openlp/openlp/core/ui/filerenamedialog.py

67 lines
3.6 KiB
Python
Raw Normal View History

2010-09-26 08:38:11 +00:00
# -*- coding: utf-8 -*-
2012-12-29 13:15:42 +00:00
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
2010-09-26 08:38:11 +00:00
2010-09-26 12:23:50 +00:00
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
2012-12-29 20:56:56 +00:00
# Copyright (c) 2008-2013 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
2012-11-11 21:16:14 +00:00
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
2012-10-21 13:16:22 +00:00
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
# Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock, #
# Frode Woldsund, Martin Zibricky, Patrick Zimmermann #
2010-09-26 12:23:50 +00:00
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
2013-02-01 19:58:18 +00:00
"""
The UI widgets for the rename dialog
"""
2010-09-26 08:38:11 +00:00
from PyQt4 import QtCore, QtGui
2010-09-26 12:23:50 +00:00
from openlp.core.lib import translate
from openlp.core.lib.ui import create_button_box
2010-09-26 12:23:50 +00:00
2013-02-01 19:58:18 +00:00
2010-09-26 08:38:11 +00:00
class Ui_FileRenameDialog(object):
2013-02-01 19:58:18 +00:00
"""
The UI widgets for the rename dialog
"""
2013-03-01 11:12:23 +00:00
def setupUi(self, file_rename_dialog):
2013-02-01 19:58:18 +00:00
"""
Set up the UI
"""
2013-03-07 17:58:15 +00:00
file_rename_dialog.setObjectName(u'file_rename_dialog')
2013-03-01 11:12:23 +00:00
file_rename_dialog.resize(300, 10)
self.dialog_layout = QtGui.QGridLayout(file_rename_dialog)
2013-03-07 17:58:15 +00:00
self.dialog_layout.setObjectName(u'dialog_layout')
2013-03-01 11:12:23 +00:00
self.file_name_label = QtGui.QLabel(file_rename_dialog)
2013-03-07 17:58:15 +00:00
self.file_name_label.setObjectName(u'file_name_label')
2013-03-01 11:12:23 +00:00
self.dialog_layout.addWidget(self.file_name_label, 0, 0)
self.file_name_edit = QtGui.QLineEdit(file_rename_dialog)
self.file_name_edit.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp(r'[^/\\?*|<>\[\]":+%]+'), self))
2013-03-07 17:58:15 +00:00
self.file_name_edit.setObjectName(u'file_name_edit')
2013-03-01 11:12:23 +00:00
self.dialog_layout.addWidget(self.file_name_edit, 0, 1)
self.button_box = create_button_box(file_rename_dialog, u'button_box', [u'cancel', u'ok'])
self.dialog_layout.addWidget(self.button_box, 1, 0, 1, 2)
self.retranslateUi(file_rename_dialog)
self.setMaximumHeight(self.sizeHint().height())
2010-09-26 08:38:11 +00:00
2013-03-01 11:12:23 +00:00
def retranslateUi(self, file_rename_dialog):
2013-02-01 19:58:18 +00:00
"""
Translate the UI on the fly.
"""
2013-03-01 11:12:23 +00:00
self.file_name_label.setText(translate('OpenLP.FileRenameForm', 'New File Name:'))