diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:43:15 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:43:15 +0000 |
commit | e654398e46e37abf457b2b1122ab898d2c51c49f (patch) | |
tree | d39ee6440f3c3663c3ead84a2d4cc2d034667e96 /noatun/modules/infrared/irprefs.cpp | |
parent | e4f29b18e19394b9352f52a6c0d0d0e3932cf511 (diff) | |
download | tdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.tar.gz tdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1157644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'noatun/modules/infrared/irprefs.cpp')
-rw-r--r-- | noatun/modules/infrared/irprefs.cpp | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/noatun/modules/infrared/irprefs.cpp b/noatun/modules/infrared/irprefs.cpp index 409fa94e..548fd27d 100644 --- a/noatun/modules/infrared/irprefs.cpp +++ b/noatun/modules/infrared/irprefs.cpp @@ -1,7 +1,7 @@ -#include <qlayout.h> -#include <qlabel.h> -#include <qcheckbox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqcheckbox.h> #include <noatun/app.h> #include <kdialog.h> @@ -17,17 +17,17 @@ class CommandItem : public QListViewItem { public: - CommandItem(QListViewItem *remote, const QString &name, + CommandItem(TQListViewItem *remote, const TQString &name, IRPrefs::Action action, int interval) - : QListViewItem(remote, name, IRPrefs::actionName(action), - interval ? QString().setNum(interval) : QString::null), + : TQListViewItem(remote, name, IRPrefs::actionName(action), + interval ? TQString().setNum(interval) : TQString::null), m_name(remote->text(0) + "::" + name), m_action(action), m_interval(interval) { } - const QString &name() const { return m_name; } + const TQString &name() const { return m_name; } IRPrefs::Action action() const { return m_action; } int interval() const { return m_interval; } void setAction(IRPrefs::Action action) @@ -37,44 +37,44 @@ public: } void setInterval(int interval) { - setText(2, interval ? QString().setNum(interval) : QString::null); + setText(2, interval ? TQString().setNum(interval) : TQString::null); m_interval = interval; } private: - QString m_name; + TQString m_name; IRPrefs::Action m_action; int m_interval; }; Lirc *IRPrefs::s_lirc = 0; bool IRPrefs::s_configRead = false; -QMap<QString, IRPrefs::Command> IRPrefs::s_commands; +TQMap<TQString, IRPrefs::Command> IRPrefs::s_commands; -IRPrefs::IRPrefs(QObject *parent) +IRPrefs::IRPrefs(TQObject *parent) : CModule(i18n("Infrared Control"), i18n("Configure Infrared Commands"), "remote", parent) { - QGridLayout *layout = new QGridLayout(this, 3, 5, KDialog::marginHint(), KDialog::spacingHint()); + TQGridLayout *layout = new TQGridLayout(this, 3, 5, KDialog::marginHint(), KDialog::spacingHint()); layout->setColStretch(1, 1); - QLabel *label = new QLabel(i18n("Remote control &commands:"), this); + TQLabel *label = new TQLabel(i18n("Remote control &commands:"), this); layout->addMultiCellWidget(label, 0, 0, 0, 4); label->setBuddy(m_commands = new KListView(this)); layout->addMultiCellWidget(m_commands, 1, 1, 0, 4); - label = new QLabel(i18n("&Action:"), this); + label = new TQLabel(i18n("&Action:"), this); layout->addWidget(label, 2, 0); label->setBuddy(m_action = new KComboBox(this)); m_action->setEnabled(false); layout->addWidget(m_action, 2, 1); - m_repeat = new QCheckBox(i18n("&Repeat"), this); + m_repeat = new TQCheckBox(i18n("&Repeat"), this); m_repeat->setEnabled(false); layout->addWidget(m_repeat, 2, 2); - label = new QLabel(i18n("&Interval:"), this); + label = new TQLabel(i18n("&Interval:"), this); layout->addWidget(label, 2, 3); label->setBuddy(m_interval = new KIntSpinBox(this)); @@ -84,19 +84,19 @@ IRPrefs::IRPrefs(QObject *parent) m_interval->setEnabled(false); layout->addWidget(m_interval, 2, 4); - connect(s_lirc, SIGNAL(remotesRead()), SLOT(reopen())); + connect(s_lirc, TQT_SIGNAL(remotesRead()), TQT_SLOT(reopen())); connect(m_commands, - SIGNAL(selectionChanged(QListViewItem *)), - SLOT(slotCommandSelected(QListViewItem *))); + TQT_SIGNAL(selectionChanged(TQListViewItem *)), + TQT_SLOT(slotCommandSelected(TQListViewItem *))); connect(m_action, - SIGNAL(activated(int)), - SLOT(slotActionActivated(int))); + TQT_SIGNAL(activated(int)), + TQT_SLOT(slotActionActivated(int))); connect(m_repeat, - SIGNAL(toggled(bool)), - SLOT(slotRepeatToggled(bool))); + TQT_SIGNAL(toggled(bool)), + TQT_SLOT(slotRepeatToggled(bool))); connect(m_interval, - SIGNAL(valueChanged(int)), - SLOT(slotIntervalChanged(int))); + TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotIntervalChanged(int))); reopen(); } @@ -107,11 +107,11 @@ void IRPrefs::save() KConfigGroupSaver groupSaver(c, "Infrared"); c->writeEntry("CommandCount", s_commands.count()); int i = 1; - for (QMap<QString, Command>::ConstIterator it = s_commands.begin(); it != s_commands.end(); ++it) + for (TQMap<TQString, Command>::ConstIterator it = s_commands.begin(); it != s_commands.end(); ++it) { - c->writePathEntry(QString("Command_%1").arg(i), it.key()); - c->writeEntry(QString("Action_%1").arg(i), (int)((*it).action)); - c->writeEntry(QString("Interval_%1").arg(i), (*it).interval); + c->writePathEntry(TQString("Command_%1").arg(i), it.key()); + c->writeEntry(TQString("Action_%1").arg(i), (int)((*it).action)); + c->writeEntry(TQString("Interval_%1").arg(i), (*it).interval); ++i; } } @@ -120,7 +120,7 @@ void IRPrefs::reopen() { readConfig(); - QStringList remotes = s_lirc->remotes(); + TQStringList remotes = s_lirc->remotes(); m_commands->clear(); while (m_commands->columns()) m_commands->removeColumn(0); if (!remotes.count()) @@ -129,13 +129,13 @@ void IRPrefs::reopen() m_commands->setSorting(-1); if (s_lirc->isConnected()) { - new QListViewItem(m_commands, i18n("You do not have any remote control configured.")); - new QListViewItem(m_commands, i18n("Please make sure lirc is setup correctly.")); + new TQListViewItem(m_commands, i18n("You do not have any remote control configured.")); + new TQListViewItem(m_commands, i18n("Please make sure lirc is setup correctly.")); } else { - new QListViewItem(m_commands, i18n("Connection could not be established.")); - new QListViewItem(m_commands, i18n("Please make sure lirc is setup correctly and lircd is running.")); + new TQListViewItem(m_commands, i18n("Connection could not be established.")); + new TQListViewItem(m_commands, i18n("Please make sure lirc is setup correctly and lircd is running.")); } m_commands->setEnabled(false); return; @@ -145,13 +145,13 @@ void IRPrefs::reopen() m_commands->addColumn(i18n("Action")); m_commands->addColumn(i18n("Interval")); m_commands->setSorting(0); - for (QStringList::ConstIterator it = remotes.begin(); it != remotes.end(); ++it) + for (TQStringList::ConstIterator it = remotes.begin(); it != remotes.end(); ++it) { - QListViewItem *remote = new QListViewItem(m_commands, *it); - const QStringList &buttons = s_lirc->buttons(*it); - for (QStringList::ConstIterator btn = buttons.begin(); btn != buttons.end(); ++btn) + TQListViewItem *remote = new TQListViewItem(m_commands, *it); + const TQStringList &buttons = s_lirc->buttons(*it); + for (TQStringList::ConstIterator btn = buttons.begin(); btn != buttons.end(); ++btn) { - QString key = *it + "::" + *btn; + TQString key = *it + "::" + *btn; if (s_commands.contains(key)) new CommandItem(remote, *btn, s_commands[key].action, s_commands[key].interval); else @@ -163,7 +163,7 @@ void IRPrefs::reopen() m_action->clear(); for (int i = 0; ; ++i) { - QString action = actionName((Action)i); + TQString action = actionName((Action)i); if (action.isNull()) break; if (action.isEmpty()) @@ -175,7 +175,7 @@ void IRPrefs::reopen() } -void IRPrefs::slotCommandSelected(QListViewItem *item) +void IRPrefs::slotCommandSelected(TQListViewItem *item) { CommandItem *cmd = dynamic_cast<CommandItem *>(item); if (cmd) @@ -242,12 +242,12 @@ void IRPrefs::slotIntervalChanged(int value) s_commands[cmd->name()].interval = cmd->interval(); } -const QString IRPrefs::actionName(Action action) +const TQString IRPrefs::actionName(Action action) { switch (action) { case None: - return QString(""); + return TQString(""); case Play: return i18n("Play"); case Stop: @@ -275,7 +275,7 @@ const QString IRPrefs::actionName(Action action) case PreviousSection: return i18n("Previous Section"); } - return QString::null; + return TQString::null; } void IRPrefs::readConfig() @@ -288,14 +288,14 @@ void IRPrefs::readConfig() for (int i = 1; i <= count; ++i) { Command cmd; - cmd.action = (Action)(c->readNumEntry(QString("Action_%1").arg(i))); - cmd.interval = c->readNumEntry(QString("Interval_%1").arg(i)); - s_commands.insert(c->readPathEntry(QString("Command_%1").arg(i)), cmd); + cmd.action = (Action)(c->readNumEntry(TQString("Action_%1").arg(i))); + cmd.interval = c->readNumEntry(TQString("Interval_%1").arg(i)); + s_commands.insert(c->readPathEntry(TQString("Command_%1").arg(i)), cmd); } s_configRead = true; } -IRPrefs::Action IRPrefs::actionFor(const QString &remote, const QString &button, int repeat) +IRPrefs::Action IRPrefs::actionFor(const TQString &remote, const TQString &button, int repeat) { readConfig(); Command cmd = s_commands[remote + "::" + button]; |