summaryrefslogtreecommitdiffstats
path: root/kppp/accounts.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/accounts.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/accounts.cpp')
-rw-r--r--kppp/accounts.cpp148
1 files changed, 74 insertions, 74 deletions
diff --git a/kppp/accounts.cpp b/kppp/accounts.cpp
index 25023ad4..d374e6c6 100644
--- a/kppp/accounts.cpp
+++ b/kppp/accounts.cpp
@@ -24,12 +24,12 @@
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <qdir.h>
+#include <tqdir.h>
#include <stdlib.h>
-#include <qlayout.h>
-#include <qtabdialog.h>
-#include <qwhatsthis.h>
-#include <qmessagebox.h>
+#include <tqlayout.h>
+#include <tqtabdialog.h>
+#include <tqwhatsthis.h>
+#include <tqmessagebox.h>
#include <kapplication.h>
#include <kbuttonbox.h>
@@ -39,7 +39,7 @@
#include <kwin.h>
#include <kdialogbase.h>
#include <kstdguiitem.h>
-#include <qvgroupbox.h>
+#include <tqvgroupbox.h>
#include <errno.h>
@@ -51,29 +51,29 @@
void parseargs(char* buf, char** args);
-AccountWidget::AccountWidget( QWidget *parent, const char *name )
- : QWidget( parent, name )
+AccountWidget::AccountWidget( TQWidget *parent, const char *name )
+ : TQWidget( parent, name )
{
int min = 0;
- QVBoxLayout *l1 = new QVBoxLayout(parent, 10, 10);
+ TQVBoxLayout *l1 = new TQVBoxLayout(parent, 10, 10);
// add a hbox
- QHBoxLayout *l11 = new QHBoxLayout;
+ TQHBoxLayout *l11 = new QHBoxLayout;
l1->addLayout(l11);
- accountlist_l = new QListBox(parent);
+ accountlist_l = new TQListBox(parent);
accountlist_l->setMinimumSize(160, 128);
- connect(accountlist_l, SIGNAL(highlighted(int)),
- this, SLOT(slotListBoxSelect(int)));
- connect(accountlist_l, SIGNAL(selected(int)),
- this, SLOT(editaccount()));
+ connect(accountlist_l, TQT_SIGNAL(highlighted(int)),
+ this, TQT_SLOT(slotListBoxSelect(int)));
+ connect(accountlist_l, TQT_SIGNAL(selected(int)),
+ this, TQT_SLOT(editaccount()));
l11->addWidget(accountlist_l, 10);
- QVBoxLayout *l111 = new QVBoxLayout;
+ TQVBoxLayout *l111 = new QVBoxLayout;
l11->addLayout(l111, 1);
- edit_b = new QPushButton(i18n("&Edit..."), parent);
- connect(edit_b, SIGNAL(clicked()), SLOT(editaccount()));
- QWhatsThis::add(edit_b, i18n("Allows you to modify the selected account"));
+ edit_b = new TQPushButton(i18n("&Edit..."), parent);
+ connect(edit_b, TQT_SIGNAL(clicked()), TQT_SLOT(editaccount()));
+ TQWhatsThis::add(edit_b, i18n("Allows you to modify the selected account"));
min = edit_b->sizeHint().width();
min = QMAX(70,min);
@@ -81,60 +81,60 @@ AccountWidget::AccountWidget( QWidget *parent, const char *name )
l111->addWidget(edit_b);
- new_b = new QPushButton(i18n("&New..."), parent);
- connect(new_b, SIGNAL(clicked()), SLOT(newaccount()));
+ new_b = new TQPushButton(i18n("&New..."), parent);
+ connect(new_b, TQT_SIGNAL(clicked()), TQT_SLOT(newaccount()));
l111->addWidget(new_b);
- QWhatsThis::add(new_b, i18n("Create a new dialup connection\n"
+ TQWhatsThis::add(new_b, i18n("Create a new dialup connection\n"
"to the Internet"));
- copy_b = new QPushButton(i18n("Co&py"), parent);
- connect(copy_b, SIGNAL(clicked()), SLOT(copyaccount()));
+ copy_b = new TQPushButton(i18n("Co&py"), parent);
+ connect(copy_b, TQT_SIGNAL(clicked()), TQT_SLOT(copyaccount()));
l111->addWidget(copy_b);
- QWhatsThis::add(copy_b,
+ TQWhatsThis::add(copy_b,
i18n("Makes a copy of the selected account. All\n"
"settings of the selected account are copied\n"
"to a new account that you can modify to fit your\n"
"needs"));
- delete_b = new QPushButton(i18n("De&lete"), parent);
- connect(delete_b, SIGNAL(clicked()), SLOT(deleteaccount()));
+ delete_b = new TQPushButton(i18n("De&lete"), parent);
+ connect(delete_b, TQT_SIGNAL(clicked()), TQT_SLOT(deleteaccount()));
l111->addWidget(delete_b);
- QWhatsThis::add(delete_b,
+ TQWhatsThis::add(delete_b,
i18n("<p>Deletes the selected account\n\n"
"<font color=\"red\"><b>Use with care!</b></font>"));
- QHBoxLayout *l12 = new QHBoxLayout;
+ TQHBoxLayout *l12 = new QHBoxLayout;
l1->addStretch(1);
l1->addLayout(l12);
- QVBoxLayout *l121 = new QVBoxLayout;
+ TQVBoxLayout *l121 = new QVBoxLayout;
l12->addLayout(l121);
l121->addStretch(1);
- costlabel = new QLabel(i18n("Phone costs:"), parent);
+ costlabel = new TQLabel(i18n("Phone costs:"), parent);
costlabel->setEnabled(FALSE);
l121->addWidget(costlabel);
- costedit = new QLineEdit(parent);
- costedit->setFocusPolicy(QWidget::NoFocus);
+ costedit = new TQLineEdit(parent);
+ costedit->setFocusPolicy(TQWidget::NoFocus);
costedit->setFixedHeight(costedit->sizeHint().height());
costedit->setEnabled(FALSE);
l121->addWidget(costedit);
l121->addStretch(1);
- QString tmp = i18n("<p>This shows the accumulated phone costs\n"
+ TQString tmp = i18n("<p>This shows the accumulated phone costs\n"
"for the selected account.\n"
"\n"
"<b>Important</b>: If you have more than one \n"
"account - beware, this is <b>NOT</b> the sum \n"
"of the phone costs of all your accounts!");
- QWhatsThis::add(costlabel, tmp);
- QWhatsThis::add(costedit, tmp);
+ TQWhatsThis::add(costlabel, tmp);
+ TQWhatsThis::add(costedit, tmp);
- vollabel = new QLabel(i18n("Volume:"), parent);
+ vollabel = new TQLabel(i18n("Volume:"), parent);
vollabel->setEnabled(FALSE);
l121->addWidget(vollabel);
- voledit = new QLineEdit(parent,"voledit");
- voledit->setFocusPolicy(QWidget::NoFocus);
+ voledit = new TQLineEdit(parent,"voledit");
+ voledit->setFocusPolicy(TQWidget::NoFocus);
voledit->setFixedHeight(voledit->sizeHint().height());
voledit->setEnabled(FALSE);
l121->addWidget(voledit);
@@ -145,23 +145,23 @@ AccountWidget::AccountWidget( QWidget *parent, const char *name )
"\n"
"<a href=\"#volaccounting\">More on volume accounting</a>");
- QWhatsThis::add(vollabel,tmp);
- QWhatsThis::add(voledit, tmp);
+ TQWhatsThis::add(vollabel,tmp);
+ TQWhatsThis::add(voledit, tmp);
- QVBoxLayout *l122 = new QVBoxLayout;
+ TQVBoxLayout *l122 = new QVBoxLayout;
l12->addStretch(1);
l12->addLayout(l122);
l122->addStretch(1);
- reset = new QPushButton(i18n("&Reset..."), parent);
+ reset = new TQPushButton(i18n("&Reset..."), parent);
reset->setEnabled(FALSE);
- connect(reset, SIGNAL(clicked()),
- this, SLOT(resetClicked()));
+ connect(reset, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(resetClicked()));
l122->addWidget(reset);
- log = new QPushButton(i18n("&View Logs"), parent);
- connect(log, SIGNAL(clicked()),
- this, SLOT(viewLogClicked()));
+ log = new TQPushButton(i18n("&View Logs"), parent);
+ connect(log, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(viewLogClicked()));
l122->addWidget(log);
l122->addStretch(1);
@@ -185,7 +185,7 @@ void AccountWidget::slotListBoxSelect(int idx) {
edit_b->setEnabled((bool)(idx != -1));
copy_b->setEnabled((bool)(idx != -1));
if(idx!=-1) {
- QString account = gpppdata.accname();
+ TQString account = gpppdata.accname();
gpppdata.setAccountByIndex(accountlist_l->currentItem());
reset->setEnabled(TRUE);
costlabel->setEnabled(TRUE);
@@ -211,7 +211,7 @@ void AccountWidget::slotListBoxSelect(int idx) {
void AccountWidget::viewLogClicked(){
- QApplication::flushX();
+ TQApplication::flushX();
if(fork() == 0) {
if (setgid(getgid()) < 0 && errno != EPERM)
_exit(2);
@@ -249,7 +249,7 @@ void AccountWidget::editaccount() {
int result = doTab();
- if(result == QDialog::Accepted) {
+ if(result == TQDialog::Accepted) {
accountlist_l->changeItem(gpppdata.accname(),accountlist_l->currentItem());
emit resetaccounts();
gpppdata.save();
@@ -291,7 +291,7 @@ void AccountWidget::newaccount() {
return;
}
- if(result == QDialog::Accepted) {
+ if(result == TQDialog::Accepted) {
accountlist_l->insertItem(gpppdata.accname());
accountlist_l->setSelected(accountlist_l->findItem(gpppdata.accname()),
true);
@@ -323,7 +323,7 @@ void AccountWidget::copyaccount() {
void AccountWidget::deleteaccount() {
- QString s = i18n("Are you sure you want to delete\nthe account \"%1\"?")
+ TQString s = i18n("Are you sure you want to delete\nthe account \"%1\"?")
.arg(accountlist_l->text(accountlist_l->currentItem()));
if(KMessageBox::warningYesNo(this, s, i18n("Confirm"), KGuiItem(i18n("Delete"), "editdelete"), KStdGuiItem::cancel()) != KMessageBox::Yes)
@@ -341,7 +341,7 @@ void AccountWidget::deleteaccount() {
int AccountWidget::doTab(){
- tabWindow = new KDialogBase( KDialogBase::Tabbed, QString::null,
+ tabWindow = new KDialogBase( KDialogBase::Tabbed, TQString::null,
KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok,
0, 0, true);
KWin::setIcons(tabWindow->winId(), kapp->icon(), kapp->miniIcon());
@@ -351,7 +351,7 @@ int AccountWidget::doTab(){
tabWindow->setCaption(i18n("New Account"));
isnewaccount = true;
} else {
- QString tit = i18n("Edit Account: ");
+ TQString tit = i18n("Edit Account: ");
tit += gpppdata.accname();
tabWindow->setCaption(tit);
isnewaccount = false;
@@ -372,7 +372,7 @@ int AccountWidget::doTab(){
result = tabWindow->exec();
ok = true;
- if(result == QDialog::Accepted) {
+ if(result == TQDialog::Accepted) {
if (script_w->check()) {
if(dial_w->save()) {
ip_w->save();
@@ -400,10 +400,10 @@ int AccountWidget::doTab(){
}
-QString AccountWidget::prettyPrintVolume(unsigned int n) {
+TQString AccountWidget::prettyPrintVolume(unsigned int n) {
int idx = 0;
- const QString quant[] = {i18n("Byte"), i18n("KB"),
- i18n("MB"), i18n("GB"), QString::null};
+ const TQString quant[] = {i18n("Byte"), i18n("KB"),
+ i18n("MB"), i18n("GB"), TQString::null};
float n1 = n;
while(n >= 1024 && !quant[idx].isNull()) {
@@ -415,7 +415,7 @@ QString AccountWidget::prettyPrintVolume(unsigned int n) {
while(i--)
n1 = n1 / 1024.0;
- QString s = KGlobal::locale()->formatNumber( n1, idx==0 ? 0 : 1 );
+ TQString s = KGlobal::locale()->formatNumber( n1, idx==0 ? 0 : 1 );
s += " " + quant[idx];
return s;
}
@@ -426,25 +426,25 @@ QString AccountWidget::prettyPrintVolume(unsigned int n) {
// Queries the user what to reset: costs, volume or both
//
/////////////////////////////////////////////////////////////////////////////
-QueryReset::QueryReset(QWidget *parent) : QDialog(parent, 0, true) {
+QueryReset::QueryReset(TQWidget *parent) : TQDialog(parent, 0, true) {
KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon());
setCaption(i18n("Reset Accounting"));
- QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);
- QVGroupBox *f = new QVGroupBox(i18n("What to Reset"), this);
+ TQVBoxLayout *tl = new TQVBoxLayout(this, 10, 10);
+ TQVGroupBox *f = new TQVGroupBox(i18n("What to Reset"), this);
- QVBoxLayout *l1 = new QVBoxLayout(parent, 10, 10);
- costs = new QCheckBox(i18n("Reset the accumulated p&hone costs"), f);
+ TQVBoxLayout *l1 = new TQVBoxLayout(parent, 10, 10);
+ costs = new TQCheckBox(i18n("Reset the accumulated p&hone costs"), f);
costs->setChecked(true);
l1->addWidget(costs);
- QWhatsThis::add(costs, i18n("Check this to set the phone costs\n"
+ TQWhatsThis::add(costs, i18n("Check this to set the phone costs\n"
"to zero. Typically you will want to\n"
"do this once a month."));
- volume = new QCheckBox(i18n("Reset &volume accounting"), f);
+ volume = new TQCheckBox(i18n("Reset &volume accounting"), f);
volume->setChecked(true);
l1->addWidget(volume);
- QWhatsThis::add(volume, i18n("Check this to set the volume accounting\n"
+ TQWhatsThis::add(volume, i18n("Check this to set the volume accounting\n"
"to zero. Typically you will want to do this\n"
"once a month."));
@@ -457,14 +457,14 @@ QueryReset::QueryReset(QWidget *parent) : QDialog(parent, 0, true) {
KButtonBox *bbox = new KButtonBox(this);
bbox->addStretch(1);
- QPushButton *ok = bbox->addButton(KStdGuiItem::ok());
+ TQPushButton *ok = bbox->addButton(KStdGuiItem::ok());
ok->setDefault(true);
- QPushButton *cancel = bbox->addButton(KStdGuiItem::cancel());
+ TQPushButton *cancel = bbox->addButton(KStdGuiItem::cancel());
- connect(ok, SIGNAL(clicked()),
- this, SLOT(accepted()));
- connect(cancel, SIGNAL(clicked()),
- this, SLOT(reject()));
+ connect(ok, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(accepted()));
+ connect(cancel, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(reject()));
bbox->layout();
tl->addWidget(bbox);