diff options
Diffstat (limited to 'kradio3/plugins/gui-standard-display/radioview_frequencyradio.cpp')
-rw-r--r-- | kradio3/plugins/gui-standard-display/radioview_frequencyradio.cpp | 136 |
1 files changed, 68 insertions, 68 deletions
diff --git a/kradio3/plugins/gui-standard-display/radioview_frequencyradio.cpp b/kradio3/plugins/gui-standard-display/radioview_frequencyradio.cpp index 8c6d15d..53f3a37 100644 --- a/kradio3/plugins/gui-standard-display/radioview_frequencyradio.cpp +++ b/kradio3/plugins/gui-standard-display/radioview_frequencyradio.cpp @@ -17,16 +17,16 @@ #include "../../src/include/utils.h" -#include <qpainter.h> -#include <qimage.h> -#include <qpixmap.h> +#include <tqpainter.h> +#include <tqimage.h> +#include <tqpixmap.h> #include <kimageeffect.h> // fading, blending, ... -#include <kpixmapio.h> // fast conversion between QPixmap/QImage +#include <kpixmapio.h> // fast conversion between TQPixmap/TQImage #include "radioview_frequencyradio.h" #include "displaycfg.h" -RadioViewFrequencyRadio::RadioViewFrequencyRadio(QWidget *parent, const QString &name ) - : RadioViewElement(parent, name, clsRadioDisplay), +RadioViewFrequencyRadio::RadioViewFrequencyRadio(TQWidget *tqparent, const TQString &name ) + : RadioViewElement(tqparent, name, clsRadioDisplay), m_power(false), m_valid(false), m_frequency(0), @@ -40,10 +40,10 @@ RadioViewFrequencyRadio::RadioViewFrequencyRadio(QWidget *parent, const QString // set some sensless default colors // real values are read in restoreState - setDisplayColors(QColor(20, 244, 20), - QColor(10, 117, 10).light(75), - QColor(10, 117, 10)); - setDisplayFont(QFont("Helvetica")); + setDisplayColors(TQColor(20, 244, 20), + TQColor(10, 117, 10).light(75), + TQColor(10, 117, 10)); + setDisplayFont(TQFont("Helvetica")); } @@ -72,12 +72,12 @@ void RadioViewFrequencyRadio::saveState (KConfig *config) const void RadioViewFrequencyRadio::restoreState (KConfig *config) { - QColor defaultActive (20, 244, 20), - defaultInactive(QColor(10, 117, 10).light(75)), + TQColor defaultActive (20, 244, 20), + defaultInactive(TQColor(10, 117, 10).light(75)), defaultButton (10, 117, 10); - QFont defaultFont ("Helvetica"); - QColor a, b, c; - QFont f; + TQFont defaultFont ("Helvetica"); + TQColor a, b, c; + TQFont f; a = config->readColorEntry ("frequency-view-colorActiveText", &defaultActive); b = config->readColorEntry ("frequency-view-colorInactiveText", @@ -98,7 +98,7 @@ ConfigPageInfo RadioViewFrequencyRadio::createConfigurationPage() return ConfigPageInfo (a, i18n("Frequency Display"), i18n("Frequency Display"), - QString::null + TQString() ); } @@ -144,9 +144,9 @@ void RadioViewFrequencyRadio::noticeConnectedI (ISoundStreamServer *s, bool poin // IDisplayCfg -bool RadioViewFrequencyRadio::setDisplayColors(const QColor &activeText, - const QColor &inactiveText, - const QColor &button) +bool RadioViewFrequencyRadio::setDisplayColors(const TQColor &activeText, + const TQColor &inactiveText, + const TQColor &button) { bool change = (activeText != m_colorActiveText || inactiveText != m_colorInactiveText || button != m_colorButton); @@ -154,18 +154,18 @@ bool RadioViewFrequencyRadio::setDisplayColors(const QColor &activeText, m_colorInactiveText = inactiveText; m_colorButton = button; - QPalette pl = palette(); - QColorGroup cg = pl.inactive(); + TQPalette pl = palette(); + TQColorGroup cg = pl.inactive(); - QBrush fg = cg.brush(QColorGroup::Foreground), - btn = cg.brush(QColorGroup::Button), - lgt = cg.brush(QColorGroup::Light), - drk = cg.brush(QColorGroup::Dark), - mid = cg.brush(QColorGroup::Mid), - txt = cg.brush(QColorGroup::Text), - btx = cg.brush(QColorGroup::BrightText), - bas = cg.brush(QColorGroup::Base), - bg = cg.brush(QColorGroup::Background); + TQBrush fg = cg.brush(TQColorGroup::Foreground), + btn = cg.brush(TQColorGroup::Button), + lgt = cg.brush(TQColorGroup::Light), + drk = cg.brush(TQColorGroup::Dark), + mid = cg.brush(TQColorGroup::Mid), + txt = cg.brush(TQColorGroup::Text), + btx = cg.brush(TQColorGroup::BrightText), + bas = cg.brush(TQColorGroup::Base), + bg = cg.brush(TQColorGroup::Background); fg.setColor (m_colorActiveText); btn.setColor(m_colorButton); @@ -177,19 +177,19 @@ bool RadioViewFrequencyRadio::setDisplayColors(const QColor &activeText, bas.setColor(m_colorButton); bg.setColor (m_colorButton); - QColorGroup ncg(fg, btn, lgt, drk, mid, txt, btx, bas, bg); + TQColorGroup ncg(fg, btn, lgt, drk, mid, txt, btx, bas, bg); pl.setInactive(ncg); pl.setActive(ncg); setPalette(pl); - if (parentWidget() && parentWidget()->backgroundPixmap() ){ + if (tqparentWidget() && tqparentWidget()->backgroundPixmap() ){ KPixmapIO io; - QImage i = io.convertToImage(*parentWidget()->backgroundPixmap()); - KImageEffect::fade(i, 0.5, colorGroup().color(QColorGroup::Dark)); + TQImage i = io.convertToImage(*tqparentWidget()->backgroundPixmap()); + KImageEffect::fade(i, 0.5, tqcolorGroup().color(TQColorGroup::Dark)); setPaletteBackgroundPixmap(io.convertToPixmap(i)); setBackgroundOrigin(WindowOrigin); } else { - setBackgroundColor(colorGroup().color(QColorGroup::Button)); + setBackgroundColor(tqcolorGroup().color(TQColorGroup::Button)); } if (change) @@ -197,7 +197,7 @@ bool RadioViewFrequencyRadio::setDisplayColors(const QColor &activeText, return true; } -bool RadioViewFrequencyRadio::setDisplayFont (const QFont &f) +bool RadioViewFrequencyRadio::setDisplayFont (const TQFont &f) { if (m_font != f) { m_font = f; @@ -222,7 +222,7 @@ bool RadioViewFrequencyRadio::noticePowerChanged (bool on, const IRadioDevice */ queryIsStereo(ssid, s); noticeStereoChanged(ssid, s); - repaint(); + tqrepaint(); return true; } @@ -233,7 +233,7 @@ bool RadioViewFrequencyRadio::noticeStationChanged (const RadioStation &, const } -bool RadioViewFrequencyRadio::noticeDescriptionChanged (const QString &, const IRadioDevice */*sender*/) +bool RadioViewFrequencyRadio::noticeDescriptionChanged (const TQString &, const IRadioDevice */*sender*/) { return false; // we don't care } @@ -246,7 +246,7 @@ bool RadioViewFrequencyRadio::noticeSignalQualityChanged(SoundStreamID id, float if (queryCurrentSoundStreamID() != id) return false; m_quality = q; - repaint (); + tqrepaint (); return true; } @@ -256,7 +256,7 @@ bool RadioViewFrequencyRadio::noticeStereoChanged(SoundStreamID id, bool s) if (queryCurrentSoundStreamID() != id) return false; m_stereo = s; - repaint (); + tqrepaint (); return true; } @@ -269,7 +269,7 @@ bool RadioViewFrequencyRadio::noticeStereoChanged(SoundStreamID id, bool s) bool RadioViewFrequencyRadio::noticeFrequencyChanged(float f, const RadioStation *) { m_frequency = f; - repaint (); + tqrepaint (); return true; } @@ -293,17 +293,17 @@ bool RadioViewFrequencyRadio::noticeScanStepChanged(float /*s*/) -void RadioViewFrequencyRadio::drawContents(QPainter *paint) +void RadioViewFrequencyRadio::drawContents(TQPainter *paint) { if (!paint) return; - QRect r = contentsRect(); + TQRect r = contentsRect(); - int margin = QMAX(4, QMIN(r.width() / 50, r.height() / 50)), - tmp = QMIN(r.height(), (r.width() - 2*margin) / 4), - xd_st = QMIN((r.height() - margin * 2) / 3, tmp/3), - xw = QMIN(tmp / 2, xd_st * 3 / 2), - penw = QMAX(1, xw / 25), + int margin = TQMAX(4, TQMIN(r.width() / 50, r.height() / 50)), + tmp = TQMIN(r.height(), (r.width() - 2*margin) / 4), + xd_st = TQMIN((r.height() - margin * 2) / 3, tmp/3), + xw = TQMIN(tmp / 2, xd_st * 3 / 2), + penw = TQMAX(1, xw / 25), xh_st = xd_st, xx_st = r.x() + margin + xw + 2 * margin + penw/2, xy_st = r.y() + margin + penw/2, @@ -320,10 +320,10 @@ void RadioViewFrequencyRadio::drawContents(QPainter *paint) xx_sg = r.x() + margin, xy_sg = r.y() + margin; - QPen activePen (colorGroup().color(QColorGroup::Text), penw); - QPen inactivePen (colorGroup().color(QColorGroup::Mid), penw); - QBrush activeBrush = colorGroup().brush(QColorGroup::Text); - QBrush inactiveBrush = colorGroup().brush(QColorGroup::Mid); + TQPen activePen (tqcolorGroup().color(TQColorGroup::Text), penw); + TQPen inactivePen (tqcolorGroup().color(TQColorGroup::Mid), penw); + TQBrush activeBrush = tqcolorGroup().brush(TQColorGroup::Text); + TQBrush inactiveBrush = tqcolorGroup().brush(TQColorGroup::Mid); // draw stereo symbol paint->setPen( (m_stereo && m_power) ? activePen : inactivePen); @@ -367,11 +367,11 @@ void RadioViewFrequencyRadio::drawContents(QPainter *paint) ); // triangle - QPen tmppen = (m_quality > 0.1 && m_power) ? activePen : inactivePen; + TQPen tmppen = (m_quality > 0.1 && m_power) ? activePen : inactivePen; tmppen.setWidth(1); paint->setPen(tmppen); paint->setBrush( (m_quality > 0.1 && m_power) ? activeBrush : inactiveBrush); - QPointArray pts(3); + TQPointArray pts(3); pts.setPoint(0, (int)(xx_sg + xw / 4), (int)(xy_sg + xh_sg - penw/2)); pts.setPoint(1, (int)(xx_sg + xw *3/4), (int)(xy_sg + xh_sg - penw/2)); pts.setPoint(2, (int)(xx_sg + xw / 2), (int)(xy_sg + xw/2 + penw)); @@ -381,31 +381,31 @@ void RadioViewFrequencyRadio::drawContents(QPainter *paint) // AM/FM display - QFont f = m_font; + TQFont f = m_font; paint->setPen ( (m_frequency <= 10 && m_power) ? activePen : inactivePen); f.setPixelSize(xh_am); paint->setFont(f); paint->drawText(xx_am, xy_am + xh_am - 1, i18n("AM")); - int xw_am = QFontMetrics(f).width(i18n("AM")); + int xw_am = TQFontMetrics(f).width(i18n("AM")); paint->setPen ( (m_frequency > 10 && m_power) ? activePen : inactivePen); f.setPixelSize(xh_fm); paint->setFont(f); paint->drawText(xx_fm, xy_fm + xh_fm - 1, i18n("FM")); - int xw_fm = QFontMetrics(f).width(i18n("FM")); + int xw_fm = TQFontMetrics(f).width(i18n("FM")); - int xx_f = QMAX(xx_fm + xw_fm, QMAX(xw_am + xx_am, QMAX(xx_st + xw, xw + xx_sg))) + margin, + int xx_f = TQMAX(xx_fm + xw_fm, TQMAX(xw_am + xx_am, TQMAX(xx_st + xw, xw + xx_sg))) + margin, xy_f = r.y() + margin, xw_f = r.right() - margin - xx_f + 1, xh_f = r.bottom() - margin - xy_f + 1; // Frequency Display - QString s; + TQString s; if (m_frequency < 10) { - s = i18n("%1 kHz").arg(KGlobal::locale()->formatNumber((int)(m_frequency * 1000), 0)); + s = i18n("%1 kHz").tqarg(KGlobal::locale()->formatNumber((int)(m_frequency * 1000), 0)); } else { - s = i18n("%1 MHz").arg(KGlobal::locale()->formatNumber(m_frequency, 2)); + s = i18n("%1 MHz").tqarg(KGlobal::locale()->formatNumber(m_frequency, 2)); } float pxs = xh_f; @@ -413,16 +413,16 @@ void RadioViewFrequencyRadio::drawContents(QPainter *paint) f.setPixelSize((int)pxs); int n = 30; while (1) { - QFontMetrics fm(f); - int sw = fm.boundingRect(xx_f, xy_f, xw_f, xh_f, Qt::AlignRight | Qt::AlignVCenter, s).width(); + TQFontMetrics fm(f); + int sw = fm.boundingRect(xx_f, xy_f, xw_f, xh_f, TQt::AlignRight | TQt::AlignVCenter, s).width(); if (sw <= xw_f || --n <= 0) break; float fact = (float)xw_f / (float)sw; - pxs = QMIN(pxs - 1, pxs * fact); - f.setPixelSize(QMAX(1,(int)pxs)); + pxs = TQMIN(pxs - 1, pxs * fact); + f.setPixelSize(TQMAX(1,(int)pxs)); } paint->setFont(f); - paint->drawText(xx_f, xy_f, xw_f, xh_f, Qt::AlignRight | Qt::AlignVCenter, s); + paint->drawText(xx_f, xy_f, xw_f, xh_f, TQt::AlignRight | TQt::AlignVCenter, s); } @@ -430,9 +430,9 @@ void RadioViewFrequencyRadio::drawContents(QPainter *paint) -void RadioViewFrequencyRadio::reparent (QWidget *prnt, +void RadioViewFrequencyRadio::reparent (TQWidget *prnt, WFlags f, - const QPoint &p, + const TQPoint &p, bool showIt) { RadioViewElement::reparent(prnt, f, p, showIt); |