Skip to content

Commit

Permalink
make the saved arch filter work on first start (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Lauridsen committed Apr 30, 2015
1 parent 969a160 commit 114affe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/yumex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ def __init__(self, app, status):
self.search_type = 'prefix'
self.last_search_pkgs = []
self.current_filter_search = None
self.active_archs = const.PLATFORM_ARCH
if CONFIG.conf.archs:
self.active_archs = CONFIG.conf.archs
else:
self.active_archs = list(const.PLATFORM_ARCH)
self._grps = None # Group and Category cache
self.active_page = None # Active content page
self.search_fields = CONFIG.conf.search_fields
Expand Down Expand Up @@ -547,7 +550,7 @@ def setup_main_content(self):
self.queue_view = views.QueueView(queue_menu)
arch_menu_widget = self.ui.get_object('arch_menu')
self.arch_menu = yumex.gui.widgets.ArchMenu(arch_menu_widget,
self.active_archs)
const.PLATFORM_ARCH)
self.arch_menu.connect('arch-changed', self.on_arch_changed)
self.package_view = views.PackageView(self.queue_view, self.arch_menu)
self.package_view.connect(
Expand Down Expand Up @@ -759,6 +762,7 @@ def on_arch_changed(self, widget, data):
"""Arch changed in arch menu callback."""
self.active_archs = data.split(',')
logger.debug('arch-changed : %s' % self.active_archs)
self.arch_filter.change(self.active_archs)
if self.last_search:
data = self.last_search
self.last_search = None
Expand Down
2 changes: 1 addition & 1 deletion src/yumex/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
'/usr/bin/rpm --eval %_arch', shell=True).decode("utf-8")[:-1]

ARCH_DICT = {
"x86_64": set(['86_64', 'i686', 'i386', 'noarch']),
"x86_64": set(['x86_64', 'i686', 'i386', 'noarch']),
"i386": set(['i686', 'i386', 'noarch']),
"armhfp": set(['armv7hl', 'noarch'])
}
Expand Down
2 changes: 1 addition & 1 deletion src/yumex/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ class ArchMenu(GObject.GObject):
def __init__(self, arch_menu_widget, archs):
GObject.GObject.__init__(self)
self.all_archs = archs
self.current_archs = archs
self.arch_menu_widget = arch_menu_widget
if not CONFIG.conf.archs:
CONFIG.conf.archs = list(archs)
CONFIG.write()
self.current_archs = set(CONFIG.conf.archs)
self.arch_menu = self._setup_archmenu()

def _setup_archmenu(self):
Expand Down

0 comments on commit 114affe

Please sign in to comment.