diff options
Diffstat (limited to 'kalarm/sounddlg.cpp')
-rw-r--r-- | kalarm/sounddlg.cpp | 136 |
1 files changed, 68 insertions, 68 deletions
diff --git a/kalarm/sounddlg.cpp b/kalarm/sounddlg.cpp index fe1df0bad..2df7542b1 100644 --- a/kalarm/sounddlg.cpp +++ b/kalarm/sounddlg.cpp @@ -22,14 +22,14 @@ #include "kalarm.h" -#include <qlabel.h> -#include <qhbox.h> -#include <qgroupbox.h> -#include <qlayout.h> -#include <qfile.h> -#include <qdir.h> -#include <qwhatsthis.h> -#include <qtooltip.h> +#include <tqlabel.h> +#include <tqhbox.h> +#include <tqgroupbox.h> +#include <tqlayout.h> +#include <tqfile.h> +#include <tqdir.h> +#include <tqwhatsthis.h> +#include <tqtooltip.h> #include <klocale.h> #include <kstandarddirs.h> @@ -37,7 +37,7 @@ #ifdef WITHOUT_ARTS #include <kaudioplayer.h> #else -#include <qtimer.h> +#include <tqtimer.h> #include <arts/kartsdispatcher.h> #include <arts/kartsserver.h> #include <arts/kplayobjectfactory.h> @@ -60,123 +60,123 @@ // Collect these widget labels together to ensure consistent wording and // translations across different modules. -QString SoundDlg::i18n_SetVolume() { return i18n("Set volume"); } -QString SoundDlg::i18n_v_SetVolume() { return i18n("Set &volume"); } -QString SoundDlg::i18n_Repeat() { return i18n("Repeat"); } -QString SoundDlg::i18n_p_Repeat() { return i18n("Re&peat"); } +TQString SoundDlg::i18n_SetVolume() { return i18n("Set volume"); } +TQString SoundDlg::i18n_v_SetVolume() { return i18n("Set &volume"); } +TQString SoundDlg::i18n_Repeat() { return i18n("Repeat"); } +TQString SoundDlg::i18n_p_Repeat() { return i18n("Re&peat"); } static const char SOUND_DIALOG_NAME[] = "SoundDialog"; -SoundDlg::SoundDlg(const QString& file, float volume, float fadeVolume, int fadeSeconds, bool repeat, - const QString& caption, QWidget* parent, const char* name) +SoundDlg::SoundDlg(const TQString& file, float volume, float fadeVolume, int fadeSeconds, bool repeat, + const TQString& caption, TQWidget* parent, const char* name) : KDialogBase(parent, name, true, caption, Ok|Cancel, Ok, false), mReadOnly(false), mArtsDispatcher(0), mPlayObject(0), mPlayTimer(0) { - QWidget* page = new QWidget(this); + TQWidget* page = new TQWidget(this); setMainWidget(page); - QVBoxLayout* layout = new QVBoxLayout(page, 0, spacingHint()); + TQVBoxLayout* layout = new TQVBoxLayout(page, 0, spacingHint()); // File play button - QHBox* box = new QHBox(page); + TQHBox* box = new TQHBox(page); layout->addWidget(box); - mFilePlay = new QPushButton(box); + mFilePlay = new TQPushButton(box); mFilePlay->setPixmap(SmallIcon("player_play")); mFilePlay->setFixedSize(mFilePlay->sizeHint()); - connect(mFilePlay, SIGNAL(clicked()), SLOT(playSound())); - QToolTip::add(mFilePlay, i18n("Test the sound")); - QWhatsThis::add(mFilePlay, i18n("Play the selected sound file.")); + connect(mFilePlay, TQT_SIGNAL(clicked()), TQT_SLOT(playSound())); + TQToolTip::add(mFilePlay, i18n("Test the sound")); + TQWhatsThis::add(mFilePlay, i18n("Play the selected sound file.")); // File name edit box mFileEdit = new LineEdit(LineEdit::Url, box); mFileEdit->setAcceptDrops(true); - QWhatsThis::add(mFileEdit, i18n("Enter the name or URL of a sound file to play.")); + TQWhatsThis::add(mFileEdit, i18n("Enter the name or URL of a sound file to play.")); // File browse button mFileBrowseButton = new PushButton(box); mFileBrowseButton->setPixmap(SmallIcon("fileopen")); mFileBrowseButton->setFixedSize(mFileBrowseButton->sizeHint()); - connect(mFileBrowseButton, SIGNAL(clicked()), SLOT(slotPickFile())); - QToolTip::add(mFileBrowseButton, i18n("Choose a file")); - QWhatsThis::add(mFileBrowseButton, i18n("Select a sound file to play.")); + connect(mFileBrowseButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotPickFile())); + TQToolTip::add(mFileBrowseButton, i18n("Choose a file")); + TQWhatsThis::add(mFileBrowseButton, i18n("Select a sound file to play.")); // Sound repetition checkbox mRepeatCheckbox = new CheckBox(i18n_p_Repeat(), page); mRepeatCheckbox->setFixedSize(mRepeatCheckbox->sizeHint()); - QWhatsThis::add(mRepeatCheckbox, + TQWhatsThis::add(mRepeatCheckbox, i18n("If checked, the sound file will be played repeatedly for as long as the message is displayed.")); layout->addWidget(mRepeatCheckbox); // Volume - QGroupBox* group = new QGroupBox(i18n("Volume"), page); + TQGroupBox* group = new TQGroupBox(i18n("Volume"), page); layout->addWidget(group); - QGridLayout* grid = new QGridLayout(group, 4, 3, marginHint(), spacingHint()); + TQGridLayout* grid = new TQGridLayout(group, 4, 3, marginHint(), spacingHint()); grid->addRowSpacing(0, fontMetrics().height() - marginHint() + spacingHint()); grid->setColStretch(2, 1); int indentWidth = 3 * KDialog::spacingHint(); grid->addColSpacing(0, indentWidth); grid->addColSpacing(1, indentWidth); - // Get alignment to use in QGridLayout (AlignAuto doesn't work correctly there) - int alignment = QApplication::reverseLayout() ? Qt::AlignRight : Qt::AlignLeft; + // Get alignment to use in TQGridLayout (AlignAuto doesn't work correctly there) + int alignment = TQApplication::reverseLayout() ? Qt::AlignRight : Qt::AlignLeft; // 'Set volume' checkbox - box = new QHBox(group); + box = new TQHBox(group); box->setSpacing(spacingHint()); grid->addMultiCellWidget(box, 1, 1, 0, 2); mVolumeCheckbox = new CheckBox(i18n_v_SetVolume(), box); mVolumeCheckbox->setFixedSize(mVolumeCheckbox->sizeHint()); - connect(mVolumeCheckbox, SIGNAL(toggled(bool)), SLOT(slotVolumeToggled(bool))); - QWhatsThis::add(mVolumeCheckbox, + connect(mVolumeCheckbox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotVolumeToggled(bool))); + TQWhatsThis::add(mVolumeCheckbox, i18n("Select to choose the volume for playing the sound file.")); // Volume slider mVolumeSlider = new Slider(0, 100, 10, 0, Qt::Horizontal, box); - mVolumeSlider->setTickmarks(QSlider::Below); + mVolumeSlider->setTickmarks(TQSlider::Below); mVolumeSlider->setTickInterval(10); - mVolumeSlider->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); - QWhatsThis::add(mVolumeSlider, i18n("Choose the volume for playing the sound file.")); + mVolumeSlider->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed)); + TQWhatsThis::add(mVolumeSlider, i18n("Choose the volume for playing the sound file.")); mVolumeCheckbox->setFocusWidget(mVolumeSlider); // Fade checkbox mFadeCheckbox = new CheckBox(i18n("Fade"), group); mFadeCheckbox->setFixedSize(mFadeCheckbox->sizeHint()); - connect(mFadeCheckbox, SIGNAL(toggled(bool)), SLOT(slotFadeToggled(bool))); - QWhatsThis::add(mFadeCheckbox, + connect(mFadeCheckbox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotFadeToggled(bool))); + TQWhatsThis::add(mFadeCheckbox, i18n("Select to fade the volume when the sound file first starts to play.")); grid->addMultiCellWidget(mFadeCheckbox, 2, 2, 1, 2, alignment); // Fade time - mFadeBox = new QHBox(group); + mFadeBox = new TQHBox(group); mFadeBox->setSpacing(spacingHint()); grid->addWidget(mFadeBox, 3, 2, alignment); - QLabel* label = new QLabel(i18n("Time period over which to fade the sound", "Fade time:"), mFadeBox); + TQLabel* label = new TQLabel(i18n("Time period over which to fade the sound", "Fade time:"), mFadeBox); label->setFixedSize(label->sizeHint()); mFadeTime = new SpinBox(1, 999, 1, mFadeBox); mFadeTime->setLineShiftStep(10); mFadeTime->setFixedSize(mFadeTime->sizeHint()); label->setBuddy(mFadeTime); - label = new QLabel(i18n("seconds"), mFadeBox); + label = new TQLabel(i18n("seconds"), mFadeBox); label->setFixedSize(label->sizeHint()); - QWhatsThis::add(mFadeBox, i18n("Enter how many seconds to fade the sound before reaching the set volume.")); + TQWhatsThis::add(mFadeBox, i18n("Enter how many seconds to fade the sound before reaching the set volume.")); // Fade slider - mFadeVolumeBox = new QHBox(group); + mFadeVolumeBox = new TQHBox(group); mFadeVolumeBox->setSpacing(spacingHint()); grid->addWidget(mFadeVolumeBox, 4, 2); - label = new QLabel(i18n("Initial volume:"), mFadeVolumeBox); + label = new TQLabel(i18n("Initial volume:"), mFadeVolumeBox); label->setFixedSize(label->sizeHint()); mFadeSlider = new Slider(0, 100, 10, 0, Qt::Horizontal, mFadeVolumeBox); - mFadeSlider->setTickmarks(QSlider::Below); + mFadeSlider->setTickmarks(TQSlider::Below); mFadeSlider->setTickInterval(10); - mFadeSlider->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); + mFadeSlider->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed)); label->setBuddy(mFadeSlider); - QWhatsThis::add(mFadeVolumeBox, i18n("Choose the initial volume for playing the sound file.")); + TQWhatsThis::add(mFadeVolumeBox, i18n("Choose the initial volume for playing the sound file.")); // Restore the dialogue size from last time - QSize s; + TQSize s; if (KAlarm::readConfigWindowSize(SOUND_DIALOG_NAME, s)) resize(s); @@ -241,7 +241,7 @@ bool SoundDlg::getSettings(float& volume, float& fadeVolume, int& fadeSeconds) c * Called when the dialog's size has changed. * Records the new size in the config file. */ -void SoundDlg::resizeEvent(QResizeEvent* re) +void SoundDlg::resizeEvent(TQResizeEvent* re) { if (isVisible()) KAlarm::writeConfigWindowSize(SOUND_DIALOG_NAME, re->size()); @@ -249,7 +249,7 @@ void SoundDlg::resizeEvent(QResizeEvent* re) KDialog::resizeEvent(re); } -void SoundDlg::showEvent(QShowEvent* se) +void SoundDlg::showEvent(TQShowEvent* se) { mVolumeSlider->resize(mFadeSlider->size()); KDialog::showEvent(se); @@ -272,7 +272,7 @@ void SoundDlg::slotOk() */ void SoundDlg::slotPickFile() { - QString url = SoundPicker::browseFile(mDefaultDir, mFileEdit->text()); + TQString url = SoundPicker::browseFile(mDefaultDir, mFileEdit->text()); if (!url.isEmpty()) mFileEdit->setText(url); } @@ -284,7 +284,7 @@ void SoundDlg::playSound() { #ifdef WITHOUT_ARTS if (checkFile()) - KAudioPlayer::play(QFile::encodeName(mFileName)); + KAudioPlayer::play(TQFile::encodeName(mFileName)); #else if (mPlayObject) { @@ -302,8 +302,8 @@ void SoundDlg::playSound() KMessageBox::error(this, i18n("Cannot open audio file:\n%1").arg(mFileName)); return; } - mPlayTimer = new QTimer(this); - connect(mPlayTimer, SIGNAL(timeout()), SLOT(checkAudioPlay())); + mPlayTimer = new TQTimer(this); + connect(mPlayTimer, TQT_SIGNAL(timeout()), TQT_SLOT(checkAudioPlay())); mArtsDispatcher = new KArtsDispatcher; mPlayStarted = false; KArtsServer aserver; @@ -311,9 +311,9 @@ void SoundDlg::playSound() KDE::PlayObjectFactory factory(sserver); mPlayObject = factory.createPlayObject(mLocalAudioFile, true); mFilePlay->setPixmap(SmallIcon("player_stop")); - QToolTip::add(mFilePlay, i18n("Stop sound")); - QWhatsThis::add(mFilePlay, i18n("Stop playing the sound")); - connect(mPlayObject, SIGNAL(playObjectCreated()), SLOT(checkAudioPlay())); + TQToolTip::add(mFilePlay, i18n("Stop sound")); + TQWhatsThis::add(mFilePlay, i18n("Stop playing the sound")); + connect(mPlayObject, TQT_SIGNAL(playObjectCreated()), TQT_SLOT(checkAudioPlay())); if (!mPlayObject->object().isNull()) checkAudioPlay(); #endif @@ -370,11 +370,11 @@ void SoundDlg::stopPlay() if (!mLocalAudioFile.isEmpty()) { KIO::NetAccess::removeTempFile(mLocalAudioFile); // removes it only if it IS a temporary file - mLocalAudioFile = QString::null; + mLocalAudioFile = TQString::null; } mFilePlay->setPixmap(SmallIcon("player_play")); - QToolTip::add(mFilePlay, i18n("Test the sound")); - QWhatsThis::add(mFilePlay, i18n("Play the selected sound file.")); + TQToolTip::add(mFilePlay, i18n("Test the sound")); + TQWhatsThis::add(mFilePlay, i18n("Play the selected sound file.")); #endif } @@ -389,7 +389,7 @@ bool SoundDlg::checkFile() if (KURL::isRelativeURL(mFileName)) { // It's not an absolute URL, so check for an absolute path - QFileInfo f(mFileName); + TQFileInfo f(mFileName); if (!f.isRelative()) url.setPath(mFileName); } @@ -413,12 +413,12 @@ bool SoundDlg::checkFile() { // It's a relative path. // Find the first sound resource that contains files. - QStringList soundDirs = KGlobal::dirs()->resourceDirs("sound"); + TQStringList soundDirs = KGlobal::dirs()->resourceDirs("sound"); if (!soundDirs.isEmpty()) { - QDir dir; - dir.setFilter(QDir::Files | QDir::Readable); - for (QStringList::ConstIterator it = soundDirs.begin(); it != soundDirs.end(); ++it) + TQDir dir; + dir.setFilter(TQDir::Files | TQDir::Readable); + for (TQStringList::ConstIterator it = soundDirs.begin(); it != soundDirs.end(); ++it) { dir = *it; if (dir.isReadable() && dir.count() > 2) @@ -433,7 +433,7 @@ bool SoundDlg::checkFile() } } } - url.setPath(QDir::homeDirPath()); + url.setPath(TQDir::homeDirPath()); url.addPath(mFileName); if (KIO::NetAccess::exists(url, true, this)) { @@ -443,7 +443,7 @@ bool SoundDlg::checkFile() } #ifdef WITHOUT_ARTS KMessageBox::sorry(this, i18n("File not found")); - mFileName = QString::null; + mFileName = TQString::null; return false; #else return true; |