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

Add option to give alarms a name

parent 3b0afdbf
Pipeline #38881 passed with stage
in 24 minutes and 48 seconds
KAlarm Change Log KAlarm Change Log
=== Version 3.1.0 (KDE Applications 20.12) --- 25 October 2020 === === Version 3.1.0 (KDE Applications 20.12) --- 28 October 2020 ===
+ Add option to show alarm message as a notification instead of in a window [KDE Bug 345922] + Add option to show alarm message as a notification instead of in a window [KDE Bug 345922]
+ Add option to give alarms a name.
+ Don't execute display alarms while desktop notifications are inhibited. + Don't execute display alarms while desktop notifications are inhibited.
+ Cancel any screen saver when an alarm is displayed. + Cancel any screen saver when an alarm is displayed.
......
doc/editwindow-simple.png

47.8 KB | W: | H:

doc/editwindow-simple.png

49 KB | W: | H:

doc/editwindow-simple.png
doc/editwindow-simple.png
doc/editwindow-simple.png
doc/editwindow-simple.png
  • 2-up
  • Swipe
  • Onion skin
doc/editwindow.png

72.5 KB | W: | H:

doc/editwindow.png

73.5 KB | W: | H:

doc/editwindow.png
doc/editwindow.png
doc/editwindow.png
doc/editwindow.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<!-- Don't change format of date and version of the documentation --> <!-- Don't change format of date and version of the documentation -->
<date>2020-10-22</date> <date>2020-10-28</date>
<releaseinfo>3.1.0 (Applications 20.12)</releaseinfo> <releaseinfo>3.1.0 (Applications 20.12)</releaseinfo>
<abstract> <abstract>
...@@ -66,10 +66,10 @@ ...@@ -66,10 +66,10 @@
messages, the playing of sound files, the execution of commands and messages, the playing of sound files, the execution of commands and
the sending of emails.</para> the sending of emails.</para>
<para>In its default graphical mode, &kalarm; displays the list of <para>&kalarm; displays the list of pending alarms, showing their
pending alarms, showing their times and details. You can create new times and details. You can create new alarms, or you can select
alarms, or you can select existing alarms for modification or existing alarms for modification or deletion. You can also optionally
deletion. You can also optionally view expired alarms.</para> view expired alarms.</para>
<para>When configuring an alarm, you can choose whether it should <para>When configuring an alarm, you can choose whether it should
repeat, and whether the alarm should be canceled if it cannot be repeat, and whether the alarm should be canceled if it cannot be
...@@ -186,7 +186,7 @@ background.</para> ...@@ -186,7 +186,7 @@ background.</para>
<title>Alarm List</title> <title>Alarm List</title>
<para>The main &kalarm; window displays the current list of pending <para>The main &kalarm; window displays the current list of pending
alarms, showing their times, repetition intervals, colors, and alarms, showing their times, repetition intervals, colors, names, and
message texts, names of files to play or display, commands to execute message texts, names of files to play or display, commands to execute
or email subjects. (For a recurring alarm, the time shown is its next or email subjects. (For a recurring alarm, the time shown is its next
scheduled trigger time. For an alarm with a reminder, the time shown scheduled trigger time. For an alarm with a reminder, the time shown
...@@ -194,6 +194,11 @@ is the time of the alarm proper, not the reminder time.) An icon at ...@@ -194,6 +194,11 @@ is the time of the alarm proper, not the reminder time.) An icon at
the left of each alarm text/file/command/email subject indicates the the left of each alarm text/file/command/email subject indicates the
type of alarm.</para> type of alarm.</para>
<para>Note that the <guilabel>Name</guilabel> column only exists if
the use of alarm names is enabled in the
<link linkend="preferences-general">General</link> tab of the
Configuration dialog.</para>
<screenshot> <screenshot>
<screeninfo>Screenshot of the &kalarm; main window</screeninfo> <screeninfo>Screenshot of the &kalarm; main window</screeninfo>
<mediaobject> <mediaobject>
...@@ -222,17 +227,19 @@ above.</para> ...@@ -222,17 +227,19 @@ above.</para>
<title>Changing the Alarm List Appearance</title> <title>Changing the Alarm List Appearance</title>
<para>The alarms may be ordered by date/time, repeat interval, color, <para>The alarms may be ordered by date/time, repeat interval, color,
type or text by clicking on the titlebar for the appropriate column. type, name or text by clicking on the titlebar for the appropriate
To reverse the sort order, click the column titlebar again.</para> column. To reverse the sort order, click the column titlebar
again.</para>
<para>You can optionally show the remaining time until each alarm is <para>You can optionally show the remaining time until each alarm is
due, together with, or instead of, the alarm's scheduled time.</para> due, together with, or instead of, the alarm's scheduled time.</para>
<para>You can select which columns to display or hide by <para>You can select which columns to display or hide by
<mousebutton>Right</mousebutton> clicking on the column headings and <mousebutton>Right</mousebutton> clicking on the column headings and
using the context menu to set the columns to show. But note that the using the context menu to set the columns to show. But note that at
<guilabel>Message, File or Command</guilabel> column, and at least one least one of the <guilabel>Name</guilabel> or
of the <guilabel>Time</guilabel> or <guilabel>Time To</guilabel> <guilabel>Message, File or Command</guilabel> columns, and at least
one of the <guilabel>Time</guilabel> or <guilabel>Time To</guilabel>
columns, are always shown.</para> columns, are always shown.</para>
<para>If you use multiple alarm calendars, you can color code alarms <para>If you use multiple alarm calendars, you can color code alarms
...@@ -1173,6 +1180,21 @@ the Alarm Edit dialog using the ...@@ -1173,6 +1180,21 @@ the Alarm Edit dialog using the
</mediaobject> </mediaobject>
</screenshot> </screenshot>
<sect2>
<title>Alarm Name</title>
<para>You can give a name to the alarm in the
<guilabel>Alarm name</guilabel> field. This is a convenience to help
you identify the alarm more easily. You do not have to enter a name,
and it need not be unique.</para>
<para>Note that this field is only displayed if the the use of alarm
names is enabled in the
<link linkend="preferences-general">General</link> tab of the
Configuration dialog.</para>
</sect2>
<sect2> <sect2>
<title>Alarm Action</title> <title>Alarm Action</title>
...@@ -2549,6 +2571,14 @@ option is automatically re-enabled by default whenever you change run ...@@ -2549,6 +2571,14 @@ option is automatically re-enabled by default whenever you change run
mode.</para> mode.</para>
</listitem> </listitem>
<listitem><para><guilabel>Use alarm names</guilabel>: Specify
whether each alarm can be given a name to help you to identify it.
This determines whether the <guilabel>Name</guilabel> column will be
shown in the <link linkend="alarm-list">alarm list</link>, and
whether the <guilabel>Alarm name</guilabel> field will appear in the
<link linkend="alarm-edit-dlg">Alarm Edit dialog</link>.</para>
</listitem>
<listitem><para><guilabel>Confirm alarm deletions</guilabel>: Specify <listitem><para><guilabel>Confirm alarm deletions</guilabel>: Specify
whether you should be prompted for confirmation each time you delete whether you should be prompted for confirmation each time you delete
an alarm.</para> an alarm.</para>
...@@ -3217,7 +3247,11 @@ time.</para> ...@@ -3217,7 +3247,11 @@ time.</para>
with this option.</entry> with this option.</entry>
</row> </row>
<row> <row>
<entry><option>-n</option>, <option>--notify</option></entry> <entry><option>-n</option>, <option>--name</option></entry>
<entry>Specify a name to help you to identify the alarm.</entry>
</row>
<row>
<entry><option>-N</option>, <option>--notify</option></entry>
<entry>Display the alarm as a notification, not in a window. <entry>Display the alarm as a notification, not in a window.
<option>--color</option>, <option>--colorfg</option>, <option>--color</option>, <option>--colorfg</option>,
<option>--play</option>, <option>--ack-confirm</option> and <option>--play</option>, <option>--ack-confirm</option> and
...@@ -3559,7 +3593,8 @@ unchanged.</para> ...@@ -3559,7 +3593,8 @@ unchanged.</para>
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
<synopsis> <synopsis>
bool scheduleMessage(const QString&amp; <replaceable>message</replaceable>, bool scheduleMessage(const QString&amp; <replaceable>name</replaceable>,
const QString&amp; <replaceable>message</replaceable>,
const QString&amp; <replaceable>startDateTime</replaceable>, const QString&amp; <replaceable>startDateTime</replaceable>,
int <replaceable>lateCancel</replaceable>, int <replaceable>lateCancel</replaceable>,
unsigned <replaceable>flags</replaceable>, unsigned <replaceable>flags</replaceable>,
...@@ -3573,7 +3608,8 @@ bool scheduleMessage(const QString&amp; <replaceable>message</replaceable>, ...@@ -3573,7 +3608,8 @@ bool scheduleMessage(const QString&amp; <replaceable>message</replaceable>,
int <replaceable>subRepeatCount</replaceable>) int <replaceable>subRepeatCount</replaceable>)
</synopsis> </synopsis>
<synopsis> <synopsis>
bool scheduleMessage(const QString&amp; <replaceable>message</replaceable>, bool scheduleMessage(const QString&amp; <replaceable>name</replaceable>,
const QString&amp; <replaceable>message</replaceable>,
const QString&amp; <replaceable>startDateTime</replaceable>, const QString&amp; <replaceable>startDateTime</replaceable>,
int <replaceable>lateCancel</replaceable>, int <replaceable>lateCancel</replaceable>,
unsigned <replaceable>flags</replaceable>, unsigned <replaceable>flags</replaceable>,
...@@ -3587,7 +3623,8 @@ bool scheduleMessage(const QString&amp; <replaceable>message</replaceable>, ...@@ -3587,7 +3623,8 @@ bool scheduleMessage(const QString&amp; <replaceable>message</replaceable>,
int <replaceable>recurCount</replaceable>) int <replaceable>recurCount</replaceable>)
</synopsis> </synopsis>
<synopsis> <synopsis>
bool scheduleMessage(const QString&amp; <replaceable>message</replaceable>, bool scheduleMessage(const QString&amp; <replaceable>name</replaceable>,
const QString&amp; <replaceable>message</replaceable>,
const QString&amp; <replaceable>startDateTime</replaceable>, const QString&amp; <replaceable>startDateTime</replaceable>,
int <replaceable>lateCancel</replaceable>, int <replaceable>lateCancel</replaceable>,
unsigned <replaceable>flags</replaceable>, unsigned <replaceable>flags</replaceable>,
...@@ -3604,6 +3641,13 @@ bool scheduleMessage(const QString&amp; <replaceable>message</replaceable>, ...@@ -3604,6 +3641,13 @@ bool scheduleMessage(const QString&amp; <replaceable>message</replaceable>,
<refsect2> <refsect2>
<title>Parameters</title> <title>Parameters</title>
<variablelist> <variablelist>
<varlistentry>
<term><parameter>name</parameter></term>
<listitem>
<para>Specifies an optional name for the alarm.</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><parameter>message</parameter></term> <term><parameter>message</parameter></term>
<listitem> <listitem>
...@@ -3819,7 +3863,8 @@ text or image file.</refpurpose> ...@@ -3819,7 +3863,8 @@ text or image file.</refpurpose>
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
<synopsis> <synopsis>
bool scheduleFile(const QString&amp; <replaceable>URL</replaceable>, bool scheduleFile(const QString&amp; <replaceable>name</replaceable>,
const QString&amp; <replaceable>URL</replaceable>,
const QString&amp; <replaceable>startDateTime</replaceable>, const QString&amp; <replaceable>startDateTime</replaceable>,
int <replaceable>lateCancel</replaceable>, int <replaceable>lateCancel</replaceable>,
unsigned <replaceable>flags</replaceable>, unsigned <replaceable>flags</replaceable>,
...@@ -3831,7 +3876,8 @@ bool scheduleFile(const QString&amp; <replaceable>URL</replaceable>, ...@@ -3831,7 +3876,8 @@ bool scheduleFile(const QString&amp; <replaceable>URL</replaceable>,
int <replaceable>subRepeatCount</replaceable>) int <replaceable>subRepeatCount</replaceable>)
</synopsis> </synopsis>
<synopsis> <synopsis>
bool scheduleFile(const QString&amp; <replaceable>URL</replaceable>, bool scheduleFile(const QString&amp; <replaceable>name</replaceable>,
const QString&amp; <replaceable>URL</replaceable>,
const QString&amp; <replaceable>startDateTime</replaceable>, const QString&amp; <replaceable>startDateTime</replaceable>,
int <replaceable>lateCancel</replaceable>, int <replaceable>lateCancel</replaceable>,
unsigned <replaceable>flags</replaceable>, unsigned <replaceable>flags</replaceable>,
...@@ -3843,7 +3889,8 @@ bool scheduleFile(const QString&amp; <replaceable>URL</replaceable>, ...@@ -3843,7 +3889,8 @@ bool scheduleFile(const QString&amp; <replaceable>URL</replaceable>,
int <replaceable>recurCount</replaceable>) int <replaceable>recurCount</replaceable>)
</synopsis> </synopsis>
<synopsis> <synopsis>
bool scheduleFile(const QString&amp; <replaceable>URL</replaceable>, bool scheduleFile(const QString&amp; <replaceable>name</replaceable>,
const QString&amp; <replaceable>URL</replaceable>,
const QString&amp; <replaceable>startDateTime</replaceable>, const QString&amp; <replaceable>startDateTime</replaceable>,
int <replaceable>lateCancel</replaceable>, int <replaceable>lateCancel</replaceable>,
unsigned <replaceable>flags</replaceable>, unsigned <replaceable>flags</replaceable>,
...@@ -3858,6 +3905,13 @@ bool scheduleFile(const QString&amp; <replaceable>URL</replaceable>, ...@@ -3858,6 +3905,13 @@ bool scheduleFile(const QString&amp; <replaceable>URL</replaceable>,
<refsect2> <refsect2>
<title>Parameters</title> <title>Parameters</title>
<variablelist> <variablelist>
<varlistentry>
<term><parameter>name</parameter></term>
<listitem>
<para>Specifies an optional name for the alarm.</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><parameter>URL</parameter></term> <term><parameter>URL</parameter></term>
<listitem> <listitem>
...@@ -4043,7 +4097,8 @@ command.</refpurpose> ...@@ -4043,7 +4097,8 @@ command.</refpurpose>
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
<synopsis> <synopsis>
bool scheduleCommand(const QString&amp; <replaceable>commandLine</replaceable>, bool scheduleCommand(const QString&amp; <replaceable>name</replaceable>,
const QString&amp; <replaceable>commandLine</replaceable>,
const QString&amp; <replaceable>startDateTime</replaceable>, const QString&amp; <replaceable>startDateTime</replaceable>,
int <replaceable>lateCancel</replaceable>, int <replaceable>lateCancel</replaceable>,
unsigned <replaceable>flags</replaceable>, unsigned <replaceable>flags</replaceable>,
...@@ -4052,7 +4107,8 @@ bool scheduleCommand(const QString&amp; <replaceable>commandLine</replaceable>, ...@@ -4052,7 +4107,8 @@ bool scheduleCommand(const QString&amp; <replaceable>commandLine</replaceable>,
int <replaceable>subRepeatCount</replaceable>) int <replaceable>subRepeatCount</replaceable>)
</synopsis> </synopsis>
<synopsis> <synopsis>
bool scheduleCommand(const QString&amp; <replaceable>commandLine</replaceable>, bool scheduleCommand(const QString&amp; <replaceable>name</replaceable>,
const QString&amp; <replaceable>commandLine</replaceable>,
const QString&amp; <replaceable>startDateTime</replaceable>, const QString&amp; <replaceable>startDateTime</replaceable>,
int <replaceable>lateCancel</replaceable>, int <replaceable>lateCancel</replaceable>,
unsigned <replaceable>flags</replaceable>, unsigned <replaceable>flags</replaceable>,
...@@ -4061,7 +4117,8 @@ bool scheduleCommand(const QString&amp; <replaceable>commandLine</replaceable>, ...@@ -4061,7 +4117,8 @@ bool scheduleCommand(const QString&amp; <replaceable>commandLine</replaceable>,
int <replaceable>recurCount</replaceable>) int <replaceable>recurCount</replaceable>)
</synopsis> </synopsis>
<synopsis> <synopsis>
bool scheduleCommand(const QString&amp; <replaceable>commandLine</replaceable>, bool scheduleCommand(const QString&amp; <replaceable>name</replaceable>,
const QString&amp; <replaceable>commandLine</replaceable>,
const QString&amp; <replaceable>startDateTime</replaceable>, const QString&amp; <replaceable>startDateTime</replaceable>,
int <replaceable>lateCancel</replaceable>, int <replaceable>lateCancel</replaceable>,
unsigned <replaceable>flags</replaceable>, unsigned <replaceable>flags</replaceable>,
...@@ -4073,6 +4130,13 @@ bool scheduleCommand(const QString&amp; <replaceable>commandLine</replaceable>, ...@@ -4073,6 +4130,13 @@ bool scheduleCommand(const QString&amp; <replaceable>commandLine</replaceable>,
<refsect2> <refsect2>
<title>Parameters</title> <title>Parameters</title>
<variablelist> <variablelist>
<varlistentry>
<term><parameter>name</parameter></term>
<listitem>
<para>Specifies an optional name for the alarm.</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><parameter>commandLine</parameter></term> <term><parameter>commandLine</parameter></term>
<listitem> <listitem>
...@@ -4225,7 +4289,8 @@ parameters, its usage is identical to ...@@ -4225,7 +4289,8 @@ parameters, its usage is identical to
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
<synopsis> <synopsis>
bool scheduleEmail(const QString&amp; <replaceable>fromID</replaceable>, bool scheduleEmail(const QString&amp; <replaceable>name</replaceable>,
const QString&amp; <replaceable>fromID</replaceable>,
const QString&amp; <replaceable>addresses</replaceable>, const QString&amp; <replaceable>addresses</replaceable>,
const QString&amp; <replaceable>subject</replaceable>, const QString&amp; <replaceable>subject</replaceable>,
const QString&amp; <replaceable>message</replaceable>, const QString&amp; <replaceable>message</replaceable>,
...@@ -4238,7 +4303,8 @@ bool scheduleEmail(const QString&amp; <replaceable>fromID</replaceable>, ...@@ -4238,7 +4303,8 @@ bool scheduleEmail(const QString&amp; <replaceable>fromID</replaceable>,
int <replaceable>subRepeatCount</replaceable>) int <replaceable>subRepeatCount</replaceable>)
</synopsis> </synopsis>
<synopsis> <synopsis>
bool scheduleEmail(const QString&amp; <replaceable>fromID</replaceable>, bool scheduleEmail(const QString&amp; <replaceable>name</replaceable>,
const QString&amp; <replaceable>fromID</replaceable>,
const QString&amp; <replaceable>addresses</replaceable>, const QString&amp; <replaceable>addresses</replaceable>,
const QString&amp; <replaceable>subject</replaceable>, const QString&amp; <replaceable>subject</replaceable>,
const QString&amp; <replaceable>message</replaceable>, const QString&amp; <replaceable>message</replaceable>,
...@@ -4251,7 +4317,8 @@ bool scheduleEmail(const QString&amp; <replaceable>fromID</replaceable>, ...@@ -4251,7 +4317,8 @@ bool scheduleEmail(const QString&amp; <replaceable>fromID</replaceable>,
int <replaceable>recurCount</replaceable>) int <replaceable>recurCount</replaceable>)
</synopsis> </synopsis>
<synopsis> <synopsis>
bool scheduleEmail(const QString&amp; <replaceable>fromID</replaceable>, bool scheduleEmail(const QString&amp; <replaceable>name</replaceable>,
const QString&amp; <replaceable>fromID</replaceable>,
const QString&amp; <replaceable>addresses</replaceable>, const QString&amp; <replaceable>addresses</replaceable>,
const QString&amp; <replaceable>subject</replaceable>, const QString&amp; <replaceable>subject</replaceable>,
const QString&amp; <replaceable>message</replaceable>, const QString&amp; <replaceable>message</replaceable>,
...@@ -4267,6 +4334,13 @@ bool scheduleEmail(const QString&amp; <replaceable>fromID</replaceable>, ...@@ -4267,6 +4334,13 @@ bool scheduleEmail(const QString&amp; <replaceable>fromID</replaceable>,
<refsect2> <refsect2>
<title>Parameters</title> <title>Parameters</title>
<variablelist> <variablelist>
<varlistentry>
<term><parameter>name</parameter></term>
<listitem>
<para>Specifies an optional name for the alarm.</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><parameter>fromID</parameter></term> <term><parameter>fromID</parameter></term>
<listitem> <listitem>
...@@ -4450,7 +4524,8 @@ command.</refpurpose> ...@@ -4450,7 +4524,8 @@ command.</refpurpose>
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
<synopsis> <synopsis>
bool scheduleAudio(const QString&amp; <replaceable>audioURL</replaceable>, bool scheduleAudio(const QString&amp; <replaceable>name</replaceable>,
const QString&amp; <replaceable>audioURL</replaceable>,
int <replaceable>volumePercent</replaceable>, int <replaceable>volumePercent</replaceable>,
const QString&amp; <replaceable>startDateTime</replaceable>, const QString&amp; <replaceable>startDateTime</replaceable>,
int <replaceable>lateCancel</replaceable>, int <replaceable>lateCancel</replaceable>,
...@@ -4460,7 +4535,8 @@ bool scheduleAudio(const QString&amp; <replaceable>audioURL</replaceable>, ...@@ -4460,7 +4535,8 @@ bool scheduleAudio(const QString&amp; <replaceable>audioURL</replaceable>,
int <replaceable>subRepeatCount</replaceable>) int <replaceable>subRepeatCount</replaceable>)
</synopsis> </synopsis>
<synopsis> <synopsis>
bool scheduleAudio(const QString&amp; <replaceable>audioURL</replaceable>, bool scheduleAudio(const QString&amp; <replaceable>name</replaceable>,
const QString&amp; <replaceable>audioURL</replaceable>,
int <replaceable>volumePercent</replaceable>, int <replaceable>volumePercent</replaceable>,
const QString&amp; <replaceable>startDateTime</replaceable>, const QString&amp; <replaceable>startDateTime</replaceable>,
int <replaceable>lateCancel</replaceable>, int <replaceable>lateCancel</replaceable>,
...@@ -4470,7 +4546,8 @@ bool scheduleAudio(const QString&amp; <replaceable>audioURL</replaceable>, ...@@ -4470,7 +4546,8 @@ bool scheduleAudio(const QString&amp; <replaceable>audioURL</replaceable>,
int <replaceable>recurCount</replaceable>) int <replaceable>recurCount</replaceable>)
</synopsis> </synopsis>
<synopsis> <synopsis>
bool scheduleAudio(const QString&amp; <replaceable>audioURL</replaceable>, bool scheduleAudio(const QString&amp; <replaceable>name</replaceable>,
const QString&amp; <replaceable>audioURL</replaceable>,
int <replaceable>volumePercent</replaceable>, int <replaceable>volumePercent</replaceable>,
const QString&amp; <replaceable>startDateTime</replaceable>, const QString&amp; <replaceable>startDateTime</replaceable>,
int <replaceable>lateCancel</replaceable>, int <replaceable>lateCancel</replaceable>,
...@@ -4483,6 +4560,13 @@ bool scheduleAudio(const QString&amp; <replaceable>audioURL</replaceable>, ...@@ -4483,6 +4560,13 @@ bool scheduleAudio(const QString&amp; <replaceable>audioURL</replaceable>,
<refsect2> <refsect2>
<title>Parameters</title> <title>Parameters</title>
<variablelist> <variablelist>
<varlistentry>
<term><parameter>name</parameter></term>
<listitem>
<para>Specifies an optional name for the alarm.</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><parameter>audioURL</parameter></term> <term><parameter>audioURL</parameter></term>
<listitem> <listitem>
......
doc/mainwindow-calendars.png

59 KB | W: | H:

doc/mainwindow-calendars.png

61.6 KB | W: | H:

doc/mainwindow-calendars.png
doc/mainwindow-calendars.png
doc/mainwindow-calendars.png
doc/mainwindow-calendars.png
  • 2-up
  • Swipe
  • Onion skin
doc/mainwindow.png

47.6 KB | W: | H:

doc/mainwindow.png

49.7 KB | W: | H:

doc/mainwindow.png
doc/mainwindow.png
doc/mainwindow.png
doc/mainwindow.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -28,37 +28,52 @@ AlarmListView::AlarmListView(const QByteArray& configGroup, QWidget* parent) ...@@ -28,37 +28,52 @@ AlarmListView::AlarmListView(const QByteArray& configGroup, QWidget* parent)
connect(header(), &QHeaderView::sectionMoved, this, &AlarmListView::saveColumnsState); connect(header(), &QHeaderView::sectionMoved, this, &AlarmListView::saveColumnsState);
header()->setContextMenuPolicy(Qt::CustomContextMenu); header()->setContextMenuPolicy(Qt::CustomContextMenu);
connect(header(), &QWidget::customContextMenuRequested, this, &AlarmListView::headerContextMenuRequested); connect(header(), &QWidget::customContextMenuRequested, this, &AlarmListView::headerContextMenuRequested);
Preferences::connect(&Preferences::useAlarmNameChanged, this, &AlarmListView::useAlarmNameChanged);
} }
/****************************************************************************** /******************************************************************************
* Return which of the optional columns are currently shown. * Return which of the optional columns are currently shown.
* Note that the column order must be the same as in setColumnsVisible(). * Note that the column order must be the same as in setColumnsVisible().
* Reply = array of 5 columns if not using alarm names;
* = array of 6 columns if not using alarm names.
*/ */
QList<bool> AlarmListView::columnsVisible() const QList<bool> AlarmListView::columnsVisible() const
{ {
if (!model()) if (!model())
return {}; return {};
return { !header()->isSectionHidden(AlarmListModel::TimeColumn), QList<bool> vis{ !header()->isSectionHidden(AlarmListModel::TimeColumn),
!header()->isSectionHidden(AlarmListModel::TimeToColumn), !header()->isSectionHidden(AlarmListModel::TimeToColumn),
!header()->isSectionHidden(AlarmListModel::RepeatColumn), !header()->isSectionHidden(AlarmListModel::RepeatColumn),
!header()->isSectionHidden(AlarmListModel::ColourColumn), !header()->isSectionHidden(AlarmListModel::ColourColumn),
!header()->isSectionHidden(AlarmListModel::TypeColumn) }; !header()->isSectionHidden(AlarmListModel::TypeColumn) };
if (Preferences::useAlarmName())
vis += !header()->isSectionHidden(AlarmListModel::TextColumn);
return vis;
} }
/****************************************************************************** /******************************************************************************
* Set which of the optional columns are to be shown. * Set which of the optional columns are to be shown.
* 'show' = array of 5 columns if not using alarm names;
* = array of 6 columns if not using alarm names.
* Note that the column order must be the same as in columnsVisible(). * Note that the column order must be the same as in columnsVisible().
*/ */
void AlarmListView::setColumnsVisible(const QList<bool>& show) void AlarmListView::setColumnsVisible(const QList<bool>& show)
{ {
if (!model()) if (!model())
return; return;
const QList<bool> vis = (show.size() < 5) ? QList<bool>{true, false, true, true, true} : show; const bool useName = Preferences::useAlarmName();
QList<bool> vis{ true, false, true, true, true, !useName };
const int colCount = useName ? 6 : 5;
for (int i = 0; i < colCount; ++i)
vis[i] = show[i];
header()->setSectionHidden(AlarmListModel::TimeColumn, !vis[0]); header()->setSectionHidden(AlarmListModel::TimeColumn, !vis[0]);
header()->setSectionHidden(AlarmListModel::TimeToColumn, !vis[1]); header()->setSectionHidden(AlarmListModel::TimeToColumn, !vis[1]);
header()->setSectionHidden(AlarmListModel::RepeatColumn, !vis[2]); header()->setSectionHidden(AlarmListModel::RepeatColumn, !vis[2]);
header()->setSectionHidden(AlarmListModel::ColourColumn, !vis[3]); header()->setSectionHidden(AlarmListModel::ColourColumn, !vis[3]);
header()->setSectionHidden(AlarmListModel::TypeColumn, !vis[4]); header()->setSectionHidden(AlarmListModel::TypeColumn, !vis[4]);
header()->setSectionHidden(AlarmListModel::NameColumn, !useName);
header()->setSectionHidden(AlarmListModel::TextColumn, !vis[5]);
setReplaceBlankName();
setSortingEnabled(false); // sortByColumn() won't work if sorting is already enabled! setSortingEnabled(false); // sortByColumn() won't work if sorting is already enabled!
sortByColumn(vis[0] ? AlarmListModel::TimeColumn : AlarmListModel::TimeToColumn, Qt::AscendingOrder); sortByColumn(vis[0] ? AlarmListModel::TimeColumn : AlarmListModel::TimeToColumn, Qt::AscendingOrder);
} }
...@@ -71,13 +86,23 @@ void AlarmListView::initSections() ...@@ -71,13 +86,23 @@ void AlarmListView::initSections()
KConfigGroup config(KSharedConfig::openConfig(), mConfigGroup.constData()); KConfigGroup config(KSharedConfig::openConfig(), mConfigGroup.constData());
const QByteArray settings = config.readEntry("ListHead", QByteArray()); const QByteArray settings = config.readEntry("ListHead", QByteArray());
if (!settings.isEmpty()) if (!settings.isEmpty())
{
header()->restoreState(settings); header()->restoreState(settings);
const bool useName = Preferences::useAlarmName();
header()->setSectionHidden(AlarmListModel::NameColumn, !useName);
if (!useName)
{
header()->setSectionHidden(AlarmListModel::TextColumn, false);
setReplaceBlankName();
}
}
header()->setSectionsMovable(true); header()->setSectionsMovable(true);
header()->setSectionResizeMode(AlarmListModel::TimeColumn, QHeaderView::ResizeToContents); header()->setSectionResizeMode(AlarmListModel::TimeColumn, QHeaderView::ResizeToContents);
header()->setSectionResizeMode(AlarmListModel::TimeToColumn, QHeaderView::ResizeToContents); header()->setSectionResizeMode(AlarmListModel::TimeToColumn, QHeaderView::ResizeToContents);
header()->setSectionResizeMode(AlarmListModel::RepeatColumn, QHeaderView::ResizeToContents); header()->setSectionResizeMode(AlarmListModel::RepeatColumn, QHeaderView::ResizeToContents);
header()->setSectionResizeMode(AlarmListModel::ColourColumn, QHeaderView::Fixed); header()->setSectionResizeMode(AlarmListModel::ColourColumn, QHeaderView::Fixed);
header()->setSectionResizeMode(AlarmListModel::TypeColumn, QHeaderView::Fixed); header()->setSectionResizeMode(AlarmListModel::TypeColumn, QHeaderView::Fixed);
header()->setSectionResizeMode(AlarmListModel::NameColumn, QHeaderView::ResizeToContents);
header()->setSectionResizeMode(AlarmListModel::TextColumn, QHeaderView::Stretch); header()->setSectionResizeMode(AlarmListModel::TextColumn, QHeaderView::Stretch);
header()->setStretchLastSection(true); // necessary to ensure ResizeToContents columns do resize to contents! header()->setStretchLastSection(true); // necessary to ensure ResizeToContents columns do resize to contents!
const int minWidth = viewOptions().fontMetrics.lineSpacing() * 3 / 4; const int minWidth = viewOptions().fontMetrics.lineSpacing() * 3 / 4;
...@@ -105,10 +130,12 @@ void AlarmListView::saveColumnsState() ...@@ -105,10 +130,12 @@ void AlarmListView::saveColumnsState()
void AlarmListView::headerContextMenuRequested(const QPoint& pt) void AlarmListView::headerContextMenuRequested(const QPoint& pt)
{ {
QAbstractItemModel* almodel = model(); QAbstractItemModel* almodel = model();
int count = header()->count();
QMenu menu;