diff options
Diffstat (limited to 'kradio3/plugins/gui-quickbar')
-rw-r--r-- | kradio3/plugins/gui-quickbar/buttonflowlayout.cpp | 122 | ||||
-rw-r--r-- | kradio3/plugins/gui-quickbar/buttonflowlayout.h | 36 | ||||
-rw-r--r-- | kradio3/plugins/gui-quickbar/quickbar-configuration.cpp | 4 | ||||
-rw-r--r-- | kradio3/plugins/gui-quickbar/quickbar-configuration.h | 7 | ||||
-rw-r--r-- | kradio3/plugins/gui-quickbar/quickbar.cpp | 112 | ||||
-rw-r--r-- | kradio3/plugins/gui-quickbar/quickbar.h | 49 |
6 files changed, 186 insertions, 144 deletions
diff --git a/kradio3/plugins/gui-quickbar/buttonflowlayout.cpp b/kradio3/plugins/gui-quickbar/buttonflowlayout.cpp index 40d7da4..419fd10 100644 --- a/kradio3/plugins/gui-quickbar/buttonflowlayout.cpp +++ b/kradio3/plugins/gui-quickbar/buttonflowlayout.cpp @@ -1,11 +1,11 @@ /**************************************************************************** -** $Id: buttonflowlayout.cpp 272 2005-05-18 08:12:51Z emw $ +** $Id: buttonflowtqlayout.cpp 272 2005-05-18 08:12:51Z emw $ ** -** Implementing your own layout: flow example +** Implementing your own tqlayout: flow example ** ** Copyright (C) 1996 by Trolltech AS. All rights reserved. ** -** This file is part of an example program for Qt. This example +** This file is part of an example program for TQt. This example ** program may be used, distributed and modified without limitation. ** *****************************************************************************/ @@ -19,18 +19,18 @@ /*********************************************/ /* Iterator */ -class ButtonFlowLayoutIterator :public QGLayoutIterator +class ButtonFlowLayoutIterator :public TQGLayoutIterator { public: - ButtonFlowLayoutIterator( QPtrList<QLayoutItem> *l ) :idx(0), list(l) {} + ButtonFlowLayoutIterator( TQPtrList<TQLayoutItem> *l ) :idx(0), list(l) {} uint count() const; - QLayoutItem *current(); - QLayoutItem *next(); - QLayoutItem *takeCurrent(); + TQLayoutItem *current(); + TQLayoutItem *next(); + TQLayoutItem *takeCurrent(); private: int idx; - QPtrList<QLayoutItem> *list; + TQPtrList<TQLayoutItem> *list; }; @@ -39,38 +39,38 @@ uint ButtonFlowLayoutIterator::count() const return list->count(); } -QLayoutItem *ButtonFlowLayoutIterator::current() +TQLayoutItem *ButtonFlowLayoutIterator::current() { return idx < int(count()) ? list->at(idx) : 0; } -QLayoutItem *ButtonFlowLayoutIterator::next() +TQLayoutItem *ButtonFlowLayoutIterator::next() { idx++; return current(); } -QLayoutItem *ButtonFlowLayoutIterator::takeCurrent() +TQLayoutItem *ButtonFlowLayoutIterator::takeCurrent() { return idx < int(count()) ? list->take( idx ) : 0; } /**************************************************************/ -ButtonFlowLayout::ButtonFlowLayout( QWidget *parent, int margin, int spacing, +ButtonFlowLayout::ButtonFlowLayout( TQWidget *tqparent, int margin, int spacing, const char *name ) - : QLayout( parent, margin, spacing, name ), + : TQLayout( tqparent, margin, spacing, name ), cached_width(0) { } -ButtonFlowLayout::ButtonFlowLayout( QLayout* parentLayout, int spacing, const char *name ) - : QLayout( parentLayout, spacing, name ), +ButtonFlowLayout::ButtonFlowLayout( TQLayout* tqparentLayout, int spacing, const char *name ) + : TQLayout( tqparentLayout, spacing, name ), cached_width(0) { } ButtonFlowLayout::ButtonFlowLayout( int spacing, const char *name ) - : QLayout( spacing, name ), + : TQLayout( spacing, name ), cached_width(0) { } @@ -86,7 +86,7 @@ int ButtonFlowLayout::heightForWidth( int w ) const if ( cached_width != w ) { //Not all C++ compilers support "mutable" yet: ButtonFlowLayout * mthis = (ButtonFlowLayout*)this; - int h = mthis->doLayout( QRect(0,0,w,0), TRUE ); + int h = mthis->doLayout( TQRect(0,0,w,0), TRUE ); mthis->cached_hfw = h; mthis->cached_width = w; return h; @@ -96,7 +96,7 @@ int ButtonFlowLayout::heightForWidth( int w ) const void ButtonFlowLayout::addItem( QLayoutItem *item) { - list.append( item ); + list.append( TQT_TQLAYOUTITEM(item) ); } bool ButtonFlowLayout::hasHeightForWidth() const @@ -104,30 +104,36 @@ bool ButtonFlowLayout::hasHeightForWidth() const return TRUE; } -QSize ButtonFlowLayout::sizeHint() const +TQSize ButtonFlowLayout::tqsizeHint() const { - return minimumSize(); + return tqminimumSize(); } -QSizePolicy::ExpandData ButtonFlowLayout::expanding() const +TQSizePolicy::ExpandData ButtonFlowLayout::expanding() const { - return QSizePolicy::NoDirection; + return TQ_SPNoDirection; } -QLayoutIterator ButtonFlowLayout::iterator() +TQLayoutIterator ButtonFlowLayout::iterator() { - return QLayoutIterator( new ButtonFlowLayoutIterator( &list ) ); + // [FIXME] +#ifdef USE_QT4 + #warning [FIXME] ContainerAreaLayout iterators may not function correctly under Qt4 + return TQLayoutIterator( this ); // [FIXME] +#else // USE_QT4 + return TQLayoutIterator( new ButtonFlowLayoutIterator( &list ) ); +#endif // USE_QT4 } -void ButtonFlowLayout::setGeometry( const QRect &r ) +void ButtonFlowLayout::setGeometry( const TQRect &r ) { - QLayout::setGeometry( r ); + TQLayout::setGeometry( r ); doLayout( r ); } -int ButtonFlowLayout::doLayout( const QRect &r, bool testonly ) +int ButtonFlowLayout::doLayout( const TQRect &r, bool testonly ) { -/* kdDebug() << "buttonflowlayout::doLayout (" +/* kdDebug() << "buttonflowtqlayout::doLayout (" << r.x() << "," << r.y() << "," << r.width() << "," << r.height() << ", " << testonly << ")\n"; */ @@ -140,16 +146,16 @@ int ButtonFlowLayout::doLayout( const QRect &r, bool testonly ) int totalWidth = r.width(); int totalHeight = r.height(); - QPtrListIterator<QLayoutItem> it(list); - QLayoutItem *o; + TQPtrListIterator<TQLayoutItem> it(list); + TQLayoutItem *o; // get the width of the biggest Button it.toFirst(); while ( (o=it.current()) != 0 ) { ++it; - buttonWidth = QMAX( buttonWidth, o->sizeHint().width() ); - buttonHeight = QMAX( buttonHeight, o->sizeHint().height() ); + buttonWidth = TQMAX( buttonWidth, o->tqsizeHint().width() ); + buttonHeight = TQMAX( buttonHeight, o->tqsizeHint().height() ); } // calculate the optimal width @@ -195,13 +201,13 @@ int ButtonFlowLayout::doLayout( const QRect &r, bool testonly ) linecount++; } if (!testonly) - o->setGeometry( QRect( QPoint( btnLeft, (int)rint(y) ), - QSize( btnRight - btnLeft + 1, + o->setGeometry( TQRect( TQPoint( btnLeft, (int)rint(y) ), + TQSize( btnRight - btnLeft + 1, buttonHeight) ) ); x += buttonWidth + spacing(); - h = QMAX( h, buttonHeight ); + h = TQMAX( h, buttonHeight ); } int ret = (int)rint(y + h + deltaH) - r.y(); @@ -211,22 +217,52 @@ int ButtonFlowLayout::doLayout( const QRect &r, bool testonly ) } -QSize ButtonFlowLayout::minimumSize() const +TQSize ButtonFlowLayout::tqminimumSize() const { - return minimumSize(geometry().size()); + return tqminimumSize(tqgeometry().size()); } -QSize ButtonFlowLayout::minimumSize(const QSize &r) const +TQSize ButtonFlowLayout::tqminimumSize(const TQSize &r) const { - QSize s(0, 0); + TQSize s(0, 0); - for (QPtrListIterator<QLayoutItem> it(list); it.current(); ++it) { - QLayoutItem *o = it.current(); - s = s.expandedTo( o->sizeHint()); //minimumSize() ); + for (TQPtrListIterator<TQLayoutItem> it(list); it.current(); ++it) { + TQLayoutItem *o = it.current(); + s = s.expandedTo( o->tqsizeHint()); //tqminimumSize() ); } s.setHeight(heightForWidth(r.width())); return s; } + +#ifdef USE_QT4 +/*! + \reimp +*/ +int ButtonFlowLayout::count() const { + return list.count(); +} + +/*! + \reimp +*/ +TQLayoutItem* ButtonFlowLayout::itemAt(int index) const { + return index >= 0 && index < list.count() ? (const_cast<TQPtrList<TQLayoutItem>&>(list).tqat(index)) : 0; +} + +/*! + \reimp +*/ +TQLayoutItem* ButtonFlowLayout::takeAt(int index) { + if (index < 0 || index >= list.count()) + return 0; + TQLayoutItem *item = list.tqat(index); + list.remove(list.tqat(index)); + delete item; + + invalidate(); + return item; +} +#endif // USE_QT4
\ No newline at end of file diff --git a/kradio3/plugins/gui-quickbar/buttonflowlayout.h b/kradio3/plugins/gui-quickbar/buttonflowlayout.h index 337a850..624688e 100644 --- a/kradio3/plugins/gui-quickbar/buttonflowlayout.h +++ b/kradio3/plugins/gui-quickbar/buttonflowlayout.h @@ -1,13 +1,13 @@ /**************************************************************************** -** $Id: buttonflowlayout.h 471 2006-11-11 17:04:51Z emw $ +** $Id: buttonflowtqlayout.h 471 2006-11-11 17:04:51Z emw $ ** -** Definition of simple flow layout for custom layout example +** Definition of simple flow tqlayout for custom tqlayout example ** ** Created : 979899 ** ** Copyright (C) 1997 by Trolltech AS. All rights reserved. ** -** This file is part of an example program for Qt. This example +** This file is part of an example program for TQt. This example ** program may be used, distributed and modified without limitation. ** *****************************************************************************/ @@ -23,16 +23,16 @@ #include "../../src/include/utils.h" -#include <qlayout.h> -#include <qptrlist.h> +#include <tqlayout.h> +#include <tqptrlist.h> -class ButtonFlowLayout : public QLayout +class ButtonFlowLayout : public TQLayout { public: - ButtonFlowLayout( QWidget *parent, int margin = 0, int spacing=-1, + ButtonFlowLayout( TQWidget *tqparent, int margin = 0, int spacing=-1, const char *name=0 ); - ButtonFlowLayout( QLayout* parentLayout, int spacing=-1, const char *name=0 ); + ButtonFlowLayout( TQLayout* tqparentLayout, int spacing=-1, const char *name=0 ); ButtonFlowLayout( int spacing=-1, const char *name=0 ); @@ -41,18 +41,22 @@ public: void addItem( QLayoutItem *item); bool hasHeightForWidth() const; int heightForWidth( int ) const; - QSize sizeHint() const; - QSize minimumSize() const; - QSize minimumSize(const QSize &r) const; // minimumSize is dependent from width - QLayoutIterator iterator(); - QSizePolicy::ExpandData expanding() const; + TQSize tqsizeHint() const; + TQSize tqminimumSize() const; + TQSize tqminimumSize(const TQSize &r) const; // tqminimumSize is dependent from width + TQLayoutIterator iterator(); + TQSizePolicy::ExpandData expanding() const; + +#ifdef USE_QT4 + QLAYOUT_REQUIRED_METHOD_DECLARATIONS +#endif // USE_QT4 protected: - void setGeometry( const QRect& ); + void setGeometry( const TQRect& ); private: - int doLayout( const QRect&, bool testonly = FALSE ); - QPtrList<QLayoutItem> list; + int doLayout( const TQRect&, bool testonly = FALSE ); + TQPtrList<TQLayoutItem> list; int cached_width; int cached_hfw; }; diff --git a/kradio3/plugins/gui-quickbar/quickbar-configuration.cpp b/kradio3/plugins/gui-quickbar/quickbar-configuration.cpp index bb8b0f6..e9c784e 100644 --- a/kradio3/plugins/gui-quickbar/quickbar-configuration.cpp +++ b/kradio3/plugins/gui-quickbar/quickbar-configuration.cpp @@ -19,8 +19,8 @@ using namespace std; -QuickbarConfiguration::QuickbarConfiguration (QWidget *parent) - : StationSelector(parent) +QuickbarConfiguration::QuickbarConfiguration (TQWidget *tqparent) + : StationSelector(tqparent) { } diff --git a/kradio3/plugins/gui-quickbar/quickbar-configuration.h b/kradio3/plugins/gui-quickbar/quickbar-configuration.h index e2e1c08..c2ba4f8 100644 --- a/kradio3/plugins/gui-quickbar/quickbar-configuration.h +++ b/kradio3/plugins/gui-quickbar/quickbar-configuration.h @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef KRADIO_QUICKBAR_CONFIGURATION_H -#define KRADIO_QUICKBAR_CONFIGURATION_H +#ifndef KRADIO_TQUICKBAR_CONFIGURATION_H +#define KRADIO_TQUICKBAR_CONFIGURATION_H #ifdef HAVE_CONFIG_H #include <config.h> @@ -27,8 +27,9 @@ class QuickbarConfiguration : public StationSelector { Q_OBJECT + TQ_OBJECT public : - QuickbarConfiguration (QWidget *parent); + QuickbarConfiguration (TQWidget *tqparent); ~QuickbarConfiguration (); }; diff --git a/kradio3/plugins/gui-quickbar/quickbar.cpp b/kradio3/plugins/gui-quickbar/quickbar.cpp index 628a1bf..1ae3623 100644 --- a/kradio3/plugins/gui-quickbar/quickbar.cpp +++ b/kradio3/plugins/gui-quickbar/quickbar.cpp @@ -15,10 +15,10 @@ * * ***************************************************************************/ -#include <qtooltip.h> -#include <qnamespace.h> -#include <qhbuttongroup.h> -#include <qvbuttongroup.h> +#include <tqtooltip.h> +#include <tqnamespace.h> +#include <tqhbuttongroup.h> +#include <tqvbuttongroup.h> #include <ktoolbarbutton.h> #include <kwin.h> @@ -43,8 +43,8 @@ PLUGIN_LIBRARY_FUNCTIONS(QuickBar, "kradio-gui-quickbar", i18n("Radio Station Qu ///////////////////////////////////////////////////////////////////////////// -QuickBar::QuickBar(const QString &name) - : QWidget(NULL, name.ascii()), +QuickBar::QuickBar(const TQString &name) + : TQWidget(NULL, name.ascii()), WidgetPluginBase(name, i18n("Quickbar Plugin")), m_layout(NULL), m_buttonGroup(NULL), @@ -83,7 +83,7 @@ bool QuickBar::disconnectI(Interface *i) // IStationSelection -bool QuickBar::setStationSelection(const QStringList &sl) +bool QuickBar::setStationSelection(const TQStringList &sl) { if (m_stationIDs != sl) { m_stationIDs = sl; @@ -98,14 +98,14 @@ bool QuickBar::setStationSelection(const QStringList &sl) void QuickBar::restoreState (KConfig *config) { - config->setGroup(QString("quickBar-") + name()); + config->setGroup(TQString("quickBar-") + name()); WidgetPluginBase::restoreState(config, false); int nStations = config->readNumEntry("nStations", 0); m_stationIDs.clear(); for (int i = 1; i <= nStations; ++i) { - QString s = config->readEntry(QString("stationID-") + QString().setNum(i), QString::null); + TQString s = config->readEntry(TQString("stationID-") + TQString().setNum(i), TQString()); if (s.length()) m_stationIDs += s; } @@ -117,15 +117,15 @@ void QuickBar::restoreState (KConfig *config) void QuickBar::saveState (KConfig *config) const { - config->setGroup(QString("quickBar-") + name()); + config->setGroup(TQString("quickBar-") + name()); WidgetPluginBase::saveState(config); config->writeEntry("nStations", m_stationIDs.size()); int i = 1; - QStringList::const_iterator end = m_stationIDs.end(); - for (QStringList::const_iterator it = m_stationIDs.begin(); it != end; ++it, ++i) { - config->writeEntry(QString("stationID-") + QString().setNum(i), *it); + TQStringList::const_iterator end = m_stationIDs.end(); + for (TQStringList::const_iterator it = m_stationIDs.begin(); it != end; ++it, ++i) { + config->writeEntry(TQString("stationID-") + TQString().setNum(i), *it); } } @@ -200,14 +200,14 @@ bool QuickBar::noticeStationsChanged(const StationList &/*sl*/) void QuickBar::buttonClicked(int id) { - // ouch, but we are still using QStringList :( + // ouch, but we are still using TQStringList :( if (queryIsPowerOn() && id == getButtonID(queryCurrentStation())) { sendPowerOff(); } else { int k = 0; - QStringList::iterator end = m_stationIDs.end(); - for (QStringList::iterator it = m_stationIDs.begin(); it != end; ++it, ++k) { + TQStringList::iterator end = m_stationIDs.end(); + for (TQStringList::iterator it = m_stationIDs.begin(); it != end; ++it, ++k) { if (k == id) { const RawStationList &sl = queryStations().all(); const RadioStation &rs = sl.stationWithID(*it); @@ -229,10 +229,10 @@ void QuickBar::buttonClicked(int id) int QuickBar::getButtonID(const RadioStation &rs) const { - QString stationID = rs.stationID(); + TQString stationID = rs.stationID(); int k = 0; - QStringList::const_iterator end = m_stationIDs.end(); - for (QStringList::const_iterator it = m_stationIDs.begin(); it != end; ++it, ++k) { + TQStringList::const_iterator end = m_stationIDs.end(); + for (TQStringList::const_iterator it = m_stationIDs.begin(); it != end; ++it, ++k) { if (*it == stationID) return k; } @@ -254,7 +254,7 @@ void QuickBar::activateButton(const RadioStation &rs) if (pwr && buttonID >= 0) { m_buttonGroup->setButton(buttonID); } else { - for (QToolButton *b = m_buttons.first(); b; b = m_buttons.next()) { + for (TQToolButton *b = m_buttons.first(); b; b = m_buttons.next()) { b->setOn(false); } } @@ -263,7 +263,7 @@ void QuickBar::activateButton(const RadioStation &rs) -// KDE/Qt gui +// KDE/TQt gui void QuickBar::rebuildGUI() @@ -271,7 +271,7 @@ void QuickBar::rebuildGUI() if (m_layout) delete m_layout; if (m_buttonGroup) delete m_buttonGroup; - for (QPtrListIterator<QToolButton> it(m_buttons); it.current(); ++it) + for (TQPtrListIterator<TQToolButton> it(m_buttons); it.current(); ++it) delete it.current(); m_buttons.clear(); @@ -279,33 +279,33 @@ void QuickBar::rebuildGUI() m_layout->setMargin(1); m_layout->setSpacing(2); - m_buttonGroup = new QButtonGroup(this); - QObject::connect (m_buttonGroup, SIGNAL(clicked(int)), this, SLOT(buttonClicked(int))); + m_buttonGroup = new TQButtonGroup(this); + TQObject::connect (m_buttonGroup, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(buttonClicked(int))); // we use buttonGroup to enable automatic toggle/untoggle m_buttonGroup->setExclusive(true); - m_buttonGroup->setFrameStyle(QFrame::NoFrame); + m_buttonGroup->setFrameStyle(TQFrame::NoFrame); m_buttonGroup->show(); int buttonID = 0; const RawStationList &stations = queryStations().all(); - QStringList::iterator end = m_stationIDs.end(); - for (QStringList::iterator it = m_stationIDs.begin(); it != end; ++it, ++buttonID) { + TQStringList::iterator end = m_stationIDs.end(); + for (TQStringList::iterator it = m_stationIDs.begin(); it != end; ++it, ++buttonID) { const RadioStation &rs = stations.stationWithID(*it); if (! rs.isValid()) continue; - QToolButton *b = new QToolButton(this); + TQToolButton *b = new TQToolButton(this); m_buttons.append(b); b->setToggleButton(true); if (rs.iconName().length()) - b->setIconSet(QPixmap(rs.iconName())); + b->setIconSet(TQPixmap(rs.iconName())); else b->setText(m_showShortName ? rs.shortName() : rs.name()); - b->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred)); + b->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Preferred)); - QToolTip::add(b, rs.longName()); + TQToolTip::add(b, rs.longName()); if (isVisible()) b->show(); @@ -316,9 +316,9 @@ void QuickBar::rebuildGUI() // activate correct button activateCurrentButton(); - // calculate geometry + // calculate tqgeometry if (m_layout) { - QRect r = geometry(); + TQRect r = tqgeometry(); int h = m_layout->heightForWidth( r.width()); if (h > r.height()) @@ -333,32 +333,32 @@ void QuickBar::show() { // KWin::setType(winId(), NET::Toolbar); WidgetPluginBase::pShow(); - QWidget::show(); + TQWidget::show(); } void QuickBar::showOnOrgDesktop() { WidgetPluginBase::pShowOnOrgDesktop(); - //QWidget::show(); + //TQWidget::show(); } void QuickBar::hide() { WidgetPluginBase::pHide(); - QWidget::hide(); + TQWidget::hide(); } -void QuickBar::showEvent(QShowEvent *e) +void QuickBar::showEvent(TQShowEvent *e) { - QWidget::showEvent(e); + TQWidget::showEvent(e); WidgetPluginBase::pShowEvent(e); } -void QuickBar::hideEvent(QHideEvent *e) +void QuickBar::hideEvent(TQHideEvent *e) { - QWidget::hideEvent(e); + TQWidget::hideEvent(e); WidgetPluginBase::pHideEvent(e); } @@ -366,38 +366,38 @@ void QuickBar::hideEvent(QHideEvent *e) void QuickBar::setGeometry (int x, int y, int w, int h) { if (m_layout) { - QSize marginSize(m_layout->margin()*2, m_layout->margin()*2); - setMinimumSize(m_layout->minimumSize(QSize(w, h) - marginSize) + marginSize); + TQSize marginSize(m_layout->margin()*2, m_layout->margin()*2); + setMinimumSize(m_layout->tqminimumSize(TQSize(w, h) - marginSize) + marginSize); } - QWidget::setGeometry (x, y, w, h); + TQWidget::setGeometry (x, y, w, h); } -void QuickBar::setGeometry (const QRect &r) +void QuickBar::setGeometry (const TQRect &r) { setGeometry (r.x(), r.y(), r.width(), r.height()); } -void QuickBar::resizeEvent (QResizeEvent *e) +void QuickBar::resizeEvent (TQResizeEvent *e) { - // minimumSize might change because of the flow layout + // tqminimumSize might change because of the flow tqlayout if (m_layout) { - QSize marginSize(m_layout->margin()*2, m_layout->margin()*2); - setMinimumSize(m_layout->minimumSize(e->size() - marginSize) + marginSize); + TQSize marginSize(m_layout->margin()*2, m_layout->margin()*2); + setMinimumSize(m_layout->tqminimumSize(e->size() - marginSize) + marginSize); } - QWidget::resizeEvent (e); + TQWidget::resizeEvent (e); } void QuickBar::autoSetCaption() { const RadioStation &rs = queryCurrentStation(); - setCaption((queryIsPowerOn() && rs.isValid()) ? rs.longName() : QString("KRadio")); + setCaption((queryIsPowerOn() && rs.isValid()) ? rs.longName() : TQString("KRadio")); } -void QuickBar::dragEnterEvent(QDragEnterEvent* event) +void QuickBar::dragEnterEvent(TQDragEnterEvent* event) { bool a = StationDragObject::canDecode(event); if (a) @@ -407,14 +407,14 @@ void QuickBar::dragEnterEvent(QDragEnterEvent* event) event->accept(a); } -void QuickBar::dropEvent(QDropEvent* event) +void QuickBar::dropEvent(TQDropEvent* event) { - QStringList list; + TQStringList list; if ( StationDragObject::decode(event, list) ) { - QStringList l = getStationSelection(); - for (QValueListConstIterator<QString> it = list.begin(); it != list.end(); ++it) - if (!l.contains(*it)) + TQStringList l = getStationSelection(); + for (TQValueListConstIterator<TQString> it = list.begin(); it != list.end(); ++it) + if (!l.tqcontains(*it)) l.append(*it); setStationSelection(l); } diff --git a/kradio3/plugins/gui-quickbar/quickbar.h b/kradio3/plugins/gui-quickbar/quickbar.h index 7bf5193..1f5443a 100644 --- a/kradio3/plugins/gui-quickbar/quickbar.h +++ b/kradio3/plugins/gui-quickbar/quickbar.h @@ -15,42 +15,43 @@ * * ***************************************************************************/ -#ifndef KRADIO_QUICKBAR_H -#define KRADIO_QUICKBAR_H +#ifndef KRADIO_TQUICKBAR_H +#define KRADIO_TQUICKBAR_H #ifdef HAVE_CONFIG_H #include <config.h> #endif -#include <qwidget.h> +#include <tqwidget.h> #include "../../src/include/radio_interfaces.h" #include "../../src/include/widgetplugins.h" #include "../../src/include/stationselection_interfaces.h" class ButtonFlowLayout; -class QButtonGroup; +class TQButtonGroup; class KConfig; -class QToolButton; +class TQToolButton; /** *@author Martin Witte / Klas Kalass */ -class QuickBar : public QWidget, +class QuickBar : public TQWidget, public WidgetPluginBase, public IRadioClient, public IStationSelection { Q_OBJECT + TQ_OBJECT public: - QuickBar(const QString &name = QString::null); + QuickBar(const TQString &name = TQString()); ~QuickBar(); - virtual QString pluginClassName() const { return "QuickBar"; } + virtual TQString pluginClassName() const { return "QuickBar"; } - const QString &name() const { return PluginBase::name(); } - QString &name() { return PluginBase::name(); } + const TQString &name() const { return PluginBase::name(); } + TQString &name() { return PluginBase::name(); } virtual bool connectI(Interface *i); virtual bool disconnectI(Interface *i); @@ -58,10 +59,10 @@ public: // IStationSelection RECEIVERS: - bool setStationSelection(const QStringList &sl); + bool setStationSelection(const TQStringList &sl); ANSWERS: - const QStringList & getStationSelection () const { return m_stationIDs; } + const TQStringList & getStationSelection () const { return m_stationIDs; } // PluginBase @@ -79,7 +80,7 @@ RECEIVERS: bool noticePowerChanged(bool on); bool noticeStationChanged (const RadioStation &, int idx); bool noticeStationsChanged(const StationList &sl); - bool noticePresetFileChanged(const QString &/*f*/) { return false; } + bool noticePresetFileChanged(const TQString &/*f*/) { return false; } bool noticeCurrentSoundStreamIDChanged(SoundStreamID /*id*/) { return false; } @@ -99,8 +100,8 @@ protected: void autoSetCaption(); - void dragEnterEvent(QDragEnterEvent* event); - void dropEvent(QDropEvent* event); + void dragEnterEvent(TQDragEnterEvent* event); + void dropEvent(TQDropEvent* event); // KDE/QT @@ -110,28 +111,28 @@ public slots: void show(); void hide(); void showOnOrgDesktop(); - void setGeometry (const QRect &r); + void setGeometry (const TQRect &r); void setGeometry (int x, int y, int w, int h); protected: void rebuildGUI(); - void showEvent(QShowEvent *); - void hideEvent(QHideEvent *); - void resizeEvent(QResizeEvent *); + void showEvent(TQShowEvent *); + void hideEvent(TQHideEvent *); + void resizeEvent(TQResizeEvent *); - const QWidget *getWidget() const { return this; } - QWidget *getWidget() { return this; } + const TQWidget *getWidget() const { return this; } + TQWidget *getWidget() { return this; } protected : ButtonFlowLayout *m_layout; - QButtonGroup *m_buttonGroup; + TQButtonGroup *m_buttonGroup; - QPtrList<QToolButton> m_buttons; + TQPtrList<TQToolButton> m_buttons; // config bool m_showShortName; - QStringList m_stationIDs; + TQStringList m_stationIDs; bool m_ignoreNoticeActivation; }; |