diff options
Diffstat (limited to 'kpilot/kpilot/logWidget.cc')
-rw-r--r-- | kpilot/kpilot/logWidget.cc | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/kpilot/kpilot/logWidget.cc b/kpilot/kpilot/logWidget.cc index b64ed4a8..c7bddb61 100644 --- a/kpilot/kpilot/logWidget.cc +++ b/kpilot/kpilot/logWidget.cc @@ -29,18 +29,18 @@ #include "options.h" -#include <qfile.h> -#include <qlayout.h> -#include <qtextedit.h> -#include <qwhatsthis.h> -#include <qdatetime.h> -#include <qlabel.h> -#include <qpixmap.h> -#include <qtimer.h> -#include <qpushbutton.h> -#include <qhbox.h> -#include <qtextstream.h> -#include <qpainter.h> +#include <tqfile.h> +#include <tqlayout.h> +#include <tqtextedit.h> +#include <tqwhatsthis.h> +#include <tqdatetime.h> +#include <tqlabel.h> +#include <tqpixmap.h> +#include <tqtimer.h> +#include <tqpushbutton.h> +#include <tqhbox.h> +#include <tqtextstream.h> +#include <tqpainter.h> #include <kglobal.h> #include <kstandarddirs.h> @@ -63,9 +63,9 @@ #endif -LogWidget::LogWidget(QWidget * parent) : +LogWidget::LogWidget(TQWidget * parent) : DCOPObject("LogIface"), - PilotComponent(parent, "component_log", QString::null), + PilotComponent(parent, "component_log", TQString::null), fLog(0L), fShowTime(false), fSplash(0L), @@ -74,7 +74,7 @@ LogWidget::LogWidget(QWidget * parent) : fButtonBox(0L) { FUNCTIONSETUP; - QGridLayout *grid = new QGridLayout(this, 4, 4, SPACING); + TQGridLayout *grid = new TQGridLayout(this, 4, 4, SPACING); grid->addRowSpacing(0, SPACING); grid->addRowSpacing(1, 100); @@ -85,42 +85,42 @@ LogWidget::LogWidget(QWidget * parent) : grid->setRowStretch(1, 50); grid->setColStretch(2, 50); - fLog = new QTextEdit(this); + fLog = new TQTextEdit(this); fLog->setReadOnly(true); - fLog->setWordWrap(QTextEdit::WidgetWidth); - fLog->setWrapPolicy(QTextEdit::AtWordOrDocumentBoundary); + fLog->setWordWrap(TQTextEdit::WidgetWidth); + fLog->setWrapPolicy(TQTextEdit::AtWordOrDocumentBoundary); #if QT_VERSION < 0x030100 /* nothing, use AutoText */ #else fLog->setTextFormat(Qt::LogText); #endif - QWhatsThis::add(fLog, i18n("<qt>This lists all the messages received " + TQWhatsThis::add(fLog, i18n("<qt>This lists all the messages received " "during the current HotSync</qt>")); grid->addMultiCellWidget(fLog, 1, 1,1,2); - QString initialText ; + TQString initialText ; initialText.append(CSL1("<b>Version:</b> KPilot %1" TE_EOL) - .arg(QString::fromLatin1(KPILOT_VERSION))); + .arg(TQString::fromLatin1(KPILOT_VERSION))); initialText.append(CSL1("<b>Version:</b> pilot-link %1.%2.%3%4" TE_EOL) .arg(PILOT_LINK_VERSION) .arg(PILOT_LINK_MAJOR) .arg(PILOT_LINK_MINOR) #ifdef PILOT_LINK_PATCH - .arg(QString::fromLatin1(PILOT_LINK_PATCH)) + .arg(TQString::fromLatin1(PILOT_LINK_PATCH)) #else - .arg(QString()) + .arg(TQString()) #endif ); #ifdef KDE_VERSION_STRING initialText.append(CSL1("<b>Version:</b> KDE %1" TE_EOL) - .arg(QString::fromLatin1(KDE_VERSION_STRING))); + .arg(TQString::fromLatin1(KDE_VERSION_STRING))); #endif #ifdef QT_VERSION_STR initialText.append(CSL1("<b>Version:</b> Qt %1" TE_EOL) - .arg(QString::fromLatin1(QT_VERSION_STR))); + .arg(TQString::fromLatin1(QT_VERSION_STR))); #endif initialText.append(CSL1(TE_EOL)); @@ -136,51 +136,51 @@ LogWidget::LogWidget(QWidget * parent) : fLog->setText(initialText); fLog->scrollToBottom(); - QHBox *h = new QHBox(this); + TQHBox *h = new TQHBox(this); h->setSpacing(SPACING); - QPushButton *b = new QPushButton( + TQPushButton *b = new TQPushButton( i18n("Clear the text of HotSync messages","Clear Log"), h); - QWhatsThis::add(b,i18n("<qt>Clears the list of messages from the " + TQWhatsThis::add(b,i18n("<qt>Clears the list of messages from the " "current HotSync.</qt>")); - connect(b,SIGNAL(clicked()),this,SLOT(clearLog())); + connect(b,TQT_SIGNAL(clicked()),this,TQT_SLOT(clearLog())); - b = new QPushButton(i18n("Save Log..."),h); - QWhatsThis::add(b,i18n("<qt>You can save the list of messages received " + b = new TQPushButton(i18n("Save Log..."),h); + TQWhatsThis::add(b,i18n("<qt>You can save the list of messages received " "during this HotSync to a file (for example for use in a " "bug report) by clicking here.</qt>")); - connect(b,SIGNAL(clicked()),this,SLOT(saveLog())); + connect(b,TQT_SIGNAL(clicked()),this,TQT_SLOT(saveLog())); fButtonBox = h; grid->addMultiCellWidget(h,2,2,1,2); - fLabel = new QLabel(i18n("Sync progress:"),this); + fLabel = new TQLabel(i18n("Sync progress:"),this); grid->addWidget(fLabel,3,1); fProgress = new KProgress(this); - QWhatsThis::add(fProgress,i18n("<qt>The (estimated) percentage " + TQWhatsThis::add(fProgress,i18n("<qt>The (estimated) percentage " "completed in the current HotSync.</qt>")); grid->addWidget(fProgress,3,2); - QString splashPath = + TQString splashPath = KGlobal::dirs()->findResource("data", CSL1("kpilot/kpilot-splash.png")); - if (!splashPath.isEmpty() && QFile::exists(splashPath)) + if (!splashPath.isEmpty() && TQFile::exists(splashPath)) { fLog->hide(); fLabel->hide(); fProgress->hide(); - QPixmap splash(splashPath); - QPainter painter(&splash); - painter.setPen(QColor(0, 255, 0)); + TQPixmap splash(splashPath); + TQPainter painter(&splash); + painter.setPen(TQColor(0, 255, 0)); // This latin1() is ok; KPILOT_VERSION is a #define // of a constant string. int textWidth =fontMetrics().width( - QString::fromLatin1(KPILOT_VERSION)) ; + TQString::fromLatin1(KPILOT_VERSION)) ; int textHeight = fontMetrics().height(); #ifdef DEBUG @@ -197,11 +197,11 @@ LogWidget::LogWidget(QWidget * parent) : black); painter.drawText(splash.width() - 25 - textWidth, splash.height() - 8, - QString::fromLatin1(KPILOT_VERSION)); - fSplash = new QLabel(this); + TQString::fromLatin1(KPILOT_VERSION)); + fSplash = new TQLabel(this); fSplash->setPixmap(splash); fSplash->setAlignment(AlignCenter); - QTimer::singleShot(3000,this,SLOT(hideSplash())); + TQTimer::singleShot(3000,this,TQT_SLOT(hideSplash())); grid->addMultiCellWidget(fSplash,1,3,1,2); grid->addColSpacing(0,10); grid->setColStretch(1,50); @@ -211,18 +211,18 @@ LogWidget::LogWidget(QWidget * parent) : } -void LogWidget::addMessage(const QString & s) +void LogWidget::addMessage(const TQString & s) { FUNCTIONSETUP; if (s.isEmpty()) return; if (!fLog) return; - QString t; + TQString t; if (fShowTime) { t.append(CSL1("<b>")); - t.append(QTime::currentTime().toString()); + t.append(TQTime::currentTime().toString()); t.append(CSL1("</b> ")); } @@ -237,7 +237,7 @@ void LogWidget::addMessage(const QString & s) fLog->scrollToBottom(); } -void LogWidget::addError(const QString & s) +void LogWidget::addError(const TQString & s) { FUNCTIONSETUP; @@ -247,7 +247,7 @@ void LogWidget::addError(const QString & s) if (!fLog) return; - QString t; + TQString t; t.append(CSL1("<i>")); t.append(s); @@ -256,7 +256,7 @@ void LogWidget::addError(const QString & s) addMessage(t); } -void LogWidget::addProgress(const QString &s,int i) +void LogWidget::addProgress(const TQString &s,int i) { FUNCTIONSETUP; @@ -299,17 +299,17 @@ void LogWidget::hideSplash() } -/* DCOP */ ASYNC LogWidget::logMessage(QString s) +/* DCOP */ ASYNC LogWidget::logMessage(TQString s) { addMessage(s); } -/* DCOP */ ASYNC LogWidget::logError(QString s) +/* DCOP */ ASYNC LogWidget::logError(TQString s) { addError(s); } -/* DCOP */ ASYNC LogWidget::logProgress(QString s, int i) +/* DCOP */ ASYNC LogWidget::logProgress(TQString s, int i) { addProgress(s,i); } @@ -328,7 +328,7 @@ void LogWidget::hideSplash() if (fLog) { - fLog->setText(QString::null); + fLog->setText(TQString::null); } } @@ -340,14 +340,14 @@ void LogWidget::hideSplash() while (!finished) { - QString saveFileName = KFileDialog::getSaveFileName( - QString::null, /* default */ + TQString saveFileName = KFileDialog::getSaveFileName( + TQString::null, /* default */ CSL1("*.log"), /* show log files by default */ this, i18n("Save Log")); if (saveFileName.isEmpty()) return; - if (QFile::exists(saveFileName)) + if (TQFile::exists(saveFileName)) { int r = KMessageBox::warningYesNoCancel( this, @@ -369,11 +369,11 @@ void LogWidget::hideSplash() } -bool LogWidget::saveFile(const QString &saveFileName) +bool LogWidget::saveFile(const TQString &saveFileName) { FUNCTIONSETUP; - QFile f(saveFileName); + TQFile f(saveFileName); if (!f.open(IO_WriteOnly)) { int r = KMessageBox::questionYesNo(this, @@ -386,7 +386,7 @@ bool LogWidget::saveFile(const QString &saveFileName) } else { - QTextStream t(&f); + TQTextStream t(&f); t << fLog->text(); } |