From c663b6440964f6ac48027143ac9e63298991f9d0 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:33:34 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdialog/kdialog.cpp | 204 +++++++++++++++++++++--------------------- kdialog/klistboxdialog.cpp | 20 ++--- kdialog/klistboxdialog.h | 12 +-- kdialog/progressdialog.cpp | 4 +- kdialog/progressdialog.h | 4 +- kdialog/progressdialogiface.h | 2 +- kdialog/widgets.cpp | 76 ++++++++-------- kdialog/widgets.h | 24 ++--- 8 files changed, 173 insertions(+), 173 deletions(-) (limited to 'kdialog') diff --git a/kdialog/kdialog.cpp b/kdialog/kdialog.cpp index 2dafb5789..48d22729a 100644 --- a/kdialog/kdialog.cpp +++ b/kdialog/kdialog.cpp @@ -24,11 +24,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -41,7 +41,7 @@ #include "widgets.h" #include -#include +#include #include #include #include @@ -108,24 +108,24 @@ class WinIdEmbedder: public QObject { public: WinIdEmbedder(bool printID, WId winId): - QObject(qApp), print(printID), id(winId) + TQObject(qApp), print(printID), id(winId) { if (qApp) qApp->installEventFilter(this); } protected: - bool eventFilter(QObject *o, QEvent *e); + bool eventFilter(TQObject *o, TQEvent *e); private: bool print; WId id; }; -bool WinIdEmbedder::eventFilter(QObject *o, QEvent *e) +bool WinIdEmbedder::eventFilter(TQObject *o, TQEvent *e) { - if (e->type() == QEvent::Show && o->isWidgetType() + if (e->type() == TQEvent::Show && o->isWidgetType() && o->inherits("KDialog")) { - QWidget *w = static_cast(o); + TQWidget *w = static_cast(o); if (print) cout << "winId: " << w->winId() << endl; #ifdef Q_WS_X11 @@ -135,17 +135,17 @@ bool WinIdEmbedder::eventFilter(QObject *o, QEvent *e) deleteLater(); // WinIdEmbedder is not needed anymore after the first dialog was shown return false; } - return QObject::eventFilter(o, e); + return TQObject::eventFilter(o, e); } -static void outputStringList(QStringList list, bool separateOutput) +static void outputStringList(TQStringList list, bool separateOutput) { if ( separateOutput) { - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { cout << (*it).local8Bit().data() << endl; } } else { - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { cout << (*it).local8Bit().data() << " "; } cout << endl; @@ -154,16 +154,16 @@ static void outputStringList(QStringList list, bool separateOutput) static int directCommand(KCmdLineArgs *args) { - QString title; + TQString title; bool separateOutput = FALSE; bool printWId = args->isSet("print-winid"); bool embed = args->isSet("embed"); - QString defaultEntry; + TQString defaultEntry; // --title text KCmdLineArgs *qtargs = KCmdLineArgs::parsedArgs("qt"); // --title is a qt option if(qtargs->isSet("title")) { - title = QFile::decodeName(qtargs->getOption("title")); + title = TQFile::decodeName(qtargs->getOption("title")); } // --separate-output @@ -185,7 +185,7 @@ static int directCommand(KCmdLineArgs *args) // --yesno and other message boxes KMessageBox::DialogType type = (KMessageBox::DialogType) 0; - QCString option; + TQCString option; if (args->isSet("yesno")) { option = "yesno"; type = KMessageBox::QuestionYesNo; @@ -223,11 +223,11 @@ static int directCommand(KCmdLineArgs *args) { KConfig* dontagaincfg = NULL; // --dontagain - QString dontagain; // QString::null + TQString dontagain; // TQString::null if (args->isSet("dontagain")) { - QString value = args->getOption("dontagain"); - QStringList values = QStringList::split( ':', value ); + TQString value = args->getOption("dontagain"); + TQStringList values = TQStringList::split( ':', value ); if( values.count() == 2 ) { dontagaincfg = new KConfig( values[ 0 ] ); @@ -239,11 +239,11 @@ static int directCommand(KCmdLineArgs *args) } int ret; - QString text = QString::fromLocal8Bit(args->getOption( option )); + TQString text = TQString::fromLocal8Bit(args->getOption( option )); int pos; - while ((pos = text.find( QString::fromLatin1("\\n") )) >= 0) + while ((pos = text.find( TQString::fromLatin1("\\n") )) >= 0) { - text.replace(pos, 2, QString::fromLatin1("\n")); + text.replace(pos, 2, TQString::fromLatin1("\n")); } if ( type == KMessageBox::WarningContinueCancel ) { @@ -264,13 +264,13 @@ static int directCommand(KCmdLineArgs *args) // --inputbox text [init] if (args->isSet("inputbox")) { - QString result; - QString init; + TQString result; + TQString init; if (args->count() > 0) - init = QString::fromLocal8Bit(args->arg(0)); + init = TQString::fromLocal8Bit(args->arg(0)); - bool retcode = Widgets::inputBox(0, title, QString::fromLocal8Bit(args->getOption("inputbox")), init, result); + bool retcode = Widgets::inputBox(0, title, TQString::fromLocal8Bit(args->getOption("inputbox")), init, result); cout << result.local8Bit().data() << endl; return retcode ? 0 : 1; } @@ -279,8 +279,8 @@ static int directCommand(KCmdLineArgs *args) // --password text if (args->isSet("password")) { - QCString result; - bool retcode = Widgets::passwordBox(0, title, QString::fromLocal8Bit(args->getOption("password")), result); + TQCString result; + bool retcode = Widgets::passwordBox(0, title, TQString::fromLocal8Bit(args->getOption("password")), result); cout << result.data() << endl; return retcode ? 0 : 1; } @@ -290,19 +290,19 @@ static int directCommand(KCmdLineArgs *args) { int duration = 0; if (args->count() > 0) - duration = 1000 * QString::fromLocal8Bit(args->arg(0)).toInt(); + duration = 1000 * TQString::fromLocal8Bit(args->arg(0)).toInt(); if (duration == 0) duration = 10000; KPassivePopup *popup = KPassivePopup::message( KPassivePopup::Balloon, // style title, - QString::fromLocal8Bit( args->getOption("passivepopup") ), + TQString::fromLocal8Bit( args->getOption("passivepopup") ), 0, // icon - (QWidget*)0UL, // parent + (TQWidget*)0UL, // parent 0, // name duration ); - QTimer *timer = new QTimer(); - QObject::connect( timer, SIGNAL( timeout() ), kapp, SLOT( quit() ) ); - QObject::connect( popup, SIGNAL( clicked() ), kapp, SLOT( quit() ) ); + TQTimer *timer = new TQTimer(); + TQObject::connect( timer, TQT_SIGNAL( timeout() ), kapp, TQT_SLOT( quit() ) ); + TQObject::connect( popup, TQT_SIGNAL( clicked() ), kapp, TQT_SLOT( quit() ) ); timer->start( duration, TRUE ); #ifdef Q_WS_X11 @@ -314,7 +314,7 @@ static int directCommand(KCmdLineArgs *args) x = KApplication::desktop()->width() + x - w; if ( (m & YNegative) ) y = KApplication::desktop()->height() + y - h; - popup->setAnchor( QPoint(x, y) ); + popup->setAnchor( TQPoint(x, y) ); } #endif kapp->exec(); @@ -328,11 +328,11 @@ static int directCommand(KCmdLineArgs *args) int h = 0; if (args->count() == 2) { - w = QString::fromLocal8Bit(args->arg(0)).toInt(); - h = QString::fromLocal8Bit(args->arg(1)).toInt(); + w = TQString::fromLocal8Bit(args->arg(0)).toInt(); + h = TQString::fromLocal8Bit(args->arg(1)).toInt(); } - return Widgets::textBox(0, w, h, title, QString::fromLocal8Bit(args->getOption("textbox"))); + return Widgets::textBox(0, w, h, title, TQString::fromLocal8Bit(args->getOption("textbox"))); } // --textinputbox file [width] [height] @@ -342,19 +342,19 @@ static int directCommand(KCmdLineArgs *args) int h = 200; if (args->count() == 4) { - w = QString::fromLocal8Bit(args->arg(2)).toInt(); - h = QString::fromLocal8Bit(args->arg(3)).toInt(); + w = TQString::fromLocal8Bit(args->arg(2)).toInt(); + h = TQString::fromLocal8Bit(args->arg(3)).toInt(); } - QStringList list; - list.append(QString::fromLocal8Bit(args->getOption("textinputbox"))); + TQStringList list; + list.append(TQString::fromLocal8Bit(args->getOption("textinputbox"))); if (args->count() >= 1) { for (int i = 0; i < args->count(); i++) - list.append(QString::fromLocal8Bit(args->arg(i))); + list.append(TQString::fromLocal8Bit(args->arg(i))); } - QCString result; + TQCString result; int ret = Widgets::textInputBox(0, w, h, title, list, result); cout << result.data() << endl; return ret; @@ -362,16 +362,16 @@ static int directCommand(KCmdLineArgs *args) // --combobox [tag item] [tag item] ..." if (args->isSet("combobox")) { - QStringList list; + TQStringList list; if (args->count() >= 2) { for (int i = 0; i < args->count(); i++) { - list.append(QString::fromLocal8Bit(args->arg(i))); + list.append(TQString::fromLocal8Bit(args->arg(i))); } - QString text = QString::fromLocal8Bit(args->getOption("combobox")); + TQString text = TQString::fromLocal8Bit(args->getOption("combobox")); if (args->isSet("default")) { defaultEntry = args->getOption("default"); } - QString result; + TQString result; bool retcode = Widgets::comboBox(0, title, text, list, defaultEntry, result); cout << result.local8Bit().data() << endl; return retcode ? 0 : 1; @@ -381,16 +381,16 @@ static int directCommand(KCmdLineArgs *args) // --menu text [tag item] [tag item] ... if (args->isSet("menu")) { - QStringList list; + TQStringList list; if (args->count() >= 2) { for (int i = 0; i < args->count(); i++) { - list.append(QString::fromLocal8Bit(args->arg(i))); + list.append(TQString::fromLocal8Bit(args->arg(i))); } - QString text = QString::fromLocal8Bit(args->getOption("menu")); + TQString text = TQString::fromLocal8Bit(args->getOption("menu")); if (args->isSet("default")) { defaultEntry = args->getOption("default"); } - QString result; + TQString result; bool retcode = Widgets::listBox(0, title, text, list, defaultEntry, result); if (1 == retcode) { // OK was selected cout << result.local8Bit().data() << endl; @@ -402,14 +402,14 @@ static int directCommand(KCmdLineArgs *args) // --checklist text [tag item status] [tag item status] ... if (args->isSet("checklist")) { - QStringList list; + TQStringList list; if (args->count() >= 3) { for (int i = 0; i < args->count(); i++) { - list.append(QString::fromLocal8Bit(args->arg(i))); + list.append(TQString::fromLocal8Bit(args->arg(i))); } - QString text = QString::fromLocal8Bit(args->getOption("checklist")); - QStringList result; + TQString text = TQString::fromLocal8Bit(args->getOption("checklist")); + TQStringList result; bool retcode = Widgets::checkList(0, title, text, list, separateOutput, result); @@ -425,14 +425,14 @@ static int directCommand(KCmdLineArgs *args) // --radiolist text width height menuheight [tag item status] if (args->isSet("radiolist")) { - QStringList list; + TQStringList list; if (args->count() >= 3) { for (int i = 0; i < args->count(); i++) { - list.append(QString::fromLocal8Bit(args->arg(i))); + list.append(TQString::fromLocal8Bit(args->arg(i))); } - QString text = QString::fromLocal8Bit(args->getOption("radiolist")); - QString result; + TQString text = TQString::fromLocal8Bit(args->getOption("radiolist")); + TQString result; bool retcode = Widgets::radioBox(0, title, text, list, result); cout << result.local8Bit().data() << endl; exit( retcode ? 0 : 1 ); @@ -442,11 +442,11 @@ static int directCommand(KCmdLineArgs *args) // getopenfilename [startDir] [filter] if (args->isSet("getopenfilename")) { - QString startDir; - QString filter; - startDir = QString::fromLocal8Bit(args->getOption("getopenfilename")); + TQString startDir; + TQString filter; + startDir = TQString::fromLocal8Bit(args->getOption("getopenfilename")); if (args->count() >= 1) { - filter = QString::fromLocal8Bit(args->arg(0)); + filter = TQString::fromLocal8Bit(args->arg(0)); } KFileDialog dlg(startDir, filter, 0, "filedialog", true); dlg.setOperationMode( KFileDialog::Opening ); @@ -462,13 +462,13 @@ static int directCommand(KCmdLineArgs *args) dlg.exec(); if (args->isSet("multiple")) { - QStringList result = dlg.selectedFiles(); + TQStringList result = dlg.selectedFiles(); if ( !result.isEmpty() ) { outputStringList( result, separateOutput ); return 0; } } else { - QString result = dlg.selectedFile(); + TQString result = dlg.selectedFile(); if (!result.isEmpty()) { cout << result.local8Bit().data() << endl; return 0; @@ -481,19 +481,19 @@ static int directCommand(KCmdLineArgs *args) // getsaveurl [startDir] [filter] // getsavefilename [startDir] [filter] if ( (args->isSet("getsavefilename") ) || (args->isSet("getsaveurl") ) ) { - QString startDir; - QString filter; + TQString startDir; + TQString filter; if ( args->isSet("getsavefilename") ) { - startDir = QString::fromLocal8Bit(args->getOption("getsavefilename")); + startDir = TQString::fromLocal8Bit(args->getOption("getsavefilename")); } else { - startDir = QString::fromLocal8Bit(args->getOption("getsaveurl")); + startDir = TQString::fromLocal8Bit(args->getOption("getsaveurl")); } if (args->count() >= 1) { - filter = QString::fromLocal8Bit(args->arg(0)); + filter = TQString::fromLocal8Bit(args->arg(0)); } // copied from KFileDialog::getSaveFileName(), so we can add geometry bool specialDir = ( startDir.at(0) == ':' ); - KFileDialog dlg( specialDir ? startDir : QString::null, filter, 0, "filedialog", true ); + KFileDialog dlg( specialDir ? startDir : TQString::null, filter, 0, "filedialog", true ); if ( !specialDir ) dlg.setSelection( startDir ); dlg.setOperationMode( KFileDialog::Saving ); @@ -510,7 +510,7 @@ static int directCommand(KCmdLineArgs *args) return 0; } } else { // getsavefilename - QString result = dlg.selectedFile(); + TQString result = dlg.selectedFile(); if (!result.isEmpty()) { KRecentDocument::add(result); cout << result.local8Bit().data() << endl; @@ -522,11 +522,11 @@ static int directCommand(KCmdLineArgs *args) // getexistingdirectory [startDir] if (args->isSet("getexistingdirectory")) { - QString startDir; - startDir = QString::fromLocal8Bit(args->getOption("getexistingdirectory")); - QString result; + TQString startDir; + startDir = TQString::fromLocal8Bit(args->getOption("getexistingdirectory")); + TQString result; #ifdef Q_WS_WIN - result = QFileDialog::getExistingDirectory(startDir, 0, "getExistingDirectory", + result = TQFileDialog::getExistingDirectory(startDir, 0, "getExistingDirectory", title, true, true); #else KURL url; @@ -539,7 +539,7 @@ static int directCommand(KCmdLineArgs *args) if ( !title.isNull() ) myDialog.setCaption( title ); - if ( myDialog.exec() == QDialog::Accepted ) + if ( myDialog.exec() == TQDialog::Accepted ) url = myDialog.url(); if ( url.isValid() ) @@ -554,11 +554,11 @@ static int directCommand(KCmdLineArgs *args) // getopenurl [startDir] [filter] if (args->isSet("getopenurl")) { - QString startDir; - QString filter; - startDir = QString::fromLocal8Bit(args->getOption("getopenurl")); + TQString startDir; + TQString filter; + startDir = TQString::fromLocal8Bit(args->getOption("getopenurl")); if (args->count() >= 1) { - filter = QString::fromLocal8Bit(args->arg(0)); + filter = TQString::fromLocal8Bit(args->arg(0)); } KFileDialog dlg(startDir, filter, 0, "filedialog", true); dlg.setOperationMode( KFileDialog::Opening ); @@ -591,35 +591,35 @@ static int directCommand(KCmdLineArgs *args) // geticon [group] [context] if (args->isSet("geticon")) { - QString groupStr, contextStr; - groupStr = QString::fromLocal8Bit(args->getOption("geticon")); + TQString groupStr, contextStr; + groupStr = TQString::fromLocal8Bit(args->getOption("geticon")); if (args->count() >= 1) { - contextStr = QString::fromLocal8Bit(args->arg(0)); + contextStr = TQString::fromLocal8Bit(args->arg(0)); } KIcon::Group group = KIcon::NoGroup; - if ( groupStr == QString::fromLatin1( "Desktop" ) ) + if ( groupStr == TQString::fromLatin1( "Desktop" ) ) group = KIcon::Desktop; - else if ( groupStr == QString::fromLatin1( "Toolbar" ) ) + else if ( groupStr == TQString::fromLatin1( "Toolbar" ) ) group = KIcon::Toolbar; - else if ( groupStr == QString::fromLatin1( "MainToolbar" ) ) + else if ( groupStr == TQString::fromLatin1( "MainToolbar" ) ) group = KIcon::MainToolbar; - else if ( groupStr == QString::fromLatin1( "Small" ) ) + else if ( groupStr == TQString::fromLatin1( "Small" ) ) group = KIcon::Small; - else if ( groupStr == QString::fromLatin1( "Panel" ) ) + else if ( groupStr == TQString::fromLatin1( "Panel" ) ) group = KIcon::Panel; - else if ( groupStr == QString::fromLatin1( "User" ) ) + else if ( groupStr == TQString::fromLatin1( "User" ) ) group = KIcon::User; KIcon::Context context = KIcon::Any; // From kicontheme.cpp - if ( contextStr == QString::fromLatin1( "Devices" ) ) + if ( contextStr == TQString::fromLatin1( "Devices" ) ) context = KIcon::Device; - else if ( contextStr == QString::fromLatin1( "MimeTypes" ) ) + else if ( contextStr == TQString::fromLatin1( "MimeTypes" ) ) context = KIcon::MimeType; - else if ( contextStr == QString::fromLatin1( "FileSystems" ) ) + else if ( contextStr == TQString::fromLatin1( "FileSystems" ) ) context = KIcon::FileSystem; - else if ( contextStr == QString::fromLatin1( "Applications" ) ) + else if ( contextStr == TQString::fromLatin1( "Applications" ) ) context = KIcon::Application; - else if ( contextStr == QString::fromLatin1( "Actions" ) ) + else if ( contextStr == TQString::fromLatin1( "Actions" ) ) context = KIcon::Action; KIconDialog dlg(0, "icon dialog"); @@ -629,7 +629,7 @@ static int directCommand(KCmdLineArgs *args) dlg.setCaption(title); Widgets::handleXGeometry(&dlg); - QString result = dlg.openDialog(); + TQString result = dlg.openDialog(); if (!result.isEmpty()) { cout << result.local8Bit().data() << endl; @@ -647,10 +647,10 @@ static int directCommand(KCmdLineArgs *args) close(1); int totalsteps = 100; - QString text = QString::fromLocal8Bit(args->getOption("progressbar")); + TQString text = TQString::fromLocal8Bit(args->getOption("progressbar")); if (args->count() == 1) - totalsteps = QString::fromLocal8Bit(args->arg(0)).toInt(); + totalsteps = TQString::fromLocal8Bit(args->arg(0)).toInt(); return Widgets::progressBar(0, title, text, totalsteps) ? 1 : 0; } diff --git a/kdialog/klistboxdialog.cpp b/kdialog/klistboxdialog.cpp index 7ddbf509c..d7abfb694 100644 --- a/kdialog/klistboxdialog.cpp +++ b/kdialog/klistboxdialog.cpp @@ -17,34 +17,34 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -#include -#include -#include +#include +#include +#include #include "klistboxdialog.h" #include "klistboxdialog.moc" #include "klocale.h" -KListBoxDialog::KListBoxDialog(QString text, QWidget *parent) - : KDialogBase( parent, 0, true, QString::null, Ok|Cancel, Ok, true ) +KListBoxDialog::KListBoxDialog(TQString text, TQWidget *parent) + : KDialogBase( parent, 0, true, TQString::null, Ok|Cancel, Ok, true ) { - QVBox *page = makeVBoxMainWidget(); + TQVBox *page = makeVBoxMainWidget(); - label = new QLabel(text, page); + label = new TQLabel(text, page); label->setAlignment(AlignCenter); - table = new QListBox(page); + table = new TQListBox(page); table->setFocus(); } -void KListBoxDialog::insertItem(const QString& item) +void KListBoxDialog::insertItem(const TQString& item) { table->insertItem(item); table->setCurrentItem(0); } -void KListBoxDialog::setCurrentItem(const QString& item) +void KListBoxDialog::setCurrentItem(const TQString& item) { for ( int i=0; i < (int) table->count(); i++ ) { if ( table->text(i) == item ) { diff --git a/kdialog/klistboxdialog.h b/kdialog/klistboxdialog.h index 35a326da7..fb73383f1 100644 --- a/kdialog/klistboxdialog.h +++ b/kdialog/klistboxdialog.h @@ -29,19 +29,19 @@ class KListBoxDialog : public KDialogBase public: - KListBoxDialog(QString text, QWidget *parent=0); + KListBoxDialog(TQString text, TQWidget *parent=0); ~KListBoxDialog() {}; - QListBox &getTable() { return *table; }; + TQListBox &getTable() { return *table; }; - void insertItem( const QString& text ); - void setCurrentItem ( const QString& text ); + void insertItem( const TQString& text ); + void setCurrentItem ( const TQString& text ); int currentItem(); protected: - QListBox *table; - QLabel *label; + TQListBox *table; + TQLabel *label; }; diff --git a/kdialog/progressdialog.cpp b/kdialog/progressdialog.cpp index fa145f83e..498e333af 100644 --- a/kdialog/progressdialog.cpp +++ b/kdialog/progressdialog.cpp @@ -21,7 +21,7 @@ #include "kdebug.h" #include "widgets.h" -ProgressDialog::ProgressDialog(QWidget* parent, const QString& caption, const QString& text, int totalSteps) +ProgressDialog::ProgressDialog(TQWidget* parent, const TQString& caption, const TQString& text, int totalSteps) : DCOPObject( "ProgressDialog" ), KProgressDialog(parent, 0, caption, text, false) { setAutoClose( false ); @@ -54,7 +54,7 @@ int ProgressDialog::progress() const return progressBar()->progress(); } -void ProgressDialog::setLabel(const QString& label) +void ProgressDialog::setLabel(const TQString& label) { KProgressDialog::setLabel( label ); } diff --git a/kdialog/progressdialog.h b/kdialog/progressdialog.h index 4b7d90754..cdfca1ccb 100644 --- a/kdialog/progressdialog.h +++ b/kdialog/progressdialog.h @@ -27,7 +27,7 @@ class ProgressDialog : public KProgressDialog, virtual public ProgressDialogIfac Q_OBJECT public: - ProgressDialog(QWidget* parent = 0, const QString& caption = QString::null, const QString& text = QString::null, int totalSteps = 100); + ProgressDialog(TQWidget* parent = 0, const TQString& caption = TQString::null, const TQString& text = TQString::null, int totalSteps = 100); void setTotalSteps( int ); int totalSteps() const; @@ -35,7 +35,7 @@ class ProgressDialog : public KProgressDialog, virtual public ProgressDialogIfac void setProgress( int ); int progress() const; - void setLabel(const QString&); + void setLabel(const TQString&); void showCancelButton(bool show); bool wasCancelled() const; diff --git a/kdialog/progressdialogiface.h b/kdialog/progressdialogiface.h index 2974cb9a9..068e5de38 100644 --- a/kdialog/progressdialogiface.h +++ b/kdialog/progressdialogiface.h @@ -14,7 +14,7 @@ class ProgressDialogIface : virtual public DCOPObject virtual void setProgress( int ) =0; virtual int progress() const =0; - virtual void setLabel( const QString& ) =0; + virtual void setLabel( const TQString& ) =0; virtual void showCancelButton ( bool ) =0; virtual bool wasCancelled() const =0; diff --git a/kdialog/widgets.cpp b/kdialog/widgets.cpp index 41f5e452f..a2064a5ba 100644 --- a/kdialog/widgets.cpp +++ b/kdialog/widgets.cpp @@ -30,16 +30,16 @@ #include #include -#include +#include #include -#include -#include +#include +#include #if defined Q_WS_X11 && ! defined K_WS_QTONLY #include #endif -void Widgets::handleXGeometry(QWidget * dlg) +void Widgets::handleXGeometry(TQWidget * dlg) { #ifdef Q_WS_X11 if ( ! kapp->geometryArgument().isEmpty()) { @@ -56,16 +56,16 @@ void Widgets::handleXGeometry(QWidget * dlg) #endif } -bool Widgets::inputBox(QWidget *parent, const QString& title, const QString& text, const QString& init, QString &result) +bool Widgets::inputBox(TQWidget *parent, const TQString& title, const TQString& text, const TQString& init, TQString &result) { bool ok; - QString str = KInputDialog::text( title, text, init, &ok, parent, 0, 0, QString::null ); + TQString str = KInputDialog::text( title, text, init, &ok, parent, 0, 0, TQString::null ); if ( ok ) result = str; return ok; } -bool Widgets::passwordBox(QWidget *parent, const QString& title, const QString& text, QCString &result) +bool Widgets::passwordBox(TQWidget *parent, const TQString& title, const TQString& text, TQCString &result) { KPasswordDialog dlg( KPasswordDialog::Password, false, 0, parent ); @@ -75,13 +75,13 @@ bool Widgets::passwordBox(QWidget *parent, const QString& title, const QString& handleXGeometry(&dlg); - bool retcode = (dlg.exec() == QDialog::Accepted); + bool retcode = (dlg.exec() == TQDialog::Accepted); if ( retcode ) result = dlg.password(); return retcode; } -int Widgets::textBox(QWidget *parent, int width, int height, const QString& title, const QString& file) +int Widgets::textBox(TQWidget *parent, int width, int height, const TQString& title, const TQString& file) { // KTextBox dlg(parent, 0, TRUE, width, height, file); KDialogBase dlg( parent, 0, true, title, KDialogBase::Ok, KDialogBase::Ok ); @@ -90,23 +90,23 @@ int Widgets::textBox(QWidget *parent, int width, int height, const QString& titl KTextEdit *edit = new KTextEdit( dlg.makeVBoxMainWidget() ); edit->setReadOnly(TRUE); - QFile f(file); + TQFile f(file); if (!f.open(IO_ReadOnly)) { kdError() << i18n("kdialog: could not open file ") << file << endl; return -1; } - QTextStream s(&f); + TQTextStream s(&f); while (!s.eof()) edit->append(s.readLine()); - edit->moveCursor(QTextEdit::MoveHome, false); + edit->moveCursor(TQTextEdit::MoveHome, false); f.close(); if ( width > 0 && height > 0 ) - dlg.setInitialSize( QSize( width, height ) ); + dlg.setInitialSize( TQSize( width, height ) ); handleXGeometry(&dlg); dlg.setCaption(title); @@ -114,17 +114,17 @@ int Widgets::textBox(QWidget *parent, int width, int height, const QString& titl return 0; } -int Widgets::textInputBox(QWidget *parent, int width, int height, const QString& title, const QStringList& args, QCString &result) +int Widgets::textInputBox(TQWidget *parent, int width, int height, const TQString& title, const TQStringList& args, TQCString &result) { // KTextBox dlg(parent, 0, TRUE, width, height, file); KDialogBase dlg( parent, 0, true, title, KDialogBase::Ok, KDialogBase::Ok ); kapp->setTopWidget( &dlg ); - QVBox* vbox = dlg.makeVBoxMainWidget(); + TQVBox* vbox = dlg.makeVBoxMainWidget(); if( args.count() > 0 ) { - QLabel *label = new QLabel(vbox); + TQLabel *label = new TQLabel(vbox); label->setText(args[0]); } @@ -137,7 +137,7 @@ int Widgets::textInputBox(QWidget *parent, int width, int height, const QString& edit->setText( args[1] ); if ( width > 0 && height > 0 ) - dlg.setInitialSize( QSize( width, height ) ); + dlg.setInitialSize( TQSize( width, height ) ); handleXGeometry(&dlg); dlg.setCaption(title); @@ -146,17 +146,17 @@ int Widgets::textInputBox(QWidget *parent, int width, int height, const QString& return 0; } -bool Widgets::comboBox(QWidget *parent, const QString& title, const QString& text, const QStringList& args, - const QString& defaultEntry, QString &result) +bool Widgets::comboBox(TQWidget *parent, const TQString& title, const TQString& text, const TQStringList& args, + const TQString& defaultEntry, TQString &result) { KDialogBase dlg( parent, 0, true, title, KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok ); kapp->setTopWidget( &dlg ); dlg.setCaption(title); - QVBox* vbox = dlg.makeVBoxMainWidget(); + TQVBox* vbox = dlg.makeVBoxMainWidget(); - QLabel label (vbox); + TQLabel label (vbox); label.setText (text); KComboBox combo (vbox); combo.insertStringList (args); @@ -164,7 +164,7 @@ bool Widgets::comboBox(QWidget *parent, const QString& title, const QString& tex handleXGeometry(&dlg); - bool retcode = (dlg.exec() == QDialog::Accepted); + bool retcode = (dlg.exec() == TQDialog::Accepted); if (retcode) result = combo.currentText(); @@ -172,8 +172,8 @@ bool Widgets::comboBox(QWidget *parent, const QString& title, const QString& tex return retcode; } -bool Widgets::listBox(QWidget *parent, const QString& title, const QString& text, const QStringList& args, - const QString& defaultEntry, QString &result) +bool Widgets::listBox(TQWidget *parent, const TQString& title, const TQString& text, const TQStringList& args, + const TQString& defaultEntry, TQString &result) { KListBoxDialog box(text,parent); @@ -187,23 +187,23 @@ bool Widgets::listBox(QWidget *parent, const QString& title, const QString& text handleXGeometry(&box); - bool retcode = (box.exec() == QDialog::Accepted); + bool retcode = (box.exec() == TQDialog::Accepted); if ( retcode ) result = args[ box.currentItem()*2 ]; return retcode; } -bool Widgets::checkList(QWidget *parent, const QString& title, const QString& text, const QStringList& args, bool separateOutput, QStringList &result) +bool Widgets::checkList(TQWidget *parent, const TQString& title, const TQString& text, const TQStringList& args, bool separateOutput, TQStringList &result) { - QStringList entries, tags; - QString rs; + TQStringList entries, tags; + TQString rs; result.clear(); KListBoxDialog box(text,parent); - QListBox &table = box.getTable(); + TQListBox &table = box.getTable(); kapp->setTopWidget( &box ); box.setCaption(title); @@ -218,12 +218,12 @@ bool Widgets::checkList(QWidget *parent, const QString& title, const QString& te table.setCurrentItem(0); // This is to circumvent a Qt bug for (unsigned int i=0; i+2setTopWidget( &box ); box.setCaption(title); @@ -260,18 +260,18 @@ bool Widgets::radioBox(QWidget *parent, const QString& title, const QString& tex table.insertStringList(entries); for (unsigned int i=0; i+2setTopWidget( &dlg ); diff --git a/kdialog/widgets.h b/kdialog/widgets.h index 8808b810c..e6576d36e 100644 --- a/kdialog/widgets.h +++ b/kdialog/widgets.h @@ -21,22 +21,22 @@ #ifndef _WIDGETS_H_ #define _WIDGETS_H_ -#include -#include +#include +#include namespace Widgets { - bool inputBox(QWidget *parent, const QString& title, const QString& text, const QString& init, QString &result); - bool passwordBox(QWidget *parent, const QString& title, const QString& text, QCString &result); - int textBox(QWidget *parent, int width, int height, const QString& title, const QString& file); - int textInputBox(QWidget *parent, int width, int height, const QString& title, const QStringList& args, QCString &result); - bool listBox(QWidget *parent, const QString& title, const QString& text, const QStringList& args, const QString &defaultEntry, QString &result); - bool checkList(QWidget *parent, const QString& title, const QString& text, const QStringList& args, bool separateOutput, QStringList &result); - bool radioBox(QWidget *parent, const QString& title, const QString& text, const QStringList& args, QString &result); - bool comboBox(QWidget *parent, const QString& title, const QString& text, const QStringList& args, const QString& defaultEntry, QString &result); - bool progressBar(QWidget *parent, const QString& title, const QString& text, int totalSteps); + bool inputBox(TQWidget *parent, const TQString& title, const TQString& text, const TQString& init, TQString &result); + bool passwordBox(TQWidget *parent, const TQString& title, const TQString& text, TQCString &result); + int textBox(TQWidget *parent, int width, int height, const TQString& title, const TQString& file); + int textInputBox(TQWidget *parent, int width, int height, const TQString& title, const TQStringList& args, TQCString &result); + bool listBox(TQWidget *parent, const TQString& title, const TQString& text, const TQStringList& args, const TQString &defaultEntry, TQString &result); + bool checkList(TQWidget *parent, const TQString& title, const TQString& text, const TQStringList& args, bool separateOutput, TQStringList &result); + bool radioBox(TQWidget *parent, const TQString& title, const TQString& text, const TQStringList& args, TQString &result); + bool comboBox(TQWidget *parent, const TQString& title, const TQString& text, const TQStringList& args, const TQString& defaultEntry, TQString &result); + bool progressBar(TQWidget *parent, const TQString& title, const TQString& text, int totalSteps); - void handleXGeometry(QWidget * dlg); + void handleXGeometry(TQWidget * dlg); } -- cgit v1.2.3