From 4ccd17443615187a585f367e3a47301b24265cd9 Mon Sep 17 00:00:00 2001 From: Lubos Dolezel Date: Wed, 3 Jun 2015 21:55:27 +0200 Subject: More Qt3 -> Qt4 porting, now only the main window remains --- src/gui/buddyform.ui | 1 - src/gui/gui.cpp | 4 ++-- src/gui/historyform.cpp | 2 +- src/gui/messageform.cpp | 10 +++++----- src/gui/selectprofileform.cpp | 2 +- src/gui/selectprofileform.h | 4 ++-- src/gui/selectuserform.ui | 4 ++-- src/gui/sendfileform.cpp | 6 +++--- src/gui/srvredirectform.cpp | 2 +- src/gui/textbrowsernoautolink.h | 6 +++--- src/gui/userprofileform.cpp | 17 ++++++----------- src/gui/wizardform.cpp | 6 ++---- src/gui/yesnodialog.cpp | 10 +++++----- 13 files changed, 33 insertions(+), 41 deletions(-) (limited to 'src/gui') diff --git a/src/gui/buddyform.ui b/src/gui/buddyform.ui index a4806dc..657abec 100644 --- a/src/gui/buddyform.ui +++ b/src/gui/buddyform.ui @@ -186,7 +186,6 @@ presence/buddy.h user.h - q3listview.h getaddressform.h diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 1b0fbbb..788fa60 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -23,7 +23,7 @@ #include //Added by qt3to4: #include -#include +#include #ifdef HAVE_KDE #include @@ -1603,7 +1603,7 @@ void t_gui::cb_notify_call(int line, const QString &from_party, const QString &o pm = QPixmap(":/icons/images/twinkle32.png"); } else { pm.convertFromImage(photo); - photoFrameShape = Q3Frame::Box; + photoFrameShape = QFrame::Box; } // Create the popup view. diff --git a/src/gui/historyform.cpp b/src/gui/historyform.cpp index eb8a469..b418f63 100644 --- a/src/gui/historyform.cpp +++ b/src/gui/historyform.cpp @@ -1,7 +1,7 @@ //Added by qt3to4: #include #include -#include +#include /* Copyright (C) 2005-2009 Michel de Boer diff --git a/src/gui/messageform.cpp b/src/gui/messageform.cpp index 0e71995..1f615af 100644 --- a/src/gui/messageform.cpp +++ b/src/gui/messageform.cpp @@ -34,7 +34,7 @@ #include "gui.h" #include "sockets/url.h" -#include +#include #include "audits/memman.h" #include "util.h" #include @@ -337,7 +337,7 @@ void MessageForm::addMessage(const im::t_msg &msg, const QString &name) if (msg.format == im::TXT_HTML) { s += msg.message.c_str(); } else { - s += Q3StyleSheet::escape(msg.message.c_str()); + s += Qt::escape(msg.message.c_str()); } } @@ -428,7 +428,7 @@ void MessageForm::displayError(const QString &errorMsg) s += ""; s += tr("Delivery failure").ascii(); s += ": "; - s += Q3StyleSheet::escape(errorMsg); + s += Qt::escape(errorMsg); s += ""; conversationBrowser->append(s); @@ -440,7 +440,7 @@ void MessageForm::displayDeliveryNotification(const QString ¬ification) s += ""; s += tr("Delivery notification").ascii(); s += ": "; - s += Q3StyleSheet::escape(notification); + s += Qt::escape(notification); s += ""; conversationBrowser->append(s); @@ -598,7 +598,7 @@ void MessageForm::setComposingIndication(const QString &name) MEMMAN_NEW(_isComposingLabel); _isComposingLabel->setText(tr("%1 is typing a message.").arg(name)); - _isComposingLabel->setFrameStyle(Q3Frame::NoFrame | Q3Frame::Plain); + _isComposingLabel->setFrameStyle(QFrame::NoFrame | QFrame::Plain); statusBar()->addWidget(_isComposingLabel); } } diff --git a/src/gui/selectprofileform.cpp b/src/gui/selectprofileform.cpp index 9645eaa..e900dcc 100644 --- a/src/gui/selectprofileform.cpp +++ b/src/gui/selectprofileform.cpp @@ -179,7 +179,7 @@ int SelectProfileForm::execForm() // The execForm() method cannot be used as it will block the Qt event loop. // NOTE: the method show() is not re-implemented as Qt calls this method // from exec() internally. -void SelectProfileForm::showForm(Q3MainWindow *_mainWindow) +void SelectProfileForm::showForm(QWidget *_mainWindow) { mainWindow = _mainWindow; profileListView->clear(); diff --git a/src/gui/selectprofileform.h b/src/gui/selectprofileform.h index 7c9b0a5..517efb1 100644 --- a/src/gui/selectprofileform.h +++ b/src/gui/selectprofileform.h @@ -23,7 +23,7 @@ public: static bool getUserProfiles( QStringList & profiles, QString & error ); public slots: - virtual void showForm( Q3MainWindow * _mainWindow ); + virtual void showForm( QWidget * _mainWindow ); virtual void runProfile(); virtual void editProfile(); virtual void newProfile(); @@ -50,7 +50,7 @@ protected slots: private: bool defaultSet; t_user *user_config; - Q3MainWindow *mainWindow; + QWidget *mainWindow; void init(); void destroy(); diff --git a/src/gui/selectuserform.ui b/src/gui/selectuserform.ui index d379340..fcdc06a 100644 --- a/src/gui/selectuserform.ui +++ b/src/gui/selectuserform.ui @@ -183,9 +183,9 @@ userListView - doubleClicked(Q3ListViewItem*) + doubleClicked(QModelIndex) SelectUserForm - toggle(Q3ListViewItem*) + toggle(QModelIndex) 20 diff --git a/src/gui/sendfileform.cpp b/src/gui/sendfileform.cpp index e212579..cd9f10e 100644 --- a/src/gui/sendfileform.cpp +++ b/src/gui/sendfileform.cpp @@ -23,7 +23,7 @@ #include "audits/memman.h" #include "gui.h" #include -#include +#include #include "sendfileform.h" /* * Constructs a SendFileForm as a child of 'parent', with the @@ -98,7 +98,7 @@ void SendFileForm::chooseFile() d->setOperationMode(KFileDialog::Other); connect(d, SIGNAL(okClicked()), this, SLOT(setFilename())); #else - Q3FileDialog *d = new Q3FileDialog(QString::null, QString::null, this, 0, true); + QFileDialog *d = new QFileDialog(this); MEMMAN_NEW(d); connect(d, SIGNAL(fileSelected(const QString &)), this, SLOT(setFilename())); @@ -125,7 +125,7 @@ void SendFileForm::setFilename() KFileDialog *d = dynamic_cast(_chooseFileDialog); filename = d->selectedFile(); #else - Q3FileDialog *d = dynamic_cast(_chooseFileDialog); + QFileDialog *d = dynamic_cast(_chooseFileDialog); filename = d->selectedFile(); #endif diff --git a/src/gui/srvredirectform.cpp b/src/gui/srvredirectform.cpp index 4d95643..cfcfa93 100644 --- a/src/gui/srvredirectform.cpp +++ b/src/gui/srvredirectform.cpp @@ -20,7 +20,7 @@ */ #include "phone.h" -#include +#include #include #include "gui.h" #include "audits/memman.h" diff --git a/src/gui/textbrowsernoautolink.h b/src/gui/textbrowsernoautolink.h index 72dbcbb..56b7b6b 100644 --- a/src/gui/textbrowsernoautolink.h +++ b/src/gui/textbrowsernoautolink.h @@ -31,17 +31,17 @@ #ifndef _TEXTBROWSERNOAUTOLINK_H #define _TEXTBROWSERNOAUTOLINK_H -#include +#include /** * A text browser similar to QTextBrowser, but when a user clicks a link * the browser will not automatically load the linked document. */ -class TextBrowserNoAutoLink : public Q3TextBrowser { +class TextBrowserNoAutoLink : public QTextBrowser { Q_OBJECT public: TextBrowserNoAutoLink ( QWidget * parent = 0, const char * name = 0 ) : - Q3TextBrowser(parent, name) {}; + QTextBrowser(parent, name) {}; virtual void setSource ( const QString & name ) {}; }; diff --git a/src/gui/userprofileform.cpp b/src/gui/userprofileform.cpp index 75c2fcd..040a57a 100644 --- a/src/gui/userprofileform.cpp +++ b/src/gui/userprofileform.cpp @@ -1,7 +1,3 @@ -//Added by qt3to4: -#include -#include - /* Copyright (C) 2005-2009 Michel de Boer @@ -19,8 +15,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#include +#include +#include #include #include #include @@ -31,11 +27,11 @@ #include "protocol.h" #include #include "gui.h" -#include +#include #include #include #include "twinkle_config.h" -#include +#include #include "numberconversionform.h" #include "util.h" #include "userprofileform.h" @@ -1292,10 +1288,9 @@ void UserProfileForm::changeProfile(const QString &profileName) { void UserProfileForm::chooseFile(QLineEdit *qle, const QString &filter, const QString &caption) { - QString file = Q3FileDialog::getOpenFileName( + QString file = QFileDialog::getOpenFileName(this, caption, ((t_gui *)ui)->get_last_file_browse_path(), - filter, this, "open file dialog", - caption); + filter); if (!file.isEmpty()) { qle->setText(file); ((t_gui *)ui)->set_last_file_browse_path(QFileInfo(file).dirPath(true)); diff --git a/src/gui/wizardform.cpp b/src/gui/wizardform.cpp index 6ed7d5d..0728454 100644 --- a/src/gui/wizardform.cpp +++ b/src/gui/wizardform.cpp @@ -1,6 +1,3 @@ -//Added by qt3to4: -#include - /* Copyright (C) 2005-2009 Michel de Boer @@ -24,6 +21,7 @@ #include #include #include +#include #include "gui.h" #include #include "wizardform.h" @@ -94,7 +92,7 @@ void WizardForm::initProviders() fname.append("/").append(FILE_PROVIDERS); QFile providersFile(fname); if (providersFile.open(QIODevice::ReadOnly)) { - Q3TextStream providersStream(&providersFile); + QTextStream providersStream(&providersFile); QString entry; while ((entry = providersStream.readLine()) != QString::null) { // Skip comment diff --git a/src/gui/yesnodialog.cpp b/src/gui/yesnodialog.cpp index cde27ef..868f3d0 100644 --- a/src/gui/yesnodialog.cpp +++ b/src/gui/yesnodialog.cpp @@ -21,9 +21,9 @@ #include "qlabel.h" #include "qlayout.h" //Added by qt3to4: -#include -#include -#include +#include +#include +#include #include "userintf.h" @@ -45,10 +45,10 @@ YesNoDialog::YesNoDialog(QWidget *parent, const QString &caption, const QString QDialog(parent, NULL, true, Qt::WDestructiveClose) { setCaption(caption); - Q3BoxLayout *vb = new Q3VBoxLayout(this, 11, 6); + QBoxLayout *vb = new QVBoxLayout(this, 11, 6); QLabel *lblQuestion = new QLabel(text, this); vb->addWidget(lblQuestion); - Q3HBoxLayout *hb = new Q3HBoxLayout(NULL, 0, 6); + QHBoxLayout *hb = new QHBoxLayout(NULL, 0, 6); QSpacerItem *spacer1 = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum ); hb->addItem(spacer1); -- cgit v1.2.3