little gui adjustements

This commit is contained in:
guinux 2013-07-19 16:14:09 +02:00
parent 5c15513f0b
commit 81ac1ef4ca
2 changed files with 30 additions and 33 deletions

View File

@ -247,6 +247,7 @@
</object> </object>
<object class="GtkWindow" id="ManagerWindow"> <object class="GtkWindow" id="ManagerWindow">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">2</property>
<property name="title" translatable="yes">Package Manager</property> <property name="title" translatable="yes">Package Manager</property>
<property name="window_position">center</property> <property name="window_position">center</property>
<property name="default_width">900</property> <property name="default_width">900</property>
@ -520,7 +521,6 @@
<child> <child>
<object class="GtkTreeViewColumn" id="installed_column"> <object class="GtkTreeViewColumn" id="installed_column">
<property name="resizable">True</property> <property name="resizable">True</property>
<property name="sizing">autosize</property>
<property name="title" translatable="yes">State</property> <property name="title" translatable="yes">State</property>
<property name="clickable">True</property> <property name="clickable">True</property>
<property name="sort_indicator">True</property> <property name="sort_indicator">True</property>
@ -536,7 +536,6 @@
<child> <child>
<object class="GtkTreeViewColumn" id="name_column"> <object class="GtkTreeViewColumn" id="name_column">
<property name="resizable">True</property> <property name="resizable">True</property>
<property name="sizing">autosize</property>
<property name="title" translatable="yes">Name</property> <property name="title" translatable="yes">Name</property>
<property name="clickable">True</property> <property name="clickable">True</property>
<property name="sort_indicator">True</property> <property name="sort_indicator">True</property>
@ -554,7 +553,6 @@
<child> <child>
<object class="GtkTreeViewColumn" id="version_column"> <object class="GtkTreeViewColumn" id="version_column">
<property name="resizable">True</property> <property name="resizable">True</property>
<property name="sizing">autosize</property>
<property name="title" translatable="yes">Version</property> <property name="title" translatable="yes">Version</property>
<property name="clickable">True</property> <property name="clickable">True</property>
<property name="sort_indicator">True</property> <property name="sort_indicator">True</property>
@ -570,7 +568,6 @@
<child> <child>
<object class="GtkTreeViewColumn" id="size_column"> <object class="GtkTreeViewColumn" id="size_column">
<property name="resizable">True</property> <property name="resizable">True</property>
<property name="sizing">autosize</property>
<property name="title" translatable="yes">Size</property> <property name="title" translatable="yes">Size</property>
<property name="clickable">True</property> <property name="clickable">True</property>
<property name="sort_indicator">True</property> <property name="sort_indicator">True</property>

View File

@ -16,50 +16,50 @@ _ = gettext.gettext
GObject.threads_init() GObject.threads_init()
icon = ''
info = ''
update_icon = 'software-update-available' update_icon = 'software-update-available'
update_info = _('{number} available updates') update_info = _('{number} available updates')
one_update_info = _('1 available update') one_update_info = _('1 available update')
noupdate_icon = '' noupdate_icon = ''
noupdate_info = _('Your system is up-to-date') noupdate_info = _('Your system is up-to-date')
icon = noupdate_icon
info = noupdate_info
class Tray: class Tray:
def __init__(self): def __init__(self):
self.statusIcon = Gtk.StatusIcon() self.statusIcon = Gtk.StatusIcon()
#~ self.menu = Gtk.Menu() self.menu = Gtk.Menu()
#~ self.menuItem = Gtk.ImageMenuItem(_('Install/Check for updates')) self.menuItem = Gtk.ImageMenuItem(_('Update Manager'))
#~ self.menuItem.set_image(Gtk.Image.new_from_pixbuf(Gtk.IconTheme.get_default().load_icon('system-software-update', 16, 0))) self.menuItem.set_image(Gtk.Image.new_from_pixbuf(Gtk.IconTheme.get_default().load_icon('system-software-update', 16, 0)))
#~ self.menuItem.connect('activate', self.execute_update, self.statusIcon) self.menuItem.connect('activate', self.execute_update, self.statusIcon)
#~ self.menu.append(self.menuItem) self.menu.append(self.menuItem)
#~ self.menuItem = Gtk.ImageMenuItem(_('Manage packages')) self.menuItem = Gtk.ImageMenuItem(_('Package Manager'))
#~ self.menuItem.set_image(Gtk.Image.new_from_pixbuf(Gtk.IconTheme.get_default().load_icon('system-software-install', 16, 0))) self.menuItem.set_image(Gtk.Image.new_from_pixbuf(Gtk.IconTheme.get_default().load_icon('system-software-install', 16, 0)))
#~ self.menuItem.connect('activate', self.execute_manager, self.statusIcon) self.menuItem.connect('activate', self.execute_manager, self.statusIcon)
#~ self.menu.append(self.menuItem) self.menu.append(self.menuItem)
#~ self.menuItem = Gtk.ImageMenuItem(_('Quit')) self.menuItem = Gtk.ImageMenuItem(_('Quit'))
#~ self.menuItem.set_image(Gtk.Image.new_from_stock('gtk-quit', Gtk.IconSize.MENU)) self.menuItem.set_image(Gtk.Image.new_from_stock('gtk-quit', Gtk.IconSize.MENU))
#~ self.menuItem.connect('activate', self.quit_tray, self.statusIcon) self.menuItem.connect('activate', self.quit_tray, self.statusIcon)
#~ self.menu.append(self.menuItem) self.menu.append(self.menuItem)
#~ self.statusIcon.connect('popup-menu', self.popup_menu_cb, self.menu) self.statusIcon.connect('popup-menu', self.popup_menu_cb, self.menu)
self.statusIcon.connect('activate', self.activate_cb)#, self.menu) self.statusIcon.connect('activate', self.activate_cb)
#~ def execute_update(self, widget, event, data = None): def execute_update(self, widget, event, data = None):
#~ Popen(['/usr/bin/pamac-updater']) Popen(['/usr/bin/pamac-updater'])
#~ def execute_manager(self, widget, event, data = None): def execute_manager(self, widget, event, data = None):
#~ Popen(['/usr/bin/pamac-manager']) Popen(['/usr/bin/pamac-manager'])
#~ def quit_tray(self, widget, data = None): def quit_tray(self, widget, data = None):
#~ t.shutdown() t.shutdown()
#~ Gtk.main_quit() Gtk.main_quit()
#~ def popup_menu_cb(self, widget, button, time, data = None): def popup_menu_cb(self, widget, button, time, data = None):
#~ if button == 3: if button == 3:
#~ if data: if data:
#~ data.show_all() data.show_all()
#~ data.popup(None, None, Gtk.StatusIcon.position_menu, self.statusIcon, 3, time) data.popup(None, None, Gtk.StatusIcon.position_menu, self.statusIcon, 3, time)
def activate_cb(self, widget, data = None): def activate_cb(self, widget, data = None):
if icon == update_icon: if icon == update_icon: