From 1c1403293485f35fd53db45aaa77a01cdd9627e7 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 28 Jun 2011 20:34:15 +0000 Subject: TQt4 port ktorrent This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktorrent@1238733 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- plugins/scheduler/bwscheduler.cpp | 34 +++--- plugins/scheduler/bwspage.ui | 154 +++++++++++++------------- plugins/scheduler/bwsprefpagewidget.cpp | 104 ++++++++--------- plugins/scheduler/bwsprefpagewidget.h | 9 +- plugins/scheduler/bwswidget.cpp | 110 +++++++++--------- plugins/scheduler/bwswidget.h | 35 +++--- plugins/scheduler/schedulerpage.ui | 24 ++-- plugins/scheduler/schedulerplugin.cpp | 40 +++---- plugins/scheduler/schedulerplugin.h | 11 +- plugins/scheduler/schedulerprefpage.cpp | 4 +- plugins/scheduler/schedulerprefpage.h | 2 +- plugins/scheduler/schedulerprefpagewidget.cpp | 16 +-- plugins/scheduler/schedulerprefpagewidget.h | 5 +- 13 files changed, 276 insertions(+), 272 deletions(-) (limited to 'plugins/scheduler') diff --git a/plugins/scheduler/bwscheduler.cpp b/plugins/scheduler/bwscheduler.cpp index 56375b5..a669360 100644 --- a/plugins/scheduler/bwscheduler.cpp +++ b/plugins/scheduler/bwscheduler.cpp @@ -31,9 +31,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -160,9 +160,9 @@ namespace kt if(!m_enabled) return; - QDateTime now = QDateTime::currentDateTime(); + TQDateTime now = TQDateTime::tqcurrentDateTime(); - QString prefix = QString("BWS: %1 :: ").arg(now.toString()); + TQString prefix = TQString("BWS: %1 :: ").tqarg(now.toString()); int t1 = now.date().dayOfWeek(); int t2 = now.time().hour(); @@ -172,8 +172,8 @@ namespace kt { case CAT_NORMAL: Out(SYS_SCD|LOG_NOTICE) << prefix << "Switching to NORMAL category" << endl; - Out(SYS_SCD|LOG_NOTICE) << prefix << QString("%1 Up, %2 Down") - .arg(m_core->getMaxUploadSpeed()).arg(m_core->getMaxDownloadSpeed()) << endl; + Out(SYS_SCD|LOG_NOTICE) << prefix << TQString("%1 Up, %2 Down") + .tqarg(m_core->getMaxUploadSpeed()).tqarg(m_core->getMaxDownloadSpeed()) << endl; if(!m_core) break; m_core->setPausedState(false); @@ -182,8 +182,8 @@ namespace kt break; case CAT_FIRST: Out(SYS_SCD|LOG_NOTICE) << prefix << "Switching to FIRST category" << endl; - Out(SYS_SCD|LOG_NOTICE) << prefix << QString("%1 Up, %2 Down") - .arg(m_schedule.getUpload(0)).arg(m_schedule.getDownload(0)) << endl; + Out(SYS_SCD|LOG_NOTICE) << prefix << TQString("%1 Up, %2 Down") + .tqarg(m_schedule.getUpload(0)).tqarg(m_schedule.getDownload(0)) << endl; if(!m_core) break; m_core->setPausedState(false); @@ -192,8 +192,8 @@ namespace kt break; case CAT_SECOND: Out(SYS_SCD|LOG_NOTICE) << prefix << "Switching to SECOND category" << endl; - Out(SYS_SCD|LOG_NOTICE) << prefix << QString("%1 Up, %2 Down") - .arg(m_schedule.getUpload(1)).arg(m_schedule.getDownload(1)) << endl; + Out(SYS_SCD|LOG_NOTICE) << prefix << TQString("%1 Up, %2 Down") + .tqarg(m_schedule.getUpload(1)).tqarg(m_schedule.getDownload(1)) << endl; if(!m_core) break; m_core->setPausedState(false); @@ -202,8 +202,8 @@ namespace kt break; case CAT_THIRD: Out(SYS_SCD|LOG_NOTICE) << prefix << "Switching to THIRD category" << endl; - Out(SYS_SCD|LOG_NOTICE) << prefix << QString("%1 Up, %2 Down") - .arg(m_schedule.getUpload(2)).arg(m_schedule.getDownload(2)) << endl; + Out(SYS_SCD|LOG_NOTICE) << prefix << TQString("%1 Up, %2 Down") + .tqarg(m_schedule.getUpload(2)).tqarg(m_schedule.getDownload(2)) << endl; if(!m_core) break; m_core->setPausedState(false); @@ -222,13 +222,13 @@ namespace kt void BWScheduler::loadSchedule() { - QFile file(KGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule"); + TQFile file(KGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule"); if(!file.exists()) return; file.open(IO_ReadOnly); - QDataStream stream(&file); + TQDataStream stream(&file); int tmp; @@ -256,10 +256,10 @@ namespace kt void BWScheduler::saveSchedule() { - QFile file(KGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule"); + TQFile file(KGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule"); file.open(IO_WriteOnly); - QDataStream stream(&file); + TQDataStream stream(&file); for(int i=0; i<3; ++i) { diff --git a/plugins/scheduler/bwspage.ui b/plugins/scheduler/bwspage.ui index af0e771..c4fb9db 100644 --- a/plugins/scheduler/bwspage.ui +++ b/plugins/scheduler/bwspage.ui @@ -1,6 +1,6 @@ BWSPage - + BWSPage @@ -12,13 +12,13 @@ 530 - + 0 0 - + 750 540 @@ -34,15 +34,15 @@ Fixed - + - layout21 + tqlayout21 unnamed - + buttonGroup1 @@ -53,7 +53,7 @@ unnamed - + radio2 @@ -61,7 +61,7 @@ Categor&y 1 - + pix1 @@ -73,7 +73,7 @@ 0 - + 30 15 @@ -83,7 +83,7 @@ true - + pix2 @@ -95,7 +95,7 @@ 0 - + 30 15 @@ -105,7 +105,7 @@ true - + pix3 @@ -117,7 +117,7 @@ 0 - + 30 15 @@ -127,7 +127,7 @@ true - + pix5 @@ -139,7 +139,7 @@ 0 - + 30 15 @@ -149,7 +149,7 @@ true - + radio5 @@ -157,7 +157,7 @@ T&urn off - + radio1 @@ -165,7 +165,7 @@ &Normal - + pix4 @@ -177,7 +177,7 @@ 0 - + 30 15 @@ -187,7 +187,7 @@ true - + radio4 @@ -198,7 +198,7 @@ Alt+3 - + radio3 @@ -211,7 +211,7 @@ - + buttonGroup1_2 @@ -222,7 +222,7 @@ unnamed - + radio22 @@ -233,7 +233,7 @@ Alt+1 - + pix12 @@ -245,7 +245,7 @@ 0 - + 30 15 @@ -255,7 +255,7 @@ true - + pix22 @@ -267,7 +267,7 @@ 0 - + 30 15 @@ -277,7 +277,7 @@ true - + pix32 @@ -289,7 +289,7 @@ 0 - + 30 15 @@ -299,7 +299,7 @@ true - + pix52 @@ -311,7 +311,7 @@ 0 - + 30 15 @@ -321,7 +321,7 @@ true - + radio52 @@ -329,7 +329,7 @@ T&urn off - + radio12 @@ -337,7 +337,7 @@ &Normal - + pix42 @@ -349,7 +349,7 @@ 0 - + 30 15 @@ -359,7 +359,7 @@ true - + radio42 @@ -367,7 +367,7 @@ &Category 3 - + radio32 @@ -382,7 +382,7 @@ - + groupCategories_2 @@ -393,7 +393,7 @@ unnamed - + textLabel8_4 @@ -401,7 +401,7 @@ <b>1. Category</b> - + textLabel8_3_2 @@ -409,15 +409,15 @@ <b>3. Category</b> - + - layout8 + tqlayout8 unnamed - + textLabel6_5 @@ -433,7 +433,7 @@ 30000 - + textLabel6_4_4 @@ -449,7 +449,7 @@ 30000 - + textLabel9_4 @@ -459,15 +459,15 @@ - + - layout9 + tqlayout9 unnamed - + textLabel6_2_2 @@ -483,7 +483,7 @@ 30000 - + textLabel6_4_2_2 @@ -499,7 +499,7 @@ 30000 - + textLabel9_2_2 @@ -509,15 +509,15 @@ - + - layout10 + tqlayout10 unnamed - + textLabel6_3_2 @@ -533,7 +533,7 @@ 30000 - + textLabel6_4_3_2 @@ -549,7 +549,7 @@ 30000 - + textLabel9_3_2 @@ -559,7 +559,7 @@ - + textLabel8_2_2 @@ -581,36 +581,36 @@ 0 - + 379 510 - + 379 508 - + - layout34 + tqlayout34 unnamed - + - lblStatus + lbltqStatus - + textLabel10 @@ -625,7 +625,7 @@ * zero means no limit - + AlignVCenter|AlignRight @@ -641,24 +641,24 @@ Expanding - + 20 16 - + - layout32 + tqlayout32 unnamed - + - layout31 + tqlayout31 @@ -700,14 +700,14 @@ Expanding - + 36 20 - + pix_icon @@ -728,16 +728,16 @@ Expanding - + 35 20 - + - layout29 + tqlayout29 @@ -850,15 +850,15 @@ dlCat3 ulCat3 - + btnOk_clicked() btnApply_clicked() btnCancel_clicked() btnSave_clicked() btnLoad_clicked() btnReset_clicked() - - + + knuminput.h knuminput.h diff --git a/plugins/scheduler/bwsprefpagewidget.cpp b/plugins/scheduler/bwsprefpagewidget.cpp index 0c44a43..96e0613 100644 --- a/plugins/scheduler/bwsprefpagewidget.cpp +++ b/plugins/scheduler/bwsprefpagewidget.cpp @@ -33,25 +33,25 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace kt { /* PREF PAGE WIDGET --------------------------------------------------------*/ - BWSPrefPageWidget::BWSPrefPageWidget(QWidget* parent, const char* name, WFlags fl) - : BWSPage(parent,name,fl) + BWSPrefPageWidget::BWSPrefPageWidget(TQWidget* tqparent, const char* name, WFlags fl) + : BWSPage(tqparent,name,fl) { loadDefault(); - lblStatus->clear(); + lbltqStatus->clear(); pix_icon->setPixmap(KGlobal::iconLoader()->loadIcon("clock",KIcon::NoGroup)); @@ -67,42 +67,42 @@ namespace kt if(use_colors) //set up colors { - pix1->setPaletteBackgroundColor(QColor(30,165,105)); - pix2->setPaletteBackgroundColor(QColor(195,195,70)); - pix3->setPaletteBackgroundColor(QColor(195,195,70)); - pix4->setPaletteBackgroundColor(QColor(195,195,70)); - pix5->setPaletteBackgroundColor(QColor(190,30,30)); + pix1->setPaletteBackgroundColor(TQColor(30,165,105)); + pix2->setPaletteBackgroundColor(TQColor(195,195,70)); + pix3->setPaletteBackgroundColor(TQColor(195,195,70)); + pix4->setPaletteBackgroundColor(TQColor(195,195,70)); + pix5->setPaletteBackgroundColor(TQColor(190,30,30)); - pix12->setPaletteBackgroundColor(QColor(30,165,105)); - pix22->setPaletteBackgroundColor(QColor(195,195,70)); - pix32->setPaletteBackgroundColor(QColor(195,195,70)); - pix42->setPaletteBackgroundColor(QColor(195,195,70)); - pix52->setPaletteBackgroundColor(QColor(190,30,30)); + pix12->setPaletteBackgroundColor(TQColor(30,165,105)); + pix22->setPaletteBackgroundColor(TQColor(195,195,70)); + pix32->setPaletteBackgroundColor(TQColor(195,195,70)); + pix42->setPaletteBackgroundColor(TQColor(195,195,70)); + pix52->setPaletteBackgroundColor(TQColor(190,30,30)); } else //set up pixmaps { - pix1->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0000.png")))); - pix2->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0001.png")))); - pix3->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0002.png")))); - pix4->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0003.png")))); - pix5->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0004.png")))); - - pix12->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0000.png")))); - pix22->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0001.png")))); - pix32->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0002.png")))); - pix42->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0003.png")))); - pix52->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0004.png")))); + pix1->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0000.png")))); + pix2->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0001.png")))); + pix3->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0002.png")))); + pix4->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0003.png")))); + pix5->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0004.png")))); + + pix12->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0000.png")))); + pix22->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0001.png")))); + pix32->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0002.png")))); + pix42->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0003.png")))); + pix52->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0004.png")))); } - connect(radio1, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio2, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio3, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio4, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio5, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio12, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio22, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio32, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio42, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio52, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); + connect(radio1, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio2, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio3, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio4, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio5, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio12, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio22, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio32, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio42, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio52, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); //pre-check default categories (say 1 for left and 0 for right) radio2->setChecked(true); @@ -116,7 +116,7 @@ namespace kt void BWSPrefPageWidget::btnSave_clicked() { - QString sf = KFileDialog::getSaveFileName("/home","*",this,i18n("Choose a filename to save under")); + TQString sf = KFileDialog::getSaveFileName("/home","*",this,i18n("Choose a filename to save under")); if(sf.isEmpty()) return; @@ -126,7 +126,7 @@ namespace kt void BWSPrefPageWidget::btnLoad_clicked() { - QString lf = KFileDialog::getOpenFileName("/home", "*",this,i18n("Choose a file")); + TQString lf = KFileDialog::getOpenFileName("/home", "*",this,i18n("Choose a file")); if(lf.isEmpty()) return; @@ -135,14 +135,14 @@ namespace kt loadSchedule(lf); } - void BWSPrefPageWidget::saveSchedule(QString& fn) + void BWSPrefPageWidget::saveSchedule(TQString& fn) { schedule = m_bwsWidget->schedule(); - QFile file(fn); + TQFile file(fn); file.open(IO_WriteOnly); - QDataStream stream(&file); + TQDataStream stream(&file); //First category stream << dlCat1->value(); @@ -162,12 +162,12 @@ namespace kt stream << (int) schedule.getCategory(i, j); file.close(); - lblStatus->setText(i18n("Schedule saved.")); + lbltqStatus->setText(i18n("Schedule saved.")); } - void BWSPrefPageWidget::loadSchedule(QString& fn, bool showmsg) + void BWSPrefPageWidget::loadSchedule(TQString& fn, bool showmsg) { - QFile file(fn); + TQFile file(fn); if(!file.exists()) { if(showmsg) @@ -176,7 +176,7 @@ namespace kt } file.open(IO_ReadOnly); - QDataStream stream(&file); + TQDataStream stream(&file); int tmp; @@ -205,13 +205,13 @@ namespace kt file.close(); m_bwsWidget->setSchedule(schedule); - lblStatus->setText(i18n("Schedule loaded.")); + lbltqStatus->setText(i18n("Schedule loaded.")); } void BWSPrefPageWidget::loadDefault() { //read schedule from HD - QString fn = KGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule"; + TQString fn = KGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule"; loadSchedule(fn, false); } @@ -228,7 +228,7 @@ namespace kt ulCat2->setValue(0); ulCat3->setValue(0); - lblStatus->clear(); + lbltqStatus->clear(); } void BWSPrefPageWidget::apply() diff --git a/plugins/scheduler/bwsprefpagewidget.h b/plugins/scheduler/bwsprefpagewidget.h index ca0e80b..7529887 100644 --- a/plugins/scheduler/bwsprefpagewidget.h +++ b/plugins/scheduler/bwsprefpagewidget.h @@ -20,7 +20,7 @@ #ifndef KTBWSPREFPAGEWIDGET_H #define KTBWSPREFPAGEWIDGET_H -#include +#include #include "bwspage.h" #include "bwscheduler.h" @@ -34,8 +34,9 @@ namespace kt class BWSPrefPageWidget : public BWSPage { Q_OBJECT + TQ_OBJECT public: - BWSPrefPageWidget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + BWSPrefPageWidget(TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 ); ~BWSPrefPageWidget(); /*$PUBLIC_FUNCTIONS$*/ @@ -52,13 +53,13 @@ namespace kt * @ref BWSPrefPageWidget::btnLoad_clicked() * @ref BWSPrefPageWidget::loadDefault() */ - void loadSchedule(QString& fn, bool showmsg = true); + void loadSchedule(TQString& fn, bool showmsg = true); /** * Saves current schedule to HD. * @param fn Schedule filename. */ - void saveSchedule(QString& fn); + void saveSchedule(TQString& fn); public slots: diff --git a/plugins/scheduler/bwswidget.cpp b/plugins/scheduler/bwswidget.cpp index b430de3..4cfb3f4 100644 --- a/plugins/scheduler/bwswidget.cpp +++ b/plugins/scheduler/bwswidget.cpp @@ -21,26 +21,26 @@ #include "schedulerpluginsettings.h" #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include namespace kt { - BWSWidget::BWSWidget(QWidget* parent, const char* name, bool useColors) - : QTable(parent,name), m_leftCategory(1), m_rightCategory(0), draw_focus(true), right_click(false), use_colors(useColors) + BWSWidget::BWSWidget(TQWidget* tqparent, const char* name, bool useColors) + : TQTable(tqparent,name), m_leftCategory(1), m_rightCategory(0), draw_focus(true), right_click(false), use_colors(useColors) { use_colors = SchedulerPluginSettings::useColors(); - QStringList days; - QStringList hours; + TQStringList days; + TQStringList hours; days << i18n("MON") << i18n("TUE") << i18n("WED") << i18n("THU") << i18n("FRI") << i18n("SAT") << i18n("SUN"); hours << @@ -63,9 +63,9 @@ namespace kt setColumnLabels(days); setRowLabels(hours); - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(TQ_StrongFocus); - QFont f; + TQFont f; f.setPointSize(8); setFont(f); @@ -96,13 +96,13 @@ namespace kt resetSchedule(); - setSelectionMode(QTable::NoSelection); + setSelectionMode(TQTable::NoSelection); - setHScrollBarMode(QTable::AlwaysOff); - setVScrollBarMode(QTable::AlwaysOff); + setHScrollBarMode(TQTable::AlwaysOff); + setVScrollBarMode(TQTable::AlwaysOff); - connect(this, SIGNAL(currentChanged( int, int )), this, SLOT(cellSelectionChanged( int, int ))); - connect(this, SIGNAL(pressed(int, int, int, const QPoint&)), this, SLOT(cellMouseDown(int, int, int, const QPoint& ))); + connect(this, TQT_SIGNAL(currentChanged( int, int )), this, TQT_SLOT(cellSelectionChanged( int, int ))); + connect(this, TQT_SIGNAL(pressed(int, int, int, const TQPoint&)), this, TQT_SLOT(cellMouseDown(int, int, int, const TQPoint& ))); } BWSWidget::~BWSWidget() @@ -115,7 +115,7 @@ namespace kt } } - void BWSWidget::paintFocus(QPainter* p, const QRect& cr) + void BWSWidget::paintFocus(TQPainter* p, const TQRect& cr) { int x = rowAt(cr.y()); int y = columnAt(cr.x()); @@ -146,12 +146,12 @@ namespace kt void BWSWidget::cellSelectionChanged(int row, int col) { if(right_click) - setText(row, col, QString::number(m_rightCategory)); + setText(row, col, TQString::number(m_rightCategory)); else - setText(row, col, QString::number(m_leftCategory)); + setText(row, col, TQString::number(m_leftCategory)); } - void BWSWidget::paintCell(QPainter* p, int row, int col, const QRect& cr, bool selected) + void BWSWidget::paintCell(TQPainter* p, int row, int col, const TQRect& cr, bool selected) { if(selected) return; @@ -161,8 +161,8 @@ namespace kt if((ok || cat == 0) && cat >= 0 && cat <= 4) drawCell(p, cat); else - setText(row,col,QString::number(0)); - // QTable::paintCell(p,row,col,cr,selected); + setText(row,col,TQString::number(0)); + // TQTable::paintCell(p,row,col,cr,selected); } void BWSWidget::resetSchedule() @@ -175,14 +175,14 @@ namespace kt updateHeaderStates(); } - void BWSWidget::repaintWidget() + void BWSWidget::tqrepaintWidget() { for(int i=0; i<7; ++i) for(int j=0; j<24; ++j) updateCell(j,i); } - void BWSWidget::cellMouseDown(int row, int col, int button, const QPoint& mousePos) + void BWSWidget::cellMouseDown(int row, int col, int button, const TQPoint& mousePos) { right_click = button == 2; draw_focus = true; @@ -194,7 +194,7 @@ namespace kt draw_focus = false; clearSelection(); updateHeaderStates(); - repaintWidget(); + tqrepaintWidget(); } void BWSWidget::setLeftCategory(const int& theValue) @@ -213,7 +213,7 @@ namespace kt use_colors = theValue; } - void BWSWidget::drawCell(QPainter* p, int category, bool focus) + void BWSWidget::drawCell(TQPainter* p, int category, bool focus) { if(use_colors) { if(focus) { @@ -224,15 +224,15 @@ namespace kt switch(category) { case 0: - // p->drawText(QRect(0,0,40,20), Qt::AlignCenter | Qt::SingleLine, "normalllll"); + // p->drawText(TQRect(0,0,40,20), TQt::AlignCenter | TQt::SingleLine, "normalllll"); break; case 1: case 2: case 3: - p->drawText(QRect(0,0,40,20), Qt::AlignCenter | Qt::SingleLine, QString::number(category)); + p->drawText(TQRect(0,0,40,20), TQt::AlignCenter | TQt::SingleLine, TQString::number(category)); break; case 4: - p->drawText(QRect(0,0,40,20), Qt::AlignCenter | Qt::SingleLine, "off"); + p->drawText(TQRect(0,0,40,20), TQt::AlignCenter | TQt::SingleLine, "off"); break; } @@ -258,17 +258,17 @@ namespace kt m_pixf[i] = 0; } - m_color[0] = new QColor(30,165,105); - m_color[1] = new QColor(195,195,70); - m_color[2] = new QColor(195,195,70); - m_color[3] = new QColor(195,195,70); - m_color[4] = new QColor(190,30,30); + m_color[0] = new TQColor(30,165,105); + m_color[1] = new TQColor(195,195,70); + m_color[2] = new TQColor(195,195,70); + m_color[3] = new TQColor(195,195,70); + m_color[4] = new TQColor(190,30,30); - m_colorf[0] = new QColor(40,200,130); - m_colorf[1] = new QColor(210,220,130); - m_colorf[2] = new QColor(210,220,130); - m_colorf[3] = new QColor(210,220,130); - m_colorf[4] = new QColor(230,40,40); + m_colorf[0] = new TQColor(40,200,130); + m_colorf[1] = new TQColor(210,220,130); + m_colorf[2] = new TQColor(210,220,130); + m_colorf[3] = new TQColor(210,220,130); + m_colorf[4] = new TQColor(230,40,40); } else { for(int i=0; i<5; ++i) { @@ -281,22 +281,22 @@ namespace kt m_colorf[i] = 0; } - m_pix[0] = new QPixmap(locate("data", QString("ktorrent/icons/cell-a-0000.png"))); - m_pix[1] = new QPixmap(locate("data", QString("ktorrent/icons/cell-a-0001.png"))); - m_pix[2] = new QPixmap(locate("data", QString("ktorrent/icons/cell-a-0002.png"))); - m_pix[3] = new QPixmap(locate("data", QString("ktorrent/icons/cell-a-0003.png"))); - m_pix[4] = new QPixmap(locate("data", QString("ktorrent/icons/cell-a-0004.png"))); - - m_pixf[0] = new QPixmap(locate("data", QString("ktorrent/icons/cell-b-0000.png"))); - m_pixf[1] = new QPixmap(locate("data", QString("ktorrent/icons/cell-b-0001.png"))); - m_pixf[2] = new QPixmap(locate("data", QString("ktorrent/icons/cell-b-0002.png"))); - m_pixf[3] = new QPixmap(locate("data", QString("ktorrent/icons/cell-b-0003.png"))); - m_pixf[4] = new QPixmap(locate("data", QString("ktorrent/icons/cell-b-0004.png"))); + m_pix[0] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0000.png"))); + m_pix[1] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0001.png"))); + m_pix[2] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0002.png"))); + m_pix[3] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0003.png"))); + m_pix[4] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0004.png"))); + + m_pixf[0] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-b-0000.png"))); + m_pixf[1] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-b-0001.png"))); + m_pixf[2] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-b-0002.png"))); + m_pixf[3] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-b-0003.png"))); + m_pixf[4] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-b-0004.png"))); } use_colors = color; - repaintWidget(); + tqrepaintWidget(); } void BWSWidget::setSchedule(const BWS& theValue) @@ -304,7 +304,7 @@ namespace kt m_schedule = theValue; for(int i=0; i<7; ++i) for(int j=0; j<24; ++j) - setText(j,i, QString::number((int) m_schedule.getCategory(i,j))); + setText(j,i, TQString::number((int) m_schedule.getCategory(i,j))); } const BWS& BWSWidget::schedule() @@ -326,7 +326,7 @@ namespace kt return m_schedule; } - void BWSWidget::focusOutEvent(QFocusEvent* e) + void BWSWidget::focusOutEvent(TQFocusEvent* e) { if(e->lostFocus()) clearSelect(); diff --git a/plugins/scheduler/bwswidget.h b/plugins/scheduler/bwswidget.h index c035edb..bd0a94d 100644 --- a/plugins/scheduler/bwswidget.h +++ b/plugins/scheduler/bwswidget.h @@ -20,10 +20,10 @@ #ifndef KTBWSWIDGET_H #define KTBWSWIDGET_H -#include -#include -#include -#include +#include +#include +#include +#include #include "bwscheduler.h" @@ -39,17 +39,18 @@ namespace kt /** * @brief Bandwidth scheduler widget. * @author Ivan Vasić - * This class is a QTable with customized cells. It's used for bandwidth scheduling by painting each cell with mouse moves or keyboard. + * This class is a TQTable with customized cells. It's used for bandwidth scheduling by painting each cell with mouse moves or keyboard. */ - class BWSWidget : public QTable + class BWSWidget : public TQTable { Q_OBJECT + TQ_OBJECT public: - BWSWidget(QWidget* parent = 0, const char* name = 0, bool useColors = true); + BWSWidget(TQWidget* tqparent = 0, const char* name = 0, bool useColors = true); ~BWSWidget(); ///Repaints the whole widget - void repaintWidget(); + void tqrepaintWidget(); ///Clears selection (removes focus) void clearSelect(); @@ -77,19 +78,19 @@ namespace kt private slots: void cellSelectionChanged(int row, int col); - void cellMouseDown(int row, int col, int button, const QPoint& mousePos); + void cellMouseDown(int row, int col, int button, const TQPoint& mousePos); private: - void paintFocus(QPainter* p, const QRect& cr); - void paintCell(QPainter* p, int row, int col, const QRect& cr, bool selected); - void drawCell(QPainter* p, int category, bool focus = false); - void focusOutEvent(QFocusEvent*); + void paintFocus(TQPainter* p, const TQRect& cr); + void paintCell(TQPainter* p, int row, int col, const TQRect& cr, bool selected); + void drawCell(TQPainter* p, int category, bool focus = false); + void focusOutEvent(TQFocusEvent*); - QPixmap* m_pix[5]; - QPixmap* m_pixf[5]; + TQPixmap* m_pix[5]; + TQPixmap* m_pixf[5]; - QColor* m_color[5]; - QColor* m_colorf[5]; + TQColor* m_color[5]; + TQColor* m_colorf[5]; int m_leftCategory; int m_rightCategory; diff --git a/plugins/scheduler/schedulerpage.ui b/plugins/scheduler/schedulerpage.ui index 01a4f47..1a42edf 100644 --- a/plugins/scheduler/schedulerpage.ui +++ b/plugins/scheduler/schedulerpage.ui @@ -1,6 +1,6 @@ SchedulerPage - + SchedulerPage @@ -19,7 +19,7 @@ unnamed - + useBS @@ -27,7 +27,7 @@ Use &bandwidth scheduler? - + groupBWS @@ -38,7 +38,7 @@ unnamed - + useColors @@ -46,7 +46,7 @@ Use colors instead of pi&xmaps? - + textLabel1_2 @@ -54,7 +54,7 @@ (Recommended for slower systems) - + btnEditBWS @@ -72,7 +72,7 @@ Expanding - + 40 20 @@ -89,7 +89,7 @@ Expanding - + 20 80 @@ -108,7 +108,7 @@ Expanding - + 20 40 @@ -137,10 +137,10 @@ useColors_toggled(bool) - + btnEditBWS_toggled(bool) btnEditBWS_clicked() useColors_toggled(bool) - - + + diff --git a/plugins/scheduler/schedulerplugin.cpp b/plugins/scheduler/schedulerplugin.cpp index 7639293..9177ebb 100644 --- a/plugins/scheduler/schedulerplugin.cpp +++ b/plugins/scheduler/schedulerplugin.cpp @@ -24,9 +24,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -50,17 +50,17 @@ K_EXPORT_COMPONENT_FACTORY(ktschedulerplugin,KGenericFactoryaddPrefPage(Pref); BWScheduler::instance().setCoreInterface(getCore()); - QDateTime now = QDateTime::currentDateTime(); + TQDateTime now = TQDateTime::tqcurrentDateTime(); //each hour - QDateTime hour = now.addSecs(3600); - QTime t(hour.time().hour(), 0); + TQDateTime hour = now.addSecs(3600); + TQTime t(hour.time().hour(), 0); //each minute -// QDateTime hour = now.addSecs(60); -// QTime t(hour.time().hour(), hour.time().minute()); +// TQDateTime hour = now.addSecs(60); +// TQTime t(hour.time().hour(), hour.time().minute()); - QDateTime round(hour.date(), t); + TQDateTime round(hour.date(), t); // add a 5 second safety margin (BUG: 131246) int secs_to = now.secsTo(round) + 5; @@ -95,7 +95,7 @@ namespace kt // updateEnabledBWS(); bws_action = new KAction(i18n("Open Bandwidth Scheduler" ), "clock", 0, this, - SLOT(openBWS()), actionCollection(), "bwscheduler" ); + TQT_SLOT(openBWS()), actionCollection(), "bwscheduler" ); } void SchedulerPlugin::unload() @@ -115,7 +115,7 @@ namespace kt void SchedulerPlugin::timer_triggered() { m_timer.changeInterval(3600*1000); - QDateTime now = QDateTime::currentDateTime(); + TQDateTime now = TQDateTime::tqcurrentDateTime(); BWScheduler::instance().trigger(); } @@ -135,7 +135,7 @@ namespace kt if(SchedulerPluginSettings::enableBWS()) { bws_action = new KAction(i18n("Open Bandwidth Scheduler" ), "clock", 0, this, - SLOT(openBWS()), actionCollection(), "bwscheduler" ); + TQT_SLOT(openBWS()), actionCollection(), "bwscheduler" ); } else { @@ -145,7 +145,7 @@ namespace kt } } - bool SchedulerPlugin::versionCheck(const QString & version) const + bool SchedulerPlugin::versionCheck(const TQString & version) const { return version == KT_VERSION_MACRO; } diff --git a/plugins/scheduler/schedulerplugin.h b/plugins/scheduler/schedulerplugin.h index 6828d0d..96dad21 100644 --- a/plugins/scheduler/schedulerplugin.h +++ b/plugins/scheduler/schedulerplugin.h @@ -24,11 +24,11 @@ #include "schedulerprefpage.h" -#include +#include #include -class QString; +class TQString; namespace kt @@ -43,13 +43,14 @@ namespace kt class SchedulerPlugin : public Plugin { Q_OBJECT + TQ_OBJECT public: - SchedulerPlugin(QObject* parent, const char* name, const QStringList& args); + SchedulerPlugin(TQObject* tqparent, const char* name, const TQStringList& args); virtual ~SchedulerPlugin(); virtual void load(); virtual void unload(); - virtual bool versionCheck(const QString& version) const; + virtual bool versionCheck(const TQString& version) const; void updateEnabledBWS(); @@ -58,7 +59,7 @@ namespace kt void openBWS(); private: - QTimer m_timer; + TQTimer m_timer; /* BANDWIDTH SCHEDULE PLUGIN */ SchedulerPrefPage* Pref; diff --git a/plugins/scheduler/schedulerprefpage.cpp b/plugins/scheduler/schedulerprefpage.cpp index fe82f34..076fb5c 100644 --- a/plugins/scheduler/schedulerprefpage.cpp +++ b/plugins/scheduler/schedulerprefpage.cpp @@ -48,9 +48,9 @@ namespace kt return true; } - void SchedulerPrefPage::createWidget( QWidget * parent ) + void SchedulerPrefPage::createWidget( TQWidget * tqparent ) { - widget = new SchedulerPrefPageWidget(parent); + widget = new SchedulerPrefPageWidget(tqparent); } void SchedulerPrefPage::updateData() diff --git a/plugins/scheduler/schedulerprefpage.h b/plugins/scheduler/schedulerprefpage.h index a10a98a..a2efa21 100644 --- a/plugins/scheduler/schedulerprefpage.h +++ b/plugins/scheduler/schedulerprefpage.h @@ -40,7 +40,7 @@ namespace kt virtual ~SchedulerPrefPage(); virtual bool apply(); - virtual void createWidget(QWidget* parent); + virtual void createWidget(TQWidget* tqparent); virtual void updateData(); virtual void deleteWidget(); diff --git a/plugins/scheduler/schedulerprefpagewidget.cpp b/plugins/scheduler/schedulerprefpagewidget.cpp index d6e73dd..ad12e73 100644 --- a/plugins/scheduler/schedulerprefpagewidget.cpp +++ b/plugins/scheduler/schedulerprefpagewidget.cpp @@ -22,16 +22,16 @@ #include "bwscheduler.h" #include "schedulerpluginsettings.h" -#include -#include -#include -#include +#include +#include +#include +#include namespace kt { - SchedulerPrefPageWidget::SchedulerPrefPageWidget(QWidget* parent, const char* name, WFlags fl) - : SchedulerPage(parent,name,fl) + SchedulerPrefPageWidget::SchedulerPrefPageWidget(TQWidget* tqparent, const char* name, WFlags fl) + : SchedulerPage(tqparent,name,fl) { groupBWS->setEnabled(false); bool useit = SchedulerPluginSettings::enableBWS(); @@ -59,9 +59,9 @@ namespace kt SchedulerPluginSettings::writeConfig(); /* force trigger since the schedule has changed but after KTorrent::apply() - * Used QTimer with fixed interval - not very nice solution... */ + * Used TQTimer with fixed interval - not very nice solution... */ if(useBS->isChecked()) - QTimer::singleShot(1000, this, SLOT(scheduler_trigger())); + TQTimer::singleShot(1000, this, TQT_SLOT(scheduler_trigger())); BWScheduler::instance().setEnabled(use_bws); } diff --git a/plugins/scheduler/schedulerprefpagewidget.h b/plugins/scheduler/schedulerprefpagewidget.h index 9f62c20..5274f3d 100644 --- a/plugins/scheduler/schedulerprefpagewidget.h +++ b/plugins/scheduler/schedulerprefpagewidget.h @@ -20,7 +20,7 @@ #ifndef KTSCHEDULERPREFPAGEWIDGET_H #define KTSCHEDULERPREFPAGEWIDGET_H -#include +#include #include "schedulerpage.h" namespace kt @@ -32,8 +32,9 @@ namespace kt class SchedulerPrefPageWidget : public SchedulerPage { Q_OBJECT + TQ_OBJECT public: - SchedulerPrefPageWidget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + SchedulerPrefPageWidget(TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 ); ~SchedulerPrefPageWidget(); -- cgit v1.2.1