use icons

This commit is contained in:
guinux 2012-12-26 19:25:33 +01:00
parent c82c493e8a
commit 41d81d5de1
4 changed files with 97 additions and 19 deletions

View File

@ -14,6 +14,7 @@ interface.add_from_file('/usr/share/pamac/dialogs.glade')
ProgressWindow = interface.get_object('ProgressWindow')
progress_bar = interface.get_object('progressbar2')
progress_label = interface.get_object('progresslabel2')
action_icon = interface.get_object('action_icon')
ErrorDialog = interface.get_object('ErrorDialog')
WarningDialog = interface.get_object('WarningDialog')
QuestionDialog = interface.get_object('QuestionDialog')
@ -290,18 +291,38 @@ def cb_event(ID, event, tupel):
ProgressWindow.show_all()
while Gtk.events_pending():
Gtk.main_iteration()
for i in [1,3,5,7,9,11,15]:
if ID is i:
progress_label.set_text(event)
break
else :
progress_label.set_text(' ')
if ID is 27:
progress_label.set_text('Downloading '+format_size(total_size))
print('Downloading a file')
if ID is 17:
if ID is 1:
progress_label.set_text('Checking dependencies')
action_icon.set_from_file('/usr/share/icons/hicolor/24x24/status/package-search.png')
elif ID is 3:
progress_label.set_text('Checking file conflicts')
action_icon.set_from_file('/usr/share/icons/hicolor/24x24/status/package-search.png')
elif ID is 5:
progress_label.set_text('Resolving dependencies')
action_icon.set_from_file('/usr/share/icons/hicolor/24x24/status/setup.png')
elif ID is 7:
progress_label.set_text('Checking inter conflicts')
action_icon.set_from_file('/usr/share/icons/hicolor/24x24/status/package-search.png')
elif ID is 9:
progress_label.set_text('Installing packages')
action_icon.set_from_file('/usr/share/icons/hicolor/24x24/status/package-add.png')
elif ID is 11:
progress_label.set_text('Removing packages')
action_icon.set_from_file('/usr/share/icons/hicolor/24x24/status/package-delete.png')
elif ID is 13:
progress_label.set_text('Upgrading packages')
action_icon.set_from_file('/usr/share/icons/hicolor/24x24/status/package-update.png')
elif ID is 15:
progress_label.set_text('Checking integrity')
action_icon.set_from_file('/usr/share/icons/hicolor/24x24/status/package-search.png')
elif ID is 17:
progress_label.set_text('Checking signatures')
action_icon.set_from_file('/usr/share/icons/hicolor/24x24/status/package-search.png')
print('Checking signatures')
elif ID is 27:
print('Downloading a file')
else :
progress_label.set_text('')
progress_bar.set_fraction(0.0)
progress_bar.set_text('')
print(ID,event)
@ -360,10 +381,12 @@ def cb_dl(_target, _transferred, total):
progress_label.set_text('Downloading '+format_size(total_size))
progress_bar.set_text(_target)
progress_bar.set_fraction(fraction)
action_icon.set_from_file('/usr/share/icons/hicolor/24x24/status/package-download.png')
else:
progress_label.set_text('Refreshing...')
progress_bar.set_text(_target)
progress_bar.pulse()
action_icon.set_from_file('/usr/share/icons/hicolor/24x24/status/refresh-cache.png')
def cb_progress(_target, _percent, n, i):
while Gtk.events_pending():

View File

@ -8,12 +8,13 @@
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="border_width">5</property>
<property name="title" translatable="yes"> </property>
<property name="window_position">center-on-parent</property>
<property name="default_width">200</property>
<property name="default_height">100</property>
<property name="icon">/usr/share/icons/hicolor/22x22/status/package-info.png</property>
<property name="type_hint">dialog</property>
<property name="skip_taskbar_hint">True</property>
<property name="deletable">False</property>
<property name="message_type">other</property>
<property name="buttons">ok-cancel</property>
<property name="text" translatable="yes">&lt;b&gt;Transaction summary&lt;/b&gt;</property>
@ -144,9 +145,11 @@
<property name="can_focus">False</property>
<property name="title" translatable="yes">Progress</property>
<property name="resizable">False</property>
<property name="window_position">center-on-parent</property>
<property name="window_position">center</property>
<property name="default_width">250</property>
<property name="default_height">60</property>
<property name="icon">/usr/share/icons/hicolor/22x22/status/setup.png</property>
<property name="skip_taskbar_hint">True</property>
<property name="deletable">False</property>
<child>
<object class="GtkBox" id="box7">
@ -157,11 +160,35 @@
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkImage" id="action_icon">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">/usr/share/icons/hicolor/24x24/status/setup.png</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="progresslabel2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes"> </property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>

View File

@ -15,6 +15,7 @@
<property name="title" translatable="yes">Pamac</property>
<property name="default_width">800</property>
<property name="default_height">500</property>
<property name="icon">/usr/share/icons/hicolor/22x22/status/package-sources.png</property>
<signal name="delete-event" handler="on_MainWindow_delete_event" swapped="no"/>
<child>
<object class="GtkBox" id="box1">
@ -88,6 +89,7 @@
<property name="can_focus">True</property>
<property name="model">groups_list</property>
<property name="headers_clickable">False</property>
<property name="enable_search">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview1_selection">
<signal name="changed" handler="on_treeview1_selection_changed" swapped="no"/>

View File

@ -5,6 +5,7 @@
<property name="can_focus">False</property>
<property name="title" translatable="yes">Update Manager</property>
<property name="window_position">center</property>
<property name="icon">/usr/share/icons/hicolor/22x22/status/package-update.png</property>
<signal name="delete-event" handler="on_UpdateWindow_delete_event" swapped="no"/>
<child>
<object class="GtkBox" id="box1">
@ -58,6 +59,23 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">10</property>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">/usr/share/icons/hicolor/48x48/status/package-update.png</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="top_label">
<property name="visible">True</property>
@ -70,10 +88,17 @@
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="width_request">390</property>
<property name="height_request">490</property>
<property name="width_request">300</property>
<property name="height_request">420</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
@ -116,8 +141,9 @@
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">6</property>
<property name="position">2</property>
</packing>
</child>