diff options
Diffstat (limited to 'portato/gui/windows')
-rw-r--r-- | portato/gui/windows/main.py | 416 | ||||
-rw-r--r-- | portato/gui/windows/preference.py | 16 |
2 files changed, 254 insertions, 178 deletions
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index 36054a1..b675d17 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -19,6 +19,7 @@ import gobject # other import os.path import itertools as itt +from collections import defaultdict # our backend stuff from ...backend import flags, system # must be the first to avoid circular deps @@ -67,10 +68,6 @@ class PackageTable: # the notebook self.notebook = self.tree.get_widget("packageNotebook") - # the version combo - self.versionList = self.tree.get_widget("versionList") - self.build_version_list() - # chechboxes self.installedCheck = self.tree.get_widget("installedCheck") self.maskedCheck = self.tree.get_widget("maskedCheck") @@ -117,15 +114,13 @@ class PackageTable: self.icons["or"] = self.window.render_icon(gtk.STOCK_MEDIA_PAUSE, gtk.ICON_SIZE_MENU) self.icons["block"] = self.window.render_icon(gtk.STOCK_NO, gtk.ICON_SIZE_MENU) - def update (self, cp, queue = None, version = None, doEmerge = True, instantChange = False, type = None): + def update (self, pkg, queue = None, doEmerge = True, instantChange = False, type = None): """Updates the table to show the contents for the package. - @param cp: the selected package - @type cp: string (cp) + @param pkg: the selected package + @type pkg: Package @param queue: emerge-queue (if None the emerge-buttons are disabled) @type queue: EmergeQueue - @param version: if not None, specifies the version to select - @type version: string @param doEmerge: if False, the emerge buttons are disabled @type doEmerge: boolean @param instantChange: if True the changed keywords are updated instantly @@ -133,40 +128,28 @@ class PackageTable: @param type: the type of the queue this package is in; if None there is no queue :) @type type: string""" - self.cp = cp # category/package - self.version = version # version - if not None this is used + self.pkg = pkg self.queue = queue self.doEmerge = doEmerge self.instantChange = instantChange self.type = type - # packages and installed packages - if not self.doEmerge: - self.instPackages = self.packages = system.find_packages("=%s-%s" % (cp, version), masked = True) - else: - self.packages = system.sort_package_list(system.find_packages(cp, masked = True)) - self.instPackages = system.sort_package_list(system.find_packages(cp, "installed", masked = True)) - - # version-combo-box - self.versionList.get_model().clear() - self.fill_version_list() - if not self.queue or not self.doEmerge: self.emergeBtn.set_sensitive(False) self.unmergeBtn.set_sensitive(False) # current status - self.cb_version_list_changed() + self._update_table() self.vb.show_all() def hide (self): self.vb.hide_all() def set_labels (self): - pkg = self.actual_package() + pkg = self.pkg # name - self.nameLabel.set_markup("<b>%s</b>" % pkg.get_cp()) + self.nameLabel.set_markup("<b>%s</b>" % pkg.get_cpv()) # description desc = pkg.get_package_settings("DESCRIPTION") or _("<no description>") @@ -275,7 +258,7 @@ class PackageTable: store.append(it, [get_icon(dep), dep.dep]) try: - deptree = self.actual_package().get_dependencies() + deptree = self.pkg.get_dependencies() except AssertionError: w = _("Can't display dependencies: This package has an unsupported dependency string.") error(w) @@ -285,7 +268,7 @@ class PackageTable: def fill_use_list(self): - pkg = self.actual_package() + pkg = self.pkg pkg_flags = pkg.get_iuse_flags() pkg_flags.sort() @@ -309,7 +292,7 @@ class PackageTable: enabled = use in euse installed = use in instuse - store.append(actual_exp_it, [enabled, installed, use, system.get_use_desc(use, self.cp)]) + store.append(actual_exp_it, [enabled, installed, use, system.get_use_desc(use, self.pkg.get_cp())]) def build_dep_list (self): store = gtk.TreeStore(gtk.gdk.Pixbuf, str) @@ -348,115 +331,27 @@ class PackageTable: self.useList.set_search_column(2) self.useList.set_enable_tree_lines(True) - def build_version_list (self): - store = gtk.ListStore(gtk.gdk.Pixbuf, str, str) - - # build view - self.versionList.set_model(store) - - col = gtk.TreeViewColumn(_("Versions")) - col.set_property("expand", True) - - self.slotcol = gtk.TreeViewColumn(_("Slot")) - self.slotcol.set_property("expand", True) - - # adding the pixbuf - cell = gtk.CellRendererPixbuf() - col.pack_start(cell, False) - col.add_attribute(cell, "pixbuf", 0) - - # adding the package name - cell = gtk.CellRendererText() - col.pack_start(cell, True) - col.add_attribute(cell, "text", 1) - - # adding the slot - cell = gtk.CellRendererText() - self.slotcol.pack_start(cell, True) - self.slotcol.add_attribute(cell, "text", 2) - - self.versionList.append_column(col) - self.versionList.append_column(self.slotcol) - - def fill_version_list (self): - - store = self.versionList.get_model() - - # this is here for performance reasons - # to not query the package with info, we do not need - if self.main.cfg.get_boolean("showSlots", "GUI"): - def get_slot(pkg): - return pkg.get_package_settings("SLOT") - - self.slotcol.set_visible(True) - - else: - def get_slot(*args): - return "" - - self.slotcol.set_visible(False) - - # append versions - for vers, inst, slot in ((x.get_version(), x.is_installed(), get_slot(x)) for x in self.packages): - if inst: - icon = self.main.instPixbuf - else: - icon = None - - store.append([icon, vers, slot]) - - pos = ((0,)) # default - - # activate the first one - try: - best_version = "" - if self.version: - best_version = self.version - else: - best_version = system.find_best_match(self.packages[0].get_cp(), only_installed = (self.instPackages != [])).get_version() - for i in range(len(self.packages)): - if self.packages[i].get_version() == best_version: - pos = (i,) - break - except AttributeError: # no package found - pass - - self.versionList.get_selection().select_path(pos) - self.versionList.scroll_to_cell(pos) - - def actual_package (self): - """Returns the actual selected package. - - @returns: the actual selected package - @rtype: backend.Package""" - - model, iter = self.versionList.get_selection().get_selected() - if iter: - return self.packages[model.get_path(iter)[0]] - else: - return self.packages[0] - def _update_keywords (self, emerge, update = False): if emerge: type = "install" if not self.type else self.type try: try: - self.queue.append(self.actual_package().get_cpv(), type = type, update = update) + self.queue.append(self.pkg.get_cpv(), type = type, update = update) except PackageNotFoundException, e: if unmask_dialog(e[0]) == gtk.RESPONSE_YES: - self.queue.append(self.actual_package().get_cpv(), type = type, unmask = True, update = update) + self.queue.append(self.pkg.get_cpv(), type = type, unmask = True, update = update) except BlockedException, e: blocked_dialog(e[0], e[1]) else: try: - self.queue.append(self.actual_package().get_cpv(), type = "uninstall") + self.queue.append(self.pkg.get_cpv(), type = "uninstall") except PackageNotFoundException, e: error(_("Package could not be found: %s"), e[0]) #masked_dialog(e[0]) - def cb_version_list_changed (self, *args): + def _update_table (self, *args): - pkg = self.actual_package() + pkg = self.pkg # set the views for v in (self.ebuildView, self.changelogView, self.filesView): @@ -530,7 +425,7 @@ class PackageTable: if self.doEmerge: # set emerge-button-label - if not self.actual_package().is_installed(): + if not pkg.is_installed(): self.unmergeBtn.set_sensitive(False) else: self.unmergeBtn.set_sensitive(True) @@ -546,12 +441,10 @@ class PackageTable: def cb_package_revert_clicked (self, button): """Callback for pressed revert-button.""" - self.actual_package().remove_new_use_flags() - self.actual_package().remove_new_masked() - self.actual_package().remove_new_testing() - self.versionList.get_model().clear() - self.fill_version_list() - self.cb_version_list_changed() + self.pkg.remove_new_use_flags() + self.pkg.remove_new_masked() + self.pkg.remove_new_testing() + self._update_table() if self.instantChange: self._update_keywords(True, update = True) return True @@ -573,21 +466,21 @@ class PackageTable: status = button.get_active() # end of recursion :) - if self.actual_package().is_testing(use_keywords = False) == status: + if self.pkg.is_testing(use_keywords = False) == status: return False # if the package is not testing - don't allow to set it as such - if not self.actual_package().is_testing(use_keywords = False): + if not self.pkg.is_testing(use_keywords = False): button.set_active(False) return True # re-set to testing status - if not self.actual_package().is_testing(use_keywords = True): - self.actual_package().set_testing(False) + if not self.pkg.is_testing(use_keywords = True): + self.pkg.set_testing(False) button.set_label(_("Testing")) button.set_active(True) else: # disable testing - self.actual_package().set_testing(True) + self.pkg.set_testing(True) button.set_label("<i>(%s)</i>" % _("Testing")) button.get_child().set_use_markup(True) button.set_active(True) @@ -600,7 +493,7 @@ class PackageTable: def cb_masked_toggled (self, button): """Callback for toggled masking-checkbox.""" status = button.get_active() - pkg = self.actual_package() + pkg = self.pkg if pkg.is_masked(use_changed = False) == status and not pkg.is_locally_masked(): return False @@ -637,7 +530,7 @@ class PackageTable: def cb_use_flag_toggled (self, cell, path, store): """Callback for a toggled use-flag button.""" flag = store[path][2] - pkg = self.actual_package() + pkg = self.pkg if pkg.use_expanded(flag): # ignore expanded flags return False @@ -733,12 +626,17 @@ class MainWindow (Window): self.hpaned = self.tree.get_widget("hpaned") self.hpaned.set_position(int(self.window.get_size()[0]/1.5)) - # cat and pkg list + # lists + self.selCatName = "" + self.selCP = "" + self.selCPV = "" self.sortPkgListByName = True self.catList = self.tree.get_widget("catList") self.pkgList = self.tree.get_widget("pkgList") + self.versionList = self.tree.get_widget("versionList") self.build_cat_list() self.build_pkg_list() + self.build_version_list() # search entry self.searchEntry = self.tree.get_widget("searchEntry") @@ -804,9 +702,6 @@ class MainWindow (Window): self.queueTree = GtkTree(self.queueList.get_model()) self.queue = EmergeQueue(console = self.console, tree = self.queueTree, db = self.db, title_update = self.title_update, threadClass = GtkThread) - self.catList.get_selection().select_path(1) - self.pkgList.get_selection().select_path(0) - # session splash(_("Restoring Session")) try: @@ -821,8 +716,25 @@ class MainWindow (Window): self.window.show_all() - def show_package (self, *args, **kwargs): - self.packageTable.update(*args, **kwargs) + def show_package (self, pkg = None, cpv = None, cp = None, version = None, **kwargs): + p = None + + if pkg: + p = pkg + elif cpv: + p = system.find_packages("="+cpv, masked = True)[0] + elif cp: + if version: + p = system.find_packages("=%s-%s" % (cp, version), masked = True)[0] + + else: + best = system.find_best_match(cp) + if best: + p = best + else: + p = system.find_packages(cp)[0] + + self.packageTable.update(p, **kwargs) def build_terminal (self): """ @@ -860,28 +772,53 @@ class MainWindow (Window): Builds the category list. """ - store = gtk.ListStore(str) + store = gtk.TreeStore(str) + + self.fill_cat_store(store) self.catList.set_model(store) cell = gtk.CellRendererText() col = gtk.TreeViewColumn(_("Categories"), cell, text = 0) self.catList.append_column(col) - self.fill_cat_store(store) self.catList.get_selection().connect("changed", self.cb_cat_list_selection) - def fill_cat_store (self, store): + def fill_cat_store (self, store = None): """ Fills the category store with data. - + @param store: the store to fill @type store: gtk.ListStore """ + if store is None: + store = self.catList.get_model() + + store.clear() + cats = self.db.get_categories(installed = not self.showAll) - for p in cats: - store.append([p]) + if not self.cfg.get_boolean("collapseCats", "GUI"): + for p in cats: + store.append(None, [p]) + else: + splitCats = defaultdict(list) + for c in cats: + try: + pre, post = c.split("-", 1) + except ValueError: # no "-" in cat name -- do not split + debug("Category '%s' can't be split up. Should be no harm.", c) + splitCats["not-split"].append(c) + else: + splitCats[pre].append(post) + + for sc in splitCats: + if sc == "not-split": + it = None # append not splitted stuff to root + else: + it = store.append(None, [sc]) + for cat in splitCats[sc]: + store.append(it, [cat]) # sort them alphabetically store.set_sort_column_id(0, gtk.SORT_ASCENDING) @@ -895,7 +832,7 @@ class MainWindow (Window): """ store = gtk.ListStore(gtk.gdk.Pixbuf, str, str) - self.fill_pkg_store(store,name) + self.fill_pkg_store(store, name) # build view self.pkgList.set_model(store) @@ -918,7 +855,7 @@ class MainWindow (Window): self.pkgList.get_selection().connect("changed", self.cb_pkg_list_selection) - def fill_pkg_store (self, store, name = None): + def fill_pkg_store (self, store = None, name = None): """ Fills a given ListStore with the packages in a category. @@ -927,6 +864,10 @@ class MainWindow (Window): @param name: the name of the category @type name: string """ + + if store is None: + store = self.pkgList.get_model() + store.clear() if name: for cat, pkg, is_inst in self.db.get_cat(name, self.sortPkgListByName): @@ -938,19 +879,96 @@ class MainWindow (Window): icon = None store.append([icon, pkg, cat]) + def build_version_list (self): + store = gtk.ListStore(gtk.gdk.Pixbuf, str, str) + + # build view + self.versionList.set_model(store) + + col = gtk.TreeViewColumn(_("Versions")) + col.set_property("expand", True) + + self.slotcol = gtk.TreeViewColumn(_("Slot")) + self.slotcol.set_property("expand", True) + + # adding the pixbuf + cell = gtk.CellRendererPixbuf() + col.pack_start(cell, False) + col.add_attribute(cell, "pixbuf", 0) + + # adding the package name + cell = gtk.CellRendererText() + col.pack_start(cell, True) + col.add_attribute(cell, "text", 1) + + # adding the slot + cell = gtk.CellRendererText() + self.slotcol.pack_start(cell, True) + self.slotcol.add_attribute(cell, "text", 2) + + self.versionList.append_column(col) + self.versionList.append_column(self.slotcol) + + self.versionList.get_selection().connect("changed", self.cb_vers_list_selection) + + def fill_version_list (self, cp, version = None): + + store = self.versionList.get_model() + store.clear() + + # this is here for performance reasons + # to not query the package with info, we do not need + if self.cfg.get_boolean("showSlots", "GUI"): + def get_slot(pkg): + return pkg.get_package_settings("SLOT") + + self.slotcol.set_visible(True) + + else: + def get_slot(*args): + return "" + + self.slotcol.set_visible(False) + + packages = system.sort_package_list(system.find_packages(cp, masked=True)) + + # append versions + for vers, inst, slot in ((x.get_version(), x.is_installed(), get_slot(x)) for x in packages): + if inst: + icon = self.instPixbuf + else: + icon = None + + store.append([icon, vers, slot]) + + pos = ((0,)) # default + + # activate the first one + try: + best_version = "" + if version: + best_version = version + else: + best_version = system.find_best_match(packages[0].get_cp()).get_version() + for i, p in enumerate(packages): + if p.get_version() == best_version: + pos = (i,) + break + except AttributeError: # no package found + pass + + self.versionList.get_selection().select_path(pos) + self.versionList.scroll_to_cell(pos) + def refresh_stores (self): """ Refreshes the category and package stores. """ - store = self.catList.get_model() - store.clear() - self.fill_cat_store(store) + self.fill_cat_store() - store = self.pkgList.get_model() - store.clear() - try: - self.fill_pkg_store(store, self.selCatName) - except AttributeError: # no selCatName -> so no category selected --> ignore + if self.selCatName: + self.fill_pkg_store(name = self.selCatName) + else: # no selCatName -> so no category selected --> ignore debug("No category selected --> should be no harm.") def load_session(self, sessionEx = None): @@ -1012,7 +1030,27 @@ class MainWindow (Window): for cname, path in ((x[col], x.path) for x in list.get_model()): if cname == name: pos = path + break + + if self.cfg.get_boolean("collapseCats", "GUI") and \ + pos == "0" and isinstance(list.get_model(), gtk.TreeStore): # try the new split up + + try: + pre, post = name.split("-", 1) + except ValueError: # nothing to split + pass + else: + for row in list.get_model(): + if row[col] == pre: # found first part + pos = row.path + list.expand_row(pos, False) + for cname, path in ((x[col], x.path) for x in row.iterchildren()): + if cname == post: # found second + pos = ":".join(map(str,path)) + break + break + debug("Selecting path '%s'.", pos) list.get_selection().select_path(pos) list.scroll_to_cell(pos) @@ -1066,13 +1104,19 @@ class MainWindow (Window): elif version > SESSION_VERSION: raise NewSessionException(version, SESSION_VERSION) + def _add (value): + if len(value) == 4: + self.session.add_handler(value[:3], default = value[3]) + else: + self.session.add_handler(value) + # set the simple ones :) - map(self.session.add_handler,[ + map(_add,[ ([("gtksessionversion", "session")], load_session_version, lambda: SESSION_VERSION), ([("width", "window"), ("height", "window")], lambda w,h: self.window.resize(int(w), int(h)), self.window.get_size), ([("vpanedpos", "window"), ("hpanedpos", "window")], load_paned, save_paned), - ([("catsel", "window")], load_selection(self.catList, 0), save_cat_selection), - ([("pkgsel", "window")], load_selection(self.pkgList, 1), save_pkg_selection) + ([("catsel", "window")], load_selection(self.catList, 0), save_cat_selection, ["app-portage"]), + ([("pkgsel", "window")], load_selection(self.pkgList, 1), save_pkg_selection, ["portato"]) #([("merge", "queue"), ("unmerge", "queue"), ("oneshot", "queue")], load_queue, save_queue), ]) @@ -1107,7 +1151,7 @@ class MainWindow (Window): debug("Unexpected number of %s returned after search: %d", what, len(pathes)) break - self.show_package(cp, self.queue, version = version) + self.show_package(cp = cp, version = version, queue = self.queue) def set_uri_hook (self, browser): """ @@ -1166,7 +1210,8 @@ class MainWindow (Window): else: title = ("%s (%s)") % (_("Console"), title) - if (len(title) > 60): title = "%s..." % title[:57] + tlength = int(self.cfg.get("titlelength", "GUI")) + if (len(title) > tlength): title = "%s..." % title[:tlength-3] self.sysNotebook.set_tab_label_text(self.termHB, title) return False @@ -1182,26 +1227,47 @@ class MainWindow (Window): # get the selected category store, it = selection.get_selected() if it: - self.selCatName = store.get_value(it, 0) - self.pkgList.get_model().clear() - self.fill_pkg_store(self.pkgList.get_model(), self.selCatName) + if not self.cfg.get_boolean("collapseCats", "GUI"): + self.selCatName = store.get_value(it, 0) + else: + parent = store.iter_parent(it) + if parent is None: + if store.iter_has_child(it): # this is a split up selector -> do nothing + return True + else: + self.selCatName = store.get_value(it, 0) # this is a non-split up top + else: + self.selCatName = ("%s-%s" % (store.get_value(parent, 0), store.get_value(it, 0))) + + self.fill_pkg_store(name = self.selCatName) return True def cb_pkg_list_selection (self, selection): """ Callback for a package-list selection. - Updates the package info. + Updates the version list. """ store, it = selection.get_selected() if it: - cp = "%s/%s" % (store.get_value(it, 2), store.get_value(it, 1)) - self.show_package(cp, self.queue) + self.selCP = "%s/%s" % (store.get_value(it, 2), store.get_value(it, 1)) + self.fill_version_list(self.selCP) return True def cb_pkg_list_header_clicked(self, col): self.sortPkgListByName = not self.sortPkgListByName - self.pkgList.get_model().clear() - self.fill_pkg_store(self.pkgList.get_model(), self.selCatName) + self.fill_pkg_store(name = self.selCatName) + return True + + def cb_vers_list_selection (self, selection): + """ + Callback for a package-list selection. + Updates the version list. + """ + store, it = selection.get_selected() + if it: + self.selCPV = "%s-%s" % (self.selCP, store.get_value(it, 1)) + self.show_package(cpv = self.selCPV, queue = self.queue) + return True def cb_queue_row_activated (self, view, path, *args): @@ -1211,8 +1277,6 @@ class MainWindow (Window): iterator = store.get_original().get_iter(path) if store.iter_has_parent(iterator): package = store.get_value(iterator, store.get_cpv_column()) - cat, name, vers, rev = system.split_cpv(package) - if rev != "r0": vers = vers+"-"+rev if store.is_in_emerge(iterator): type = "install" @@ -1221,7 +1285,7 @@ class MainWindow (Window): elif store.is_in_update(iterator): type = "update" - self.show_package(cat+"/"+name, queue = self.queue, version = vers, instantChange = True, doEmerge = False, type = type) + self.show_package(cpv = package, queue = self.queue, instantChange = True, doEmerge = False, type = type) return True def cb_queue_tooltip_queried (self, view, x, y, is_keyboard, tooltip): @@ -1470,7 +1534,7 @@ class MainWindow (Window): """ User wants to open preferences. """ - PreferenceWindow(self.window, self.cfg, self.console.set_font_from_string, self.set_uri_hook, self.set_notebook_tabpos) + PreferenceWindow(self.window, self.cfg, self.console.set_font_from_string, self.set_uri_hook, self.set_notebook_tabpos, self.fill_cat_store) return True def cb_about_clicked (self, *args): @@ -1599,10 +1663,10 @@ class MainWindow (Window): self.emergePaused = cb.get_active() if not self.emergePaused: self.queue.continue_emerge() - self.tray.set_from_file(APP_ICON) + #self.tray.set_from_file(APP_ICON) else: self.queue.stop_emerge() - self.tray.set_from_file(os.path.join(ICON_DIR, "pausing.png")) + #self.tray.set_from_file(os.path.join(ICON_DIR, "pausing.png")) # block the handlers of the other buttons # so that calling "set_active" does not call this callback recursivly diff --git a/portato/gui/windows/preference.py b/portato/gui/windows/preference.py index 991e7b3..d35666d 100644 --- a/portato/gui/windows/preference.py +++ b/portato/gui/windows/preference.py @@ -24,6 +24,7 @@ class PreferenceWindow (AbstractDialog): # all checkboxes in the window # widget name -> option name checkboxes = { + "collapseCatCheck" : ("collapseCats", "GUI"), "consoleUpdateCheck" : ("updateConsole", "GUI"), "debugCheck" : "debug", "deepCheck" : "deep", @@ -56,7 +57,7 @@ class PreferenceWindow (AbstractDialog): 4 : gtk.POS_RIGHT } - def __init__ (self, parent, cfg, console_fn, linkbtn_fn, tabpos_fn): + def __init__ (self, parent, cfg, console_fn, linkbtn_fn, tabpos_fn, catmodel_fn): """Constructor. @param parent: parent window @@ -68,7 +69,9 @@ class PreferenceWindow (AbstractDialog): @param linkbtn_fn: function to call to set the linkbutton behavior @type linkbtn_fn: function(string) @param tabpos_fn: function to call to set the tabposition of the notebooks - @type tabpos_fn: function(gtk.ComboBox,int)""" + @type tabpos_fn: function(gtk.ComboBox,int) + @param catmodel_fn: function to call to set the model of the cat list (collapsed/not collapsed) + @type catmodel_fn: function()""" AbstractDialog.__init__(self, parent) @@ -79,6 +82,7 @@ class PreferenceWindow (AbstractDialog): self.console_fn = console_fn self.linkbtn_fn = linkbtn_fn self.tabpos_fn = tabpos_fn + self.catmodel_fn = catmodel_fn # set the bg-color of the hint hintEB = self.tree.get_widget("hintEB") @@ -106,6 +110,10 @@ class PreferenceWindow (AbstractDialog): self.consoleFontBtn = self.tree.get_widget("consoleFontBtn") self.consoleFontBtn.set_font_name(self.cfg.get("consolefont", section = "GUI")) + # the console title length spin button + self.titleLengthSpinBtn = self.tree.get_widget("titleLengthSpinBtn") + self.titleLengthSpinBtn.set_value(int(self.cfg.get("titlelength", section = "GUI"))) + # the comboboxes self.systemTabCombo = self.tree.get_widget("systemTabCombo") self.pkgTabCombo = self.tree.get_widget("packageTabCombo") @@ -140,6 +148,8 @@ class PreferenceWindow (AbstractDialog): self.cfg.set("consolefont", font, section = "GUI") self.console_fn(font) + self.cfg.set("titlelength", str(self.titleLengthSpinBtn.get_value_as_int()), section = "GUI") + pkgPos = self.pkgTabCombo.get_active()+1 sysPos = self.systemTabCombo.get_active()+1 @@ -150,6 +160,8 @@ class PreferenceWindow (AbstractDialog): self.linkbtn_fn(self.cfg.get("browserCmd", section="GUI")) + self.catmodel_fn() + def cb_ok_clicked(self, button): """Saves, writes to config-file and closes the window.""" self._save() |