Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KOrganizer
Commits
c347b50d
Commit
c347b50d
authored
Jul 13, 2020
by
Laurent Montel
😁
Browse files
Continue to port settings
parent
0b869377
Pipeline
#27109
passed with stage
in 44 minutes and 55 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/prefs/koprefsdialog.cpp
View file @
c347b50d
...
...
@@ -142,7 +142,6 @@ KOPrefsDialogMain::KOPrefsDialogMain(QWidget *parent)
mDestinationCheckBox
=
new
QCheckBox
(
KOPrefs
::
instance
()
->
destinationItem
()
->
label
(),
saveFrame
);
saveLayout
->
addWidget
(
mDestinationCheckBox
);
//saveLayout->addWidget(destinationItem->groupBox());
saveLayout
->
addStretch
(
1
);
// System Tray Settings
...
...
@@ -279,7 +278,7 @@ public:
mHolidayCheckCombo
=
new
KPIM
::
KCheckComboBox
(
holidayRegBox
);
holidayRegBoxHBoxLayout
->
addWidget
(
mHolidayCheckCombo
);
connect
(
mHolidayCheckCombo
,
&
KPIM
::
KCheckComboBox
::
checkedItemsChanged
,
this
,
&
KOPrefsDialogTime
::
slot
Wid
Changed
);
this
,
&
KOPrefsDialogTime
::
slot
Config
Changed
);
mHolidayCheckCombo
->
setToolTip
(
KOPrefs
::
instance
()
->
holidaysItem
()
->
toolTip
());
mHolidayCheckCombo
->
setWhatsThis
(
KOPrefs
::
instance
()
->
holidaysItem
()
->
whatsThis
());
...
...
@@ -309,7 +308,6 @@ public:
mHolidayCheckCombo
->
addItem
(
entry
.
first
,
entry
.
second
);
}
//QString regionStr = KHolidays::HolidayRegion::defaultRegionCode();
const
auto
holidays
=
KOGlobals
::
self
()
->
holidays
();
for
(
KHolidays
::
HolidayRegion
*
region
:
holidays
)
{
const
QString
regionStr
=
region
->
regionCode
();
...
...
@@ -342,13 +340,13 @@ public:
"marked with color."
));
connect
(
mWorkDays
[
index
],
&
QCheckBox
::
stateChanged
,
this
,
&
K
PIM
::
KPrefsModul
e
::
slot
Wid
Changed
);
this
,
&
K
OPrefsDialogTim
e
::
slot
Config
Changed
);
workDaysLayout
->
addWidget
(
mWorkDays
[
index
]);
}
KPIM
::
KPrefsWidCombo
*
firstDayCombo
=
addWidCombo
(
KOPrefs
::
instance
()
->
weekStartDayItem
(),
workingHoursGroupBox
);
mFirstDayCombo
=
new
QComboBox
(
workingHoursGroupBox
);
QHBoxLayout
*
firstDayLayout
=
new
QHBoxLayout
;
workingHoursLayout
->
addLayout
(
firstDayLayout
);
QStringList
days
;
...
...
@@ -359,10 +357,10 @@ public:
<<
i18nc
(
"@item:inlistbox"
,
"Friday"
)
<<
i18nc
(
"@item:inlistbox"
,
"Saturday"
)
<<
i18nc
(
"@item:inlistbox"
,
"Sunday"
);
f
irstDayCombo
->
comboBox
()
->
addItems
(
days
);
mF
irstDayCombo
->
addItems
(
days
);
firstDayLayout
->
addWidget
(
firstDayCombo
->
label
());
firstDayLayout
->
addWidget
(
f
irstDayCombo
->
comboBox
()
);
firstDayLayout
->
addWidget
(
new
QLabel
(
KOPrefs
::
instance
()
->
weekStartDayItem
()
->
label
()
,
this
)
);
firstDayLayout
->
addWidget
(
mF
irstDayCombo
);
KPIM
::
KPrefsWidTime
*
workStart
=
addWidTime
(
KOPrefs
::
instance
()
->
workingHoursStartItem
());
...
...
@@ -382,10 +380,8 @@ public:
workEndLayout
->
addWidget
(
workEnd
->
label
());
workEndLayout
->
addWidget
(
workEnd
->
timeEdit
());
KPIM
::
KPrefsWidBool
*
excludeHolidays
=
addWidBool
(
KOPrefs
::
instance
()
->
excludeHolidaysItem
());
workingHoursLayout
->
addWidget
(
excludeHolidays
->
checkBox
());
mExcludeHolidaysCheckbox
=
new
QCheckBox
(
KOPrefs
::
instance
()
->
excludeHolidaysItem
()
->
label
(),
this
);
workingHoursLayout
->
addWidget
(
mExcludeHolidaysCheckbox
);
regionalLayout
->
setRowStretch
(
4
,
1
);
...
...
@@ -429,7 +425,7 @@ public:
mReminderTimeSpin
->
setToolTip
(
CalendarSupport
::
KCalPrefs
::
instance
()
->
reminderTimeItem
()
->
toolTip
());
connect
(
mReminderTimeSpin
,
qOverload
<
int
>
(
&
QSpinBox
::
valueChanged
),
this
,
&
KOPrefsDialogTime
::
slot
Wid
Changed
);
this
,
&
KOPrefsDialogTime
::
slot
Config
Changed
);
remindersLayout
->
addWidget
(
mReminderTimeSpin
,
0
,
1
);
mReminderUnitsCombo
=
new
KComboBox
(
defaultPage
);
...
...
@@ -438,7 +434,7 @@ public:
mReminderUnitsCombo
->
setWhatsThis
(
CalendarSupport
::
KCalPrefs
::
instance
()
->
reminderTimeUnitsItem
()
->
whatsThis
());
connect
(
mReminderUnitsCombo
,
qOverload
<
int
>
(
&
KComboBox
::
activated
),
this
,
&
KOPrefsDialogTime
::
slot
Wid
Changed
);
this
,
&
KOPrefsDialogTime
::
slot
Config
Changed
);
mReminderUnitsCombo
->
addItem
(
i18nc
(
"@item:inlistbox reminder units in minutes"
,
"minute(s)"
));
mReminderUnitsCombo
->
addItem
(
...
...
@@ -457,25 +453,23 @@ public:
QStringLiteral
(
"sound/"
)
+
QLatin1String
(
"KDE-Sys-Warning.ogg"
));
CalendarSupport
::
KCalPrefs
::
instance
()
->
audioFilePathItem
()
->
setValue
(
defAudioFile
);
}
QString
filter
=
i18n
(
"*.ogg *.wav *.mp3 *.wma *.flac *.aiff *.raw *.au *.ra|"
const
QString
filter
=
i18n
(
"*.ogg *.wav *.mp3 *.wma *.flac *.aiff *.raw *.au *.ra|"
"Audio Files (*.ogg *.wav *.mp3 *.wma *.flac *.aiff *.raw *.au *.ra)"
);
K
UrlRequester
*
rq
=
addWidPath
(
CalendarSupport
::
KCalPrefs
::
instance
()
->
audioFilePathItem
(),
nullptr
,
filter
)
->
urlReques
ter
(
);
r
q
->
setEnabled
(
cb
->
isChecked
());
m
UrlRequester
=
new
KUrlRequester
(
this
);
mUrlRequester
->
setFilter
(
fil
ter
);
mUrlRequeste
r
->
setEnabled
(
cb
->
isChecked
());
connect
(
cb
,
&
QCheckBox
::
toggled
,
r
q
,
&
KUrlRequester
::
setEnabled
);
connect
(
cb
,
&
QCheckBox
::
toggled
,
mUrlRequeste
r
,
&
KUrlRequester
::
setEnabled
);
QVBoxLayout
*
audioFileRemindersBox
=
new
QVBoxLayout
;
audioFileRemindersBox
->
addWidget
(
cb
);
audioFileRemindersBox
->
addWidget
(
r
q
);
audioFileRemindersBox
->
addWidget
(
mUrlRequeste
r
);
remindersLayout
->
addLayout
(
audioFileRemindersBox
,
1
,
0
);
remindersLayout
->
addWidget
(
addWidBool
(
CalendarSupport
::
KCalPrefs
::
instance
()
->
defaultEventRemindersItem
())
->
checkBox
(),
2
,
0
);
remindersLayout
->
addWidget
(
addWidBool
(
CalendarSupport
::
KCalPrefs
::
instance
()
->
defaultTodoRemindersItem
())
->
checkBox
(),
3
,
0
);
mDefaultEventRemindersCheckBox
=
new
QCheckBox
(
CalendarSupport
::
KCalPrefs
::
instance
()
->
defaultEventRemindersItem
()
->
label
(),
this
);
remindersLayout
->
addWidget
(
mDefaultEventRemindersCheckBox
,
2
,
0
);
mDefaultTodoRemindersCheckBox
=
new
QCheckBox
(
CalendarSupport
::
KCalPrefs
::
instance
()
->
defaultTodoRemindersItem
()
->
label
(),
this
);
remindersLayout
->
addWidget
(
mDefaultTodoRemindersCheckBox
,
3
,
0
);
defaultLayout
->
setRowStretch
(
3
,
1
);
load
();
...
...
@@ -484,6 +478,10 @@ public:
protected:
void
usrReadConfig
()
override
{
//TODO mFirstDayCombo
//TODO mDefaultEventRemindersCheckBox mDefaultTodoRemindersCheckBox
mExcludeHolidaysCheckbox
->
setChecked
(
KOPrefs
::
instance
()
->
excludeHolidays
());
mUrlRequester
->
setText
(
CalendarSupport
::
KCalPrefs
::
instance
()
->
audioFilePath
());
mReminderTimeSpin
->
setValue
(
CalendarSupport
::
KCalPrefs
::
instance
()
->
mReminderTime
);
mReminderUnitsCombo
->
setCurrentIndex
(
CalendarSupport
::
KCalPrefs
::
instance
()
->
mReminderTimeUnits
);
...
...
@@ -494,6 +492,10 @@ protected:
void
usrWriteConfig
()
override
{
//TODO mFirstDayCombo
//TODO mDefaultEventRemindersCheckBox mDefaultTodoRemindersCheckBox
//TODO mUrlRequester;
KOPrefs
::
instance
()
->
setExcludeHolidays
(
mExcludeHolidaysCheckbox
->
isChecked
());
QStringList
HolidayRegions
;
const
auto
checkedItems
=
mHolidayCheckCombo
->
checkedItems
();
for
(
const
QString
&
str
:
checkedItems
)
{
...
...
@@ -539,11 +541,20 @@ protected:
}
private:
void
slotConfigChanged
()
{
Q_EMIT
markAsChanged
();
}
QStringList
tzonenames
;
KPIM
::
KCheckComboBox
*
mHolidayCheckCombo
=
nullptr
;
QSpinBox
*
mReminderTimeSpin
=
nullptr
;
KComboBox
*
mReminderUnitsCombo
=
nullptr
;
QCheckBox
*
mWorkDays
[
7
];
QComboBox
*
mFirstDayCombo
=
nullptr
;
QCheckBox
*
mDefaultEventRemindersCheckBox
=
nullptr
;
QCheckBox
*
mDefaultTodoRemindersCheckBox
=
nullptr
;
KUrlRequester
*
mUrlRequester
=
nullptr
;
QCheckBox
*
mExcludeHolidaysCheckbox
=
nullptr
;
};
extern
"C"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment