Merge pull request #6 from Leonidas-from-XIV/dynamic-ui

Dynamic UI
This commit is contained in:
Alex Yatskov 2011-10-29 12:29:27 -07:00
commit be90061fa5
24 changed files with 57 additions and 431 deletions

View File

@ -1,17 +0,0 @@
all: \
mangle/ui/resources_rc.py \
mangle/ui/about_ui.py \
mangle/ui/options_ui.py \
mangle/ui/book_ui.py
mangle/ui/resources_rc.py: dev/res/resources.qrc
pyrcc4 $< -o $@
mangle/ui/about_ui.py: dev/ui/about.ui
pyuic4 $< -o $@
mangle/ui/options_ui.py: dev/ui/options.ui
pyuic4 $< -o $@
mangle/ui/book_ui.py: dev/ui/book.ui
pyuic4 $< -o $@

View File

@ -1,14 +0,0 @@
<RCC>
<qresource prefix="img">
<file>img/add_directory.png</file>
<file>img/add_file.png</file>
<file>img/banner_about.png</file>
<file>img/export_book.png</file>
<file>img/file_new.png</file>
<file>img/file_open.png</file>
<file>img/remove_files.png</file>
<file>img/save_file.png</file>
<file>img/shift_down.png</file>
<file>img/shift_up.png</file>
</qresource>
</RCC>

View File

@ -14,12 +14,14 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from PyQt4 import QtGui import os.path
from ui.about_ui import Ui_DialogAbout from PyQt4 import QtGui, uic
import resources
class DialogAbout(QtGui.QDialog, Ui_DialogAbout): class DialogAbout(QtGui.QDialog):
def __init__(self, parent): def __init__(self, parent):
QtGui.QDialog.__init__(self, parent) QtGui.QDialog.__init__(self, parent)
self.setupUi(self) ui = uic.loadUi(os.path.join(resources.get_ui_path(), 'about.ui'), self)
self.label.setPixmap(QtGui.QPixmap(os.path.join(resources.get_image_path(), 'banner_about.png')))

View File

@ -14,16 +14,15 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import os import os, os.path
from PyQt4 import QtGui, QtCore, QtXml from PyQt4 import QtGui, QtCore, QtXml, uic
import image import image
from resources import get_ui_path, get_image_path
from image import ImageFlags from image import ImageFlags
from about import DialogAbout from about import DialogAbout
from options import DialogOptions from options import DialogOptions
from convert import DialogConvert from convert import DialogConvert
from ui.book_ui import Ui_MainWindowBook
class Book: class Book:
DefaultDevice = 'Kindle 3' DefaultDevice = 'Kindle 3'
@ -105,10 +104,19 @@ class Book:
self.images.append(item.attribute('filename')) self.images.append(item.attribute('filename'))
class MainWindowBook(QtGui.QMainWindow, Ui_MainWindowBook): class MainWindowBook(QtGui.QMainWindow):
def __init__(self, filename=None): def __init__(self, filename=None):
QtGui.QMainWindow.__init__(self) QtGui.QMainWindow.__init__(self)
self.setupUi(self) ui = uic.loadUi(os.path.join(get_ui_path(), 'book.ui'), self)
self._setIcon(self.actionFileNew, 'file_new')
self._setIcon(self.actionFileOpen, 'file_open')
self._setIcon(self.actionFileSave, 'save_file')
self._setIcon(self.actionBookAddFiles, 'add_file')
self._setIcon(self.actionBookAddDirectory, 'add_directory')
self._setIcon(self.actionBookRemove, 'remove_files')
self._setIcon(self.actionBookShiftUp, 'shift_up')
self._setIcon(self.actionBookShiftDown, 'shift_down')
self._setIcon(self.actionBookExport, 'export_book')
self.connect(self.actionFileNew, QtCore.SIGNAL('triggered()'), self.onFileNew) self.connect(self.actionFileNew, QtCore.SIGNAL('triggered()'), self.onFileNew)
self.connect(self.actionFileOpen, QtCore.SIGNAL('triggered()'), self.onFileOpen) self.connect(self.actionFileOpen, QtCore.SIGNAL('triggered()'), self.onFileOpen)
self.connect(self.actionFileSave, QtCore.SIGNAL('triggered()'), self.onFileSave) self.connect(self.actionFileSave, QtCore.SIGNAL('triggered()'), self.onFileSave)
@ -131,6 +139,11 @@ class MainWindowBook(QtGui.QMainWindow, Ui_MainWindowBook):
self.loadBook(filename) self.loadBook(filename)
@staticmethod
def _setIcon(action, name):
action.setIcon(QtGui.QIcon(os.path.join(get_image_path(), '%s.png' % name)))
def closeEvent(self, event): def closeEvent(self, event):
if not self.saveIfNeeded(): if not self.saveIfNeeded():
event.ignore() event.ignore()

View File

@ -13,18 +13,19 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import os.path
from PyQt4 import QtGui, QtCore from PyQt4 import QtGui, QtCore, uic
from image import ImageFlags from image import ImageFlags
from ui.options_ui import Ui_DialogOptions import resources
class DialogOptions(QtGui.QDialog, Ui_DialogOptions): class DialogOptions(QtGui.QDialog):
def __init__(self, parent, book): def __init__(self, parent, book):
QtGui.QDialog.__init__(self, parent) QtGui.QDialog.__init__(self, parent)
self.book = book self.book = book
self.setupUi(self) ui = uic.loadUi(os.path.join(resources.get_ui_path(), 'options.ui'), self)
self.connect(self, QtCore.SIGNAL('accepted()'), self.onAccept) self.connect(self, QtCore.SIGNAL('accepted()'), self.onAccept)
self.moveOptionsToDialog() self.moveOptionsToDialog()

View File

@ -0,0 +1,25 @@
# Copyright (C) 2011 Marek Kubica <marek@xivilization.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os.path
def get_resource_path():
return os.path.dirname(__file__)
def get_ui_path():
return os.path.join(get_resource_path(), 'ui')
def get_image_path():
return os.path.join(get_resource_path(), 'images')

View File

View File

Before

Width:  |  Height:  |  Size: 667 B

After

Width:  |  Height:  |  Size: 667 B

View File

Before

Width:  |  Height:  |  Size: 570 B

After

Width:  |  Height:  |  Size: 570 B

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 827 B

After

Width:  |  Height:  |  Size: 827 B

View File

Before

Width:  |  Height:  |  Size: 438 B

After

Width:  |  Height:  |  Size: 438 B

View File

Before

Width:  |  Height:  |  Size: 504 B

After

Width:  |  Height:  |  Size: 504 B

View File

Before

Width:  |  Height:  |  Size: 709 B

After

Width:  |  Height:  |  Size: 709 B

View File

Before

Width:  |  Height:  |  Size: 719 B

After

Width:  |  Height:  |  Size: 719 B

View File

Before

Width:  |  Height:  |  Size: 646 B

After

Width:  |  Height:  |  Size: 646 B

View File

Before

Width:  |  Height:  |  Size: 615 B

After

Width:  |  Height:  |  Size: 615 B

View File

View File

@ -24,11 +24,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label"/>
<property name="pixmap">
<pixmap resource="../res/resources.qrc">:/img/img/banner_about.png</pixmap>
</property>
</widget>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">

View File

@ -33,7 +33,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>800</width>
<height>25</height> <height>29</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menu_File"> <widget class="QMenu" name="menu_File">
@ -107,10 +107,6 @@
<addaction name="actionBookExport"/> <addaction name="actionBookExport"/>
</widget> </widget>
<action name="actionFileNew"> <action name="actionFileNew">
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/img/img/file_new.png</normaloff>:/img/img/file_new.png</iconset>
</property>
<property name="text"> <property name="text">
<string>&amp;New</string> <string>&amp;New</string>
</property> </property>
@ -122,10 +118,6 @@
</property> </property>
</action> </action>
<action name="actionFileOpen"> <action name="actionFileOpen">
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/img/img/file_open.png</normaloff>:/img/img/file_open.png</iconset>
</property>
<property name="text"> <property name="text">
<string>&amp;Open...</string> <string>&amp;Open...</string>
</property> </property>
@ -137,10 +129,6 @@
</property> </property>
</action> </action>
<action name="actionFileSave"> <action name="actionFileSave">
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/img/img/save_file.png</normaloff>:/img/img/save_file.png</iconset>
</property>
<property name="text"> <property name="text">
<string>&amp;Save</string> <string>&amp;Save</string>
</property> </property>
@ -176,10 +164,6 @@
</property> </property>
</action> </action>
<action name="actionBookRemove"> <action name="actionBookRemove">
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/img/img/remove_files.png</normaloff>:/img/img/remove_files.png</iconset>
</property>
<property name="text"> <property name="text">
<string>&amp;Remove</string> <string>&amp;Remove</string>
</property> </property>
@ -191,10 +175,6 @@
</property> </property>
</action> </action>
<action name="actionBookExport"> <action name="actionBookExport">
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/img/img/export_book.png</normaloff>:/img/img/export_book.png</iconset>
</property>
<property name="text"> <property name="text">
<string>&amp;Export...</string> <string>&amp;Export...</string>
</property> </property>
@ -222,10 +202,6 @@
</property> </property>
</action> </action>
<action name="actionBookAddFiles"> <action name="actionBookAddFiles">
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/img/img/add_file.png</normaloff>:/img/img/add_file.png</iconset>
</property>
<property name="text"> <property name="text">
<string>&amp;Files...</string> <string>&amp;Files...</string>
</property> </property>
@ -237,10 +213,6 @@
</property> </property>
</action> </action>
<action name="actionBookAddDirectory"> <action name="actionBookAddDirectory">
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/img/img/add_directory.png</normaloff>:/img/img/add_directory.png</iconset>
</property>
<property name="text"> <property name="text">
<string>&amp;Directory...</string> <string>&amp;Directory...</string>
</property> </property>
@ -252,10 +224,6 @@
</property> </property>
</action> </action>
<action name="actionBookShiftUp"> <action name="actionBookShiftUp">
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/img/img/shift_up.png</normaloff>:/img/img/shift_up.png</iconset>
</property>
<property name="text"> <property name="text">
<string>&amp;Up</string> <string>&amp;Up</string>
</property> </property>
@ -267,10 +235,6 @@
</property> </property>
</action> </action>
<action name="actionBookShiftDown"> <action name="actionBookShiftDown">
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/img/img/shift_down.png</normaloff>:/img/img/shift_down.png</iconset>
</property>
<property name="text"> <property name="text">
<string>&amp;Down</string> <string>&amp;Down</string>
</property> </property>

View File

@ -1,70 +0,0 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'dev/ui/about.ui'
#
# Created: Sun Aug 28 16:12:10 2011
# by: PyQt4 UI code generator 4.8.5
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
class Ui_DialogAbout(object):
def setupUi(self, DialogAbout):
DialogAbout.setObjectName(_fromUtf8("DialogAbout"))
DialogAbout.resize(470, 200)
DialogAbout.setWindowTitle(QtGui.QApplication.translate("DialogAbout", "About", None, QtGui.QApplication.UnicodeUTF8))
self.horizontalLayout = QtGui.QHBoxLayout(DialogAbout)
self.horizontalLayout.setSpacing(0)
self.horizontalLayout.setSizeConstraint(QtGui.QLayout.SetFixedSize)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.label = QtGui.QLabel(DialogAbout)
self.label.setPixmap(QtGui.QPixmap(_fromUtf8(":/img/img/banner_about.png")))
self.label.setObjectName(_fromUtf8("label"))
self.horizontalLayout.addWidget(self.label)
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setMargin(9)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.labelReadme = QtGui.QLabel(DialogAbout)
self.labelReadme.setMinimumSize(QtCore.QSize(350, 0))
self.labelReadme.setText(QtGui.QApplication.translate("DialogAbout", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:14pt;\">Mangle</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Version 2.2</p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Manga processor by Alex Yatskov for the Kindle e-book reader. Please see <span style=\" font-style:italic;\">license.txt</span> for licensing information. Visit the homepage at <a href=\"http://foosoft.net/mangle\"><span style=\" text-decoration: underline; color:#0000ff;\">http://foosoft.net/mangle</span></a>.</p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
self.labelReadme.setWordWrap(True)
self.labelReadme.setOpenExternalLinks(True)
self.labelReadme.setObjectName(_fromUtf8("labelReadme"))
self.verticalLayout.addWidget(self.labelReadme)
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.verticalLayout.addItem(spacerItem)
spacerItem1 = QtGui.QSpacerItem(0, 0, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem1)
self.buttonBox = QtGui.QDialogButtonBox(DialogAbout)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.buttonBox.sizePolicy().hasHeightForWidth())
self.buttonBox.setSizePolicy(sizePolicy)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.verticalLayout.addWidget(self.buttonBox)
self.horizontalLayout.addLayout(self.verticalLayout)
self.retranslateUi(DialogAbout)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), DialogAbout.accept)
QtCore.QMetaObject.connectSlotsByName(DialogAbout)
def retranslateUi(self, DialogAbout):
pass
import resources_rc

View File

@ -1,182 +0,0 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'dev/ui/book.ui'
#
# Created: Sat Aug 7 12:28:58 2010
# by: PyQt4 UI code generator 4.7.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_MainWindowBook(object):
def setupUi(self, MainWindowBook):
MainWindowBook.setObjectName("MainWindowBook")
MainWindowBook.resize(800, 600)
MainWindowBook.setAcceptDrops(True)
self.centralwidget = QtGui.QWidget(MainWindowBook)
self.centralwidget.setObjectName("centralwidget")
self.horizontalLayout = QtGui.QHBoxLayout(self.centralwidget)
self.horizontalLayout.setObjectName("horizontalLayout")
self.listWidgetFiles = QtGui.QListWidget(self.centralwidget)
self.listWidgetFiles.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
self.listWidgetFiles.setObjectName("listWidgetFiles")
self.horizontalLayout.addWidget(self.listWidgetFiles)
MainWindowBook.setCentralWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(MainWindowBook)
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 25))
self.menubar.setObjectName("menubar")
self.menu_File = QtGui.QMenu(self.menubar)
self.menu_File.setObjectName("menu_File")
self.menu_Book = QtGui.QMenu(self.menubar)
self.menu_Book.setObjectName("menu_Book")
self.menu_Add = QtGui.QMenu(self.menu_Book)
self.menu_Add.setObjectName("menu_Add")
self.menu_Shift = QtGui.QMenu(self.menu_Book)
self.menu_Shift.setObjectName("menu_Shift")
self.menu_Help = QtGui.QMenu(self.menubar)
self.menu_Help.setObjectName("menu_Help")
MainWindowBook.setMenuBar(self.menubar)
self.toolBar = QtGui.QToolBar(MainWindowBook)
self.toolBar.setObjectName("toolBar")
MainWindowBook.addToolBar(QtCore.Qt.ToolBarArea(QtCore.Qt.TopToolBarArea), self.toolBar)
self.actionFileNew = QtGui.QAction(MainWindowBook)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/img/img/file_new.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionFileNew.setIcon(icon)
self.actionFileNew.setObjectName("actionFileNew")
self.actionFileOpen = QtGui.QAction(MainWindowBook)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/img/img/file_open.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionFileOpen.setIcon(icon1)
self.actionFileOpen.setObjectName("actionFileOpen")
self.actionFileSave = QtGui.QAction(MainWindowBook)
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(":/img/img/save_file.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionFileSave.setIcon(icon2)
self.actionFileSave.setObjectName("actionFileSave")
self.actionFileSaveAs = QtGui.QAction(MainWindowBook)
self.actionFileSaveAs.setObjectName("actionFileSaveAs")
self.actionFileExit = QtGui.QAction(MainWindowBook)
self.actionFileExit.setObjectName("actionFileExit")
self.actionBookOptions = QtGui.QAction(MainWindowBook)
self.actionBookOptions.setObjectName("actionBookOptions")
self.actionBookRemove = QtGui.QAction(MainWindowBook)
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap(":/img/img/remove_files.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionBookRemove.setIcon(icon3)
self.actionBookRemove.setObjectName("actionBookRemove")
self.actionBookExport = QtGui.QAction(MainWindowBook)
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap(":/img/img/export_book.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionBookExport.setIcon(icon4)
self.actionBookExport.setObjectName("actionBookExport")
self.actionHelpHomepage = QtGui.QAction(MainWindowBook)
self.actionHelpHomepage.setObjectName("actionHelpHomepage")
self.actionHelpAbout = QtGui.QAction(MainWindowBook)
self.actionHelpAbout.setObjectName("actionHelpAbout")
self.actionBookAddFiles = QtGui.QAction(MainWindowBook)
icon5 = QtGui.QIcon()
icon5.addPixmap(QtGui.QPixmap(":/img/img/add_file.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionBookAddFiles.setIcon(icon5)
self.actionBookAddFiles.setObjectName("actionBookAddFiles")
self.actionBookAddDirectory = QtGui.QAction(MainWindowBook)
icon6 = QtGui.QIcon()
icon6.addPixmap(QtGui.QPixmap(":/img/img/add_directory.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionBookAddDirectory.setIcon(icon6)
self.actionBookAddDirectory.setObjectName("actionBookAddDirectory")
self.actionBookShiftUp = QtGui.QAction(MainWindowBook)
icon7 = QtGui.QIcon()
icon7.addPixmap(QtGui.QPixmap(":/img/img/shift_up.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionBookShiftUp.setIcon(icon7)
self.actionBookShiftUp.setObjectName("actionBookShiftUp")
self.actionBookShiftDown = QtGui.QAction(MainWindowBook)
icon8 = QtGui.QIcon()
icon8.addPixmap(QtGui.QPixmap(":/img/img/shift_down.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionBookShiftDown.setIcon(icon8)
self.actionBookShiftDown.setObjectName("actionBookShiftDown")
self.menu_File.addAction(self.actionFileNew)
self.menu_File.addAction(self.actionFileOpen)
self.menu_File.addAction(self.actionFileSave)
self.menu_File.addAction(self.actionFileSaveAs)
self.menu_File.addSeparator()
self.menu_File.addAction(self.actionFileExit)
self.menu_Add.addAction(self.actionBookAddFiles)
self.menu_Add.addAction(self.actionBookAddDirectory)
self.menu_Shift.addAction(self.actionBookShiftUp)
self.menu_Shift.addAction(self.actionBookShiftDown)
self.menu_Book.addAction(self.actionBookOptions)
self.menu_Book.addSeparator()
self.menu_Book.addAction(self.menu_Add.menuAction())
self.menu_Book.addAction(self.actionBookRemove)
self.menu_Book.addAction(self.menu_Shift.menuAction())
self.menu_Book.addSeparator()
self.menu_Book.addAction(self.actionBookExport)
self.menu_Help.addAction(self.actionHelpHomepage)
self.menu_Help.addAction(self.actionHelpAbout)
self.menubar.addAction(self.menu_File.menuAction())
self.menubar.addAction(self.menu_Book.menuAction())
self.menubar.addAction(self.menu_Help.menuAction())
self.toolBar.addAction(self.actionFileNew)
self.toolBar.addAction(self.actionFileOpen)
self.toolBar.addAction(self.actionFileSave)
self.toolBar.addSeparator()
self.toolBar.addAction(self.actionBookAddFiles)
self.toolBar.addAction(self.actionBookAddDirectory)
self.toolBar.addAction(self.actionBookRemove)
self.toolBar.addAction(self.actionBookShiftUp)
self.toolBar.addAction(self.actionBookShiftDown)
self.toolBar.addSeparator()
self.toolBar.addAction(self.actionBookExport)
self.retranslateUi(MainWindowBook)
QtCore.QObject.connect(self.actionFileExit, QtCore.SIGNAL("triggered()"), MainWindowBook.close)
QtCore.QMetaObject.connectSlotsByName(MainWindowBook)
def retranslateUi(self, MainWindowBook):
MainWindowBook.setWindowTitle(QtGui.QApplication.translate("MainWindowBook", "Mangle", None, QtGui.QApplication.UnicodeUTF8))
self.menu_File.setTitle(QtGui.QApplication.translate("MainWindowBook", "&File", None, QtGui.QApplication.UnicodeUTF8))
self.menu_Book.setTitle(QtGui.QApplication.translate("MainWindowBook", "&Book", None, QtGui.QApplication.UnicodeUTF8))
self.menu_Add.setTitle(QtGui.QApplication.translate("MainWindowBook", "&Add", None, QtGui.QApplication.UnicodeUTF8))
self.menu_Shift.setTitle(QtGui.QApplication.translate("MainWindowBook", "&Shift", None, QtGui.QApplication.UnicodeUTF8))
self.menu_Help.setTitle(QtGui.QApplication.translate("MainWindowBook", "&Help", None, QtGui.QApplication.UnicodeUTF8))
self.toolBar.setWindowTitle(QtGui.QApplication.translate("MainWindowBook", "toolBar", None, QtGui.QApplication.UnicodeUTF8))
self.actionFileNew.setText(QtGui.QApplication.translate("MainWindowBook", "&New", None, QtGui.QApplication.UnicodeUTF8))
self.actionFileNew.setToolTip(QtGui.QApplication.translate("MainWindowBook", "New book", None, QtGui.QApplication.UnicodeUTF8))
self.actionFileNew.setShortcut(QtGui.QApplication.translate("MainWindowBook", "Ctrl+N", None, QtGui.QApplication.UnicodeUTF8))
self.actionFileOpen.setText(QtGui.QApplication.translate("MainWindowBook", "&Open...", None, QtGui.QApplication.UnicodeUTF8))
self.actionFileOpen.setToolTip(QtGui.QApplication.translate("MainWindowBook", "Open book", None, QtGui.QApplication.UnicodeUTF8))
self.actionFileOpen.setShortcut(QtGui.QApplication.translate("MainWindowBook", "Ctrl+O", None, QtGui.QApplication.UnicodeUTF8))
self.actionFileSave.setText(QtGui.QApplication.translate("MainWindowBook", "&Save", None, QtGui.QApplication.UnicodeUTF8))
self.actionFileSave.setToolTip(QtGui.QApplication.translate("MainWindowBook", "Save book", None, QtGui.QApplication.UnicodeUTF8))
self.actionFileSave.setShortcut(QtGui.QApplication.translate("MainWindowBook", "Ctrl+S", None, QtGui.QApplication.UnicodeUTF8))
self.actionFileSaveAs.setText(QtGui.QApplication.translate("MainWindowBook", "Save &as...", None, QtGui.QApplication.UnicodeUTF8))
self.actionFileSaveAs.setToolTip(QtGui.QApplication.translate("MainWindowBook", "Save book as", None, QtGui.QApplication.UnicodeUTF8))
self.actionFileSaveAs.setShortcut(QtGui.QApplication.translate("MainWindowBook", "Ctrl+Shift+S", None, QtGui.QApplication.UnicodeUTF8))
self.actionFileExit.setText(QtGui.QApplication.translate("MainWindowBook", "&Exit", None, QtGui.QApplication.UnicodeUTF8))
self.actionFileExit.setShortcut(QtGui.QApplication.translate("MainWindowBook", "Ctrl+Q", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookOptions.setText(QtGui.QApplication.translate("MainWindowBook", "&Options...", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookRemove.setText(QtGui.QApplication.translate("MainWindowBook", "&Remove", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookRemove.setToolTip(QtGui.QApplication.translate("MainWindowBook", "Remove files", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookRemove.setShortcut(QtGui.QApplication.translate("MainWindowBook", "Del", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookExport.setText(QtGui.QApplication.translate("MainWindowBook", "&Export...", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookExport.setToolTip(QtGui.QApplication.translate("MainWindowBook", "Export book", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookExport.setShortcut(QtGui.QApplication.translate("MainWindowBook", "Ctrl+E", None, QtGui.QApplication.UnicodeUTF8))
self.actionHelpHomepage.setText(QtGui.QApplication.translate("MainWindowBook", "&Homepage...", None, QtGui.QApplication.UnicodeUTF8))
self.actionHelpAbout.setText(QtGui.QApplication.translate("MainWindowBook", "&About...", None, QtGui.QApplication.UnicodeUTF8))
self.actionHelpAbout.setToolTip(QtGui.QApplication.translate("MainWindowBook", "About", None, QtGui.QApplication.UnicodeUTF8))
self.actionHelpAbout.setShortcut(QtGui.QApplication.translate("MainWindowBook", "F1", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookAddFiles.setText(QtGui.QApplication.translate("MainWindowBook", "&Files...", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookAddFiles.setToolTip(QtGui.QApplication.translate("MainWindowBook", "Add files", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookAddFiles.setShortcut(QtGui.QApplication.translate("MainWindowBook", "Ctrl+F", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookAddDirectory.setText(QtGui.QApplication.translate("MainWindowBook", "&Directory...", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookAddDirectory.setToolTip(QtGui.QApplication.translate("MainWindowBook", "Add directory", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookAddDirectory.setShortcut(QtGui.QApplication.translate("MainWindowBook", "Ctrl+D", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookShiftUp.setText(QtGui.QApplication.translate("MainWindowBook", "&Up", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookShiftUp.setToolTip(QtGui.QApplication.translate("MainWindowBook", "Shift files up", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookShiftUp.setShortcut(QtGui.QApplication.translate("MainWindowBook", "Ctrl+PgUp", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookShiftDown.setText(QtGui.QApplication.translate("MainWindowBook", "&Down", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookShiftDown.setToolTip(QtGui.QApplication.translate("MainWindowBook", "Shift files down", None, QtGui.QApplication.UnicodeUTF8))
self.actionBookShiftDown.setShortcut(QtGui.QApplication.translate("MainWindowBook", "Ctrl+PgDown", None, QtGui.QApplication.UnicodeUTF8))
import resources_rc

View File

@ -1,92 +0,0 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'dev/ui/options.ui'
#
# Created: Sat Sep 11 12:04:56 2010
# by: PyQt4 UI code generator 4.7.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_DialogOptions(object):
def setupUi(self, DialogOptions):
DialogOptions.setObjectName("DialogOptions")
DialogOptions.resize(350, 350)
self.verticalLayout = QtGui.QVBoxLayout(DialogOptions)
self.verticalLayout.setObjectName("verticalLayout")
self.groupBox = QtGui.QGroupBox(DialogOptions)
self.groupBox.setFlat(False)
self.groupBox.setObjectName("groupBox")
self.formLayout = QtGui.QFormLayout(self.groupBox)
self.formLayout.setObjectName("formLayout")
self.label = QtGui.QLabel(self.groupBox)
self.label.setObjectName("label")
self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label)
self.lineEditTitle = QtGui.QLineEdit(self.groupBox)
self.lineEditTitle.setObjectName("lineEditTitle")
self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.lineEditTitle)
self.verticalLayout.addWidget(self.groupBox)
self.groupBox_2 = QtGui.QGroupBox(DialogOptions)
self.groupBox_2.setObjectName("groupBox_2")
self.verticalLayout_2 = QtGui.QVBoxLayout(self.groupBox_2)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.formLayout_2 = QtGui.QFormLayout()
self.formLayout_2.setObjectName("formLayout_2")
self.label_2 = QtGui.QLabel(self.groupBox_2)
self.label_2.setObjectName("label_2")
self.formLayout_2.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_2)
self.comboBoxDevice = QtGui.QComboBox(self.groupBox_2)
self.comboBoxDevice.setObjectName("comboBoxDevice")
self.comboBoxDevice.addItem("")
self.comboBoxDevice.addItem("")
self.comboBoxDevice.addItem("")
self.comboBoxDevice.addItem("")
self.comboBoxDevice.addItem("")
self.formLayout_2.setWidget(0, QtGui.QFormLayout.FieldRole, self.comboBoxDevice)
self.verticalLayout_2.addLayout(self.formLayout_2)
self.checkboxOverwrite = QtGui.QCheckBox(self.groupBox_2)
self.checkboxOverwrite.setObjectName("checkboxOverwrite")
self.verticalLayout_2.addWidget(self.checkboxOverwrite)
self.checkboxOrient = QtGui.QCheckBox(self.groupBox_2)
self.checkboxOrient.setObjectName("checkboxOrient")
self.verticalLayout_2.addWidget(self.checkboxOrient)
self.checkboxResize = QtGui.QCheckBox(self.groupBox_2)
self.checkboxResize.setObjectName("checkboxResize")
self.verticalLayout_2.addWidget(self.checkboxResize)
self.checkboxQuantize = QtGui.QCheckBox(self.groupBox_2)
self.checkboxQuantize.setObjectName("checkboxQuantize")
self.verticalLayout_2.addWidget(self.checkboxQuantize)
self.checkboxFrame = QtGui.QCheckBox(self.groupBox_2)
self.checkboxFrame.setObjectName("checkboxFrame")
self.verticalLayout_2.addWidget(self.checkboxFrame)
self.verticalLayout.addWidget(self.groupBox_2)
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.buttonBox = QtGui.QDialogButtonBox(DialogOptions)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.verticalLayout.addWidget(self.buttonBox)
self.retranslateUi(DialogOptions)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), DialogOptions.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), DialogOptions.reject)
QtCore.QMetaObject.connectSlotsByName(DialogOptions)
def retranslateUi(self, DialogOptions):
DialogOptions.setWindowTitle(QtGui.QApplication.translate("DialogOptions", "Options", None, QtGui.QApplication.UnicodeUTF8))
self.groupBox.setTitle(QtGui.QApplication.translate("DialogOptions", "Book", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("DialogOptions", "Title", None, QtGui.QApplication.UnicodeUTF8))
self.groupBox_2.setTitle(QtGui.QApplication.translate("DialogOptions", "Export", None, QtGui.QApplication.UnicodeUTF8))
self.label_2.setText(QtGui.QApplication.translate("DialogOptions", "Device", None, QtGui.QApplication.UnicodeUTF8))
self.comboBoxDevice.setItemText(0, QtGui.QApplication.translate("DialogOptions", "Kindle 1", None, QtGui.QApplication.UnicodeUTF8))
self.comboBoxDevice.setItemText(1, QtGui.QApplication.translate("DialogOptions", "Kindle 2", None, QtGui.QApplication.UnicodeUTF8))
self.comboBoxDevice.setItemText(2, QtGui.QApplication.translate("DialogOptions", "Kindle 3", None, QtGui.QApplication.UnicodeUTF8))
self.comboBoxDevice.setItemText(3, QtGui.QApplication.translate("DialogOptions", "Kindle DX", None, QtGui.QApplication.UnicodeUTF8))
self.comboBoxDevice.setItemText(4, QtGui.QApplication.translate("DialogOptions", "Kindle DXG", None, QtGui.QApplication.UnicodeUTF8))
self.checkboxOverwrite.setText(QtGui.QApplication.translate("DialogOptions", "Overwrite existing files", None, QtGui.QApplication.UnicodeUTF8))
self.checkboxOrient.setText(QtGui.QApplication.translate("DialogOptions", "Orient images to match aspect ratio", None, QtGui.QApplication.UnicodeUTF8))
self.checkboxResize.setText(QtGui.QApplication.translate("DialogOptions", "Resize images to center on screen", None, QtGui.QApplication.UnicodeUTF8))
self.checkboxQuantize.setText(QtGui.QApplication.translate("DialogOptions", "Dither images to match device palette", None, QtGui.QApplication.UnicodeUTF8))
self.checkboxFrame.setText(QtGui.QApplication.translate("DialogOptions", "Draw frame around images", None, QtGui.QApplication.UnicodeUTF8))