Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1 from LuqueDaniel/1.1

Minecraft Backup Manager 1.1 release
  • Loading branch information...
commit 9f5ed6f113c9bb1491ca95ec577c1ccaa83de9ea 2 parents fc36f3e + 7e461f2
@LuqueDaniel authored
View
11 Changelog.md
@@ -2,5 +2,14 @@
Minecraft Backup Manager - Changelog
====================================================================
+- **Minecraft Backup Manager 1.1 (Stone)** - (01/30/2013)
+ - Rewrited New backup window for using layouts.
+ - Rewrited Configuration window for using layouts.
+ - Now "About Minecraft Backup Manager" window using QLabel.
+ - Removed menu bar.
+ - Added website url in "About Minecraft Backup Manager"
+ - Added button "About".
+ - Performance improvements.
+ - New header image.
- **Minecraft Backup Manager 1.0 (Dirt)** - (11/06/2012)
- - First version of Minecraft Backup Manager
+ - First version of Minecraft Backup Manager.
View
9 README.md
@@ -3,7 +3,12 @@ Minecraft Backup Manager
Minecraft Backup Manager is an application for managing Minecraft
backups quickly and easily.
-Licensed under: GPLv3
+Version: **1.1-dev** <br />
+Licensed under: **GPLv3**
+
+Download packages
+--------------------------------------------------------------------
+**[Download packages and executables](http://luquedaniel.github.com/Minecraft_backup/)**
Dependencies
--------------------------------------------------------------------
@@ -11,7 +16,7 @@ Dependencies
Changelog
--------------------------------------------------------------------
-See Changelog.md for more information
+See **[Changelog.md](https://github.com/LuqueDaniel/Minecraft_backup/blob/master/Changelog.md)** for more information
How compile for Windows
--------------------------------------------------------------------
View
2  Windows/setup.py
@@ -36,7 +36,7 @@
information = {'script': 'minecraft-backup.py',
- 'Version': '1.0',
+ 'Version': '1.1',
'copyright': 'GPL3',
'name': 'Minecraft Backup Manager',
'dest_base': 'Minecraft Backup Manager',
View
9 minecraft_backup/__init__.py
@@ -21,10 +21,11 @@
__prj__ = 'Minecraft Backup Manager'
__author__ = 'Daniel Luque'
__mail__ = 'danielluque14@gmail.com'
-__source__ = 'http://github.com/LuqueDaniel/Minecraft_backup.git'
-__version__ = '1.0'
-__version_name__ = 'Dirt'
-__license__ = 'GPL3'
+__url__ = 'http://luquedaniel.github.com/Minecraft_backup'
+__source__ = 'http://github.com/LuqueDaniel/Minecraft_backup'
+__version__ = '1.1'
+__version_name__ = 'Stone'
+__license__ = 'GPL v3'
__docu__ = """Minecraft Backup Manager is an application for managing Minecraft
backups quickly and easily."""
View
15 minecraft_backup/core/backup_manager.py
@@ -89,10 +89,17 @@ def make_backup(self, dst, backup_name):
mkdir(dst)
- copy_backup_files(GAME_PATH, dst)
-
- self.save_backup_list(backup_name, dst)
- self.emit(SIGNAL('makeend()'))
+ try:
+ self.make_backup_continue = True
+ copy_backup_files(GAME_PATH, dst)
+ except IOError:
+ self.make_backup_continue = False
+ self.emit(SIGNAL('IOdenied()'))
+ rmtree(dst)
+
+ if self.make_backup_continue is True:
+ self.save_backup_list(backup_name, dst)
+ self.emit(SIGNAL('makeend()'))
def save_backup_list(self, backup_name, path):
"""This function create and save backup list"""
View
62 minecraft_backup/gui/dialogs/about_minebackup.py
@@ -38,53 +38,41 @@ class about_minebackup(QDialog):
def __init__(self, parent=None):
QDialog.__init__(self, parent)
-
self.setWindowTitle('About Minecraft Backup')
self.setMaximumSize(QSize(0, 0))
- vbox = QVBoxLayout(self)
-
#Header
self.header = QLabel()
self.header.setPixmap(QPixmap(IMAGES['minebackup_icon_128']))
- hbox = QHBoxLayout()
- hbox.addWidget(self.header)
-
#title_label
self.label_title = QLabel('<h1>Minecraft Backup Manager</h1>', self)
self.label_title.setAlignment(Qt.AlignRight)
self.label_title.setTextFormat(Qt.RichText)
- hbox.addWidget(self.label_title)
- vbox.addLayout(hbox)
-
- #label_description
- self.label_description = QLabel(
-"""Minecraft Backup Manager is an application for managing Minecraft
-backups quickly and easily.""")
-
- vbox.addWidget(self.label_description)
-
- #label_version
- self.label_version = QLabel('Version: %s (%s)' % (
+ #LAYOUTS
+ #Horizontal Layout
+ self.hbox = QHBoxLayout()
+ self.hbox.addWidget(self.header)
+ self.hbox.addWidget(self.label_title)
+
+ #Vertical Layout
+ self.vbox = QVBoxLayout(self)
+ self.vbox.addLayout(self.hbox)
+ #Label Docu
+ self.vbox.addWidget(QLabel(minecraft_backup.__docu__))
+ #Label version
+ self.vbox.addWidget(QLabel('Version: %s (%s)' % (
minecraft_backup.__version__,
- minecraft_backup.__version_name__))
-
- vbox.addWidget(self.label_version)
-
- self.label_author = QLabel('Author: %s' % minecraft_backup.__author__)
-
- vbox.addWidget(self.label_author)
-
- #label_license
- self.label_license = QLabel('License: %s' % (
- minecraft_backup.__license__))
-
- vbox.addWidget(self.label_license)
-
- #label_source
- self.label_source = QLabel('Source: <a href="%s">%s</a>' % (
- minecraft_backup.__source__, minecraft_backup.__source__))
-
- vbox.addWidget(self.label_source)
+ minecraft_backup.__version_name__)))
+ #Label Author
+ self.vbox.addWidget(QLabel('Author: %s' % minecraft_backup.__author__))
+ #Label License
+ self.vbox.addWidget(QLabel('License: %s' % (
+ minecraft_backup.__license__)))
+ #Label Website Url
+ self.vbox.addWidget(QLabel('Website: <a href="%s">%s</a>' % (
+ minecraft_backup.__url__, minecraft_backup.__url__)))
+ #Label Source
+ self.vbox.addWidget(QLabel('Source: <a href="%s">%s</a>' % (
+ minecraft_backup.__source__, minecraft_backup.__source__)))
View
48 minecraft_backup/gui/dialogs/config_window.py
@@ -21,7 +21,6 @@
# Minecraft Backu Manager
from minecraft_backup.core.configuration import load_config
from minecraft_backup.core.configuration import save_new_config
-from minecraft_backup.gui.center_widget import center_widget
# PyQt4.QtGui
from PyQt4.QtGui import QDialog
@@ -30,54 +29,59 @@
from PyQt4.QtGui import QPushButton
from PyQt4.QtGui import QFileDialog
from PyQt4.QtGui import QDialogButtonBox
+from PyQt4.QtGui import QVBoxLayout
+from PyQt4.QtGui import QHBoxLayout
# PyQt4.QtCore
from PyQt4.QtCore import SIGNAL
-from PyQt4.QtCore import QRect
+from PyQt4.QtCore import QSize
class config_window(QDialog):
def __init__(self, parent=None):
QDialog.__init__(self, parent)
- self.setGeometry(0, 0, 500, 400)
- self.setMaximumSize(500, 400)
- self.setMinimumSize(500, 400)
+ self.setMaximumSize(QSize(0, 0))
+ self.setMinimumSize(500, 0)
self.setWindowTitle('Minecraft Backup Manager - Configuration')
- center_widget(self)
- # STANNDARD BUTTONS
+ #STANNDARD BUTTONS
self.button_box = QDialogButtonBox(self)
- self.button_box.setGeometry(QRect(150, 360, 341, 32))
self.button_box.setStandardButtons(QDialogButtonBox.Cancel |
QDialogButtonBox.Save)
- # LABELS
- self.label_save_folder = self.generate_label('Save Folder', 15, 20)
-
- # input_save_folder
+ #input_save_folder
self.input_save_folder = QLineEdit(self)
- self.input_save_folder.setGeometry(QRect(100, 17, 290, 25))
self.input_save_folder.setText(load_config('save_backup_folder'))
self.input_save_folder.setToolTip('Default folder save backup')
- # change_save_folder
+ #change_save_folder
self.btn_save_folder = QPushButton('Change', self)
- self.btn_save_folder.move(400, 16)
- # CONNECT SIGNALS
+ #LAYOUTS
+ #Save Folder Layout
+ self.layout_save_folder = QHBoxLayout()
+ self.layout_save_folder.addWidget(QLabel('Save folder:', self))
+ self.layout_save_folder.addWidget(self.input_save_folder)
+ self.layout_save_folder.addWidget(self.btn_save_folder)
+
+ #Button Box Layout
+ self.layout_button_box = QHBoxLayout()
+ self.layout_button_box.setContentsMargins(0, 25, 0, 0)
+ self.layout_button_box.addWidget(self.button_box)
+
+ #Vertical Container Layout
+ self.Vcontainer = QVBoxLayout(self)
+ self.Vcontainer.addLayout(self.layout_save_folder)
+ self.Vcontainer.addLayout(self.layout_button_box)
+
+ #CONNECT SIGNALS
self.connect(self.btn_save_folder, SIGNAL('clicked()'),
self.change_save_folder)
self.connect(self.button_box, SIGNAL('accepted()'),
self.save_configurations)
self.connect(self.button_box, SIGNAL('rejected()'), self.close)
- def generate_label(self, text, h, v):
- self.label = QLabel(self)
- self.label.setText(text)
- self.label.adjustSize()
- self.label.move(h, v)
-
def change_save_folder(self):
self.file_dialog = QFileDialog.getExistingDirectory(self,
'Change Default folder save backup',
View
81 minecraft_backup/gui/dialogs/new_backup_window.py
@@ -21,10 +21,10 @@
# Minecraft Backup Manager
from minecraft_backup.core.configuration import load_config
from minecraft_backup.core.backup_manager import make_backup_thread
-from minecraft_backup.gui.center_widget import center_widget
from minecraft_backup.gui.msg_box import msg_no_backup_name
from minecraft_backup.gui.msg_box import msg_name_exists
from minecraft_backup.gui.msg_box import msg_dir_exists
+from minecraft_backup.gui.msg_box import msg_IO_denied
from minecraft_backup.gui.msg_box import msg_make_backup_finishied
# PyQt4.QtGui
@@ -33,9 +33,12 @@
from PyQt4.QtGui import QLineEdit
from PyQt4.QtGui import QPushButton
from PyQt4.QtGui import QFileDialog
+from PyQt4.QtGui import QVBoxLayout
+from PyQt4.QtGui import QHBoxLayout
# PyQt4.QtCore
-from PyQt4.QtCore import QRect
+from PyQt4.QtCore import Qt
+from PyQt4.QtCore import QSize
from PyQt4.QtCore import SIGNAL
# os
@@ -46,51 +49,59 @@ class new_backup_window(QDialog):
def __init__(self, parent=None):
QDialog.__init__(self, parent)
- self.setGeometry(QRect(0, 0, 450, 200))
- self.setMaximumSize(450, 200)
- self.setMinimumSize(450, 200)
+ self.setMaximumSize(QSize(0, 0))
+ self.setMinimumSize(450, 0)
self.setWindowTitle('Create a new backup')
- center_widget(self)
- # STANNDARD BUTTONS
- self.btn_cancel = QPushButton('Cancel', self)
- self.btn_cancel.setGeometry(QRect(135, 160, 80, 28))
- self.btn_cancel.setAutoDefault(False)
-
- # btn_create_backup
- self.btn_create_backup = QPushButton('Create backup', self)
- self.btn_create_backup.setGeometry(QRect(235, 160, 200, 28))
-
- # LABELS
- self.generate_label('Name', 15, 20)
- self.generate_label('Save folder', 15, 70)
-
- # input_backup_name
+ #input_backup_name
self.input_backup_name = QLineEdit(self)
- self.input_backup_name.setGeometry(QRect(100, 17, 335, 25))
- self.input_backup_name.text().toUtf8()
self.input_backup_name.setToolTip('Name of backup')
self.input_backup_name.setFocus()
- # btn_change_save_backup
+ #btn_change_save_backup
self.btn_change_save_backup = QPushButton(
load_config('save_backup_folder'), self)
- self.btn_change_save_backup.setGeometry(QRect(100, 64, 335, 30))
+ self.btn_change_save_backup.sizeHint()
self.btn_change_save_backup.setAutoDefault(False)
- # CONNECT SIGNALS
+ #btn_cancel
+ self.btn_cancel = QPushButton('Cancel', self)
+ self.btn_cancel.setAutoDefault(False)
+
+ #btn_create_backup
+ self.btn_create_backup = QPushButton('Create backup', self)
+
+ #LAYOUTS
+ #Backup name layout
+ self.layout_name = QHBoxLayout()
+ self.layout_name.addWidget(QLabel('Name:', self))
+ self.layout_name.addWidget(self.input_backup_name)
+
+ #Save Backup Folder Layout
+ self.layout_save_folder = QHBoxLayout()
+ self.layout_save_folder.addWidget(QLabel('Save folder:', self))
+ self.layout_save_folder.addWidget(self.btn_change_save_backup,
+ Qt.AlignCenter)
+
+ #Standard Buttons Layout
+ self.layout_standard_buttons = QHBoxLayout()
+ self.layout_standard_buttons.setContentsMargins(90, 20, 0, 0)
+ self.layout_standard_buttons.addWidget(self.btn_cancel)
+ self.layout_standard_buttons.addWidget(self.btn_create_backup)
+
+ #Vertical Container Layout
+ self.Vcontainer = QVBoxLayout(self)
+ self.Vcontainer.addLayout(self.layout_name)
+ self.Vcontainer.addLayout(self.layout_save_folder)
+ self.Vcontainer.addLayout(self.layout_standard_buttons)
+
+ #CONNECT SIGNALS
self.connect(self.btn_change_save_backup, SIGNAL('clicked()'),
self.change_save_backup)
self.connect(self.btn_cancel, SIGNAL('clicked()'), self.close)
self.connect(self.btn_create_backup, SIGNAL('clicked()'),
self.create_backup)
- def generate_label(self, text, h, v):
- self.label = QLabel(self)
- self.label.setText(text)
- self.label.adjustSize()
- self.label.move(h, v)
-
def change_save_backup(self):
self.file_dialog = QFileDialog.getExistingDirectory(self,
'Select folder saved for backup',
@@ -109,11 +120,17 @@ def create_backup(self):
self.make_backup = make_backup_thread()
- # CONNECT SIGNALS
+ #--CONNECT SIGNALS--
+ #nameexists()
self.connect(self.make_backup, SIGNAL('nameexists()'),
lambda: msg_name_exists(self))
+ #direxists()
self.connect(self.make_backup, SIGNAL('direxists()'),
lambda: msg_dir_exists(self))
+ #IOdenied()
+ self.connect(self.make_backup, SIGNAL('IOdenied()'),
+ lambda: msg_IO_denied(self))
+ #makeend()
self.connect(self.make_backup, SIGNAL('makeend()'),
lambda: msg_make_backup_finishied(self))
View
86 minecraft_backup/gui/main.py
@@ -44,11 +44,13 @@
from PyQt4.QtGui import QListWidget
from PyQt4.QtGui import QListWidgetItem
from PyQt4.QtGui import QPushButton
+from PyQt4.QtGui import QMenu
# PyQt4.QtCore
from PyQt4.QtCore import QCoreApplication
from PyQt4.QtCore import SIGNAL
from PyQt4.QtCore import QRect
+from PyQt4.QtCore import QTextCodec
# os
from os import path
@@ -68,23 +70,26 @@ def __init__(self):
self.setMaximumSize(700, 520)
center_widget(self)
- self.header()
+ #Header
+ self.header_label = QLabel(self)
+ self.header_label.resize(700, 170)
+ self.header_label.setPixmap(QPixmap(IMAGES['header']))
+
+ #menu_about
+ self.menu_about = QMenu(self)
+ self.menu_about.addAction('About Minecraft Backup Manager',
+ lambda: self.open_about_minebackup())
+ self.menu_about.addAction('About Qt', lambda: msg_about_qt(self))
- # btn_config
+ #btn_config
self.btn_config = QPushButton(QIcon(IMAGES['config_icon']), '', self)
- if sys.platform == 'win32':
- self.btn_config.setGeometry(QRect(7, 27, 32, 32))
- else:
- self.btn_config.setGeometry(QRect(7, 7, 32, 32))
+ self.btn_config.setGeometry(QRect(7, 7, 32, 32))
self.btn_config.setToolTip('Configuration')
- # menu bar
- self.menu_bar = self.menuBar()
-
- self.menu_help = self.menu_bar.addMenu('About')
- self.menu_help.addAction('About Minecraft Backup Manager',
- lambda: self.open_about_minebackup())
- self.menu_help.addAction('About Qt', lambda: msg_about_qt(self))
+ #btn_about
+ self.btn_about = QPushButton('About', self)
+ self.btn_about.setGeometry(QRect(45, 7, 80, 32))
+ self.btn_about.setMenu(self.menu_about)
# list_backup
self.list_backup = QListWidget(self)
@@ -122,8 +127,6 @@ def load_backup_list(self):
self.list_backup.clear()
self.backup_list = load_backup_list()
- self.name_list = []
-
if self.backup_list is not False:
for backup in self.backup_list.values():
if path.exists(backup['path']):
@@ -131,17 +134,28 @@ def load_backup_list(self):
self.list_item.setToolTip('<b>Directory:</b> %s' %
backup['path'])
- self.name_list.append(backup['name'])
-
self.list_backup.addItem(self.list_item)
else:
msg_backup_folder_not_exists(self, backup['name'])
remove_backup_name(backup['name'])
- def header(self):
- self.header_label = QLabel(self)
- self.header_label.resize(700, 170)
- self.header_label.setPixmap(QPixmap(IMAGES['header']))
+ def remove_backup(self):
+ self.remove_question = msg_remove_backup(self)
+
+ if self.remove_question is not False:
+ self.backup_name = self.list_backup.currentItem().text()
+
+ remove_backup(unicode(self.backup_name))
+ self.load_backup_list()
+
+ def restore_backup(self):
+ self.restore_question = msg_restore_backup(self)
+
+ if self.restore_question is not False:
+ self.backup_name = self.list_backup.currentItem().text()
+
+ restore_backup(unicode(self.backup_name))
+ msg_restore_finishied(self, self.backup_name)
def enabled_buttons(self):
self.btn_remove_backup.setEnabled(True)
@@ -163,40 +177,16 @@ def open_new_backup(self):
self.connect(self.new_backup_window, SIGNAL('close()'),
self.load_backup_list)
- def backup_item_selector(self, item):
- for name in self.name_list:
- if item.text() == name:
- return self.name_list[self.name_list.index(name)]
- else:
- continue
-
- def remove_backup(self):
- self.remove_question = msg_remove_backup(self)
-
- if self.remove_question is not False:
- self.backup_item = self.list_backup.currentItem()
- self.backup_name = self.backup_item_selector(self.backup_item)
-
- remove_backup(self.backup_name)
- self.load_backup_list()
-
- def restore_backup(self):
- self.restore_question = msg_restore_backup(self)
-
- if self.restore_question is not False:
- self.backup_item = self.list_backup.currentItem()
- self.backup_name = self.backup_item_selector(self.backup_item)
-
- restore_backup(self.backup_name)
- msg_restore_finishied(self, self.backup_name)
-
def start():
app = QApplication(sys.argv)
QCoreApplication.setApplicationName('Minecraft Backup Manager')
QCoreApplication.setApplicationVersion('1.0')
+ #Set Application icon
app.setWindowIcon(QIcon(IMAGES['minebackup_icon']))
+ #Codec for QString
+ QTextCodec.setCodecForCStrings(QTextCodec.codecForName('utf-8'))
#Create configuration
configuration.config()
View
6 minecraft_backup/gui/msg_box.py
@@ -68,6 +68,12 @@ def msg_dir_exists(self):
exists_msg)
+def msg_IO_denied(self):
+ msg_io_denied = QMessageBox.warning(self, 'Permission denied',
+ """Permission denied, check if you have permission. Recommend closing
+ Minecraft for create backup""")
+
+
def msg_make_backup_finishied(self):
msg_backup_finishied = QMessageBox.information(self,
'Minecraft backup created',
View
BIN  minecraft_backup/images/header.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Please sign in to comment.
Something went wrong with that request. Please try again.