• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kalarm

  • sources
  • kde-4.14
  • kdepim
  • kalarm
sounddlg.cpp
Go to the documentation of this file.
1 /*
2  * sounddlg.cpp - sound file selection and configuration dialog and widget
3  * Program: kalarm
4  * Copyright © 2005-2012 by David Jarvie <djarvie@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #include "kalarm.h"
22 #include "sounddlg.h"
23 
24 #include "checkbox.h"
25 #include "functions.h"
26 #include "groupbox.h"
27 #include "lineedit.h"
28 #include "pushbutton.h"
29 #include "slider.h"
30 #include "soundpicker.h"
31 #include "spinbox.h"
32 
33 #include <klocale.h>
34 #include <kstandarddirs.h>
35 #include <kiconloader.h>
36 #include <khbox.h>
37 #include <kio/netaccess.h>
38 #include <phonon/mediaobject.h>
39 #include <phonon/audiooutput.h>
40 #include <kdebug.h>
41 
42 #include <QLabel>
43 #include <QDir>
44 #include <QGroupBox>
45 #include <QVBoxLayout>
46 #include <QGridLayout>
47 #include <QShowEvent>
48 #include <QResizeEvent>
49 
50 
51 // Collect these widget labels together to ensure consistent wording and
52 // translations across different modules.
53 QString SoundWidget::i18n_chk_Repeat() { return i18nc("@option:check", "Repeat"); }
54 
55 static const char SOUND_DIALOG_NAME[] = "SoundDialog";
56 
57 
58 SoundDlg::SoundDlg(const QString& file, float volume, float fadeVolume, int fadeSeconds, int repeatPause,
59  const QString& caption, QWidget* parent)
60  : KDialog(parent),
61  mReadOnly(false)
62 {
63  mSoundWidget = new SoundWidget(true, true, this);
64  setMainWidget(mSoundWidget);
65  setCaption(caption);
66  setButtons(Ok|Cancel);
67  setDefaultButton(Ok);
68 
69  // Restore the dialog size from last time
70  QSize s;
71  if (KAlarm::readConfigWindowSize(SOUND_DIALOG_NAME, s))
72  resize(s);
73 
74  // Initialise the control values
75  mSoundWidget->set(file, volume, fadeVolume, fadeSeconds, repeatPause);
76 }
77 
78 /******************************************************************************
79 * Set the read-only status of the dialog.
80 */
81 void SoundDlg::setReadOnly(bool readOnly)
82 {
83  if (readOnly != mReadOnly)
84  {
85  mSoundWidget->setReadOnly(readOnly);
86  mReadOnly = readOnly;
87  if (readOnly)
88  {
89  setButtons(Cancel);
90  setDefaultButton(Cancel);
91  }
92  else
93  {
94  setButtons(Ok|Cancel);
95  setDefaultButton(Ok);
96  }
97  }
98 }
99 
100 KUrl SoundDlg::getFile() const
101 {
102  KUrl url;
103  mSoundWidget->file(url);
104  return url;
105 }
106 
107 /******************************************************************************
108 * Called when the dialog's size has changed.
109 * Records the new size in the config file.
110 */
111 void SoundDlg::resizeEvent(QResizeEvent* re)
112 {
113  if (isVisible())
114  KAlarm::writeConfigWindowSize(SOUND_DIALOG_NAME, re->size());
115  KDialog::resizeEvent(re);
116 }
117 
118 /******************************************************************************
119 * Called when the OK or Cancel button is clicked.
120 */
121 void SoundDlg::slotButtonClicked(int button)
122 {
123  if (button == Ok)
124  {
125  if (mReadOnly)
126  reject();
127  else if (mSoundWidget->validate(true))
128  accept();
129  }
130  else
131  KDialog::slotButtonClicked(button);
132 }
133 
134 
135 /*=============================================================================
136 = Class SoundWidget
137 = Select a sound file and configure how to play it.
138 =============================================================================*/
139 QString SoundWidget::mDefaultDir;
140 
141 SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
142  : QWidget(parent),
143  mFilePlay(0),
144  mRepeatGroupBox(0),
145  mRepeatPause(0),
146  mPlayer(0),
147  mReadOnly(false),
148  mEmptyFileAllowed(false)
149 {
150  QVBoxLayout* layout = new QVBoxLayout(this);
151  layout->setMargin(0);
152  layout->setSpacing(KDialog::spacingHint());
153 
154  QLabel* label = 0;
155  if (!showPlay)
156  {
157  label = new QLabel(i18nc("@label", "Sound file:"), this);
158  layout->addWidget(label);
159  }
160 
161  KHBox* box = new KHBox(this);
162  box->setMargin(0);
163  layout->addWidget(box);
164 
165  if (showPlay)
166  {
167  // File play button
168  mFilePlay = new QPushButton(box);
169  mFilePlay->setIcon(SmallIcon(QLatin1String("media-playback-start")));
170  connect(mFilePlay, SIGNAL(clicked()), SLOT(playSound()));
171  mFilePlay->setToolTip(i18nc("@info:tooltip", "Test the sound"));
172  mFilePlay->setWhatsThis(i18nc("@info:whatsthis", "Play the selected sound file."));
173  }
174 
175  // File name edit box
176  mFileEdit = new LineEdit(LineEdit::Url, box);
177  mFileEdit->setAcceptDrops(true);
178  mFileEdit->setWhatsThis(i18nc("@info:whatsthis", "Enter the name or URL of a sound file to play."));
179  if (label)
180  label->setBuddy(mFileEdit);
181  connect(mFileEdit, SIGNAL(textChanged(QString)), SIGNAL(changed()));
182 
183  // File browse button
184  mFileBrowseButton = new PushButton(box);
185  mFileBrowseButton->setIcon(KIcon(SmallIcon(QLatin1String("document-open"))));
186  int size = mFileBrowseButton->sizeHint().height();
187  mFileBrowseButton->setFixedSize(size, size);
188  connect(mFileBrowseButton, SIGNAL(clicked()), SLOT(slotPickFile()));
189  mFileBrowseButton->setToolTip(i18nc("@info:tooltip", "Choose a file"));
190  mFileBrowseButton->setWhatsThis(i18nc("@info:whatsthis", "Select a sound file to play."));
191 
192  if (mFilePlay)
193  {
194  int size = qMax(mFilePlay->sizeHint().height(), mFileBrowseButton->sizeHint().height());
195  mFilePlay->setFixedSize(size, size);
196  mFileBrowseButton->setFixedSize(size, size);
197  }
198 
199  if (showRepeat)
200  {
201  // Sound repetition checkbox
202  mRepeatGroupBox = new GroupBox(i18n_chk_Repeat(), this);
203  mRepeatGroupBox->setCheckable(true);
204  mRepeatGroupBox->setWhatsThis(i18nc("@info:whatsthis", "If checked, the sound file will be played repeatedly for as long as the message is displayed."));
205  connect(mRepeatGroupBox, SIGNAL(toggled(bool)), SIGNAL(changed()));
206  layout->addWidget(mRepeatGroupBox);
207  QVBoxLayout* glayout = new QVBoxLayout(mRepeatGroupBox);
208 
209  // Pause between repetitions
210  KHBox* box = new KHBox(mRepeatGroupBox);
211  box->setMargin(0);
212  box->setSpacing(KDialog::spacingHint());
213  glayout->addWidget(box);
214  label = new QLabel(i18nc("@label:spinbox Length of time to pause between repetitions", "Pause between repetitions:"), box);
215  label->setFixedSize(label->sizeHint());
216  mRepeatPause = new SpinBox(0, 999, box);
217  mRepeatPause->setSingleShiftStep(10);
218  mRepeatPause->setFixedSize(mRepeatPause->sizeHint());
219  label->setBuddy(mRepeatPause);
220  connect(mRepeatPause, SIGNAL(valueChanged(int)), SIGNAL(changed()));
221  label = new QLabel(i18nc("@label", "seconds"), box);
222  label->setFixedSize(label->sizeHint());
223  box->setWhatsThis(i18nc("@info:whatsthis", "Enter how many seconds to pause between repetitions."));
224  }
225 
226  // Volume
227  QGroupBox* group = new QGroupBox(i18nc("@title:group Sound volume", "Volume"), this);
228  layout->addWidget(group);
229  QGridLayout* grid = new QGridLayout(group);
230  grid->setMargin(KDialog::marginHint());
231  grid->setSpacing(KDialog::spacingHint());
232  grid->setColumnStretch(2, 1);
233  int indentWidth = 3 * KDialog::spacingHint();
234  grid->setColumnMinimumWidth(0, indentWidth);
235  grid->setColumnMinimumWidth(1, indentWidth);
236 
237  // 'Set volume' checkbox
238  box = new KHBox(group);
239  box->setMargin(0);
240  box->setSpacing(KDialog::spacingHint());
241  grid->addWidget(box, 1, 0, 1, 3);
242  mVolumeCheckbox = new CheckBox(i18nc("@option:check", "Set volume"), box);
243  mVolumeCheckbox->setFixedSize(mVolumeCheckbox->sizeHint());
244  connect(mVolumeCheckbox, SIGNAL(toggled(bool)), SLOT(slotVolumeToggled(bool)));
245  mVolumeCheckbox->setWhatsThis(i18nc("@info:whatsthis", "Select to choose the volume for playing the sound file."));
246 
247  // Volume slider
248  mVolumeSlider = new Slider(0, 100, 10, Qt::Horizontal, box);
249  mVolumeSlider->setTickPosition(QSlider::TicksBelow);
250  mVolumeSlider->setTickInterval(10);
251  mVolumeSlider->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
252  mVolumeSlider->setWhatsThis(i18nc("@info:whatsthis", "Choose the volume for playing the sound file."));
253  mVolumeCheckbox->setFocusWidget(mVolumeSlider);
254  connect(mVolumeSlider, SIGNAL(valueChanged(int)), SIGNAL(changed()));
255 
256  // Fade checkbox
257  mFadeCheckbox = new CheckBox(i18nc("@option:check", "Fade"), group);
258  mFadeCheckbox->setFixedSize(mFadeCheckbox->sizeHint());
259  connect(mFadeCheckbox, SIGNAL(toggled(bool)), SLOT(slotFadeToggled(bool)));
260  mFadeCheckbox->setWhatsThis(i18nc("@info:whatsthis", "Select to fade the volume when the sound file first starts to play."));
261  grid->addWidget(mFadeCheckbox, 2, 1, 1, 2, Qt::AlignLeft);
262 
263  // Fade time
264  mFadeBox = new KHBox(group);
265  mFadeBox->setMargin(0);
266  mFadeBox->setSpacing(KDialog::spacingHint());
267  grid->addWidget(mFadeBox, 3, 2, Qt::AlignLeft);
268  label = new QLabel(i18nc("@label:spinbox Time period over which to fade the sound", "Fade time:"), mFadeBox);
269  label->setFixedSize(label->sizeHint());
270  mFadeTime = new SpinBox(1, 999, mFadeBox);
271  mFadeTime->setSingleShiftStep(10);
272  mFadeTime->setFixedSize(mFadeTime->sizeHint());
273  label->setBuddy(mFadeTime);
274  connect(mFadeTime, SIGNAL(valueChanged(int)), SIGNAL(changed()));
275  label = new QLabel(i18nc("@label", "seconds"), mFadeBox);
276  label->setFixedSize(label->sizeHint());
277  mFadeBox->setWhatsThis(i18nc("@info:whatsthis", "Enter how many seconds to fade the sound before reaching the set volume."));
278 
279  // Fade slider
280  mFadeVolumeBox = new KHBox(group);
281  mFadeVolumeBox->setMargin(0);
282  mFadeVolumeBox->setSpacing(KDialog::spacingHint());
283  grid->addWidget(mFadeVolumeBox, 4, 2);
284  label = new QLabel(i18nc("@label:slider", "Initial volume:"), mFadeVolumeBox);
285  label->setFixedSize(label->sizeHint());
286  mFadeSlider = new Slider(0, 100, 10, Qt::Horizontal, mFadeVolumeBox);
287  mFadeSlider->setTickPosition(QSlider::TicksBelow);
288  mFadeSlider->setTickInterval(10);
289  mFadeSlider->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
290  label->setBuddy(mFadeSlider);
291  connect(mFadeSlider, SIGNAL(valueChanged(int)), SIGNAL(changed()));
292  mFadeVolumeBox->setWhatsThis(i18nc("@info:whatsthis", "Choose the initial volume for playing the sound file."));
293 
294  slotVolumeToggled(false);
295 }
296 
297 SoundWidget::~SoundWidget()
298 {
299  delete mPlayer; // this stops playing if not already stopped
300  mPlayer = 0;
301 }
302 
303 /******************************************************************************
304 * Set the controls' values.
305 */
306 void SoundWidget::set(const QString& file, float volume, float fadeVolume, int fadeSeconds, int repeatPause)
307 {
308  // Initialise the control values
309  mFileEdit->setText(KAlarm::pathOrUrl(file));
310  if (mRepeatGroupBox)
311  {
312  mRepeatGroupBox->setChecked(repeatPause >= 0);
313  mRepeatPause->setValue(repeatPause >= 0 ? repeatPause : 0);
314  }
315  mVolumeCheckbox->setChecked(volume >= 0);
316  mVolumeSlider->setValue(volume >= 0 ? static_cast<int>(volume*100) : 100);
317  mFadeCheckbox->setChecked(fadeVolume >= 0);
318  mFadeSlider->setValue(fadeVolume >= 0 ? static_cast<int>(fadeVolume*100) : 100);
319  mFadeTime->setValue(fadeSeconds);
320  slotVolumeToggled(volume >= 0);
321 }
322 
323 /******************************************************************************
324 * Set the read-only status of the widget.
325 */
326 void SoundWidget::setReadOnly(bool readOnly)
327 {
328  if (readOnly != mReadOnly)
329  {
330  mFileEdit->setReadOnly(readOnly);
331  mFileBrowseButton->setReadOnly(readOnly);
332  if (mRepeatGroupBox)
333  mRepeatGroupBox->setReadOnly(readOnly);
334  mVolumeCheckbox->setReadOnly(readOnly);
335  mVolumeSlider->setReadOnly(readOnly);
336  mFadeCheckbox->setReadOnly(readOnly);
337  mFadeTime->setReadOnly(readOnly);
338  mFadeSlider->setReadOnly(readOnly);
339  mReadOnly = readOnly;
340  }
341 }
342 
343 /******************************************************************************
344 * Return the file name typed in the edit field.
345 */
346 QString SoundWidget::fileName() const
347 {
348  return mFileEdit->text();
349 }
350 
351 /******************************************************************************
352 * Validate the entered file and return it.
353 */
354 bool SoundWidget::file(KUrl& url, bool showErrorMessage) const
355 {
356  bool result = validate(showErrorMessage);
357  url = mUrl;
358  return result;
359 }
360 
361 /******************************************************************************
362 * Return the entered repetition and volume settings:
363 * 'volume' is in range 0 - 1, or < 0 if volume is not to be set.
364 * 'fadeVolume is similar, with 'fadeTime' set to the fade interval in seconds.
365 */
366 void SoundWidget::getVolume(float& volume, float& fadeVolume, int& fadeSeconds) const
367 {
368  volume = mVolumeCheckbox->isChecked() ? (float)mVolumeSlider->value() / 100 : -1;
369  if (mFadeCheckbox->isChecked())
370  {
371  fadeVolume = (float)mFadeSlider->value() / 100;
372  fadeSeconds = mFadeTime->value();
373  }
374  else
375  {
376  fadeVolume = -1;
377  fadeSeconds = 0;
378  }
379 }
380 
381 /******************************************************************************
382 * Return the entered repetition setting.
383 * Reply = seconds to pause between repetitions, or -1 if no repeat.
384 */
385 int SoundWidget::repeatPause() const
386 {
387  return mRepeatGroupBox && mRepeatGroupBox->isChecked() ? mRepeatPause->value() : -1;
388 }
389 
390 /******************************************************************************
391 * Called when the dialog's size has changed.
392 * Records the new size in the config file.
393 */
394 void SoundWidget::resizeEvent(QResizeEvent* re)
395 {
396  mVolumeSlider->resize(mFadeSlider->size());
397  QWidget::resizeEvent(re);
398 }
399 
400 void SoundWidget::showEvent(QShowEvent* se)
401 {
402  mVolumeSlider->resize(mFadeSlider->size());
403  QWidget::showEvent(se);
404 }
405 
406 /******************************************************************************
407 * Called when the file browser button is clicked.
408 */
409 void SoundWidget::slotPickFile()
410 {
411  QString url = SoundPicker::browseFile(mDefaultDir, mFileEdit->text());
412  if (!url.isEmpty())
413  mFileEdit->setText(KAlarm::pathOrUrl(url));
414 }
415 
416 /******************************************************************************
417 * Called when the file play or stop button is clicked.
418 */
419 void SoundWidget::playSound()
420 {
421  if (mPlayer)
422  {
423  // The file is currently playing. Stop it.
424  playFinished();
425  return;
426  }
427  if (!validate(true))
428  return;
429 #if 0
430 #warning Phonon::createPlayer() does not work
431  mPlayer = Phonon::createPlayer(Phonon::MusicCategory, mUrl);
432  mPlayer->setParent(this);
433 #else
434  mPlayer = new Phonon::MediaObject(this);
435  Phonon::AudioOutput* output = new Phonon::AudioOutput(Phonon::MusicCategory, mPlayer);
436  mPlayer->setCurrentSource(mUrl);
437  Phonon::createPath(mPlayer, output);
438 #endif
439  connect(mPlayer, SIGNAL(finished()), SLOT(playFinished()));
440  mFilePlay->setIcon(SmallIcon(QLatin1String("media-playback-stop"))); // change the play button to a stop button
441  mFilePlay->setToolTip(i18nc("@info:tooltip", "Stop sound"));
442  mFilePlay->setWhatsThis(i18nc("@info:whatsthis", "Stop playing the sound"));
443  mPlayer->play();
444 }
445 
446 /******************************************************************************
447 * Called when playing the file has completed, or to stop playing.
448 */
449 void SoundWidget::playFinished()
450 {
451  delete mPlayer; // this stops playing if not already stopped
452  mPlayer = 0;
453  mFilePlay->setIcon(SmallIcon(QLatin1String("media-playback-start")));
454  mFilePlay->setToolTip(i18nc("@info:tooltip", "Test the sound"));
455  mFilePlay->setWhatsThis(i18nc("@info:whatsthis", "Play the selected sound file."));
456 }
457 
458 /******************************************************************************
459 * Check whether the specified sound file exists.
460 */
461 bool SoundWidget::validate(bool showErrorMessage) const
462 {
463  QString file = mFileEdit->text();
464  if (file == mValidatedFile && !file.isEmpty())
465  return true;
466  mValidatedFile = file;
467  if (file.isEmpty() && mEmptyFileAllowed)
468  {
469  mUrl.clear();
470  return true;
471  }
472  KAlarm::FileErr err = KAlarm::checkFileExists(file, mUrl);
473  if (err == KAlarm::FileErr_None)
474  return true;
475  if (err == KAlarm::FileErr_Nonexistent)
476  {
477  mUrl = KUrl(file);
478  if (mUrl.isLocalFile() && !file.startsWith(QLatin1String("/")))
479  {
480  // It's a relative path.
481  // Find the first sound resource that contains files.
482  QStringList soundDirs = KGlobal::dirs()->resourceDirs("sound");
483  if (!soundDirs.isEmpty())
484  {
485  QDir dir;
486  dir.setFilter(QDir::Files | QDir::Readable);
487  for (int i = 0, end = soundDirs.count(); i < end; ++i)
488  {
489  dir = soundDirs[i];
490  if (dir.isReadable() && dir.count() > 2)
491  {
492  mUrl.setPath(soundDirs[i]);
493  mUrl.addPath(file);
494  QString f = mUrl.toLocalFile();
495  err = KAlarm::checkFileExists(f, mUrl);
496  if (err == KAlarm::FileErr_None)
497  return true;
498  if (err != KAlarm::FileErr_Nonexistent)
499  {
500  file = f; // for inclusion in error message
501  break;
502  }
503  }
504  }
505  }
506  if (err == KAlarm::FileErr_Nonexistent)
507  {
508  mUrl.setPath(QDir::homePath());
509  mUrl.addPath(file);
510  QString f = mUrl.toLocalFile();
511  err = KAlarm::checkFileExists(f, mUrl);
512  if (err == KAlarm::FileErr_None)
513  return true;
514  if (err != KAlarm::FileErr_Nonexistent)
515  file = f; // for inclusion in error message
516  }
517  }
518  }
519  mFileEdit->setFocus();
520  if (showErrorMessage
521  && KAlarm::showFileErrMessage(file, err, KAlarm::FileErr_BlankPlay, const_cast<SoundWidget*>(this)))
522  return true;
523  mValidatedFile.clear();
524  mUrl.clear();
525  return false;
526 }
527 
528 /******************************************************************************
529 * Called when the Set Volume checkbox is toggled.
530 */
531 void SoundWidget::slotVolumeToggled(bool on)
532 {
533  mVolumeSlider->setEnabled(on);
534  mFadeCheckbox->setEnabled(on);
535  slotFadeToggled(on && mFadeCheckbox->isChecked());
536 }
537 
538 /******************************************************************************
539 * Called when the Fade checkbox is toggled.
540 */
541 void SoundWidget::slotFadeToggled(bool on)
542 {
543  mFadeBox->setEnabled(on);
544  mFadeVolumeBox->setEnabled(on);
545  emit changed();
546 }
547 #include "moc_sounddlg.cpp"
548 // vim: et sw=4:
QWidget::layout
QLayout * layout() const
SoundWidget::changed
void changed()
CheckBox::setReadOnly
virtual void setReadOnly(bool readOnly)
SOUND_DIALOG_NAME
static const char SOUND_DIALOG_NAME[]
Definition: sounddlg.cpp:55
QResizeEvent
QWidget
SoundWidget::repeatPause
int repeatPause() const
Definition: sounddlg.cpp:385
SoundWidget::validate
bool validate(bool showErrorMessage) const
Definition: sounddlg.cpp:461
SoundWidget::getVolume
void getVolume(float &volume, float &fadeVolume, int &fadeSeconds) const
Definition: sounddlg.cpp:366
QPushButton::sizeHint
virtual QSize sizeHint() const
LineEdit::setText
virtual void setText(const QString &str)
SoundWidget::showEvent
virtual void showEvent(QShowEvent *)
Definition: sounddlg.cpp:400
QGridLayout::addWidget
void addWidget(QWidget *widget, int row, int column, QFlags< Qt::AlignmentFlag > alignment)
SoundDlg::resizeEvent
virtual void resizeEvent(QResizeEvent *)
Definition: sounddlg.cpp:111
CheckBox::setFocusWidget
void setFocusWidget(QWidget *widget, bool enable=true)
Phonon::MediaObject::play
void play()
QSizePolicy
SoundDlg::getFile
KUrl getFile() const
Definition: sounddlg.cpp:100
QCheckBox::sizeHint
virtual QSize sizeHint() const
PushButton::setReadOnly
virtual void setReadOnly(bool readOnly, bool noHighlight=false)
lineedit.h
SoundWidget::file
bool file(KUrl &, bool showErrorMessage=true) const
Definition: sounddlg.cpp:354
SoundWidget::resizeEvent
virtual void resizeEvent(QResizeEvent *)
Definition: sounddlg.cpp:394
QGridLayout
KDialog
SoundWidget::i18n_chk_Repeat
static QString i18n_chk_Repeat()
Definition: sounddlg.cpp:53
QDir::isReadable
bool isReadable() const
Phonon::createPlayer
MediaObject * createPlayer(Phonon::Category category, const MediaSource &source)
checkbox.h
groupbox.h
QDir::homePath
QString homePath()
LineEdit::text
QString text() const
QAbstractButton::setIcon
void setIcon(const QIcon &icon)
SoundPicker::browseFile
static QString browseFile(QString &initialDir, const QString &initialFile=QString())
Display a dialog to choose a sound file, initially highlighting initialFile if non-null.
Definition: soundpicker.cpp:321
QGridLayout::setSpacing
void setSpacing(int spacing)
QDir::count
uint count() const
PushButton
QString::clear
void clear()
QLabel::setBuddy
void setBuddy(QWidget *buddy)
SoundDlg::SoundDlg
SoundDlg(const QString &file, float volume, float fadeVolume, int fadeSeconds, int repeatPause, const QString &caption, QWidget *parent)
Definition: sounddlg.cpp:58
QWidget::size
QSize size() const
pushbutton.h
SoundWidget::SoundWidget
SoundWidget(bool showPlay, bool showRepeat, QWidget *parent)
Definition: sounddlg.cpp:141
SoundWidget::set
void set(const QString &file, float volume, float fadeVolume=-1, int fadeSeconds=0, int repeatPause=-1)
Definition: sounddlg.cpp:306
QDir::setFilter
void setFilter(QFlags< QDir::Filter > filters)
QWidget::setEnabled
void setEnabled(bool)
QBoxLayout::addWidget
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
QWidget::showEvent
virtual void showEvent(QShowEvent *event)
QList::count
int count(const T &value) const
QGroupBox::setChecked
void setChecked(bool checked)
QGroupBox
LineEdit
CheckBox
QShowEvent
Phonon::MediaObject
QList::isEmpty
bool isEmpty() const
SoundWidget::~SoundWidget
~SoundWidget()
Definition: sounddlg.cpp:297
QString::isEmpty
bool isEmpty() const
QString::startsWith
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
QVBoxLayout
SoundWidget
Definition: sounddlg.h:41
GroupBox::setReadOnly
virtual void setReadOnly(bool readOnly)
SoundDlg::setReadOnly
void setReadOnly(bool)
Definition: sounddlg.cpp:81
QString
SoundWidget::fileName
QString fileName() const
Definition: sounddlg.cpp:346
QSlider::setTickPosition
void setTickPosition(TickPosition position)
QLayout::setMargin
void setMargin(int margin)
QWidget::setSizePolicy
void setSizePolicy(QSizePolicy)
QStringList
Phonon::createPath
Path createPath(MediaNode *source, MediaNode *sink)
QResizeEvent::size
const QSize & size() const
QObject::setParent
void setParent(QObject *parent)
SpinBox
QSize
QAbstractSpinBox::setReadOnly
void setReadOnly(bool r)
QWidget::setFixedSize
void setFixedSize(const QSize &s)
Phonon::MediaObject::setCurrentSource
void setCurrentSource(const MediaSource &source)
LineEdit::Url
QAbstractSlider::setValue
void setValue(int)
GroupBox
QDir
QAbstractButton::setChecked
void setChecked(bool)
QWidget::setWhatsThis
void setWhatsThis(const QString &)
QAbstractSpinBox::sizeHint
virtual QSize sizeHint() const
slider.h
QLatin1String
sounddlg.h
functions.h
miscellaneous functions
QGridLayout::setColumnStretch
void setColumnStretch(int column, int stretch)
QSpinBox::setValue
void setValue(int val)
QGroupBox::setCheckable
void setCheckable(bool checkable)
SoundWidget::setReadOnly
void setReadOnly(bool)
Definition: sounddlg.cpp:326
kalarm.h
QGridLayout::setColumnMinimumWidth
void setColumnMinimumWidth(int column, int minSize)
QLabel::sizeHint
virtual QSize sizeHint() const
QSize::height
int height() const
soundpicker.h
QPushButton
Phonon::AudioOutput
KHBox
QSlider::setTickInterval
void setTickInterval(int ti)
QWidget::setToolTip
void setToolTip(const QString &)
Slider
QWidget::resizeEvent
virtual void resizeEvent(QResizeEvent *event)
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QLabel
spinbox.h
QBoxLayout::setSpacing
void setSpacing(int spacing)
SoundDlg::slotButtonClicked
virtual void slotButtonClicked(int button)
Definition: sounddlg.cpp:121
Slider::setReadOnly
virtual void setReadOnly(bool readOnly)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kalarm

Skip menu "kalarm"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal