summaryrefslogtreecommitdiffstats
path: root/tderadio3/plugins/timecontrol
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2022-05-30 19:40:31 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2022-05-31 01:17:58 +0900
commitd95a4fea540b371fa86493d069fdbd54f33c5b40 (patch)
tree079b038ab559439eb7ded40a07bd79fd92926b3b /tderadio3/plugins/timecontrol
parente54890e0480e5adee69f5220a7c6dd072bbd75ea (diff)
downloadtderadio-d95a4fea540b371fa86493d069fdbd54f33c5b40.tar.gz
tderadio-d95a4fea540b371fa86493d069fdbd54f33c5b40.zip
Standardize folder structure.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tderadio3/plugins/timecontrol')
-rw-r--r--tderadio3/plugins/timecontrol/CMakeL10n.txt6
-rw-r--r--tderadio3/plugins/timecontrol/Makefile.am17
-rw-r--r--tderadio3/plugins/timecontrol/icons/Makefile.am7
-rw-r--r--tderadio3/plugins/timecontrol/icons/hi16-action-tderadio_kalarm.pngbin430 -> 0 bytes
-rw-r--r--tderadio3/plugins/timecontrol/icons/hi16-action-tderadio_zzz.pngbin295 -> 0 bytes
-rw-r--r--tderadio3/plugins/timecontrol/icons/hi22-action-tderadio_kalarm.pngbin823 -> 0 bytes
-rw-r--r--tderadio3/plugins/timecontrol/icons/hi22-action-tderadio_zzz.pngbin770 -> 0 bytes
-rw-r--r--tderadio3/plugins/timecontrol/icons/hi32-action-tderadio_kalarm.pngbin1544 -> 0 bytes
-rw-r--r--tderadio3/plugins/timecontrol/icons/hi32-action-tderadio_zzz.pngbin1304 -> 0 bytes
-rw-r--r--tderadio3/plugins/timecontrol/icons/hi48-action-tderadio_kalarm.pngbin1927 -> 0 bytes
-rw-r--r--tderadio3/plugins/timecontrol/icons/hi48-action-tderadio_zzz.pngbin2018 -> 0 bytes
-rw-r--r--tderadio3/plugins/timecontrol/icons/tderadio_zzz.pngbin14219 -> 0 bytes
-rw-r--r--tderadio3/plugins/timecontrol/po/Makefile.am2
-rw-r--r--tderadio3/plugins/timecontrol/timecontrol-configuration-ui.ui450
-rw-r--r--tderadio3/plugins/timecontrol/timecontrol-configuration.cpp425
-rw-r--r--tderadio3/plugins/timecontrol/timecontrol-configuration.h91
-rw-r--r--tderadio3/plugins/timecontrol/timecontrol.cpp301
-rw-r--r--tderadio3/plugins/timecontrol/timecontrol.h96
18 files changed, 0 insertions, 1395 deletions
diff --git a/tderadio3/plugins/timecontrol/CMakeL10n.txt b/tderadio3/plugins/timecontrol/CMakeL10n.txt
deleted file mode 100644
index 1b6cf40..0000000
--- a/tderadio3/plugins/timecontrol/CMakeL10n.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-##### create translation templates ##############
-
-tde_l10n_create_template(
- CATALOG "tderadio-timecontrol"
- DESTINATION "po"
-)
diff --git a/tderadio3/plugins/timecontrol/Makefile.am b/tderadio3/plugins/timecontrol/Makefile.am
deleted file mode 100644
index edcda42..0000000
--- a/tderadio3/plugins/timecontrol/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-SUBDIRS = po icons .
-
-INCLUDES = $(all_includes)
-METASOURCES = AUTO
-
-libtderadio_LTLIBRARIES = libtimecontrol.la
-libtimecontrol_la_SOURCES = timecontrol-configuration.cpp \
- timecontrol-configuration-ui.ui timecontrol.cpp
-libtimecontrol_la_LDFLAGS = -module -avoid-version $(KDE_RPATH) $(all_libraries)
-noinst_HEADERS = timecontrol-configuration.h timecontrol.h
-
-#messages: rc.cpp
-# $(XGETTEXT) *.cpp *.h -o po/tderadio-timecontrol.pot
-
-messages: rc.cpp
- $(EXTRACTRC) *.rc *.ui >> rc.cpp
- $(XGETTEXT) rc.cpp *.h *.cpp -o po/tderadio-timecontrol.pot
diff --git a/tderadio3/plugins/timecontrol/icons/Makefile.am b/tderadio3/plugins/timecontrol/icons/Makefile.am
deleted file mode 100644
index a594625..0000000
--- a/tderadio3/plugins/timecontrol/icons/Makefile.am
+++ /dev/null
@@ -1,7 +0,0 @@
-#icons_ICON = tderadio_*
-#iconsdir = $(datadir)/icons
-
-KDE_ICON = tderadio_zzz
-
-icons_ICON = tderadio_kalarm tderadio_zzz
-iconsdir = $(datadir)/icons
diff --git a/tderadio3/plugins/timecontrol/icons/hi16-action-tderadio_kalarm.png b/tderadio3/plugins/timecontrol/icons/hi16-action-tderadio_kalarm.png
deleted file mode 100644
index 3009d55..0000000
--- a/tderadio3/plugins/timecontrol/icons/hi16-action-tderadio_kalarm.png
+++ /dev/null
Binary files differ
diff --git a/tderadio3/plugins/timecontrol/icons/hi16-action-tderadio_zzz.png b/tderadio3/plugins/timecontrol/icons/hi16-action-tderadio_zzz.png
deleted file mode 100644
index 0d677f4..0000000
--- a/tderadio3/plugins/timecontrol/icons/hi16-action-tderadio_zzz.png
+++ /dev/null
Binary files differ
diff --git a/tderadio3/plugins/timecontrol/icons/hi22-action-tderadio_kalarm.png b/tderadio3/plugins/timecontrol/icons/hi22-action-tderadio_kalarm.png
deleted file mode 100644
index e4273d6..0000000
--- a/tderadio3/plugins/timecontrol/icons/hi22-action-tderadio_kalarm.png
+++ /dev/null
Binary files differ
diff --git a/tderadio3/plugins/timecontrol/icons/hi22-action-tderadio_zzz.png b/tderadio3/plugins/timecontrol/icons/hi22-action-tderadio_zzz.png
deleted file mode 100644
index 2a5ad8d..0000000
--- a/tderadio3/plugins/timecontrol/icons/hi22-action-tderadio_zzz.png
+++ /dev/null
Binary files differ
diff --git a/tderadio3/plugins/timecontrol/icons/hi32-action-tderadio_kalarm.png b/tderadio3/plugins/timecontrol/icons/hi32-action-tderadio_kalarm.png
deleted file mode 100644
index 2ae2809..0000000
--- a/tderadio3/plugins/timecontrol/icons/hi32-action-tderadio_kalarm.png
+++ /dev/null
Binary files differ
diff --git a/tderadio3/plugins/timecontrol/icons/hi32-action-tderadio_zzz.png b/tderadio3/plugins/timecontrol/icons/hi32-action-tderadio_zzz.png
deleted file mode 100644
index 4089298..0000000
--- a/tderadio3/plugins/timecontrol/icons/hi32-action-tderadio_zzz.png
+++ /dev/null
Binary files differ
diff --git a/tderadio3/plugins/timecontrol/icons/hi48-action-tderadio_kalarm.png b/tderadio3/plugins/timecontrol/icons/hi48-action-tderadio_kalarm.png
deleted file mode 100644
index e88778d..0000000
--- a/tderadio3/plugins/timecontrol/icons/hi48-action-tderadio_kalarm.png
+++ /dev/null
Binary files differ
diff --git a/tderadio3/plugins/timecontrol/icons/hi48-action-tderadio_zzz.png b/tderadio3/plugins/timecontrol/icons/hi48-action-tderadio_zzz.png
deleted file mode 100644
index a131574..0000000
--- a/tderadio3/plugins/timecontrol/icons/hi48-action-tderadio_zzz.png
+++ /dev/null
Binary files differ
diff --git a/tderadio3/plugins/timecontrol/icons/tderadio_zzz.png b/tderadio3/plugins/timecontrol/icons/tderadio_zzz.png
deleted file mode 100644
index 063e502..0000000
--- a/tderadio3/plugins/timecontrol/icons/tderadio_zzz.png
+++ /dev/null
Binary files differ
diff --git a/tderadio3/plugins/timecontrol/po/Makefile.am b/tderadio3/plugins/timecontrol/po/Makefile.am
deleted file mode 100644
index 26d490c..0000000
--- a/tderadio3/plugins/timecontrol/po/Makefile.am
+++ /dev/null
@@ -1,2 +0,0 @@
-PACKAGE = tderadio-timecontrol
-POFILES = AUTO
diff --git a/tderadio3/plugins/timecontrol/timecontrol-configuration-ui.ui b/tderadio3/plugins/timecontrol/timecontrol-configuration-ui.ui
deleted file mode 100644
index f528418..0000000
--- a/tderadio3/plugins/timecontrol/timecontrol-configuration-ui.ui
+++ /dev/null
@@ -1,450 +0,0 @@
-<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
-<class>TimeControlConfigurationUI</class>
-<widget class="TQWidget">
- <property name="name">
- <cstring>TimeControlConfigurationUI</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>374</width>
- <height>261</height>
- </rect>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
- <property name="name">
- <cstring>layout13</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLabel">
- <property name="name">
- <cstring>labelSleep</cstring>
- </property>
- <property name="text">
- <string>sleep countdown</string>
- </property>
- </widget>
- <widget class="TQSpinBox">
- <property name="name">
- <cstring>editSleep</cstring>
- </property>
- <property name="suffix">
- <string> min</string>
- </property>
- <property name="maxValue">
- <number>200</number>
- </property>
- <property name="minValue">
- <number>1</number>
- </property>
- <property name="lineStep">
- <number>5</number>
- </property>
- <property name="value">
- <number>30</number>
- </property>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer6_2</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </hbox>
- </widget>
- <widget class="Line" row="1" column="0" rowspan="1" colspan="2">
- <property name="name">
- <cstring>line1</cstring>
- </property>
- <property name="frameShape">
- <enum>HLine</enum>
- </property>
- <property name="frameShadow">
- <enum>Sunken</enum>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- </widget>
- <widget class="TQLayoutWidget" row="0" column="0">
- <property name="name">
- <cstring>layout15</cstring>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLayoutWidget">
- <property name="name">
- <cstring>layout14</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLabel">
- <property name="name">
- <cstring>labelAlarmList</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Alarms</string>
- </property>
- </widget>
- <widget class="TQPushButton">
- <property name="name">
- <cstring>buttonAlarmNew</cstring>
- </property>
- <property name="text">
- <string></string>
- </property>
- <property name="iconSet">
- <iconset>"filenew2"</iconset>
- </property>
- </widget>
- <widget class="TQPushButton">
- <property name="name">
- <cstring>buttonDeleteAlarm</cstring>
- </property>
- <property name="text">
- <string></string>
- </property>
- <property name="iconSet">
- <iconset>"edit-delete"</iconset>
- </property>
- </widget>
- </hbox>
- </widget>
- <widget class="TQListBox">
- <property name="name">
- <cstring>listAlarms</cstring>
- </property>
- </widget>
- </vbox>
- </widget>
- <widget class="TQLayoutWidget" row="0" column="1">
- <property name="name">
- <cstring>layout17</cstring>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLayoutWidget">
- <property name="name">
- <cstring>layout28</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLayoutWidget">
- <property name="name">
- <cstring>layout27</cstring>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLabel">
- <property name="name">
- <cstring>labelAlarmDate</cstring>
- </property>
- <property name="text">
- <string>Date</string>
- </property>
- </widget>
- <widget class="TQDateEdit">
- <property name="name">
- <cstring>editAlarmDate</cstring>
- </property>
- </widget>
- </vbox>
- </widget>
- <widget class="TQLayoutWidget">
- <property name="name">
- <cstring>layout28</cstring>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLabel">
- <property name="name">
- <cstring>labelAlarmTime</cstring>
- </property>
- <property name="text">
- <string>Time</string>
- </property>
- </widget>
- <widget class="TQTimeEdit">
- <property name="name">
- <cstring>editAlarmTime</cstring>
- </property>
- </widget>
- </vbox>
- </widget>
- <widget class="TQLayoutWidget">
- <property name="name">
- <cstring>layout29</cstring>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLabel">
- <property name="name">
- <cstring>labelAlarmVolume</cstring>
- </property>
- <property name="text">
- <string>Volume</string>
- </property>
- </widget>
- <widget class="TQSpinBox">
- <property name="name">
- <cstring>editAlarmVolume</cstring>
- </property>
- <property name="suffix">
- <string> %</string>
- </property>
- <property name="maxValue">
- <number>100</number>
- </property>
- <property name="minValue">
- <number>-1</number>
- </property>
- <property name="value">
- <number>-1</number>
- </property>
- </widget>
- </vbox>
- </widget>
- </hbox>
- </widget>
- <widget class="TQLayoutWidget">
- <property name="name">
- <cstring>layout16</cstring>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQCheckBox" row="0" column="0">
- <property name="name">
- <cstring>checkboxAlarmEnable</cstring>
- </property>
- <property name="text">
- <string>enabled</string>
- </property>
- </widget>
- <spacer row="2" column="0">
- <property name="name">
- <cstring>spacer6</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>100</height>
- </size>
- </property>
- </spacer>
- <widget class="TDEListBox" row="0" column="1" rowspan="3" colspan="1">
- <item>
- <property name="text">
- <string>Monday</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Tuesday</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Wednesday</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Thursday</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Friday</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Saturday</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Sunday</string>
- </property>
- </item>
- <property name="name">
- <cstring>listWeekdays</cstring>
- </property>
- <property name="selectionMode">
- <enum>Multi</enum>
- </property>
- </widget>
- <widget class="TQCheckBox" row="1" column="0">
- <property name="name">
- <cstring>checkboxAlarmDaily</cstring>
- </property>
- <property name="text">
- <string>daily</string>
- </property>
- </widget>
- </grid>
- </widget>
- <widget class="TQLabel">
- <property name="name">
- <cstring>labelStationSelection</cstring>
- </property>
- <property name="text">
- <string>Radio Station</string>
- </property>
- </widget>
- <widget class="TQComboBox">
- <property name="name">
- <cstring>comboStationSelection</cstring>
- </property>
- </widget>
- <widget class="TQLayoutWidget">
- <property name="name">
- <cstring>layout20</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLabel">
- <property name="name">
- <cstring>pixmapAlarmStation</cstring>
- </property>
- <property name="minimumSize">
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- <property name="scaledContents">
- <bool>true</bool>
- </property>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer8</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>150</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </hbox>
- </widget>
- <widget class="TQComboBox">
- <item>
- <property name="text">
- <string>Start Playing</string>
- </property>
- <property name="pixmap">
- <pixmap>"tderadio_muteoff"</pixmap>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Stop Playing</string>
- </property>
- <property name="pixmap">
- <pixmap>"tderadio_muteon"</pixmap>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Start Recording</string>
- </property>
- <property name="pixmap">
- <pixmap>"tderadio_record"</pixmap>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Stop Recording</string>
- </property>
- <property name="pixmap">
- <pixmap>"tderadio_muteon"</pixmap>
- </property>
- </item>
- <property name="name">
- <cstring>comboAlarmType</cstring>
- </property>
- </widget>
- </vbox>
- </widget>
- </grid>
-</widget>
-<customwidgets>
-</customwidgets>
-<tabstops>
- <tabstop>listAlarms</tabstop>
- <tabstop>buttonAlarmNew</tabstop>
- <tabstop>buttonDeleteAlarm</tabstop>
- <tabstop>editAlarmDate</tabstop>
- <tabstop>editAlarmTime</tabstop>
- <tabstop>editAlarmVolume</tabstop>
- <tabstop>checkboxAlarmDaily</tabstop>
- <tabstop>checkboxAlarmEnable</tabstop>
- <tabstop>comboStationSelection</tabstop>
-</tabstops>
-<pixmapfunction>SmallIcon</pixmapfunction>
-<layoutdefaults spacing="6" margin="0"/>
-<includes>
- <include location="global" impldecl="in implementation">kiconloader.h</include>
- <include location="global" impldecl="in implementation">tdelistbox.h</include>
-</includes>
-</UI>
diff --git a/tderadio3/plugins/timecontrol/timecontrol-configuration.cpp b/tderadio3/plugins/timecontrol/timecontrol-configuration.cpp
deleted file mode 100644
index db3a760..0000000
--- a/tderadio3/plugins/timecontrol/timecontrol-configuration.cpp
+++ /dev/null
@@ -1,425 +0,0 @@
-/***************************************************************************
- timecontrol-configuration.cpp - description
- -------------------
- begin : Sam Aug 2 2003
- copyright : (C) 2003 by Martin Witte
- email : witte@kawo1.rwth-aachen.de
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
-#include <math.h>
-#include <algorithm>
-using std::sort;
-
-#include <tqdatetime.h>
-#include <tqlistbox.h>
-#include <tqcombobox.h>
-#include <tqdatetimeedit.h>
-#include <tqlabel.h>
-#include <tqspinbox.h>
-#include <tqcheckbox.h>
-#include <tqpushbutton.h>
-
-#include <tdelistbox.h>
-#include <tdelocale.h>
-
-#include "../../src/include/stationlist.h"
-#include "../../src/include/alarm.h"
-#include "../../src/include/errorlog-interfaces.h"
-#include "../../src/include/radiostation.h"
-
-#include "timecontrol-configuration.h"
-
-class DateTimeCmp
-{
-public:
- bool operator() (const Alarm &a, const Alarm &b) {
- return a.nextAlarm(true) < b.nextAlarm(true);
- }
-
-};
-
-TimeControlConfiguration::TimeControlConfiguration (TQWidget *parent)
- : TimeControlConfigurationUI(parent),
- ITimeControlClient(),
- IRadioClient(),
- ignoreChanges(false),
- m_dirty(false)
-{
-
- TQObject::connect(checkboxAlarmDaily, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotDailyChanged(bool)));
- TQObject::connect(listWeekdays, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotWeekdaysChanged()));
- TQObject::connect(checkboxAlarmEnable, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotEnabledChanged(bool)));
- TQObject::connect(comboStationSelection, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotStationChanged(int)));
- TQObject::connect(listAlarms, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotAlarmSelectChanged(int)));
- TQObject::connect(editAlarmDate, TQT_SIGNAL(valueChanged(const TQDate &)), this, TQT_SLOT(slotDateChanged(const TQDate &)));
- TQObject::connect(editAlarmTime, TQT_SIGNAL(valueChanged(const TQTime &)), this, TQT_SLOT(slotTimeChanged(const TQTime &)));
- TQObject::connect(editAlarmVolume, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotVolumeChanged(int)));
- TQObject::connect(buttonAlarmNew, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewAlarm()));
- TQObject::connect(buttonDeleteAlarm, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDeleteAlarm()));
- TQObject::connect(comboAlarmType, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotAlarmTypeChanged(int)));
-
- TQObject::connect(checkboxAlarmDaily, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSetDirty()));
- TQObject::connect(listWeekdays, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSetDirty()));
- TQObject::connect(checkboxAlarmEnable, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSetDirty()));
- TQObject::connect(comboStationSelection, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetDirty()));
- TQObject::connect(editAlarmDate, TQT_SIGNAL(valueChanged(const TQDate &)), this, TQT_SLOT(slotSetDirty()));
- TQObject::connect(editAlarmTime, TQT_SIGNAL(valueChanged(const TQTime &)), this, TQT_SLOT(slotSetDirty()));
- TQObject::connect(editAlarmVolume, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotSetDirty()));
- TQObject::connect(buttonAlarmNew, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSetDirty()));
- TQObject::connect(buttonDeleteAlarm, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSetDirty()));
- TQObject::connect(comboAlarmType, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetDirty()));
- TQObject::connect(editSleep, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotSetDirty()));
-}
-
-TimeControlConfiguration::~TimeControlConfiguration ()
-{
-}
-
-bool TimeControlConfiguration::connectI (Interface *i)
-{
- bool a = ITimeControlClient::connectI(i);
- bool b = IRadioClient::connectI(i);
- return a || b;
-}
-
-
-bool TimeControlConfiguration::disconnectI (Interface *i)
-{
- bool a = ITimeControlClient::disconnectI(i);
- bool b = IRadioClient::disconnectI(i);
- return a || b;
-}
-
-
-// ITimeControlClient
-
-bool TimeControlConfiguration::noticeAlarmsChanged(const AlarmVector &sl)
-{
- int idx = listAlarms->currentItem();
- int currentID = (idx >= 0 && (unsigned)idx < alarms.size()) ? alarms[idx].ID() : -1;
-
- alarms = sl;
- sort(alarms.begin(), alarms.end(), DateTimeCmp());
-
- bool oldBlock = listAlarms->signalsBlocked();
- listAlarms->blockSignals(true);
-
- listAlarms->clear();
- idx = -1;
- int k = 0;
- for (ciAlarmVector i = alarms.begin(); i != alarms.end(); ++i, ++k) {
- listAlarms->insertItem(i->nextAlarm(true).toString());
- if (i->ID() == currentID)
- idx = k;
- }
- listAlarms->setCurrentItem(idx);
-
- listAlarms->blockSignals(oldBlock);
-
- slotAlarmSelectChanged(idx);
- return true;
-}
-
-bool TimeControlConfiguration::noticeAlarm(const Alarm &)
-{
- return false;
-}
-
-bool TimeControlConfiguration::noticeNextAlarmChanged(const Alarm *)
-{
- noticeAlarmsChanged(alarms);
- return true;
-}
-
-bool TimeControlConfiguration::noticeCountdownStarted(const TQDateTime &/*end*/)
-{
- return false;
-}
-
-bool TimeControlConfiguration::noticeCountdownStopped()
-{
- return false;
-}
-
-bool TimeControlConfiguration::noticeCountdownZero()
-{
- return false;
-}
-
-bool TimeControlConfiguration::noticeCountdownSecondsChanged(int n)
-{
- editSleep->setValue((int)rint(n / 60));
- return false;
-}
-
-
-// IRadioClient
-
-bool TimeControlConfiguration::noticePowerChanged(bool /*on*/)
-{
- return false;
-}
-
-bool TimeControlConfiguration::noticeStationChanged (const RadioStation &, int /*idx*/)
-{
- return false;
-}
-
-bool TimeControlConfiguration::noticeStationsChanged(const StationList &sl)
-{
- comboStationSelection->clear();
- stationIDs.clear();
- comboStationSelection->insertItem(i18n("<don't change>"));
- stationIDs.push_back(TQString());
-
- for (RawStationList::Iterator i(sl.all()); i.current(); ++i) {
- comboStationSelection->insertItem(i.current()->iconName(),
- i.current()->longName());
- stationIDs.push_back(i.current()->stationID());
- }
- return true;
-}
-
-
-// Slots
-
-
-void TimeControlConfiguration::slotDateChanged( const TQDate &d )
-{
- if (ignoreChanges) return;
-
- int idx = listAlarms->currentItem();
- if (idx >= 0 && (unsigned)idx < alarms.size()) {
- Alarm &a = alarms[idx];
- a.setDate(d);
-
- ignoreChanges = true;
- bool oldBlock = listAlarms->signalsBlocked();
- listAlarms->blockSignals(true);
- noticeAlarmsChanged(alarms);
- listAlarms->blockSignals(oldBlock);
- ignoreChanges = false;
- }
-}
-
-
-void TimeControlConfiguration::slotTimeChanged(const TQTime &t)
-{
- if (ignoreChanges) return;
-
- int idx = listAlarms->currentItem();
- if (idx >= 0 && (unsigned)idx < alarms.size()) {
- Alarm &a = alarms[idx];
- a.setTime(t);
-
- ignoreChanges = true;
- bool oldBlock = listAlarms->signalsBlocked();
- listAlarms->blockSignals(true);
- noticeAlarmsChanged(alarms);
- listAlarms->blockSignals(oldBlock);
- ignoreChanges = false;
- }
-}
-
-
-void TimeControlConfiguration::slotDailyChanged (bool b)
-{
- if (ignoreChanges) return;
-
- int idx = listAlarms->currentItem();
- if (idx >= 0 && (unsigned)idx < alarms.size()) {
- Alarm &a = alarms[idx];
- a.setDaily(b);
-
- ignoreChanges = true;
- bool oldBlock = listAlarms->signalsBlocked();
- listAlarms->blockSignals(true);
- noticeAlarmsChanged(alarms);
- listAlarms->blockSignals(oldBlock);
- ignoreChanges = false;
-
- editAlarmDate ->setDisabled(b);
- labelAlarmDate->setDisabled(b);
- listWeekdays ->setDisabled(!b);
- }
-}
-
-
-void TimeControlConfiguration::slotWeekdaysChanged ()
-{
- if (ignoreChanges) return;
-
- int mask = 0;
- for (int i = 0; i < 7; ++i) {
- if (listWeekdays->isSelected(i)) {
- mask |= (1 << i);
- }
- }
-
- int idx = listAlarms->currentItem();
- if (idx >= 0 && (unsigned)idx < alarms.size()) {
- Alarm &a = alarms[idx];
- a.setWeekdayMask(mask);
-
- ignoreChanges = true;
- bool oldBlock = listAlarms->signalsBlocked();
- listAlarms->blockSignals(true);
- noticeAlarmsChanged(alarms);
- listAlarms->blockSignals(oldBlock);
- ignoreChanges = false;
- }
-}
-
-
-void TimeControlConfiguration::slotEnabledChanged( bool b)
-{
- int idx = listAlarms->currentItem();
- if (idx >= 0 && (unsigned)idx < alarms.size()) {
- alarms[idx].setEnabled(b);
- }
-}
-
-
-void TimeControlConfiguration::slotStationChanged( int i )
-{
- int idx = listAlarms->currentItem();
- if ( idx >= 0 && (unsigned)idx < alarms.size()
- && i >= 0 && (unsigned)i < stationIDs.size())
- {
- alarms[idx].setStationID( stationIDs[i] );
- }
-}
-
-
-void TimeControlConfiguration::slotVolumeChanged( int v )
-{
- int idx = listAlarms->currentItem();
- if (idx >= 0 && (unsigned)idx < alarms.size()) {
- alarms[idx].setVolumePreset(0.01 * (float)v);
- }
-}
-
-
-void TimeControlConfiguration::slotAlarmTypeChanged(int t)
-{
- int idx = listAlarms->currentItem();
- if (idx >= 0 && (unsigned)idx < alarms.size()) {
- alarms[idx].setAlarmType((Alarm::AlarmType)t);
- }
-}
-
-
-void TimeControlConfiguration::slotAlarmSelectChanged(int idx)
-{
- if (ignoreChanges) return;
- ignoreChanges = true;
-
- Alarm a;
- bool valid = false;
-
- if (idx >= 0 && (unsigned)idx < alarms.size()) {
-
- a = alarms[idx];
- valid = true;
-
- }
-
- editAlarmDate ->setDisabled(!valid || a.isDaily());
- labelAlarmDate ->setDisabled(!valid || a.isDaily());
- listWeekdays ->setDisabled(!valid ||!a.isDaily());
- editAlarmTime ->setDisabled(!valid);
- labelAlarmTime ->setDisabled(!valid);
- labelAlarmVolume ->setDisabled(!valid);
- editAlarmVolume ->setDisabled(!valid);
- checkboxAlarmDaily ->setDisabled(!valid);
- checkboxAlarmEnable ->setDisabled(!valid);
- comboStationSelection->setDisabled(!valid);
- labelStationSelection->setDisabled(!valid);
- buttonDeleteAlarm ->setDisabled(!valid);
- comboAlarmType ->setDisabled(!valid);
-
- editAlarmDate ->setDate(a.alarmTime().date());
- editAlarmTime ->setTime(a.alarmTime().time());
- checkboxAlarmDaily ->setChecked(a.isDaily());
- checkboxAlarmEnable ->setChecked(a.isEnabled());
- editAlarmVolume ->setValue((int)rint(a.volumePreset() * 100));
- comboAlarmType ->setCurrentItem(a.alarmType());
-
- int k = 0;
- const TQString &sID = a.stationID();
- for (int i = 0; !k && i < (int)stationIDs.size(); ++i)
- if (stationIDs[i] == sID) k = i;
- comboStationSelection->setCurrentItem(k);
-
- int m = a.weekdayMask();
- for (int i = 0; i < 7; ++i) {
- listWeekdays->setSelected(i, m & (1 << i));
- }
-
- ignoreChanges = false;
-}
-
-
-void TimeControlConfiguration::slotNewAlarm()
-{
- TQDateTime dt(TQDateTime::currentDateTime());
- Alarm a(dt, false, false);
- alarms.push_back(a);
- listAlarms->insertItem(a.alarmTime().toString());
- listAlarms->setSelected(listAlarms->count() - 1, true);
- noticeAlarmsChanged(alarms);
-}
-
-
-void TimeControlConfiguration::slotDeleteAlarm()
-{
- int idx = listAlarms->currentItem();
-
- if (idx >= 0 && (unsigned)idx < alarms.size()) {
- // unfortunately a function vector<>::erase(idx) does not exist
- iAlarmVector i = alarms.begin();
- for (int k = 0; k < idx; ++k)
- ++i;
- if (i != alarms.end())
- alarms.erase(i);
- listAlarms->removeItem(idx);
- }
-}
-
-
-void TimeControlConfiguration::slotOK()
-{
- if (m_dirty) {
- sendAlarms(alarms);
- sendCountdownSeconds(editSleep->value() * 60);
- m_dirty = false;
- }
-}
-
-void TimeControlConfiguration::slotCancel()
-{
- if (m_dirty) {
- noticeAlarmsChanged(queryAlarms());
- noticeCountdownSecondsChanged(queryCountdownSeconds());
- m_dirty = false;
- }
-}
-
-void TimeControlConfiguration::slotSetDirty()
-{
- if (!ignoreChanges) {
- m_dirty = true;
- }
-}
-
-
-#include "timecontrol-configuration.moc"
diff --git a/tderadio3/plugins/timecontrol/timecontrol-configuration.h b/tderadio3/plugins/timecontrol/timecontrol-configuration.h
deleted file mode 100644
index b53747e..0000000
--- a/tderadio3/plugins/timecontrol/timecontrol-configuration.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/***************************************************************************
- timecontro-configuration.h - description
- -------------------
- begin : Sam Aug 2 2003
- copyright : (C) 2003 by Martin Witte
- email : witte@kawo1.rwth-aachen.de
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-#ifndef KRADIO_TIMECONTROL_CONFIGURATION_H
-#define KRADIO_TIMECONTROL_CONFIGURATION_H
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "../../src/include/radio_interfaces.h"
-#include "../../src/include/timecontrol_interfaces.h"
-#include "timecontrol-configuration-ui.h"
-
-class TimeControl;
-class TQWidget;
-
-class TimeControlConfiguration : public TimeControlConfigurationUI,
- public ITimeControlClient,
- public IRadioClient
-{
-Q_OBJECT
-
-public :
- TimeControlConfiguration (TQWidget *parent);
- ~TimeControlConfiguration ();
-
- bool connectI (Interface *i);
- bool disconnectI (Interface *i);
-
-// ITimeControlClient
-
- bool noticeAlarmsChanged(const AlarmVector &sl);
- bool noticeAlarm(const Alarm &);
- bool noticeNextAlarmChanged(const Alarm *);
- bool noticeCountdownStarted(const TQDateTime &end);
- bool noticeCountdownStopped();
- bool noticeCountdownZero();
- bool noticeCountdownSecondsChanged(int n);
-
-// IRadioClient
-
- bool noticePowerChanged(bool on);
- bool noticeStationChanged (const RadioStation &, int idx);
- bool noticeStationsChanged(const StationList &sl);
- bool noticePresetFileChanged(const TQString &/*f*/) { return false; }
-
- bool noticeCurrentSoundStreamIDChanged(SoundStreamID /*id*/) { return false; }
-
-protected slots:
-
- void slotDailyChanged (bool daily);
- void slotWeekdaysChanged ();
- void slotEnabledChanged (bool enable);
- void slotStationChanged (int idx);
- void slotAlarmSelectChanged(int idx);
- void slotDateChanged(const TQDate &d);
- void slotTimeChanged(const TQTime &d);
- void slotVolumeChanged(int v);
- void slotAlarmTypeChanged(int idx);
-
- void slotNewAlarm();
- void slotDeleteAlarm();
-
- void slotOK();
- void slotCancel();
- void slotSetDirty();
-
-protected:
-
- AlarmVector alarms;
- vector<TQString> stationIDs;
-
- bool ignoreChanges;
- bool m_dirty;
-};
-
-#endif
diff --git a/tderadio3/plugins/timecontrol/timecontrol.cpp b/tderadio3/plugins/timecontrol/timecontrol.cpp
deleted file mode 100644
index 1b56ff0..0000000
--- a/tderadio3/plugins/timecontrol/timecontrol.cpp
+++ /dev/null
@@ -1,301 +0,0 @@
-/***************************************************************************
- timecontrol.cpp - description
- -------------------
- begin : Son Jan 12 2003
- copyright : (C) 2003 by Martin Witte
- email : witte@kawo1.rwth-aachen.de
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
-#include <tdeaboutdata.h>
-#include <tdeconfig.h>
-
-#include "timecontrol.h"
-#include "timecontrol-configuration.h"
-#include "../../src/include/pluginmanager.h"
-#include "../../src/include/aboutwidget.h"
-
-//const char *AlarmListElement = "alarmlist";
-//const char *AlarmElement = "alarm";
-const char *AlarmDateElement = "date";
-const char *AlarmTimeElement = "time";
-const char *AlarmDailyElement = "daily";
-const char *AlarmWeekdayMaskElement = "weekdayMask";
-const char *AlarmEnabledElement = "enabled";
-const char *AlarmStationIDElement = "stationID";
-//const char *AlarmFrequencyElement = "frequency";
-const char *AlarmVolumeElement = "volume";
-const char *AlarmTypeElement = "type";
-
-
-///////////////////////////////////////////////////////////////////////
-//// plugin library functions
-
-PLUGIN_LIBRARY_FUNCTIONS(TimeControl, "tderadio-timecontrol", i18n("Time Control and Alarm Functions"));
-
-///////////////////////////////////////////////////////////////////////
-
-
-TimeControl::TimeControl (const TQString &n)
- : PluginBase(n, i18n("TimeControl Plugin")),
- m_waitingFor(NULL),
- m_countdownSeconds(0),
- m_alarmTimer(this),
- m_countdownTimer(this)
-{
- TQObject::connect(&m_alarmTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotQTimerAlarmTimeout()));
- TQObject::connect(&m_countdownTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotQTimerCountdownTimeout()));
-}
-
-
-TimeControl::~TimeControl ()
-{
- m_waitingFor = NULL;
-}
-
-bool TimeControl::connectI (Interface *i)
-{
- bool a = ITimeControl::connectI(i);
- bool b = PluginBase::connectI(i);
- return a || b;
-}
-
-bool TimeControl::disconnectI (Interface *i)
-{
- bool a = ITimeControl::disconnectI(i);
- bool b = PluginBase::disconnectI(i);
- return a || b;
-}
-
-bool TimeControl::setAlarms (const AlarmVector &al)
-{
- if (m_alarms != al) {
- m_waitingFor = NULL;
-
- m_alarms = al;
-
- slotQTimerAlarmTimeout();
-
- notifyAlarmsChanged(m_alarms);
- }
- return true;
-}
-
-
-bool TimeControl::setCountdownSeconds(int n)
-{
- int old = m_countdownSeconds;
- m_countdownSeconds = n;
- if (old != n)
- notifyCountdownSecondsChanged(n);
- return true;
-}
-
-
-bool TimeControl::startCountdown()
-{
- m_countdownEnd = TQDateTime::currentDateTime().addSecs(m_countdownSeconds);
- m_countdownTimer.start(m_countdownSeconds * 1000, true);
-
- notifyCountdownStarted(getCountdownEnd());
-
- return true;
-}
-
-
-bool TimeControl::stopCountdown()
-{
- m_countdownTimer.stop();
- m_countdownEnd = TQDateTime();
-
- notifyCountdownStopped();
-
- return true;
-}
-
-
-TQDateTime TimeControl::getNextAlarmTime() const
-{
- const Alarm *a = getNextAlarm();
- if (a)
- return a->nextAlarm();
- else
- return TQDateTime();
-}
-
-
-const Alarm *TimeControl::getNextAlarm () const
-{
- TQDateTime now = TQDateTime::currentDateTime(),
- next;
-
- const Alarm *retval = NULL;
-
- for (ciAlarmVector i = m_alarms.begin(); i != m_alarms.end(); ++i) {
- TQDateTime n = i->nextAlarm();
- if (n.isValid() && n > now && ( ! next.isValid() || n < next)) {
- next = n;
- retval = &(*i);
- }
- }
-
- TQDateTime old = m_nextAlarm_tmp;
- m_nextAlarm_tmp = next;
- if (old != m_nextAlarm_tmp) {
- notifyNextAlarmChanged(retval);
- }
-
- return retval;
-}
-
-
-TQDateTime TimeControl::getCountdownEnd () const
-{
- if (m_countdownTimer.isActive())
- return m_countdownEnd;
- else
- return TQDateTime();
-}
-
-
-void TimeControl::slotQTimerCountdownTimeout()
-{
- stopCountdown();
-
- notifyCountdownZero();
-}
-
-
-void TimeControl::slotQTimerAlarmTimeout()
-{
- if (m_waitingFor) {
- notifyAlarm(*m_waitingFor);
- }
-
- TQDateTime now = TQDateTime::currentDateTime();
- Alarm const *n = getNextAlarm();
- TQDateTime na = getNextAlarmTime();
-
- m_waitingFor = NULL;
-
- if (na.isValid()) {
-
- int days = now.daysTo(na);
- int msecs = now.time().msecsTo(na.time());
-
- if (days > 1) {
- m_alarmTimer.start(24 * 3600 * 1000, true);
-
- } else if (days >= 0) {
-
- if (days > 0)
- msecs += days * 24 * 3600 * 1000;
-
- if (msecs > 0) {
- m_waitingFor = n;
- m_alarmTimer.start(msecs, true);
- }
- }
- }
-}
-
-
-void TimeControl::restoreState (TDEConfig *config)
-{
- AlarmVector al;
-
- config->setGroup(TQString("timecontrol-") + name());
-
- int nAlarms = config->readNumEntry ("nAlarms", 0);
- for (int idx = 1; idx <= nAlarms; ++idx) {
-
- TQString num = TQString().setNum(idx);
- TQDateTime d = config->readDateTimeEntry(AlarmTimeElement + num);
- bool enable = config->readBoolEntry(AlarmEnabledElement + num, false);
- bool daily = config->readBoolEntry(AlarmDailyElement + num, false);
- int weekdayMask = config->readNumEntry(AlarmWeekdayMaskElement + num, 0x7F);
- float vol = config->readDoubleNumEntry(AlarmVolumeElement + num, 1);
- TQString sid = config->readEntry(AlarmStationIDElement + num, TQString());
- int type = config->readNumEntry(AlarmTypeElement + num, 0);
-
- enable &= d.isValid();
-
- Alarm a ( d, daily, enable);
- a.setVolumePreset(vol);
- a.setWeekdayMask(weekdayMask);
- a.setStationID(sid);
- a.setAlarmType((Alarm::AlarmType)type);
- al.push_back(a);
- }
-
- setAlarms(al);
- setCountdownSeconds(config->readNumEntry("countdownSeconds", 30*60));
-}
-
-
-void TimeControl::saveState (TDEConfig *config) const
-{
- config->setGroup(TQString("timecontrol-") + name());
-
- config->writeEntry("nAlarms", m_alarms.size());
- int idx = 1;
- ciAlarmVector end = m_alarms.end();
- for (ciAlarmVector i = m_alarms.begin(); i != end; ++i, ++idx) {
- TQString num = TQString().setNum(idx);
- config->writeEntry (AlarmTimeElement + num, i->alarmTime());
- config->writeEntry (AlarmEnabledElement + num, i->isEnabled());
- config->writeEntry (AlarmDailyElement + num, i->isDaily());
- config->writeEntry (AlarmWeekdayMaskElement + num, i->weekdayMask());
- config->writeEntry (AlarmVolumeElement + num, i->volumePreset());
- config->writeEntry (AlarmStationIDElement + num, i->stationID());
- config->writeEntry (AlarmTypeElement + num, i->alarmType());
- }
-
- config->writeEntry("countdownSeconds", m_countdownSeconds);
-}
-
-
-ConfigPageInfo TimeControl::createConfigurationPage()
-{
- TimeControlConfiguration *conf = new TimeControlConfiguration(NULL);
- connectI(conf);
- return ConfigPageInfo (conf, i18n("Alarms"), i18n("Setup Alarms"), "tderadio_kalarm");
-}
-
-
-AboutPageInfo TimeControl::createAboutPage()
-{
-/* TDEAboutData aboutData("tderadio",
- NULL,
- NULL,
- I18N_NOOP("Time Control Plugin for TDERadio."
- "<P>"
- "Provides Alarms and Sleep Countdown"
- "<P>"),
- TDEAboutData::License_GPL,
- "(c) 2002-2005 Martin Witte, Klas Kalass",
- 0,
- "http://sourceforge.net/projects/tderadio",
- 0);
- aboutData.addAuthor("Martin Witte", "", "witte@kawo1.rwth-aachen.de");
- aboutData.addAuthor("Klas Kalass", "", "klas.kalass@gmx.de");
-
- return AboutPageInfo(
- new TDERadioAboutWidget(aboutData, TDERadioAboutWidget::AbtTabbed),
- i18n("Alarms"),
- i18n("Time Control Plugin"),
- "tderadio_kalarm"
- );*/
- return AboutPageInfo();
-}
-
-
-#include "timecontrol.moc"
diff --git a/tderadio3/plugins/timecontrol/timecontrol.h b/tderadio3/plugins/timecontrol/timecontrol.h
deleted file mode 100644
index 933d8f2..0000000
--- a/tderadio3/plugins/timecontrol/timecontrol.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/***************************************************************************
- timecontrol.h - description
- -------------------
- begin : Son Jan 12 2003
- copyright : (C) 2003 by Martin Witte
- email : witte@kawo1.rwth-aachen.de
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
-#ifndef KRADIO_TIMECONTROL_H
-#define KRADIO_TIMECONTROL_H
-
-#include <tqobject.h>
-#include <tqtimer.h>
-
-#include "../../src/include/alarm.h"
-#include "../../src/include/plugins.h"
-#include "../../src/include/timecontrol_interfaces.h"
-
-// well, it has to be a TQObject :( , but only for
-// receiving TQTimer - timeouts
-
-class TimeControl : public TQObject,
- public PluginBase,
- public ITimeControl
-{
- Q_OBJECT
-
-protected:
- AlarmVector m_alarms;
- Alarm const * m_waitingFor; // m_alarmTimer is exactly for this date/time
-
- int m_countdownSeconds; // in seconds
- TQDateTime m_countdownEnd;
-
- TQTimer m_alarmTimer;
- TQTimer m_countdownTimer;
-
- mutable TQDateTime m_nextAlarm_tmp; // used to recognize nextAlarm changes
-
-public:
- TimeControl (const TQString &name);
- ~TimeControl();
-
- virtual TQString pluginClassName() const { return "TimeControl"; }
-
- virtual const TQString &name() const { return PluginBase::name(); }
- virtual TQString &name() { return PluginBase::name(); }
-
- virtual bool connectI (Interface *i);
- virtual bool disconnectI (Interface *i);
-
- // PluginBase
-
-public:
- virtual void saveState (TDEConfig *) const;
- virtual void restoreState (TDEConfig *);
-
- virtual ConfigPageInfo createConfigurationPage();
- virtual AboutPageInfo createAboutPage();
-
-
- // ITimeControl Interface methods
-
-RECEIVERS:
- bool setAlarms(const AlarmVector &sl);
- bool setCountdownSeconds(int n);
- bool startCountdown();
- bool stopCountdown();
-
-ANSWERS:
- TQDateTime getNextAlarmTime () const;
- const Alarm* getNextAlarm () const;
- const AlarmVector & getAlarms () const { return m_alarms; }
- int getCountdownSeconds () const { return m_countdownSeconds; }
- TQDateTime getCountdownEnd () const;
-
-
- // slots for receiving timeout messages of timers
-
-protected slots:
- virtual void slotQTimerAlarmTimeout();
- virtual void slotQTimerCountdownTimeout();
-
-};
-
-
-#endif