X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fui%2Ftsuigeneralmethods.py;fp=src%2Fui%2Ftsuigeneralmethods.py;h=1535527193fffdb598297b3d8ccdc7e59e0aee5d;hb=256d6db84797e58f32185f042154a7c0fc54163e;hp=0000000000000000000000000000000000000000;hpb=7d8224c9f08712280a22af40325d59a19f4fb1e1;p=tablet-suite diff --git a/src/ui/tsuigeneralmethods.py b/src/ui/tsuigeneralmethods.py new file mode 100644 index 0000000..1535527 --- /dev/null +++ b/src/ui/tsuigeneralmethods.py @@ -0,0 +1,32 @@ +# Authors: Amaury Medeiros, Nicholas Alexander and Paulo Ouriques +# Software License: GPL + +from PyQt4 import QtGui +from PyQt4 import QtCore + +from ui.pcsuiutils import * +from style.styleTabletSuite import * + +def centralize(widget): + screen = QtGui.QDesktopWidget().screenGeometry() + size = widget.geometry() + widget.move((screen.width() - size.width())/2, (screen.height() - size.height())/2) + +def showMessageBox(message, window_title = ""): + """ Creates a QMessageBox object and set its window title and text to the + given strings. + + Attributes: + String message - Message to be displayed inside the message box. + String window_title - String representing the title of the message box. + + """ + message_box = QtGui.QMessageBox() + message_box.setStyleSheet(MESSAGE_BOX_DEFAULT) + message_box.setWindowFlags(QtCore.Qt.FramelessWindowHint) + message_box.setWindowTitle(window_title) + message_box.setWindowIcon(QtGui.QIcon(BACKUP_IMAGE)) + message_box.setText(message) + message_box.exec_() + +