1 # Authors: Amaury Medeiros, Nicholas Alexander and Paulo Ouriques
2 # Software License: GPL
4 from PyQt4 import QtGui
5 from PyQt4 import QtCore
7 from ui.pcsuiutils import *
8 from style.styleTabletSuite import *
10 def centralize(widget):
11 screen = QtGui.QDesktopWidget().screenGeometry()
12 size = widget.geometry()
13 widget.move((screen.width() - size.width())/2, (screen.height() - size.height())/2)
15 def showMessageBox(message, window_title = ""):
16 """ Creates a QMessageBox object and set its window title and text to the
20 String message - Message to be displayed inside the message box.
21 String window_title - String representing the title of the message box.
24 message_box = QtGui.QMessageBox()
25 message_box.setStyleSheet(MESSAGE_BOX_DEFAULT)
26 message_box.setWindowFlags(QtCore.Qt.FramelessWindowHint)
27 message_box.setWindowTitle(window_title)
28 message_box.setWindowIcon(QtGui.QIcon(BACKUP_IMAGE))
29 message_box.setText(message)