summaryrefslogtreecommitdiffstats
path: root/kppp/acctselect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kppp/acctselect.cpp')
-rw-r--r--kppp/acctselect.cpp112
1 files changed, 56 insertions, 56 deletions
diff --git a/kppp/acctselect.cpp b/kppp/acctselect.cpp
index 7c22e030..56a28cb4 100644
--- a/kppp/acctselect.cpp
+++ b/kppp/acctselect.cpp
@@ -33,15 +33,15 @@
//---------------------------------------------------------------------------
-#include <qcombobox.h>
-#include <qlabel.h>
+#include <tqcombobox.h>
+#include <tqlabel.h>
#include <kurllabel.h>
-#include <qlayout.h>
-#include <qlistview.h>
-#include <qdir.h>
-#include <qregexp.h>
-#include <qwmatrix.h>
-#include <qcheckbox.h>
+#include <tqlayout.h>
+#include <tqlistview.h>
+#include <tqdir.h>
+#include <tqregexp.h>
+#include <tqwmatrix.h>
+#include <tqcheckbox.h>
#include <kdialog.h>
#include <kstandarddirs.h>
#include <klocale.h>
@@ -52,38 +52,38 @@
#include "pppdata.h"
-AccountingSelector::AccountingSelector(QWidget *parent, bool _isnewaccount, const char *name)
- : QWidget(parent, name),
+AccountingSelector::AccountingSelector(TQWidget *parent, bool _isnewaccount, const char *name)
+ : TQWidget(parent, name),
isnewaccount(_isnewaccount)
{
- QVBoxLayout *l1 = new QVBoxLayout(parent, 0, KDialog::spacingHint());
+ TQVBoxLayout *l1 = new TQVBoxLayout(parent, 0, KDialog::spacingHint());
- enable_accounting = new QCheckBox(i18n("&Enable accounting"), parent);
+ enable_accounting = new TQCheckBox(i18n("&Enable accounting"), parent);
l1->addWidget(enable_accounting, 1);
- connect(enable_accounting, SIGNAL(toggled(bool)), this, SLOT(enableItems(bool)));
+ connect(enable_accounting, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(enableItems(bool)));
// insert the tree widget
- tl = new QListView(parent, "treewidget");
+ tl = new TQListView(parent, "treewidget");
- connect(tl, SIGNAL(selectionChanged(QListViewItem*)), this,
- SLOT(slotSelectionChanged(QListViewItem*)));
+ connect(tl, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this,
+ TQT_SLOT(slotSelectionChanged(TQListViewItem*)));
tl->setMinimumSize(220, 200);
l1->addWidget(tl, 1);
KURLLabel *up = new KURLLabel(parent);
up->setText(i18n("Check for rule updates"));
up->setURL("http://developer.kde.org/~kppp/rules.html");
- connect(up, SIGNAL(leftClickedURL(const QString&)), SLOT(openURL(const QString&)));
+ connect(up, TQT_SIGNAL(leftClickedURL(const TQString&)), TQT_SLOT(openURL(const TQString&)));
l1->addWidget(up, 1);
// label to display the currently selected ruleset
- QHBoxLayout *l11 = new QHBoxLayout;
+ TQHBoxLayout *l11 = new QHBoxLayout;
l1->addSpacing(10);
l1->addLayout(l11);
- QLabel *lsel = new QLabel(i18n("Selected:"), parent);
- selected = new QLabel(parent);
- selected->setFrameStyle(QFrame::Sunken | QFrame::WinPanel);
+ TQLabel *lsel = new TQLabel(i18n("Selected:"), parent);
+ selected = new TQLabel(parent);
+ selected->setFrameStyle(TQFrame::Sunken | TQFrame::WinPanel);
selected->setLineWidth(1);
selected->setFixedHeight(selected->sizeHint().height() + 16);
l11->addWidget(lsel, 0);
@@ -92,10 +92,10 @@ AccountingSelector::AccountingSelector(QWidget *parent, bool _isnewaccount, cons
// volume accounting
l1->addStretch(1);
- QHBoxLayout *l12 = new QHBoxLayout;
+ TQHBoxLayout *l12 = new QHBoxLayout;
l1->addLayout(l12);
- QLabel *usevol_l = new QLabel(i18n("Volume accounting:"), parent);
- use_vol = new QComboBox(parent);
+ TQLabel *usevol_l = new TQLabel(i18n("Volume accounting:"), parent);
+ use_vol = new TQComboBox(parent);
use_vol->insertItem(i18n("No Accounting"), 0);
use_vol->insertItem(i18n("Bytes In"), 1);
use_vol->insertItem(i18n("Bytes Out"), 2);
@@ -109,7 +109,7 @@ AccountingSelector::AccountingSelector(QWidget *parent, bool _isnewaccount, cons
// scale the pixmap
if(pmfolder.width() > 0) {
- QWMatrix wm;
+ TQWMatrix wm;
wm.scale(16.0/pmfolder.width(), 16.0/pmfolder.width());
pmfolder = pmfolder.xForm(wm);
}
@@ -119,7 +119,7 @@ AccountingSelector::AccountingSelector(QWidget *parent, bool _isnewaccount, cons
// scale the pixmap
if(pmfile.width() > 0) {
- QWMatrix wm;
+ TQWMatrix wm;
wm.scale(16.0/pmfile.width(), 16.0/pmfile.width());
pmfile = pmfile.xForm(wm);
}
@@ -132,7 +132,7 @@ AccountingSelector::AccountingSelector(QWidget *parent, bool _isnewaccount, cons
}
-QString AccountingSelector::fileNameToName(QString s) {
+TQString AccountingSelector::fileNameToName(TQString s) {
s.replace('_', " ");
return KURL::decode_string(s);
@@ -140,16 +140,16 @@ QString AccountingSelector::fileNameToName(QString s) {
}
-QString AccountingSelector::nameToFileName(QString s) {
+TQString AccountingSelector::nameToFileName(TQString s) {
s.replace(' ', "_");
return s;
}
-QListViewItem *AccountingSelector::findByName(QString name)
+TQListViewItem *AccountingSelector::findByName(TQString name)
{
- QListViewItem *ch = tl->firstChild();
+ TQListViewItem *ch = tl->firstChild();
while(ch) {
if(ch->text(0) == name)
return ch;
@@ -159,9 +159,9 @@ QListViewItem *AccountingSelector::findByName(QString name)
}
-void AccountingSelector::insertDir(QDir d, QListViewItem *root) {
+void AccountingSelector::insertDir(TQDir d, TQListViewItem *root) {
- QListViewItem* tli = 0;
+ TQListViewItem* tli = 0;
// sanity check
if(!d.exists() || !d.isReadable())
@@ -170,45 +170,45 @@ void AccountingSelector::insertDir(QDir d, QListViewItem *root) {
// set up filter
d.setNameFilter("*.rst");
- d.setFilter(QDir::Files);
- d.setSorting(QDir::Name);
+ 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
while((fi = it.current())) {
++it;
- QString samename = fi->fileName();
+ TQString samename = fi->fileName();
- QListViewItem *i = findByName(samename);
+ TQListViewItem *i = findByName(samename);
// skip this file if already in tree
if(i)
continue;
// check if this is the file we should mark
- QString name = fileNameToName(fi->baseName(true));
+ TQString name = fileNameToName(fi->baseName(true));
if(root)
- tli = new QListViewItem(root, name);
+ tli = new TQListViewItem(root, name);
else
- tli = new QListViewItem(tl, name);
+ tli = new TQListViewItem(tl, name);
tli->setPixmap(0, pmfile);
// check if this is the item we are searching for
// (only in "Edit"-mode, not in "New"-mode
if(!isnewaccount && !edit_s.isEmpty() &&
- (edit_s == QString(fi->filePath()).right(edit_s.length()))) {
+ (edit_s == TQString(fi->filePath()).right(edit_s.length()))) {
edit_item = tli;
}
}
// set up a filter for the directories
- d.setFilter(QDir::Dirs);
+ d.setFilter(TQDir::Dirs);
d.setNameFilter("*");
const QFileInfoList *dlist = d.entryInfoList();
QFileInfoListIterator dit(*dlist);
@@ -217,25 +217,25 @@ void AccountingSelector::insertDir(QDir d, QListViewItem *root) {
// skip "." and ".." directories
if(fi->fileName().left(1) != ".") {
// convert to human-readable name
- QString name = fileNameToName(fi->fileName());
+ TQString name = fileNameToName(fi->fileName());
// if the tree already has an item with this name,
// skip creation and use this one, otherwise
// create a new entry
- QListViewItem *i = findByName(name);
+ TQListViewItem *i = findByName(name);
if(!i) {
- QListViewItem* item;
+ TQListViewItem* item;
if(root)
- item = new QListViewItem(root, name);
+ item = new TQListViewItem(root, name);
else
- item = new QListViewItem(tl, name);
+ item = new TQListViewItem(tl, name);
item->setPixmap(0, pmfolder);
- insertDir(QDir(fi->filePath()), item);
+ insertDir(TQDir(fi->filePath()), item);
} else
- insertDir(QDir(fi->filePath()), i);
+ insertDir(TQDir(fi->filePath()), i);
}
++dit;
}
@@ -256,10 +256,10 @@ void AccountingSelector::setupTreeWidget() {
tl->setRootIsDecorated(true);
// look in ~/.kde/share/apps/kppp/Rules and $KDEDIR/share/apps/kppp/Rules
- QStringList dirs = KGlobal::dirs()->resourceDirs("appdata");
- for (QStringList::ConstIterator it = dirs.begin();
+ TQStringList dirs = KGlobal::dirs()->resourceDirs("appdata");
+ for (TQStringList::ConstIterator it = dirs.begin();
it != dirs.end(); it++) {
- insertDir(QDir((*it) + "Rules"), 0);
+ insertDir(TQDir((*it) + "Rules"), 0);
}
// when mode is "Edit", then hightlight the
@@ -281,8 +281,8 @@ void AccountingSelector::enableItems(bool enabled) {
if(!enabled || (!tl->currentItem()))
selected->setText(i18n("(none)"));
else {
- QListViewItem* i = tl->currentItem();
- QString s;
+ TQListViewItem* i = tl->currentItem();
+ TQString s;
while(i) {
s = "/" + i->text(0) + s;
i = i->parent();
@@ -295,7 +295,7 @@ void AccountingSelector::enableItems(bool enabled) {
}
-void AccountingSelector::slotSelectionChanged(QListViewItem* i) {
+void AccountingSelector::slotSelectionChanged(TQListViewItem* i) {
if(!i || i->childCount())
return;
@@ -322,7 +322,7 @@ bool AccountingSelector::save() {
return true;
}
-void AccountingSelector::openURL(const QString &url) {
+void AccountingSelector::openURL(const TQString &url) {
new KRun( KURL( url ) );
}