From 860f59e2a4a7a8daeb9683d6938986afc694cf6d Mon Sep 17 00:00:00 2001 From: necoro <> Date: Thu, 31 May 2007 19:45:22 +0000 Subject: Some interface changes Made qt-frontend work mostly with PyQt-4.2 --- portato/gui/qt/windows.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'portato/gui/qt/windows.py') diff --git a/portato/gui/qt/windows.py b/portato/gui/qt/windows.py index bf7be49..58f923e 100644 --- a/portato/gui/qt/windows.py +++ b/portato/gui/qt/windows.py @@ -70,9 +70,12 @@ class Window (object): Qt.QApplication.setOverrideCursor(Qt.Qt.WaitCursor) try: - ret = func(*args, **kwargs) - finally: - Qt.QApplication.restoreOverrideCursor() + try: + ret = func(*args, **kwargs) + finally: + Qt.QApplication.restoreOverrideCursor() + except TypeError: + pass # invalid signature called return ret @@ -743,8 +746,8 @@ class MainWindow (Window): def on_prefAction_triggered (self): PreferenceWindow(self, self.cfg).exec_() - @Qt.pyqtSignature("") @Window.watch_cursor + @Qt.pyqtSignature("") def on_reloadAction_triggered (self): """Reloads the portage settings and the database.""" system.reload_settings() @@ -800,12 +803,17 @@ class MainWindow (Window): self.fill_pkg_list(self.selCatName) @Qt.pyqtSignature("") - @Window.watch_cursor def on_searchBtn_clicked (self): """Do a search.""" text = str(self.searchEdit.text()) + if text != "": - packages = system.find_all_packages(text, withVersion = False) + + @Window.watch_cursor + def get_packages(): + return system.find_all_packages(text, withVersion = False) + + packages = get_packages() if packages == []: nothing_found_dialog(self) @@ -865,8 +873,8 @@ class MainWindow (Window): self.tabWidget.setCurrentIndex(self.CONSOLE_PAGE) self.queue.unmerge(force = True) - @Qt.pyqtSignature("") @Window.watch_cursor + @Qt.pyqtSignature("") def on_updateBtn_clicked (self): if not am_i_root(): not_root_dialog(self) -- cgit v1.2.3-54-g00ecf