[gevice] add call to window maintainers



commit 08f9ca5da69830730668a5ce9bf7ad850907a51e
Author: Alejandro Valdes Jimenez <avaldes lenny utalca cl>
Date:   Tue May 12 18:15:19 2009 -0400

    add call to window maintainers
---
 src/gevice.py |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/gevice.py b/src/gevice.py
index 079c0d2..3f570e6 100755
--- a/src/gevice.py
+++ b/src/gevice.py
@@ -72,6 +72,7 @@ UI = '''<ui>
       <menuitem action="Mark"/>
       <menuitem action="TypeOfLink"/>
       <menuitem action="TypeOfDev"/>
+      <menuitem action="Model"/>
     </menu>
     <menu action="ActionsMenu">
       <menuitem action="AddDevice"/>
@@ -177,6 +178,7 @@ class Gevice:
             ('Mark', gtk.STOCK_EDIT, _('Mark'),None, _('Mark'), self.on_action_mark),
             ('TypeOfLink', gtk.STOCK_EDIT, _('Type of link'),None, _('Type of Link'), self.on_action_typeoflink),
             ('TypeOfDev', gtk.STOCK_EDIT, _('Type of device'),None, _('Type of device'), self.on_action_typeofdev),
+            ('Model', gtk.STOCK_EDIT, _('Model of device'),None, _('Model of dvice'), self.on_action_model),            
         ])
 
         self.actiongroup_window.add_toggle_actions([
@@ -364,6 +366,25 @@ class Gevice:
 
         return button
 
+    def on_action_model (gevice,action):
+        sql_select = "select modelo.id_modelo,tipo_disp.nom_tipo_disp || ' ' || marca.nom_marca,modelo.nom_modelo "
+        sql_select = sql_select + "from modelo inner join marca on modelo.id_marca = marca.id_marca inner join tipo_disp "
+        sql_select = sql_select + "on modelo.id_tipo_disp = tipo_disp.id_tipo_disp order by 2;"
+        
+        sql = {"select":sql_select,
+        "update1":"update modelo set nom_modelo=",
+        "update2":" where id_modelo=",
+        "delete":"delete from modelo where id_modelo=",
+        "max_id":"select max(id_modelo) + 1 from modelo;",
+        "insert":"insert into modelo values "}
+        dialogmaintainer = gevicemaintainer.GeviceMaintainer ()
+        dialogmaintainer.load_interface1 (gevice,_("Model of device"),sql)
+        dialogmaintainer.load_data1 (gevice,sql)
+        dialogmaintainer.show_interface ()
+
+
+        
+
     def on_action_mark (gevice,action):
         sql = {"select":"select * from marca order by 1",
         "insert":"insert into marca values ",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]