[GTKUI] Default Plugin statusbar items to the end on startup

This commit is contained in:
Calum Lind 2015-09-07 09:22:51 +01:00
parent 0a10c8f3bf
commit e75e65b2c1

View File

@ -149,22 +149,22 @@ class StatusBar(component.Component):
self.connections_item = self.add_item( self.connections_item = self.add_item(
stock=gtk.STOCK_NETWORK, stock=gtk.STOCK_NETWORK,
callback=self._on_connection_item_clicked, callback=self._on_connection_item_clicked,
tooltip=_("Connections")) tooltip=_("Connections"), pack_start=True)
self.download_item = self.add_item( self.download_item = self.add_item(
image=deluge.common.get_pixmap("downloading16.png"), image=deluge.common.get_pixmap("downloading16.png"),
callback=self._on_download_item_clicked, callback=self._on_download_item_clicked,
tooltip=_("Download Speed")) tooltip=_("Download Speed"), pack_start=True)
self.upload_item = self.add_item( self.upload_item = self.add_item(
image=deluge.common.get_pixmap("seeding16.png"), image=deluge.common.get_pixmap("seeding16.png"),
callback=self._on_upload_item_clicked, callback=self._on_upload_item_clicked,
tooltip=_("Upload Speed")) tooltip=_("Upload Speed"), pack_start=True)
self.traffic_item = self.add_item( self.traffic_item = self.add_item(
image=deluge.common.get_pixmap("traffic16.png"), image=deluge.common.get_pixmap("traffic16.png"),
callback=self._on_traffic_item_clicked, callback=self._on_traffic_item_clicked,
tooltip=_("Protocol Traffic Download/Upload")) tooltip=_("Protocol Traffic Download/Upload"), pack_start=True)
self.dht_item = StatusBarItem( self.dht_item = StatusBarItem(
image=deluge.common.get_pixmap("dht16.png"), tooltip=_("DHT Nodes")) image=deluge.common.get_pixmap("dht16.png"), tooltip=_("DHT Nodes"))
@ -172,12 +172,12 @@ class StatusBar(component.Component):
self.diskspace_item = self.add_item( self.diskspace_item = self.add_item(
stock=gtk.STOCK_HARDDISK, stock=gtk.STOCK_HARDDISK,
callback=self._on_diskspace_item_clicked, callback=self._on_diskspace_item_clicked,
tooltip=_("Free Disk Space")) tooltip=_("Free Disk Space"), pack_start=True)
self.health_item = self.add_item( self.health_item = self.add_item(
stock=gtk.STOCK_DIALOG_ERROR, stock=gtk.STOCK_DIALOG_ERROR,
text=_("No Incoming Connections!"), text=_("No Incoming Connections!"),
callback=self._on_health_icon_clicked) callback=self._on_health_icon_clicked, pack_start=True)
self.health = False self.health = False
@ -217,11 +217,14 @@ class StatusBar(component.Component):
self.hbox.pack_start( self.hbox.pack_start(
self.not_connected_item.get_eventbox(), expand=False, fill=False) self.not_connected_item.get_eventbox(), expand=False, fill=False)
def add_item(self, image=None, stock=None, text=None, callback=None, tooltip=None): def add_item(self, image=None, stock=None, text=None, callback=None, tooltip=None, pack_start=False):
"""Adds an item to the status bar""" """Adds an item to the status bar"""
# The return tuple.. we return whatever widgets we add # The return tuple.. we return whatever widgets we add
item = StatusBarItem(image, stock, text, callback, tooltip) item = StatusBarItem(image, stock, text, callback, tooltip)
self.hbox.pack_start(item.get_eventbox(), expand=False, fill=False) if pack_start:
self.hbox.pack_start(item.get_eventbox(), expand=False, fill=False)
else:
self.hbox.pack_end(item.get_eventbox(), expand=False, fill=False)
return item return item
def remove_item(self, item): def remove_item(self, item):