some esthetic improvements

This commit is contained in:
guinux 2013-03-02 15:27:52 +01:00
parent e2e90eca22
commit 3aa7b124a0
3 changed files with 9 additions and 9 deletions

View File

@ -633,6 +633,7 @@
<property name="icon">/usr/share/pamac/icons/22x22/status/setup.png</property> <property name="icon">/usr/share/pamac/icons/22x22/status/setup.png</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<property name="deletable">False</property> <property name="deletable">False</property>
<property name="transient_for">ManagerWindow</property>
<property name="has_resize_grip">False</property> <property name="has_resize_grip">False</property>
<child> <child>
<object class="GtkBox" id="box8"> <object class="GtkBox" id="box8">

View File

@ -92,13 +92,14 @@ class PamacDBusService(dbus.service.Object):
elif ID is 26: elif ID is 26:
self.action = 'Configuring...' self.action = 'Configuring...'
self.icon = '/usr/share/pamac/icons/24x24/status/setup.png' self.icon = '/usr/share/pamac/icons/24x24/status/setup.png'
self.EmitPercent(str(2))
print('Configuring a package') print('Configuring a package')
elif ID is 27: elif ID is 27:
print('Downloading a file') print('Downloading a file')
else : else :
self.action = '' self.action = ''
self.EmitTarget('') #self.EmitTarget('')
self.EmitPercent(str(0)) #self.EmitPercent(str(0))
self.EmitAction(self.action) self.EmitAction(self.action)
self.EmitIcon(self.icon) self.EmitIcon(self.icon)
print(ID,event) print(ID,event)
@ -139,15 +140,12 @@ class PamacDBusService(dbus.service.Object):
self.already_transferred += size self.already_transferred += size
self.action = 'Downloading '+common.format_size(self.total_size) self.action = 'Downloading '+common.format_size(self.total_size)
self.target = _target self.target = _target
if fraction > 1: self.percent = fraction
self.percent = 0
else:
self.percent = fraction
self.icon = '/usr/share/pamac/icons/24x24/status/package-download.png' self.icon = '/usr/share/pamac/icons/24x24/status/package-download.png'
else: else:
self.action = 'Refreshing...' self.action = 'Refreshing...'
self.target = _target self.target = _target
self.percent = 0 self.percent = 2
self.icon = '/usr/share/pamac/icons/24x24/status/refresh-cache.png' self.icon = '/usr/share/pamac/icons/24x24/status/refresh-cache.png'
self.EmitAction(self.action) self.EmitAction(self.action)
self.EmitIcon(self.icon) self.EmitIcon(self.icon)

View File

@ -47,7 +47,8 @@ update_listore = interface.get_object('update_list')
update_label = interface.get_object('update_label') update_label = interface.get_object('update_label')
def action_signal_handler(action): def action_signal_handler(action):
progress_label.set_text(action) if action:
progress_label.set_text(action)
#if 'Downloading' in action: #if 'Downloading' in action:
# print('cancel enabled') # print('cancel enabled')
# ProgressCancelButton.set_visible(True) # ProgressCancelButton.set_visible(True)
@ -62,7 +63,7 @@ def target_signal_handler(target):
progress_bar.set_text(target) progress_bar.set_text(target)
def percent_signal_handler(percent): def percent_signal_handler(percent):
if percent == '0': if float(percent) > 1:
progress_bar.pulse() progress_bar.pulse()
else: else:
progress_bar.set_fraction(float(percent)) progress_bar.set_fraction(float(percent))