diff options
author | Michal Kubecek <mkubecek@suse.cz> | 2015-04-17 14:05:41 +0200 |
---|---|---|
committer | Michal Kubecek <mkubecek@suse.cz> | 2015-04-19 11:44:18 +0200 |
commit | e44b91159d2fefeb495b2c77c64ba3e7cbc0869e (patch) | |
tree | 0591e420eadf5a3124d27f9d57bfa71e868fdbaf /src/gui/numberconversionform.ui.h | |
parent | 97d3c08dadd1ea4b0773819a69540a320590b868 (diff) | |
download | twinkle-e44b91159d2fefeb495b2c77c64ba3e7cbc0869e.tar twinkle-e44b91159d2fefeb495b2c77c64ba3e7cbc0869e.tar.gz twinkle-e44b91159d2fefeb495b2c77c64ba3e7cbc0869e.tar.lz twinkle-e44b91159d2fefeb495b2c77c64ba3e7cbc0869e.tar.xz twinkle-e44b91159d2fefeb495b2c77c64ba3e7cbc0869e.zip |
automatic conversion of numberconversionform.ui
Diffstat (limited to 'src/gui/numberconversionform.ui.h')
-rw-r--r-- | src/gui/numberconversionform.ui.h | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/src/gui/numberconversionform.ui.h b/src/gui/numberconversionform.ui.h deleted file mode 100644 index 6bbdaec..0000000 --- a/src/gui/numberconversionform.ui.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** ui.h extension file, included from the uic-generated form implementation. -** -** If you want to add, delete, or rename functions or slots, use -** Qt Designer to update this file, preserving your code. -** -** You should not define a constructor or destructor in this file. -** Instead, write your code in functions called init() and destroy(). -** These will automatically be called by the form's constructor and -** destructor. -*****************************************************************************/ - -/* - Copyright (C) 2005-2009 Michel de Boer <michel@twinklephone.com> - - 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 2 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, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -void NumberConversionForm::init() -{ - QRegExp rxNoAtSign("[^@]*"); - - exprLineEdit->setValidator(new QRegExpValidator(rxNoAtSign, this)); - replaceLineEdit->setValidator(new QRegExpValidator(rxNoAtSign, this)); -} - -int NumberConversionForm::exec(QString &expr, QString &replace) -{ - exprLineEdit->setText(expr); - replaceLineEdit->setText(replace); - int retval = QDialog::exec(); - - if (retval == QDialog::Accepted) { - expr = exprLineEdit->text(); - replace = replaceLineEdit->text(); - } - - return retval; -} - -void NumberConversionForm::validate() -{ - QString expr = exprLineEdit->text(); - QString replace = replaceLineEdit->text(); - - if (expr.isEmpty()) { - ((t_gui *)ui)->cb_show_msg(this, - tr("Match expression may not be empty.").ascii(), MSG_CRITICAL); - exprLineEdit->setFocus(); - exprLineEdit->selectAll(); - return; - } - - if (replace.isEmpty()) { - ((t_gui *)ui)->cb_show_msg(this, - tr("Replace value may not be empty.").ascii(), MSG_CRITICAL); - replaceLineEdit->setFocus(); - replaceLineEdit->selectAll(); - return; - } - - try { - boost::regex re(expr.ascii()); - } catch (boost::bad_expression) { - ((t_gui *)ui)->cb_show_msg(this, - tr("Invalid regular expression.").ascii(), MSG_CRITICAL); - exprLineEdit->setFocus(); - return; - } - - accept(); -} |