Commit 1030aedf authored by Kai Willadsen's avatar Kai Willadsen

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.
parent 1aceac7a
......@@ -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>
......
......@@ -34,7 +34,6 @@
</menu>
<menu action="ViewMenu">
<menuitem action="ToolbarVisible" />
<menuitem action="StatusbarVisible" />
<menuitem action="Fullscreen" />
<separator/>
<placeholder name="ViewUtilityPlaceholder" />
......
......@@ -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>
......
......@@ -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
......
......@@ -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"""
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment