[gedit/wip/redesign2] external tools: fix manager to not use GtkActions



commit d772ace84e49180f53f86bec2efd3206851f3706
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Fri Jan 3 11:26:11 2014 +0100

    external tools: fix manager to not use GtkActions

 plugins/externaltools/tools/manager.py |   14 +++++++-------
 plugins/externaltools/tools/tools.ui   |   27 +++------------------------
 2 files changed, 10 insertions(+), 31 deletions(-)
---
diff --git a/plugins/externaltools/tools/manager.py b/plugins/externaltools/tools/manager.py
index a654172..56406bc 100644
--- a/plugins/externaltools/tools/manager.py
+++ b/plugins/externaltools/tools/manager.py
@@ -299,8 +299,8 @@ class Manager(GObject.Object):
 
     def build(self):
         callbacks = {
-            'on_action_add_tool_activated'    : self.on_action_add_tool_activated,
-            'on_action_remove_tool_activated' : self.on_action_remove_tool_activated,
+            'on_add_tool_button_clicked'    : self.on_add_tool_button_clicked,
+            'on_remove_tool_button_clicked' : self.on_remove_tool_button_clicked,
             'on_tool_manager_dialog_response' : self.on_tool_manager_dialog_response,
             'on_tool_manager_dialog_focus_out': self.on_tool_manager_dialog_focus_out,
             'on_tool_manager_dialog_configure_event': self.on_tool_manager_dialog_configure_event,
@@ -629,8 +629,8 @@ class Manager(GObject.Object):
 
         removable = node is not None and node.is_local()
 
-        self['remove-tool-action'].set_sensitive(removable)
-        self['revert-tool-action'].set_sensitive(removable)
+        self['remove-tool-button'].set_sensitive(removable)
+        self['revert-tool-button'].set_sensitive(removable)
 
         if node is not None and node.is_global():
             self['remove-tool-button'].hide()
@@ -675,7 +675,7 @@ class Manager(GObject.Object):
 
         return self.language_id_from_iter(piter)
 
-    def on_action_add_tool_activated(self, action):
+    def on_add_tool_button_clicked(self, button):
         self.save_current_tool()
 
         # block handlers while inserting a new item
@@ -707,7 +707,7 @@ class Manager(GObject.Object):
 
         self.update_remove_revert()
 
-    def on_action_remove_tool_activated(self, action):
+    def on_remove_tool_button_clicked(self, button):
         piter, node = self.get_selected_tool()
 
         if not node:
@@ -720,7 +720,7 @@ class Manager(GObject.Object):
                 self.remove_accelerator(node, shortcut)
                 self.add_accelerator(node)
 
-                self['revert-tool-action'].set_sensitive(False)
+                self['revert-tool-button'].set_sensitive(False)
                 self.fill_fields()
 
                 self.tool_changed(node)
diff --git a/plugins/externaltools/tools/tools.ui b/plugins/externaltools/tools/tools.ui
index a77bfb3..1a91753 100644
--- a/plugins/externaltools/tools/tools.ui
+++ b/plugins/externaltools/tools/tools.ui
@@ -1,9 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkAction" id="add-tool-action">
-    <signal name="activate" handler="on_action_add_tool_activated" swapped="no"/>
-  </object>
   <object class="GtkListStore" id="model_applicability">
     <columns>
       <!-- column-name gchararray -->
@@ -132,12 +129,6 @@
       </row>
     </data>
   </object>
-  <object class="GtkAction" id="remove-tool-action">
-    <signal name="activate" handler="on_action_remove_tool_activated" swapped="no"/>
-  </object>
-  <object class="GtkAction" id="revert-tool-action">
-    <signal name="activate" handler="on_action_remove_tool_activated" swapped="no"/>
-  </object>
   <object class="GeditDocument" id="commands_buffer"/>
   <object class="GtkDialog" id="tool-manager-dialog">
     <property name="can_focus">False</property>
@@ -164,7 +155,6 @@
             <child>
               <object class="GtkButton" id="button1">
                 <property name="label">gtk-help</property>
-                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
@@ -181,7 +171,6 @@
             <child>
               <object class="GtkButton" id="button2">
                 <property name="label">gtk-close</property>
-                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
@@ -279,16 +268,13 @@
                     </style>
                     <child>
                       <object class="GtkToolButton" id="add-tool-button">
-                        <property name="use_action_appearance">False</property>
-                        <property name="related_action">add-tool-action</property>
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="tooltip_text" translatable="yes">Add a new tool</property>
-                        <property name="related_action">add-tool-action</property>
-                        <property name="use_action_appearance">False</property>
                         <property name="label" translatable="yes">Add Tool</property>
                         <property name="use_underline">True</property>
                         <property name="icon_name">list-add-symbolic</property>
+                        <signal name="clicked" handler="on_add_tool_button_clicked" swapped="no"/>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -297,16 +283,13 @@
                     </child>
                     <child>
                       <object class="GtkToolButton" id="remove-tool-button">
-                        <property name="use_action_appearance">False</property>
-                        <property name="related_action">remove-tool-action</property>
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="tooltip_text" translatable="yes">Remove selected tool</property>
-                        <property name="related_action">remove-tool-action</property>
-                        <property name="use_action_appearance">False</property>
                         <property name="label" translatable="yes">Remove Tool</property>
                         <property name="use_underline">True</property>
                         <property name="icon_name">list-remove-symbolic</property>
+                        <signal name="clicked" handler="on_remove_tool_button_clicked" swapped="no"/>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -315,16 +298,13 @@
                     </child>
                     <child>
                       <object class="GtkToolButton" id="revert-tool-button">
-                        <property name="use_action_appearance">False</property>
-                        <property name="related_action">revert-tool-action</property>
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="tooltip_text" translatable="yes">Revert tool</property>
-                        <property name="related_action">revert-tool-action</property>
-                        <property name="use_action_appearance">False</property>
                         <property name="label" translatable="yes">Revert Tool</property>
                         <property name="use_underline">True</property>
                         <property name="icon_name">edit-undo-symbolic</property>
+                        <signal name="clicked" handler="on_remove_tool_button_clicked" swapped="no"/>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -431,7 +411,6 @@
                                 <property name="can_focus">False</property>
                                 <child>
                                   <object class="GtkButton" id="languages_button">
-                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
                                     <property name="receives_default">False</property>


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