summaryrefslogtreecommitdiffstats
path: root/kppp/providerdb.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
commit47c8a359c5276062c4bc17f0e82410f29081b502 (patch)
tree2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kppp/providerdb.cpp
parent6f82532777a35e0e60bbd2b290b2e93e646f349b (diff)
downloadtdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz
tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kppp/providerdb.cpp')
-rw-r--r--kppp/providerdb.cpp184
1 files changed, 92 insertions, 92 deletions
diff --git a/kppp/providerdb.cpp b/kppp/providerdb.cpp
index 614816d0..867ffd8c 100644
--- a/kppp/providerdb.cpp
+++ b/kppp/providerdb.cpp
@@ -29,26 +29,26 @@
//---------------------------------------------------------------------------
-#include <qdir.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qregexp.h>
+#include <tqdir.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqregexp.h>
#include <klocale.h>
#include <kstandarddirs.h>
#include <kdebug.h>
#include "providerdb.h"
#include "newwidget.h"
#include "pppdata.h"
-#include <qlistbox.h>
-#include <qlineedit.h>
+#include <tqlistbox.h>
+#include <tqlineedit.h>
#include <ksimpleconfig.h>
#define UNENCODED_CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"
-QWizard* ProviderDB::wiz = 0L;
+TQWizard* ProviderDB::wiz = 0L;
-ProviderDB::ProviderDB(QWidget *parent) :
+ProviderDB::ProviderDB(TQWidget *parent) :
KWizard(parent, "", true),
cfg(0)
{
@@ -83,10 +83,10 @@ ProviderDB::ProviderDB(QWidget *parent) :
setFinish(page9, true);
setFinishEnabled(page9, true);
- connect((const QObject *)nextButton(), SIGNAL(clicked()),
- this, SLOT(pageSelected()));
- connect((const QObject *)backButton(), SIGNAL(clicked()),
- this, SLOT(pageSelected()));
+ connect((const TQObject *)nextButton(), TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(pageSelected()));
+ connect((const TQObject *)backButton(), TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(pageSelected()));
// resize(minimumSize());
adjustSize();
@@ -102,7 +102,7 @@ void ProviderDB::pageSelected() {
bool prev = true;
bool next = true;
- QWidget *page = currentPage();
+ TQWidget *page = currentPage();
if(page == page2) {
next = page2->lb->currentItem() != -1;
} else if(page == page3) {
@@ -122,12 +122,12 @@ void ProviderDB::pageSelected() {
void ProviderDB::loadProviderInfo() {
delete cfg;
- QString loc = *page2->list->at(page2->lb->currentItem());
- QString provider = page3->lb->text(page3->lb->currentItem());
+ TQString loc = *page2->list->at(page2->lb->currentItem());
+ TQString provider = page3->lb->text(page3->lb->currentItem());
urlEncode(provider);
- QString prov = "Provider/" + loc;
+ TQString prov = "Provider/" + loc;
prov += "/" + provider;
- QString fname = locate("appdata", prov);
+ TQString fname = locate("appdata", prov);
kdDebug(5002) << "Providerfile=" << fname << endl;
cfg = new KSimpleConfig(fname, true);
@@ -135,14 +135,14 @@ void ProviderDB::loadProviderInfo() {
void ProviderDB::accept() {
- QRegExp re_username("%USERNAME%");
- QRegExp re_password("%PASSWORD%");
+ TQRegExp re_username("%USERNAME%");
+ TQRegExp re_password("%PASSWORD%");
- QMap <QString, QString> map(cfg->entryMap("<default>"));
- QMap <QString, QString>::Iterator it(map.begin());
+ TQMap <TQString, TQString> map(cfg->entryMap("<default>"));
+ TQMap <TQString, TQString>::Iterator it(map.begin());
while(it != map.end()) {
- QString key = it.key();
- QString value = *it;
+ TQString key = it.key();
+ TQString value = *it;
if(value.contains(re_username))
value.replace(re_username, page4->username());
@@ -164,8 +164,8 @@ void ProviderDB::accept() {
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
-PDB_Intro::PDB_Intro(QWidget *parent) : QWidget(parent) {
- QLabel *l = new QLabel(i18n("You will be asked a few questions on information\n"
+PDB_Intro::PDB_Intro(TQWidget *parent) : TQWidget(parent) {
+ TQLabel *l = new TQLabel(i18n("You will be asked a few questions on information\n"
"which is needed to establish an Internet connection\n"
"with your Internet Service Provider (ISP).\n\n"
"Make sure you have the registration form from your\n"
@@ -173,7 +173,7 @@ PDB_Intro::PDB_Intro(QWidget *parent) : QWidget(parent) {
"help first. If any information is missing, contact\n"
"your ISP."),
this);
- QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);
+ TQVBoxLayout *tl = new TQVBoxLayout(this, 10, 10);
tl->addWidget(l);
tl->activate();
}
@@ -182,24 +182,24 @@ PDB_Intro::PDB_Intro(QWidget *parent) : QWidget(parent) {
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
-PDB_Country::PDB_Country(QWidget *parent) : QWidget(parent) {
- QLabel *l = new QLabel(i18n("Select the location where you plan to use this\n"
+PDB_Country::PDB_Country(TQWidget *parent) : TQWidget(parent) {
+ TQLabel *l = new TQLabel(i18n("Select the location where you plan to use this\n"
"account from the list below. If your country or\n"
"location is not listed, you have to create the\n"
"account with the normal, dialog based setup.\n\n"
"If you click \"Cancel\", the dialog based setup\n"
"will start."),
this);
- QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);
+ TQVBoxLayout *tl = new TQVBoxLayout(this, 10, 10);
tl->addWidget(l);
- QHBoxLayout *l1 = new QHBoxLayout;
+ TQHBoxLayout *l1 = new QHBoxLayout;
tl->addLayout(l1);
l1->addStretch(1);
- lb = new QListBox(this);
- connect(lb, SIGNAL(highlighted(int)),
- this, SLOT(selectionChanged(int)));
+ lb = new TQListBox(this);
+ connect(lb, TQT_SIGNAL(highlighted(int)),
+ this, TQT_SLOT(selectionChanged(int)));
lb->setMinimumSize(220, 100);
l1->addWidget(lb, 2);
l1->addStretch(1);
@@ -208,22 +208,22 @@ PDB_Country::PDB_Country(QWidget *parent) : QWidget(parent) {
// fill the listbox
// set up filter
- QDir d(KGlobal::dirs()->findDirs("appdata", "Provider").first());
- d.setFilter(QDir::Dirs);
- d.setSorting(QDir::Name);
+ TQDir d(KGlobal::dirs()->findDirs("appdata", "Provider").first());
+ d.setFilter(TQDir::Dirs);
+ d.setSorting(TQDir::Name);
// read the list of files
const QFileInfoList *flist = d.entryInfoList();
if(flist) {
QFileInfoListIterator it( *flist );
- QFileInfo *fi;
+ TQFileInfo *fi;
// traverse the flist and insert into a map for sorting
- QMap<QString, QString> countries;
+ TQMap<TQString, TQString> countries;
for(; (fi = it.current()) != 0; ++it) {
if(fi->fileName() != "." && fi->fileName() != "..") {
- QString dirFile(fi->absFilePath()+"/.directory");
- QString entryName;
- if(QFile::exists(dirFile)){
+ TQString dirFile(fi->absFilePath()+"/.directory");
+ TQString entryName;
+ if(TQFile::exists(dirFile)){
KSimpleConfig config(dirFile);
config.setDesktopGroup();
entryName = config.readEntry("Name");
@@ -233,8 +233,8 @@ PDB_Country::PDB_Country(QWidget *parent) : QWidget(parent) {
}
}
// insert sorted entries into list box and string list
- QMap<QString, QString>::const_iterator mit = countries.begin();
- QMap<QString, QString>::const_iterator mend = countries.end();
+ TQMap<TQString, TQString>::const_iterator mit = countries.begin();
+ TQMap<TQString, TQString>::const_iterator mend = countries.end();
while(mit != mend) {
lb->insertItem(mit.key());
list->append(*mit);
@@ -251,7 +251,7 @@ PDB_Country::~PDB_Country()
}
void PDB_Country::selectionChanged(int idx) {
- // QWizard *wizard = (QWizard *)parent(); Why doesn't this work ?
+ // TQWizard *wizard = (TQWizard *)parent(); Why doesn't this work ?
ProviderDB::wiz->setNextEnabled(this, (idx != -1));
}
@@ -259,9 +259,9 @@ void PDB_Country::selectionChanged(int idx) {
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
-PDB_Provider::PDB_Provider(QWidget *parent) : QWidget(parent) {
- QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);
- QLabel *l = new QLabel(i18n("Select your Internet Service Provider (ISP) from\n"
+PDB_Provider::PDB_Provider(TQWidget *parent) : TQWidget(parent) {
+ TQVBoxLayout *tl = new TQVBoxLayout(this, 10, 10);
+ TQLabel *l = new TQLabel(i18n("Select your Internet Service Provider (ISP) from\n"
"the list below. If the ISP is not in this list,\n"
"you have to click on \"Cancel\" and create this\n"
"account using the normal, dialog-based setup.\n\n"
@@ -269,13 +269,13 @@ PDB_Provider::PDB_Provider(QWidget *parent) : QWidget(parent) {
"selection."), this);
tl->addWidget(l);
- QHBoxLayout *l1 = new QHBoxLayout;
+ TQHBoxLayout *l1 = new QHBoxLayout;
tl->addLayout(l1);
l1->addStretch(1);
- lb = new QListBox(this);
- connect(lb, SIGNAL(highlighted(int)),
- this, SLOT(selectionChanged(int)));
+ lb = new TQListBox(this);
+ connect(lb, TQT_SIGNAL(highlighted(int)),
+ this, TQT_SLOT(selectionChanged(int)));
lb->setMinimumSize(220, 100);
l1->addWidget(lb, 2);
l1->addStretch(1);
@@ -286,7 +286,7 @@ void PDB_Provider::selectionChanged(int idx) {
}
-void PDB_Provider::setDir(const QString &_dir) {
+void PDB_Provider::setDir(const TQString &_dir) {
if(dir != _dir) {
lb->clear();
@@ -294,24 +294,24 @@ void PDB_Provider::setDir(const QString &_dir) {
// set up filter
dir = _dir;
- QString dir1 = KGlobal::dirs()->findDirs("appdata", "Provider").first();
- QRegExp re1(" ");
+ TQString dir1 = KGlobal::dirs()->findDirs("appdata", "Provider").first();
+ TQRegExp re1(" ");
dir = dir.replace(re1, "_");
dir1 += dir;
- QDir d(dir1);
- d.setFilter(QDir::Files);
- d.setSorting(QDir::Name);
+ TQDir d(dir1);
+ d.setFilter(TQDir::Files);
+ d.setSorting(TQDir::Name);
// read the list of files
const QFileInfoList *list = d.entryInfoList();
QFileInfoListIterator it( *list );
- QFileInfo *fi;
+ TQFileInfo *fi;
// traverse the list and insert into the widget
- QRegExp re("_");
+ TQRegExp re("_");
while((fi = it.current()) != NULL) {
- QString fname = fi->fileName();
+ TQString fname = fi->fileName();
if(fname.length() && fname[0] != '.') {
urlDecode(fname);
lb->insertItem(fname);
@@ -325,7 +325,7 @@ void PDB_Provider::setDir(const QString &_dir) {
}
-QString PDB_Provider::getDir() {
+TQString PDB_Provider::getDir() {
return dir;
}
@@ -334,48 +334,48 @@ QString PDB_Provider::getDir() {
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
-PDB_UserInfo::PDB_UserInfo(QWidget *parent) : QWidget(parent) {
- QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);
- QLabel *l = new QLabel(i18n("To log on to your ISP, kppp needs the username\n"
+PDB_UserInfo::PDB_UserInfo(TQWidget *parent) : TQWidget(parent) {
+ TQVBoxLayout *tl = new TQVBoxLayout(this, 10, 10);
+ TQLabel *l = new TQLabel(i18n("To log on to your ISP, kppp needs the username\n"
"and the password you got from your ISP. Type\n"
"in this information in the fields below.\n\n"
"Word case is important here."),
this);
tl->addWidget(l);
- QGridLayout *l1 = new QGridLayout(2, 2);
+ TQGridLayout *l1 = new TQGridLayout(2, 2);
tl->addLayout(l1);
- l = new QLabel(i18n("Username:"), this);
+ l = new TQLabel(i18n("Username:"), this);
l1->addWidget(l, 0, 0);
- l = new QLabel(i18n("Password:"), this);
+ l = new TQLabel(i18n("Password:"), this);
l1->addWidget(l, 1, 0);
_username = newLineEdit(24, this);
- connect(_username, SIGNAL(textChanged(const QString &)),
- this, SLOT(textChanged(const QString &)));
+ connect(_username, TQT_SIGNAL(textChanged(const TQString &)),
+ this, TQT_SLOT(textChanged(const TQString &)));
l1->addWidget(_username, 0, 1);
_password = newLineEdit(24, this);
- _password->setEchoMode(QLineEdit::Password);
- connect(_password, SIGNAL(textChanged(const QString &)),
- this, SLOT(textChanged(const QString &)));
+ _password->setEchoMode(TQLineEdit::Password);
+ connect(_password, TQT_SIGNAL(textChanged(const TQString &)),
+ this, TQT_SLOT(textChanged(const TQString &)));
l1->addWidget(_password, 1, 1);
tl->activate();
}
-void PDB_UserInfo::textChanged(const QString &) {
+void PDB_UserInfo::textChanged(const TQString &) {
ProviderDB::wiz->setNextEnabled(this, !_password->text().isEmpty() &&
!_username->text().isEmpty());
}
-QString PDB_UserInfo::username() {
- QString s = _username->text();
+TQString PDB_UserInfo::username() {
+ TQString s = _username->text();
return s;
}
-QString PDB_UserInfo::password() {
- QString s = _password->text();
+TQString PDB_UserInfo::password() {
+ TQString s = _password->text();
return s;
}
@@ -388,9 +388,9 @@ void PDB_UserInfo::activate() {
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
-PDB_DialPrefix::PDB_DialPrefix(QWidget *parent) : QWidget(parent) {
- QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);
- QLabel *l = new QLabel(i18n("If you need a special dial prefix (e.g. if you\n"
+PDB_DialPrefix::PDB_DialPrefix(TQWidget *parent) : TQWidget(parent) {
+ TQVBoxLayout *tl = new TQVBoxLayout(this, 10, 10);
+ TQLabel *l = new TQLabel(i18n("If you need a special dial prefix (e.g. if you\n"
"are using a telephone switch) you can specify\n"
"it here. This prefix is dialed just before the\n"
"phone number.\n\n"
@@ -399,9 +399,9 @@ PDB_DialPrefix::PDB_DialPrefix(QWidget *parent) : QWidget(parent) {
this);
tl->addWidget(l);
- QGridLayout *l1 = new QGridLayout(1, 2);
+ TQGridLayout *l1 = new TQGridLayout(1, 2);
tl->addLayout(l1);
- l = new QLabel(i18n("Dial prefix:"), this);
+ l = new TQLabel(i18n("Dial prefix:"), this);
l1->addWidget(l, 0, 0);
_prefix = newLineEdit(24, this);
l1->addWidget(_prefix, 0, 1);
@@ -409,8 +409,8 @@ PDB_DialPrefix::PDB_DialPrefix(QWidget *parent) : QWidget(parent) {
}
-QString PDB_DialPrefix::prefix() {
- QString s = _prefix->text();
+TQString PDB_DialPrefix::prefix() {
+ TQString s = _prefix->text();
return s;
}
@@ -424,9 +424,9 @@ void PDB_DialPrefix::activate() {
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
-PDB_Finished::PDB_Finished(QWidget *parent) : QWidget(parent) {
- QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);
- QLabel *l = new QLabel(i18n("Finished!\n\n"
+PDB_Finished::PDB_Finished(TQWidget *parent) : TQWidget(parent) {
+ TQVBoxLayout *tl = new TQVBoxLayout(this, 10, 10);
+ TQLabel *l = new TQLabel(i18n("Finished!\n\n"
"A new account has been created. Click \"Finish\" to\n"
"go back to the setup dialog. If you want to\n"
"check the settings of the newly created account,\n"
@@ -437,8 +437,8 @@ PDB_Finished::PDB_Finished(QWidget *parent) : QWidget(parent) {
}
-void urlDecode(QString &s) {
- QString s1;
+void urlDecode(TQString &s) {
+ TQString s1;
for(uint i = 0; i < s.length(); i++) {
if(s[i] == '%') {
@@ -454,11 +454,11 @@ void urlDecode(QString &s) {
}
-void urlEncode(QString &s) {
- QString s1, tmp;
+void urlEncode(TQString &s) {
+ TQString s1, tmp;
for(uint i = 0; i < s.length(); i++) {
- if(QString(UNENCODED_CHARS).find(s[i]) >= 0)
+ if(TQString(UNENCODED_CHARS).find(s[i]) >= 0)
s1 += s[i];
else {
tmp.sprintf("%%%03i", s[i].unicode());