diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-01 03:43:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-01 03:43:07 +0000 |
commit | 70b9eea2ba01c3691497f49e4c45cb070c16193c (patch) | |
tree | 9a6df61aa247a27275aad9c5245e419e89c2c640 /kradio3/plugins/recording/recording-monitor.cpp | |
parent | 998c1384ace4ae4655997c181fa33242148cd0a4 (diff) | |
download | tderadio-70b9eea2ba01c3691497f49e4c45cb070c16193c.tar.gz tderadio-70b9eea2ba01c3691497f49e4c45cb070c16193c.zip |
TQt4 port kradio
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kradio@1238952 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kradio3/plugins/recording/recording-monitor.cpp')
-rw-r--r-- | kradio3/plugins/recording/recording-monitor.cpp | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/kradio3/plugins/recording/recording-monitor.cpp b/kradio3/plugins/recording/recording-monitor.cpp index 5d6dbf9..6ce59a2 100644 --- a/kradio3/plugins/recording/recording-monitor.cpp +++ b/kradio3/plugins/recording/recording-monitor.cpp @@ -19,60 +19,60 @@ #include "recording-datamonitor.h" #include "../../src/include/aboutwidget.h" -#include <qlabel.h> -#include <qpushbutton.h> -#include <qlayout.h> -#include <qcheckbox.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqlayout.h> +#include <tqcheckbox.h> #include <kcombobox.h> #include <klocale.h> #include <kconfig.h> #include <kaboutdata.h> -RecordingMonitor::RecordingMonitor(const QString &name) - : QWidget(NULL, name.ascii()), +RecordingMonitor::RecordingMonitor(const TQString &name) + : TQWidget(NULL, name.ascii()), WidgetPluginBase(name, i18n("Recording Monitor")), m_recording(false), - m_defaultStreamDescription(QString::null) + m_defaultStreamDescription(TQString()) { setCaption(i18n("KRadio Recording Monitor")); - QVBoxLayout *l = new QVBoxLayout(this, 10, 4); - QGridLayout *l0 = new QGridLayout(l, 6, 2); + TQVBoxLayout *l = new TQVBoxLayout(this, 10, 4); + TQGridLayout *l0 = new TQGridLayout(l, 6, 2); - l0->addWidget( new QLabel(i18n("SoundStream"), this), 0, 0); + l0->addWidget( new TQLabel(i18n("SoundStream"), this), 0, 0); l0->addWidget(m_comboSoundStreamSelector = new KComboBox( this), 0, 1); - l0->addWidget( new QLabel(i18n("Status"), this), 1, 0); - l0->addWidget(m_labelStatus = new QLabel(i18n("<undefined>"), this), 1, 1); - l0->addWidget( new QLabel(i18n("Recording File"), this), 2, 0); - l0->addWidget(m_labelFileName = new QLabel(i18n("<undefined>"), this), 2, 1); - l0->addWidget( new QLabel(i18n("File Size"), this), 3, 0); - l0->addWidget(m_labelSize = new QLabel(i18n("<undefined>"), this), 3, 1); - l0->addWidget( new QLabel(i18n("Recording Time"), this), 4, 0); - l0->addWidget(m_labelTime = new QLabel(i18n("<undefined>"), this), 4, 1); - l0->addWidget( new QLabel(i18n("Sample Rate"), this), 5, 0); - l0->addWidget(m_labelRate = new QLabel(i18n("<undefined>"), this), 5, 1); - - QPushButton *close = new QPushButton(i18n("&Close"), this); - m_btnStartStop = new QPushButton(i18n("&Record"), this); - QObject::connect(close, SIGNAL(clicked()), this, SLOT(hide())); - QObject::connect(m_btnStartStop, SIGNAL(clicked()), this, SLOT(slotStartStopRecording())); + l0->addWidget( new TQLabel(i18n("tqStatus"), this), 1, 0); + l0->addWidget(m_labeltqStatus = new TQLabel(i18n("<undefined>"), this), 1, 1); + l0->addWidget( new TQLabel(i18n("Recording File"), this), 2, 0); + l0->addWidget(m_labelFileName = new TQLabel(i18n("<undefined>"), this), 2, 1); + l0->addWidget( new TQLabel(i18n("File Size"), this), 3, 0); + l0->addWidget(m_labelSize = new TQLabel(i18n("<undefined>"), this), 3, 1); + l0->addWidget( new TQLabel(i18n("Recording Time"), this), 4, 0); + l0->addWidget(m_labelTime = new TQLabel(i18n("<undefined>"), this), 4, 1); + l0->addWidget( new TQLabel(i18n("Sample Rate"), this), 5, 0); + l0->addWidget(m_labelRate = new TQLabel(i18n("<undefined>"), this), 5, 1); + + TQPushButton *close = new TQPushButton(i18n("&Close"), this); + m_btnStartStop = new TQPushButton(i18n("&Record"), this); + TQObject::connect(close, TQT_SIGNAL(clicked()), this, TQT_SLOT(hide())); + TQObject::connect(m_btnStartStop, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotStartStopRecording())); m_dataMonitor = new RecordingDataMonitor(this, NULL); m_dataMonitor->setEnabled(false); - QHBoxLayout *hl0 = new QHBoxLayout(l); + TQHBoxLayout *hl0 = new TQHBoxLayout(l); hl0->addWidget(m_dataMonitor); - QHBoxLayout *hl2 = new QHBoxLayout(l); - hl2->addItem(new QSpacerItem(10, 1)); + TQHBoxLayout *hl2 = new TQHBoxLayout(l); + hl2->addItem(new TQSpacerItem(10, 1)); hl2->addWidget(close); hl2->addWidget(m_btnStartStop); - hl2->addItem(new QSpacerItem(10, 1)); + hl2->addItem(new TQSpacerItem(10, 1)); m_comboSoundStreamSelector->insertItem(i18n("nothing")); - QObject::connect(m_comboSoundStreamSelector, SIGNAL(activated(int)), this, SLOT(slotStreamSelected(int))); + TQObject::connect(m_comboSoundStreamSelector, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotStreamSelected(int))); updateRecordingButton(); } @@ -86,7 +86,7 @@ RecordingMonitor::~RecordingMonitor() void RecordingMonitor::saveState (KConfig *config) const { - config->setGroup(QString("recordingmonitor-") + name()); + config->setGroup(TQString("recordingmonitor-") + name()); WidgetPluginBase::saveState(config); } @@ -94,7 +94,7 @@ void RecordingMonitor::saveState (KConfig *config) const void RecordingMonitor::restoreState (KConfig *config) { - config->setGroup(QString("recordingmonitor-") + name()); + config->setGroup(TQString("recordingmonitor-") + name()); WidgetPluginBase::restoreState(config, false); } @@ -132,15 +132,15 @@ void RecordingMonitor::noticeConnectedI (ISoundStreamServer *s, bool pointer_val s->register4_sendStartRecordingWithFormat(this); s->register4_sendStopRecording(this); - QMap<QString, SoundStreamID> tmp; + TQMap<TQString, SoundStreamID> tmp; queryEnumerateSoundStreams(tmp); m_comboSoundStreamSelector->clear(); m_SoundStreamID2idx.clear(); m_idx2SoundStreamID.clear(); m_comboSoundStreamSelector->insertItem(i18n("nothing")); - QMapConstIterator<QString, SoundStreamID> end = tmp.end(); - for (QMapConstIterator<QString, SoundStreamID> it = tmp.begin(); it != end; ++it) { + TQMapConstIterator<TQString, SoundStreamID> end = tmp.end(); + for (TQMapConstIterator<TQString, SoundStreamID> it = tmp.begin(); it != end; ++it) { int idx = m_comboSoundStreamSelector->count(); m_comboSoundStreamSelector->insertItem(it.key()); m_idx2SoundStreamID[idx] = *it; @@ -181,35 +181,35 @@ AboutPageInfo RecordingMonitor::createAboutPage() void RecordingMonitor::show() { WidgetPluginBase::pShow(); - QWidget::show(); + TQWidget::show(); } void RecordingMonitor::showOnOrgDesktop() { WidgetPluginBase::pShowOnOrgDesktop(); - //QWidget::show(); + //TQWidget::show(); } void RecordingMonitor::hide() { WidgetPluginBase::pHide(); - QWidget::hide(); + TQWidget::hide(); } -void RecordingMonitor::showEvent(QShowEvent *e) +void RecordingMonitor::showEvent(TQShowEvent *e) { - QWidget::showEvent(e); + TQWidget::showEvent(e); WidgetPluginBase::pShowEvent(e); //m_comboSoundStreamSelector->setCurrentItem(1); //slotStreamSelected(1); } -void RecordingMonitor::hideEvent(QHideEvent *e) +void RecordingMonitor::hideEvent(TQHideEvent *e) { - QWidget::hideEvent(e); + TQWidget::hideEvent(e); WidgetPluginBase::pHideEvent(e); m_comboSoundStreamSelector->setCurrentItem(0); slotStreamSelected(0); @@ -231,7 +231,7 @@ void RecordingMonitor::slotStartStopRecording() bool RecordingMonitor::noticeSoundStreamCreated(SoundStreamID id) { - QString tmp = QString::null; + TQString tmp = TQString(); querySoundStreamDescription(id, tmp); int idx = m_comboSoundStreamSelector->count(); @@ -249,12 +249,12 @@ bool RecordingMonitor::noticeSoundStreamCreated(SoundStreamID id) bool RecordingMonitor::noticeSoundStreamClosed(SoundStreamID id) { - if (m_SoundStreamID2idx.contains(id)) { + if (m_SoundStreamID2idx.tqcontains(id)) { int idx = m_SoundStreamID2idx[id]; m_idx2SoundStreamID.clear(); m_SoundStreamID2idx.remove(id); - QMapIterator<SoundStreamID, int> end = m_SoundStreamID2idx.end(); - for (QMapIterator<SoundStreamID, int> it = m_SoundStreamID2idx.begin(); it != end; ++it) { + TQMapIterator<SoundStreamID, int> end = m_SoundStreamID2idx.end(); + for (TQMapIterator<SoundStreamID, int> it = m_SoundStreamID2idx.begin(); it != end; ++it) { if (*it > idx) { (*it)--; } @@ -270,9 +270,9 @@ bool RecordingMonitor::noticeSoundStreamClosed(SoundStreamID id) bool RecordingMonitor::noticeSoundStreamChanged(SoundStreamID id) { - if (m_SoundStreamID2idx.contains(id)) { + if (m_SoundStreamID2idx.tqcontains(id)) { int idx = m_SoundStreamID2idx[id]; - QString tmp = QString::null; + TQString tmp = TQString(); querySoundStreamDescription(id, tmp); m_comboSoundStreamSelector->changeItem(tmp, idx); if (idx == m_comboSoundStreamSelector->currentItem()) { @@ -317,7 +317,7 @@ bool RecordingMonitor::noticeSoundStreamData(SoundStreamID id, int m = (int)(s / 60); s -= 60 * m; int h = m / 60; m %= 60; int d = h / 24; h %= 24; - QString time; + TQString time; if (d) { time.sprintf("%dd - %02d:%02d:%05.2f", d, h, m, s); } else { @@ -335,14 +335,14 @@ bool RecordingMonitor::noticeSoundStreamData(SoundStreamID id, double kB = B / 1024; double MB = kB / 1024; double GB = MB / 1024; - QString str_size; - str_size = i18n("%1 Byte").arg(KGlobal::locale()->formatNumber((int)B, 0)); - if (kB > 1) str_size = i18n("%1 kB").arg(KGlobal::locale()->formatNumber(kB, 3)); - if (MB > 1) str_size = i18n("%1 MB").arg(KGlobal::locale()->formatNumber(MB, 3)); - if (GB > 1) str_size = i18n("%1 GB").arg(KGlobal::locale()->formatNumber(GB, 3)); + TQString str_size; + str_size = i18n("%1 Byte").tqarg(KGlobal::locale()->formatNumber((int)B, 0)); + if (kB > 1) str_size = i18n("%1 kB").tqarg(KGlobal::locale()->formatNumber(kB, 3)); + if (MB > 1) str_size = i18n("%1 MB").tqarg(KGlobal::locale()->formatNumber(MB, 3)); + if (GB > 1) str_size = i18n("%1 GB").tqarg(KGlobal::locale()->formatNumber(GB, 3)); m_labelSize->setText(str_size); - m_labelRate->setText(i18n("%1 Hz").arg(sf.m_SampleRate)); + m_labelRate->setText(i18n("%1 Hz").tqarg(sf.m_SampleRate)); return true; } return false; @@ -356,7 +356,7 @@ void RecordingMonitor::slotStreamSelected(int idx) sendStopCapture(old_id); } - SoundStreamID id = m_idx2SoundStreamID.contains(idx) ? m_idx2SoundStreamID[idx] : SoundStreamID::InvalidID; + SoundStreamID id = m_idx2SoundStreamID.tqcontains(idx) ? m_idx2SoundStreamID[idx] : SoundStreamID::InvalidID; if (id.isValid()) { m_defaultStreamDescription = m_comboSoundStreamSelector->text(idx); @@ -369,7 +369,7 @@ void RecordingMonitor::slotStreamSelected(int idx) m_labelTime ->setEnabled(true); m_labelRate ->setEnabled(true); m_labelFileName ->setEnabled(true); - m_labelStatus ->setEnabled(true); + m_labeltqStatus ->setEnabled(true); } else { m_dataMonitor ->setEnabled(false); m_labelSize ->setEnabled(false); @@ -377,7 +377,7 @@ void RecordingMonitor::slotStreamSelected(int idx) m_labelTime ->setEnabled(false); m_labelRate ->setEnabled(false); m_labelFileName ->setEnabled(false); - m_labelStatus ->setEnabled(false); + m_labeltqStatus ->setEnabled(false); } m_currentStream = id; m_recording = false; |