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
KAlarm
Commits
2d7c54ca
Commit
2d7c54ca
authored
Jan 12, 2021
by
David Jarvie
Browse files
Add default sound volume setting to Preferences dialog
parent
5c39eab6
Pipeline
#47436
canceled with stage
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
2d7c54ca
...
...
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
set
(
PIM_VERSION
"5.16.40"
)
set
(
PIM_VERSION
${
PIM_VERSION
}
)
set
(
RELEASE_SERVICE_VERSION
"21.03.80"
)
set
(
KALARM_VERSION
"3.
1.2
"
)
set
(
KALARM_VERSION
"3.
2.0
"
)
project
(
kalarm VERSION
${
KALARM_VERSION
}
)
...
...
Changelog
View file @
2d7c54ca
KAlarm Change Log
=== Version 3.2.0 (KDE Applications 21.04) --- 1
1
January 2021 ===
=== Version 3.2.0 (KDE Applications 21.04) --- 1
2
January 2021 ===
* Remove KAlarm Akonadi resource code.
* Rename Settings 'Edit' tab to 'Defaults'.
* Rename Preferences 'Edit' tab to 'Alarm Defaults'.
* Add default sound volume setting to Preferences dialogue.
=== Version 3.1.2 (KDE Applications 20.12.2) --- 11 January 2021 ===
* Default to using alarm names.
...
...
@@ -743,7 +744,7 @@ recurs.
=== Version 1.4.3 (KDE 3.5.4) --- 11 July 2006 ===
* Add facility to import alarms from other calendar files.
* Fix Defer dialog time interval maximum to match maximum date/time value.
* Fix Defer dialog
ue
time interval maximum to match maximum date/time value.
* Fix crash when a deferred expired recurring alarm is edited from message window.
* Fix crash when a message is redisplayed after login.
* Prevent inapplicable 'Unable to speak' error when alarm redisplayed after login.
...
...
@@ -776,7 +777,7 @@ recurs.
* Fix New From Template not creating alarm if template contents are not changed.
* Ensure that day and month names translations are independent of locale calendar.
* Display alarm message windows within current screen in multi-head systems.
* Reduce size of Preferences dialog to fit in 1024x768 screen.
* Reduce size of Preferences dialog
ue
to fit in 1024x768 screen.
=== Version 1.3.5 --- 14 December 2005 ===
* Fix email attachments being forgotten when saving alarms.
...
...
@@ -786,7 +787,7 @@ recurs.
* Fix incorrect recurrence frequency in Alarm Edit dialogue's Alarm tab.
=== Version 1.3.3 --- 22 September 2005 ===
* Add day-of-week selection to daily recurrence dialog.
* Add day-of-week selection to daily recurrence dialog
ue
.
=== Version 1.3.2 (KDE 3.5 beta 1) --- 10 September 2005 ===
* Add option to show alarms in KOrganizer's active calendar.
...
...
@@ -824,10 +825,10 @@ recurs.
* Fix failure to enable "Reminder for first recurrence only" checkbox.
=== Version 1.2.7 --- 20 April 2005 ===
* Use a sensible default for terminal window command in Preferences dialog.
* Validate terminal window command entered in Preferences dialog.
* Fix date range no longer being validated in Defer dialog.
* Don't ignore Sound setting in Preferences dialog Edit tab.
* Use a sensible default for terminal window command in Preferences dialog
ue
.
* Validate terminal window command entered in Preferences dialog
ue
.
* Fix date range no longer being validated in Defer dialog
ue
.
* Don't ignore Sound setting in Preferences dialog
ue
Edit tab.
* Reset sound volume (if it was set) as soon as audio file playing is complete.
* Don't start KMix when an alarm is displayed if no sound volume is specified.
* Add command script and execute-in-terminal options to DCOP interface.
...
...
@@ -847,19 +848,19 @@ recurs.
* Add option to run command alarms in terminal windows.
* Accept drag and drop of KAddressBook entries to alarm edit dialog email fields.
* Drag and drop now inserts text where appropriate, rather than replacing it.
* Display correct controls after loading a template in alarm edit dialog.
* Display correct controls after loading a template in alarm edit dialog
ue
.
=== Version 1.2.3 --- 7 December 2004 ===
* Put alarm type icons in a separate, sortable, column in alarm list.
* Align times in alarm list.
* Fix crash when the last recurrence of an alarm is reached.
* Fix random limit on expired alarm discard time if stepping with spinbox buttons.
* Fix dialog layouts for right-to-left languages.
* Fix dialog
ue
layouts for right-to-left languages.
* Fix time spin box layout for right-to-left languages.
=== Version 1.2.2 --- 27 November 2004 ===
* Make alarm daemon (kalarmd) exclusive to KAlarm.
* Move control options for alarm daemon into KAlarm preferences dialog.
* Move control options for alarm daemon into KAlarm preferences dialog
ue
.
* Allow user to specify the late-cancellation period for an alarm.
* Add option to automatically close window after late-cancellation period.
* Add facility to enable and disable individual alarms.
...
...
src/prefdlg.cpp
View file @
2d7c54ca
...
...
@@ -35,6 +35,7 @@
#include "lib/locale.h"
#include "lib/messagebox.h"
#include "lib/radiobutton.h"
#include "lib/slider.h"
#include "lib/stackedwidgets.h"
#include "lib/timeedit.h"
#include "lib/timespinbox.h"
...
...
@@ -1216,7 +1217,7 @@ EditPrefTab::EditPrefTab(StackedScrollGroup* scrollGroup)
auto
*
topTypes
=
new
StackedWidgetT
<
QWidget
>
(
tabgroup
);
auto
*
ttLayout
=
new
QVBoxLayout
(
topTypes
);
mTabTypes
=
mTabs
->
addTab
(
topTypes
,
i18nc
(
"@title:tab
"
,
"Alarm Types
"
));
mTabTypes
=
mTabs
->
addTab
(
topTypes
,
i18nc
(
"@title:tab
Settings specific to alarm type"
,
"Type Specific
"
));
auto
*
topFontColour
=
new
StackedWidgetT
<
QWidget
>
(
tabgroup
);
auto
*
tfLayout
=
new
QVBoxLayout
(
topFontColour
);
...
...
@@ -1381,6 +1382,25 @@ EditPrefTab::EditPrefTab(StackedScrollGroup* scrollGroup)
widget
->
setWhatsThis
(
i18nc
(
"@info:whatsthis"
,
"Enter the default sound file to use in the alarm edit dialog."
));
vlayout
->
addWidget
(
widget
);
box
=
new
QHBoxLayout
();
box
->
setContentsMargins
(
0
,
0
,
0
,
0
);
mSoundVolumeCheckbox
=
new
CheckBox
(
SoundWidget
::
i18n_chk_SetVolume
(),
nullptr
);
connect
(
mSoundVolumeCheckbox
,
&
CheckBox
::
toggled
,
this
,
[
this
](
bool
on
)
{
mSoundVolumeSlider
->
setEnabled
(
on
);
});
box
->
addWidget
(
mSoundVolumeCheckbox
);
mSoundVolumeSlider
=
new
Slider
(
0
,
100
,
10
,
Qt
::
Horizontal
);
mSoundVolumeCheckbox
->
setWhatsThis
(
i18nc
(
"@info:whatsthis"
,
"Select to set the default volume for sound files in the alarm edit dialog."
));
mSoundVolumeSlider
->
setTickPosition
(
QSlider
::
TicksBelow
);
mSoundVolumeSlider
->
setTickInterval
(
10
);
mSoundVolumeSlider
->
setSizePolicy
(
QSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Fixed
));
mSoundVolumeSlider
->
setWhatsThis
(
i18nc
(
"@info:whatsthis"
,
"The default volume for sound files in the alarm edit dialog."
));
mSoundVolumeSlider
->
setEnabled
(
false
);
box
->
addWidget
(
mSoundVolumeSlider
);
label
=
new
QLabel
;
mSoundVolumeSlider
->
setValueLabel
(
label
,
QStringLiteral
(
"%1%"
),
true
);
box
->
addWidget
(
label
);
mSoundVolumeCheckbox
->
setFocusWidget
(
mSoundVolumeSlider
);
vlayout
->
addLayout
(
box
);
// COMMAND ALARMS
group
=
new
QGroupBox
(
i18nc
(
"@title:group"
,
"Command Alarms"
));
ttLayout
->
addWidget
(
group
);
...
...
@@ -1465,6 +1485,9 @@ void EditPrefTab::restore(bool, bool allTabs)
mSound
->
setCurrentIndex
(
soundIndex
(
Preferences
::
defaultSoundType
()));
mSoundFile
->
setText
(
Preferences
::
defaultSoundFile
());
mSoundRepeat
->
setChecked
(
Preferences
::
defaultSoundRepeat
());
const
int
volume
=
Preferences
::
defaultSoundVolume
()
*
100
;
mSoundVolumeCheckbox
->
setChecked
(
volume
>=
0
);
mSoundVolumeSlider
->
setValue
(
volume
>=
0
?
volume
:
100
);
mCmdScript
->
setChecked
(
Preferences
::
defaultCmdScript
());
mCmdXterm
->
setChecked
(
Preferences
::
defaultCmdLogType
()
==
Preferences
::
Log_Terminal
);
mEmailBcc
->
setChecked
(
Preferences
::
defaultEmailBcc
());
...
...
@@ -1529,6 +1552,9 @@ void EditPrefTab::apply(bool syncToDisc)
b
=
mSoundRepeat
->
isChecked
();
if
(
b
!=
Preferences
::
defaultSoundRepeat
())
Preferences
::
setDefaultSoundRepeat
(
b
);
const
float
v
=
mSoundVolumeCheckbox
->
isChecked
()
?
(
float
)
mSoundVolumeSlider
->
value
()
/
100
:
-
1
;
if
(
v
!=
Preferences
::
defaultSoundVolume
())
Preferences
::
setDefaultSoundVolume
(
v
);
b
=
mCmdScript
->
isChecked
();
if
(
b
!=
Preferences
::
defaultCmdScript
())
Preferences
::
setDefaultCmdScript
(
b
);
...
...
src/prefdlg_p.h
View file @
2d7c54ca
/*
* prefdlg_p.h - private classes for program preferences dialog
* Program: kalarm
* SPDX-FileCopyrightText: 2001-202
0
David Jarvie <djarvie@kde.org>
* SPDX-FileCopyrightText: 2001-202
1
David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
...
...
@@ -26,11 +26,13 @@ class QComboBox;
class
QVBoxLayout
;
class
QTabWidget
;
class
FontColourChooser
;
class
CheckBox
;
class
ColourButton
;
class
ButtonGroup
;
class
RadioButton
;
class
TimeEdit
;
class
TimePeriod
;
class
Slider
;
class
SpinBox
;
class
TimeSpinBox
;
class
SpecialActionsButton
;
...
...
@@ -215,6 +217,8 @@ private:
QLabel
*
mSoundFileLabel
;
QLineEdit
*
mSoundFile
;
QPushButton
*
mSoundFileBrowse
;
CheckBox
*
mSoundVolumeCheckbox
;
Slider
*
mSoundVolumeSlider
;
QCheckBox
*
mSoundRepeat
;
QCheckBox
*
mCopyToKOrganizer
;
QCheckBox
*
mLateCancel
;
...
...
src/sounddlg.cpp
View file @
2d7c54ca
/*
* sounddlg.cpp - sound file selection and configuration dialog and widget
* Program: kalarm
* SPDX-FileCopyrightText: 2005-202
0
David Jarvie <djarvie@kde.org>
* SPDX-FileCopyrightText: 2005-202
1
David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
...
...
@@ -40,6 +40,7 @@
// Collect these widget labels together to ensure consistent wording and
// translations across different modules.
QString
SoundWidget
::
i18n_chk_Repeat
()
{
return
i18nc
(
"@option:check"
,
"Repeat"
);
}
QString
SoundWidget
::
i18n_chk_SetVolume
()
{
return
i18nc
(
"@option:check"
,
"Set volume"
);
}
static
const
char
SOUND_DIALOG_NAME
[]
=
"SoundDialog"
;
...
...
@@ -234,7 +235,7 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
grid
->
addWidget
(
box
,
1
,
0
,
1
,
3
);
boxHLayout
=
new
QHBoxLayout
(
box
);
boxHLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
mVolumeCheckbox
=
new
CheckBox
(
i18n
c
(
"@option:check"
,
"
Set
v
olume
"
),
box
);
mVolumeCheckbox
=
new
CheckBox
(
i18n
_chk_
Set
V
olume
(
),
box
);
boxHLayout
->
addWidget
(
mVolumeCheckbox
);
mVolumeCheckbox
->
setFixedSize
(
mVolumeCheckbox
->
sizeHint
());
connect
(
mVolumeCheckbox
,
&
CheckBox
::
toggled
,
this
,
&
SoundWidget
::
slotVolumeToggled
);
...
...
@@ -249,6 +250,9 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
mVolumeSlider
->
setWhatsThis
(
i18nc
(
"@info:whatsthis"
,
"Choose the volume for playing the sound file."
));
mVolumeCheckbox
->
setFocusWidget
(
mVolumeSlider
);
connect
(
mVolumeSlider
,
&
Slider
::
valueChanged
,
this
,
&
SoundWidget
::
changed
);
label
=
new
QLabel
;
mVolumeSlider
->
setValueLabel
(
label
,
QStringLiteral
(
"%1%"
),
true
);
boxHLayout
->
addWidget
(
label
);
// Fade checkbox
mFadeCheckbox
=
new
CheckBox
(
i18nc
(
"@option:check"
,
"Fade"
),
group
);
...
...
src/sounddlg.h
View file @
2d7c54ca
/*
* sounddlg.h - sound file selection and configuration dialog and widget
* Program: kalarm
* SPDX-FileCopyrightText: 2005-201
9
David Jarvie <djarvie@kde.org>
* SPDX-FileCopyrightText: 2005-20
2
1 David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
...
...
@@ -29,83 +29,84 @@ class QAbstractButton;
class
SoundWidget
:
public
QWidget
{
Q_OBJECT
public:
SoundWidget
(
bool
showPlay
,
bool
showRepeat
,
QWidget
*
parent
);
~
SoundWidget
()
override
;
void
set
(
const
QString
&
file
,
float
volume
,
float
fadeVolume
=
-
1
,
int
fadeSeconds
=
0
,
int
repeatPause
=
-
1
);
void
setReadOnly
(
bool
);
bool
isReadOnly
()
const
{
return
mReadOnly
;
}
void
setAllowEmptyFile
()
{
mEmptyFileAllowed
=
true
;
}
QString
fileName
()
const
;
bool
file
(
QUrl
&
,
bool
showErrorMessage
=
true
)
const
;
void
getVolume
(
float
&
volume
,
float
&
fadeVolume
,
int
&
fadeSeconds
)
const
;
int
repeatPause
()
const
;
// -1 if none, else seconds between repeats
QString
defaultDir
()
const
{
return
mDefaultDir
;
}
bool
validate
(
bool
showErrorMessage
)
const
;
static
QString
i18n_chk_Repeat
();
// text of Repeat checkbox
Q_SIGNALS:
void
changed
();
// emitted whenever any contents change
protected:
void
showEvent
(
QShowEvent
*
)
override
;
void
resizeEvent
(
QResizeEvent
*
)
override
;
private
Q_SLOTS
:
void
slotPickFile
();
void
slotVolumeToggled
(
bool
on
);
void
slotFadeToggled
(
bool
on
);
void
playSound
();
void
playFinished
();
private:
static
QString
mDefaultDir
;
// current default directory for mFileEdit
QPushButton
*
mFilePlay
{
nullptr
};
LineEdit
*
mFileEdit
;
PushButton
*
mFileBrowseButton
;
GroupBox
*
mRepeatGroupBox
{
nullptr
};
SpinBox
*
mRepeatPause
{
nullptr
};
CheckBox
*
mVolumeCheckbox
;
Slider
*
mVolumeSlider
;
CheckBox
*
mFadeCheckbox
;
QWidget
*
mFadeBox
;
SpinBox
*
mFadeTime
;
QWidget
*
mFadeVolumeBox
;
Slider
*
mFadeSlider
;
mutable
QUrl
mUrl
;
mutable
QString
mValidatedFile
;
Phonon
::
MediaObject
*
mPlayer
{
nullptr
};
bool
mReadOnly
{
false
};
bool
mEmptyFileAllowed
{
false
};
Q_OBJECT
public:
SoundWidget
(
bool
showPlay
,
bool
showRepeat
,
QWidget
*
parent
);
~
SoundWidget
()
override
;
void
set
(
const
QString
&
file
,
float
volume
,
float
fadeVolume
=
-
1
,
int
fadeSeconds
=
0
,
int
repeatPause
=
-
1
);
void
setReadOnly
(
bool
);
bool
isReadOnly
()
const
{
return
mReadOnly
;
}
void
setAllowEmptyFile
()
{
mEmptyFileAllowed
=
true
;
}
QString
fileName
()
const
;
bool
file
(
QUrl
&
,
bool
showErrorMessage
=
true
)
const
;
void
getVolume
(
float
&
volume
,
float
&
fadeVolume
,
int
&
fadeSeconds
)
const
;
int
repeatPause
()
const
;
// -1 if none, else seconds between repeats
QString
defaultDir
()
const
{
return
mDefaultDir
;
}
bool
validate
(
bool
showErrorMessage
)
const
;
static
QString
i18n_chk_Repeat
();
// text of Repeat checkbox
static
QString
i18n_chk_SetVolume
();
// text of Set volume checkbox
Q_SIGNALS:
void
changed
();
// emitted whenever any contents change
protected:
void
showEvent
(
QShowEvent
*
)
override
;
void
resizeEvent
(
QResizeEvent
*
)
override
;
private
Q_SLOTS
:
void
slotPickFile
();
void
slotVolumeToggled
(
bool
on
);
void
slotFadeToggled
(
bool
on
);
void
playSound
();
void
playFinished
();
private:
static
QString
mDefaultDir
;
// current default directory for mFileEdit
QPushButton
*
mFilePlay
{
nullptr
};
LineEdit
*
mFileEdit
;
PushButton
*
mFileBrowseButton
;
GroupBox
*
mRepeatGroupBox
{
nullptr
};
SpinBox
*
mRepeatPause
{
nullptr
};
CheckBox
*
mVolumeCheckbox
;
Slider
*
mVolumeSlider
;
CheckBox
*
mFadeCheckbox
;
QWidget
*
mFadeBox
;
SpinBox
*
mFadeTime
;
QWidget
*
mFadeVolumeBox
;
Slider
*
mFadeSlider
;
mutable
QUrl
mUrl
;
mutable
QString
mValidatedFile
;
Phonon
::
MediaObject
*
mPlayer
{
nullptr
};
bool
mReadOnly
{
false
};
bool
mEmptyFileAllowed
{
false
};
};
class
SoundDlg
:
public
QDialog
{
Q_OBJECT
public:
SoundDlg
(
const
QString
&
file
,
float
volume
,
float
fadeVolume
,
int
fadeSeconds
,
int
repeatPause
,
const
QString
&
caption
,
QWidget
*
parent
);
void
setReadOnly
(
bool
);
bool
isReadOnly
()
const
{
return
mReadOnly
;
}
QUrl
getFile
()
const
;
void
getVolume
(
float
&
volume
,
float
&
fadeVolume
,
int
&
fadeSeconds
)
const
{
mSoundWidget
->
getVolume
(
volume
,
fadeVolume
,
fadeSeconds
);
}
int
repeatPause
()
const
{
return
mSoundWidget
->
repeatPause
();
}
QString
defaultDir
()
const
{
return
mSoundWidget
->
defaultDir
();
}
protected:
void
resizeEvent
(
QResizeEvent
*
)
override
;
protected
Q_SLOTS
:
void
slotButtonClicked
(
QAbstractButton
*
);
private:
SoundWidget
*
mSoundWidget
;
QDialogButtonBox
*
mButtonBox
;
bool
mReadOnly
{
false
};
Q_OBJECT
public:
SoundDlg
(
const
QString
&
file
,
float
volume
,
float
fadeVolume
,
int
fadeSeconds
,
int
repeatPause
,
const
QString
&
caption
,
QWidget
*
parent
);
void
setReadOnly
(
bool
);
bool
isReadOnly
()
const
{
return
mReadOnly
;
}
QUrl
getFile
()
const
;
void
getVolume
(
float
&
volume
,
float
&
fadeVolume
,
int
&
fadeSeconds
)
const
{
mSoundWidget
->
getVolume
(
volume
,
fadeVolume
,
fadeSeconds
);
}
int
repeatPause
()
const
{
return
mSoundWidget
->
repeatPause
();
}
QString
defaultDir
()
const
{
return
mSoundWidget
->
defaultDir
();
}
protected:
void
resizeEvent
(
QResizeEvent
*
)
override
;
protected
Q_SLOTS
:
void
slotButtonClicked
(
QAbstractButton
*
);
private:
SoundWidget
*
mSoundWidget
;
QDialogButtonBox
*
mButtonBox
;
bool
mReadOnly
{
false
};
};
#endif
...
...
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