rework on icons display

This commit is contained in:
guinux 2014-02-08 12:10:55 +01:00
parent 56f5b057c5
commit 0195a64a2a
26 changed files with 45 additions and 51 deletions

View File

@ -125,7 +125,7 @@ Categories=System;
Exec=pamac-install %F
Terminal=false
Type=Application
Icon=/usr/share/pamac/icons/32x32/apps/pamac.png
Icon=system-software-install
StartupNotify=true
NoDisplay=true
MimeType=application/x-xz-compressed-tar;

View File

@ -130,7 +130,7 @@ Comment[vi]=Thêm hoặc gỡ phần mềm cài đặt trên hệ thống
Comment[zh_CN]=添加或删除系统中安装的软件
Comment[zh_HK]=加入或移除系統上安裝的軟件
Comment[zh_TW]=加入或移除系統上安裝的軟體
Icon=/usr/share/pamac/icons/32x32/apps/pamac.png
Icon=system-software-install
Exec=pamac-manager
Terminal=false
Type=Application

View File

@ -126,7 +126,7 @@ Comment[vi]=Cập nhật phần mềm đã cài đặt trên hệ thống
Comment[zh_CN]=更新本系统中安装的软件
Comment[zh_HK]=更新系統中已安裝的軟件
Comment[zh_TW]=更新系統中已安裝的軟體
Icon=/usr/share/pamac/icons/32x32/apps/pamac-updater.png
Icon=system-software-update
Exec=pamac-updater
Terminal=false
Type=Application

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 793 B

View File

Before

Width:  |  Height:  |  Size: 748 B

After

Width:  |  Height:  |  Size: 748 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -281,6 +281,7 @@
<property name="window_position">center</property>
<property name="default_width">300</property>
<property name="default_height">250</property>
<property name="icon_name">system-software-install</property>
<signal name="delete-event" handler="on_PreferencesWindow_delete_event" swapped="no"/>
<child>
<object class="GtkBox" id="box1">

View File

@ -161,7 +161,7 @@ class PamacDBusService(dbus.service.Object):
if event == 'ALPM_EVENT_CHECKDEPS_START':
action = _('Checking dependencies')+'...'
action_long = action+'\n'
icon = '/usr/share/pamac/icons/24x24/status/package-search.png'
icon = 'pamac-search'
elif event == 'ALPM_EVENT_CHECKDEPS_DONE':
if self.warning:
self.EmitLogWarning(self.warning)
@ -169,13 +169,13 @@ class PamacDBusService(dbus.service.Object):
elif event == 'ALPM_EVENT_FILECONFLICTS_START':
action = _('Checking file conflicts')+'...'
action_long = action+'\n'
icon = '/usr/share/pamac/icons/24x24/status/package-search.png'
icon = 'pamac-search'
elif event == 'ALPM_EVENT_FILECONFLICTS_DONE':
pass
elif event == 'ALPM_EVENT_RESOLVEDEPS_START':
action = _('Resolving dependencies')+'...'
action_long = action+'\n'
icon = '/usr/share/pamac/icons/24x24/status/package-setup.png'
icon = 'pamac-setup'
elif event == 'ALPM_EVENT_RESOLVEDEPS_DONE':
if self.warning:
self.EmitLogWarning(self.warning)
@ -183,7 +183,7 @@ class PamacDBusService(dbus.service.Object):
elif event == 'ALPM_EVENT_INTERCONFLICTS_START':
action = _('Checking inter conflicts')+'...'
action_long = action+'\n'
icon = '/usr/share/pamac/icons/24x24/status/package-search.png'
icon = 'pamac-search'
elif event == 'ALPM_EVENT_INTERCONFLICTS_DONE':
if self.warning:
self.EmitLogWarning(self.warning)
@ -192,7 +192,7 @@ class PamacDBusService(dbus.service.Object):
string = _('Installing {pkgname}').format(pkgname = tupel[0].name)
action = string+'...'
action_long = '{} ({})...\n'.format(string, tupel[0].version)
icon = '/usr/share/pamac/icons/24x24/status/package-add.png'
icon = 'pamac-add'
elif event == 'ALPM_EVENT_ADD_DONE':
formatted_event = 'Installed {pkgname} ({pkgversion})'.format(pkgname = tupel[0].name, pkgversion = tupel[0].version)
common.write_log_file(formatted_event)
@ -200,7 +200,7 @@ class PamacDBusService(dbus.service.Object):
string = _('Removing {pkgname}').format(pkgname = tupel[0].name)
action = string+'...'
action_long = '{} ({})...\n'.format(string, tupel[0].version)
icon = '/usr/share/pamac/icons/24x24/status/package-delete.png'
icon = 'pamac-delete'
elif event == 'ALPM_EVENT_REMOVE_DONE':
formatted_event = 'Removed {pkgname} ({pkgversion})'.format(pkgname = tupel[0].name, pkgversion = tupel[0].version)
common.write_log_file(formatted_event)
@ -208,7 +208,7 @@ class PamacDBusService(dbus.service.Object):
string = _('Upgrading {pkgname}').format(pkgname = tupel[1].name)
action = string+'...'
action_long = '{} ({} => {})...\n'.format(string, tupel[1].version, tupel[0].version)
icon = '/usr/share/pamac/icons/24x24/status/package-update.png'
icon = 'pamac-update'
elif event == 'ALPM_EVENT_UPGRADE_DONE':
formatted_event = 'Upgraded {pkgname} ({oldversion} -> {newversion})'.format(pkgname = tupel[1].name, oldversion = tupel[1].version, newversion = tupel[0].version)
common.write_log_file(formatted_event)
@ -216,7 +216,7 @@ class PamacDBusService(dbus.service.Object):
string = _('Downgrading {pkgname}').format(pkgname = tupel[1].name)
action = string+'...'
action_long = '{} ({} => {})...\n'.format(string, tupel[1].version, tupel[0].version)
icon = '/usr/share/pamac/icons/24x24/status/package-add.png'
icon = 'pamac-add'
elif event == 'ALPM_EVENT_DOWNGRADE_DONE':
formatted_event = 'Downgraded {pkgname} ({oldversion} -> {newversion})'.format(pkgname = tupel[1].name, oldversion = tupel[1].version, newversion = tupel[0].version)
common.write_log_file(formatted_event)
@ -224,39 +224,39 @@ class PamacDBusService(dbus.service.Object):
string = _('Reinstalling {pkgname}').format(pkgname = tupel[0].name)
action = string+'...'
action_long = '{} ({})...\n'.format(string, tupel[0].version)
icon = '/usr/share/pamac/icons/24x24/status/package-add.png'
icon = 'pamac-add'
elif event == 'ALPM_EVENT_REINSTALL_DONE':
formatted_event = 'Reinstalled {pkgname} ({pkgversion})'.format(pkgname = tupel[0].name, pkgversion = tupel[0].version)
common.write_log_file(formatted_event)
elif event == 'ALPM_EVENT_INTEGRITY_START':
action = _('Checking integrity')+'...'
action_long = action+'\n'
icon = '/usr/share/pamac/icons/24x24/status/package-search.png'
icon = 'pamac-search'
self.already_transferred = 0
elif event == 'ALPM_EVENT_INTEGRITY_DONE':
pass
elif event == 'ALPM_EVENT_LOAD_START':
action = _('Loading packages files')+'...'
action_long = action+'\n'
icon = '/usr/share/pamac/icons/24x24/status/package-search.png'
icon = 'pamac-search'
elif event == 'ALPM_EVENT_LOAD_DONE':
pass
elif event == 'ALPM_EVENT_DELTA_INTEGRITY_START':
action = _('Checking delta integrity')+'...'
action_long = action+'\n'
icon = '/usr/share/pamac/icons/24x24/status/package-search.png'
icon = 'pamac-search'
elif event == 'ALPM_EVENT_DELTA_INTEGRITY_DONE':
pass
elif event == 'ALPM_EVENT_DELTA_PATCHES_START':
action = _('Applying deltas')+'...'
action_long = action+'\n'
icon = '/usr/share/pamac/icons/24x24/status/package-setup.png'
icon = 'pamac-setup'
elif event == 'ALPM_EVENT_DELTA_PATCHES_DONE':
pass
elif event == 'ALPM_EVENT_DELTA_PATCH_START':
action = _('Generating {} with {}').format(tupel[0], tupel[1])+'...'
action_long = action+'\n'
icon = '/usr/share/pamac/icons/24x24/status/package-setup.png'
icon = 'pamac-setup'
elif event == 'ALPM_EVENT_DELTA_PATCH_DONE':
action = _('Generation succeeded!')
action_long = action+'\n'
@ -266,16 +266,16 @@ class PamacDBusService(dbus.service.Object):
elif event == 'ALPM_EVENT_SCRIPTLET_INFO':
action =_('Configuring {pkgname}').format(pkgname = self.previous_target)+'...'
action_long = tupel[0]
icon = '/usr/share/pamac/icons/24x24/status/package-setup.png'
icon = 'pamac-setup'
self.EmitNeedDetails(True)
elif event == 'ALPM_EVENT_RETRIEVE_START':
action = _('Downloading')+'...'
action_long = action+'\n'
icon = '/usr/share/pamac/icons/24x24/status/package-download.png'
icon = 'pamac-download'
elif event == 'ALPM_EVENT_DISKSPACE_START':
action = _('Checking available disk space')+'...'
action_long = action+'\n'
icon = '/usr/share/pamac/icons/24x24/status/package-search.png'
icon = 'pamac-search'
elif event == 'ALPM_EVENT_OPTDEP_REQUIRED':
print('Optionnal deps exist')
elif event == 'ALPM_EVENT_DATABASE_MISSING':
@ -285,7 +285,7 @@ class PamacDBusService(dbus.service.Object):
elif event == 'ALPM_EVENT_KEYRING_START':
action = _('Checking keyring')+'...'
action_long = action+'\n'
icon = '/usr/share/pamac/icons/24x24/status/package-search.png'
icon = 'pamac-search'
elif event == 'ALPM_EVENT_KEYRING_DONE':
pass
elif event == 'ALPM_EVENT_KEY_DOWNLOAD_START':
@ -358,11 +358,11 @@ class PamacDBusService(dbus.service.Object):
if _target.endswith('.db'):
action = _('Refreshing {repo}').format(repo = _target.replace('.db', ''))+'...'
action_long = ''
icon = '/usr/share/pamac/icons/24x24/status/refresh-cache.png'
icon = 'pamac-refresh'
else:
action = _('Downloading {pkgname}').format(pkgname = _target.replace('.pkg.tar.xz', ''))+'...'
action_long = action+'\n'
icon = '/usr/share/pamac/icons/24x24/status/package-download.png'
icon = 'pamac-download'
if self.total_size > 0:
percent = round((_transferred+self.already_transferred)/self.total_size, 2)
if _transferred+self.already_transferred <= self.total_size:
@ -549,7 +549,7 @@ class PamacDBusService(dbus.service.Object):
error = ''
try:
for db in self.syncdbs:
pkg = db.get_pkg(pkgname)
pkg = pyalpm.find_satisfier(db.pkgcache, pkgname)
if pkg:
self.t.add_pkg(pkg)
break

View File

@ -21,7 +21,6 @@
version = '0.9.7'
from gi.repository import Gtk, Gdk
from gi.repository.GdkPixbuf import Pixbuf
import pyalpm
import dbus
from time import strftime, localtime
@ -93,12 +92,12 @@ repos_dict = {}
current_filter = (None, None)
right_click_menu = Gtk.Menu()
installed_icon = Pixbuf.new_from_file('/usr/share/pamac/icons/16x16/actions/package-installed-updated.png')
uninstalled_icon = Pixbuf.new_from_file('/usr/share/pamac/icons/16x16/actions/package-available.png')
to_install_icon = Pixbuf.new_from_file('/usr/share/pamac/icons/16x16/actions/package-install.png')
to_reinstall_icon = Pixbuf.new_from_file('/usr/share/pamac/icons/16x16/actions/package-reinstall.png')
to_remove_icon = Pixbuf.new_from_file('/usr/share/pamac/icons/16x16/actions/package-remove.png')
locked_icon = Pixbuf.new_from_file('/usr/share/pamac/icons/16x16/actions/package-installed-locked.png')
installed_icon = Gtk.IconTheme.get_default().load_icon('package-installed-updated', 16, 0)
uninstalled_icon = Gtk.IconTheme.get_default().load_icon('package-available', 16, 0)
to_install_icon = Gtk.IconTheme.get_default().load_icon('package-install', 16, 0)
to_reinstall_icon = Gtk.IconTheme.get_default().load_icon('package-reinstall', 16, 0)
to_remove_icon = Gtk.IconTheme.get_default().load_icon('package-remove', 16, 0)
locked_icon = Gtk.IconTheme.get_default().load_icon('package-installed-locked', 16, 0)
def state_column_display_func(column, cell, treemodel, treeiter, data):
if treemodel[treeiter][0] == _('No package found'):
@ -639,20 +638,17 @@ def on_list_treeview_button_press_event(treeview, event):
if liststore[treeiter][0].name in transaction.to_add | transaction.to_remove or liststore[treeiter][0] in transaction.to_build:
item = Gtk.ImageMenuItem(_('Deselect'))
item.set_image(Gtk.Image.new_from_stock('gtk-undo', Gtk.IconSize.MENU))
item.set_always_show_image(True)
item.connect('activate', mark_to_deselect, liststore[treeiter][0])
right_click_menu.append(item)
elif liststore[treeiter][0].db.name == 'local':
item = Gtk.ImageMenuItem(_('Remove'))
item.set_image(Gtk.Image.new_from_pixbuf(to_remove_icon))
item.set_always_show_image(True)
item.connect('activate', mark_to_remove, liststore[treeiter][0])
right_click_menu.append(item)
if transaction.get_syncpkg(liststore[treeiter][0].name):
if not pyalpm.sync_newversion(liststore[treeiter][0], transaction.syncdbs):
item = Gtk.ImageMenuItem(_('Reinstall'))
item.set_image(Gtk.Image.new_from_pixbuf(to_reinstall_icon))
item.set_always_show_image(True)
item.connect('activate', mark_to_reinstall, liststore[treeiter][0])
right_click_menu.append(item)
optdeps_strings = liststore[treeiter][0].optdepends
@ -664,7 +660,6 @@ def on_list_treeview_button_press_event(treeview, event):
if available_optdeps:
item = Gtk.ImageMenuItem(_('Install optional deps'))
item.set_image(Gtk.Image.new_from_pixbuf(to_install_icon))
item.set_always_show_image(True)
item.connect('activate', select_optdeps, liststore[treeiter][0], available_optdeps)
right_click_menu.append(item)
if liststore[treeiter][0].reason == pyalpm.PKG_REASON_DEPEND:
@ -674,7 +669,6 @@ def on_list_treeview_button_press_event(treeview, event):
else:
item = Gtk.ImageMenuItem(_('Install'))
item.set_image(Gtk.Image.new_from_pixbuf(to_install_icon))
item.set_always_show_image(True)
item.connect('activate', mark_to_install, liststore[treeiter][0])
right_click_menu.append(item)
optdeps_strings = liststore[treeiter][0].optdepends
@ -686,7 +680,6 @@ def on_list_treeview_button_press_event(treeview, event):
if available_optdeps:
item = Gtk.ImageMenuItem(_('Install with optional deps'))
item.set_image(Gtk.Image.new_from_pixbuf(to_install_icon))
item.set_always_show_image(True)
item.connect('activate', install_with_optdeps, liststore[treeiter][0], available_optdeps)
right_click_menu.append(item)
treeview.grab_focus()

View File

@ -33,10 +33,10 @@ gettext.bindtextdomain('pamac', '/usr/share/locale')
gettext.textdomain('pamac')
_ = gettext.gettext
update_icon = '/usr/share/pamac/icons/24x24/status/pamac-update.png'
update_icon = 'pamac-tray-update'
update_info = _('{number} available updates')
one_update_info = _('1 available update')
noupdate_icon = '/usr/share/pamac/icons/24x24/status/pamac-tray.png'
noupdate_icon = 'pamac-tray-no-update'
noupdate_info = _('Your system is up-to-date')
icon = noupdate_icon
info = noupdate_info
@ -48,15 +48,15 @@ class Tray:
self.menu = Gtk.Menu()
self.menuItem = Gtk.ImageMenuItem(_('Update Manager'))
self.menuItem.set_image(Gtk.Image.new_from_file('/usr/share/pamac/icons/16x16/apps/pamac-updater.png'))
self.menuItem.set_image(Gtk.Image.new_from_icon_name('system-software-update', Gtk.IconSize.MENU))
self.menuItem.connect('activate', self.execute_update, self.statusIcon)
self.menu.append(self.menuItem)
self.menuItem = Gtk.ImageMenuItem(_('Package Manager'))
self.menuItem.set_image(Gtk.Image.new_from_file('/usr/share/pamac/icons/16x16/apps/pamac.png'))
self.menuItem.set_image(Gtk.Image.new_from_icon_name('system-software-install', Gtk.IconSize.MENU))
self.menuItem.connect('activate', self.execute_manager, self.statusIcon)
self.menu.append(self.menuItem)
self.menuItem = Gtk.ImageMenuItem(_('Quit'))
self.menuItem.set_image(Gtk.Image.new_from_file('/usr/share/pamac/icons/16x16/apps/exit.png'))
self.menuItem.set_image(Gtk.Image.new_from_icon_name('application-exit', Gtk.IconSize.MENU))
self.menuItem.connect('activate', self.quit_tray, self.statusIcon)
self.menu.append(self.menuItem)
@ -85,7 +85,7 @@ class Tray:
Thread(target = call, args = (['/usr/bin/pamac-updater'],)).start()
def update_icon(self, icon, info):
self.statusIcon.set_from_file(icon)
self.statusIcon.set_from_icon_name(icon)
self.statusIcon.set_tooltip_markup(info)
def set_visible(self, boolean):
@ -123,7 +123,7 @@ def set_icon(update_data):
else:
info = update_info.format(number = len(updates))
if not common.pid_file_exists():
Notify.Notification.new(_('Update Manager'), info, '/usr/share/pamac/icons/32x32/apps/pamac-updater.png').show()
Notify.Notification.new(_('Update Manager'), info, 'system-software-update').show()
else:
icon = noupdate_icon
info = noupdate_info

View File

@ -156,7 +156,7 @@ def need_details_handler(need):
progress_expander.set_expanded(need)
def icon_handler(icon):
action_icon.set_from_file(icon)
action_icon.set_from_icon_name(icon, Gtk.IconSize.BUTTON)
def target_handler(target):
progress_bar.set_text(target)
@ -255,7 +255,7 @@ def refresh(force_update = False):
while Gtk.events_pending():
Gtk.main_iteration()
action_handler(_('Refreshing')+'...')
icon_handler('/usr/share/pamac/icons/24x24/status/refresh-cache.png')
icon_handler('pamac-refresh')
target_handler('')
percent_handler(0)
ProgressCancelButton.set_visible(True)
@ -404,7 +404,7 @@ def run(cascade = True, recurse = False):
if to_add or to_remove or to_load or to_build:
global progress_buffer
action_handler(_('Preparing')+'...')
icon_handler('/usr/share/pamac/icons/24x24/status/package-setup.png')
icon_handler('pamac-setup')
target_handler('')
percent_handler(0)
progress_buffer.delete(progress_buffer.get_start_iter(), progress_buffer.get_end_iter())
@ -585,7 +585,7 @@ def download(url_list, path):
ftp = None
total_size = 0
transferred = 0
icon_handler('/usr/share/pamac/icons/24x24/status/package-download.png')
icon_handler('pamac-download')
ProgressCancelButton.set_visible(True)
ProgressCloseButton.set_visible(False)
parsed_urls = []
@ -644,7 +644,7 @@ def build_next():
action = _('Building {pkgname}').format(pkgname = pkg.name)+'...'
action_handler(action)
action_long_handler(action+'\n')
icon_handler('/usr/share/pamac/icons/24x24/status/package-setup.png')
icon_handler('pamac-setup')
target_handler('')
percent_handler(0)
ProgressCancelButton.set_visible(True)
@ -683,7 +683,7 @@ def get_updates():
while Gtk.events_pending():
Gtk.main_iteration()
action_handler(_('Checking for updates')+'...')
icon_handler('/usr/share/pamac/icons/24x24/status/package-search.png')
icon_handler('pamac-search')
target_handler('')
percent_handler(0)
ProgressCancelButton.set_visible(False)
@ -797,7 +797,7 @@ def sysupgrade(show_updates = True):
to_add.clear()
to_remove.clear()
action_handler(_('Preparing')+'...')
icon_handler('/usr/share/pamac/icons/24x24/status/package-setup.png')
icon_handler('pamac-setup')
target_handler('')
percent_handler(0)
progress_buffer.delete(progress_buffer.get_start_iter(), progress_buffer.get_end_iter())