[meld] Remove statusbar from everywhere except file comparison



commit 1030aedf68139f44d4b0bb30294f4d569ff58f6c
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Wed Dec 18 06:48:28 2013 +1000

    Remove statusbar from everywhere except file comparison
    
    This commit also removes the hooks for showing detailed messages on
    menu item hover; while handy these aren't present anywhere in modern
    GTK 3 apps.
    
    Also, this makes the statusbar always appear in file comparison mode.

 data/ui/filediff.ui    |   11 ++++++++++
 data/ui/meldapp-ui.xml |    1 -
 data/ui/meldapp.ui     |   15 +------------
 meld/filediff.py       |    1 +
 meld/melddoc.py        |    4 ---
 meld/meldwindow.py     |   51 ------------------------------------------------
 6 files changed, 14 insertions(+), 69 deletions(-)
---
diff --git a/data/ui/filediff.ui b/data/ui/filediff.ui
index 59f16f0..fa42aec 100644
--- a/data/ui/filediff.ui
+++ b/data/ui/filediff.ui
@@ -507,6 +507,17 @@
                 <property name="height">1</property>
               </packing>
             </child>
+            <child>
+              <object class="MeldStatusBar" id="statusbar">
+                <property name="visible">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">2</property>
+                <property name="width">7</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">True</property>
diff --git a/data/ui/meldapp-ui.xml b/data/ui/meldapp-ui.xml
index d987760..436745d 100644
--- a/data/ui/meldapp-ui.xml
+++ b/data/ui/meldapp-ui.xml
@@ -34,7 +34,6 @@
     </menu>
     <menu action="ViewMenu">
       <menuitem action="ToolbarVisible" />
-      <menuitem action="StatusbarVisible" />
       <menuitem action="Fullscreen" />
       <separator/>
       <placeholder name="ViewUtilityPlaceholder" />
diff --git a/data/ui/meldapp.ui b/data/ui/meldapp.ui
index 246c6fc..b06c068 100644
--- a/data/ui/meldapp.ui
+++ b/data/ui/meldapp.ui
@@ -20,18 +20,7 @@
             <property name="expand">False</property>
             <property name="fill">True</property>
             <property name="pack_type">end</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
-        <child>
-          <object class="MeldStatusBar" id="statusbar">
-            <property name="visible">True</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
+            <property name="position">1</property>
           </packing>
         </child>
         <child>
@@ -51,7 +40,7 @@
             <property name="expand">True</property>
             <property name="fill">True</property>
             <property name="pack_type">end</property>
-            <property name="position">1</property>
+            <property name="position">0</property>
           </packing>
         </child>
       </object>
diff --git a/meld/filediff.py b/meld/filediff.py
index 93f1d25..086e833 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -332,6 +332,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
         cursor_label = Gtk.Label()
         cursor_label.show()
         self.status_info_labels = [overwrite_label, cursor_label]
+        self.statusbar.set_info_box(self.status_info_labels)
 
         # Prototype implementation
 
diff --git a/meld/melddoc.py b/meld/melddoc.py
index 8de8e02..1791932 100644
--- a/meld/melddoc.py
+++ b/meld/melddoc.py
@@ -74,10 +74,6 @@ class MeldDoc(GObject.GObject):
         self.num_panes = 0
         self.label_text = _("untitled")
         self.tooltip_text = _("untitled")
-        self.status_info_labels = []
-
-    def get_info_widgets(self):
-        return self.status_info_labels
 
     def get_comparison(self):
         """Get the comparison type and path(s) being compared"""
diff --git a/meld/meldwindow.py b/meld/meldwindow.py
index 2877d1c..db7ba11 100644
--- a/meld/meldwindow.py
+++ b/meld/meldwindow.py
@@ -133,9 +133,6 @@ class MeldWindow(gnomeglade.Component):
             ("ToolbarVisible", None, _("_Toolbar"), None,
                 _("Show or hide the toolbar"),
                 None, True),
-            ("StatusbarVisible", None, _("_Statusbar"), None,
-                _("Show or hide the statusbar"),
-                None, True),
         )
         ui_file = gnomeglade.ui_file("meldapp-ui.xml")
         self.actiongroup = Gtk.ActionGroup('MainActions')
@@ -154,9 +151,6 @@ class MeldWindow(gnomeglade.Component):
         self.ui = Gtk.UIManager()
         self.ui.insert_action_group(self.actiongroup, 0)
         self.ui.add_ui_from_file(ui_file)
-        self.ui.connect("connect-proxy", self._on_uimanager_connect_proxy)
-        self.ui.connect("disconnect-proxy",
-                        self._on_uimanager_disconnect_proxy)
         self.tab_switch_actiongroup = None
         self.tab_switch_merge_id = None
 
@@ -171,13 +165,8 @@ class MeldWindow(gnomeglade.Component):
         settings.bind('toolbar-visible',
                       self.actiongroup.get_action('ToolbarVisible'), 'active',
                       Gio.SettingsBindFlags.DEFAULT)
-        settings.bind('statusbar-visible',
-                      self.actiongroup.get_action('StatusbarVisible'), 'active',
-                      Gio.SettingsBindFlags.DEFAULT)
         settings.bind('toolbar-visible', self.toolbar, 'visible',
                       Gio.SettingsBindFlags.DEFAULT)
-        settings.bind('statusbar-visible', self.statusbar, 'visible',
-                      Gio.SettingsBindFlags.DEFAULT)
         interface_settings.bind('toolbar-style', self.toolbar, 'toolbar-style',
                                 Gio.SettingsBindFlags.DEFAULT)
 
@@ -211,7 +200,6 @@ class MeldWindow(gnomeglade.Component):
         self.secondary_toolbar.set_size_request(30, -1)
         self.secondary_toolbar.show_all()
 
-        self._menu_context = self.statusbar.get_context_id("Tooltips")
         self.widget.drag_dest_set(
             Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT |
             Gtk.DestDefaults.DROP,
@@ -247,39 +235,6 @@ class MeldWindow(gnomeglade.Component):
             self.open_paths(paths)
             return True
 
-    def _on_uimanager_connect_proxy(self, ui, action, widget):
-        tooltip = action.props.tooltip
-        if not tooltip:
-            return
-        if isinstance(widget, Gtk.MenuItem):
-            cid = widget.connect(
-                "select", self._on_action_item_select_enter, tooltip)
-            cid2 = widget.connect(
-                "deselect", self._on_action_item_deselect_leave)
-            widget.proxy_signal_ids = (cid, cid2)
-        elif isinstance(widget, Gtk.ToolButton):
-            cid = widget.get_child().connect(
-                "enter", self._on_action_item_select_enter, tooltip)
-            cid2 = widget.get_child().connect(
-                "leave", self._on_action_item_deselect_leave)
-            widget.proxy_signal_ids = (cid, cid2)
-
-    def _on_uimanager_disconnect_proxy(self, ui, action, widget):
-        try:
-            cids = widget.proxy_signal_ids
-        except AttributeError:
-            return
-        if isinstance(widget, Gtk.ToolButton):
-            widget = widget.get_child()
-        for cid in cids:
-            widget.disconnect(cid)
-
-    def _on_action_item_select_enter(self, item, tooltip):
-        self.statusbar.push(self._menu_context, tooltip)
-
-    def _on_action_item_deselect_leave(self, item):
-        self.statusbar.pop(self._menu_context)
-
     def on_idle(self):
         ret = self.scheduler.iteration()
         if ret and isinstance(ret, string_types):
@@ -377,10 +332,6 @@ class MeldWindow(gnomeglade.Component):
 
         nbl = self.notebook.get_tab_label(newdoc.widget)
         self.widget.set_title(nbl.get_label_text() + " - Meld")
-        try:
-            self.statusbar.set_info_box(newdoc.get_info_widgets())
-        except AttributeError:
-            pass
         newdoc.on_container_switch_in_event(self.ui)
         if isinstance(newdoc, melddoc.MeldDoc):
             self.diff_handler = newdoc.connect("next-diff-changed",
@@ -623,8 +574,6 @@ class MeldWindow(gnomeglade.Component):
             page.connect("file-changed", self.on_file_changed)
             page.connect("create-diff", lambda obj, arg, kwargs:
                          self.append_diff(arg, **kwargs))
-            page.connect("status-changed",
-                         lambda obj, arg: self.statusbar.set_doc_status(arg))
 
         self.notebook.set_tab_reorderable(page.widget, True)
 


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