File: calendar.h

package info (click to toggle)
shutdown-qapps 1.7.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 1,640 kB
  • sloc: cpp: 3,967; makefile: 10; sh: 1
file content (87 lines) | stat: -rw-r--r-- 2,887 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/* qshutdown, a program to shutdown/reboot/suspend/hibernate the system
 * Copyright (C) 2010-2019 Christian Metscher <hakaishi@web.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 3 of the License, or
 * (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef CALENDAR_H
#define CALENDAR_H

#include "ui_calendar.h"
#include <QDateTime>
#include <QSettings>
#include "weekday.h"
#include "weekdayitem.h"

class Calendar : public QDialog, public Ui::Calendar {
     Q_OBJECT
 
    public:
     Calendar(QWidget *parent = 0);
     ~Calendar();
     bool timeRunning;
     QDateTime setCalendarDate, calendarDate, setWeeklyDate;
     bool getClosed();
     WeekDay     *mon, *tue, *wed, *thu, *fri,
                 *sat, *sun;
     WeekDayItem *mon1, *mon2, *mon3, *mon4, *mon5,
                 *tue1, *tue2, *tue3, *tue4, *tue5,
                 *wed1, *wed2, *wed3, *wed4, *wed5,
                 *thu1, *thu2, *thu3, *thu4, *thu5,
                 *fri1, *fri2, *fri3, *fri4, *fri5,
                 *sat1, *sat2, *sat3, *sat4, *sat5,
                 *sun1, *sun2, *sun3, *sun4, *sun5;

    private:
     QVBoxLayout *scrollArea_layout;
     bool isClosed;
     QList<WeekDayItem* > *mondayItems;
     QList<WeekDayItem* > *tuesdayItems;
     QList<WeekDayItem* > *wednesdayItems;
     QList<WeekDayItem* > *thursdayItems;
     QList<WeekDayItem* > *fridayItems;
     QList<WeekDayItem* > *saturdayItems;
     QList<WeekDayItem* > *sundayItems;
     QSettings *settings;
     QString file;

    private slots:
     void getDate(QDate date);
     void getSortedAndActivatedDays();
     void getNearestTime(QList<int> calculatedDay);
     QList<QTime> getSortedTimes();
     void loadSettings();
     void saveToConfFile();
     void monday_addTimeEditAndActionBox(int i);
     void tuesday_addTimeEditAndActionBox(int i);
     void wednesday_addTimeEditAndActionBox(int i);
     void thursday_addTimeEditAndActionBox(int i);
     void friday_addTimeEditAndActionBox(int i);
     void saturday_addTimeEditAndActionBox(int i);
     void sunday_addTimeEditAndActionBox(int i);

    public slots:
     void setDate();

    signals:
     void aDateWasSet();
     void starting();
     void finishing();

    protected:
     virtual void showEvent(QShowEvent* show_calendar);
     virtual void closeEvent(QCloseEvent* close_calendar);

};

#endif //CALENDAR_H