[gevice] update functions called por GtkAction



commit 8fed1587b742a082934d6e5420b8125bbe44eb03
Author: Alejandro Valdes Jimenez <avaldes gnome org>
Date:   Mon Nov 21 09:16:29 2011 -0300

    update functions called por GtkAction

 ChangeLog        |    4 +++
 src/gevice.py    |   50 ++++++++++++++++++++--------------------
 src/gevicevte.py |   66 +++++++++++++++++++++++++++--------------------------
 3 files changed, 63 insertions(+), 57 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b0434ba..e31abdb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-11-21  Alejandro Valdes Jimenez  <avaldes gnome org>
+	* src/gevice.py: update functions called por GtkAction
+	* src/gevicevte.py: Disable set bgcolor and textcolor. (FIX)
+
 2011-11-17  Alejandro Valdes Jimenez  <avaldes gnome org>
 	* data/ui/main.xml: change dimension of main windows.
 	* src/gevice.py: add combox_geometry for selecting geometry display connection with VNC and RDP protocol.
diff --git a/src/gevice.py b/src/gevice.py
index d9be790..b87baeb 100755
--- a/src/gevice.py
+++ b/src/gevice.py
@@ -460,7 +460,7 @@ class Gevice:
     
     return button
 
-  def on_action_ndbase(gevice,action,data):
+  def on_action_ndbase(gevice,action):
     filechooser = Gtk.FileChooserDialog(title=_("New Database"), 
       parent=gevice.window_main, 
       action=Gtk.FileChooserAction.SAVE, 
@@ -485,7 +485,7 @@ class Gevice:
 
     filechooser.destroy()
 
-  def on_action_model (gevice,action,data):
+  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;"
@@ -504,7 +504,7 @@ class Gevice:
     dialogmaintainer.load_data1 (gevice,sql)
     dialogmaintainer.show_interface ()
       
-  def on_action_location (gevice,action,data):
+  def on_action_location (gevice,action):
     sql_select = "select rack.id_rack,'[' || campus.nom_campus || '][' || edificio.nom_edif || '][' || nivel.nom_nivel || ']',rack.detalle "
     sql_select = sql_select + "from rack inner join nivel on rack.id_nivel = nivel.id_nivel "
     sql_select = sql_select + "inner join edificio on rack.id_edif = edificio.id_edif "
@@ -524,7 +524,7 @@ class Gevice:
     dialogmaintainer.load_data1 (gevice,sql)
     dialogmaintainer.show_interface ()
     
-  def on_action_edifice (gevice,action,data):
+  def on_action_edifice (gevice,action):
     sql_select = "select edificio.id_edif, campus.nom_campus, edificio.nom_edif "
     sql_select = sql_select + "from edificio inner join campus on edificio.id_campus = campus.id_campus "
     sql_select = sql_select +  "order by 2,3"
@@ -544,7 +544,7 @@ class Gevice:
     dialogmaintainer.load_data1 (gevice,sql)
     dialogmaintainer.show_interface ()
     
-  def on_action_level (gevice,action,data):
+  def on_action_level (gevice,action):
     sql = {"select":"select * from nivel order by 1",
       "insert":"insert into nivel (id_nivel, nom_nivel) values ",
       "delete":"delete from nivel where id_nivel=",
@@ -557,7 +557,7 @@ class Gevice:
     dialogmaintainer.load_data (gevice,sql)
     dialogmaintainer.show_interface ()
     
-  def on_action_campus (gevice,action,data):
+  def on_action_campus (gevice,action):
     sql = {"select":"select * from campus order by 1",
       "insert":"insert into campus (id_campus, nom_campus) values ",
       "delete":"delete from campus where id_campus=",
@@ -570,7 +570,7 @@ class Gevice:
     dialogmaintainer.load_data (gevice,sql)
     dialogmaintainer.show_interface ()
   
-  def on_action_mark (gevice,action,data):
+  def on_action_mark (gevice,action):
     sql = {"select":"select * from marca order by 1",
       "insert":"insert into marca (id_marca, nom_marca) values ",
       "delete":"delete from marca where id_marca=",
@@ -583,7 +583,7 @@ class Gevice:
     dialogmaintainer.load_data (gevice,sql) 
     dialogmaintainer.show_interface ()
     
-  def on_action_typeofdev (gevice,action,data):
+  def on_action_typeofdev (gevice,action):
     sql = {"select":"select * from tipo_disp order by 1",
       "insert":"insert into tipo_disp (id_tipo_disp, nom_tipo_disp) values ",
       "delete":"delete from tipo_disp where id_tipo_disp=",
@@ -596,7 +596,7 @@ class Gevice:
     dialogmaintainer.load_data (gevice,sql)
     dialogmaintainer.show_interface ()
   
-  def on_action_typeoflink (gevice,action,data):
+  def on_action_typeoflink (gevice,action):
     sql = {"select":"select * from tipo_enlace order by 1",
       "insert":"insert into tipo_enlace (id_tipo_enlace, nom_tipo_enlace) values ",
       "delete":"delete from tipo_enlace where id_tipo_enlace=",
@@ -609,7 +609,7 @@ class Gevice:
     dialogmaintainer.load_data (gevice,sql)
     dialogmaintainer.show_interface ()
   
-  def on_action_export (gevice,action,data):
+  def on_action_export (gevice,action):
     dialogexport = geviceexport.GeviceExport ()
     dialogexport.load_interface (gevice)
     dialogexport.save_file (gevice)
@@ -617,23 +617,23 @@ class Gevice:
   def on_delete_event (self,data1=None,data2=None):
     Gtk.main_quit()
   
-  def on_action_about (self,action,data):
+  def on_action_about (self,action):
     self.create_about_dialog()
     
-  def on_action_quit (self,action,data):
+  def on_action_quit (self,action):
     self.on_delete_event ()
     
-  def on_action_preferences (gevice,action,data):
+  def on_action_preferences (gevice,action):
     gevice.gpref.load_preferences(gevice)
     gevice.gpref.load_interface(gevice)
     gevice.gpref.show_interface()
   
-  def on_action_find (gevice,action,data):
+  def on_action_find (gevice,action):
     gevice.gevicefind = gevicefind.GeviceFind ()
     gevice.gevicefind.load_interface(gevice)
     gevice.gevicefind.show_interface()
     
-  def on_action_diagram (gevice,action,data):
+  def on_action_diagram (gevice,action):
     i = gevice.gmodel.get_iter_selected(gevice.gmodel.treeview)
     
     #check if the user have selected some device
@@ -650,29 +650,29 @@ class Gevice:
     gprint.load_interface(gevice)
     gprint.show_interface()
     
-  def on_action_expand (gevice,action,data):
+  def on_action_expand (gevice,action):
     gevice.gmodel.expand_treeview (True)
     
-  def on_action_decrease (gevice,action,data):
+  def on_action_decrease (gevice,action):
     gevice.gmodel.expand_treeview (False)
     
-  def on_action_adddevice (gevice,action,data):
+  def on_action_adddevice (gevice,action):
     gevice.gdevice = gevicedevice.GeviceDevice ()
     gevice.gdevice.load_interface (gevice)
     gevice.gdevice.add_device()
     gevice.gdevice.show_interface ()
     
-  def on_action_removedevice (gevice,action,data):
+  def on_action_removedevice (gevice,action):
     gevice.gdevice = gevicedevice.GeviceDevice ()
     gevice.gdevice.remove_device(gevice)
     
-  def on_action_editdevice (gevice,action,data):
+  def on_action_editdevice (gevice,action):
     gevice.gdevice = gevicedevice.GeviceDevice ()
     gevice.gdevice.load_interface (gevice)
     gevice.gdevice.modify_device(gevice)
     gevice.gdevice.show_interface ()
     
-  def on_action_open (gevice,action,data):
+  def on_action_open (gevice,action):
     if (not gevice.connected_to_database):    
       filechooser = Gtk.FileChooserDialog(title=_("Open Database"), 
         parent=gevice.window_main, 
@@ -713,12 +713,12 @@ class Gevice:
       
       gevice.update_statusbar("")
     
-  def on_action_save (gevice,action,data):
+  def on_action_save (gevice,action):
     gevice.gdbase.save_data_to_database(gevice)
     result = gevice.show_infobar_message (_("Model saved"),
       Gtk.MessageType.INFO)
     
-  def on_action_connect(self,action,data):
+  def on_action_connect(self,action):
     flag = True
     proto = self.get_protocol_selected()
     
@@ -730,13 +730,13 @@ class Gevice:
   def on_action_open_local_terminal(self,action):
     self.connect_to_device(True)
    
-  def on_toggle_tree (gevice,action,data):
+  def on_toggle_tree (gevice,action):
     if (action.get_active() == True):
       gevice.vboxtreeview.show()
     else:
       gevice.vboxtreeview.hide ()
   
-  def on_toggle_terminal (gevice,action,data):
+  def on_toggle_terminal (gevice,action):
     if (action.get_active() == True):
       gevice.vboxterminal.show()
     else:
diff --git a/src/gevicevte.py b/src/gevicevte.py
index 5a7a448..82fe64f 100644
--- a/src/gevicevte.py
+++ b/src/gevicevte.py
@@ -9,38 +9,40 @@ gettext.bind_textdomain_codeset (config.PACKAGE, "UTF-8");
 from gettext import gettext as _
 
 class GeviceVte:
-    def __init__ (self):
-        pass
+  def __init__ (self):
+    pass
 
-    def the_focus (self,widget,event,terminal):
-        if (event.type==Gdk.EventType.ENTER_NOTIFY):
-            terminal.grab_focus()
+  def the_focus (self,widget,event,terminal):
+    if (event.type==Gdk.EventType.ENTER_NOTIFY):
+      terminal.grab_focus()
+
+  def new_terminal (self,gevice):       
+    hbox_term = Gtk.HBox(homogeneous=False,spacing=0)
+
+    terminal = Vte.Terminal()
+    terminal.set_mouse_autohide(True)       
+    terminal.set_default_colors()
+
+    ###status,bgcolor = Gdk.color_parse(gevice.gpref.backcolor)
+    ### ERROR: TypeError: 'Color' object is not iterable
+    ###terminal.set_color_background(bgcolor)
+    
+    ###status,fgcolor = Gdk.color_parse(gevice.gpref.forecolor)
+    ###terminal.set_color_foreground(fgcolor)
     
+    terminal.set_size_request(10,10)
+    terminal.set_size (30,1)
+    terminal.set_mouse_autohide (True)    
+
+    # capture word limited for characters when double click
+    terminal.set_word_chars("-A-Za-z0-9,./?%&#:_")
+
+    terminal.connect('event',self.the_focus,terminal)
+
+    adj = terminal.get_vadjustment()
+    scroll = Gtk.VScrollbar.new(adj)
+
+    hbox_term.pack_start(terminal,True,True,0)
+    hbox_term.pack_start(scroll,False,False,0)
 
-    def new_terminal (self,gevice):       
-        hbox_term = Gtk.HBox(homogeneous=False,spacing=0)
-         
-        terminal = Vte.Terminal()
-        terminal.set_mouse_autohide(True)       
-        terminal.set_default_colors()
-	status,bgcolor = Gdk.color_parse(gevice.gpref.backcolor)
-	terminal.set_color_background(bgcolor)
-	status,fgcolor = Gdk.color_parse(gevice.gpref.forecolor)
-        terminal.set_color_foreground(fgcolor)
-        terminal.set_size_request(10,10)
-        terminal.set_size (30,1)
-        terminal.set_mouse_autohide (True)    
-
-        # capture word limited for characters when double click
-        terminal.set_word_chars("-A-Za-z0-9,./?%&#:_")
-        
-        terminal.connect('event',self.the_focus,terminal)
-        ###terminal.connect('button_press_event',self.button_press)
-       
-	adj = terminal.get_vadjustment()
-	scroll = Gtk.VScrollbar.new(adj)
-        
-        hbox_term.pack_start(terminal,True,True,0)
-        hbox_term.pack_start(scroll,False,False,0)
-        
-        return hbox_term,terminal
+    return hbox_term,terminal



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