diff options
Diffstat (limited to 'kradio3/plugins/gui-standard-display/radioview.cpp')
-rw-r--r-- | kradio3/plugins/gui-standard-display/radioview.cpp | 228 |
1 files changed, 114 insertions, 114 deletions
diff --git a/kradio3/plugins/gui-standard-display/radioview.cpp b/kradio3/plugins/gui-standard-display/radioview.cpp index e1fd8e4..0a8e31f 100644 --- a/kradio3/plugins/gui-standard-display/radioview.cpp +++ b/kradio3/plugins/gui-standard-display/radioview.cpp @@ -15,14 +15,14 @@ * * ***************************************************************************/ -#include <qwidgetstack.h> -#include <qlayout.h> -#include <qtoolbutton.h> -#include <qslider.h> -#include <qfile.h> -#include <qtooltip.h> -#include <qcheckbox.h> -#include <qimage.h> +#include <tqwidgetstack.h> +#include <tqlayout.h> +#include <tqtoolbutton.h> +#include <tqslider.h> +#include <tqfile.h> +#include <tqtooltip.h> +#include <tqcheckbox.h> +#include <tqimage.h> #include <kcombobox.h> #include <kiconloader.h> @@ -67,8 +67,8 @@ bool RadioView::ElementCfg::operator == (const ElementCfg &x) const /////////////////////////////////////////////////////////////////////// -RadioView::RadioView(const QString &name) - : QWidget(NULL, name.ascii()), +RadioView::RadioView(const TQString &name) + : TQWidget(NULL, name.ascii()), WidgetPluginBase(name, i18n("Radio Display")), enableToolbarFlag(false), btnPower(NULL), @@ -86,34 +86,34 @@ RadioView::RadioView(const QString &name) for (int i = 0; i < clsClassMAX; ++i) maxUsability[i] = 0; - QBoxLayout *l01 = new QBoxLayout(this, QBoxLayout::LeftToRight, /*spacing=*/3); + TQBoxLayout *l01 = new TQBoxLayout(this, TQBoxLayout::LeftToRight, /*spacing=*/3); l01->setMargin(1); l01->setSpacing(2); - widgetStacks[clsRadioSound] = new QWidgetStack (this); + widgetStacks[clsRadioSound] = new TQWidgetStack (this); l01->addWidget(widgetStacks[clsRadioSound]); - QBoxLayout *l02 = new QBoxLayout(l01, QBoxLayout::Down); - QBoxLayout *l03 = new QBoxLayout(l02, QBoxLayout::LeftToRight); + TQBoxLayout *l02 = new TQBoxLayout(l01, TQBoxLayout::Down); + TQBoxLayout *l03 = new TQBoxLayout(l02, TQBoxLayout::LeftToRight); comboStations = new KComboBox (this); l02->addWidget (comboStations); - QBoxLayout *l05 = new QBoxLayout(l03, QBoxLayout::Down); - widgetStacks[clsRadioDisplay] = new QWidgetStack (this); + TQBoxLayout *l05 = new TQBoxLayout(l03, TQBoxLayout::Down); + widgetStacks[clsRadioDisplay] = new TQWidgetStack (this); l05->addWidget(widgetStacks[clsRadioDisplay]); - widgetStacks[clsRadioSeek] = new QWidgetStack (this); + widgetStacks[clsRadioSeek] = new TQWidgetStack (this); l05->addWidget(widgetStacks[clsRadioSeek]); - QGridLayout *l04 = new QGridLayout (l03, /*rows=*/ 3, /*cols=*/ 2); - btnPower = new QToolButton(this); + TQGridLayout *l04 = new TQGridLayout (l03, /*rows=*/ 3, /*cols=*/ 2); + btnPower = new TQToolButton(this); btnPower->setToggleButton(true); - btnRecording = new QToolButton(this); + btnRecording = new TQToolButton(this); btnRecording->setToggleButton(true); - btnConfigure = new QToolButton(this); + btnConfigure = new TQToolButton(this); btnConfigure->setToggleButton(true); - btnQuit = new QToolButton(this); - btnSnooze = new QToolButton(this); + btnQuit = new TQToolButton(this); + btnSnooze = new TQToolButton(this); btnSnooze->setToggleButton(true); - btnPlugins = new QToolButton(this); + btnPlugins = new TQToolButton(this); btnPlugins->setPopupDelay(1); l04->addWidget (btnPower, 0, 0); l04->addWidget (btnRecording, 0, 1); @@ -125,24 +125,24 @@ RadioView::RadioView(const QString &name) m_pauseMenu = new KPopupMenu(btnPower); m_pauseMenu->insertItem(SmallIcon("kradio_pause"), i18n("Pause KRadio"), - this, SLOT(slotPause())); + this, TQT_SLOT(slotPause())); btnPower->setPopupDelay(200); m_RecordingMenu = new KPopupMenu(btnRecording); m_RecordingMenu->insertItem(SmallIcon("kradio_record"), i18n("Start Recording"), POPUP_ID_START_RECORDING_DEFAULT); - QObject::connect(m_RecordingMenu, SIGNAL(activated(int)), - this, SLOT(slotRecordingMenu(int))); + TQObject::connect(m_RecordingMenu, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotRecordingMenu(int))); btnRecording->setPopup(m_RecordingMenu); m_SnoozeMenu = new KPopupMenu(btnSnooze); - m_SnoozeMenu->insertItem(i18n("5 min"), this, SLOT(slotSnooze(int)), 0, 5); - m_SnoozeMenu->insertItem(i18n("10 min"), this, SLOT(slotSnooze(int)), 0, 10); - m_SnoozeMenu->insertItem(i18n("15 min"), this, SLOT(slotSnooze(int)), 0, 15); - m_SnoozeMenu->insertItem(i18n("30 min"), this, SLOT(slotSnooze(int)), 0, 30); - m_SnoozeMenu->insertItem(i18n("60 min"), this, SLOT(slotSnooze(int)), 0, 60); + m_SnoozeMenu->insertItem(i18n("5 min"), this, TQT_SLOT(slotSnooze(int)), 0, 5); + m_SnoozeMenu->insertItem(i18n("10 min"), this, TQT_SLOT(slotSnooze(int)), 0, 10); + m_SnoozeMenu->insertItem(i18n("15 min"), this, TQT_SLOT(slotSnooze(int)), 0, 15); + m_SnoozeMenu->insertItem(i18n("30 min"), this, TQT_SLOT(slotSnooze(int)), 0, 30); + m_SnoozeMenu->insertItem(i18n("60 min"), this, TQT_SLOT(slotSnooze(int)), 0, 60); btnSnooze->setPopup(m_SnoozeMenu); btnSnooze->setPopupDelay(200); @@ -162,42 +162,42 @@ RadioView::RadioView(const QString &name) btnSnooze->setIconSet(SmallIconSet("kradio_zzz")); btnPlugins->setIconSet(SmallIconSet("kradio_plugins")); - widgetStacks[clsRadioSound] ->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred)); - widgetStacks[clsRadioDisplay]->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred)); - widgetStacks[clsRadioSeek] ->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); - comboStations ->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); + widgetStacks[clsRadioSound] ->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Preferred)); + widgetStacks[clsRadioDisplay]->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred)); + widgetStacks[clsRadioSeek] ->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed)); + comboStations ->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed)); comboStations->setMinimumHeight(28); - QObject::connect(btnPower, SIGNAL(toggled(bool)), - this, SLOT(slotPower(bool))); - QObject::connect(btnQuit, SIGNAL(clicked()), - kapp, SLOT(quit())); - QObject::connect(btnConfigure, SIGNAL(toggled(bool)), - this, SLOT(slotConfigure(bool))); - QObject::connect(btnRecording, SIGNAL(clicked()), - this, SLOT(slotRecord())); - QObject::connect(btnSnooze, SIGNAL(toggled(bool)), - this, SLOT(slotSnooze(bool))); - QObject::connect(comboStations, SIGNAL(activated(int)), - this, SLOT(slotComboStationSelected(int))); - QObject::connect(btnPlugins, SIGNAL(clicked()), - this, SLOT(slotBtnPluginsClicked())); + TQObject::connect(btnPower, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(slotPower(bool))); + TQObject::connect(btnQuit, TQT_SIGNAL(clicked()), + kapp, TQT_SLOT(quit())); + TQObject::connect(btnConfigure, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(slotConfigure(bool))); + TQObject::connect(btnRecording, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotRecord())); + TQObject::connect(btnSnooze, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(slotSnooze(bool))); + TQObject::connect(comboStations, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotComboStationSelected(int))); + TQObject::connect(btnPlugins, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotBtnPluginsClicked())); // tooltips - QToolTip::add(btnConfigure, i18n("Configure KRadio")); - QToolTip::add(btnPower, i18n("Power On/Off")); - QToolTip::add(btnQuit, i18n("Quit KRadio Application")); - QToolTip::add(btnRecording, i18n("Start/Stop Recording")); - QToolTip::add(btnSnooze, i18n("Start/Stop Sleep Countdown")); - QToolTip::add(btnPlugins, i18n("Show/Hide Plugins")); - QToolTip::add(comboStations, i18n("Select a Radio Station")); + TQToolTip::add(btnConfigure, i18n("Configure KRadio")); + TQToolTip::add(btnPower, i18n("Power On/Off")); + TQToolTip::add(btnQuit, i18n("Quit KRadio Application")); + TQToolTip::add(btnRecording, i18n("Start/Stop Recording")); + TQToolTip::add(btnSnooze, i18n("Start/Stop Sleep Countdown")); + TQToolTip::add(btnPlugins, i18n("Show/Hide Plugins")); + TQToolTip::add(comboStations, i18n("Select a Radio Station")); // testing - addElement (new RadioViewFrequencyRadio (this, QString::null)); - addElement (new RadioViewVolume(this, QString::null)); - addElement (new RadioViewFrequencySeeker(this, QString::null)); + addElement (new RadioViewFrequencyRadio (this, TQString())); + addElement (new RadioViewVolume(this, TQString())); + addElement (new RadioViewFrequencySeeker(this, TQString())); autoSetCaption(); } @@ -205,7 +205,7 @@ RadioView::RadioView(const QString &name) RadioView::~RadioView () { - QPtrListIterator<QObject> it(configPages); + TQPtrListIterator<TQObject> it(configPages); while (configPages.first()) { delete configPages.first(); } @@ -223,9 +223,9 @@ bool RadioView::addElement (RadioViewElement *e) return false; - e->reparent(this, QPoint(0, 0), true); - QObject::connect(e, SIGNAL(destroyed(QObject*)), - this, SLOT(removeElement(QObject*))); + e->reparent(this, TQPoint(0, 0), true); + TQObject::connect(e, TQT_SIGNAL(destroyed(TQObject*)), + this, TQT_SLOT(removeElement(TQObject*))); elements.append(e); widgetStacks[cls]->addWidget(e); @@ -236,9 +236,9 @@ bool RadioView::addElement (RadioViewElement *e) e->connectI(getSoundStreamServer()); - QPtrListIterator<QObject> it(configPages); + TQPtrListIterator<TQObject> it(configPages); for (; it.current(); ++it) { - addConfigurationTabFor(e, (QTabWidget *)it.current()); + addConfigurationTabFor(e, (TQTabWidget *)it.current()); } selectTopWidgets(); @@ -247,14 +247,14 @@ bool RadioView::addElement (RadioViewElement *e) } -bool RadioView::removeElement (QObject *_e) +bool RadioView::removeElement (TQObject *_e) { RadioViewElement *e = dynamic_cast<RadioViewElement*>(_e); if (!e) return false; ElementCfgListIterator it; - while ((it = elementConfigPages.find(e)) != elementConfigPages.end()) { + while ((it = elementConfigPages.tqfind(e)) != elementConfigPages.end()) { delete (*it).cfg; // it must not used behind, the element will be deleted automatically // by slotElementConfigPageDeleted @@ -266,8 +266,8 @@ bool RadioView::removeElement (QObject *_e) e->disconnectI(currentDevice); RadioViewClass cls = e->getClass(); - QObject::disconnect(e, SIGNAL(destroyed(QObject*)), - this, SLOT(removeElement(QObject*))); + TQObject::disconnect(e, TQT_SIGNAL(destroyed(TQObject*)), + this, TQT_SLOT(removeElement(TQObject*))); widgetStacks[cls]->removeWidget(e); elements.remove(e); @@ -333,9 +333,9 @@ bool RadioView::noticeStationsChanged(const StationList &sl) for (RawStationList::Iterator i(list); i.current(); ++i) { RadioStation *stn = i.current(); - QString icon = stn->iconName(); - if (icon.length() && QFile(icon).exists()) { - QImage img(icon); + TQString icon = stn->iconName(); + if (icon.length() && TQFile(icon).exists()) { + TQImage img(icon); int h = img.height(); float f = (float)(comboStations->height() - 4) / (h ? (float)h : 1.0); comboStations->insertItem(img.smoothScale((int)(img.width()*f), (int)(h * f)), stn->name()); @@ -432,14 +432,14 @@ bool RadioView::startRecordingWithFormat( const SoundFormat &/*proposed_format*/, SoundFormat &/*real_format*/) { - if (!id.isValid() || id != queryCurrentSoundStreamID() || m_StreamID2MenuID.contains(id)) + if (!id.isValid() || id != queryCurrentSoundStreamID() || m_StreamID2MenuID.tqcontains(id)) return false; - QString descr; + TQString descr; querySoundStreamDescription(id, descr); int menu_id = m_NextRecordingMenuID++; m_RecordingMenu->insertItem(SmallIcon("kradio_record"), - i18n("Stop Recording of %1").arg(descr), + i18n("Stop Recording of %1").tqarg(descr), menu_id); m_MenuID2StreamID.insert(menu_id, id); m_StreamID2MenuID.insert(id, menu_id); @@ -454,7 +454,7 @@ bool RadioView::startRecordingWithFormat( bool RadioView::stopRecording (SoundStreamID id) { - if (!id.isValid() || !m_StreamID2MenuID.contains(id)) + if (!id.isValid() || !m_StreamID2MenuID.tqcontains(id)) return false; int menu_id = m_StreamID2MenuID[id]; @@ -472,12 +472,12 @@ bool RadioView::stopRecording (SoundStreamID id) bool RadioView::noticeSoundStreamChanged(SoundStreamID id) { - if (m_StreamID2MenuID.contains(id)) { - QString descr; + if (m_StreamID2MenuID.tqcontains(id)) { + TQString descr; querySoundStreamDescription(id, descr); m_RecordingMenu->changeItem(m_StreamID2MenuID[id], SmallIcon("kradio_record"), - i18n("Stop Recording of %1").arg(descr)); + i18n("Stop Recording of %1").tqarg(descr)); return true; } return false; @@ -486,7 +486,7 @@ bool RadioView::noticeSoundStreamChanged(SoundStreamID id) // ITimeControl -bool RadioView::noticeCountdownStarted(const QDateTime &) +bool RadioView::noticeCountdownStarted(const TQDateTime &) { btnSnooze->setOn(true); return true; @@ -508,7 +508,7 @@ bool RadioView::noticeCountdownZero() void RadioView::saveState (KConfig *config) const { - config->setGroup(QString("radioview-") + name()); + config->setGroup(TQString("radioview-") + name()); config->writeEntry("enableToobarFlag", enableToolbarFlag); WidgetPluginBase::saveState(config); @@ -522,7 +522,7 @@ void RadioView::saveState (KConfig *config) const void RadioView::restoreState (KConfig *config) { - config->setGroup(QString("radioview-") + name()); + config->setGroup(TQString("radioview-") + name()); enableToolbarFlag = config->readBoolEntry("enableToolbarFlag", false); WidgetPluginBase::restoreState(config); @@ -544,9 +544,9 @@ ConfigPageInfo RadioView::createConfigurationPage() addConfigurationTabFor(i.current(), c); } - configPages.append(c); - QObject::connect(c, SIGNAL(destroyed(QObject *)), - this, SLOT(slotConfigPageDeleted(QObject *))); + configPages.append(TQT_TQOBJECT(c)); + TQObject::connect(c, TQT_SIGNAL(destroyed(TQObject *)), + this, TQT_SLOT(slotConfigPageDeleted(TQObject *))); return ConfigPageInfo( c, @@ -557,7 +557,7 @@ ConfigPageInfo RadioView::createConfigurationPage() } -void RadioView::addConfigurationTabFor(RadioViewElement *e, QTabWidget *c) +void RadioView::addConfigurationTabFor(RadioViewElement *e, TQTabWidget *c) { if (!e || !c) return; @@ -567,34 +567,34 @@ void RadioView::addConfigurationTabFor(RadioViewElement *e, QTabWidget *c) if (inf.page) { if (inf.iconName.length()) { - c->addTab(inf.page, QIconSet(SmallIconSet(inf.iconName)), inf.itemName); + c->addTab(inf.page, TQIconSet(SmallIconSet(inf.iconName)), inf.itemName); } else { c->addTab(inf.page, inf.itemName); } - elementConfigPages.push_back(ElementCfg(e, inf.page)); - QObject::connect(inf.page, SIGNAL(destroyed(QObject *)), - this, SLOT(slotElementConfigPageDeleted(QObject *))); + elementConfigPages.push_back(ElementCfg(e, TQT_TQOBJECT(inf.page))); + TQObject::connect(inf.page, TQT_SIGNAL(destroyed(TQObject *)), + this, TQT_SLOT(slotElementConfigPageDeleted(TQObject *))); } } -void RadioView::addCommonConfigurationTab(QTabWidget *c) +void RadioView::addCommonConfigurationTab(TQTabWidget *c) { if (!c) return; - QFrame *f = new QFrame(c); - QVBoxLayout *l = new QVBoxLayout(f, 10); + TQFrame *f = new TQFrame(c); + TQVBoxLayout *l = new TQVBoxLayout(f, 10); - l->addWidget(new QCheckBox(i18n("set Toolbar-Flag for Display"), f)); - l->addItem(new QSpacerItem(1, 3, QSizePolicy::Fixed, QSizePolicy::Expanding)); + l->addWidget(new TQCheckBox(i18n("set Toolbar-Flag for Display"), f)); + l->addItem(new TQSpacerItem(1, 3, TQSizePolicy::Fixed, TQSizePolicy::Expanding)); c->addTab(f, i18n("Common")); - elementConfigPages.push_back(ElementCfg(f)); - QObject::connect(f, SIGNAL(destroyed(QObject *)), - this, SLOT(slotElementConfigPageDeleted(QObject *))); + elementConfigPages.push_back(ElementCfg(TQT_TQOBJECT(f))); + TQObject::connect(f, TQT_SIGNAL(destroyed(TQObject *)), + this, TQT_SLOT(slotElementConfigPageDeleted(TQObject *))); } @@ -632,7 +632,7 @@ void RadioView::noticeWidgetPluginShown(WidgetPluginBase *p, bool shown) btnConfigure->blockSignals(false); } - if (m_Plugins2MenuID.contains(p)) { + if (m_Plugins2MenuID.tqcontains(p)) { m_manager->updateWidgetPluginMenuItem(p, m_PluginMenu, m_Plugins2MenuID, shown); } } @@ -666,7 +666,7 @@ void RadioView::slotPause() void RadioView::slotConfigure(bool b) { - QWidget *w = m_manager ? m_manager->getConfigDialog() : NULL; + TQWidget *w = m_manager ? m_manager->getConfigDialog() : NULL; if (w) b ? w->show() : w->hide(); if (!w) btnConfigure->setOn(false); @@ -682,7 +682,7 @@ void RadioView::slotRecord() SoundFormat sf; queryIsRecordingRunning(id, r, sf); - if (!r && b /*!m_StreamID2MenuID.contains(id)*/) { + if (!r && b /*!m_StreamID2MenuID.tqcontains(id)*/) { if (!queryIsPowerOn()) sendPowerOn(); sendStartRecording(id); @@ -704,7 +704,7 @@ void RadioView::slotRecordingMenu(int i) sendPowerOn(); sendStartRecording(id); } - } else if (m_MenuID2StreamID.contains(i)) { + } else if (m_MenuID2StreamID.tqcontains(i)) { sendStopRecording(m_MenuID2StreamID[i]); } } @@ -740,16 +740,16 @@ void RadioView::slotBtnPluginsClicked() btnPlugins->openPopup(); } -void RadioView::slotConfigPageDeleted(QObject *o) +void RadioView::slotConfigPageDeleted(TQObject *o) { configPages.remove(o); } -void RadioView::slotElementConfigPageDeleted(QObject *o) +void RadioView::slotElementConfigPageDeleted(TQObject *o) { ElementCfgListIterator it; - while ((it = elementConfigPages.find(o)) != elementConfigPages.end()) { + while ((it = elementConfigPages.tqfind(o)) != elementConfigPages.end()) { elementConfigPages.remove(it); } } @@ -762,14 +762,14 @@ void RadioView::show() else KWin::setType(winId(), NET::Normal); WidgetPluginBase::pShow(); - QWidget::show(); + TQWidget::show(); } void RadioView::showOnOrgDesktop() { WidgetPluginBase::pShowOnOrgDesktop(); - //QWidget::show(); + //TQWidget::show(); } @@ -777,20 +777,20 @@ void RadioView::showOnOrgDesktop() void RadioView::hide() { WidgetPluginBase::pHide(); - QWidget::hide(); + TQWidget::hide(); } -void RadioView::showEvent(QShowEvent *e) +void RadioView::showEvent(TQShowEvent *e) { - QWidget::showEvent(e); + TQWidget::showEvent(e); WidgetPluginBase::pShowEvent(e); } -void RadioView::hideEvent(QHideEvent *e) +void RadioView::hideEvent(TQHideEvent *e) { - QWidget::hideEvent(e); + TQWidget::hideEvent(e); WidgetPluginBase::pHideEvent(e); } @@ -798,7 +798,7 @@ void RadioView::hideEvent(QHideEvent *e) void RadioView::autoSetCaption() { const RadioStation &rs = queryCurrentStation(); - setCaption((queryIsPowerOn() && rs.isValid()) ? rs.longName() : QString("KRadio")); + setCaption((queryIsPowerOn() && rs.isValid()) ? rs.longName() : TQString("KRadio")); } |