[gevice/gevice-2-0] remove Action 'Refresh'



commit 69bdd41d02d9b71ab3b98e6eb7530ca74245988f
Author: Alejandro Valdes Jimenez <avaldes gnome org>
Date:   Thu Nov 3 11:22:38 2011 -0300

    remove Action 'Refresh'

 ChangeLog        |    4 ++++
 data/ui/menu.xml |    3 +--
 src/gevice.py    |   33 ++++++++++++++++-----------------
 3 files changed, 21 insertions(+), 19 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8db7481..eb10a40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-11-03  Alejandro Valdes Jimenez  <avaldes gnome org>
+	* data/ui/menu.xml: remove Action "Refresh"
+	* src/gevice.py: remove Action "Refresh"
+
 2011-10-29  Alejandro Valdes Jimenez  <avaldes gnome org>
 	* data/ui/dbase.xml: remove file
 
diff --git a/data/ui/menu.xml b/data/ui/menu.xml
index 564589c..f4c71ce 100644
--- a/data/ui/menu.xml
+++ b/data/ui/menu.xml
@@ -2,8 +2,8 @@
   <menubar name="MainMenu">
     <menu action="FileMenu">
       <menuitem action="Open"/>
-      <menuitem action="Refresh"/>      
       <menuitem action="Save"/>
+      <menuitem action="Nbase"/>      
       <separator/>
       <menuitem action="Export"/>
       <menuitem action="Diagram"/>
@@ -44,7 +44,6 @@
   <toolbar name="MainToolbar">
     <placeholder name="placeholder1">
       <toolitem action="Open" />
-      <toolitem action="Refresh" />      
       <toolitem action="Save" />
       <separator/>
       <toolitem action="AddDevice" />
diff --git a/src/gevice.py b/src/gevice.py
index 865c68f..65a8bb4 100755
--- a/src/gevice.py
+++ b/src/gevice.py
@@ -110,8 +110,8 @@ class Gevice:
     # create toolitem for combobox for SSH user session
     separator_user = Gtk.SeparatorToolItem()
     self.toolitem_user = Gtk.ToolItem()
-    self.maintoolbar.insert(separator_user,11)
-    self.maintoolbar.insert(self.toolitem_user,12)
+    self.maintoolbar.insert(separator_user,10)
+    self.maintoolbar.insert(self.toolitem_user,11)
     
     # create combobox_user
     self.vboxcombo = Gtk.VBox(homogeneous=False,spacing=0)
@@ -126,8 +126,8 @@ class Gevice:
     # create toolitem for combobox protocol
     separator_user = Gtk.SeparatorToolItem()
     self.toolitem_proto = Gtk.ToolItem()
-    self.maintoolbar.insert(separator_user,13)
-    self.maintoolbar.insert(self.toolitem_proto,14)
+    self.maintoolbar.insert(separator_user,12)
+    self.maintoolbar.insert(self.toolitem_proto,13)
     
     # create combobox_proto
     self.vboxproto = Gtk.VBox(homogeneous=False,spacing=0)
@@ -191,8 +191,10 @@ class Gevice:
     # add the accelerator group to the toplevel window
     self.accelgroup = self.uimanager.get_accel_group()
     self.window_main.add_accel_group (self.accelgroup)
-    self.actiongroup_window.add_toggle_actions([('Dual', Gtk.STOCK_NETWORK, '_Dual', None,_('Dual terminal'), None)])
-    
+
+    self.actiongroup_window.add_toggle_actions([
+      ('Dual', Gtk.STOCK_NETWORK, '_Dual', None,_('Dual terminal'), None)])
+
     # creat actions
     self.actiongroup_window.add_actions([
       ('FileMenu', None, _('_File')),
@@ -207,17 +209,18 @@ class Gevice:
       ('Quit', Gtk.STOCK_QUIT, _('_Quit'), None, _('Quit the program'), self.on_action_quit),
       ('Prefer', Gtk.STOCK_PREFERENCES, _('Preferences'), None, _('Setting preferences'), self.on_action_preferences),
       ('About', Gtk.STOCK_ABOUT, None, None, None, self.on_action_about),
+      ('Connect', Gtk.STOCK_JUMP_TO, _('Open terminal'), None, _('Open terminal'), self.on_action_connect),      
+      ('Nbase', None, _('New Database'),None, _('New Database'), self.on_action_ndbase),            
       ])
       
     self.actiongroup_model.add_actions([
       ('Find', Gtk.STOCK_FIND, _('Find'),None, _('Search a device'), self.on_action_find),
       ('Save', Gtk.STOCK_SAVE, _('Save'), None, _('Save model'), self.on_action_save),
-      ('Refresh', Gtk.STOCK_REFRESH, _('Refresh'), None, _('Refresh model'), self.on_action_refresh),
       ('Export', Gtk.STOCK_SELECT_ALL, _('Export all to CSV'), None, _('Export all to CSV'), self.on_action_export),
+      ('AddDevice', Gtk.STOCK_ADD, _('Add'),None, _('Add a device'), self.on_action_adddevice),      
       ])
       
     self.actiongroup_device.add_actions([
-      ('AddDevice', Gtk.STOCK_ADD, _('Add'),None, _('Add a device'), self.on_action_adddevice),
       ('RemoveDevice', Gtk.STOCK_REMOVE, _('Remove'), None, _('Remove device selected'), self.on_action_removedevice),
       ('EditDevice', Gtk.STOCK_EDIT, _('Edit'), None, _('Edit data of device selected'), self.on_action_editdevice),
       ('Expand', Gtk.STOCK_INDENT, _('Expand'), None, _('Expand tree of device selected'), self.on_action_expand),
@@ -235,11 +238,7 @@ class Gevice:
     
     self.actiongroup_window.add_toggle_actions([
       ('Tree', None, _('Tree'),None, _('Show tree'), self.on_toggle_tree, True),
-      ('Terminal', None, _('Terminal'),None, _('Show terminal'), self.on_toggle_terminal, True)
-      ])
-
-    self.actiongroup_window.add_actions([
-      ('Connect', Gtk.STOCK_JUMP_TO, _('Open terminal'), None, _('Open terminal'), self.on_action_connect),
+      ('Terminal', None, _('Terminal'),None, _('Show terminal'), self.on_toggle_terminal, True),
       ])
     
     self.actiongroup_model.set_sensitive (False)
@@ -394,6 +393,9 @@ class Gevice:
     button.set_sensitive (sensitive)
     
     return button
+
+  def on_action_ndbase(gevice,action,data):
+    pass
     
   def on_action_model (gevice,action,data):
     sql_select = "select modelo.id_modelo,tipo_disp.nom_tipo_disp || ' ' || marca.nom_marca,modelo.nom_modelo "
@@ -523,10 +525,6 @@ class Gevice:
     dialogexport = geviceexport.GeviceExport ()
     dialogexport.load_interface (gevice)
     dialogexport.save_file (gevice)
-  
-  def on_action_refresh (gevice,action,data):
-    gevice.gdbase.cur = gevice.gdbase.conn.cursor()
-    gevice.gdbase.load_data_from_database(gevice)
     
   def on_delete_event (self,data1=None,data2=None):
     Gtk.main_quit()
@@ -607,6 +605,7 @@ class Gevice:
         if s == gevice.magic:
           gevice.gdbase = gevicedatabase.GeviceDatabase (dbsqlite,gevice)
           gevice.update_statusbar (dbsqlite)
+          gevice.actiongroup_device.set_sensitive (False)
         else:
           result = gevice.show_infobar_message (_("Seems not sqlite3: " + dbsqlite), 
             Gtk.MessageType.ERROR)



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