Commit 8ecdaec7 authored by David Jarvie's avatar David Jarvie

Tidy up

parent 31bea3a3
......@@ -50,7 +50,6 @@
#include <AkonadiCore/itemfetchscope.h>
#include <AkonadiWidgets/agenttypedialog.h>
#include <QDebug>
#include <KUrl>
#include <KLocalizedString>
#include <kcolorutils.h>
......@@ -59,6 +58,7 @@
#include <QApplication>
#include <QFileInfo>
#include <QTimer>
#include <QDebug>
using namespace Akonadi;
using namespace KAlarmCal;
......
......@@ -34,8 +34,6 @@
#include <QMap>
#include <QQueue>
namespace Akonadi {
}
class QPixmap;
class KJob;
......
......@@ -27,8 +27,8 @@
#include <AkonadiCore/agentfilterproxymodel.h>
#include <AkonadiCore/agentinstancecreatejob.h>
#include <AkonadiCore/agentmanager.h>
#include <AkonadiWidgets/agenttypedialog.h>
#include <AkonadiCore/dbusconnectionpool.h>
#include <AkonadiWidgets/agenttypedialog.h>
#include <kmessagebox.h>
#include <KLocalizedString>
......
......@@ -24,7 +24,6 @@
#include <ksharedconfig.h>
#include <kconfiggroup.h>
#include <kglobal.h>
#include <KSharedConfig>
#include <QHeaderView>
#include <QApplication>
......
......@@ -123,11 +123,11 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
// Time edit box and Any time checkbox
QWidget* timeBox = new QWidget(topWidget);
QHBoxLayout *timeBoxHBoxLayout = new QHBoxLayout(timeBox);
timeBoxHBoxLayout->setMargin(0);
timeBoxHBoxLayout->setSpacing(2*KDialog::spacingHint());
QHBoxLayout* timeBoxHLayout = new QHBoxLayout(timeBox);
timeBoxHLayout->setMargin(0);
timeBoxHLayout->setSpacing(2*KDialog::spacingHint());
mTimeEdit = new TimeEdit(timeBox);
timeBoxHBoxLayout->addWidget(mTimeEdit);
timeBoxHLayout->addWidget(mTimeEdit);
mTimeEdit->setFixedSize(mTimeEdit->sizeHint());
connect(mTimeEdit, SIGNAL(valueChanged(int)), SLOT(dateTimeChanged()));
mTimeEdit->setWhatsThis(xi18nc("@info:whatsthis",
......@@ -145,7 +145,7 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
{
mAnyTimeAllowed = true;
mAnyTimeCheckBox = new CheckBox(i18nc("@option:check", "Any time"), timeBox);
timeBoxHBoxLayout->addWidget(mAnyTimeCheckBox);
timeBoxHLayout->addWidget(mAnyTimeCheckBox);
mAnyTimeCheckBox->setFixedSize(mAnyTimeCheckBox->sizeHint());
connect(mAnyTimeCheckBox, SIGNAL(toggled(bool)), SLOT(slotAnyTimeToggled(bool)));
mAnyTimeCheckBox->setWhatsThis(i18nc("@info:whatsthis",
......@@ -210,14 +210,12 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
// Time zone selector
mTimeZoneBox = new QWidget(topWidget); // this is to control the QWhatsThis text display area
QHBoxLayout *mTimeZoneBoxHBoxLayout = new QHBoxLayout(mTimeZoneBox);
mTimeZoneBoxHBoxLayout->setMargin(0);
mTimeZoneBoxHBoxLayout->setMargin(0);
mTimeZoneBoxHBoxLayout->setSpacing(KDialog::spacingHint());
QHBoxLayout* hlayout = new QHBoxLayout(mTimeZoneBox);
hlayout->setMargin(0);
QLabel* label = new QLabel(i18nc("@label:listbox", "Time zone:"), mTimeZoneBox);
mTimeZoneBoxHBoxLayout->addWidget(label);
hlayout->addWidget(label);
mTimeZone = new TimeZoneCombo(mTimeZoneBox);
mTimeZoneBoxHBoxLayout->addWidget(mTimeZone);
hlayout->addWidget(mTimeZone);
mTimeZone->setMaxVisibleItems(15);
connect(mTimeZone, SIGNAL(activated(int)), SLOT(slotTimeZoneChanged()));
mTimeZoneBox->setWhatsThis(i18nc("@info:whatsthis", "Select the time zone to use for this alarm."));
......
......@@ -26,7 +26,6 @@
class QAbstractButton;
class KDateComboBox;
class ButtonGroup;
class RadioButton;
class CheckBox;
......@@ -95,7 +94,7 @@ class AlarmTimeWidget : public QFrame
TimeEdit* mTimeEdit;
TimeSpinBox* mDelayTimeEdit;
PushButton* mTimeZoneButton;
QWidget * mTimeZoneBox; // contains label and time zone combo box
QWidget* mTimeZoneBox; // contains label and time zone combo box
CheckBox* mNoTimeZone;
TimeZoneCombo* mTimeZone;
KDateTime mMinDateTime; // earliest allowed date/time
......
......@@ -27,13 +27,12 @@
#include <kalarmcal/compatibilityattribute.h>
#include <AkonadiCore/agentmanager.h>
#include <AkonadiWidgets/collectiondialog.h>
#include <AkonadiCore/collectiondeletejob.h>
#include <AkonadiCore/collectionmodifyjob.h>
#include <AkonadiCore/entitymimetypefiltermodel.h>
#include <AkonadiWidgets/collectiondialog.h>
#include <KLocalizedString>
#include <QDebug>
#include <KUrl>
#include <KSharedConfig>
......@@ -43,6 +42,7 @@
#include <QToolTip>
#include <QTimer>
#include <QObject>
#include <QDebug>
using namespace Akonadi;
using namespace KAlarmCal;
......
......@@ -29,9 +29,8 @@
#include <AkonadiCore/itemfetchjob.h>
#include <AkonadiCore/itemdeletejob.h>
#include <QDebug>
#include <QTimer>
#include <QDebug>
using namespace Akonadi;
......
......@@ -145,15 +145,13 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
{
// Display type combo box
QWidget* box = new QWidget(parent); // to group widgets for QWhatsThis text
QHBoxLayout *boxHBoxLayout = new QHBoxLayout(box);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setSpacing(KDialog::spacingHint());
QHBoxLayout* boxHLayout = new QHBoxLayout(box);
boxHLayout->setMargin(0);
QLabel* label = new QLabel(i18nc("@label:listbox", "Display type:"), box);
boxHBoxLayout->addWidget(label);
boxHLayout->addWidget(label);
label->setFixedSize(label->sizeHint());
mTypeCombo = new ComboBox(box);
boxHBoxLayout->addWidget(mTypeCombo);
boxHLayout->addWidget(mTypeCombo);
QString textItem = i18nc("@item:inlistbox", "Text message");
QString fileItem = i18nc("@item:inlistbox", "File contents");
QString commandItem = i18nc("@item:inlistbox", "Command output");
......@@ -182,7 +180,7 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
"<item><interface>%2</interface>: the alarm will display the contents of a text or image file.</item>"
"<item><interface>%3</interface>: the alarm will display the output from a command.</item></list></para>",
textItem, fileItem, commandItem));
boxHBoxLayout->setStretchFactor(new QWidget(box), 1); // left adjust the control
boxHLayout->setStretchFactor(new QWidget(box), 1); // left adjust the control
frameLayout->addWidget(box);
// Text message edit box
......@@ -194,19 +192,19 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
// File name edit box
mFileBox = new QWidget(parent);
QHBoxLayout *mFileBoxHBoxLayout = new QHBoxLayout(mFileBox);
mFileBoxHBoxLayout->setMargin(0);
mFileBoxHBoxLayout->setMargin(0);
frameLayout->addWidget(mFileBox);
QHBoxLayout* fileBoxHLayout = new QHBoxLayout(mFileBox);
fileBoxHLayout->setMargin(0);
fileBoxHLayout->setSpacing(0);
mFileMessageEdit = new LineEdit(LineEdit::Url, mFileBox);
mFileBoxHBoxLayout->addWidget(mFileMessageEdit);
fileBoxHLayout->addWidget(mFileMessageEdit);
mFileMessageEdit->setAcceptDrops(true);
mFileMessageEdit->setWhatsThis(i18nc("@info:whatsthis", "Enter the name or URL of a text or image file to display."));
connect(mFileMessageEdit, SIGNAL(textChanged(QString)), SLOT(contentsChanged()));
// File browse button
mFileBrowseButton = new QPushButton(mFileBox);
mFileBoxHBoxLayout->addWidget(mFileBrowseButton);
fileBoxHLayout->addWidget(mFileBrowseButton);
mFileBrowseButton->setIcon(SmallIcon(QLatin1String("document-open")));
int size = mFileBrowseButton->sizeHint().height();
mFileBrowseButton->setFixedSize(size, size);
......@@ -249,9 +247,9 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
// Top-adjust the controls
mFilePadding = new QWidget(parent);
QHBoxLayout *mFilePaddingHBoxLayout = new QHBoxLayout(mFilePadding);
mFilePaddingHBoxLayout->setMargin(0);
mFilePaddingHBoxLayout->setMargin(0);
hlayout = new QHBoxLayout(mFilePadding);
hlayout->setMargin(0);
hlayout->setSpacing(0);
frameLayout->addWidget(mFilePadding);
frameLayout->setStretchFactor(mFilePadding, 1);
}
......@@ -793,12 +791,12 @@ void EditCommandAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
// Log file name edit box
QWidget* box = new QWidget(mCmdOutputBox);
QHBoxLayout *boxHBoxLayout = new QHBoxLayout(box);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setMargin(0);
QHBoxLayout* boxHLayout = new QHBoxLayout(box);
boxHLayout->setMargin(0);
boxHLayout->setSpacing(0);
(new QWidget(box))->setFixedWidth(mCmdExecInTerm->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth)); // indent the edit box
mCmdLogFileEdit = new LineEdit(LineEdit::Url, box);
boxHBoxLayout->addWidget(mCmdLogFileEdit);
boxHLayout->addWidget(mCmdLogFileEdit);
mCmdLogFileEdit->setAcceptDrops(true);
mCmdLogFileEdit->setWhatsThis(i18nc("@info:whatsthis", "Enter the name or path of the log file."));
connect(mCmdLogFileEdit, SIGNAL(textChanged(QString)), SLOT(contentsChanged()));
......@@ -806,7 +804,7 @@ void EditCommandAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
// Log file browse button.
// The file browser dialog is activated by the PickLogFileRadio class.
QPushButton* browseButton = new QPushButton(box);
boxHBoxLayout->addWidget(browseButton);
boxHLayout->addWidget(browseButton);
browseButton->setIcon(SmallIcon(QLatin1String("document-open")));
int size = browseButton->sizeHint().height();
browseButton->setFixedSize(size, size);
......@@ -831,9 +829,9 @@ void EditCommandAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
// Top-adjust the controls
mCmdPadding = new QWidget(parent);
QHBoxLayout *mCmdPaddingHBoxLayout = new QHBoxLayout(mCmdPadding);
mCmdPaddingHBoxLayout->setMargin(0);
mCmdPaddingHBoxLayout->setMargin(0);
QHBoxLayout* hlayout = new QHBoxLayout(mCmdPadding);
hlayout->setMargin(0);
hlayout->setSpacing(0);
frameLayout->addWidget(mCmdPadding);
frameLayout->setStretchFactor(mCmdPadding, 1);
}
......@@ -1533,9 +1531,9 @@ void EditAudioAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
// Top-adjust the controls
mPadding = new QWidget(parent);
QHBoxLayout *mPaddingHBoxLayout = new QHBoxLayout(mPadding);
mPaddingHBoxLayout->setMargin(0);
mPaddingHBoxLayout->setMargin(0);
QHBoxLayout* hlayout = new QHBoxLayout(mPadding);
hlayout->setMargin(0);
hlayout->setSpacing(0);
frameLayout->addWidget(mPadding);
frameLayout->setStretchFactor(mPadding, 1);
}
......
......@@ -27,13 +27,11 @@
#include <kalarmcal/alarmtext.h>
#include <kalarmcal/kaevent.h>
#include <kurl.h>
class QAbstractButton;
class QGroupBox;
class KComboBox;
class EmailIdCombo;
class CheckBox;
class ComboBox;
......@@ -100,8 +98,8 @@ class EditDisplayAlarmDlg : public EditAlarmDlg
// Display alarm options
ComboBox* mTypeCombo;
QWidget * mFileBox;
QWidget * mFilePadding;
QWidget* mFileBox;
QWidget* mFilePadding;
SoundPicker* mSoundPicker;
CheckBox* mConfirmAck;
FontColourButton* mFontColourButton;
......@@ -184,7 +182,7 @@ class EditCommandAlarmDlg : public EditAlarmDlg
PickLogFileRadio* mCmdLogToFile;
RadioButton* mCmdDiscardOutput;
LineEdit* mCmdLogFileEdit; // log file URL edit box
QWidget * mCmdPadding;
QWidget* mCmdPadding;
// Initial state of all controls
bool mSavedCmdScript; // mCmdEdit->isScript() status
......@@ -299,7 +297,7 @@ class EditAudioAlarmDlg : public EditAlarmDlg
// Audio alarm options
SoundWidget* mSoundConfig;
QWidget * mPadding; // allow top-adjustment of controls
QWidget* mPadding; // allow top-adjustment of controls
// Initial state of all controls
QString mSavedFile; // sound file
......
......@@ -62,34 +62,32 @@ FontColourChooser::FontColourChooser(QWidget *parent,
if (fg)
{
QWidget* box = new QWidget(page); // to group widgets for QWhatsThis text
QHBoxLayout *boxHBoxLayout = new QHBoxLayout(box);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setSpacing(KDialog::spacingHint()/2);
colourLayout->addWidget(box);
QHBoxLayout* boxHLayout = new QHBoxLayout(box);
boxHLayout->setMargin(0);
boxHLayout->setSpacing(KDialog::spacingHint()/2);
QLabel* label = new QLabel(i18nc("@label:listbox", "Foreground color:"), box);
boxHBoxLayout->addWidget(label);
boxHBoxLayout->setStretchFactor(new QWidget(box), 0);
boxHLayout->addWidget(label);
boxHLayout->setStretchFactor(new QWidget(box), 0);
mFgColourButton = new ColourButton(box);
boxHBoxLayout->addWidget(mFgColourButton);
boxHLayout->addWidget(mFgColourButton);
connect(mFgColourButton, SIGNAL(changed(QColor)), SLOT(setSampleColour()));
label->setBuddy(mFgColourButton);
box->setWhatsThis(i18nc("@info:whatsthis", "Select the alarm message foreground color"));
}
QWidget* box = new QWidget(page); // to group widgets for QWhatsThis text
QHBoxLayout *boxHBoxLayout = new QHBoxLayout(box);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setSpacing(KDialog::spacingHint()/2);
colourLayout->addWidget(box);
QHBoxLayout* boxHLayout = new QHBoxLayout(box);
boxHLayout->setMargin(0);
boxHLayout->setSpacing(KDialog::spacingHint()/2);
QLabel* label = new QLabel(i18nc("@label:listbox", "Background color:"), box);
boxHBoxLayout->addWidget(label);
boxHBoxLayout->setStretchFactor(new QWidget(box), 0);
boxHLayout->addWidget(label);
boxHLayout->setStretchFactor(new QWidget(box), 0);
mBgColourButton = new ColourButton(box);
boxHBoxLayout->addWidget(mBgColourButton);
boxHLayout->addWidget(mBgColourButton);
connect(mBgColourButton, SIGNAL(changed(QColor)), SLOT(setSampleColour()));
label->setBuddy(mBgColourButton);
box->setWhatsThis(i18nc("@info:whatsthis", "Select the alarm message background color"));
......
......@@ -18,7 +18,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "config-kdepim.h"
#include "kalarm.h" //krazy:exclude=includes (kalarm.h must be first)
#include "functions.h"
#include "functions_p.h"
......@@ -56,7 +55,6 @@ using namespace KCalCore;
#include <kconfiggroup.h>
#include <KSharedConfig>
#include <QAction>
#include <ktoggleaction.h>
#include <kactioncollection.h>
#include <kdbusservicestarter.h>
......@@ -79,6 +77,7 @@ using namespace KCalCore;
#include <QX11Info>
#endif
#include <QAction>
#include <QDir>
#include <QRegExp>
#include <QDesktopWidget>
......
......@@ -50,7 +50,6 @@
#include <kcodecs.h>
#include <kcharsets.h>
#include <kascii.h>
#include <KCharsets>
#include <QFile>
#include <QHostInfo>
......
......@@ -23,7 +23,6 @@
#include <kglobal.h>
#include <KLocalizedString>
#include <KLocalizedString>
#include <qdebug.h>
namespace KAlarm
......
......@@ -24,7 +24,6 @@
#include <kconfiggroup.h>
#include <ksharedconfig.h>
#include <kglobal.h>
#include <KSharedConfig>
QMap<QString, KMessageBox::ButtonCode> KAMessageBox::mContinueDefaults;
......
......@@ -53,14 +53,12 @@ using namespace KCalCore;
using namespace KCalUtils;
#include <ktoolbar.h>
#include <QAction>
#include <kactioncollection.h>
#include <ksystemtrayicon.h>
#include <kstandardaction.h>
#include <kiconloader.h>
#include <kurl.h>
#include <KLocalizedString>
#include <KLocalizedString>
#include <kglobalsettings.h>
#include <KSharedConfig>
#include <kconfiggroup.h>
......@@ -74,6 +72,7 @@ using namespace KCalUtils;
#include <KGlobal>
#include <KShortcut>
#include <QAction>
#include <QSplitter>
#include <QByteArray>
#include <QDragEnterEvent>
......
......@@ -23,8 +23,6 @@
#include <kxmlguiwindow.h>
/**
* The MainWindowBase class is a base class for KAlarm's main window and message window.
* When the window is closed, it only allows the application to quit if there is no
......
......@@ -41,7 +41,6 @@
//QT5 #include "kspeechinterface.h"
#include <QAction>
#include <kstandardguiitem.h>
#include <K4AboutData>
#include <KLocalizedString>
......@@ -66,6 +65,7 @@
#endif
#include <KGlobal>
#include <QAction>
#include <qtextbrowser.h>
#include <QPushButton>
#include <QScrollBar>
......
......@@ -38,17 +38,17 @@
#include <AkonadiCore/agentmanager.h>
#include <AkonadiCore/agentinstancecreatejob.h>
#include <AkonadiCore/agenttype.h>
#include <AkonadiWidgets/collectionpropertiesdialog.h>
#include <AkonadiCore/entitydisplayattribute.h>
#include <AkonadiWidgets/collectionpropertiesdialog.h>
#include <kdialog.h>
#include <KLocalizedString>
#include <kglobal.h>
#include <kcombobox.h>
#include <kactioncollection.h>
#include <QAction>
#include <ktoggleaction.h>
#include <QAction>
#include <QLabel>
#include <QPushButton>
#include <QTimer>
......
......@@ -161,16 +161,16 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
}
QWidget* box = new QWidget(this);
QHBoxLayout *boxHBoxLayout = new QHBoxLayout(box);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setMargin(0);
layout->addWidget(box);
QHBoxLayout* boxHLayout = new QHBoxLayout(box);
boxHLayout->setMargin(0);
boxHLayout->setSpacing(0);
if (showPlay)
{
// File play button
mFilePlay = new QPushButton(box);
boxHBoxLayout->addWidget(mFilePlay);
boxHLayout->addWidget(mFilePlay);
mFilePlay->setIcon(SmallIcon(QLatin1String("media-playback-start")));
connect(mFilePlay, SIGNAL(clicked()), SLOT(playSound()));
mFilePlay->setToolTip(i18nc("@info:tooltip", "Test the sound"));
......@@ -179,7 +179,7 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
// File name edit box
mFileEdit = new LineEdit(LineEdit::Url, box);
boxHBoxLayout->addWidget(mFileEdit);
boxHLayout->addWidget(mFileEdit);
mFileEdit->setAcceptDrops(true);
mFileEdit->setWhatsThis(i18nc("@info:whatsthis", "Enter the name or URL of a sound file to play."));
if (label)
......@@ -188,7 +188,7 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
// File browse button
mFileBrowseButton = new PushButton(box);
boxHBoxLayout->addWidget(mFileBrowseButton);
boxHLayout->addWidget(mFileBrowseButton);
mFileBrowseButton->setIcon(KIcon(SmallIcon(QLatin1String("document-open"))));
int size = mFileBrowseButton->sizeHint().height();
mFileBrowseButton->setFixedSize(size, size);
......@@ -215,22 +215,20 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
// Pause between repetitions
QWidget* box = new QWidget(mRepeatGroupBox);
boxHBoxLayout = new QHBoxLayout(box);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setSpacing(KDialog::spacingHint());
glayout->addWidget(box);
boxHLayout = new QHBoxLayout(box);
boxHLayout->setMargin(0);
label = new QLabel(i18nc("@label:spinbox Length of time to pause between repetitions", "Pause between repetitions:"), box);
boxHBoxLayout->addWidget(label);
boxHLayout->addWidget(label);
label->setFixedSize(label->sizeHint());
mRepeatPause = new SpinBox(0, 999, box);
boxHBoxLayout->addWidget(mRepeatPause);
boxHLayout->addWidget(mRepeatPause);
mRepeatPause->setSingleShiftStep(10);
mRepeatPause->setFixedSize(mRepeatPause->sizeHint());
label->setBuddy(mRepeatPause);
connect(mRepeatPause, SIGNAL(valueChanged(int)), SIGNAL(changed()));
label = new QLabel(i18nc("@label", "seconds"), box);
boxHBoxLayout->addWidget(label);
boxHLayout->addWidget(label);
label->setFixedSize(label->sizeHint());
box->setWhatsThis(i18nc("@info:whatsthis", "Enter how many seconds to pause between repetitions."));
}
......@@ -248,20 +246,18 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
// 'Set volume' checkbox
box = new QWidget(group);
boxHBoxLayout = new QHBoxLayout(box);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setSpacing(KDialog::spacingHint());
grid->addWidget(box, 1, 0, 1, 3);
boxHLayout = new QHBoxLayout(box);
boxHLayout->setMargin(0);
mVolumeCheckbox = new CheckBox(i18nc("@option:check", "Set volume"), box);
boxHBoxLayout->addWidget(mVolumeCheckbox);
boxHLayout->addWidget(mVolumeCheckbox);
mVolumeCheckbox->setFixedSize(mVolumeCheckbox->sizeHint());
connect(mVolumeCheckbox, SIGNAL(toggled(bool)), SLOT(slotVolumeToggled(bool)));
mVolumeCheckbox->setWhatsThis(i18nc("@info:whatsthis", "Select to choose the volume for playing the sound file."));
// Volume slider
mVolumeSlider = new Slider(0, 100, 10, Qt::Horizontal, box);
boxHBoxLayout->addWidget(mVolumeSlider);
boxHLayout->addWidget(mVolumeSlider);
mVolumeSlider->setTickPosition(QSlider::TicksBelow);
mVolumeSlider->setTickInterval(10);
mVolumeSlider->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
......@@ -278,37 +274,33 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
// Fade time
mFadeBox = new QWidget(group);
QHBoxLayout *mFadeBoxHBoxLayout = new QHBoxLayout(mFadeBox);
mFadeBoxHBoxLayout->setMargin(0);
mFadeBoxHBoxLayout->setMargin(0);
mFadeBoxHBoxLayout->setSpacing(KDialog::spacingHint());
grid->addWidget(mFadeBox, 3, 2, Qt::AlignLeft);
boxHLayout = new QHBoxLayout(mFadeBox);
boxHLayout->setMargin(0);
label = new QLabel(i18nc("@label:spinbox Time period over which to fade the sound", "Fade time:"), mFadeBox);
mFadeBoxHBoxLayout->addWidget(label);
boxHLayout->addWidget(label);
label->setFixedSize(label->sizeHint());
mFadeTime = new SpinBox(1, 999, mFadeBox);
mFadeBoxHBoxLayout->addWidget(mFadeTime);
boxHLayout->addWidget(mFadeTime);
mFadeTime->setSingleShiftStep(10);
mFadeTime->setFixedSize(mFadeTime->sizeHint());
label->setBuddy(mFadeTime);
connect(mFadeTime, SIGNAL(valueChanged(int)), SIGNAL(changed()));
label = new QLabel(i18nc("@label", "seconds"), mFadeBox);
mFadeBoxHBoxLayout->addWidget(label);
boxHLayout->addWidget(label);
label->setFixedSize(label->sizeHint());
mFadeBox->setWhatsThis(i18nc("@info:whatsthis", "Enter how many seconds to fade the sound before reaching the set volume."));
// Fade slider
mFadeVolumeBox = new QWidget(group);
QHBoxLayout *mFadeVolumeBoxHBoxLayout = new QHBoxLayout(mFadeVolumeBox);
mFadeVolumeBoxHBoxLayout->setMargin(0);
mFadeVolumeBoxHBoxLayout->setMargin(0);
mFadeVolumeBoxHBoxLayout->setSpacing(KDialog::spacingHint());
grid->addWidget(mFadeVolumeBox, 4, 2);
boxHLayout = new QHBoxLayout(mFadeVolumeBox);
boxHLayout->setMargin(0);
label = new QLabel(i18nc("@label:slider", "Initial volume:"), mFadeVolumeBox);
mFadeVolumeBoxHBoxLayout->addWidget(label);
boxHLayout->addWidget(label);
label->setFixedSize(label->sizeHint());
mFadeSlider = new Slider(0, 100, 10, Qt::Horizontal, mFadeVolumeBox);
mFadeVolumeBoxHBoxLayout->addWidget(mFadeSlider);
boxHLayout->addWidget(mFadeSlider);
mFadeSlider->setTickPosition(QSlider::TicksBelow);
mFadeSlider->setTickInterval(10);
mFadeSlider->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
......
......@@ -28,7 +28,6 @@
class QPushButton;
class QShowEvent;
class QResizeEvent;
namespace Phonon { class MediaObject; }
class GroupBox;
class PushButton;
......@@ -72,19 +71,19 @@ class SoundWidget : public QWidget
void playFinished();
private:
static QString mDefaultDir; // current default directory for mFileEdit
QPushButton* mFilePlay;