diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-17 08:20:48 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-17 08:20:48 +0000 |
commit | aa0726b20f398264f0a2abc60215be044b106f9c (patch) | |
tree | 070fdbc19a1106cfdd7f651a8ce76bb1b89a513d /src/likeback.cpp | |
parent | d3cf5b3e75aadc3b02d0b56f030d4c3f8c2c749d (diff) | |
download | basket-aa0726b20f398264f0a2abc60215be044b106f9c.tar.gz basket-aa0726b20f398264f0a2abc60215be044b106f9c.zip |
TQt4 port basket
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/basket@1232416 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/likeback.cpp')
-rw-r--r-- | src/likeback.cpp | 294 |
1 files changed, 147 insertions, 147 deletions
diff --git a/src/likeback.cpp b/src/likeback.cpp index 5beafc8..d22e985 100644 --- a/src/likeback.cpp +++ b/src/likeback.cpp @@ -27,24 +27,24 @@ #include <klocale.h> #include <kdebug.h> #include <kmessagebox.h> -#include <qlayout.h> -#include <qtoolbutton.h> +#include <tqlayout.h> +#include <tqtoolbutton.h> #include <kpushbutton.h> -#include <qcheckbox.h> -#include <qradiobutton.h> -#include <qbuttongroup.h> -#include <qvgroupbox.h> +#include <tqcheckbox.h> +#include <tqradiobutton.h> +#include <tqbuttongroup.h> +#include <tqvgroupbox.h> #include <kguiitem.h> -#include <qpopupmenu.h> -#include <qtextedit.h> -#include <qlayout.h> -#include <qlabel.h> +#include <tqpopupmenu.h> +#include <tqtextedit.h> +#include <tqlayout.h> +#include <tqlabel.h> #include <kdialogbase.h> -#include <qhttp.h> +#include <tqhttp.h> #include <kurl.h> #include <kinputdialog.h> -#include <qvalidator.h> -#include <qaction.h> +#include <tqvalidator.h> +#include <tqaction.h> #include <kdebug.h> #include <pwd.h> @@ -59,45 +59,45 @@ /****************************************/ LikeBackBar::LikeBackBar(LikeBack *likeBack) - : QWidget(0, "LikeBackBar", Qt::WX11BypassWM | Qt::WStyle_NoBorder | Qt::WNoAutoErase | Qt::WStyle_StaysOnTop | Qt::WStyle_NoBorder | Qt::Qt::WGroupLeader) + : TQWidget(0, "LikeBackBar", TQt::WX11BypassWM | TQt::WStyle_NoBorder | TQt::WNoAutoErase | TQt::WStyle_StaysOnTop | TQt::WStyle_NoBorder | TQt::TQt::WGroupLeader) , m_likeBack(likeBack) { - QHBoxLayout *layout = new QHBoxLayout(this); + TQHBoxLayout *tqlayout = new TQHBoxLayout(this); - QIconSet likeIconSet = kapp->iconLoader()->loadIconSet("likeback_like", KIcon::Small); - QIconSet dislikeIconSet = kapp->iconLoader()->loadIconSet("likeback_dislike", KIcon::Small); - QIconSet bugIconSet = kapp->iconLoader()->loadIconSet("likeback_bug", KIcon::Small); - QIconSet featureIconSet = kapp->iconLoader()->loadIconSet("likeback_feature", KIcon::Small); + TQIconSet likeIconSet = kapp->iconLoader()->loadIconSet("likeback_like", KIcon::Small); + TQIconSet dislikeIconSet = kapp->iconLoader()->loadIconSet("likeback_dislike", KIcon::Small); + TQIconSet bugIconSet = kapp->iconLoader()->loadIconSet("likeback_bug", KIcon::Small); + TQIconSet featureIconSet = kapp->iconLoader()->loadIconSet("likeback_feature", KIcon::Small); - m_likeButton = new QToolButton(this, "likeback_like"); + m_likeButton = new TQToolButton(this, "likeback_like"); m_likeButton->setIconSet(likeIconSet); m_likeButton->setTextLabel("<p>" + i18n("Send application developers a comment about something you like")); m_likeButton->setAutoRaise(true); - connect( m_likeButton, SIGNAL(clicked()), this, SLOT(clickedLike()) ); - layout->add(m_likeButton); + connect( m_likeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(clickedLike()) ); + tqlayout->add(m_likeButton); - m_dislikeButton = new QToolButton(this, "likeback_dislike"); + m_dislikeButton = new TQToolButton(this, "likeback_dislike"); m_dislikeButton->setIconSet(dislikeIconSet); m_dislikeButton->setTextLabel("<p>" + i18n("Send application developers a comment about something you dislike")); m_dislikeButton->setAutoRaise(true); - connect( m_dislikeButton, SIGNAL(clicked()), this, SLOT(clickedDislike()) ); - layout->add(m_dislikeButton); + connect( m_dislikeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(clickedDislike()) ); + tqlayout->add(m_dislikeButton); - m_bugButton = new QToolButton(this, "likeback_bug"); + m_bugButton = new TQToolButton(this, "likeback_bug"); m_bugButton->setIconSet(bugIconSet); m_bugButton->setTextLabel("<p>" + i18n("Send application developers a comment about an improper behavior of the application")); m_bugButton->setAutoRaise(true); - connect( m_bugButton, SIGNAL(clicked()), this, SLOT(clickedBug()) ); - layout->add(m_bugButton); + connect( m_bugButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(clickedBug()) ); + tqlayout->add(m_bugButton); - m_featureButton = new QToolButton(this, "likeback_feature"); + m_featureButton = new TQToolButton(this, "likeback_feature"); m_featureButton->setIconSet(featureIconSet); m_featureButton->setTextLabel("<p>" + i18n("Send application developers a comment about a new feature you desire")); m_featureButton->setAutoRaise(true); - connect( m_featureButton, SIGNAL(clicked()), this, SLOT(clickedFeature()) ); - layout->add(m_featureButton); + connect( m_featureButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(clickedFeature()) ); + tqlayout->add(m_featureButton); - connect( &m_timer, SIGNAL(timeout()), this, SLOT(autoMove()) ); + connect( &m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(autoMove()) ); LikeBack::Button buttons = likeBack->buttons(); m_likeButton->setShown( buttons & LikeBack::Like ); @@ -122,17 +122,17 @@ void LikeBackBar::stopTimer() void LikeBackBar::autoMove() { - static QWidget *lastWindow = 0; + static TQWidget *lastWindow = 0; - QWidget *window = kapp->activeWindow(); - // When a Kicker applet has the focus, like the Commandline QLineEdit, + TQWidget *window = TQT_TQWIDGET(kapp->activeWindow()); + // When a Kicker applet has the focus, like the Commandline TQLineEdit, // the systemtray icon indicates to be the current window and the LikeBack is shown next to the system tray icon. // It's obviously bad ;-) : bool shouldShow = (m_likeBack->userWantsToShowBar() && m_likeBack->enabledBar() && window && !window->inherits("KSystemTray")); if (shouldShow) { //move(window->x() + window->width() - 100 - width(), window->y()); - //move(window->x() + window->width() - 100 - width(), window->mapToGlobal(QPoint(0, 0)).y() - height()); - move(window->mapToGlobal(QPoint(0, 0)).x() + window->width() - width(), window->mapToGlobal(QPoint(0, 0)).y() + 1); + //move(window->x() + window->width() - 100 - width(), window->mapToGlobal(TQPoint(0, 0)).y() - height()); + move(window->mapToGlobal(TQPoint(0, 0)).x() + window->width() - width(), window->mapToGlobal(TQPoint(0, 0)).y() + 1); if (window != lastWindow && m_likeBack->windowNamesListing() != LikeBack::NoListing) { if (qstricmp(window->name(), "") == 0 || qstricmp(window->name(), "unnamed") == 0) { @@ -208,7 +208,7 @@ LikeBackPrivate::~LikeBackPrivate() /*************************************/ LikeBack::LikeBack(Button buttons, bool showBarByDefault, KConfig *config, const KAboutData *aboutData) - : QObject() + : TQObject() { // Initialize properties (1/2): d = new LikeBackPrivate(); @@ -232,7 +232,7 @@ LikeBack::LikeBack(Button buttons, bool showBarByDefault, KConfig *config, const // Initialize the button-bar: d->bar = new LikeBackBar(this); - d->bar->resize(d->bar->sizeHint()); + d->bar->resize(d->bar->tqsizeHint()); // Show the information message if it is the first time, and if the button-bar is shown: static const char *messageShown = "LikeBack_starting_information"; @@ -243,7 +243,7 @@ LikeBack::LikeBack(Button buttons, bool showBarByDefault, KConfig *config, const // Show the bar if that's wanted by the developer or the user: if (d->showBar) - QTimer::singleShot( 0, d->bar, SLOT(startTimer()) ); + TQTimer::singleShot( 0, d->bar, TQT_SLOT(startTimer()) ); #if 0 disableBar(); @@ -283,40 +283,40 @@ LikeBack::WindowListing LikeBack::windowNamesListing() return d->windowListing; } -void LikeBack::setAcceptedLanguages(const QStringList &locales, const QString &message) +void LikeBack::setAcceptedLanguages(const TQStringList &locales, const TQString &message) { d->acceptedLocales = locales; d->acceptedLanguagesMessage = message; } -QStringList LikeBack::acceptedLocales() +TQStringList LikeBack::acceptedLocales() { return d->acceptedLocales; } -QString LikeBack::acceptedLanguagesMessage() +TQString LikeBack::acceptedLanguagesMessage() { return d->acceptedLanguagesMessage; } -void LikeBack::setServer(const QString &hostName, const QString &remotePath, Q_UINT16 hostPort) +void LikeBack::setServer(const TQString &hostName, const TQString &remotePath, TQ_UINT16 hostPort) { d->hostName = hostName; d->remotePath = remotePath; d->hostPort = hostPort; } -QString LikeBack::hostName() +TQString LikeBack::hostName() { return d->hostName; } -QString LikeBack::remotePath() +TQString LikeBack::remotePath() { return d->remotePath; } -Q_UINT16 LikeBack::hostPort() +TQ_UINT16 LikeBack::hostPort() { return d->hostPort; } @@ -345,7 +345,7 @@ bool LikeBack::enabledBar() return d->disabledCount <= 0; } -void LikeBack::execCommentDialog(Button type, const QString &initialComment, const QString &windowPath, const QString &context) +void LikeBack::execCommentDialog(Button type, const TQString &initialComment, const TQString &windowPath, const TQString &context) { disableBar(); LikeBackDialog dialog(type, initialComment, windowPath, context, this); @@ -373,13 +373,13 @@ KConfig* LikeBack::config() return d->config; } -KAction* LikeBack::sendACommentAction(KActionCollection *parent) +KAction* LikeBack::sendACommentAction(KActionCollection *tqparent) { if (d->action == 0) d->action = new KAction( i18n("&Send a Comment to Developers"), /*icon=*/"mail_new", /*shortcut=*/"", - this, SLOT(execCommentDialog()), - parent, "likeback_send_a_comment" + this, TQT_SLOT(execCommentDialog()), + tqparent, "likeback_send_a_comment" ); return d->action; @@ -411,14 +411,14 @@ void LikeBack::setUserWantsToShowBar(bool showBar) void LikeBack::showInformationMessage() { // Load and register the images needed by the message: - QPixmap likeIcon = kapp->iconLoader()->loadIcon("likeback_like", KIcon::Small); - QPixmap dislikeIcon = kapp->iconLoader()->loadIcon("likeback_dislike", KIcon::Small); - QPixmap bugIcon = kapp->iconLoader()->loadIcon("likeback_bug", KIcon::Small); - QPixmap featureIcon = kapp->iconLoader()->loadIcon("likeback_feature", KIcon::Small); - QMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_like", likeIcon); - QMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_dislike", dislikeIcon); - QMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_bug", bugIcon); - QMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_feature", featureIcon); + TQPixmap likeIcon = kapp->iconLoader()->loadIcon("likeback_like", KIcon::Small); + TQPixmap dislikeIcon = kapp->iconLoader()->loadIcon("likeback_dislike", KIcon::Small); + TQPixmap bugIcon = kapp->iconLoader()->loadIcon("likeback_bug", KIcon::Small); + TQPixmap featureIcon = kapp->iconLoader()->loadIcon("likeback_feature", KIcon::Small); + TQMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_like", likeIcon); + TQMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_dislike", dislikeIcon); + TQMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_bug", bugIcon); + TQMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_feature", featureIcon); // Show a message reflecting the allowed types of comment: Button buttons = d->buttons; @@ -430,7 +430,7 @@ void LikeBack::showInformationMessage() "<p><b>" + (isDevelopmentVersion(d->aboutData->version()) ? i18n("Welcome to this testing version of %1.") : i18n("Welcome to %1.") - ).arg(d->aboutData->programName()) + "</b></p>" + ).tqarg(d->aboutData->programName()) + "</b></p>" "<p>" + i18n("To help us improve it, your comments are important.") + "</p>" "<p>" + ((buttons & LikeBack::Like) && (buttons & LikeBack::Dislike) ? @@ -446,7 +446,7 @@ void LikeBack::showInformationMessage() "please click the frowning face below the window title-bar, " "briefly describe what you dislike and click Send.") : - QString() + TQString() ))) + "</p>" + (buttons & LikeBack::Bug ? "<p>" + @@ -480,33 +480,33 @@ void LikeBack::showInformationMessage() i18n("Help Improve the Application")); // Reset the images from the factory: - QMimeSourceFactory::defaultFactory()->setData("likeback_icon_like", 0L); - QMimeSourceFactory::defaultFactory()->setData("likeback_icon_dislike", 0L); - QMimeSourceFactory::defaultFactory()->setData("likeback_icon_bug", 0L); - QMimeSourceFactory::defaultFactory()->setData("likeback_icon_feature", 0L); + TQMimeSourceFactory::defaultFactory()->setData("likeback_icon_like", 0L); + TQMimeSourceFactory::defaultFactory()->setData("likeback_icon_dislike", 0L); + TQMimeSourceFactory::defaultFactory()->setData("likeback_icon_bug", 0L); + TQMimeSourceFactory::defaultFactory()->setData("likeback_icon_feature", 0L); } -QString LikeBack::activeWindowPath() +TQString LikeBack::activeWindowPath() { // Compute the window hierarchy (from the latest to the oldest): - QStringList windowNames; - QWidget *window = kapp->activeWindow(); + TQStringList windowNames; + TQWidget *window = TQT_TQWIDGET(kapp->activeWindow()); while (window) { - QString name = window->name(); + TQString name = window->name(); // Append the class name to the window name if it is unnamed: if (name == "unnamed") - name += QString(":") + window->className(); + name += TQString(":") + window->className(); windowNames.append(name); - window = dynamic_cast<QWidget*>(window->parent()); + window = dynamic_cast<TQWidget*>(window->tqparent()); } // Create the string of windows starting by the end (from the oldest to the latest): - QString windowPath; + TQString windowPath; for (int i = ((int)windowNames.count()) - 1; i >= 0; i--) { if (windowPath.isEmpty()) windowPath = windowNames[i]; else - windowPath += QString("~~") + windowNames[i]; + windowPath += TQString("~~") + windowNames[i]; } // Finally return the computed path: @@ -519,7 +519,7 @@ bool LikeBack::emailAddressAlreadyProvided() return d->config->readBoolEntry("emailAlreadyAsked", false); } -QString LikeBack::emailAddress() +TQString LikeBack::emailAddress() { if (!emailAddressAlreadyProvided()) askEmailAddress(); @@ -528,7 +528,7 @@ QString LikeBack::emailAddress() return d->config->readEntry("emailAddress", ""); } -void LikeBack::setEmailAddress(const QString &address, bool userProvided) +void LikeBack::setEmailAddress(const TQString &address, bool userProvided) { d->config->setGroup("LikeBack"); d->config->writeEntry("emailAddress", address); @@ -540,25 +540,25 @@ void LikeBack::askEmailAddress() { d->config->setGroup("LikeBack"); - QString currentEmailAddress = d->config->readEntry("emailAddress", ""); + TQString currentEmailAddress = d->config->readEntry("emailAddress", ""); if (!emailAddressAlreadyProvided() && !d->fetchedEmail.isEmpty()) currentEmailAddress = d->fetchedEmail; bool ok; - QString emailExpString = "[\\w-\\.]+@[\\w-\\.]+\\.[\\w]+"; - //QString namedEmailExpString = "[.]*[ \\t]+<" + emailExpString + '>'; - //QRegExp emailExp("^(|" + emailExpString + '|' + namedEmailExpString + ")$"); - QRegExp emailExp("^(|" + emailExpString + ")$"); - QRegExpValidator emailValidator(emailExp, this); + TQString emailExpString = "[\\w-\\.]+@[\\w-\\.]+\\.[\\w]+"; + //TQString namedEmailExpString = "[.]*[ \\t]+<" + emailExpString + '>'; + //TQRegExp emailExp("^(|" + emailExpString + '|' + namedEmailExpString + ")$"); + TQRegExp emailExp("^(|" + emailExpString + ")$"); + TQRegExpValidator emailValidator(emailExp, this); disableBar(); - QString email = KInputDialog::getText( + TQString email = KInputDialog::getText( i18n("Email Address"), "<p><b>" + i18n("Please provide your email address.") + "</b></p>" + "<p>" + i18n("It will only be used to contact you back if more information is needed about your comments, ask you how to reproduce the bugs you report, send bug corrections for you to test, etc.") + "</p>" + "<p>" + i18n("The email address is optional. If you do not provide any, your comments will be sent anonymously.") + "</p>", - currentEmailAddress, &ok, kapp->activeWindow(), /*name=*/(const char*)0, &emailValidator); + currentEmailAddress, &ok, TQT_TQWIDGET(kapp->activeWindow()), /*name=*/(const char*)0, &emailValidator); enableBar(); if (ok) @@ -566,13 +566,13 @@ void LikeBack::askEmailAddress() } // FIXME: Should be moved to KAboutData? Cigogne will also need it. -bool LikeBack::isDevelopmentVersion(const QString &version) +bool LikeBack::isDevelopmentVersion(const TQString &version) { - return version.find("alpha", /*index=*/0, /*caseSensitive=*/false) != -1 || - version.find("beta", /*index=*/0, /*caseSensitive=*/false) != -1 || - version.find("rc", /*index=*/0, /*caseSensitive=*/false) != -1 || - version.find("svn", /*index=*/0, /*caseSensitive=*/false) != -1 || - version.find("cvs", /*index=*/0, /*caseSensitive=*/false) != -1; + return version.tqfind("alpha", /*index=*/0, /*caseSensitive=*/false) != -1 || + version.tqfind("beta", /*index=*/0, /*caseSensitive=*/false) != -1 || + version.tqfind("rc", /*index=*/0, /*caseSensitive=*/false) != -1 || + version.tqfind("svn", /*index=*/0, /*caseSensitive=*/false) != -1 || + version.tqfind("cvs", /*index=*/0, /*caseSensitive=*/false) != -1; } /** @@ -583,8 +583,8 @@ bool LikeBack::isDevelopmentVersion(const QString &version) if (m_process) return; m_process = new KProcess(); - *m_process << QString::fromLatin1("kcmshell") << QString::fromLatin1("kcm_useraccount"); - connect( m_process, SIGNAL(processExited(KProcess*)), SLOT(fetchUserEmail()) ); + *m_process << TQString::tqfromLatin1("kcmshell") << TQString::tqfromLatin1("kcm_useraccount"); + connect( m_process, TQT_SIGNAL(processExited(KProcess*)), TQT_SLOT(fetchUserEmail()) ); if (!m_process->start()) { kdDebug() << "Couldn't start kcmshell.." << endl; delete m_process; @@ -604,23 +604,23 @@ void LikeBack::fetchUserEmail() // m_configureEmail->setEnabled(true); // ### KDE4: why oh why is KEmailSettings in kio? - KConfig emailConf( QString::fromLatin1("emaildefaults") ); + KConfig emailConf( TQString::tqfromLatin1("emaildefaults") ); // find out the default profile - emailConf.setGroup(QString::fromLatin1("Defaults")); - QString profile = QString::fromLatin1("PROFILE_"); - profile += emailConf.readEntry(QString::fromLatin1("Profile"), QString::fromLatin1("Default")); + emailConf.setGroup(TQString::tqfromLatin1("Defaults")); + TQString profile = TQString::tqfromLatin1("PROFILE_"); + profile += emailConf.readEntry(TQString::tqfromLatin1("Profile"), TQString::tqfromLatin1("Default")); emailConf.setGroup(profile); - QString fromaddr = emailConf.readEntry(QString::fromLatin1("EmailAddress")); + TQString fromaddr = emailConf.readEntry(TQString::tqfromLatin1("EmailAddress")); if (fromaddr.isEmpty()) { struct passwd *p; p = getpwuid(getuid()); - d->fetchedEmail = QString::fromLatin1(p->pw_name); + d->fetchedEmail = TQString::tqfromLatin1(p->pw_name); } else { - QString name = emailConf.readEntry(QString::fromLatin1("FullName")); + TQString name = emailConf.readEntry(TQString::tqfromLatin1("FullName")); if (!name.isEmpty()) - d->fetchedEmail = /*name + QString::fromLatin1(" <") +*/ fromaddr /*+ QString::fromLatin1(">")*/; + d->fetchedEmail = /*name + TQString::tqfromLatin1(" <") +*/ fromaddr /*+ TQString::tqfromLatin1(">")*/; } // m_from->setText( fromaddr ); } @@ -629,9 +629,9 @@ void LikeBack::fetchUserEmail() /********** class LikeBackDialog: **********/ /*******************************************/ -LikeBackDialog::LikeBackDialog(LikeBack::Button reason, const QString &initialComment, const QString &windowPath, const QString &context, LikeBack *likeBack) +LikeBackDialog::LikeBackDialog(LikeBack::Button reason, const TQString &initialComment, const TQString &windowPath, const TQString &context, LikeBack *likeBack) : KDialogBase(KDialogBase::Swallow, i18n("Send a Comment to Developers"), KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Default, - KDialogBase::Ok, kapp->activeWindow(), /*name=*/"_likeback_feedback_window_", /*modal=*/true, /*separator=*/true) + KDialogBase::Ok, TQT_TQWIDGET(kapp->activeWindow()), /*name=*/"_likeback_feedback_window_", /*modal=*/true, /*separator=*/true) , m_likeBack(likeBack) , m_windowPath(windowPath) , m_context(context) @@ -651,57 +651,57 @@ LikeBackDialog::LikeBackDialog(LikeBack::Button reason, const QString &initialCo if (m_windowPath.isEmpty()) m_windowPath = LikeBack::activeWindowPath(); - QWidget *page = new QWidget(this); - QVBoxLayout *pageLayout = new QVBoxLayout(page, /*margin=*/0, spacingHint()); + TQWidget *page = new TQWidget(this); + TQVBoxLayout *pageLayout = new TQVBoxLayout(page, /*margin=*/0, spacingHint()); // The introduction message: - QLabel *introduction = new QLabel(introductionText(), page); + TQLabel *introduction = new TQLabel(introductionText(), page); pageLayout->addWidget(introduction); // The comment group: - m_group = new QButtonGroup(0);//i18n("Send Application Developers a Comment About:"), page); - QVGroupBox *box = new QVGroupBox(i18n("Send Application Developers a Comment About:"), page); + m_group = new TQButtonGroup(0);//i18n("Send Application Developers a Comment About:"), page); + TQVGroupBox *box = new TQVGroupBox(i18n("Send Application Developers a Comment About:"), page); pageLayout->addWidget(box); // The radio buttons: - QWidget *buttons = new QWidget(box); - QGridLayout *buttonsGrid = new QGridLayout(buttons, /*nbRows=*/4, /*nbColumns=*/2, /*margin=*/0, spacingHint()); + TQWidget *buttons = new TQWidget(box); + TQGridLayout *buttonsGrid = new TQGridLayout(buttons, /*nbRows=*/4, /*nbColumns=*/2, /*margin=*/0, spacingHint()); if (m_likeBack->buttons() & LikeBack::Like) { - QPixmap likePixmap = kapp->iconLoader()->loadIcon("likeback_like", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true); - QLabel *likeIcon = new QLabel(buttons); + TQPixmap likePixmap = kapp->iconLoader()->loadIcon("likeback_like", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true); + TQLabel *likeIcon = new TQLabel(buttons); likeIcon->setPixmap(likePixmap); - likeIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - QRadioButton *likeButton = new QRadioButton(i18n("Something you &like"), buttons); + likeIcon->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); + TQRadioButton *likeButton = new TQRadioButton(i18n("Something you &like"), buttons); buttonsGrid->addWidget(likeIcon, /*row=*/0, /*column=*/0); buttonsGrid->addWidget(likeButton, /*row=*/0, /*column=*/1); m_group->insert(likeButton, LikeBack::Like); } if (m_likeBack->buttons() & LikeBack::Dislike) { - QPixmap dislikePixmap = kapp->iconLoader()->loadIcon("likeback_dislike", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true); - QLabel *dislikeIcon = new QLabel(buttons); + TQPixmap dislikePixmap = kapp->iconLoader()->loadIcon("likeback_dislike", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true); + TQLabel *dislikeIcon = new TQLabel(buttons); dislikeIcon->setPixmap(dislikePixmap); - dislikeIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - QRadioButton *dislikeButton = new QRadioButton(i18n("Something you &dislike"), buttons); + dislikeIcon->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); + TQRadioButton *dislikeButton = new TQRadioButton(i18n("Something you &dislike"), buttons); buttonsGrid->addWidget(dislikeIcon, /*row=*/1, /*column=*/0); buttonsGrid->addWidget(dislikeButton, /*row=*/1, /*column=*/1); m_group->insert(dislikeButton, LikeBack::Dislike); } if (m_likeBack->buttons() & LikeBack::Bug) { - QPixmap bugPixmap = kapp->iconLoader()->loadIcon("likeback_bug", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true); - QLabel *bugIcon = new QLabel(buttons); + TQPixmap bugPixmap = kapp->iconLoader()->loadIcon("likeback_bug", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true); + TQLabel *bugIcon = new TQLabel(buttons); bugIcon->setPixmap(bugPixmap); - bugIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - QRadioButton *bugButton = new QRadioButton(i18n("An improper &behavior of this application"), buttons); + bugIcon->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); + TQRadioButton *bugButton = new TQRadioButton(i18n("An improper &behavior of this application"), buttons); buttonsGrid->addWidget(bugIcon, /*row=*/2, /*column=*/0); buttonsGrid->addWidget(bugButton, /*row=*/2, /*column=*/1); m_group->insert(bugButton, LikeBack::Bug); } if (m_likeBack->buttons() & LikeBack::Feature) { - QPixmap featurePixmap = kapp->iconLoader()->loadIcon("likeback_feature", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true); - QLabel *featureIcon = new QLabel(buttons); + TQPixmap featurePixmap = kapp->iconLoader()->loadIcon("likeback_feature", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true); + TQLabel *featureIcon = new TQLabel(buttons); featureIcon->setPixmap(featurePixmap); - featureIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - QRadioButton *featureButton = new QRadioButton(i18n("A new &feature you desire"), buttons); + featureIcon->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); + TQRadioButton *featureButton = new TQRadioButton(i18n("A new &feature you desire"), buttons); buttonsGrid->addWidget(featureIcon, /*row=*/3, /*column=*/0); buttonsGrid->addWidget(featureButton, /*row=*/3, /*column=*/1); m_group->insert(featureButton, LikeBack::Feature); @@ -709,27 +709,27 @@ LikeBackDialog::LikeBackDialog(LikeBack::Button reason, const QString &initialCo m_group->setButton(reason); // The comment text box: - m_comment = new QTextEdit(box); + m_comment = new TQTextEdit(box); m_comment->setTabChangesFocus(true); - m_comment->setTextFormat(QTextEdit::PlainText); + m_comment->setTextFormat(TQTextEdit::PlainText); m_comment->setText(initialComment); - m_showButtons = new QCheckBox(i18n("Show comment buttons below &window titlebars"), page); + m_showButtons = new TQCheckBox(i18n("Show comment buttons below &window titlebars"), page); m_showButtons->setChecked(m_likeBack->userWantsToShowBar()); pageLayout->addWidget(m_showButtons); - connect( m_showButtons, SIGNAL(stateChanged(int)), this, SLOT(changeButtonBarVisible()) ); + connect( m_showButtons, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changeButtonBarVisible()) ); setButtonOK(KGuiItem(i18n("&Send Comment"), "mail_send")); enableButtonOK(false); - connect( m_comment, SIGNAL(textChanged()), this, SLOT(commentChanged()) ); + connect( m_comment, TQT_SIGNAL(textChanged()), this, TQT_SLOT(commentChanged()) ); setButtonGuiItem(Default, KGuiItem(i18n("&Email Address..."), "mail_generic")); - resize(QSize(kapp->desktop()->width() * 1 / 2, kapp->desktop()->height() * 3 / 5).expandedTo(sizeHint())); + resize(TQSize(kapp->desktop()->width() * 1 / 2, kapp->desktop()->height() * 3 / 5).expandedTo(tqsizeHint())); - QAction *sendShortcut = new QAction(this); - sendShortcut->setAccel(QString("Ctrl+Return")); - connect( sendShortcut, SIGNAL(activated()), actionButton(Ok), SLOT(animateClick()) ); + TQAction *sendShortcut = new TQAction(this); + sendShortcut->setAccel(TQString("Ctrl+Return")); + connect( sendShortcut, TQT_SIGNAL(activated()), actionButton(Ok), TQT_SLOT(animateClick()) ); setMainWidget(page); } @@ -738,16 +738,16 @@ LikeBackDialog::~LikeBackDialog() { } -QString LikeBackDialog::introductionText() +TQString LikeBackDialog::introductionText() { - QString text = "<p>" + i18n("Please provide a brief description of your opinion of %1.").arg(m_likeBack->aboutData()->programName()) + " "; + TQString text = "<p>" + i18n("Please provide a brief description of your opinion of %1.").tqarg(m_likeBack->aboutData()->programName()) + " "; - QString languagesMessage = ""; + TQString languagesMessage = ""; if (!m_likeBack->acceptedLocales().isEmpty() && !m_likeBack->acceptedLanguagesMessage().isEmpty()) { languagesMessage = m_likeBack->acceptedLanguagesMessage(); - QStringList locales = m_likeBack->acceptedLocales(); - for (QStringList::Iterator it = locales.begin(); it != locales.end(); ++it) { - QString locale = *it; + TQStringList locales = m_likeBack->acceptedLocales(); + for (TQStringList::Iterator it = locales.begin(); it != locales.end(); ++it) { + TQString locale = *it; if (KGlobal::locale()->language().startsWith(locale)) languagesMessage = ""; } @@ -760,7 +760,7 @@ QString LikeBackDialog::introductionText() // TODO: Replace the URL with a localized one: text += languagesMessage + " " + i18n("You may be able to use an <a href=\"%1\">online translation tool</a>.") - .arg("http://www.google.com/language_tools?hl=" + KGlobal::locale()->language()) + .tqarg("http://www.google.com/language_tools?hl=" + KGlobal::locale()->language()) + " "; // If both "I Like" and "I Dislike" buttons are shown and one is clicked: @@ -796,17 +796,17 @@ void LikeBackDialog::changeButtonBarVisible() void LikeBackDialog::commentChanged() { - QPushButton *sendButton = actionButton(Ok); + TQPushButton *sendButton = actionButton(Ok); sendButton->setEnabled(!m_comment->text().isEmpty()); } void LikeBackDialog::send() { - QString emailAddress = m_likeBack->emailAddress(); + TQString emailAddress = m_likeBack->emailAddress(); int reason = m_group->selectedId(); - QString type = (reason == LikeBack::Like ? "Like" : (reason == LikeBack::Dislike ? "Dislike" : (reason == LikeBack::Bug ? "Bug" : "Feature"))); - QString data = + TQString type = (reason == LikeBack::Like ? "Like" : (reason == LikeBack::Dislike ? "Dislike" : (reason == LikeBack::Bug ? "Bug" : "Feature"))); + TQString data = "protocol=" + KURL::encode_string("1.0") + '&' + "type=" + KURL::encode_string(type) + '&' + "version=" + KURL::encode_string(m_likeBack->aboutData()->version()) + '&' + @@ -815,13 +815,13 @@ void LikeBackDialog::send() "context=" + KURL::encode_string(m_context) + '&' + "comment=" + KURL::encode_string(m_comment->text()) + '&' + "email=" + KURL::encode_string(emailAddress); - QHttp *http = new QHttp(m_likeBack->hostName(), m_likeBack->hostPort()); + TQHttp *http = new TQHttp(m_likeBack->hostName(), m_likeBack->hostPort()); std::cout << "http://" << m_likeBack->hostName() << ":" << m_likeBack->hostPort() << m_likeBack->remotePath() << std::endl; std::cout << data << std::endl; - connect( http, SIGNAL(requestFinished(int, bool)), this, SLOT(requestFinished(int, bool)) ); + connect( http, TQT_SIGNAL(requestFinished(int, bool)), this, TQT_SLOT(requestFinished(int, bool)) ); - QHttpRequestHeader header("POST", m_likeBack->remotePath()); + TQHttpRequestHeader header("POST", m_likeBack->remotePath()); header.setValue("Host", m_likeBack->hostName()); header.setValue("Content-Type", "application/x-www-form-urlencoded"); http->setHost(m_likeBack->hostName()); |