Commit c2315940 authored by David Jarvie's avatar David Jarvie
Browse files

Don't use fixed size widgets

parent 03718b87
Pipeline #93421 failed with stage
in 9 minutes and 36 seconds
......@@ -19,7 +19,6 @@
#include "lib/timespinbox.h"
#include "lib/timezonecombo.h"
#include <KDateComboBox>
#include <KLocalizedString>
......@@ -89,7 +88,6 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
// At time radio button/label
mAtTimeRadio = new RadioButton((mDeferring ? i18nc("@option:radio", "Defer to date/time:") : i18nc("@option:radio", "At date/time:")), topWidget);
mAtTimeRadio->setFixedSize(mAtTimeRadio->sizeHint());
mAtTimeRadio->setWhatsThis(mDeferring ? i18nc("@info:whatsthis", "Reschedule the alarm to the specified date and time.")
: i18nc("@info:whatsthis", "Specify the date, or date and time, to schedule the alarm."));
mButtonGroup->addButton(mAtTimeRadio);
......@@ -108,10 +106,8 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
QWidget* timeBox = new QWidget(topWidget);
auto timeBoxHLayout = new QHBoxLayout(timeBox);
timeBoxHLayout->setContentsMargins(0, 0, 0, 0);
timeBoxHLayout->setSpacing(2 * style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing));
mTimeEdit = new TimeEdit(timeBox);
timeBoxHLayout->addWidget(mTimeEdit);
mTimeEdit->setFixedSize(mTimeEdit->sizeHint());
connect(mTimeEdit, &TimeEdit::valueChanged, this, &AlarmTimeWidget::dateTimeChanged);
mTimeEdit->setWhatsThis(xi18nc("@info:whatsthis",
"<para>Enter the time to schedule the alarm.</para>"
......@@ -129,7 +125,6 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
mAnyTimeAllowed = true;
mAnyTimeCheckBox = new CheckBox(i18nc("@option:check", "Any time"), timeBox);
timeBoxHLayout->addWidget(mAnyTimeCheckBox);
mAnyTimeCheckBox->setFixedSize(mAnyTimeCheckBox->sizeHint());
connect(mAnyTimeCheckBox, &CheckBox::toggled, this, &AlarmTimeWidget::slotAnyTimeToggled);
mAnyTimeCheckBox->setToolTip(i18nc("@info:tooltip", "Set only a date (without a time) for the alarm"));
mAnyTimeCheckBox->setWhatsThis(i18nc("@info:whatsthis",
......@@ -138,7 +133,6 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
// 'Time from now' radio button/label
mAfterTimeRadio = new RadioButton((mDeferring ? i18nc("@option:radio", "Defer for time interval:") : i18nc("@option:radio", "Time from now:")), topWidget);
mAfterTimeRadio->setFixedSize(mAfterTimeRadio->sizeHint());
mAfterTimeRadio->setWhatsThis(mDeferring ? i18nc("@info:whatsthis", "Reschedule the alarm for the specified time interval after now.")
: i18nc("@info:whatsthis", "Schedule the alarm after the specified time interval from now."));
mButtonGroup->addButton(mAfterTimeRadio);
......@@ -146,7 +140,6 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
// Delay time spin box
mDelayTimeEdit = new TimeSpinBox(1, maxDelayTime, topWidget);
mDelayTimeEdit->setValue(1439);
mDelayTimeEdit->setFixedSize(mDelayTimeEdit->sizeHint());
connect(mDelayTimeEdit, &TimeSpinBox::valueChanged, this, &AlarmTimeWidget::delayTimeChanged);
mDelayTimeEdit->setWhatsThis(mDeferring ? xi18nc("@info:whatsthis", "<para>%1</para><para>%2</para>", i18n_TimeAfterPeriod(), TimeSpinBox::shiftWhatsThis())
: xi18nc("@info:whatsthis", "<para>%1</para><para>%2</para><para>%3</para>", i18n_TimeAfterPeriod(), recurText, TimeSpinBox::shiftWhatsThis()));
......@@ -172,8 +165,11 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
else
{
grid->addWidget(mAtTimeRadio, 0, 0, Qt::AlignLeft);
grid->addWidget(mDateEdit, 0, 1, Qt::AlignLeft);
grid->addWidget(timeBox, 0, 2, Qt::AlignLeft);
auto hLayout = new QHBoxLayout;
hLayout->addWidget(mDateEdit);
hLayout->addSpacing(2 * style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing));
hLayout->addWidget(timeBox);
grid->addLayout(hLayout, 0, 1, Qt::AlignLeft);
grid->setRowStretch(1, 1);
grid->addWidget(mAfterTimeRadio, 2, 0, Qt::AlignLeft);
grid->addWidget(mDelayTimeEdit, 2, 1, Qt::AlignLeft);
......
/*
* birthdaydlg.cpp - dialog to pick birthdays from address book
* Program: kalarm
* SPDX-FileCopyrightText: 2002-2020 David Jarvie <djarvie@kde.org>
* SPDX-FileCopyrightText: 2002-2021 David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
......@@ -59,7 +59,6 @@ BirthdayDlg::BirthdayDlg(QWidget* parent)
hlayout->setContentsMargins(0, 0, 0, 0);
topLayout->addLayout(hlayout);
QLabel* label = new QLabel(i18nc("@label:textbox", "Alarm name:"), this);
label->setFixedSize(label->sizeHint());
hlayout->addWidget(label);
mName = new KLineEdit(this);
mName->setMinimumSize(mName->sizeHint());
......@@ -78,7 +77,6 @@ BirthdayDlg::BirthdayDlg(QWidget* parent)
topLayout->addWidget(textGroup);
auto grid = new QGridLayout(textGroup);
QLabel* label = new QLabel(i18nc("@label:textbox", "Prefix:"), textGroup);
label->setFixedSize(label->sizeHint());
grid->addWidget(label, 0, 0);
mPrefix = new BLineEdit(mPrefixText, textGroup);
mPrefix->setMinimumSize(mPrefix->sizeHint());
......@@ -90,7 +88,6 @@ BirthdayDlg::BirthdayDlg(QWidget* parent)
grid->addWidget(mPrefix, 0, 1);
label = new QLabel(i18nc("@label:textbox", "Suffix:"), textGroup);
label->setFixedSize(label->sizeHint());
grid->addWidget(label, 1, 0);
mSuffix = new BLineEdit(mSuffixText, textGroup);
mSuffix->setMinimumSize(mSuffix->sizeHint());
......@@ -153,7 +150,6 @@ BirthdayDlg::BirthdayDlg(QWidget* parent)
hlayout->setContentsMargins(0, 0, 0, 0);
groupLayout->addLayout(hlayout);
mSoundPicker = new SoundPicker(group);
mSoundPicker->setFixedSize(mSoundPicker->sizeHint());
hlayout->addWidget(mSoundPicker);
hlayout->addSpacing(2 * style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing));
hlayout->addStretch();
......@@ -170,7 +166,6 @@ BirthdayDlg::BirthdayDlg(QWidget* parent)
"This is in addition to the alarm which is displayed on the birthday."),
i18nc("@info:whatsthis", "Select whether the reminder should be triggered before or after the birthday."),
false, false, group);
mReminder->setFixedSize(mReminder->sizeHint());
mReminder->setMaximum(0, 364);
mReminder->setMinutes(0, true);
groupLayout->addWidget(mReminder, 0, Qt::AlignLeft);
......@@ -181,7 +176,6 @@ BirthdayDlg::BirthdayDlg(QWidget* parent)
hlayout->setSpacing(2 * style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing));
groupLayout->addLayout(hlayout);
mConfirmAck = EditDisplayAlarmDlg::createConfirmAckCheckbox(group);
mConfirmAck->setFixedSize(mConfirmAck->sizeHint());
hlayout->addWidget(mConfirmAck);
hlayout->addSpacing(2 * style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing));
hlayout->addStretch();
......@@ -190,7 +184,6 @@ BirthdayDlg::BirthdayDlg(QWidget* parent)
{
// Special actions button
mSpecialActionsButton = new SpecialActionsButton(false, group);
mSpecialActionsButton->setFixedSize(mSpecialActionsButton->sizeHint());
hlayout->addWidget(mSpecialActionsButton);
}
......@@ -200,13 +193,11 @@ BirthdayDlg::BirthdayDlg(QWidget* parent)
hlayout->setSpacing(2 * style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing));
groupLayout->addLayout(hlayout);
mLateCancel = new LateCancelSelector(false, group);
mLateCancel->setFixedSize(mLateCancel->sizeHint());
hlayout->addWidget(mLateCancel);
hlayout->addStretch();
// Sub-repetition button
mSubRepetition = new RepetitionButton(i18nc("@action:button", "Sub-Repetition"), false, group);
mSubRepetition->setFixedSize(mSubRepetition->sizeHint());
mSubRepetition->set(Repetition(), true, 364*24*60);
mSubRepetition->setWhatsThis(i18nc("@info:whatsthis", "Set up an additional alarm repetition"));
hlayout->addWidget(mSubRepetition);
......
......@@ -252,7 +252,6 @@ void EditAlarmDlg::init(const KAEvent& event)
frame->setLayout(box);
box->setContentsMargins(0, 0, 0, 0);
QLabel* label = new QLabel(mTemplate ? i18nc("@label:textbox", "Template name:") : i18nc("@label:textbox", "Alarm name:"));
label->setFixedSize(label->sizeHint());
box->addWidget(label);
mName = new QLineEdit();
mName->setReadOnly(mReadOnly);
......@@ -261,7 +260,6 @@ void EditAlarmDlg::init(const KAEvent& event)
box->addWidget(mName);
frame->setWhatsThis(mTemplate ? i18nc("@info:whatsthis", "Enter the name of the alarm template")
: i18nc("@info:whatsthis", "Enter a name to help you identify this alarm. This is optional and need not be unique."));
frame->setFixedHeight(box->sizeHint().height());
topLayout->addWidget(frame);
}
......@@ -279,17 +277,14 @@ void EditAlarmDlg::init(const KAEvent& event)
topLayout->addWidget(mDeferGroup);
auto hlayout = new QHBoxLayout(mDeferGroup);
QLabel* label = new QLabel(i18nc("@label", "Deferred to:"), mDeferGroup);
label->setFixedSize(label->sizeHint());
hlayout->addWidget(label);
mDeferTimeLabel = new QLabel(mDeferGroup);
hlayout->addWidget(mDeferTimeLabel);
mDeferChangeButton = new QPushButton(i18nc("@action:button", "Change..."), mDeferGroup);
mDeferChangeButton->setFixedSize(mDeferChangeButton->sizeHint());
connect(mDeferChangeButton, &QPushButton::clicked, this, &EditAlarmDlg::slotEditDeferral);
mDeferChangeButton->setWhatsThis(i18nc("@info:whatsthis", "Change the alarm's deferred time, or cancel the deferral"));
hlayout->addWidget(mDeferChangeButton);
//?? mDeferGroup->addSpace(0);
}
auto hlayout = new QHBoxLayout();
......@@ -307,7 +302,6 @@ void EditAlarmDlg::init(const KAEvent& event)
connect(mTemplateTimeGroup, &ButtonGroup::buttonSet, this, &EditAlarmDlg::contentsChanged);
mTemplateDefaultTime = new RadioButton(i18nc("@option:radio", "Default time"), templateTimeBox);
mTemplateDefaultTime->setFixedSize(mTemplateDefaultTime->sizeHint());
mTemplateDefaultTime->setReadOnly(mReadOnly);
mTemplateDefaultTime->setWhatsThis(i18nc("@info:whatsthis", "Do not specify a start time for alarms based on this template. "
"The normal default start time will be used."));
......@@ -318,13 +312,11 @@ void EditAlarmDlg::init(const KAEvent& event)
auto layout = new QHBoxLayout(box);
layout->setContentsMargins(0, 0, 0, 0);
mTemplateUseTime = new RadioButton(i18nc("@option:radio", "Time:"), box);
mTemplateUseTime->setFixedSize(mTemplateUseTime->sizeHint());
mTemplateUseTime->setReadOnly(mReadOnly);
mTemplateUseTime->setWhatsThis(i18nc("@info:whatsthis", "Specify a start time for alarms based on this template."));
layout->addWidget(mTemplateUseTime);
mTemplateTimeGroup->addButton(mTemplateUseTime);
mTemplateTime = new TimeEdit();
mTemplateTime->setFixedSize(mTemplateTime->sizeHint());
mTemplateTime->setReadOnly(mReadOnly);
mTemplateTime->setWhatsThis(xi18nc("@info:whatsthis",
"<para>Enter the start time for alarms based on this template.</para><para>%1</para>",
......@@ -335,7 +327,6 @@ void EditAlarmDlg::init(const KAEvent& event)
grid->addWidget(box, 0, 1, Qt::AlignLeft);
mTemplateAnyTime = new RadioButton(i18nc("@option:radio", "Date only"), templateTimeBox);
mTemplateAnyTime->setFixedSize(mTemplateAnyTime->sizeHint());
mTemplateAnyTime->setReadOnly(mReadOnly);
mTemplateAnyTime->setWhatsThis(xi18nc("@info:whatsthis", "Set the <interface>Any time</interface> option for alarms based on this template."));
mTemplateTimeGroup->addButton(mTemplateAnyTime);
......@@ -345,7 +336,6 @@ void EditAlarmDlg::init(const KAEvent& event)
layout = new QHBoxLayout(box);
layout->setContentsMargins(0, 0, 0, 0);
mTemplateUseTimeAfter = new RadioButton(i18nc("@option:radio", "Time from now:"), box);
mTemplateUseTimeAfter->setFixedSize(mTemplateUseTimeAfter->sizeHint());
mTemplateUseTimeAfter->setReadOnly(mReadOnly);
mTemplateUseTimeAfter->setWhatsThis(i18nc("@info:whatsthis",
"Set alarms based on this template to start after the specified time "
......@@ -354,13 +344,11 @@ void EditAlarmDlg::init(const KAEvent& event)
mTemplateTimeGroup->addButton(mTemplateUseTimeAfter);
mTemplateTimeAfter = new TimeSpinBox(1, maxDelayTime);
mTemplateTimeAfter->setValue(1439);
mTemplateTimeAfter->setFixedSize(mTemplateTimeAfter->sizeHint());
mTemplateTimeAfter->setReadOnly(mReadOnly);
connect(mTemplateTimeAfter, &TimeSpinBox::valueChanged, this, &EditAlarmDlg::contentsChanged);
mTemplateTimeAfter->setWhatsThis(xi18nc("@info:whatsthis", "<para>%1</para><para>%2</para>",
AlarmTimeWidget::i18n_TimeAfterPeriod(), TimeSpinBox::shiftWhatsThis()));
layout->addWidget(mTemplateTimeAfter);
box->setFixedHeight(box->sizeHint().height());
grid->addWidget(box, 1, 1, Qt::AlignLeft);
hlayout->addStretch();
......@@ -384,7 +372,6 @@ void EditAlarmDlg::init(const KAEvent& event)
mReminder = createReminder(mMoreOptions);
if (mReminder)
{
mReminder->setFixedSize(mReminder->sizeHint());
connect(mReminder, &Reminder::changed, this, &EditAlarmDlg::contentsChanged);
moreLayout->addWidget(mReminder, 0, Qt::AlignLeft);
if (mTimeWidget)
......@@ -405,7 +392,6 @@ void EditAlarmDlg::init(const KAEvent& event)
CheckBox* confirmAck = type_createConfirmAckCheckbox(mMoreOptions);
if (confirmAck)
{
confirmAck->setFixedSize(confirmAck->sizeHint());
connect(confirmAck, &CheckBox::toggled, this, &EditAlarmDlg::contentsChanged);
playout->addWidget(confirmAck);
}
......@@ -414,7 +400,6 @@ void EditAlarmDlg::init(const KAEvent& event)
{
// Show in KOrganizer checkbox
mShowInKorganizer = new CheckBox(i18n_chk_ShowInKOrganizer(), mMoreOptions);
mShowInKorganizer->setFixedSize(mShowInKorganizer->sizeHint());
connect(mShowInKorganizer, &CheckBox::toggled, this, &EditAlarmDlg::contentsChanged);
mShowInKorganizer->setWhatsThis(i18nc("@info:whatsthis", "Check to copy the alarm into KOrganizer's calendar"));
playout->addWidget(mShowInKorganizer);
......
......@@ -39,9 +39,8 @@
#include <KAlarmCal/Identities>
#include <Akonadi/Contact/EmailAddressSelectionDialog>
#include <KCalendarCore/Person>
#include <KCalUtils/ICalDrag>
using namespace KCalendarCore;
#include <KCalendarCore/Person>
#include <KLocalizedString>
#include <KFileItem>
......@@ -58,6 +57,7 @@ using namespace KCalendarCore;
#include <QStandardItemModel>
using namespace KAlarmCal;
using namespace KCalendarCore;
enum { tTEXT, tFILE, tCOMMAND }; // order of mTypeCombo items
enum { dWINDOW, dNOTIFY }; // order of mDisplayMethodCombo items
......@@ -134,7 +134,6 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
boxHLayout->setContentsMargins(0, 0, 0, 0);
QLabel* label = new QLabel(i18nc("@label:listbox", "Display type:"), box);
boxHLayout->addWidget(label);
label->setFixedSize(label->sizeHint());
mTypeCombo = new ComboBox(box);
boxHLayout->addWidget(mTypeCombo);
const QString textItem = i18nc("@item:inlistbox", "Text message");
......@@ -143,7 +142,6 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
mTypeCombo->addItem(textItem); // index = tTEXT
mTypeCombo->addItem(fileItem); // index = tFILE
mTypeCombo->addItem(commandItem); // index = tCOMMAND
mTypeCombo->setFixedSize(mTypeCombo->sizeHint());
mTypeCombo->setCurrentIndex(-1); // ensure slotAlarmTypeChanged() is called when index is set
if (!ShellProcess::authorised())
{
......@@ -195,8 +193,6 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
mFileBrowseButton = new QPushButton(mFileBox);
fileBoxHLayout->addWidget(mFileBrowseButton);
mFileBrowseButton->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
int size = mFileBrowseButton->sizeHint().height();
mFileBrowseButton->setFixedSize(size, size);
mFileBrowseButton->setToolTip(i18nc("@info:tooltip", "Choose a file"));
mFileBrowseButton->setWhatsThis(i18nc("@info:whatsthis", "Select a text or image file to display."));
connect(mFileBrowseButton, &QPushButton::clicked, this, &EditDisplayAlarmDlg::slotPickFile);
......@@ -212,7 +208,6 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
hlayout->setContentsMargins(0, 0, 0, 0);
frameLayout->addLayout(hlayout);
mSoundPicker = new SoundPicker(parent);
mSoundPicker->setFixedSize(mSoundPicker->sizeHint());
connect(mSoundPicker, &SoundPicker::changed, this, &EditDisplayAlarmDlg::contentsChanged);
hlayout->addWidget(mSoundPicker);
hlayout->addSpacing(2 * style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing));
......@@ -234,14 +229,12 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
boxHLayout->setContentsMargins(0, 0, 0, 0);
label = new QLabel(i18n_lbl_DisplayMethod(), mDisplayMethodBox);
boxHLayout->addWidget(label);
label->setFixedSize(label->sizeHint());
mDisplayMethodCombo = new ComboBox(mDisplayMethodBox);
boxHLayout->addWidget(mDisplayMethodCombo);
const QString windowItem = i18n_combo_Window();
const QString notifyItem = i18n_combo_Notify();
mDisplayMethodCombo->addItem(windowItem); // index = dWINDOW
mDisplayMethodCombo->addItem(notifyItem); // index = dNOTIFY
mDisplayMethodCombo->setFixedSize(mDisplayMethodCombo->sizeHint());
connect(mDisplayMethodCombo, static_cast<void (ComboBox::*)(int)>(&ComboBox::currentIndexChanged), this, &EditDisplayAlarmDlg::slotDisplayMethodChanged);
connect(mDisplayMethodCombo, static_cast<void (ComboBox::*)(int)>(&ComboBox::currentIndexChanged), this, &EditDisplayAlarmDlg::contentsChanged);
label->setBuddy(mDisplayMethodCombo);
......@@ -254,7 +247,6 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
{
// Special actions button
mSpecialActionsButton = new SpecialActionsButton(false, parent);
mSpecialActionsButton->setFixedSize(mSpecialActionsButton->sizeHint());
connect(mSpecialActionsButton, &SpecialActionsButton::selected, this, &EditDisplayAlarmDlg::contentsChanged);
hlayout->addWidget(mSpecialActionsButton);
}
......@@ -872,7 +864,6 @@ void EditCommandAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
// Execute in terminal window
mCmdExecInTerm = new RadioButton(i18n_radio_ExecInTermWindow(), mCmdOutputBox);
mCmdExecInTerm->setFixedSize(mCmdExecInTerm->sizeHint());
mCmdExecInTerm->setWhatsThis(i18nc("@info:whatsthis", "Check to execute the command in a terminal window"));
mCmdOutputGroup->addButton(mCmdExecInTerm, Preferences::Log_Terminal);
vlayout->addWidget(mCmdExecInTerm, 0, Qt::AlignLeft);
......@@ -894,14 +885,11 @@ void EditCommandAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
auto browseButton = new QPushButton(box);
boxHLayout->addWidget(browseButton);
browseButton->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
int size = browseButton->sizeHint().height();
browseButton->setFixedSize(size, size);
browseButton->setToolTip(i18nc("@info:tooltip", "Choose a file"));
browseButton->setWhatsThis(i18nc("@info:whatsthis", "Select a log file."));
// Log output to file
mCmdLogToFile = new PickLogFileRadio(browseButton, mCmdLogFileEdit, i18nc("@option:radio", "Log to file"), mCmdOutputGroup, mCmdOutputBox);
mCmdLogToFile->setFixedSize(mCmdLogToFile->sizeHint());
mCmdLogToFile->setWhatsThis(i18nc("@info:whatsthis", "Check to log the command output to a local file. The output will be appended to any existing contents of the file."));
connect(mCmdLogToFile, &PickLogFileRadio::fileChanged, this, &EditCommandAlarmDlg::contentsChanged);
mCmdOutputGroup->addButton(mCmdLogToFile, Preferences::Log_File);
......@@ -910,7 +898,6 @@ void EditCommandAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
// Discard output
mCmdDiscardOutput = new RadioButton(i18nc("@option:radio", "Discard"), mCmdOutputBox);
mCmdDiscardOutput->setFixedSize(mCmdDiscardOutput->sizeHint());
mCmdDiscardOutput->setWhatsThis(i18nc("@info:whatsthis", "Check to discard command output."));
mCmdOutputGroup->addButton(mCmdDiscardOutput, Preferences::Log_Discard);
vlayout->addWidget(mCmdDiscardOutput, 0, Qt::AlignLeft);
......@@ -1189,7 +1176,6 @@ void EditEmailAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
{
// Email sender identity
QLabel* label = new QLabel(i18nc("@label:listbox 'From' email address", "From:"), parent);
label->setFixedSize(label->sizeHint());
grid->addWidget(label, 0, 0);
mEmailFromList = new EmailIdCombo(Identities::identityManager(), parent);
......@@ -1202,7 +1188,6 @@ void EditEmailAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
// Email recipients
QLabel* label = new QLabel(i18nc("@label:textbox Email addressee", "To:"), parent);
label->setFixedSize(label->sizeHint());
grid->addWidget(label, 1, 0);
mEmailToEdit = new LineEdit(LineEdit::Emails, parent);
......@@ -1214,8 +1199,6 @@ void EditEmailAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
mEmailAddressButton = new QPushButton(parent);
mEmailAddressButton->setIcon(QIcon::fromTheme(QStringLiteral("help-contents")));
int size = mEmailAddressButton->sizeHint().height();
mEmailAddressButton->setFixedSize(size, size);
connect(mEmailAddressButton, &QPushButton::clicked, this, &EditEmailAlarmDlg::openAddressBook);
mEmailAddressButton->setToolTip(i18nc("@info:tooltip", "Open address book"));
mEmailAddressButton->setWhatsThis(i18nc("@info:whatsthis", "Select email addresses from your address book."));
......@@ -1223,7 +1206,6 @@ void EditEmailAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
// Email subject
label = new QLabel(i18nc("@label:textbox Email subject", "Subject:"), parent);
label->setFixedSize(label->sizeHint());
grid->addWidget(label, 2, 0);
mEmailSubjectEdit = new LineEdit(parent);
......@@ -1244,7 +1226,6 @@ void EditEmailAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
grid->setContentsMargins(0, 0, 0, 0);
frameLayout->addLayout(grid);
label = new QLabel(i18nc("@label:listbox", "Attachments:"), parent);
label->setFixedSize(label->sizeHint());
grid->addWidget(label, 0, 0);
mEmailAttachList = new QComboBox(parent);
......@@ -1269,7 +1250,6 @@ void EditEmailAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
// BCC email to sender
mEmailBcc = new CheckBox(i18n_chk_CopyEmailToSelf(), parent);
mEmailBcc->setFixedSize(mEmailBcc->sizeHint());
mEmailBcc->setWhatsThis(i18nc("@info:whatsthis", "If checked, the email will be blind copied to you."));
connect(mEmailBcc, &CheckBox::toggled, this, &EditEmailAlarmDlg::contentsChanged);
grid->addWidget(mEmailBcc, 1, 0, 1, 2, Qt::AlignLeft);
......@@ -1839,7 +1819,6 @@ CommandEdit::CommandEdit(QWidget* parent)
auto vlayout = new QVBoxLayout(this);
vlayout->setContentsMargins(0, 0, 0, 0);
mTypeScript = new CheckBox(EditCommandAlarmDlg::i18n_chk_EnterScript(), this);
mTypeScript->setFixedSize(mTypeScript->sizeHint());
mTypeScript->setWhatsThis(i18nc("@info:whatsthis", "Check to enter the contents of a script instead of a shell command line"));
connect(mTypeScript, &CheckBox::toggled, this, &CommandEdit::slotCmdScriptToggled);
connect(mTypeScript, &CheckBox::toggled, this, &CommandEdit::changed);
......
/*
* find.cpp - search facility
* Program: kalarm
* SPDX-FileCopyrightText: 2005-2020 David Jarvie <djarvie@kde.org>
* SPDX-FileCopyrightText: 2005-2021 David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
......@@ -101,12 +101,10 @@ void Find::display()
// Live & archived alarm selection
mLive = new QCheckBox(i18nc("@option:check Alarm type", "Active"), group);
mLive->setFixedSize(mLive->sizeHint());
mLive->setWhatsThis(i18nc("@info:whatsthis", "Check to include active alarms in the search."));
grid->addWidget(mLive, 1, 0, Qt::AlignLeft);
mArchived = new QCheckBox(i18nc("@option:check Alarm type", "Archived"), group);
mArchived->setFixedSize(mArchived->sizeHint());
mArchived->setWhatsThis(i18nc("@info:whatsthis", "Check to include archived alarms in the search. "
"This option is only available if archived alarms are currently being displayed."));
grid->addWidget(mArchived, 1, 2, Qt::AlignLeft);
......@@ -116,27 +114,22 @@ void Find::display()
// Alarm actions
mMessageType = new QCheckBox(i18nc("@option:check Alarm action = text display", "Text"), group);
mMessageType->setFixedSize(mMessageType->sizeHint());
mMessageType->setWhatsThis(i18nc("@info:whatsthis", "Check to include text message alarms in the search."));
grid->addWidget(mMessageType, 3, 0);
mFileType = new QCheckBox(i18nc("@option:check Alarm action = file display", "File"), group);
mFileType->setFixedSize(mFileType->sizeHint());
mFileType->setWhatsThis(i18nc("@info:whatsthis", "Check to include file alarms in the search."));
grid->addWidget(mFileType, 3, 2);
mCommandType = new QCheckBox(i18nc("@option:check Alarm action", "Command"), group);
mCommandType->setFixedSize(mCommandType->sizeHint());
mCommandType->setWhatsThis(i18nc("@info:whatsthis", "Check to include command alarms in the search."));
grid->addWidget(mCommandType, 4, 0);
mEmailType = new QCheckBox(i18nc("@option:check Alarm action", "Email"), group);
mEmailType->setFixedSize(mEmailType->sizeHint());
mEmailType->setWhatsThis(i18nc("@info:whatsthis", "Check to include email alarms in the search."));
grid->addWidget(mEmailType, 4, 2);
mAudioType = new QCheckBox(i18nc("@option:check Alarm action", "Audio"), group);
mAudioType->setFixedSize(mAudioType->sizeHint());
mAudioType->setWhatsThis(i18nc("@info:whatsthis", "Check to include audio alarms in the search."));
grid->addWidget(mAudioType, 5, 0);
......
......@@ -365,17 +365,13 @@ void MessageWindow::setUpDisplay()
auto grid = new QGridLayout(frame);
QLabel* label = new QLabel(texts.errorEmail[0], frame);
label->setFixedSize(label->sizeHint());
grid->addWidget(label, 0, 0, Qt::AlignLeft);
label = new QLabel(texts.errorEmail[1], frame);
label->setFixedSize(label->sizeHint());
grid->addWidget(label, 0, 1, Qt::AlignLeft);
label = new QLabel(texts.errorEmail[2], frame);
label->setFixedSize(label->sizeHint());
grid->addWidget(label, 1, 0, Qt::AlignLeft);
label = new QLabel(texts.errorEmail[3], frame);
label->setFixedSize(label->sizeHint());
grid->addWidget(label, 1, 1, Qt::AlignLeft);
break;
}
......@@ -403,21 +399,18 @@ void MessageWindow::setUpDisplay()
topLayout->addLayout(layout);
QLabel* label = new QLabel(topWidget);
label->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-error")).pixmap(style()->pixelMetric(QStyle::PM_MessageBoxIconSize)));
label->setFixedSize(label->sizeHint());
layout->addWidget(label, 0, Qt::AlignRight);
auto vlayout = new QVBoxLayout();
layout->addLayout(vlayout);
for (const QString& msg : mErrorMsgs())
{
label = new QLabel(msg, topWidget);
label->setFixedSize(label->sizeHint());
vlayout->addWidget(label, 0, Qt::AlignLeft);
}
layout->addStretch();
if (!mDontShowAgain().isEmpty())
{
mDontShowAgainCheck = new QCheckBox(i18nc("@option:check", "Do not display this error message again for this alarm"), topWidget);
mDontShowAgainCheck->setFixedSize(mDontShowAgainCheck->sizeHint());
topLayout->addWidget(mDontShowAgainCheck, 0, Qt::AlignLeft);
}
}
......@@ -432,7 +425,6 @@ void MessageWindow::setUpDisplay()
// Prevent accidental acknowledgement of the message if the user is typing when the window appears
mOkButton->clearFocus();
mOkButton->setFocusPolicy(Qt::ClickFocus); // don't allow keyboard selection
mOkButton->setFixedSize(mOkButton->sizeHint());
connect(mOkButton, &QAbstractButton::clicked, this, &MessageWindow::slotOk);
grid->addWidget(mOkButton, 0, gridIndex++, Qt::AlignHCenter);
mOkButton->setWhatsThis(i18nc("@info:whatsthis", "Acknowledge the alarm"));
......@@ -442,7 +434,6 @@ void MessageWindow::setUpDisplay()
// Edit button
mEditButton = new PushButton(i18nc("@action:button", "&Edit..."), topWidget);
mEditButton->setFocusPolicy(Qt::ClickFocus); // don't allow keyboard selection
mEditButton->setFixedSize(mEditButton->sizeHint());
connect(mEditButton, &QAbstractButton::clicked, this, &MessageWindow::slotEdit);
grid->addWidget(mEditButton, 0, gridIndex++, Qt::AlignHCenter);
mEditButton->setToolTip(i18nc("@info:tooltip", "Edit the alarm"));
......@@ -452,7 +443,6 @@ void MessageWindow::setUpDisplay()
// Defer button
mDeferButton = new PushButton(i18nc("@action:button", "&Defer..."), topWidget);
mDeferButton->setFocusPolicy(Qt::ClickFocus); // don't allow keyboard selection
mDeferButton->setFixedSize(mDeferButton->sizeHint());
connect(mDeferButton, &QAbstractButton::clicked, this, &MessageWindow::slotDefer);
grid->addWidget(mDeferButton, 0, gridIndex++, Qt::AlignHCenter);
mDeferButton->setToolTip(i18nc("@info:tooltip", "Defer the alarm until later"));
......
......@@ -30,7 +30,6 @@
#include <KAlarmCal/KARecurrence>
#include <KCalendarCore/Event>
using namespace KCalendarCore;
#include <KLocalizedString>
#include <KDateComboBox>
......@@ -46,6 +45,7 @@ using namespace KCalendarCore;
#include <QtAlgorithms>
#include <QLocale>
using namespace KCalendarCore;
class ListWidget : public QListWidget
{
......@@ -97,14 +97,12 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
connect(mRuleButtonGroup, &ButtonGroup::buttonSet, this, &RecurrenceEdit::contentsChanged);
mNoneButton = new RadioButton(i18n_combo_NoRecur(), recurGroup);
mNoneButton->setFixedSize(mNoneButton->sizeHint());
mNoneButton->setReadOnly(mReadOnly);
mNoneButton->setWhatsThis(i18nc("@info:whatsthis", "Do not repeat the alarm"));
mRuleButtonGroup->addButton(mNoneButton);
vlayout->addWidget(mNoneButton);
mAtLoginButton = new RadioButton(i18n_combo_AtLogin(), recurGroup);
mAtLoginButton->setFixedSize(mAtLoginButton->sizeHint());
mAtLoginButton->setReadOnly(mReadOnly);
mAtLoginButton->setWhatsThis(xi18nc("@info:whatsthis",
"<para>Trigger the alarm at the specified date/time and at every login until then.</para>"
......@@ -113,35 +111,30 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
vlayout->addWidget(mAtLoginButton);
mSubDailyButton = new RadioButton(i18n_combo_HourlyMinutely(), recurGroup);
mSubDailyButton->setFixedSize(mSubDailyButton->sizeHint());
mSubDailyButton->setReadOnly(mReadOnly);
mSubDailyButton->setWhatsThis(i18nc("@info:whatsthis", "Repeat the alarm at hourly/minutely intervals"));
mRuleButtonGroup->addButton(mSubDailyButton);
vlayout->addWidget(mSubDailyButton);
mDailyButton = new RadioButton(i18n_combo_Daily(), recurGroup);
mDailyButton->setFixedSize(mDailyButton->sizeHint());
mDailyButton->setReadOnly(mReadOnly);
mDailyButton->setWhatsThis(i18nc("@info:whatsthis", "Repeat the alarm at daily intervals"));
mRuleButtonGroup->addButton(mDailyButton);
vlayout->addWidget(mDailyButton);
mWeeklyButton = new RadioButton(i18n_combo_Weekly(), recurGroup);
mWeeklyButton->setFixedSize(mWeeklyButton->sizeHint());
mWeeklyButton->setReadOnly(mReadOnly);
mWeeklyButton->setWhatsThis(i18nc("@info:whatsthis", "Repeat the alarm at weekly intervals"));
mRuleButtonGroup->addButton(mWeeklyButton);
vlayout->addWidget(mWeeklyButton);
mMonthlyButton = new RadioButton(i18n_combo_Monthly(), recurGroup);
mMonthlyButton->setFixedSize(mMonthlyButton->sizeHint());
mMonthlyButton->setReadOnly(mReadOnly);
mMonthlyButton->setWhatsThis(i18nc("@info:whatsthis", "Repeat the alarm at monthly intervals"));
mRuleButtonGroup->addButton(mMonthlyButton);
vlayout->addWidget(mMonthlyButton);
mYearlyButton = new RadioButton(i18n_combo_Yearly(), recurGroup);
mYearlyButton->setFixedSize(mYearlyButton->sizeHint());
mYearlyButton->setReadOnly(mReadOnly);
mYearlyButton->setWhatsThis(i18nc("@info:whatsthis", "Repeat the alarm at annual intervals"));
mRuleButtonGroup->addButton(mYearlyButton);
......@@ -150,7 +143,6 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
// Sub-repetition button
mSubRepetition = new RepetitionButton(i18nc("@action:button", "Sub-Repetition"), true, recurGroup);
mSubRepetition->setFixedSize(mSubRepetition->sizeHint());
mSubRepetition->setReadOnly(mReadOnly);
mSubRepetition->setWhatsThis(i18nc("@info:whatsthis",
"Set up a repetition within the recurrence, to trigger the alarm multiple times each time the recurrence is due."));
......@@ -209,7 +201,6 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
vlayout = new QVBoxLayout(mRangeButtonBox);
mNoEndDateButton = new RadioButton(i18nc("@option:radio", "No end"), mRangeButtonBox);
mNoEndDateButton->setFixedSize(mNoEndDateButton->sizeHint());
mNoEndDateButton->setReadOnly(mReadOnly);
mNoEndDateButton->setWhatsThis(i18nc("@info:whatsthis", "Repeat the alarm indefinitely"));
mRangeButtonGroup->addButton(mNoEndDateButton);
......@@ -224,7 +215,6 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
mRepeatCountButton->setWhatsThis(i18nc("@info:whatsthis", "Repeat the alarm for the number of times specified"));
mRangeButtonGroup->addButton(mRepeatCountButton);
mRepeatCountEntry = new SpinBox(1, 9999, mRangeButtonBox);
mRepeatCountEntry->setFixedSize(mRepeatCountEntry->sizeHint());
mRepeatCountEntry->setSingleShiftStep(10);
mRepeatCountEntry->setSelectOnStep(false);
mRepeatCountEntry->setReadOnly(mReadOnly);
......@@ -233,7 +223,6 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
connect(mRepeatCountEntry, &SpinBox::valueChanged, this, &RecurrenceEdit::contentsChanged);
mRepeatCountButton->setFocusWidget(mRepeatCountEntry);
mRepeatCountLabel = new QLabel(i18nc("@label", "occurrence(s)"), mRangeButtonBox);
mRepeatCountLabel->setFixedSize(mRepeatCountLabel->sizeHint());