Commit d2b3c188 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port KH/VBox

parent df7507a8
......@@ -41,6 +41,7 @@
#include <QGroupBox>
#include <QGridLayout>
#include <QLabel>
#include <QHBoxLayout>
static const QTime time_23_59(23, 59);
......@@ -121,9 +122,12 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
mAtTimeRadio->setFocusWidget(mDateEdit);
// Time edit box and Any time checkbox
KHBox* timeBox = new KHBox(topWidget);
timeBox->setSpacing(2*KDialog::spacingHint());
QWidget* timeBox = new QWidget(topWidget);
QHBoxLayout *timeBoxHBoxLayout = new QHBoxLayout(timeBox);
timeBoxHBoxLayout->setMargin(0);
timeBoxHBoxLayout->setSpacing(2*KDialog::spacingHint());
mTimeEdit = new TimeEdit(timeBox);
timeBoxHBoxLayout->addWidget(mTimeEdit);
mTimeEdit->setFixedSize(mTimeEdit->sizeHint());
connect(mTimeEdit, SIGNAL(valueChanged(int)), SLOT(dateTimeChanged()));
mTimeEdit->setWhatsThis(xi18nc("@info:whatsthis",
......@@ -141,6 +145,7 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
{
mAnyTimeAllowed = true;
mAnyTimeCheckBox = new CheckBox(i18nc("@option:check", "Any time"), timeBox);
timeBoxHBoxLayout->addWidget(mAnyTimeCheckBox);
mAnyTimeCheckBox->setFixedSize(mAnyTimeCheckBox->sizeHint());
connect(mAnyTimeCheckBox, SIGNAL(toggled(bool)), SLOT(slotAnyTimeToggled(bool)));
mAnyTimeCheckBox->setWhatsThis(i18nc("@info:whatsthis",
......@@ -204,11 +209,15 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
layout->setSpacing(2*KDialog::spacingHint());
// Time zone selector
mTimeZoneBox = new KHBox(topWidget); // this is to control the QWhatsThis text display area
mTimeZoneBox->setMargin(0);
mTimeZoneBox->setSpacing(KDialog::spacingHint());
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());
QLabel* label = new QLabel(i18nc("@label:listbox", "Time zone:"), mTimeZoneBox);
mTimeZoneBoxHBoxLayout->addWidget(label);
mTimeZone = new TimeZoneCombo(mTimeZoneBox);
mTimeZoneBoxHBoxLayout->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,7 @@
class QAbstractButton;
class KDateComboBox;
class KHBox;
class ButtonGroup;
class RadioButton;
class CheckBox;
......@@ -95,7 +95,7 @@ class AlarmTimeWidget : public QFrame
TimeEdit* mTimeEdit;
TimeSpinBox* mDelayTimeEdit;
PushButton* mTimeZoneButton;
KHBox* 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
......
......@@ -58,7 +58,7 @@ using namespace KCalCore;
#include <kiconloader.h>
#include <kio/netaccess.h>
#include <kfileitem.h>
#include <khbox.h>
#include <QHBoxLayout>
#include <qdebug.h>
#include <QLabel>
......@@ -145,12 +145,16 @@ QString EditDisplayAlarmDlg::type_caption() const
void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
{
// Display type combo box
KHBox* box = new KHBox(parent); // to group widgets for QWhatsThis text
box->setMargin(0);
box->setSpacing(KDialog::spacingHint());
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());
QLabel* label = new QLabel(i18nc("@label:listbox", "Display type:"), box);
boxHBoxLayout->addWidget(label);
label->setFixedSize(label->sizeHint());
mTypeCombo = new ComboBox(box);
boxHBoxLayout->addWidget(mTypeCombo);
QString textItem = i18nc("@item:inlistbox", "Text message");
QString fileItem = i18nc("@item:inlistbox", "File contents");
QString commandItem = i18nc("@item:inlistbox", "Command output");
......@@ -179,7 +183,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));
box->setStretchFactor(new QWidget(box), 1); // left adjust the control
boxHBoxLayout->setStretchFactor(new QWidget(box), 1); // left adjust the control
frameLayout->addWidget(box);
// Text message edit box
......@@ -190,16 +194,20 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
frameLayout->addWidget(mTextMessageEdit);
// File name edit box
mFileBox = new KHBox(parent);
mFileBox->setMargin(0);
mFileBox = new QWidget(parent);
QHBoxLayout *mFileBoxHBoxLayout = new QHBoxLayout(mFileBox);
mFileBoxHBoxLayout->setMargin(0);
mFileBoxHBoxLayout->setMargin(0);
frameLayout->addWidget(mFileBox);
mFileMessageEdit = new LineEdit(LineEdit::Url, mFileBox);
mFileBoxHBoxLayout->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);
mFileBrowseButton->setIcon(SmallIcon(QLatin1String("document-open")));
int size = mFileBrowseButton->sizeHint().height();
mFileBrowseButton->setFixedSize(size, size);
......@@ -241,8 +249,10 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
}
// Top-adjust the controls
mFilePadding = new KHBox(parent);
mFilePadding->setMargin(0);
mFilePadding = new QWidget(parent);
QHBoxLayout *mFilePaddingHBoxLayout = new QHBoxLayout(mFilePadding);
mFilePaddingHBoxLayout->setMargin(0);
mFilePaddingHBoxLayout->setMargin(0);
frameLayout->addWidget(mFilePadding);
frameLayout->setStretchFactor(mFilePadding, 1);
}
......@@ -783,10 +793,13 @@ void EditCommandAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
vlayout->addWidget(mCmdExecInTerm, 0, Qt::AlignLeft);
// Log file name edit box
KHBox* box = new KHBox(mCmdOutputBox);
box->setMargin(0);
QWidget* box = new QWidget(mCmdOutputBox);
QHBoxLayout *boxHBoxLayout = new QHBoxLayout(box);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setMargin(0);
(new QWidget(box))->setFixedWidth(mCmdExecInTerm->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth)); // indent the edit box
mCmdLogFileEdit = new LineEdit(LineEdit::Url, box);
boxHBoxLayout->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()));
......@@ -794,6 +807,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);
browseButton->setIcon(SmallIcon(QLatin1String("document-open")));
int size = browseButton->sizeHint().height();
browseButton->setFixedSize(size, size);
......@@ -817,8 +831,10 @@ void EditCommandAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
vlayout->addWidget(mCmdDiscardOutput, 0, Qt::AlignLeft);
// Top-adjust the controls
mCmdPadding = new KHBox(parent);
mCmdPadding->setMargin(0);
mCmdPadding = new QWidget(parent);
QHBoxLayout *mCmdPaddingHBoxLayout = new QHBoxLayout(mCmdPadding);
mCmdPaddingHBoxLayout->setMargin(0);
mCmdPaddingHBoxLayout->setMargin(0);
frameLayout->addWidget(mCmdPadding);
frameLayout->setStretchFactor(mCmdPadding, 1);
}
......@@ -1517,8 +1533,10 @@ void EditAudioAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
frameLayout->addWidget(mSoundConfig);
// Top-adjust the controls
mPadding = new KHBox(parent);
mPadding->setMargin(0);
mPadding = new QWidget(parent);
QHBoxLayout *mPaddingHBoxLayout = new QHBoxLayout(mPadding);
mPaddingHBoxLayout->setMargin(0);
mPaddingHBoxLayout->setMargin(0);
frameLayout->addWidget(mPadding);
frameLayout->setStretchFactor(mPadding, 1);
}
......
......@@ -33,7 +33,7 @@
class QAbstractButton;
class QGroupBox;
class KComboBox;
class KHBox;
class EmailIdCombo;
class CheckBox;
class ComboBox;
......@@ -100,8 +100,8 @@ class EditDisplayAlarmDlg : public EditAlarmDlg
// Display alarm options
ComboBox* mTypeCombo;
KHBox* mFileBox;
KHBox* mFilePadding;
QWidget * mFileBox;
QWidget * mFilePadding;
SoundPicker* mSoundPicker;
CheckBox* mConfirmAck;
FontColourButton* mFontColourButton;
......@@ -184,7 +184,7 @@ class EditCommandAlarmDlg : public EditAlarmDlg
PickLogFileRadio* mCmdLogToFile;
RadioButton* mCmdDiscardOutput;
LineEdit* mCmdLogFileEdit; // log file URL edit box
KHBox* mCmdPadding;
QWidget * mCmdPadding;
// Initial state of all controls
bool mSavedCmdScript; // mCmdEdit->isScript() status
......@@ -299,7 +299,7 @@ class EditAudioAlarmDlg : public EditAlarmDlg
// Audio alarm options
SoundWidget* mSoundConfig;
KHBox* mPadding; // allow top-adjustment of controls
QWidget * mPadding; // allow top-adjustment of controls
// Initial state of all controls
QString mSavedFile; // sound file
......
......@@ -27,7 +27,7 @@
#include <kglobal.h>
#include <kfontchooser.h>
#include <kfontdialog.h>
#include <khbox.h>
#include <QHBoxLayout>
#include <QGroupBox>
#include <QPushButton>
......@@ -62,27 +62,35 @@ FontColourChooser::FontColourChooser(QWidget *parent,
hlayout->addLayout(colourLayout);
if (fg)
{
KHBox* box = new KHBox(page); // to group widgets for QWhatsThis text
box->setMargin(0);
box->setSpacing(KDialog::spacingHint()/2);
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);
QLabel* label = new QLabel(i18nc("@label:listbox", "Foreground color:"), box);
box->setStretchFactor(new QWidget(box), 0);
boxHBoxLayout->addWidget(label);
boxHBoxLayout->setStretchFactor(new QWidget(box), 0);
mFgColourButton = new ColourButton(box);
boxHBoxLayout->addWidget(mFgColourButton);
connect(mFgColourButton, SIGNAL(changed(QColor)), SLOT(setSampleColour()));
label->setBuddy(mFgColourButton);
box->setWhatsThis(i18nc("@info:whatsthis", "Select the alarm message foreground color"));
}
KHBox* box = new KHBox(page); // to group widgets for QWhatsThis text
box->setMargin(0);
box->setSpacing(KDialog::spacingHint()/2);
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);
QLabel* label = new QLabel(i18nc("@label:listbox", "Background color:"), box);
box->setStretchFactor(new QWidget(box), 0);
boxHBoxLayout->addWidget(label);
boxHBoxLayout->setStretchFactor(new QWidget(box), 0);
mBgColourButton = new ColourButton(box);
boxHBoxLayout->addWidget(mBgColourButton);
connect(mBgColourButton, SIGNAL(changed(QColor)), SLOT(setSampleColour()));
label->setBuddy(mBgColourButton);
box->setWhatsThis(i18nc("@info:whatsthis", "Select the alarm message background color"));
......
......@@ -33,7 +33,7 @@
#include <klocale.h>
#include <kstandarddirs.h>
#include <kiconloader.h>
#include <khbox.h>
#include <QHBoxLayout>
#include <kio/netaccess.h>
#include <phonon/mediaobject.h>
#include <phonon/audiooutput.h>
......@@ -159,14 +159,17 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
layout->addWidget(label);
}
KHBox* box = new KHBox(this);
box->setMargin(0);
QWidget* box = new QWidget(this);
QHBoxLayout *boxHBoxLayout = new QHBoxLayout(box);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setMargin(0);
layout->addWidget(box);
if (showPlay)
{
// File play button
mFilePlay = new QPushButton(box);
boxHBoxLayout->addWidget(mFilePlay);
mFilePlay->setIcon(SmallIcon(QLatin1String("media-playback-start")));
connect(mFilePlay, SIGNAL(clicked()), SLOT(playSound()));
mFilePlay->setToolTip(i18nc("@info:tooltip", "Test the sound"));
......@@ -175,6 +178,7 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
// File name edit box
mFileEdit = new LineEdit(LineEdit::Url, box);
boxHBoxLayout->addWidget(mFileEdit);
mFileEdit->setAcceptDrops(true);
mFileEdit->setWhatsThis(i18nc("@info:whatsthis", "Enter the name or URL of a sound file to play."));
if (label)
......@@ -183,6 +187,7 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
// File browse button
mFileBrowseButton = new PushButton(box);
boxHBoxLayout->addWidget(mFileBrowseButton);
mFileBrowseButton->setIcon(KIcon(SmallIcon(QLatin1String("document-open"))));
int size = mFileBrowseButton->sizeHint().height();
mFileBrowseButton->setFixedSize(size, size);
......@@ -208,18 +213,23 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
QVBoxLayout* glayout = new QVBoxLayout(mRepeatGroupBox);
// Pause between repetitions
KHBox* box = new KHBox(mRepeatGroupBox);
box->setMargin(0);
box->setSpacing(KDialog::spacingHint());
QWidget* box = new QWidget(mRepeatGroupBox);
boxHBoxLayout = new QHBoxLayout(box);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setSpacing(KDialog::spacingHint());
glayout->addWidget(box);
label = new QLabel(i18nc("@label:spinbox Length of time to pause between repetitions", "Pause between repetitions:"), box);
boxHBoxLayout->addWidget(label);
label->setFixedSize(label->sizeHint());
mRepeatPause = new SpinBox(0, 999, box);
boxHBoxLayout->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);
label->setFixedSize(label->sizeHint());
box->setWhatsThis(i18nc("@info:whatsthis", "Enter how many seconds to pause between repetitions."));
}
......@@ -236,17 +246,21 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
grid->setColumnMinimumWidth(1, indentWidth);
// 'Set volume' checkbox
box = new KHBox(group);
box->setMargin(0);
box->setSpacing(KDialog::spacingHint());
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);
mVolumeCheckbox = new CheckBox(i18nc("@option:check", "Set volume"), box);
boxHBoxLayout->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);
mVolumeSlider->setTickPosition(QSlider::TicksBelow);
mVolumeSlider->setTickInterval(10);
mVolumeSlider->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
......@@ -262,29 +276,38 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
grid->addWidget(mFadeCheckbox, 2, 1, 1, 2, Qt::AlignLeft);
// Fade time
mFadeBox = new KHBox(group);
mFadeBox->setMargin(0);
mFadeBox->setSpacing(KDialog::spacingHint());
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);
label = new QLabel(i18nc("@label:spinbox Time period over which to fade the sound", "Fade time:"), mFadeBox);
mFadeBoxHBoxLayout->addWidget(label);
label->setFixedSize(label->sizeHint());
mFadeTime = new SpinBox(1, 999, mFadeBox);
mFadeBoxHBoxLayout->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);
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 KHBox(group);
mFadeVolumeBox->setMargin(0);
mFadeVolumeBox->setSpacing(KDialog::spacingHint());
mFadeVolumeBox = new QWidget(group);
QHBoxLayout *mFadeVolumeBoxHBoxLayout = new QHBoxLayout(mFadeVolumeBox);
mFadeVolumeBoxHBoxLayout->setMargin(0);
mFadeVolumeBoxHBoxLayout->setMargin(0);
mFadeVolumeBoxHBoxLayout->setSpacing(KDialog::spacingHint());
grid->addWidget(mFadeVolumeBox, 4, 2);
label = new QLabel(i18nc("@label:slider", "Initial volume:"), mFadeVolumeBox);
mFadeVolumeBoxHBoxLayout->addWidget(label);
label->setFixedSize(label->sizeHint());
mFadeSlider = new Slider(0, 100, 10, Qt::Horizontal, mFadeVolumeBox);
mFadeVolumeBoxHBoxLayout->addWidget(mFadeSlider);
mFadeSlider->setTickPosition(QSlider::TicksBelow);
mFadeSlider->setTickInterval(10);
mFadeSlider->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
......
......@@ -28,7 +28,7 @@
class QPushButton;
class QShowEvent;
class QResizeEvent;
class KHBox;
namespace Phonon { class MediaObject; }
class GroupBox;
class PushButton;
......@@ -81,9 +81,9 @@ class SoundWidget : public QWidget
CheckBox* mVolumeCheckbox;
Slider* mVolumeSlider;
CheckBox* mFadeCheckbox;
KHBox* mFadeBox;
QWidget * mFadeBox;
SpinBox* mFadeTime;
KHBox* mFadeVolumeBox;
QWidget * mFadeVolumeBox;
Slider* mFadeSlider;
mutable KUrl mUrl;
mutable QString mValidatedFile;
......
......@@ -33,7 +33,7 @@
#include <kfiledialog.h>
#include <kstandarddirs.h>
#include <kiconloader.h>
#include <khbox.h>
#include <QHBoxLayout>
#include <phonon/backendcapabilities.h>
#include <qdebug.h>
......@@ -62,11 +62,14 @@ SoundPicker::SoundPicker(QWidget* parent)
QHBoxLayout* soundLayout = new QHBoxLayout(this);
soundLayout->setMargin(0);
soundLayout->setSpacing(KDialog::spacingHint());
mTypeBox = new KHBox(this); // this is to control the QWhatsThis text display area
mTypeBox->setMargin(0);
mTypeBox->setSpacing(KDialog::spacingHint());
mTypeBox = new QWidget(this); // this is to control the QWhatsThis text display area
QHBoxLayout *mTypeBoxHBoxLayout = new QHBoxLayout(mTypeBox);
mTypeBoxHBoxLayout->setMargin(0);
mTypeBoxHBoxLayout->setMargin(0);
mTypeBoxHBoxLayout->setSpacing(KDialog::spacingHint());
QLabel* label = new QLabel(i18n_label_Sound(), mTypeBox);
mTypeBoxHBoxLayout->addWidget(label);
label->setFixedSize(label->sizeHint());
// Sound type combo box
......@@ -80,6 +83,7 @@ SoundPicker::SoundPicker(QWidget* parent)
}
mTypeCombo = new ComboBox(mTypeBox);
mTypeBoxHBoxLayout->addWidget(mTypeCombo);
mTypeCombo->addItem(i18n_combo_None()); // index None
mTypeCombo->addItem(i18n_combo_Beep()); // index Beep
mTypeCombo->addItem(i18n_combo_File()); // index PlayFile
......
......@@ -27,7 +27,7 @@
#include <QFrame>
#include <QString>
class KHBox;
class ComboBox;
class PushButton;
......@@ -115,7 +115,7 @@ class SoundPicker : public QFrame
private:
ComboBox* mTypeCombo;
KHBox* mTypeBox;
QWidget * mTypeBox;
PushButton* mFilePicker;
KUrl mFile; // sound file to play when alarm is triggered
float mVolume; // volume for file, or < 0 to not set volume
......
......@@ -27,7 +27,7 @@
#include "shellprocess.h"
#include <klineedit.h>
#include <khbox.h>
#include <QHBoxLayout>
#include <kapplication.h>
#include <klocale.h>
#include <qdebug.h>
......@@ -167,19 +167,23 @@ SpecialActions::SpecialActions(bool enableCheckboxes, QWidget* parent)
vlayout->setMargin(KDialog::marginHint());
vlayout->setSpacing(KDialog::spacingHint());
KHBox* box = new KHBox(group); // this is to control the QWhatsThis text display area
box->setMargin(0);
box->setSpacing(KDialog::spacingHint());
QWidget* box = new QWidget(group); // this is to control the QWhatsThis text display area
QHBoxLayout *boxHBoxLayout = new QHBoxLayout(box);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setSpacing(KDialog::spacingHint());
vlayout->addWidget(box);
QLabel* label = new QLabel(i18nc("@label:textbox", "Command:"), box);
boxHBoxLayout->addWidget(label);
mPreAction = new QLineEdit(box);
boxHBoxLayout->addWidget(mPreAction);
label->setBuddy(mPreAction);
connect(mPreAction, SIGNAL(textChanged(QString)), SLOT(slotPreActionChanged(QString)));
box->setWhatsThis(xi18nc("@info:whatsthis",
"<para>Enter a shell command to execute before the alarm is displayed.</para>"
"<para>Note that it is executed only when the alarm proper is displayed, not when a reminder or deferred alarm is displayed.</para>"
"<para><note>KAlarm will wait for the command to complete before displaying the alarm.</note></para>"));
box->setStretchFactor(mPreAction, 1);
boxHBoxLayout->setStretchFactor(mPreAction, 1);
// Cancel if error in pre-alarm action
mExecOnDeferral = new CheckBox(i18nc("@option:check", "Execute for deferred alarms"), group);
......@@ -202,18 +206,22 @@ SpecialActions::SpecialActions(bool enableCheckboxes, QWidget* parent)
vlayout->setMargin(KDialog::marginHint());
vlayout->setSpacing(KDialog::spacingHint());
box = new KHBox(group); // this is to control the QWhatsThis text display area
box->setMargin(0);
box->setSpacing(KDialog::spacingHint());
box = new QWidget(group); // this is to control the QWhatsThis text display area
boxHBoxLayout = new QHBoxLayout(box);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setSpacing(KDialog::spacingHint());
vlayout->addWidget(box);
label = new QLabel(i18nc("@label:textbox", "Command:"), box);
boxHBoxLayout->addWidget(label);
mPostAction = new QLineEdit(box);
boxHBoxLayout->addWidget(mPostAction);
label->setBuddy(mPostAction);
box->setWhatsThis(xi18nc("@info:whatsthis",
"<para>Enter a shell command to execute after the alarm window is closed.</para>"
"<para>Note that it is not executed after closing a reminder window. If you defer "
"the alarm, it is not executed until the alarm is finally acknowledged or closed.</para>"));
box->setStretchFactor(mPostAction, 1);
boxHBoxLayout->setStretchFactor(mPostAction, 1);
mExecOnDeferral->setEnabled(enableCheckboxes);
mCancelOnError->setEnabled(enableCheckboxes);
......
......@@ -26,7 +26,7 @@
#include <klocale.h>
#include <kdialog.h>
#include <khbox.h>
#include <QHBoxLayout>
#include <qdebug.h>
#include <QHBoxLayout>
......@@ -49,10 +49,13 @@ TimeSelector::TimeSelector(const QString& selectText, const QString& selectWhats
mSelect->setWhatsThis(selectWhatsThis);
layout->addWidget(mSelect);
KHBox* box = new KHBox(this); // to group widgets for QWhatsThis text
box->setSpacing(KDialog::spacingHint());
QWidget* box = new QWidget(this); // to group widgets for QWhatsThis text
QHBoxLayout *boxHBoxLayout = new QHBoxLayout(box);
boxHBoxLayout->setMargin(0);
boxHBoxLayout->setSpacing(KDialog::spacingHint());
layout->addWidget(box);
mPeriod = new TimePeriod(allowHourMinute, box);
boxHBoxLayout->addWidget(mPeriod);
mPeriod->setFixedSize(mPeriod->sizeHint());
mPeriod->setSelectOnStep(false);
connect(mPeriod, SIGNAL(valueChanged(KCalCore::Duration)), SLOT(periodChanged(KCalCore::Duration)));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment