diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kalarm/soundpicker.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kalarm/soundpicker.cpp')
-rw-r--r-- | kalarm/soundpicker.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/kalarm/soundpicker.cpp b/kalarm/soundpicker.cpp index 0e0626de9..cd40a778f 100644 --- a/kalarm/soundpicker.cpp +++ b/kalarm/soundpicker.cpp @@ -20,13 +20,13 @@ #include "kalarm.h" -#include <qlayout.h> -#include <qregexp.h> -#include <qtooltip.h> -#include <qtimer.h> -#include <qlabel.h> -#include <qhbox.h> -#include <qwhatsthis.h> +#include <tqlayout.h> +#include <tqregexp.h> +#include <tqtooltip.h> +#include <tqtimer.h> +#include <tqlabel.h> +#include <tqhbox.h> +#include <tqwhatsthis.h> #include <kglobal.h> #include <klocale.h> @@ -48,22 +48,22 @@ // Collect these widget labels together to ensure consistent wording and // translations across different modules. -QString SoundPicker::i18n_Sound() { return i18n("An audio sound", "Sound"); } -QString SoundPicker::i18n_None() { return i18n("None"); } -QString SoundPicker::i18n_Beep() { return i18n("Beep"); } -QString SoundPicker::i18n_Speak() { return i18n("Speak"); } -QString SoundPicker::i18n_File() { return i18n("Sound file"); } +TQString SoundPicker::i18n_Sound() { return i18n("An audio sound", "Sound"); } +TQString SoundPicker::i18n_None() { return i18n("None"); } +TQString SoundPicker::i18n_Beep() { return i18n("Beep"); } +TQString SoundPicker::i18n_Speak() { return i18n("Speak"); } +TQString SoundPicker::i18n_File() { return i18n("Sound file"); } -SoundPicker::SoundPicker(QWidget* parent, const char* name) - : QFrame(parent, name) +SoundPicker::SoundPicker(TQWidget* parent, const char* name) + : TQFrame(parent, name) { - setFrameStyle(QFrame::NoFrame); - QHBoxLayout* soundLayout = new QHBoxLayout(this, 0, KDialog::spacingHint()); - mTypeBox = new QHBox(this); // this is to control the QWhatsThis text display area + setFrameStyle(TQFrame::NoFrame); + TQHBoxLayout* soundLayout = new TQHBoxLayout(this, 0, KDialog::spacingHint()); + mTypeBox = new TQHBox(this); // this is to control the TQWhatsThis text display area mTypeBox->setSpacing(KDialog::spacingHint()); - QLabel* label = new QLabel(i18n("An audio sound", "&Sound:"), mTypeBox); + TQLabel* label = new TQLabel(i18n("An audio sound", "&Sound:"), mTypeBox); label->setFixedSize(label->sizeHint()); // Sound type combo box @@ -74,7 +74,7 @@ SoundPicker::SoundPicker(QWidget* parent, const char* name) mTypeCombo->insertItem(i18n_File()); // index PLAY_FILE mSpeakShowing = !theApp()->speechEnabled(); showSpeak(!mSpeakShowing); // index SPEAK (only displayed if appropriate) - connect(mTypeCombo, SIGNAL(activated(int)), SLOT(slotTypeSelected(int))); + connect(mTypeCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotTypeSelected(int))); label->setBuddy(mTypeCombo); soundLayout->addWidget(mTypeBox); @@ -82,9 +82,9 @@ SoundPicker::SoundPicker(QWidget* parent, const char* name) mFilePicker = new PushButton(this); mFilePicker->setPixmap(SmallIcon("playsound")); mFilePicker->setFixedSize(mFilePicker->sizeHint()); - connect(mFilePicker, SIGNAL(clicked()), SLOT(slotPickFile())); - QToolTip::add(mFilePicker, i18n("Configure sound file")); - QWhatsThis::add(mFilePicker, i18n("Configure a sound file to play when the alarm is displayed.")); + connect(mFilePicker, TQT_SIGNAL(clicked()), TQT_SLOT(slotPickFile())); + TQToolTip::add(mFilePicker, i18n("Configure sound file")); + TQWhatsThis::add(mFilePicker, i18n("Configure a sound file to play when the alarm is displayed.")); soundLayout->addWidget(mFilePicker); // Initialise the file picker button state and tooltip @@ -113,7 +113,7 @@ void SoundPicker::showSpeak(bool show) show = false; // speech capability is not installed if (show == mSpeakShowing) return; // no change - QString whatsThis = "<p>" + i18n("Choose a sound to play when the message is displayed.") + TQString whatsThis = "<p>" + i18n("Choose a sound to play when the message is displayed.") + "<br>" + i18n("%1: the message is displayed silently.").arg("<b>" + i18n_None() + "</b>") + "<br>" + i18n("%1: a simple beep is sounded.").arg("<b>" + i18n_Beep() + "</b>") + "<br>" + i18n("%1: an audio file is played. You will be prompted to choose the file and set play options.").arg("<b>" + i18n_File() + "</b>"); @@ -126,7 +126,7 @@ void SoundPicker::showSpeak(bool show) mTypeCombo->insertItem(i18n_Speak()); whatsThis += "<br>" + i18n("%1: the message text is spoken.").arg("<b>" + i18n_Speak() + "</b>") + "</p>"; } - QWhatsThis::add(mTypeBox, whatsThis + "</p>"); + TQWhatsThis::add(mTypeBox, whatsThis + "</p>"); mSpeakShowing = show; } @@ -142,9 +142,9 @@ SoundPicker::Type SoundPicker::sound() const * Return the selected sound file, if the File option is selected. * Returns null string if File is not currently selected. */ -QString SoundPicker::file() const +TQString SoundPicker::file() const { - return (mTypeCombo->currentItem() == PLAY_FILE) ? mFile : QString::null; + return (mTypeCombo->currentItem() == PLAY_FILE) ? mFile : TQString::null; } /****************************************************************************** @@ -179,7 +179,7 @@ bool SoundPicker::repeat() const /****************************************************************************** * Initialise the widget's state. */ -void SoundPicker::set(SoundPicker::Type type, const QString& f, float volume, float fadeVolume, int fadeSeconds, bool repeat) +void SoundPicker::set(SoundPicker::Type type, const TQString& f, float volume, float fadeVolume, int fadeSeconds, bool repeat) { if (type == PLAY_FILE && f.isEmpty()) type = BEEP; @@ -191,9 +191,9 @@ void SoundPicker::set(SoundPicker::Type type, const QString& f, float volume, fl mTypeCombo->setCurrentItem(type); // this doesn't trigger slotTypeSelected() mFilePicker->setEnabled(type == PLAY_FILE); if (type == PLAY_FILE) - QToolTip::add(mTypeCombo, mFile); + TQToolTip::add(mTypeCombo, mFile); else - QToolTip::remove(mTypeCombo); + TQToolTip::remove(mTypeCombo); mLastType = type; } @@ -205,11 +205,11 @@ void SoundPicker::slotTypeSelected(int id) Type newType = static_cast<Type>(id); if (newType == mLastType) return; - QString tooltip; + TQString tooltip; if (mLastType == PLAY_FILE) { mFilePicker->setEnabled(false); - QToolTip::remove(mTypeCombo); + TQToolTip::remove(mTypeCombo); } else if (newType == PLAY_FILE) { @@ -220,7 +220,7 @@ void SoundPicker::slotTypeSelected(int id) return; // revert to previously selected type } mFilePicker->setEnabled(true); - QToolTip::add(mTypeCombo, mFile); + TQToolTip::add(mTypeCombo, mFile); } mLastType = newType; } @@ -231,14 +231,14 @@ void SoundPicker::slotTypeSelected(int id) void SoundPicker::slotPickFile() { #ifdef WITHOUT_ARTS - QString url = browseFile(mDefaultDir, mFile); + TQString url = browseFile(mDefaultDir, mFile); if (!url.isEmpty()) mFile = url; #else - QString file = mFile; + TQString file = mFile; SoundDlg dlg(mFile, mVolume, mFadeVolume, mFadeSeconds, mRepeat, i18n("Sound File"), this, "soundDlg"); dlg.setReadOnly(mReadOnly); - bool accepted = (dlg.exec() == QDialog::Accepted); + bool accepted = (dlg.exec() == TQDialog::Accepted); if (mReadOnly) return; if (accepted) @@ -261,10 +261,10 @@ void SoundPicker::slotPickFile() { // No audio file is selected, so revert to previously selected option mTypeCombo->setCurrentItem(mLastType); - QToolTip::remove(mTypeCombo); + TQToolTip::remove(mTypeCombo); } else - QToolTip::add(mTypeCombo, mFile); + TQToolTip::add(mTypeCombo, mFile); } /****************************************************************************** @@ -273,9 +273,9 @@ void SoundPicker::slotPickFile() * 'defaultDir' is updated to the directory containing the chosen file. * Reply = URL selected. If none is selected, URL.isEmpty() is true. */ -QString SoundPicker::browseFile(QString& defaultDir, const QString& initialFile) +TQString SoundPicker::browseFile(TQString& defaultDir, const TQString& initialFile) { - static QString kdeSoundDir; // directory containing KDE sound files + static TQString kdeSoundDir; // directory containing KDE sound files if (defaultDir.isEmpty()) { if (kdeSoundDir.isNull()) @@ -283,10 +283,10 @@ QString SoundPicker::browseFile(QString& defaultDir, const QString& initialFile) defaultDir = kdeSoundDir; } #ifdef WITHOUT_ARTS - QString filter = QString::fromLatin1("*.wav *.mp3 *.ogg|%1\n*|%2").arg(i18n("Sound Files")).arg(i18n("All Files")); + TQString filter = TQString::fromLatin1("*.wav *.mp3 *.ogg|%1\n*|%2").arg(i18n("Sound Files")).arg(i18n("All Files")); #else - QStringList filters = KDE::PlayObjectFactory::mimeTypes(); - QString filter = filters.join(" "); + TQStringList filters = KDE::PlayObjectFactory::mimeTypes(); + TQString filter = filters.join(" "); #endif return KAlarm::browseFile(i18n("Choose Sound File"), defaultDir, initialFile, filter, KFile::ExistingOnly, 0, "pickSoundFile"); } |