From: stack Date: Sun, 8 Jul 2012 16:16:58 +0000 (+0200) Subject: showError in Gui X-Git-Url: https://v.licheni.net/stack/code/dboxswitch.git/commitdiff_plain/7ac18a9d9482dd33bb58bd271492e375ea48a357?ds=sidebyside;hp=7767ad4e97be93e5951fe83e8222f212e671cc13 showError in Gui showError displays a QErrorMessage, usually when catchin a AppError containing an errorstring to display --- diff --git a/gui.py b/gui.py index 6ed893d..c4a1866 100755 --- a/gui.py +++ b/gui.py @@ -35,6 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import sys import os from PyQt4 import QtGui +from PyQt4.QtCore import SIGNAL from apperror import AppError from settings import appconf @@ -59,7 +60,7 @@ class Gui(QtGui.QDialog): self.trayIcon.show() self.setWindowTitle("Profile manager / Dboxswitch - dropbox profile switcher") - self.resize(400, 300) + self.resize(200, 200) self.profileManager = prManager @@ -79,6 +80,7 @@ class Gui(QtGui.QDialog): def createTrayIcon(self): + #context menu build, right click self.trayIconMenu = QtGui.QMenu(self) self.trayIconMenu.addAction(self.manageprofiles) self.trayIconMenu.addSeparator() @@ -88,3 +90,11 @@ class Gui(QtGui.QDialog): self.trayIcon.setContextMenu(self.trayIconMenu) #baloon on hover self.trayIcon.setToolTip(appconf.appname+" "+appconf.appversion+"\nRight Click to manage profiles.") + def showError(self, err): + """ Display an error message """ + self.setWindowTitle("Error - Dboxswitch - dropbox profile switcher") + self.resize(200, 100) + err = QtGui.QErrorMessage.showMessage(QtGui.QErrorMessage.qtHandler(), "Error: "+err) + + +