diff options
Diffstat (limited to 'kppp/logview')
-rw-r--r-- | kppp/logview/export.cpp | 14 | ||||
-rw-r--r-- | kppp/logview/export.h | 3 | ||||
-rw-r--r-- | kppp/logview/log.cpp | 10 | ||||
-rw-r--r-- | kppp/logview/log.h | 6 | ||||
-rw-r--r-- | kppp/logview/main.cpp | 4 | ||||
-rw-r--r-- | kppp/logview/main.h | 1 | ||||
-rw-r--r-- | kppp/logview/monthly.cpp | 118 | ||||
-rw-r--r-- | kppp/logview/monthly.h | 5 |
8 files changed, 82 insertions, 79 deletions
diff --git a/kppp/logview/export.cpp b/kppp/logview/export.cpp index 14c614c4..e741405d 100644 --- a/kppp/logview/export.cpp +++ b/kppp/logview/export.cpp @@ -47,8 +47,8 @@ ExportFormats [] = { /***** ExportWizard *****/ -ExportWizard::ExportWizard(TQWidget *parent, const TQString &_date) - : KWizard(parent, "", true) { +ExportWizard::ExportWizard(TQWidget *tqparent, const TQString &_date) + : KWizard(tqparent, "", true) { date = _date; filterID = 0; @@ -73,7 +73,7 @@ ExportWizard::ExportWizard(TQWidget *parent, const TQString &_date) formatLayout->addSpacing(10); typeInfo = new TQLabel(formatPage); - typeInfo->setAlignment(Qt::AlignTop | Qt::WordBreak); + typeInfo->tqsetAlignment(TQt::AlignTop | TQt::WordBreak); typeInfo->setText(i18n("<qt><b>Please choose the output format on the left side.</b></qt>")); typeInfo->setMinimumSize(350, 200); formatLayout->addWidget(typeInfo); @@ -144,7 +144,7 @@ void ExportWizard::getFilename() { void ExportWizard::reject() { hide(); - filename = TQString::null; + filename = TQString(); } void ExportWizard::accept() { @@ -219,12 +219,12 @@ void CSVExport::setFinishCode() { /***** HTMLExport *****/ HTMLExport::HTMLExport(const TQString &filename, const TQString &date) : Export(filename) { - TQString title = i18n("Connection log for %1").arg(date); + TQString title = i18n("Connection log for %1").tqarg(date); buffer = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"; buffer.append("<html>\n<head>\n <title>"+title+"</title>\n"); - buffer.append(TQString::fromLatin1(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=") + buffer.append(TQString::tqfromLatin1(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=") + TQTextCodec::codecForLocale()->mimeName() + - TQString::fromLatin1("\">")); + TQString::tqfromLatin1("\">")); buffer.append("\n</head>\n<body>\n<h1>"+title+"</h1>\n\n"); buffer.append("<table width=\"100%\" border=\"1\">\n"); diff --git a/kppp/logview/export.h b/kppp/logview/export.h index 3c601e96..d99748aa 100644 --- a/kppp/logview/export.h +++ b/kppp/logview/export.h @@ -40,8 +40,9 @@ class Export; /***** ExportWizard *****/ class ExportWizard : public KWizard { Q_OBJECT + TQ_OBJECT public: - ExportWizard(TQWidget *parent, const TQString &_date); + ExportWizard(TQWidget *tqparent, const TQString &_date); Export *createExportFilter(); int filterID; diff --git a/kppp/logview/log.cpp b/kppp/logview/log.cpp index 93be0098..53508bdc 100644 --- a/kppp/logview/log.cpp +++ b/kppp/logview/log.cpp @@ -43,8 +43,8 @@ int loadLogs() { kdDebug(5002) << "logdirname: " << logdirname << endl; // get log file size - const QFileInfoList *list = logdir.entryInfoList(); - QFileInfoListIterator it( *list ); + const TQFileInfoList *list = logdir.entryInfoList(); + TQFileInfoListIterator it( *list ); TQFileInfo *fi; while ((fi = it.current()) != 0) { @@ -53,13 +53,13 @@ int loadLogs() { } dlg = new TQProgressDialog(i18n("Loading log files"), - TQString::null, + TQString(), logsize); dlg->setProgress(0); // load logs list = logdir.entryInfoList(); - QFileInfoListIterator it1( *list ); + TQFileInfoListIterator it1( *list ); int retval = 0; while ((fi = it1.current()) != 0) { @@ -116,7 +116,7 @@ int loadLog(TQString fname) { return 0; } -int QLogList::compareItems(Item a, Item b) { +int TQLogList::compareItems(Item a, Item b) { LogInfo *la = (LogInfo *)a; LogInfo *lb = (LogInfo *)b; diff --git a/kppp/logview/log.h b/kppp/logview/log.h index d8fa15cd..75dd86e3 100644 --- a/kppp/logview/log.h +++ b/kppp/logview/log.h @@ -24,10 +24,10 @@ #include "loginfo.h" #include <tqptrlist.h> -typedef TQPtrList<LogInfo> QLogInfoBase; -typedef TQPtrListIterator<LogInfo> QLogInfoIterator; +typedef TQPtrList<LogInfo> TQLogInfoBase; +typedef TQPtrListIterator<LogInfo> TQLogInfoIterator; -class QLogList : public QLogInfoBase { +class TQLogList : public TQLogInfoBase { public: virtual int compareItems(Item, Item); }; diff --git a/kppp/logview/main.cpp b/kppp/logview/main.cpp index f034c462..6f87ae21 100644 --- a/kppp/logview/main.cpp +++ b/kppp/logview/main.cpp @@ -86,8 +86,8 @@ TopWidget::TopWidget() : KMainWindow(0, "") { kapp, TQT_SLOT(quit())); } - setMinimumSize(mw->sizeHint().width() + 15, - mw->sizeHint().height() + 120); + setMinimumSize(mw->tqsizeHint().width() + 15, + mw->tqsizeHint().height() + 120); setCentralWidget(w); } diff --git a/kppp/logview/main.h b/kppp/logview/main.h index db7ca8da..deafd41e 100644 --- a/kppp/logview/main.h +++ b/kppp/logview/main.h @@ -28,6 +28,7 @@ class TopWidget : public KMainWindow { Q_OBJECT + TQ_OBJECT public: TopWidget(); ~TopWidget(); diff --git a/kppp/logview/monthly.cpp b/kppp/logview/monthly.cpp index 904f2800..8d949db1 100644 --- a/kppp/logview/monthly.cpp +++ b/kppp/logview/monthly.cpp @@ -38,67 +38,67 @@ static void formatBytes(double bytes, TQString &result) { if(bytes < 1024) result.setNum(bytes); else if(bytes < 1024*1024) - result = i18n("%1 KB").arg(KGlobal::locale()->formatNumber((float)bytes / 1024.0, 1)); + result = i18n("%1 KB").tqarg(KGlobal::locale()->formatNumber((float)bytes / 1024.0, 1)); else - result = i18n("%1 MB").arg(KGlobal::locale()->formatNumber((float)bytes / 1024.0 / 1024.0, 1)); + result = i18n("%1 MB").tqarg(KGlobal::locale()->formatNumber((float)bytes / 1024.0 / 1024.0, 1)); } static void formatBytesMonth(double bytes, TQString &result) { int day, days; - day = TQDate::currentDate().day(); - days = TQDate::currentDate().daysInMonth(); + day = TQDate::tqcurrentDate().day(); + days = TQDate::tqcurrentDate().daysInMonth(); bytes = (bytes / day) * days; if(bytes < 1024) result.setNum(bytes); else if(bytes < 1024*1024) - result = i18n("%1 KB").arg(KGlobal::locale()->formatNumber((float)bytes / 1024.0, 1)); + result = i18n("%1 KB").tqarg(KGlobal::locale()->formatNumber((float)bytes / 1024.0, 1)); else - result = i18n("%1 MB").arg(KGlobal::locale()->formatNumber((float)bytes / 1024.0 / 1024.0, 1)); + result = i18n("%1 MB").tqarg(KGlobal::locale()->formatNumber((float)bytes / 1024.0 / 1024.0, 1)); } static void formatDuration(int seconds, TQString &result) { TQString sec; sec.sprintf("%02d", seconds%60); if(seconds < 60) - result = i18n("%1s").arg(sec); + result = i18n("%1s").tqarg(sec); else if(seconds < 3600) - result = i18n("%1m %2s").arg(seconds/60).arg(sec); + result = i18n("%1m %2s").tqarg(seconds/60).tqarg(sec); else result = i18n("%1h %2m %3s") - .arg(seconds/3600) - .arg((seconds % 3600)/60) - .arg(sec); + .tqarg(seconds/3600) + .tqarg((seconds % 3600)/60) + .tqarg(sec); } static void formatDurationMonth(int seconds, TQString &result) { int day, days; - day = TQDate::currentDate().day(); - days = TQDate::currentDate().daysInMonth(); + day = TQDate::tqcurrentDate().day(); + days = TQDate::tqcurrentDate().daysInMonth(); seconds = (seconds / day) * days; TQString sec; sec.sprintf("%02d", seconds%60); if(seconds < 60) - result = i18n("%1s").arg(sec); + result = i18n("%1s").tqarg(sec); else if(seconds < 3600) - result = i18n("%1m %2s").arg(seconds/60).arg(sec); + result = i18n("%1m %2s").tqarg(seconds/60).tqarg(sec); else result = i18n("%1h %2m %3s") - .arg(seconds/3600) - .arg((seconds % 3600)/60) - .arg(sec); + .tqarg(seconds/3600) + .tqarg((seconds % 3600)/60) + .tqarg(sec); } static void costsMonth(double costs, double &result) { int day, days; - day = TQDate::currentDate().day(); - days = TQDate::currentDate().daysInMonth(); + day = TQDate::tqcurrentDate().day(); + days = TQDate::tqcurrentDate().daysInMonth(); result = (costs / day) * days; @@ -107,17 +107,17 @@ static void costsMonth(double costs, double &result) { class LogListItem : public TQListViewItem { public: LogListItem(LogInfo *l, - TQListView * parent, + TQListView * tqparent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5, TQString s6, TQString s7, TQString s8) - : TQListViewItem(parent, s1, s2, s3, s4, s5, s6, s7, s8), + : TQListViewItem(tqparent, s1, s2, s3, s4, s5, s6, s7, s8), li(l) { } virtual void paintCell( TQPainter *p, const TQColorGroup & cg, - int column, int width, int alignment ); + int column, int width, int tqalignment ); virtual TQString key(int, bool) const; @@ -125,9 +125,9 @@ public: }; void LogListItem::paintCell( TQPainter *p, const TQColorGroup & cg, - int column, int width, int alignment ) + int column, int width, int tqalignment ) { - TQListViewItem::paintCell(p, cg, column, width, alignment); + TQListViewItem::paintCell(p, cg, column, width, tqalignment); // double line above sum //if(!li) { @@ -167,8 +167,8 @@ TQString LogListItem::key(int c, bool ascending) const return k; } -MonthlyWidget::MonthlyWidget(TQWidget *parent) : - TQWidget(parent) +MonthlyWidget::MonthlyWidget(TQWidget *tqparent) : + TQWidget(tqparent) { tl = 0; @@ -212,7 +212,7 @@ MonthlyWidget::MonthlyWidget(TQWidget *parent) : lv2->setSorting(-1); lv2->setItemMargin(2); lv2->setMaximumHeight(100); - lv2->setSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Minimum); + lv2->tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Minimum); lv2->setSelectionMode(TQListView::NoSelection); title = new TQLabel("X", this); @@ -220,7 +220,7 @@ MonthlyWidget::MonthlyWidget(TQWidget *parent) : f.setPointSize(f.pointSize() + 2); f.setBold(TRUE); title->setFont(f); - title->setFixedHeight(title->sizeHint().height()*2); + title->setFixedHeight(title->tqsizeHint().height()*2); cboConnections = new TQComboBox(false, this); // add a combo box to select connections cboConnections->setMaximumWidth(200); // a resonable size @@ -246,13 +246,13 @@ MonthlyWidget::MonthlyWidget(TQWidget *parent) : this, TQT_SLOT(exportWizard())); bbox->addStretch(8); - bbox->layout(); + bbox->tqlayout(); currentMonth(); - layoutWidget(); + tqlayoutWidget(); } -void MonthlyWidget::layoutWidget() { +void MonthlyWidget::tqlayoutWidget() { if(tl) delete tl; @@ -265,8 +265,8 @@ void MonthlyWidget::layoutWidget() { f2.setPointSize(f2.pointSize() + 1); f2.setBold(TRUE); l->setFont(f2); - l->setFixedHeight(l->sizeHint().height()); - l->setAlignment( AlignLeft ); + l->setFixedHeight(l->tqsizeHint().height()); + l->tqsetAlignment( AlignLeft ); tl->addWidget(l, 5, 0); tl->addWidget(bbox, 1, 2); tl->addMultiCellWidget(lv, 1, 4, 0, 1); @@ -304,7 +304,7 @@ void MonthlyWidget::plotMonth() { con = li->connectionName(); // this connection name not in the list and combo box - if(lstConnections.findIndex(con) == -1) { + if(lstConnections.tqfindIndex(con) == -1) { lstConnections.append(con); cboConnections->insertItem(con); } @@ -384,19 +384,19 @@ void MonthlyWidget::plotMonth() { formatDuration(duration, s_duration); - TQString s_costs(KGlobal::locale()->formatMoney(costs, TQString::null, 2)); + TQString s_costs(KGlobal::locale()->formatMoney(costs, TQString(), 2)); selectionItem = new LogListItem(0, lv2, i18n("Selection (%n connection)", "Selection (%n connections)", 0), - TQString::null, TQString::null, TQString::null, - TQString::null, TQString::null, TQString::null, TQString::null); + TQString(), TQString(), TQString(), + TQString(), TQString(), TQString(), TQString()); (void) new LogListItem(0, lv2, i18n("%n connection", "%n connections", count), - s_duration, s_costs, _bin, _bout, TQString::null, TQString::null, TQString::null); + s_duration, s_costs, _bin, _bout, TQString(), TQString(), TQString()); const KCalendarSystem * calendar = KGlobal::locale()->calendar(); - if(calendar->month(periodeFirst()) == calendar->month(TQDate::currentDate())) { + if(calendar->month(periodeFirst()) == calendar->month(TQDate::tqcurrentDate())) { TQString m_bin, m_bout; @@ -414,11 +414,11 @@ void MonthlyWidget::plotMonth() { formatDurationMonth(duration, m_duration); costsMonth(costs, costs); - TQString m_costs(KGlobal::locale()->formatMoney(costs, TQString::null, 2)); + TQString m_costs(KGlobal::locale()->formatMoney(costs, TQString(), 2)); (void) new TQListViewItem(lv2, selectionItem, i18n("Monthly estimates"), m_duration, m_costs, m_bin, m_bout, - TQString::null, TQString::null, TQString::null); + TQString(), TQString(), TQString()); } } @@ -426,13 +426,13 @@ void MonthlyWidget::plotMonth() { if(lv->childCount() > 0) { exportBttn->setEnabled(true); // export possibility t = i18n("Connection log for %1 %2") - .arg(calendar->monthName(startDate)) - .arg(calendar->year(startDate)); + .tqarg(calendar->monthName(startDate)) + .tqarg(calendar->year(startDate)); } else { exportBttn->setEnabled(false); // nothing to export t = i18n("No connection log for %1 %2 available") - .arg(calendar->monthName(startDate)) - .arg(calendar->year(startDate)); + .tqarg(calendar->monthName(startDate)) + .tqarg(calendar->year(startDate)); } title->setText(t); @@ -456,7 +456,7 @@ void MonthlyWidget::prevMonth() { void MonthlyWidget::currentMonth() { const KCalendarSystem * calendar = KGlobal::locale()->calendar(); - TQDate dt = TQDate::currentDate(); + TQDate dt = TQDate::tqcurrentDate(); calendar->setYMD(m_periodeFirst, calendar->year(dt), calendar->month(dt), 1); plotMonth(); @@ -464,9 +464,9 @@ void MonthlyWidget::currentMonth() { void MonthlyWidget::exportWizard() { const KCalendarSystem * calendar = KGlobal::locale()->calendar(); - TQString date = TQString::fromLatin1("%1-%2") // e.g.: June-2001 - .arg(calendar->monthName(periodeFirst())) - .arg(calendar->year(periodeFirst())); + TQString date = TQString::tqfromLatin1("%1-%2") // e.g.: June-2001 + .tqarg(calendar->monthName(periodeFirst())) + .tqarg(calendar->year(periodeFirst())); ExportWizard *wizard = new ExportWizard(0, date); wizard->exec(); @@ -513,7 +513,7 @@ void MonthlyWidget::exportWizard() { con = li->connectionName(); // this connection name not in the list and combo box - if(lstConnections.findIndex(con) == -1) { + if(lstConnections.tqfindIndex(con) == -1) { lstConnections.append(con); cboConnections->insertItem(con); } @@ -576,7 +576,7 @@ void MonthlyWidget::exportWizard() { } } - if(calendar->month(periodeFirst()) == calendar->month(TQDate::currentDate())) { + if(calendar->month(periodeFirst()) == calendar->month(TQDate::tqcurrentDate())) { TQString m_bin, m_bout; if(bin < 0) @@ -593,13 +593,13 @@ void MonthlyWidget::exportWizard() { formatDurationMonth(duration, m_duration); costsMonth(costs, costs); - TQString m_costs(KGlobal::locale()->formatMoney(costs, TQString::null, 2)); + TQString m_costs(KGlobal::locale()->formatMoney(costs, TQString(), 2)); - TQString datetime = KGlobal::locale()->formatDateTime( TQDateTime::currentDateTime(), true); + TQString datetime = KGlobal::locale()->formatDateTime( TQDateTime::tqcurrentDateTime(), true); exportIFace->addEmptyLine(); - exportIFace->addDataline(i18n("Monthly estimates (%1)").arg(datetime), - TQString::null, TQString::null, TQString::null, m_duration, m_costs, m_bin, m_bout); + exportIFace->addDataline(i18n("Monthly estimates (%1)").tqarg(datetime), + TQString(), TQString(), TQString(), m_duration, m_costs, m_bin, m_bout); } if(count) { @@ -624,11 +624,11 @@ void MonthlyWidget::exportWizard() { formatDuration(duration, s_duration); - TQString s_costs(KGlobal::locale()->formatMoney(costs, TQString::null, 2)); + TQString s_costs(KGlobal::locale()->formatMoney(costs, TQString(), 2)); // call export methods exportIFace->addEmptyLine(); - exportIFace->addDataline(i18n("%n connection", "%n connections", count), TQString::null, TQString::null, TQString::null, s_duration, + exportIFace->addDataline(i18n("%n connection", "%n connections", count), TQString(), TQString(), TQString(), s_duration, s_costs, _bin, _bout); exportIFace->setFinishCode(); @@ -716,7 +716,7 @@ void MonthlyWidget::slotSelectionChanged() formatDuration(duration, s_duration); - TQString s_costs(KGlobal::locale()->formatMoney(costs, TQString::null, 2)); + TQString s_costs(KGlobal::locale()->formatMoney(costs, TQString(), 2)); selectionItem->setText(0, i18n("Selection (%n connection)", "Selection (%n connections)", count)); selectionItem->setText(1, s_duration); selectionItem->setText(2, s_costs); diff --git a/kppp/logview/monthly.h b/kppp/logview/monthly.h index e7c90b26..9f9fd24a 100644 --- a/kppp/logview/monthly.h +++ b/kppp/logview/monthly.h @@ -38,8 +38,9 @@ class LogListItem; class MonthlyWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - MonthlyWidget(TQWidget *parent = 0); + MonthlyWidget(TQWidget *tqparent = 0); private slots: void prevMonth(); @@ -50,7 +51,7 @@ private slots: void slotSelectionChanged(); private: - void layoutWidget(); + void tqlayoutWidget(); void plotMonth(); /** |