Merge request cleanups

This commit is contained in:
Tim Bentley 2010-09-26 09:38:11 +01:00
parent e33e4cb7ff
commit 2f75087e40
8 changed files with 142 additions and 7 deletions

View File

@ -273,7 +273,6 @@ def resize_image(image, width, height, background=QtCore.Qt.black):
painter = QtGui.QPainter(new_image) painter = QtGui.QPainter(new_image)
painter.drawImage((width - realw) / 2, (height - realh) / 2, preview) painter.drawImage((width - realw) / 2, (height - realh) / 2, preview)
image_cache[image_cache_key] = new_image image_cache[image_cache_key] = new_image
print image_cache
return new_image return new_image
def check_item_selected(list_widget, message): def check_item_selected(list_widget, message):

View File

@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'filerenamedialog.ui'
#
# Created: Sat Sep 25 16:20:30 2010
# by: PyQt4 UI code generator 4.7.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_FileRenameDialog(object):
def setupUi(self, FileRenameDialog):
FileRenameDialog.setObjectName("FileRenameDialog")
FileRenameDialog.resize(400, 87)
self.buttonBox = QtGui.QDialogButtonBox(FileRenameDialog)
self.buttonBox.setGeometry(QtCore.QRect(210, 50, 171, 25))
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.widget = QtGui.QWidget(FileRenameDialog)
self.widget.setGeometry(QtCore.QRect(10, 10, 381, 35))
self.widget.setObjectName("widget")
self.horizontalLayout = QtGui.QHBoxLayout(self.widget)
self.horizontalLayout.setObjectName("horizontalLayout")
self.FileRenameLabel = QtGui.QLabel(self.widget)
self.FileRenameLabel.setObjectName("FileRenameLabel")
self.horizontalLayout.addWidget(self.FileRenameLabel)
self.FileNameEdit = QtGui.QLineEdit(self.widget)
self.FileNameEdit.setObjectName("FileNameEdit")
self.horizontalLayout.addWidget(self.FileNameEdit)
self.retranslateUi(FileRenameDialog)
QtCore.QMetaObject.connectSlotsByName(FileRenameDialog)
def retranslateUi(self, FileRenameDialog):
FileRenameDialog.setWindowTitle(QtGui.QApplication.translate("FileRenameDialog", "File Rename", None, QtGui.QApplication.UnicodeUTF8))
self.FileRenameLabel.setText(QtGui.QApplication.translate("FileRenameDialog", "New File Name:", None, QtGui.QApplication.UnicodeUTF8))

View File

@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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; version 2 of the License. #
# #
# 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, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
from PyQt4 import QtCore, QtGui
from filerenamedialog import Ui_FileRenameDialog
from openlp.core.lib import translate
class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog):
"""
The exception dialog
"""
def __init__(self, parent):
QtGui.QDialog.__init__(self, parent)
self.setupUi(self)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'),
self.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
self.reject)

View File

@ -142,9 +142,12 @@ class ThemeManager(QtGui.QWidget):
themeName = unicode(item.text()) themeName = unicode(item.text())
self.deleteAction.setVisible(False) self.deleteAction.setVisible(False)
self.renameAction.setVisible(False) self.renameAction.setVisible(False)
self.globalAction.setVisible(False)
# If default theme restrict actions
if realThemeName == themeName: if realThemeName == themeName:
self.deleteAction.setVisible(True) self.deleteAction.setVisible(True)
self.renameAction.setVisible(True) self.renameAction.setVisible(True)
self.globalAction.setVisible(True)
action = self.menu.exec_(self.themeListWidget.mapToGlobal(point)) action = self.menu.exec_(self.themeListWidget.mapToGlobal(point))
if action == self.editAction: if action == self.editAction:
self.onEditTheme() self.onEditTheme()
@ -155,9 +158,9 @@ class ThemeManager(QtGui.QWidget):
if action == self.deleteAction: if action == self.deleteAction:
self.onDeleteTheme() self.onDeleteTheme()
if action == self.globalAction: if action == self.globalAction:
self. self.changeGlobalFromScreen() self.changeGlobalFromScreen()
if action == self.exportAction: if action == self.exportAction:
self. self.onExportTheme() self.onExportTheme()
def changeGlobalFromTab(self, themeName): def changeGlobalFromTab(self, themeName):
""" """
@ -323,7 +326,7 @@ class ThemeManager(QtGui.QWidget):
item.data(QtCore.Qt.UserRole).toString()) item.data(QtCore.Qt.UserRole).toString())
self.amendThemeForm.exec_() self.amendThemeForm.exec_()
def onDeleteTheme(self, onlyDelete=True): def onDeleteTheme(self):
""" """
Delete a theme Delete a theme
""" """

View File

@ -35,7 +35,7 @@ class ImagePlugin(Plugin):
log.info(u'Image Plugin loaded') log.info(u'Image Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
Plugin.__init__(self, u'Images', u'1.9.3', plugin_helpers) Plugin.__init__(self, u'Images', u'1.9.4', plugin_helpers)
self.weight = -7 self.weight = -7
self.icon_path = u':/plugins/plugin_images.png' self.icon_path = u':/plugins/plugin_images.png'
self.icon = build_icon(self.icon_path) self.icon = build_icon(self.icon_path)

View File

@ -187,7 +187,6 @@ class ImageMediaItem(MediaManagerItem):
for item in items: for item in items:
bitem = self.listView.item(item.row()) bitem = self.listView.item(item.row())
filename = unicode(bitem.data(QtCore.Qt.UserRole).toString()) filename = unicode(bitem.data(QtCore.Qt.UserRole).toString())
frame = QtGui.QImage(unicode(filename))
self.parent.liveController.display.image(filename) self.parent.liveController.display.image(filename)
self.resetButton.setVisible(True) self.resetButton.setVisible(True)

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FileRenameDialog</class>
<widget class="QWidget" name="FileRenameDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>87</height>
</rect>
</property>
<property name="windowTitle">
<string>File Rename</string>
</property>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="geometry">
<rect>
<x>210</x>
<y>50</y>
<width>171</width>
<height>25</height>
</rect>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>381</width>
<height>27</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="FileRenameLabel">
<property name="text">
<string>New File Name:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="FileNameEdit"/>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>