Permalink
Browse files

New center_widget and website url add to about Minecraft Backup

  • Loading branch information...
1 parent d9da88c commit 44159e6a7fd28a04ad81893185edd8bd66687556 @LuqueDaniel committed Jan 10, 2013
@@ -21,6 +21,7 @@
__prj__ = 'Minecraft Backup Manager'
__author__ = 'Daniel Luque'
__mail__ = 'danielluque14@gmail.com'
+__url__ = 'http://luquedaniel.github.com/Minecraft_backup'
__source__ = 'http://github.com/LuqueDaniel/Minecraft_backup.git'
__version__ = '1.0'
__version_name__ = 'Dirt'
@@ -21,10 +21,16 @@
from PyQt4.QtGui import QDesktopWidget
-def center_widget(widget):
+def center_widget(widget, parent=None):
"""Center widget in screen"""
- center_widget = widget.frameGeometry()
- center = QDesktopWidget().availableGeometry().center()
- center_widget.moveCenter(center)
- widget.move(center_widget.topLeft())
+ if parent is None:
+ center_widget = widget.frameGeometry()
+ center = QDesktopWidget().availableGeometry().center()
+ center_widget.moveCenter(center)
+ widget.move(center_widget.topLeft())
+ else:
+ center_widget = widget.frameGeometry()
+ center = parent.geometry().center()
+ center_widget.moveCenter(center)
+ widget.move(center_widget.topLeft())
@@ -83,6 +83,11 @@ def __init__(self, parent=None):
vbox.addWidget(self.label_license)
+ self.label_project_url = QLabel('Website: <a href="%s">%s</a>' % (
+ minecraft_backup.__url__, minecraft_backup.__url__))
+
+ vbox.addWidget(self.label_project_url)
+
#label_source
self.label_source = QLabel('Source: <a href="%s">%s</a>' % (
minecraft_backup.__source__, minecraft_backup.__source__))
@@ -44,7 +44,7 @@ def __init__(self, parent=None):
self.setMaximumSize(500, 400)
self.setMinimumSize(500, 400)
self.setWindowTitle('Minecraft Backup Manager - Configuration')
- center_widget(self)
+ center_widget(self, parent)
# STANNDARD BUTTONS
self.button_box = QDialogButtonBox(self)
@@ -50,7 +50,7 @@ def __init__(self, parent=None):
self.setMaximumSize(450, 200)
self.setMinimumSize(450, 200)
self.setWindowTitle('Create a new backup')
- center_widget(self)
+ center_widget(self, parent)
# STANNDARD BUTTONS
self.btn_cancel = QPushButton('Cancel', self)

0 comments on commit 44159e6

Please sign in to comment.