From 77446a6745c112c8a0ce5b1ad66e365bf227cb38 Mon Sep 17 00:00:00 2001 From: Michal Kubecek Date: Thu, 16 Apr 2015 14:47:27 +0200 Subject: automatic conversion of dtmfform.ui --- src/gui/dtmfform.cpp | 175 +++++++++++ src/gui/dtmfform.h | 39 +++ src/gui/dtmfform.ui | 852 +++++++++++++++++++++++--------------------------- src/gui/dtmfform.ui.h | 179 ----------- src/gui/twinkle.pro | 5 +- 5 files changed, 601 insertions(+), 649 deletions(-) create mode 100644 src/gui/dtmfform.cpp create mode 100644 src/gui/dtmfform.h delete mode 100644 src/gui/dtmfform.ui.h (limited to 'src/gui') diff --git a/src/gui/dtmfform.cpp b/src/gui/dtmfform.cpp new file mode 100644 index 0000000..bd61830 --- /dev/null +++ b/src/gui/dtmfform.cpp @@ -0,0 +1,175 @@ +#include "dtmfform.h" + +/* + * Constructs a DtmfForm which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' + * + * The dialog will by default be modeless, unless you set 'modal' to + * true to construct a modal dialog. + */ +DtmfForm::DtmfForm(QWidget* parent) + : QDialog(parent) +{ + setupUi(this); +} + +/* + * Destroys the object and frees any allocated resources + */ +DtmfForm::~DtmfForm() +{ + // no need to delete child widgets, Qt does it all for us +} + + +void DtmfForm::dtmf1() +{ + emit digits("1"); +} + +void DtmfForm::dtmf2() +{ + emit digits("2"); +} + +void DtmfForm::dtmf3() +{ + emit digits("3"); +} + +void DtmfForm::dtmf4() +{ + emit digits("4"); +} + +void DtmfForm::dtmf5() +{ + emit digits("5"); +} + +void DtmfForm::dtmf6() +{ + emit digits("6"); +} + +void DtmfForm::dtmf7() +{ + emit digits("7"); +} + +void DtmfForm::dtmf8() +{ + emit digits("8"); +} + +void DtmfForm::dtmf9() +{ + emit digits("9"); +} + +void DtmfForm::dtmf0() +{ + emit digits("0"); +} + +void DtmfForm::dtmfStar() +{ + emit digits("*"); +} + +void DtmfForm::dtmfPound() +{ + emit digits("#"); +} + +void DtmfForm::dtmfA() +{ + emit digits("A"); +} + +void DtmfForm::dtmfB() +{ + emit digits("B"); +} + +void DtmfForm::dtmfC() +{ + emit digits("C"); +} + +void DtmfForm::dtmfD() +{ + emit digits("D"); +} + +void DtmfForm::keyPressEvent(QKeyEvent *e) +{ + // DTMF keys + switch (e->key()) { + case Qt::Key_1: + dtmf1(); + break; + case Qt::Key_2: + case Qt::Key_A: + case Qt::Key_B: + case Qt::Key_C: + dtmf2(); + break; + case Qt::Key_3: + case Qt::Key_D: + case Qt::Key_E: + case Qt::Key_F: + dtmf3(); + break; + case Qt::Key_4: + case Qt::Key_G: + case Qt::Key_H: + case Qt::Key_I: + dtmf4(); + break; + case Qt::Key_5: + case Qt::Key_J: + case Qt::Key_K: + case Qt::Key_L: + dtmf5(); + break; + case Qt::Key_6: + case Qt::Key_M: + case Qt::Key_N: + case Qt::Key_O: + dtmf6(); + break; + case Qt::Key_7: + case Qt::Key_P: + case Qt::Key_Q: + case Qt::Key_R: + case Qt::Key_S: + dtmf7(); + break; + case Qt::Key_8: + case Qt::Key_T: + case Qt::Key_U: + case Qt::Key_V: + dtmf8(); + break; + case Qt::Key_9: + case Qt::Key_W: + case Qt::Key_X: + case Qt::Key_Y: + case Qt::Key_Z: + dtmf9(); + break; + case Qt::Key_0: + case Qt::Key_Space: + dtmf0(); + break; + case Qt::Key_Asterisk: + dtmfStar(); + break; + case Qt::Key_NumberSign: + dtmfPound(); + break; + default: + e->ignore(); + } +} diff --git a/src/gui/dtmfform.h b/src/gui/dtmfform.h new file mode 100644 index 0000000..a9c6b45 --- /dev/null +++ b/src/gui/dtmfform.h @@ -0,0 +1,39 @@ +#ifndef DTMFFORM_H +#define DTMFFORM_H + +#include +#include +#include "ui_dtmfform.h" + +class DtmfForm : public QDialog, private Ui::DtmfForm +{ + Q_OBJECT + +public: + explicit DtmfForm(QWidget *parent = 0); + ~DtmfForm(); + +public slots: + void dtmf1(); + void dtmf2(); + void dtmf3(); + void dtmf4(); + void dtmf5(); + void dtmf6(); + void dtmf7(); + void dtmf8(); + void dtmf9(); + void dtmf0(); + void dtmfStar(); + void dtmfPound(); + void dtmfA(); + void dtmfB(); + void dtmfC(); + void dtmfD(); + void keyPressEvent(QKeyEvent* e); + +signals: + void digits(const QString&); +}; + +#endif // DTMFFORM_H diff --git a/src/gui/dtmfform.ui b/src/gui/dtmfform.ui index d0e683d..6526992 100644 --- a/src/gui/dtmfform.ui +++ b/src/gui/dtmfform.ui @@ -1,509 +1,423 @@ - -DtmfForm - - - DtmfForm - + + + + + + DtmfForm + - - 0 - 0 - 350 - 302 - + + 0 + 0 + 350 + 302 + - - 5 - 5 - 0 - 0 - + + 5 + 5 + 0 + 0 + - - Twinkle - DTMF + + Twinkle - DTMF - - - unnamed - - - - keypadGroupBox - - - Keypad - - - - unnamed - - - - twoPushButton - - - - 10 - - - - - - - dtmf-2.png - - - 2 - - - - - threePushButton - - - - 10 - - - - - - - dtmf-3.png - - - 3 - - - - - aPushButton - - - - 194 - 202 - 210 - - - - - - - dtmf-a.png - - - Over decadic A. Normally not needed. - - - - - fourPushButton - - - - - - dtmf-4.png - - - 4 - - - - - fivePushButton - - - - - - dtmf-5.png - - - 5 - - - - - sixPushButton - - - - - - dtmf-6.png - - - 6 - - - - - bPushButton - - - - 194 - 202 - 210 - - - - - - - dtmf-b.png - - - Over decadic B. Normally not needed. - - - - - sevenPushButton - - - - - - dtmf-7.png - - - 7 - - - - - eightPushButton - - - - - - dtmf-8.png - - - 8 - - - - - ninePushButton - - - - - - dtmf-9.png - - - 9 - - - - - cPushButton - - - - 194 - 202 - 210 - - - - - - - dtmf-c.png - - - Over decadic C. Normally not needed. - - - - - starPushButton - - - - - - dtmf-star.png - - - Star (*) - - - - - zeroPushButton - - - - - - dtmf-0.png - - - 0 - - - - - poundPushButton - - - - - - dtmf-pound.png - - - Pound (#) - - - - - dPushButton - - - - 194 - 202 - 210 - - - - - - - dtmf-d.png - - - Over decadic D. Normally not needed. - - - - - onePushButton - - - - 10 - - - - - - - dtmf-1.png - - - true - - - 1 - - - - - - - layout24 - - - - unnamed - - - - spacer20 - - - Horizontal - - - Expanding - - - - 291 - 20 - - - - - - closePushButton - - - &Close - - - Alt+C - - - true - - - + + + + + Keypad + + + + + + + 10 + + + + + + + dtmf-2.png + + + 2 + + + + + + + + 10 + + + + + + + dtmf-3.png + + + 3 + + + + + + + + + + dtmf-a.png + + + Over decadic A. Normally not needed. + + + + + + + + + + dtmf-4.png + + + 4 + + + + + + + + + + dtmf-5.png + + + 5 + + + + + + + + + + dtmf-6.png + + + 6 + + + + + + + + + + dtmf-b.png + + + Over decadic B. Normally not needed. + + + + + + + + + + dtmf-7.png + + + 7 + + + + + + + + + + dtmf-8.png + + + 8 + + + + + + + + + + dtmf-9.png + + + 9 + + + + + + + + + + dtmf-c.png + + + Over decadic C. Normally not needed. + + + + + + + + + + dtmf-star.png + + + Star (*) + + + + + + + + + + dtmf-0.png + + + 0 + + + + + + + + + + dtmf-pound.png + + + Pound (#) + + + + + + + + + + dtmf-d.png + + + Over decadic D. Normally not needed. + + + + + + + + 10 + + + + + + + dtmf-1.png + + + true + + + 1 + + + + - - - + + + + + + + + 291 + 20 + + + + QSizePolicy::Expanding + + + Qt::Horizontal + + + + + + + &Close + + + Alt+C + + + true + + + + + + + + + qPixmapFromMimeSource + + onePushButton + twoPushButton + threePushButton + aPushButton + fourPushButton + fivePushButton + sixPushButton + bPushButton + sevenPushButton + eightPushButton + ninePushButton + cPushButton + starPushButton + zeroPushButton + poundPushButton + dPushButton + closePushButton + + - closePushButton - clicked() - DtmfForm - accept() + closePushButton + clicked() + DtmfForm + accept() - onePushButton - clicked() - DtmfForm - dtmf1() + onePushButton + clicked() + DtmfForm + dtmf1() - twoPushButton - clicked() - DtmfForm - dtmf2() + twoPushButton + clicked() + DtmfForm + dtmf2() - threePushButton - clicked() - DtmfForm - dtmf3() + threePushButton + clicked() + DtmfForm + dtmf3() - fourPushButton - clicked() - DtmfForm - dtmf4() + fourPushButton + clicked() + DtmfForm + dtmf4() - fivePushButton - clicked() - DtmfForm - dtmf5() + fivePushButton + clicked() + DtmfForm + dtmf5() - sixPushButton - clicked() - DtmfForm - dtmf6() + sixPushButton + clicked() + DtmfForm + dtmf6() - sevenPushButton - clicked() - DtmfForm - dtmf7() + sevenPushButton + clicked() + DtmfForm + dtmf7() - eightPushButton - clicked() - DtmfForm - dtmf8() + eightPushButton + clicked() + DtmfForm + dtmf8() - ninePushButton - clicked() - DtmfForm - dtmf9() + ninePushButton + clicked() + DtmfForm + dtmf9() - zeroPushButton - clicked() - DtmfForm - dtmf0() + zeroPushButton + clicked() + DtmfForm + dtmf0() - starPushButton - clicked() - DtmfForm - dtmfStar() + starPushButton + clicked() + DtmfForm + dtmfStar() - poundPushButton - clicked() - DtmfForm - dtmfPound() + poundPushButton + clicked() + DtmfForm + dtmfPound() - aPushButton - clicked() - DtmfForm - dtmfA() + aPushButton + clicked() + DtmfForm + dtmfA() - bPushButton - clicked() - DtmfForm - dtmfB() + bPushButton + clicked() + DtmfForm + dtmfB() - cPushButton - clicked() - DtmfForm - dtmfC() + cPushButton + clicked() + DtmfForm + dtmfC() - dPushButton - clicked() - DtmfForm - dtmfD() + dPushButton + clicked() + DtmfForm + dtmfD() - - - onePushButton - twoPushButton - threePushButton - aPushButton - fourPushButton - fivePushButton - sixPushButton - bPushButton - sevenPushButton - eightPushButton - ninePushButton - cPushButton - starPushButton - zeroPushButton - poundPushButton - dPushButton - closePushButton - - - qregexp.h - qvalidator.h - qlineedit.h - dtmfform.ui.h - - - digits(const QString &) - - - dtmf1() - dtmf2() - dtmf3() - dtmf4() - dtmf5() - dtmf6() - dtmf7() - dtmf8() - dtmf9() - dtmf0() - dtmfStar() - dtmfPound() - dtmfA() - dtmfB() - dtmfC() - dtmfD() - keyPressEvent( QKeyEvent * e ) - - - - + + diff --git a/src/gui/dtmfform.ui.h b/src/gui/dtmfform.ui.h deleted file mode 100644 index 08639dc..0000000 --- a/src/gui/dtmfform.ui.h +++ /dev/null @@ -1,179 +0,0 @@ -//Added by qt3to4: -#include -/**************************************************************************** -** ui.h extension file, included from the uic-generated form implementation. -** -** If you wish to add, delete or rename functions or slots use -** Qt Designer which will update this file, preserving your code. Create an -** init() function in place of a constructor, and a destroy() function in -** place of a destructor. -*****************************************************************************/ -/* - Copyright (C) 2005-2009 Michel de Boer - - 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 DtmfForm::dtmf1() -{ - emit digits("1"); -} - -void DtmfForm::dtmf2() -{ - emit digits("2"); -} - -void DtmfForm::dtmf3() -{ - emit digits("3"); -} - -void DtmfForm::dtmf4() -{ - emit digits("4"); -} - -void DtmfForm::dtmf5() -{ - emit digits("5"); -} - -void DtmfForm::dtmf6() -{ - emit digits("6"); -} - -void DtmfForm::dtmf7() -{ - emit digits("7"); -} - -void DtmfForm::dtmf8() -{ - emit digits("8"); -} - -void DtmfForm::dtmf9() -{ - emit digits("9"); -} - -void DtmfForm::dtmf0() -{ - emit digits("0"); -} - -void DtmfForm::dtmfStar() -{ - emit digits("*"); -} - -void DtmfForm::dtmfPound() -{ - emit digits("#"); -} - -void DtmfForm::dtmfA() -{ - emit digits("A"); -} - -void DtmfForm::dtmfB() -{ - emit digits("B"); -} - -void DtmfForm::dtmfC() -{ - emit digits("C"); -} - -void DtmfForm::dtmfD() -{ - emit digits("D"); -} - -void DtmfForm::keyPressEvent(QKeyEvent *e) -{ - // DTMF keys - switch (e->key()) { - case Qt::Key_1: - dtmf1(); - break; - case Qt::Key_2: - case Qt::Key_A: - case Qt::Key_B: - case Qt::Key_C: - dtmf2(); - break; - case Qt::Key_3: - case Qt::Key_D: - case Qt::Key_E: - case Qt::Key_F: - dtmf3(); - break; - case Qt::Key_4: - case Qt::Key_G: - case Qt::Key_H: - case Qt::Key_I: - dtmf4(); - break; - case Qt::Key_5: - case Qt::Key_J: - case Qt::Key_K: - case Qt::Key_L: - dtmf5(); - break; - case Qt::Key_6: - case Qt::Key_M: - case Qt::Key_N: - case Qt::Key_O: - dtmf6(); - break; - case Qt::Key_7: - case Qt::Key_P: - case Qt::Key_Q: - case Qt::Key_R: - case Qt::Key_S: - dtmf7(); - break; - case Qt::Key_8: - case Qt::Key_T: - case Qt::Key_U: - case Qt::Key_V: - dtmf8(); - break; - case Qt::Key_9: - case Qt::Key_W: - case Qt::Key_X: - case Qt::Key_Y: - case Qt::Key_Z: - dtmf9(); - break; - case Qt::Key_0: - case Qt::Key_Space: - dtmf0(); - break; - case Qt::Key_Asterisk: - dtmfStar(); - break; - case Qt::Key_NumberSign: - dtmfPound(); - break; - default: - e->ignore(); - } -} diff --git a/src/gui/twinkle.pro b/src/gui/twinkle.pro index 01624c3..ba9b51b 100644 --- a/src/gui/twinkle.pro +++ b/src/gui/twinkle.pro @@ -10,6 +10,7 @@ DEFINES += QT_NO_STL INCLUDEPATH += .. HEADERS += gui.h \ + dtmfform.h \ historylistview.h \ freedesksystray.h \ twinklesystray.h \ @@ -26,6 +27,7 @@ HEADERS += gui.h \ SOURCES += main.cpp \ gui.cpp \ + dtmfform.cpp \ historylistview.cpp \ freedesksystray.cpp \ twinklesystray.cpp \ @@ -36,13 +38,14 @@ SOURCES += main.cpp \ buddylistview.cpp \ twinkleapplication.cpp +FORMS = dtmfform.ui + #The following line was changed from FORMS to FORMS3 by qt3to4 FORMS3 = mphoneform.ui \ inviteform.ui \ deregisterform.ui \ redirectform.ui \ termcapform.ui \ - dtmfform.ui \ selectnicform.ui \ srvredirectform.ui \ authenticationform.ui \ -- cgit v1.2.3