├── organizer-070.png ├── src ├── sounds │ └── window-attention.wav ├── sounds.qrc ├── icons │ ├── icon-spacebar.svg │ ├── organizer.svg │ ├── icon-uparrow.svg │ ├── icon-downarrow.svg │ ├── icon-r.svg │ ├── icon-c.svg │ ├── icon-f.svg │ └── icon-d.svg ├── icons.qrc ├── preferences.h ├── dialogpreferences.h ├── main.cpp ├── proxymodelcontacts.cpp ├── proxymodelcontacts.h ├── dialogupcomingbirthdays.ui ├── holiday.h ├── birthdaylistmodel.h ├── dialogupcomingbirthdays.h ├── CMakeLists.txt ├── schedulelistmodel.h ├── daylistmodel.h ├── birthdaylistmodel.cpp ├── appointment.h ├── dialogupcomingschedule.h ├── dbmanager.h ├── dialogpreferences.cpp ├── contact.h ├── dialogupcomingschedule.ui ├── dialogupcomingbirthdays.cpp ├── dialogpreferences.ui ├── contactmodel.h ├── dialogrepeatappointment.h ├── dialogappointment.h ├── dialogcontact.h ├── schedulelistmodel.cpp ├── dialogappointmentupdate.h ├── dialogupcomingschedule.cpp ├── daylistmodel.cpp ├── dialogrepeatappointment.cpp ├── contactmodel.cpp ├── dialogappointmentupdate.ui ├── dialogappointment.ui ├── dialogrepeatappointment.ui ├── dialogappointment.cpp ├── dialogcontact.cpp ├── dialogcontact.ui ├── dialogappointmentupdate.cpp ├── mainwindow.ui └── mainwindow.h ├── screenshots ├── organizer-070-reminder.png ├── organizer-070-new-contact.png ├── organizer-070-new-appointment.png ├── organizer-070-repeat-appointments.png └── organizer-070-dark-calendar-light-system-theme-gb.png ├── CHANGELOG ├── scripts ├── CMakeLists.txt └── organizer.desktop ├── AUTHORS ├── CMakeLists.txt └── README.md /organizer-070.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxqt/organizer/HEAD/organizer-070.png -------------------------------------------------------------------------------- /src/sounds/window-attention.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxqt/organizer/HEAD/src/sounds/window-attention.wav -------------------------------------------------------------------------------- /screenshots/organizer-070-reminder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxqt/organizer/HEAD/screenshots/organizer-070-reminder.png -------------------------------------------------------------------------------- /screenshots/organizer-070-new-contact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxqt/organizer/HEAD/screenshots/organizer-070-new-contact.png -------------------------------------------------------------------------------- /screenshots/organizer-070-new-appointment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxqt/organizer/HEAD/screenshots/organizer-070-new-appointment.png -------------------------------------------------------------------------------- /src/sounds.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | sounds/window-attention.wav 4 | 5 | 6 | -------------------------------------------------------------------------------- /screenshots/organizer-070-repeat-appointments.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxqt/organizer/HEAD/screenshots/organizer-070-repeat-appointments.png -------------------------------------------------------------------------------- /screenshots/organizer-070-dark-calendar-light-system-theme-gb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxqt/organizer/HEAD/screenshots/organizer-070-dark-calendar-light-system-theme-gb.png -------------------------------------------------------------------------------- /src/icons/icon-spacebar.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | 2 | 0.0.1 / 2019-11-01 3 | ================== 4 | 5 | * Set the version to 0.0.1 - just a really early version 6 | * for developers only 7 | * initial release, marked as pre-release 8 | -------------------------------------------------------------------------------- /scripts/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(desktop) 2 | 3 | file( 4 | GLOB DESKTOP_FILES *.desktop 5 | ) 6 | 7 | install(FILES 8 | ${DESKTOP_FILES} 9 | DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications" 10 | COMPONENT Runtime 11 | ) 12 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Upstream Authors: 2 | LXQt team: https://lxqt.org 3 | crispinalan 4 | 5 | Copyright: 6 | Copyright (c) 2019 LXQt team 7 | 8 | License: LGPL-2.1+ 9 | The full text of the licenses can be found in the 'COPYING' file. 10 | -------------------------------------------------------------------------------- /src/icons.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | icons/icon-c.svg 4 | icons/icon-downarrow.svg 5 | icons/icon-spacebar.svg 6 | icons/icon-uparrow.svg 7 | icons/icon-calendar.png 8 | icons/icon-f.svg 9 | icons/icon-r.svg 10 | icons/icon-d.svg 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/icons/organizer.svg: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/preferences.h: -------------------------------------------------------------------------------- 1 | #ifndef PREFERENCES_H 2 | #define PREFERENCES_H 3 | 4 | struct Preferences { 5 | 6 | Preferences( 7 | int playAudio=0, 8 | 9 | int darkCalendar=0, 10 | int applicationFontSize=20, 11 | int lineSpacing=0 12 | ): 13 | 14 | m_playAudio(playAudio), 15 | m_darkCalendar(darkCalendar), 16 | m_applicationFontSize(applicationFontSize), 17 | m_lineSpacing(lineSpacing) 18 | 19 | { 20 | } 21 | 22 | int m_playAudio; 23 | int m_darkCalendar; 24 | int m_applicationFontSize; 25 | int m_lineSpacing; 26 | }; 27 | 28 | 29 | #endif // PREFERENCES_H 30 | -------------------------------------------------------------------------------- /src/icons/icon-uparrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/icons/icon-downarrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/icons/icon-r.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/icons/icon-c.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/icons/icon-f.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/icons/icon-d.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 11 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/dialogpreferences.h: -------------------------------------------------------------------------------- 1 | #ifndef DIALOGPREFERENCES_H 2 | #define DIALOGPREFERENCES_H 3 | 4 | #include 5 | #include "preferences.h" 6 | 7 | namespace Ui { 8 | class DialogPreferences; 9 | } 10 | 11 | class DialogPreferences : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit DialogPreferences(QWidget *parent = nullptr, Preferences *thePreferences=nullptr); 17 | ~DialogPreferences(); 18 | 19 | int defaultApplicationFontSize=20; 20 | int getApplicationFont(); 21 | 22 | int playAudio=1; 23 | int isPlayAudio(); 24 | 25 | int darkCalendar=0; 26 | int isDarkCalendar(); 27 | 28 | int lineSpacing =0; 29 | int getLineSpacing(); 30 | 31 | QString t_title=QStringLiteral("Preferences"); 32 | QString t_font_size=QStringLiteral("Font Size "); 33 | 34 | QString t_play_audio=QStringLiteral("Play Audio"); 35 | QString t_dark_calendar=QStringLiteral("Dark Calendar"); 36 | QString t_line_spacing=QStringLiteral("Line Spacing"); 37 | 38 | 39 | 40 | void SetLableDescriptions(); 41 | 42 | private slots: 43 | void on_spinBoxApplicationFont_valueChanged(int arg1); 44 | 45 | void on_checkBoxPlayAudio_stateChanged(int arg1); 46 | 47 | void on_checkBoxLineSpacing_stateChanged(int arg1); 48 | 49 | void on_checkBoxDarkCalendar_stateChanged(int arg1); 50 | 51 | private: 52 | Ui::DialogPreferences *ui; 53 | }; 54 | 55 | #endif // DIALOGPREFERENCES_H 56 | -------------------------------------------------------------------------------- /scripts/organizer.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Organizer 3 | GenericName=Personal Information Manager 4 | GenericName[de]=Personal Information Manager 5 | GenericName[es]=Gerente de información personal 6 | GenericName[fr]=Gestionnaire d'informations personnelles 7 | GenericName[hr]=Upravljač osobnih podataka 8 | GenericName[ja_JP]=個人情報管理 Qt 9 | GenericName[pl]=Menedżer danych osobowych 10 | GenericName[pt]=Gerente de Informações Pessoais 11 | GenericName[tr]=Kişisel Bilgi Yöneticisi 12 | GenericName[zh_CN]=个人信息经理 13 | Comment=Keeps track of appointments and tasks 14 | Comment[de]=Verfolgt Termine und Aufgaben 15 | Comment[es]=Realiza un seguimiento de las citas y tareas 16 | Comment[fr]=Assure le suivi des rendez-vous et des tâches 17 | Comment[hr]=Prati termine i zadatke 18 | Comment[ja_JP]=予定とタスクを管理します 19 | Comment[pl]=Śledzi terminy i zadania 20 | Comment[pt]=Mantém o controle de compromissos e tarefas 21 | Comment[tr]=Randevuları ve görevleri takip eder 22 | Comment[zh_CN]=跟踪约会和任务 23 | TryExec=organizer 24 | Exec=organizer %F 25 | Icon=plan 26 | Terminal=false 27 | Type=Application 28 | MimeType=application/x-sharedlib; 29 | Categories=Qt;Utility;Application; 30 | X-KDE-StartupNotify=false; 31 | Keywords=Organizer;Appointments;Notifications;PIM; 32 | Actions=new-window; 33 | 34 | [Desktop Action new-window] 35 | Name=New Window 36 | Name[de]=Neues Fenster 37 | Name[hr]=Novi prozor 38 | Name[ja_JP]=新しいウィンドウ 39 | Exec=/usr/local/organizer --win 40 | 41 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | #include "mainwindow.h" 19 | #include 20 | 21 | 22 | int main(int argc, char *argv[]) 23 | { 24 | QApplication a(argc, argv); 25 | MainWindow w; 26 | w.show(); 27 | return a.exec(); 28 | } 29 | -------------------------------------------------------------------------------- /src/proxymodelcontacts.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #include "proxymodelcontacts.h" 20 | 21 | ProxyModelContacts::ProxyModelContacts(QObject *parent) 22 | { 23 | Q_UNUSED(parent) 24 | } 25 | 26 | QVariant ProxyModelContacts::headerData(int section, Qt::Orientation orientation, 27 | int role) const { 28 | return sourceModel()->headerData(section, orientation, 29 | role); } 30 | 31 | -------------------------------------------------------------------------------- /src/proxymodelcontacts.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #ifndef PROXYMODELCONTACTS_H 20 | #define PROXYMODELCONTACTS_H 21 | 22 | #include 23 | 24 | class ProxyModelContacts : public QSortFilterProxyModel 25 | { 26 | Q_OBJECT 27 | public: 28 | ProxyModelContacts(QObject* parent = nullptr); 29 | QVariant headerData(int section, Qt::Orientation orientation, 30 | int role) const; 31 | }; 32 | 33 | #endif // PROXYMODELCONTACTS_H 34 | -------------------------------------------------------------------------------- /src/dialogupcomingbirthdays.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DialogUpcomingBirthdays 4 | 5 | 6 | 7 | 0 8 | 0 9 | 609 10 | 449 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Qt::Horizontal 24 | 25 | 26 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | buttonBox 36 | accepted() 37 | DialogUpcomingBirthdays 38 | accept() 39 | 40 | 41 | 248 42 | 254 43 | 44 | 45 | 157 46 | 274 47 | 48 | 49 | 50 | 51 | buttonBox 52 | rejected() 53 | DialogUpcomingBirthdays 54 | reject() 55 | 56 | 57 | 316 58 | 260 59 | 60 | 61 | 286 62 | 274 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/holiday.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #ifndef HOLIDAY_H 20 | #define HOLIDAY_H 21 | 22 | #include 23 | struct Holiday { 24 | 25 | Holiday(int id=0, 26 | const QString& name= QString(), 27 | const QString& date=QString(), 28 | int addToCalendar=0 29 | ): 30 | m_id(id), 31 | m_name(name), 32 | m_date(date), 33 | m_addToCalendar(addToCalendar) 34 | 35 | { 36 | } 37 | int m_id; 38 | QString m_name; 39 | QString m_date; 40 | int m_addToCalendar; 41 | }; 42 | 43 | 44 | #endif // HOLIDAY_H 45 | -------------------------------------------------------------------------------- /src/birthdaylistmodel.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #ifndef BIRTHDAYLISTMODEL_H 20 | #define BIRTHDAYLISTMODEL_H 21 | 22 | #include 23 | #include 24 | 25 | class BirthdayListModel : public QAbstractListModel 26 | { 27 | public: 28 | BirthdayListModel(QObject* parent = nullptr); 29 | BirthdayListModel(const QList& birthdayList, 30 | QObject *parent = nullptr); 31 | 32 | void addBirthday(QString &birthday); 33 | 34 | int rowCount(const QModelIndex& parent = QModelIndex()) const override; 35 | 36 | QVariant data (const QModelIndex & index, 37 | int role = Qt::DisplayRole) const override; 38 | private: 39 | QList modelBirthdayList; 40 | 41 | }; 42 | 43 | #endif // BIRTHDAYLISTMODEL_H 44 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) 2 | # CMP0000: Call the cmake_minimum_required() command at the beginning of the top-level 3 | # CMakeLists.txt file even before calling the project() command. 4 | # The cmake_minimum_required(VERSION) command implicitly invokes the cmake_policy(VERSION) 5 | # command to specify that the current project code is written for the given range of CMake 6 | # versions. 7 | project( organizer ) 8 | 9 | include(GNUInstallDirs) 10 | 11 | set(CMAKE_AUTOMOC ON) 12 | set(CMAKE_AUTOUIC ON) 13 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 14 | set(CMAKE_POSITION_INDEPENDENT_CODE ON) 15 | 16 | # Minimum Versions 17 | set(LXQT_MINIMUM_VERSION "0.14.1") 18 | set(QT_MINIMUM_VERSION "5.7.1") 19 | 20 | find_package(Qt5Core ${QT_MINIMUM_VERSION} REQUIRED) 21 | find_package(Qt5DBus ${QT_MINIMUM_VERSION} REQUIRED) 22 | find_package(Qt5Gui ${QT_MINIMUM_VERSION} REQUIRED) 23 | find_package(Qt5LinguistTools ${QT_MINIMUM_VERSION} REQUIRED) 24 | find_package(Qt5Widgets ${QT_MINIMUM_VERSION} REQUIRED) 25 | find_package(Qt5Sql ${QT_MINIMUM_VERSION} REQUIRED) 26 | find_package(Qt5Svg ${QT_MINIMUM_VERSION} REQUIRED) 27 | find_package(Qt5Xml ${QT_MINIMUM_VERSION} REQUIRED) 28 | find_package(lxqt ${LXQT_MINIMUM_VERSION} REQUIRED) 29 | message(STATUS "Building with Qt${Qt5Core_VERSION}") 30 | 31 | # Version 32 | set(ORGANIZER_MAJOR_VERSION 0) 33 | set(ORGANIZER_MINOR_VERSION 0) 34 | set(ORGANIZER_PATCH_VERSION 1) 35 | 36 | set(ORGANIZER_VERSION ${ORGANIZER_MAJOR_VERSION}.${ORGANIZER_MINOR_VERSION}.${ORGANIZER_PATCH_VERSION}) 37 | add_definitions("-DORGANIZER_VERSION=\"${ORGANIZER_VERSION}\"") 38 | 39 | include(LXQtPreventInSourceBuilds) 40 | include(LXQtCompilerSettings NO_POLICY_SCOPE) 41 | 42 | # Added by LXQtCompilerSettings. Code refactoring need before using them 43 | remove_definitions( 44 | -DQT_NO_FOREACH 45 | ) 46 | 47 | # Translations ********************************** 48 | # include(LXQtTranslate) 49 | 50 | add_subdirectory(src) 51 | add_subdirectory(scripts) 52 | 53 | # install(FILES 54 | # man/organzier.1 55 | # DESTINATION "${CMAKE_INSTALL_MANDIR}/man1" 56 | # COMPONENT Runtime 57 | # ) 58 | 59 | -------------------------------------------------------------------------------- /src/dialogupcomingbirthdays.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #ifndef DIALOGUPCOMINGBIRTHDAYS_H 20 | #define DIALOGUPCOMINGBIRTHDAYS_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include "contact.h" 27 | #include "birthdaylistmodel.h" 28 | 29 | namespace Ui { 30 | class DialogUpcomingBirthdays; 31 | } 32 | 33 | class DialogUpcomingBirthdays : public QDialog 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | explicit DialogUpcomingBirthdays(QWidget *parent = nullptr, 39 | QList *contactList=nullptr); 40 | ~DialogUpcomingBirthdays(); 41 | QString t_title=QStringLiteral("Upcoming Birthdays (Next Seven Days)"); 42 | void setTitleTranslation(QString translation); 43 | 44 | private: 45 | Ui::DialogUpcomingBirthdays *ui; 46 | QList dialogContactList; 47 | QList birthdayList; 48 | BirthdayListModel *birthdayListModel; 49 | }; 50 | 51 | #endif // DIALOGUPCOMINGBIRTHDAYS_H 52 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project( organizer ) 2 | cmake_minimum_required( VERSION 3.1 ) 3 | set( CMAKE_CXX_STANDARD 14 ) 4 | set( CMAKE_INCLUDE_CURRENT_DIR ON ) 5 | set( CMAKE_AUTOMOC ON ) 6 | set( CMAKE_BUILD_TYPE Release ) 7 | add_definitions ( -Wall ) 8 | find_package ( Qt5Widgets REQUIRED ) 9 | find_package ( Qt5Core REQUIRED ) 10 | find_package ( Qt5Gui REQUIRED ) 11 | find_package ( Qt5Sql REQUIRED ) 12 | find_package(Qt5Svg REQUIRED) 13 | find_package(Qt5Xml REQUIRED) 14 | find_package(Qt5Multimedia REQUIRED) 15 | find_package(Qt5MultimediaWidgets REQUIRED) 16 | set (organizer_HDRS 17 | appointment.h 18 | holiday.h 19 | daylistmodel.h 20 | dbmanager.h 21 | contact.h 22 | contactmodel.h 23 | schedulelistmodel.h 24 | birthdaylistmodel.h 25 | preferences.h 26 | ) 27 | 28 | set ( organizer_SRCS 29 | 30 | main.cpp 31 | mainwindow.cpp 32 | daylistmodel.cpp 33 | dbmanager.cpp 34 | dialogappointment.cpp 35 | contactmodel.cpp 36 | proxymodelcontacts.cpp 37 | dialogcontact.cpp 38 | dialogupcomingschedule.cpp 39 | dialogupcomingbirthdays.cpp 40 | schedulelistmodel.cpp 41 | birthdaylistmodel.cpp 42 | dialogrepeatappointment.cpp 43 | dialogappointmentupdate.cpp 44 | dialogpreferences.cpp 45 | ) 46 | 47 | set (organizer_UIS 48 | 49 | mainwindow.ui 50 | dialogappointment.ui 51 | dialogcontact.ui 52 | dialogupcomingschedule.ui 53 | dialogupcomingbirthdays.ui 54 | dialogrepeatappointment.ui 55 | dialogappointmentupdate.ui 56 | dialogpreferences.ui 57 | ) 58 | QT5_WRAP_UI(UIS ${organizer_UIS}) 59 | 60 | set ( organizer_RSCS 61 | icons.qrc 62 | translations.qrc 63 | sounds.qrc 64 | ) 65 | QT5_ADD_RESOURCES(RSCS ${organizer_RSCS}) 66 | 67 | set ( organizer_MOCS 68 | 69 | mainwindow.h 70 | dialogappointment.h 71 | proxymodelcontacts.h 72 | dialogcontact.h 73 | dialogupcomingschedule.h 74 | dialogupcomingbirthdays.h 75 | dialogrepeatappointment.h 76 | dialogappointmentupdate.h 77 | dialogpreferences.h 78 | ) 79 | QT5_WRAP_CPP(MOCS ${organizer_MOCS}) 80 | 81 | add_executable ( organizer ${organizer_SRCS} ${UIS} ${RSCS} ${TRS} ${MOCS} ) 82 | target_link_libraries ( organizer Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Sql Qt5::Svg Qt5::Xml Qt5::Multimedia Qt5::MultimediaWidgets) 83 | 84 | 85 | INSTALL(TARGETS 86 | organizer 87 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" 88 | COMPONENT Runtime 89 | ) 90 | 91 | -------------------------------------------------------------------------------- /src/schedulelistmodel.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #ifndef SCHEDULELISTMODEL_H 20 | #define SCHEDULELISTMODEL_H 21 | 22 | #include 23 | #include 24 | #include "appointment.h" 25 | 26 | class ScheduleListModel: public QAbstractListModel 27 | { 28 | public: 29 | ScheduleListModel(QObject* parent = nullptr); 30 | ScheduleListModel(const QList& appointmentList, 31 | QObject *parent = nullptr); 32 | 33 | void addAppointment(Appointment &appointment); 34 | void updateAppointment(Appointment &appointment, int index); 35 | Appointment getAppointment(int index); 36 | void clearAllAppointment(); 37 | void removeAppointment(int idx); 38 | 39 | int rowCount(const QModelIndex& parent = QModelIndex()) const override; 40 | 41 | QVariant data (const QModelIndex & index, 42 | int role = Qt::DisplayRole) const override; 43 | private: 44 | QList modelAppointmentList; 45 | 46 | }; 47 | 48 | #endif // SCHEDULELISTMODEL_H 49 | -------------------------------------------------------------------------------- /src/daylistmodel.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #ifndef DAYLISTMODEL_H 20 | #define DAYLISTMODEL_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include "appointment.h" 27 | 28 | 29 | 30 | class DayListModel: public QAbstractListModel 31 | { 32 | public: 33 | 34 | DayListModel(QObject* parent = nullptr); 35 | DayListModel(const QList& appointmentList, 36 | QObject *parent = nullptr); 37 | 38 | void addAppointment(Appointment &appointment); 39 | void updateAppointment(Appointment &appointment, int index); 40 | Appointment getAppointment(int index); 41 | void clearAllAppointment(); 42 | void removeAppointment(int idx); 43 | 44 | void setNewLineSpacing(int spacing); 45 | int flagSpacing=0; 46 | 47 | int rowCount(const QModelIndex& parent = QModelIndex()) const override; 48 | 49 | QVariant data (const QModelIndex & index, 50 | int role = Qt::DisplayRole) const override; 51 | private: 52 | QList modelAppointmentList; 53 | 54 | }; 55 | 56 | #endif // DAYLISTMODEL_H 57 | -------------------------------------------------------------------------------- /src/birthdaylistmodel.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #include "birthdaylistmodel.h" 20 | 21 | BirthdayListModel::BirthdayListModel(QObject *parent) 22 | { 23 | Q_UNUSED(parent) 24 | this->modelBirthdayList= QList(); 25 | } 26 | 27 | BirthdayListModel::BirthdayListModel(const QList &birthdayList, QObject *parent) 28 | { 29 | Q_UNUSED(parent) 30 | this->modelBirthdayList=birthdayList; 31 | 32 | } 33 | 34 | void BirthdayListModel::addBirthday(QString &birthday) 35 | { 36 | beginInsertRows(QModelIndex(), rowCount(), rowCount()); 37 | this->modelBirthdayList.append(birthday); 38 | endInsertRows(); 39 | } 40 | 41 | int BirthdayListModel::rowCount(const QModelIndex &parent) const 42 | { 43 | Q_UNUSED(parent) 44 | return modelBirthdayList.size(); 45 | 46 | } 47 | 48 | QVariant BirthdayListModel::data(const QModelIndex &index, int role) const 49 | { 50 | if (!index.isValid()) 51 | return QVariant(); 52 | if (index.row() >= modelBirthdayList.size() || index.row() < 0) 53 | return QVariant(); 54 | 55 | if (role == Qt::DisplayRole) { 56 | 57 | QString details=QStringLiteral(""); 58 | details = modelBirthdayList.at(index.row()); 59 | return details; 60 | } 61 | return QVariant(); 62 | } 63 | -------------------------------------------------------------------------------- /src/appointment.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | 20 | #ifndef APPOINTMENT_H 21 | #define APPOINTMENT_H 22 | 23 | #include 24 | struct Appointment { 25 | 26 | Appointment(int id=0, 27 | const QString& title= QString(), 28 | const QString& location= QString(), 29 | const QString& description= QString(), 30 | const QString& date=QString(), 31 | const QString& startTime=QString(), 32 | const QString& endTime=QString(), 33 | int isFullDay =0, 34 | int hasReminder=0, 35 | int reminderMins=0 36 | ): 37 | m_id(id), 38 | m_title(title), 39 | m_location(location), 40 | m_description(description), 41 | m_date(date), 42 | m_startTime(startTime), 43 | m_endTime(endTime), 44 | m_isFullDay(isFullDay), 45 | m_hasReminder(hasReminder), 46 | m_reminderMinutes(reminderMins) 47 | { 48 | } 49 | int m_id; 50 | QString m_title; 51 | QString m_location; 52 | QString m_description; 53 | QString m_date; 54 | QString m_startTime; 55 | QString m_endTime; 56 | int m_isFullDay; 57 | int m_hasReminder; 58 | int m_reminderMinutes; 59 | }; 60 | 61 | 62 | #endif // APPOINTMENT_H 63 | -------------------------------------------------------------------------------- /src/dialogupcomingschedule.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #ifndef DIALOGUPCOMINGSCHEDULE_H 20 | #define DIALOGUPCOMINGSCHEDULE_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include "appointment.h" 29 | #include "schedulelistmodel.h" 30 | #include "dbmanager.h" 31 | 32 | namespace Ui { 33 | class DialogUpcomingSchedule; 34 | } 35 | 36 | class DialogUpcomingSchedule : public QDialog 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | //explicit DialogUpcomingSchedule(QWidget *parent = nullptr); 42 | 43 | 44 | explicit DialogUpcomingSchedule(QWidget *parent = nullptr, 45 | DbManager *theDbm=nullptr); 46 | QList getSortedDayList(QDate theDate); 47 | static bool compare(const Appointment& first, const Appointment& second); 48 | ~DialogUpcomingSchedule(); 49 | 50 | QString t_title=QStringLiteral("Upcoming Schedule (Next Seven Days)"); 51 | QString t_label_upcoming_schedule=QStringLiteral("Upcoming Schedule For Date"); 52 | 53 | void setTitleTranslation(QString translation); 54 | void setLabelUpcomingScheduleTranslation(QString translation); 55 | 56 | QLocale locale=QLocale::English; 57 | void setLocale(QLocale locale); 58 | 59 | private: 60 | Ui::DialogUpcomingSchedule *ui; 61 | QList appointmentList; 62 | DbManager theDbm; 63 | ScheduleListModel *scheduleListModel; 64 | }; 65 | 66 | #endif // DIALOGUPCOMINGSCHEDULE_H 67 | -------------------------------------------------------------------------------- /src/dbmanager.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | 20 | #ifndef DBMANAGER_H 21 | #define DBMANAGER_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include "appointment.h" 32 | #include "contact.h" 33 | #include "preferences.h" 34 | 35 | 36 | class DbManager 37 | { 38 | public: 39 | DbManager(); 40 | QSqlDatabase db; 41 | bool isOpen() const; 42 | void openDatabase(); 43 | void createDatebaseTables(); 44 | 45 | //Appointments 46 | int addAppointment(Appointment &appointment); 47 | bool updateAppointment(Appointment &appointment, int id); 48 | QList getAllAppointments(); 49 | Appointment getAppointmentByID(int id); 50 | QList getAppointmentsOnDate(QDate &diaryDate); 51 | bool deleteAppointmentById(const int id); 52 | bool deleteAllAppointments(); 53 | 54 | //Contacts 55 | int addContact(Contact &contact); 56 | bool updateContact(Contact &contact, int id); 57 | QList getAllContacts(); 58 | Contact getContactByID(int id); 59 | bool removeAllContacts(); 60 | bool removeContactById(const int id); 61 | 62 | //Preferences (settings) 63 | int addPreferences(Preferences &preferences); 64 | bool updatePreferences(Preferences &preferences, int id); 65 | Preferences getPreferencesByID(int id); 66 | 67 | 68 | 69 | }; 70 | 71 | #endif // DBMANAGER_H 72 | -------------------------------------------------------------------------------- /src/dialogpreferences.cpp: -------------------------------------------------------------------------------- 1 | #include "dialogpreferences.h" 2 | #include "ui_dialogpreferences.h" 3 | 4 | DialogPreferences::DialogPreferences(QWidget *parent, Preferences *thePreferences) : 5 | QDialog(parent), 6 | ui(new Ui::DialogPreferences) 7 | { 8 | ui->setupUi(this); 9 | SetLableDescriptions(); 10 | 11 | 12 | ui->spinBoxApplicationFont->setRange(8,38); 13 | ui->spinBoxApplicationFont->setValue(thePreferences->m_applicationFontSize); 14 | 15 | if(thePreferences->m_playAudio==1) 16 | { 17 | ui->checkBoxPlayAudio->setCheckState(Qt::Checked); 18 | } 19 | else { 20 | ui->checkBoxPlayAudio->setCheckState(Qt::Unchecked); 21 | } 22 | 23 | if(thePreferences->m_lineSpacing==0) 24 | { 25 | ui->checkBoxLineSpacing->setCheckState(Qt::Unchecked); 26 | } 27 | else { 28 | ui->checkBoxLineSpacing->setCheckState(Qt::Checked); 29 | } 30 | 31 | if(thePreferences->m_darkCalendar==0) 32 | { 33 | ui->checkBoxDarkCalendar->setCheckState(Qt::Unchecked); 34 | } 35 | else { 36 | ui->checkBoxDarkCalendar->setCheckState(Qt::Checked); 37 | } 38 | 39 | 40 | 41 | 42 | } 43 | 44 | DialogPreferences::~DialogPreferences() 45 | { 46 | delete ui; 47 | } 48 | 49 | 50 | 51 | 52 | int DialogPreferences::getApplicationFont() 53 | { 54 | return this->defaultApplicationFontSize; 55 | } 56 | 57 | int DialogPreferences::isPlayAudio() 58 | { 59 | return playAudio; 60 | } 61 | 62 | int DialogPreferences::isDarkCalendar() 63 | { 64 | return darkCalendar; 65 | } 66 | 67 | 68 | 69 | 70 | void DialogPreferences::SetLableDescriptions() 71 | { 72 | setWindowTitle(t_title); 73 | ui->labelFontSize->setText(t_font_size); 74 | ui->checkBoxPlayAudio->setText(t_play_audio); 75 | ui->checkBoxDarkCalendar->setText(t_dark_calendar); 76 | ui->checkBoxLineSpacing->setText(t_line_spacing); 77 | } 78 | 79 | int DialogPreferences::getLineSpacing() 80 | { 81 | return lineSpacing; 82 | } 83 | 84 | void DialogPreferences::on_spinBoxApplicationFont_valueChanged(int arg1) 85 | { 86 | defaultApplicationFontSize=arg1; 87 | } 88 | 89 | 90 | 91 | void DialogPreferences::on_checkBoxPlayAudio_stateChanged(int arg1) 92 | { 93 | if (arg1==Qt::Unchecked) 94 | { 95 | playAudio=0; 96 | } 97 | else if (arg1==Qt::Checked) { 98 | playAudio=1; 99 | } 100 | } 101 | 102 | void DialogPreferences::on_checkBoxLineSpacing_stateChanged(int arg1) 103 | { 104 | if (arg1==Qt::Unchecked) 105 | { 106 | lineSpacing=0; 107 | } 108 | else if (arg1==Qt::Checked) { 109 | lineSpacing=1; 110 | } 111 | } 112 | 113 | void DialogPreferences::on_checkBoxDarkCalendar_stateChanged(int arg1) 114 | { 115 | if (arg1==Qt::Unchecked) 116 | { 117 | darkCalendar=0; 118 | } 119 | else if (arg1==Qt::Checked) { 120 | darkCalendar=1; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /src/contact.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | 20 | #ifndef CONTACT_H 21 | #define CONTACT_H 22 | 23 | #include 24 | struct Contact { 25 | 26 | Contact(int id=0, 27 | const QString& firstname= QString(), 28 | const QString& midnames= QString(), 29 | const QString& lastname= QString(), 30 | const QString& email= QString(), 31 | const QString& street= QString(), 32 | const QString& district= QString(), 33 | const QString& city= QString(), 34 | const QString& county= QString(), 35 | const QString& postcode= QString(), 36 | const QString& country= QString(), 37 | const QString& telephone= QString(), 38 | const QString& birthdate=QString(), 39 | int addToCalendar=0 40 | 41 | ): 42 | m_id(id), 43 | m_firstname(firstname), 44 | m_midnames(midnames), 45 | m_lastname(lastname), 46 | m_email(email), 47 | m_street(street), 48 | m_district(district), 49 | m_city(city), 50 | m_county(county), 51 | m_postcode(postcode), 52 | m_country(country), 53 | m_telephone(telephone), 54 | m_birthdate(birthdate), 55 | m_addToCalendar(addToCalendar) 56 | 57 | { 58 | } 59 | int m_id; 60 | QString m_firstname; 61 | QString m_midnames; 62 | QString m_lastname; 63 | QString m_email; 64 | QString m_street; 65 | QString m_district; 66 | QString m_city; 67 | QString m_county; 68 | QString m_postcode; 69 | QString m_country; 70 | QString m_telephone; 71 | QString m_birthdate; 72 | int m_addToCalendar; 73 | }; 74 | 75 | 76 | #endif // CONTACT_H 77 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Organizer 2 | 3 | ## Overview 4 | 5 | Organizer is a Qt lightweight personal information manager. 6 | 7 | It is maintained by the LXQt project but can be used independently from this 8 | desktop environment. 9 | 10 | ![](organizer-070.png) 11 | 12 | ### Compiling source code 13 | 14 | Compiling from source provides the latest version. 15 | 16 | ``` 17 | mkdir build 18 | cd build 19 | cmake .. 20 | make 21 | su (or sudo) 22 | make install 23 | ``` 24 | 25 | Organizer is installed to /usr/local/bin 26 | 27 | Note: If upgrading from a previous version you need to remove the previous version (as root) located at 28 | 29 | /usr/local/bin/organizer 30 | 31 | and rename (or remove) the 'organizerdb.sqlite' database in your home directory. Make sure to export contacts and then import them into the new version. 32 | 33 | Please do not do this on production systems. 34 | 35 | ### Prerequisites 36 | 37 | You need the following dependencies to build and run Organizer on Debian, Ubuntu and its derivatives. 38 | 39 | ``` 40 | build-essential 41 | qt5-default 42 | qtcreator 43 | automake 44 | checkinstall 45 | cmake 46 | libqt5svg5-dev 47 | libqt5*-dev 48 | qttools5-dev 49 | libkf5plasma-dev 50 | liblxqt0-dev 51 | qtmultimedia5-dev 52 | ``` 53 | 54 | ### Binary packages 55 | 56 | Binary packages are available as snap packages and in the Arch User Repository (AUR) 57 | 58 | ### Snap package 59 | 60 | * [Snap by ito32bit](https://build.snapcraft.io/user/ito32bit/lxqt-organizer-snap-packaging) 61 | 62 | To test the latest successful build use: 63 | ``` 64 | sudo snap install --edge lxqt-organizer-snap 65 | ``` 66 | To remove use: 67 | ``` 68 | sudo snap remove lxqt-organizer-snap 69 | ``` 70 | ### Arch 71 | 72 | * [Arch (AUR) by Librewish](https://aur.archlinux.org/packages/lxqt-organizer-git/) 73 | 74 | It can be installed using yay as shown below. 75 | 76 | ``` 77 | yay -S lxqt-organizer 78 | ``` 79 | 80 | ### Deb package 81 | 82 | [Developer Deb package](https://github.com/crispinalan/organizer) 83 | 84 | 85 | ## Versioning 86 | 87 | [SemVer](http://semver.org/) is used for versioning. The version number has the form 0.0.0 representing major, minor and bug fix changes. Currently at 0.7.3. 88 | 89 | 90 | ## Roadmap 91 | 92 | ``` 93 | Custom calendar (completed) 94 | Add, remove and update appointments (completed) 95 | Add, remove and update contacts (completed) 96 | Reminders (completed) 97 | Calendar themes (light and dark themes completed) 98 | Enhanced features 99 | ``` 100 | 101 | #### Runtime Dependencies 102 | * ${misc:Depends}, 103 | * ${shlibs:Depends} 104 | 105 | #### Runtime Recommends 106 | * lxqt-organizer-l10n (not implemented yet) 107 | * lxqt-qtplugin 108 | 109 | ### Binary packages 110 | 111 | Official binary packages are not available in the moment. 112 | One could find the initial packaging for Debian here: 113 | https://salsa.debian.org/lxqt-team/lxqt-organizer 114 | 115 | Arch AUR will come soon. 116 | 117 | 118 | ### Translation (Weblate) 119 | 120 | 121 | -------------------------------------------------------------------------------- /src/dialogupcomingschedule.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DialogUpcomingSchedule 4 | 5 | 6 | 7 | 0 8 | 0 9 | 660 10 | 422 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Upcoming Schedule For: 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 75 33 | true 34 | 35 | 36 | 37 | Date 38 | 39 | 40 | 41 | 42 | 43 | 44 | Qt::Horizontal 45 | 46 | 47 | 48 | 40 49 | 20 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | Qt::Horizontal 65 | 66 | 67 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | buttonBox 77 | accepted() 78 | DialogUpcomingSchedule 79 | accept() 80 | 81 | 82 | 248 83 | 254 84 | 85 | 86 | 157 87 | 274 88 | 89 | 90 | 91 | 92 | buttonBox 93 | rejected() 94 | DialogUpcomingSchedule 95 | reject() 96 | 97 | 98 | 316 99 | 260 100 | 101 | 102 | 286 103 | 274 104 | 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /src/dialogupcomingbirthdays.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #include "dialogupcomingbirthdays.h" 20 | #include "ui_dialogupcomingbirthdays.h" 21 | 22 | 23 | DialogUpcomingBirthdays::DialogUpcomingBirthdays(QWidget *parent, 24 | QList *contactList): 25 | QDialog(parent), 26 | ui(new Ui::DialogUpcomingBirthdays) 27 | { 28 | ui->setupUi(this); 29 | setWindowTitle(t_title); 30 | dialogContactList=*contactList; 31 | 32 | birthdayList =QList(); 33 | 34 | QDate currentDate =QDate::currentDate(); 35 | 36 | foreach(Contact c, dialogContactList) //use contacts!! 37 | { 38 | //qDebug()<<"Contact:"<listViewBirthdays->setModel(birthdayListModel); 70 | } 71 | 72 | DialogUpcomingBirthdays::~DialogUpcomingBirthdays() 73 | { 74 | delete ui; 75 | } 76 | 77 | void DialogUpcomingBirthdays::setTitleTranslation(QString translation) 78 | { 79 | t_title=translation; 80 | setWindowTitle(t_title); 81 | } 82 | -------------------------------------------------------------------------------- /src/dialogpreferences.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DialogPreferences 4 | 5 | 6 | 7 | 0 8 | 0 9 | 473 10 | 234 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Font Size: 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | Qt::Horizontal 35 | 36 | 37 | 38 | 40 39 | 20 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Play Audio 52 | 53 | 54 | 55 | 56 | 57 | 58 | Dark Calendar 59 | 60 | 61 | 62 | 63 | 64 | 65 | Line Spacing 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | Qt::Horizontal 77 | 78 | 79 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | buttonBox 89 | accepted() 90 | DialogPreferences 91 | accept() 92 | 93 | 94 | 248 95 | 254 96 | 97 | 98 | 157 99 | 274 100 | 101 | 102 | 103 | 104 | buttonBox 105 | rejected() 106 | DialogPreferences 107 | reject() 108 | 109 | 110 | 316 111 | 260 112 | 113 | 114 | 286 115 | 274 116 | 117 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /src/contactmodel.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #ifndef CONTACTMODEL_H 20 | #define CONTACTMODEL_H 21 | 22 | #include 23 | 24 | #include "contact.h" 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | class ContactModel : public QAbstractTableModel 31 | { 32 | public: 33 | ContactModel(QObject* parent = nullptr); 34 | ContactModel(const QList& contactList, 35 | QObject *parent = nullptr); 36 | 37 | void AddContact(Contact &contact); 38 | Contact getContact(int index); 39 | void clearAllContacts(); 40 | void removeContact(int idx); 41 | 42 | int rowCount(const QModelIndex& parent = QModelIndex()) const override; 43 | 44 | int columnCount(const QModelIndex &parent = QModelIndex()) const override; 45 | 46 | QVariant data (const QModelIndex & index, 47 | int role = Qt::DisplayRole) const override; 48 | 49 | QVariant headerData(int section, Qt::Orientation orientation, 50 | int role = Qt::DisplayRole) const override; 51 | 52 | 53 | QString t_first_name=QStringLiteral("First Name"); 54 | void setFirstNameTranslation(QString translation); 55 | 56 | QString t_mid_name=QStringLiteral("Mid Name"); 57 | void setMidNameTranslation(QString translation); 58 | 59 | QString t_last_name=QStringLiteral("Last Name"); 60 | void setLastNameTranslation(QString translation); 61 | 62 | QString t_email=QStringLiteral("Email"); 63 | void setEmailTranslation(QString translation); 64 | 65 | QString t_street=QStringLiteral("Street"); 66 | void setStreetTranslation(QString translation); 67 | 68 | QString t_district=QStringLiteral("District"); 69 | void setDistrictTranslation(QString translation); 70 | 71 | QString t_city=QStringLiteral("City"); 72 | void setCityTranslation(QString translation); 73 | 74 | QString t_county=QStringLiteral("County"); 75 | void setCountyTransaltion(QString translation); 76 | 77 | QString t_postcode=QStringLiteral("Postcode"); 78 | void setPostcodeTranslation(QString translation); 79 | 80 | QString t_country=QStringLiteral("Country"); 81 | void setCountryTranslation(QString translation); 82 | 83 | QString t_telephone=QStringLiteral("Telephone"); 84 | void setTelephoneTranslation(QString translation); 85 | 86 | QString t_birthday=QStringLiteral("Birthday"); 87 | void setBirthdayTranslation(QString translation); 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | private: 96 | QList modelContactList; 97 | 98 | 99 | }; 100 | 101 | #endif // CONTACTMODEL_H 102 | -------------------------------------------------------------------------------- /src/dialogrepeatappointment.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #ifndef DIALOGREPEATAPPOINTMENT_H 20 | #define DIALOGREPEATAPPOINTMENT_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include "appointment.h" 28 | 29 | namespace Ui { 30 | class DialogRepeatAppointment; 31 | } 32 | 33 | class DialogRepeatAppointment : public QDialog 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | 39 | 40 | explicit DialogRepeatAppointment(QWidget *parent = nullptr, QDate *theAppointmentDate=nullptr); 41 | ~DialogRepeatAppointment(); 42 | 43 | QDate appointmentDate; 44 | QTime startTime; 45 | QTime endTime; 46 | 47 | int isAllDay=0; //no 48 | int repeatDayInterval=0; 49 | int repeatNumber=0; 50 | 51 | int getRepeatDayInterval(); 52 | int getRepeatNumber(); 53 | 54 | QString getTitle(); 55 | QString getLocation(); 56 | QString getDescription(); 57 | QDate getAppointmentDate(); 58 | QTime getStartTime(); 59 | QTime getEndTime(); 60 | int getAllDay(); 61 | 62 | //Translations 63 | //Set exernally with setLabelTranslations 64 | QString t_dialog_title; 65 | QString t_start_date_display; 66 | QString t_title; 67 | QString t_location; 68 | QString t_notes; 69 | QString t_all_day; 70 | QString t_start_time; 71 | QString t_end_time; 72 | QString t_repeat_every; 73 | QString t_days; 74 | QString t_occurrences; 75 | 76 | void setDialogTitleTranslation(QString translation); 77 | void setStartDateDisplayTranslation(QString translation); 78 | void setTitleTranslation(QString translation); 79 | void setLocationTranslation(QString translation); 80 | void setNotesTranslations(QString translation); 81 | void setAllDaytranslation(QString translation); 82 | void setStartTimeTranslation(QString translation); 83 | void setEndTimeTranslation(QString translation); 84 | void setRepeatEveryTranslation(QString translation); 85 | void setDaysTranslation(QString translation); 86 | void setOccurrencesTranslation(QString translation); 87 | 88 | void setLabelTranslations(); 89 | 90 | QLocale locale=QLocale::English; 91 | void setLocaleDate(QLocale locale); 92 | 93 | 94 | private slots: 95 | void accept(); 96 | void reject(); 97 | 98 | 99 | void on_timeEditStarts_userTimeChanged(const QTime &time); 100 | 101 | void on_timeEditEnds_userTimeChanged(const QTime &time); 102 | 103 | void on_checkBox_stateChanged(int arg1); 104 | 105 | void on_spinBoxDays_valueChanged(int arg1); 106 | 107 | void on_spinBoxRepeatNumber_valueChanged(int arg1); 108 | 109 | private: 110 | Ui::DialogRepeatAppointment *ui; 111 | }; 112 | 113 | #endif // DIALOGREPEATAPPOINTMENT_H 114 | -------------------------------------------------------------------------------- /src/dialogappointment.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | 20 | #ifndef DIALOGAPPOINTMENT_H 21 | #define DIALOGAPPOINTMENT_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include "appointment.h" 29 | 30 | namespace Ui { 31 | class DialogAppointment; 32 | } 33 | 34 | class DialogAppointment : public QDialog 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | explicit DialogAppointment(QWidget *parent = nullptr, QDate *theAppointmentDate=nullptr); 40 | 41 | ~DialogAppointment(); 42 | 43 | //Appointment appointment; 44 | 45 | QDate appointmentDate; 46 | QTime startTime; 47 | QTime endTime; 48 | QString category; 49 | 50 | int isAllDay=0; //no 51 | bool deleteRequested=false; 52 | QString currentTitle=QStringLiteral(""); 53 | 54 | QString getTitle(); 55 | QString getLocation(); 56 | QString getDescription(); 57 | QDate getAppointmentDate(); 58 | QTime getStartTime(); 59 | QTime getEndTime(); 60 | int getAllDay(); 61 | 62 | 63 | bool getDeleteRequested(); 64 | void setupComboBoxes(); 65 | 66 | //Reminders 67 | int hasReminder=0; //no 68 | int getHasReminder(); 69 | int reminderMins=0; //none 70 | int getReminderMins(); 71 | 72 | //Set externally with setLabelTranslations(); 73 | QString t_dialog_title; 74 | QString t_date_display; 75 | QString t_title; 76 | QString t_location; 77 | QString t_notes; 78 | QString t_all_day; 79 | QString t_start_time; 80 | QString t_end_time; 81 | 82 | QString t_reminder; 83 | 84 | QString t_reminder_5min; 85 | QString t_reminder_10min; 86 | QString t_reminder_30min; 87 | QString t_reminder_1hour; 88 | QString t_reminder_1day; 89 | 90 | void setDialogTitleTranslation(QString translation); 91 | void setDateDisplayTranslation(QString translation); 92 | void setTitleTranslation(QString translation); 93 | void setLocationTranslation(QString translation); 94 | void setNotesTranslations(QString translation); 95 | void setAllDaytranslation(QString translation); 96 | void setStartTimeTranslation(QString translation); 97 | void setEndTimeTranslation(QString translation); 98 | void setReminderTranslation(QString translation); 99 | 100 | void setLabelTranslations(); 101 | 102 | void setReminder5MinTranslation(QString translation); 103 | void setReminder10MinTranslation(QString translation); 104 | void setReminder30MinTranslation(QString translation); 105 | void setReminder1HourTranslation(QString translation); 106 | void setReminder1DayTranslation(QString translation); 107 | 108 | void setComboBoxReminderTranslations(); 109 | 110 | QLocale locale=QLocale::English; 111 | void setLocaleDate(QLocale locale); 112 | 113 | private slots: 114 | 115 | void accept(); 116 | void reject(); 117 | 118 | void on_timeEditStartTime_userTimeChanged(const QTime &time); 119 | 120 | void on_timeEditEndTime_userTimeChanged(const QTime &time); 121 | 122 | void on_checkBoxAllDay_stateChanged(int arg1); 123 | 124 | void on_comboBoxReminder_currentIndexChanged(int index); 125 | 126 | void on_checkBoxReminder_stateChanged(int arg1); 127 | 128 | private: 129 | Ui::DialogAppointment *ui; 130 | }; 131 | 132 | #endif // DIALOGAPPOINTMENT_H 133 | -------------------------------------------------------------------------------- /src/dialogcontact.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #ifndef DIALOGCONTACT_H 20 | #define DIALOGCONTACT_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include "contact.h" 27 | 28 | namespace Ui { 29 | class DialogContact; 30 | } 31 | 32 | class DialogContact : public QDialog 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | explicit DialogContact(QWidget *parent = nullptr); 38 | 39 | explicit DialogContact(Contact *theContact=nullptr, QWidget *parent = nullptr); 40 | ~DialogContact(); 41 | 42 | QString firstName; //=QLatin1String(""); 43 | QString middleNames;//=QLatin1String(""); 44 | QString lastName; //=QLatin1String(""); 45 | QString email; //=QLatin1String(""); 46 | QDate birthDate; 47 | int birthDateId=0; 48 | 49 | QString getFirstName(); 50 | QString getMiddleNames(); 51 | QString getLastName(); 52 | QString getEmail(); 53 | QDate getBirthDate(); 54 | int getAddToCalendar(); 55 | 56 | //Contact details 57 | QString street; //=QLatin1String(""); 58 | QString district; //=QLatin1String(""); 59 | QString city; //=QLatin1String(""); 60 | QString county; //=QLatin1String(""); 61 | QString postcode; //=QLatin1String(""); 62 | QString country; //=QLatin1String(""); 63 | QString phoneNumber; //could have + code 64 | bool deleteRequested=false; 65 | int addToCalendar=0; 66 | 67 | QString getStreet(); 68 | QString getDistrict(); 69 | QString getCity(); 70 | QString getCounty(); 71 | QString getPostcode(); 72 | QString getCountry(); 73 | QString getPhoneNumber(); 74 | bool getDeleteRequested(); 75 | 76 | //Set externally with setLabelTranslations 77 | QString t_dialog_title; 78 | QString t_first_name; 79 | QString t_mid_name; 80 | QString t_last_name; 81 | QString t_email; 82 | QString t_street; 83 | QString t_district; 84 | QString t_city; 85 | QString t_county; 86 | QString t_postcode; 87 | QString t_country; 88 | QString t_telephone; 89 | 90 | QString t_born_on; 91 | QString t_birthday_unknown; 92 | QString t_add_to_calendar; 93 | QString t_delete; 94 | 95 | void setDialogTitleTranslation(QString translation); 96 | void setFirstNameTranslation(QString translation); 97 | void setMidNameTranslation(QString translation); 98 | void setLastNameTranslation(QString translation); 99 | void setEmailTranslation(QString translation); 100 | void setStreetTranslation(QString translation); 101 | void setDistrictTranslation(QString translation); 102 | void setCityTranslation(QString translation); 103 | void setCountyTranslation(QString translation); 104 | void setPostcodeTranslation(QString translation); 105 | void setCountryTranslation(QString translation); 106 | void setTelephoneTranslation(QString translation); 107 | 108 | void setBornOnTranslation(QString translation); 109 | void setBirthdayUnknownTranslation(QString translation); 110 | void setAddToCalendarTranslation(QString translation); 111 | void setDeleteTranslation(QString translation); 112 | 113 | void setLabelTranslations(); 114 | 115 | 116 | private slots: 117 | void accept(); 118 | void on_checkBoxBirthdayUnknown_stateChanged(int arg1); 119 | 120 | void on_dateEditBirthDate_userDateChanged(const QDate &date); 121 | 122 | void on_checkBoxAddBirthdayToCal_stateChanged(int arg1); 123 | 124 | void on_checkBoxDelete_stateChanged(int arg1); 125 | 126 | private: 127 | Ui::DialogContact *ui; 128 | }; 129 | 130 | #endif // DIALOGCONTACT_H 131 | -------------------------------------------------------------------------------- /src/schedulelistmodel.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #include "schedulelistmodel.h" 20 | 21 | ScheduleListModel::ScheduleListModel(QObject *parent) 22 | { 23 | Q_UNUSED(parent) 24 | this->modelAppointmentList= QList(); 25 | 26 | } 27 | 28 | ScheduleListModel::ScheduleListModel(const QList &appointmentList, QObject *parent) 29 | { 30 | Q_UNUSED(parent) 31 | this->modelAppointmentList=appointmentList; 32 | 33 | } 34 | 35 | void ScheduleListModel::addAppointment(Appointment &appointment) 36 | { 37 | beginInsertRows(QModelIndex(), rowCount(), rowCount()); 38 | this->modelAppointmentList.append(appointment); 39 | endInsertRows(); 40 | 41 | } 42 | 43 | void ScheduleListModel::updateAppointment(Appointment &appointment, int index) 44 | { 45 | beginInsertRows(QModelIndex(), rowCount(), rowCount()); 46 | Appointment a = modelAppointmentList.value(index); 47 | a.m_title= appointment.m_title; 48 | a.m_location=appointment.m_location; 49 | a.m_description=appointment.m_description; 50 | a.m_startTime=appointment.m_startTime; 51 | a.m_endTime=appointment.m_endTime; 52 | 53 | a.m_isFullDay=appointment.m_isFullDay; 54 | modelAppointmentList.removeAt(index); 55 | modelAppointmentList.insert(index,a); 56 | endInsertRows(); 57 | } 58 | 59 | Appointment ScheduleListModel::getAppointment(int index) 60 | { 61 | Appointment a = modelAppointmentList.value(index); 62 | return a; 63 | } 64 | 65 | void ScheduleListModel::clearAllAppointment() 66 | { 67 | beginResetModel(); 68 | modelAppointmentList.clear(); 69 | endResetModel(); 70 | } 71 | 72 | void ScheduleListModel::removeAppointment(int idx) 73 | { 74 | beginRemoveRows(QModelIndex(), 0, rowCount()); 75 | modelAppointmentList.removeAt(idx); 76 | endRemoveRows(); 77 | } 78 | 79 | int ScheduleListModel::rowCount(const QModelIndex &parent) const 80 | { 81 | Q_UNUSED(parent) 82 | return modelAppointmentList.size(); 83 | 84 | } 85 | 86 | QVariant ScheduleListModel::data(const QModelIndex &index, int role) const 87 | { 88 | if (!index.isValid()) 89 | return QVariant(); 90 | if (index.row() >= modelAppointmentList.size() || index.row() < 0) 91 | return QVariant(); 92 | 93 | if (role == Qt::DisplayRole) { 94 | 95 | const Appointment& appointment = modelAppointmentList.at(index.row()); 96 | QString details=QStringLiteral("default"); 97 | //More to do.. 98 | QTime starts =QTime::fromString(appointment.m_startTime); 99 | QTime ends =QTime::fromString(appointment.m_endTime); 100 | 101 | if (appointment.m_isFullDay==1) 102 | { 103 | details =QLatin1String("Title: ")+appointment.m_title 104 | +QLatin1String("\nDate: ")+appointment.m_date 105 | +QLatin1String("\nLocation: ")+appointment.m_location 106 | +QStringLiteral("\nAll Day Event") +QLatin1String("\nNotes: ")+appointment.m_description 107 | +QLatin1String("\n----------------------"); 108 | 109 | } 110 | else { 111 | details =QLatin1String("Title: ")+appointment.m_title 112 | +QLatin1String("\nDate: ")+appointment.m_date 113 | +QLatin1String("\nLocation: ")+appointment.m_location 114 | + QStringLiteral("\nStart Time: ") 115 | +starts.toString(QStringLiteral("hh:mm"))+QStringLiteral(" End Time: ")+ends.toString(QStringLiteral("hh:mm")) 116 | +QLatin1String("\nNotes: ")+appointment.m_description 117 | +QLatin1String("\n----------------------"); 118 | } 119 | 120 | return details; 121 | } 122 | 123 | return QVariant(); 124 | 125 | } 126 | -------------------------------------------------------------------------------- /src/dialogappointmentupdate.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #ifndef DIALOGAPPOINTMENTUPDATE_H 20 | #define DIALOGAPPOINTMENTUPDATE_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include "appointment.h" 29 | namespace Ui { 30 | class DialogAppointmentUpdate; 31 | } 32 | 33 | class DialogAppointmentUpdate : public QDialog 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | 39 | explicit DialogAppointmentUpdate(QWidget *parent = nullptr, Appointment *theAppointment=nullptr); 40 | ~DialogAppointmentUpdate(); 41 | 42 | //Appointment values (default) 43 | QString titleValue=QStringLiteral(""); 44 | QString locationValue=QStringLiteral(""); 45 | QString notesValue=QStringLiteral(""); 46 | QDate appointmentDate; 47 | QTime appointmentStartTime; 48 | QTime appointmentEndTime; 49 | 50 | int isAllDay=0; 51 | 52 | QTime startTime; 53 | QTime endTime; 54 | 55 | bool deleteRequested=false; 56 | bool valid =false; 57 | 58 | //QString currentTitle=QStringLiteral(""); 59 | 60 | QString getTitle(); 61 | QString getLocation(); 62 | QString getDescription(); 63 | QDate getAppointmentDate(); 64 | QTime getStartTime(); 65 | QTime getEndTime(); 66 | int getAllDay(); 67 | 68 | bool getDeleteRequested(); 69 | 70 | 71 | //reminders 72 | int reminderMins=0; 73 | int getReminderMins(); 74 | int hasReminder=0; 75 | int getHasReminder(); 76 | 77 | //Translations 78 | 79 | //Set externally with setLabelTranslations 80 | QString t_dialog_update; 81 | QString t_date_display; 82 | QString t_title; 83 | QString t_location; 84 | QString t_notes; 85 | QString t_all_day; 86 | QString t_start_time; 87 | QString t_end_time; 88 | QString t_category; 89 | QString t_reminder; 90 | QString t_delete; 91 | 92 | QString t_reminder_5min; 93 | QString t_reminder_10min; 94 | QString t_reminder_30min; 95 | QString t_reminder_1hour; 96 | QString t_reminder_1day; 97 | 98 | void setDialogUpdateTranslation(QString translation); 99 | void setDateDisplayTranslation(QString translation); 100 | void setTitleTranslation(QString translation); 101 | void setLocationTranslation(QString translation); 102 | void setNotesTranslations(QString translation); 103 | void setAllDaytranslation(QString translation); 104 | void setStartTimeTranslation(QString translation); 105 | void setEndTimeTranslation(QString translation); 106 | void setCategoryTranslation(QString translation); 107 | void setReminderTranslation(QString translation); 108 | void setDeleteTranslation(QString translation); 109 | void setLabelTranslations(); 110 | 111 | void setReminder5MinTranslation(QString translation); 112 | void setReminder10MinTranslation(QString translation); 113 | void setReminder30MinTranslation(QString translation); 114 | void setReminder1HourTranslation(QString translation); 115 | void setReminder1DayTranslation(QString translation); 116 | 117 | void setComboBoxReminderTranslations(); 118 | 119 | QLocale locale=QLocale::English; 120 | void setLocaleDate(QLocale locale); 121 | 122 | private slots: 123 | 124 | void accept(); 125 | void reject(); 126 | 127 | void on_lineEditTitle_textChanged(const QString &arg1); 128 | 129 | void on_lineEditLocation_textChanged(const QString &arg1); 130 | 131 | void on_textEditDescription_textChanged(); 132 | 133 | void on_checkBoxAllDay_stateChanged(int arg1); 134 | 135 | void on_timeEditStartTime_userTimeChanged(const QTime &time); 136 | 137 | void on_timeEditEndTime_userTimeChanged(const QTime &time); 138 | 139 | void on_checkBoxDelete_stateChanged(int arg1); 140 | 141 | void on_comboBoxReminder_currentIndexChanged(int index); 142 | 143 | void on_checkBoxReminder_stateChanged(int arg1); 144 | 145 | private: 146 | Ui::DialogAppointmentUpdate *ui; 147 | }; 148 | 149 | #endif // DIALOGAPPOINTMENTUPDATE_H 150 | -------------------------------------------------------------------------------- /src/dialogupcomingschedule.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #include "dialogupcomingschedule.h" 20 | #include "ui_dialogupcomingschedule.h" 21 | 22 | 23 | DialogUpcomingSchedule::DialogUpcomingSchedule(QWidget *parent, 24 | DbManager *theDbm) : 25 | QDialog(parent), 26 | ui(new Ui::DialogUpcomingSchedule) 27 | { 28 | ui->setupUi(this); 29 | 30 | setWindowTitle(t_title); 31 | ui->labelSchedule->setText(t_label_upcoming_schedule); 32 | 33 | this->appointmentList= theDbm->getAllAppointments(); 34 | this->theDbm=*theDbm; 35 | 36 | QList schedule =QList(); 37 | //QList dayList =QList(); 38 | QDate currentDate =QDate::currentDate(); 39 | QString date =locale.toString(currentDate,QStringLiteral("dddd dd MMMM yyyy")); 40 | ui->labelDate->setText(date); 41 | 42 | //selectedDateLabel->setText(date); 43 | //QDate currentDate =QDate::currentDate(); 44 | ui->labelDate->setText(currentDate.toString()); 45 | 46 | QDate currentDatePlusOne=currentDate.addDays(1); 47 | QDate currentDatePlusTwo=currentDate.addDays(2); 48 | QDate currentDatePlusThree=currentDate.addDays(3); 49 | QDate currentDatePlusFour=currentDate.addDays(4); 50 | QDate currentDatePlusFive=currentDate.addDays(5); 51 | QDate currentDatePlusSix=currentDate.addDays(6); 52 | QDate currentDatePlusSeven=currentDate.addDays(7); 53 | 54 | QList dayList1 =getSortedDayList(currentDatePlusOne); 55 | QList dayList2 =getSortedDayList(currentDatePlusTwo); 56 | QList dayList3 =getSortedDayList(currentDatePlusThree); 57 | QList dayList4 =getSortedDayList(currentDatePlusFour); 58 | QList dayList5 =getSortedDayList(currentDatePlusFive); 59 | QList dayList6 =getSortedDayList(currentDatePlusSix); 60 | QList dayList7 =getSortedDayList(currentDatePlusSeven); 61 | 62 | schedule.append(dayList1); 63 | schedule.append(dayList2); 64 | schedule.append(dayList3); 65 | schedule.append(dayList4); 66 | schedule.append(dayList5); 67 | schedule.append(dayList6); 68 | schedule.append(dayList7); 69 | 70 | scheduleListModel = new ScheduleListModel(schedule); 71 | ui->listViewSchedule->setModel(scheduleListModel); 72 | } 73 | 74 | QList DialogUpcomingSchedule::getSortedDayList(QDate theDate) 75 | { 76 | QList dayList =QList(); 77 | foreach(Appointment a, appointmentList) 78 | { 79 | QDate adate = QDate::fromString(a.m_date); 80 | 81 | if(adate==theDate) 82 | { 83 | dayList.append(a); 84 | } 85 | } 86 | std::sort(dayList.begin(), dayList.end(), compare); 87 | return dayList; 88 | 89 | } 90 | 91 | bool DialogUpcomingSchedule::compare(const Appointment &first, const Appointment &second) 92 | { 93 | QTime firstStarts =QTime::fromString(first.m_startTime); 94 | QTime secondStarts =QTime::fromString(second.m_startTime); 95 | 96 | int fx=60*60*firstStarts.hour()+60*firstStarts.minute(); //seconds 97 | int sx=60*60*secondStarts.hour()+60*secondStarts.minute(); 98 | 99 | if (fx < sx) 100 | { 101 | return true; 102 | } 103 | else if (fx > sx) 104 | { 105 | return false; 106 | } 107 | return false; 108 | } 109 | 110 | DialogUpcomingSchedule::~DialogUpcomingSchedule() 111 | { 112 | delete ui; 113 | } 114 | 115 | void DialogUpcomingSchedule::setTitleTranslation(QString translation) 116 | { 117 | t_title=translation; 118 | setWindowTitle(t_title); 119 | } 120 | 121 | void DialogUpcomingSchedule::setLabelUpcomingScheduleTranslation(QString translation) 122 | { 123 | t_label_upcoming_schedule=translation; 124 | ui->labelSchedule->setText(t_label_upcoming_schedule); 125 | } 126 | 127 | void DialogUpcomingSchedule::setLocale(QLocale locale) 128 | { 129 | this->locale=locale; 130 | QDate currentDate =QDate::currentDate(); 131 | QString date =locale.toString(currentDate,QStringLiteral("dddd dd MMMM yyyy")); 132 | ui->labelDate->setText(date); 133 | } 134 | 135 | 136 | -------------------------------------------------------------------------------- /src/daylistmodel.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #include "daylistmodel.h" 20 | 21 | DayListModel::DayListModel(QObject *parent) 22 | { 23 | Q_UNUSED(parent) 24 | this->modelAppointmentList= QList(); 25 | 26 | } 27 | 28 | DayListModel::DayListModel(const QList &appointmentList, QObject *parent) 29 | { 30 | Q_UNUSED(parent) 31 | this->modelAppointmentList=appointmentList; 32 | 33 | } 34 | 35 | void DayListModel::addAppointment(Appointment &appointment) 36 | { 37 | beginInsertRows(QModelIndex(), rowCount(), rowCount()); 38 | this->modelAppointmentList.append(appointment); 39 | endInsertRows(); 40 | } 41 | 42 | void DayListModel::updateAppointment(Appointment &appointment, int index) 43 | { 44 | beginInsertRows(QModelIndex(), rowCount(), rowCount()); 45 | Appointment a = modelAppointmentList.value(index); 46 | a.m_title= appointment.m_title; 47 | a.m_location=appointment.m_location; 48 | a.m_description=appointment.m_description; 49 | a.m_startTime=appointment.m_startTime; 50 | a.m_endTime=appointment.m_endTime; 51 | 52 | a.m_isFullDay=appointment.m_isFullDay; 53 | modelAppointmentList.removeAt(index); 54 | modelAppointmentList.insert(index,a); 55 | endInsertRows(); 56 | } 57 | 58 | Appointment DayListModel::getAppointment(int index) 59 | { 60 | Appointment a = modelAppointmentList.value(index); 61 | return a; 62 | } 63 | 64 | void DayListModel::clearAllAppointment() 65 | { 66 | beginResetModel(); 67 | modelAppointmentList.clear(); 68 | endResetModel(); 69 | } 70 | 71 | void DayListModel::removeAppointment(int idx) 72 | { 73 | beginRemoveRows(QModelIndex(), 0, rowCount()); 74 | modelAppointmentList.removeAt(idx); 75 | endRemoveRows(); 76 | } 77 | 78 | void DayListModel::setNewLineSpacing(int spacing) 79 | { 80 | flagSpacing=spacing; 81 | } 82 | 83 | 84 | 85 | 86 | 87 | int DayListModel::rowCount(const QModelIndex &parent) const 88 | { 89 | Q_UNUSED(parent) 90 | return modelAppointmentList.size(); 91 | } 92 | 93 | QVariant DayListModel::data(const QModelIndex &index, int role) const 94 | { 95 | 96 | if (!index.isValid()) 97 | return QVariant(); 98 | if (index.row() >= modelAppointmentList.size() || index.row() < 0) 99 | return QVariant(); 100 | const Appointment& appointment = modelAppointmentList.at(index.row()); 101 | if (role == Qt::DisplayRole) { 102 | 103 | 104 | QString details=QStringLiteral("default"); 105 | //More to do.. 106 | QTime starts =QTime::fromString(appointment.m_startTime); 107 | QTime ends =QTime::fromString(appointment.m_endTime); 108 | 109 | if (appointment.m_isFullDay==1) 110 | { 111 | 112 | 113 | if(flagSpacing==0) 114 | { 115 | details=QStringLiteral("All Day Event: ")+appointment.m_title 116 | + QStringLiteral(" (")+appointment.m_location+QStringLiteral(") ") 117 | +appointment.m_description; 118 | 119 | } 120 | else if(flagSpacing==1) 121 | { 122 | details=QStringLiteral("All Day Event: ")+appointment.m_title 123 | + QStringLiteral(" (")+appointment.m_location+QStringLiteral(") ") 124 | +appointment.m_description+QLatin1Char('\n'); 125 | } 126 | else { 127 | details=QStringLiteral("All Day Event: ")+appointment.m_title 128 | + QStringLiteral(" (")+appointment.m_location+QStringLiteral(") ") 129 | +appointment.m_description; 130 | } 131 | 132 | } 133 | else { 134 | 135 | if(flagSpacing==0) 136 | { 137 | details =starts.toString(QStringLiteral("hh:mm"))+QStringLiteral(" to ")+ends.toString(QStringLiteral("hh:mm")) 138 | + QLatin1Char(' ')+appointment.m_title+QStringLiteral(" (")+appointment.m_location+ QStringLiteral(") ") 139 | + appointment.m_description; 140 | 141 | } 142 | else if(flagSpacing==1) 143 | { 144 | details =starts.toString(QStringLiteral("hh:mm"))+QStringLiteral(" to ")+ends.toString(QStringLiteral("hh:mm")) 145 | + QLatin1Char(' ')+appointment.m_title+QStringLiteral(" (")+appointment.m_location+ QStringLiteral(") ") 146 | + appointment.m_description+QLatin1Char('\n'); 147 | } 148 | else { 149 | details =starts.toString(QStringLiteral("hh:mm"))+QStringLiteral(" to ")+ends.toString(QStringLiteral("hh:mm")) 150 | + QLatin1Char(' ')+appointment.m_title+QStringLiteral(" (")+appointment.m_location+ QStringLiteral(") ") 151 | + appointment.m_description; 152 | } 153 | } 154 | 155 | return details; 156 | } 157 | 158 | 159 | 160 | return QVariant(); 161 | } 162 | -------------------------------------------------------------------------------- /src/dialogrepeatappointment.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #include "dialogrepeatappointment.h" 20 | #include "ui_dialogrepeatappointment.h" 21 | 22 | DialogRepeatAppointment::DialogRepeatAppointment(QWidget *parent, QDate *theAppointmentDate): 23 | QDialog(parent), 24 | ui(new Ui::DialogRepeatAppointment) 25 | { 26 | ui->setupUi(this); 27 | 28 | this->appointmentDate=*theAppointmentDate; 29 | QTime timeNow =QTime::currentTime(); 30 | this->startTime=timeNow; 31 | this->endTime=timeNow; 32 | ui->timeEditStarts->setTime(timeNow); 33 | ui->timeEditEnds->setTime(timeNow); 34 | ui->spinBoxDays->setRange(1,28); //upto 4 weeks apart 35 | ui->spinBoxDays->setValue(1); 36 | ui->spinBoxRepeatNumber->setRange(0,12); //over 3 months 37 | ui->spinBoxRepeatNumber->setValue(1); 38 | 39 | } 40 | 41 | DialogRepeatAppointment::~DialogRepeatAppointment() 42 | { 43 | delete ui; 44 | } 45 | 46 | int DialogRepeatAppointment::getRepeatDayInterval() 47 | { 48 | return repeatDayInterval; 49 | } 50 | 51 | int DialogRepeatAppointment::getRepeatNumber() 52 | { 53 | return repeatNumber; 54 | } 55 | 56 | QString DialogRepeatAppointment::getTitle() 57 | { 58 | return ui->lineEditTitle->text(); 59 | } 60 | 61 | QString DialogRepeatAppointment::getLocation() 62 | { 63 | return ui->lineEditLocation->text(); 64 | } 65 | 66 | QString DialogRepeatAppointment::getDescription() 67 | { 68 | 69 | return ui->textEditDescription->toPlainText(); 70 | } 71 | 72 | QDate DialogRepeatAppointment::getAppointmentDate() 73 | { 74 | return this->appointmentDate; 75 | } 76 | 77 | QTime DialogRepeatAppointment::getStartTime() 78 | { 79 | return this->startTime; 80 | } 81 | 82 | QTime DialogRepeatAppointment::getEndTime() 83 | { 84 | return this->endTime; 85 | } 86 | 87 | int DialogRepeatAppointment::getAllDay() 88 | { 89 | return isAllDay; 90 | } 91 | 92 | void DialogRepeatAppointment::setDialogTitleTranslation(QString translation) 93 | { 94 | t_dialog_title=translation; 95 | } 96 | 97 | void DialogRepeatAppointment::setStartDateDisplayTranslation(QString translation) 98 | { 99 | t_start_date_display=translation; 100 | } 101 | 102 | void DialogRepeatAppointment::setTitleTranslation(QString translation) 103 | { 104 | t_title=translation; 105 | } 106 | 107 | void DialogRepeatAppointment::setLocationTranslation(QString translation) 108 | { 109 | t_location=translation; 110 | } 111 | 112 | void DialogRepeatAppointment::setNotesTranslations(QString translation) 113 | { 114 | t_notes=translation; 115 | } 116 | 117 | void DialogRepeatAppointment::setAllDaytranslation(QString translation) 118 | { 119 | t_all_day=translation; 120 | } 121 | 122 | void DialogRepeatAppointment::setStartTimeTranslation(QString translation) 123 | { 124 | t_start_time=translation; 125 | } 126 | 127 | void DialogRepeatAppointment::setEndTimeTranslation(QString translation) 128 | { 129 | t_end_time=translation; 130 | } 131 | 132 | void DialogRepeatAppointment::setRepeatEveryTranslation(QString translation) 133 | { 134 | t_repeat_every=translation; 135 | } 136 | 137 | void DialogRepeatAppointment::setDaysTranslation(QString translation) 138 | { 139 | t_days=translation; 140 | } 141 | 142 | void DialogRepeatAppointment::setOccurrencesTranslation(QString translation) 143 | { 144 | t_occurrences=translation; 145 | } 146 | 147 | void DialogRepeatAppointment::setLabelTranslations() 148 | { 149 | setWindowTitle(t_dialog_title); 150 | ui->labelInfo->setText(t_start_date_display); 151 | ui->labelTitle->setText(t_title); 152 | ui->labelLocation->setText(t_location); 153 | ui->labelNotes->setText(t_notes); 154 | ui->checkBox->setText(t_all_day); 155 | ui->labelStartTime->setText(t_start_time); 156 | ui->labelEndTime->setText(t_end_time); 157 | ui->labelRepeatEvery->setText(t_repeat_every); 158 | ui->labelDays->setText(t_days); 159 | ui->labelOccurrences->setText(t_occurrences); 160 | 161 | } 162 | 163 | void DialogRepeatAppointment::setLocaleDate(QLocale locale) 164 | { 165 | this->locale=locale; 166 | QString date =locale.toString(appointmentDate,QStringLiteral("dddd dd MMMM yyyy")); 167 | ui->labelDate->setText(date); 168 | } 169 | 170 | 171 | void DialogRepeatAppointment::accept() 172 | { 173 | if (this->getTitle().isEmpty() || this->getLocation().isEmpty()) 174 | { 175 | QMessageBox::information(this, QStringLiteral("Empty Details"), 176 | QStringLiteral("Must enter a title and location")); 177 | return; 178 | } 179 | else { 180 | QDialog::accept(); 181 | } 182 | } 183 | 184 | void DialogRepeatAppointment::reject() 185 | { 186 | QDialog::reject(); 187 | } 188 | 189 | void DialogRepeatAppointment::on_timeEditStarts_userTimeChanged(const QTime &time) 190 | { 191 | this->startTime=time; 192 | } 193 | 194 | void DialogRepeatAppointment::on_timeEditEnds_userTimeChanged(const QTime &time) 195 | { 196 | this->endTime=time; 197 | } 198 | 199 | void DialogRepeatAppointment::on_checkBox_stateChanged(int arg1) 200 | { 201 | if (arg1==Qt::Unchecked) 202 | { 203 | isAllDay=0; 204 | ui->timeEditStarts->setEnabled(true); 205 | ui->timeEditEnds->setEnabled(true); 206 | ui->labelStartTime->setEnabled(true); 207 | ui->labelEndTime->setEnabled(true); 208 | 209 | } 210 | else if (arg1==Qt::Checked) { 211 | isAllDay=1; 212 | ui->timeEditStarts->setEnabled(false); 213 | ui->timeEditEnds->setEnabled(false); 214 | ui->labelStartTime->setEnabled(false); 215 | ui->labelEndTime->setEnabled(false); 216 | } 217 | } 218 | 219 | void DialogRepeatAppointment::on_spinBoxDays_valueChanged(int arg1) 220 | { 221 | repeatDayInterval=arg1; 222 | } 223 | 224 | void DialogRepeatAppointment::on_spinBoxRepeatNumber_valueChanged(int arg1) 225 | { 226 | repeatNumber=arg1; 227 | } 228 | -------------------------------------------------------------------------------- /src/contactmodel.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #include "contactmodel.h" 20 | 21 | ContactModel::ContactModel(QObject *parent): 22 | QAbstractTableModel(parent) 23 | { 24 | Q_UNUSED(parent) 25 | } 26 | 27 | ContactModel::ContactModel(const QList &contactList, QObject *parent) 28 | { 29 | Q_UNUSED(parent) 30 | this->modelContactList=contactList; 31 | } 32 | 33 | void ContactModel::AddContact(Contact &contact) 34 | { 35 | beginInsertRows(QModelIndex(), rowCount(), rowCount()); 36 | modelContactList.append(contact); 37 | endInsertRows(); 38 | } 39 | 40 | Contact ContactModel::getContact(int index) 41 | { 42 | Contact c = modelContactList.value(index); 43 | return c; 44 | } 45 | 46 | void ContactModel::clearAllContacts() 47 | { 48 | beginResetModel(); 49 | modelContactList.clear(); 50 | endResetModel(); 51 | } 52 | 53 | void ContactModel::removeContact(int idx) 54 | { 55 | beginRemoveRows(QModelIndex(), 0, rowCount()); 56 | modelContactList.removeAt(idx); 57 | endRemoveRows(); 58 | } 59 | 60 | int ContactModel::rowCount(const QModelIndex &parent) const 61 | { 62 | Q_UNUSED(parent) 63 | return modelContactList.size(); 64 | } 65 | 66 | int ContactModel::columnCount(const QModelIndex &parent) const 67 | { 68 | Q_UNUSED(parent); 69 | return 13; //13 columns (see cases below) 70 | } 71 | 72 | QVariant ContactModel::data(const QModelIndex &index, int role) const 73 | { 74 | if (!index.isValid()) 75 | return QVariant(); 76 | if (index.row() >= modelContactList.size() || index.row() < 0) 77 | return QVariant(); 78 | 79 | 80 | if (role == Qt::DisplayRole) { 81 | 82 | const Contact& c = modelContactList.at(index.row()); 83 | QDate birthdayDate =QDate::fromString(c.m_birthdate); 84 | 85 | QString birthdayDateStr=QLatin1Char('(')+QString::number(birthdayDate.day())+QLatin1Char('/') 86 | +QString::number(birthdayDate.month())+QLatin1Char('/') 87 | +QString::number(birthdayDate.year())+QLatin1Char(')'); 88 | 89 | 90 | switch (index.column()) { 91 | case 0: 92 | return c.m_id; 93 | case 1: 94 | return c.m_firstname; 95 | case 2: 96 | return c.m_midnames; 97 | case 3: 98 | return c.m_lastname; 99 | case 4: 100 | return c.m_email; 101 | case 5: 102 | return c.m_street; 103 | case 6: 104 | return c.m_district; 105 | case 7: 106 | return c.m_city; 107 | case 8: 108 | return c.m_county; 109 | case 9: 110 | return c.m_postcode; 111 | case 10: 112 | return c.m_country; 113 | case 11: 114 | return c.m_telephone; 115 | case 12: 116 | return birthdayDateStr; 117 | 118 | 119 | default: 120 | return QVariant(); 121 | } 122 | } 123 | else if (role == Qt::TextAlignmentRole){ 124 | if (index.column() == 3 || index.column()==4) //start and end times 125 | return Qt::AlignCenter; 126 | else 127 | return Qt::AlignLeft; 128 | } 129 | return QVariant(); 130 | } 131 | 132 | 133 | 134 | QVariant ContactModel::headerData(int section, Qt::Orientation orientation, int role) const 135 | { 136 | if (role != Qt::DisplayRole) 137 | return QVariant(); 138 | 139 | if (orientation == Qt::Horizontal) { 140 | switch (section) { 141 | case 0: 142 | return QVariant(QLatin1String("ContactId")); 143 | case 1: 144 | return t_first_name; 145 | case 2: 146 | return t_mid_name; 147 | case 3: 148 | return t_last_name; 149 | case 4: 150 | return t_email; 151 | case 5: 152 | return t_street; 153 | case 6: 154 | return t_district; 155 | case 7: 156 | return t_city; 157 | case 8: 158 | return t_county; 159 | case 9: 160 | return t_postcode; 161 | case 10: 162 | return t_country; 163 | case 11: 164 | return t_telephone; 165 | case 12: 166 | return t_birthday; 167 | default: 168 | return QVariant(); 169 | } 170 | } 171 | return section + 1; 172 | } 173 | 174 | void ContactModel::setFirstNameTranslation(QString translation) 175 | { 176 | t_first_name=translation; 177 | } 178 | 179 | void ContactModel::setMidNameTranslation(QString translation) 180 | { 181 | t_mid_name=translation; 182 | } 183 | 184 | void ContactModel::setLastNameTranslation(QString translation) 185 | { 186 | t_last_name=translation; 187 | } 188 | 189 | void ContactModel::setEmailTranslation(QString translation) 190 | { 191 | t_email=translation; 192 | } 193 | 194 | void ContactModel::setStreetTranslation(QString translation) 195 | { 196 | t_street=translation; 197 | } 198 | 199 | void ContactModel::setDistrictTranslation(QString translation) 200 | { 201 | t_district=translation; 202 | } 203 | 204 | void ContactModel::setCityTranslation(QString translation) 205 | { 206 | t_city=translation; 207 | } 208 | 209 | void ContactModel::setCountyTransaltion(QString translation) 210 | { 211 | t_county=translation; 212 | } 213 | 214 | void ContactModel::setPostcodeTranslation(QString translation) 215 | { 216 | t_postcode=translation; 217 | } 218 | 219 | void ContactModel::setCountryTranslation(QString translation) 220 | { 221 | t_country=translation; 222 | } 223 | 224 | void ContactModel::setTelephoneTranslation(QString translation) 225 | { 226 | t_telephone=translation; 227 | } 228 | 229 | void ContactModel::setBirthdayTranslation(QString translation) 230 | { 231 | t_birthday=translation; 232 | } 233 | 234 | -------------------------------------------------------------------------------- /src/dialogappointmentupdate.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DialogAppointmentUpdate 4 | 5 | 6 | 7 | 0 8 | 0 9 | 681 10 | 522 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Appointment Date: 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 14 33 | 75 34 | true 35 | 36 | 37 | 38 | theDate 39 | 40 | 41 | 42 | 43 | 44 | 45 | Qt::Horizontal 46 | 47 | 48 | 49 | 40 50 | 20 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | Title: 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 400 71 | 0 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | Location: 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 400 88 | 0 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | Notes: 97 | 98 | 99 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 400 108 | 0 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | All Day 121 | 122 | 123 | 124 | 125 | 126 | 127 | Qt::Horizontal 128 | 129 | 130 | 131 | 40 132 | 20 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | Start Time: 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | Qt::Horizontal 151 | 152 | 153 | 154 | 40 155 | 20 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | End Time: 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | Reminder: 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | Qt::Horizontal 188 | 189 | 190 | 191 | 40 192 | 20 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 14 202 | 75 203 | true 204 | 205 | 206 | 207 | Delete Appointment 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | Qt::Horizontal 219 | 220 | 221 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | buttonBox 231 | accepted() 232 | DialogAppointmentUpdate 233 | accept() 234 | 235 | 236 | 248 237 | 254 238 | 239 | 240 | 157 241 | 274 242 | 243 | 244 | 245 | 246 | buttonBox 247 | rejected() 248 | DialogAppointmentUpdate 249 | reject() 250 | 251 | 252 | 316 253 | 260 254 | 255 | 256 | 286 257 | 274 258 | 259 | 260 | 261 | 262 | 263 | -------------------------------------------------------------------------------- /src/dialogappointment.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DialogAppointment 4 | 5 | 6 | 7 | 0 8 | 0 9 | 601 10 | 559 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Appointment Date: 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 75 33 | true 34 | 35 | 36 | 37 | theDate 38 | 39 | 40 | 41 | 42 | 43 | 44 | Qt::Horizontal 45 | 46 | 47 | 48 | 40 49 | 20 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | Title: 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 400 70 | 0 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | Location: 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 400 87 | 0 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | Notes: 96 | 97 | 98 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 400 107 | 0 108 | 109 | 110 | 111 | 112 | 16777215 113 | 200 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | All Day 126 | 127 | 128 | 129 | 130 | 131 | 132 | Qt::Horizontal 133 | 134 | 135 | 136 | 13 137 | 30 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | Start Time: 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | Qt::Horizontal 156 | 157 | 158 | 159 | 13 160 | 30 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | End Time: 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | Qt::Horizontal 179 | 180 | 181 | 182 | 13 183 | 30 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | Reminder: 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | Qt::Horizontal 206 | 207 | 208 | 209 | 40 210 | 20 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | Qt::Horizontal 223 | 224 | 225 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | buttonBox 235 | accepted() 236 | DialogAppointment 237 | accept() 238 | 239 | 240 | 248 241 | 254 242 | 243 | 244 | 157 245 | 274 246 | 247 | 248 | 249 | 250 | buttonBox 251 | rejected() 252 | DialogAppointment 253 | reject() 254 | 255 | 256 | 316 257 | 260 258 | 259 | 260 | 286 261 | 274 262 | 263 | 264 | 265 | 266 | 267 | -------------------------------------------------------------------------------- /src/dialogrepeatappointment.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DialogRepeatAppointment 4 | 5 | 6 | 7 | 0 8 | 0 9 | 647 10 | 561 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Appointment Start Date: 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 75 33 | true 34 | 35 | 36 | 37 | the Date 38 | 39 | 40 | 41 | 42 | 43 | 44 | Qt::Horizontal 45 | 46 | 47 | 48 | 40 49 | 20 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | Title: 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 350 70 | 0 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | Location: 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 350 87 | 0 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | Notes: 96 | 97 | 98 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 400 107 | 0 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | All Day 120 | 121 | 122 | 123 | 124 | 125 | 126 | Qt::Horizontal 127 | 128 | 129 | 130 | 40 131 | 20 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | Start Time: 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | Qt::Horizontal 150 | 151 | 152 | 153 | 40 154 | 20 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | End Time: 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | Repeat Every: 180 | 181 | 182 | 183 | 184 | 185 | 186 | Qt::Horizontal 187 | 188 | 189 | 190 | 40 191 | 20 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | Days 203 | 204 | 205 | 206 | 207 | 208 | 209 | Qt::Horizontal 210 | 211 | 212 | 213 | 40 214 | 20 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | Occurrences 226 | 227 | 228 | 229 | 230 | 231 | 232 | Qt::Horizontal 233 | 234 | 235 | 236 | 40 237 | 20 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | Qt::Horizontal 250 | 251 | 252 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | buttonBox 262 | accepted() 263 | DialogRepeatAppointment 264 | accept() 265 | 266 | 267 | 248 268 | 254 269 | 270 | 271 | 157 272 | 274 273 | 274 | 275 | 276 | 277 | buttonBox 278 | rejected() 279 | DialogRepeatAppointment 280 | reject() 281 | 282 | 283 | 316 284 | 260 285 | 286 | 287 | 286 288 | 274 289 | 290 | 291 | 292 | 293 | 294 | -------------------------------------------------------------------------------- /src/dialogappointment.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #include "dialogappointment.h" 20 | #include "ui_dialogappointment.h" 21 | 22 | 23 | DialogAppointment::DialogAppointment(QWidget *parent, QDate *theAppointmentDate): 24 | QDialog(parent), 25 | ui(new Ui::DialogAppointment) 26 | { 27 | ui->setupUi(this); 28 | //New appointment 29 | 30 | this->appointmentDate=*theAppointmentDate; 31 | //ui->labelDateValue->setText(this->appointmentDate.toString()); 32 | 33 | QString date =locale.toString(appointmentDate,QStringLiteral("dddd dd MMMM yyyy")); 34 | ui->labelDateValue->setText(date); 35 | setLabelTranslations(); 36 | 37 | QTime timeNow =QTime::currentTime(); 38 | this->startTime=timeNow; 39 | this->endTime=timeNow; 40 | ui->timeEditStartTime->setTime(timeNow); 41 | ui->timeEditEndTime->setTime(timeNow); 42 | ui->checkBoxReminder->setText(QStringLiteral("Reminder")); 43 | 44 | //setupComboBoxes(); 45 | 46 | ui->checkBoxReminder->setCheckState(Qt::Unchecked); 47 | ui->comboBoxReminder->setEnabled(false); 48 | } 49 | 50 | 51 | DialogAppointment::~DialogAppointment() 52 | { 53 | delete ui; 54 | } 55 | 56 | 57 | QString DialogAppointment::getTitle() 58 | { 59 | //currentTitle=ui->lineEditTitle->text(); 60 | return ui->lineEditTitle->text(); 61 | } 62 | 63 | QString DialogAppointment::getLocation() 64 | { 65 | return ui->lineEditLocation->text(); 66 | } 67 | 68 | QString DialogAppointment::getDescription() 69 | { 70 | return ui->textEditDescription->toPlainText(); 71 | } 72 | 73 | QDate DialogAppointment::getAppointmentDate() 74 | { 75 | return this->appointmentDate; 76 | } 77 | 78 | QTime DialogAppointment::getStartTime() 79 | { 80 | return this->startTime; 81 | } 82 | 83 | QTime DialogAppointment::getEndTime() 84 | { 85 | return this->endTime; 86 | } 87 | 88 | int DialogAppointment::getAllDay() 89 | { 90 | return isAllDay; 91 | } 92 | 93 | 94 | 95 | 96 | bool DialogAppointment::getDeleteRequested() 97 | { 98 | return this->deleteRequested; 99 | } 100 | 101 | void DialogAppointment::setupComboBoxes() 102 | { 103 | 104 | //Set up Reminder ComboBox 105 | ui->comboBoxReminder->addItem(t_reminder_5min); 106 | ui->comboBoxReminder->addItem(t_reminder_10min); 107 | ui->comboBoxReminder->addItem(t_reminder_30min); 108 | ui->comboBoxReminder->addItem(t_reminder_1hour); 109 | ui->comboBoxReminder->addItem(t_reminder_1day); 110 | 111 | } 112 | 113 | void DialogAppointment::setComboBoxReminderTranslations() 114 | { 115 | //Set up Reminder ComboBox 116 | ui->comboBoxReminder->addItem(t_reminder_5min); 117 | ui->comboBoxReminder->addItem(t_reminder_10min); 118 | ui->comboBoxReminder->addItem(t_reminder_30min); 119 | ui->comboBoxReminder->addItem(t_reminder_1hour); 120 | ui->comboBoxReminder->addItem(t_reminder_1day); 121 | } 122 | 123 | 124 | int DialogAppointment::getReminderMins() 125 | { 126 | return this->reminderMins; 127 | } 128 | 129 | void DialogAppointment::setDialogTitleTranslation(QString translation) 130 | { 131 | t_dialog_title=translation; 132 | } 133 | 134 | void DialogAppointment::setDateDisplayTranslation(QString translation) 135 | { 136 | t_date_display=translation; 137 | } 138 | 139 | void DialogAppointment::setTitleTranslation(QString translation) 140 | { 141 | t_title=translation; 142 | } 143 | 144 | void DialogAppointment::setLocationTranslation(QString translation) 145 | { 146 | t_location=translation; 147 | } 148 | 149 | void DialogAppointment::setNotesTranslations(QString translation) 150 | { 151 | t_notes=translation; 152 | } 153 | 154 | void DialogAppointment::setAllDaytranslation(QString translation) 155 | { 156 | t_all_day=translation; 157 | } 158 | 159 | void DialogAppointment::setStartTimeTranslation(QString translation) 160 | { 161 | t_start_time=translation; 162 | } 163 | 164 | void DialogAppointment::setEndTimeTranslation(QString translation) 165 | { 166 | t_end_time=translation; 167 | } 168 | 169 | 170 | void DialogAppointment::setReminderTranslation(QString translation) 171 | { 172 | t_reminder=translation; 173 | } 174 | 175 | void DialogAppointment::setReminder5MinTranslation(QString translation) 176 | { 177 | t_reminder_5min=translation; 178 | } 179 | 180 | void DialogAppointment::setReminder10MinTranslation(QString translation) 181 | { 182 | t_reminder_10min=translation; 183 | } 184 | 185 | void DialogAppointment::setReminder30MinTranslation(QString translation) 186 | { 187 | t_reminder_30min=translation; 188 | } 189 | 190 | void DialogAppointment::setReminder1HourTranslation(QString translation) 191 | { 192 | t_reminder_1hour=translation; 193 | } 194 | 195 | void DialogAppointment::setReminder1DayTranslation(QString translation) 196 | { 197 | t_reminder_1day=translation; 198 | } 199 | 200 | 201 | void DialogAppointment::setLabelTranslations() 202 | { 203 | setWindowTitle(t_dialog_title); 204 | ui->labelDate->setText(t_date_display); 205 | ui->labelTitle->setText(t_title); 206 | ui->labelLocation->setText(t_location); 207 | ui->labelDescription->setText(t_notes); 208 | ui->checkBoxAllDay->setText(t_all_day); 209 | ui->labelStarts->setText(t_start_time); 210 | ui->labelEndTime->setText(t_end_time); 211 | ui->checkBoxReminder->setText(t_reminder); 212 | } 213 | 214 | 215 | 216 | void DialogAppointment::setLocaleDate(QLocale locale) 217 | { 218 | this->locale=locale; 219 | QString date =locale.toString(appointmentDate,QStringLiteral("dddd dd MMMM yyyy")); 220 | ui->labelDateValue->setText(date); 221 | } 222 | 223 | 224 | int DialogAppointment::getHasReminder() 225 | { 226 | return this->hasReminder; 227 | } 228 | 229 | void DialogAppointment::accept() 230 | { 231 | 232 | //qDebug("ok button pressed"); 233 | 234 | 235 | if (this->getTitle().isEmpty() || this->getLocation().isEmpty()) 236 | { 237 | QMessageBox::information(this, QStringLiteral("Empty Details"), 238 | QStringLiteral("Must enter a title and location")); 239 | return; 240 | } 241 | else { 242 | //ui->buttonBox->setEnabled(true); 243 | QDialog::accept(); 244 | } 245 | } 246 | 247 | void DialogAppointment::reject() 248 | { 249 | //keep all the old vararialbes 250 | 251 | //qDebug("rejecting ... Cancel button pressed"); 252 | 253 | QDialog::reject(); 254 | } 255 | 256 | 257 | void DialogAppointment::on_timeEditStartTime_userTimeChanged(const QTime &time) 258 | { 259 | this->startTime=time; 260 | //ui->timeEditEndTime->setTime(time); 261 | } 262 | 263 | void DialogAppointment::on_timeEditEndTime_userTimeChanged(const QTime &time) 264 | { 265 | this->endTime=time; 266 | } 267 | 268 | 269 | 270 | void DialogAppointment::on_checkBoxAllDay_stateChanged(int arg1) 271 | { 272 | if (arg1==Qt::Unchecked) 273 | { 274 | isAllDay=0; 275 | ui->timeEditStartTime->setEnabled(true); 276 | ui->timeEditEndTime->setEnabled(true); 277 | ui->labelStarts->setEnabled(true); 278 | ui->labelEndTime->setEnabled(true); 279 | 280 | } 281 | else if (arg1==Qt::Checked) { 282 | isAllDay=1; 283 | ui->timeEditStartTime->setEnabled(false); 284 | ui->timeEditEndTime->setEnabled(false); 285 | ui->labelStarts->setEnabled(false); 286 | ui->labelEndTime->setEnabled(false); 287 | } 288 | } 289 | 290 | 291 | void DialogAppointment::on_comboBoxReminder_currentIndexChanged(int index) 292 | { 293 | if(index==0){ 294 | reminderMins=5; 295 | 296 | } 297 | else if(index==1){ 298 | reminderMins=10; 299 | 300 | } 301 | else if(index==2){ 302 | reminderMins=30; 303 | 304 | } 305 | else if(index==3){ 306 | reminderMins=60; 307 | 308 | } 309 | else if(index==4){ 310 | reminderMins=1440; //minutes in a day i.e. 1 day = (24 hours/day) × (60 minutes/hour) = 1440 311 | 312 | } 313 | } 314 | 315 | void DialogAppointment::on_checkBoxReminder_stateChanged(int arg1) 316 | { 317 | if (arg1==Qt::Unchecked) 318 | { 319 | hasReminder=0; 320 | reminderMins=0; 321 | 322 | ui->comboBoxReminder->setEnabled(false); 323 | 324 | 325 | } 326 | else if (arg1==Qt::Checked) { 327 | hasReminder=1; 328 | reminderMins=5; 329 | 330 | ui->comboBoxReminder->setEnabled(true); 331 | 332 | } 333 | } 334 | -------------------------------------------------------------------------------- /src/dialogcontact.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #include "dialogcontact.h" 20 | #include "ui_dialogcontact.h" 21 | 22 | DialogContact::DialogContact(QWidget *parent) : 23 | QDialog(parent), 24 | ui(new Ui::DialogContact) 25 | { 26 | ui->setupUi(this); 27 | //New Contact 28 | //setWindowTitle(QStringLiteral("New Contact")); 29 | ui->checkBoxDelete->hide(); 30 | this->birthDate=QDate(); //null 31 | 32 | //setLabelTranslations(); 33 | 34 | 35 | //ui->checkBoxBirthdayUnknown->setText(QStringLiteral("Birthday Unknown")); 36 | //ui->checkBoxAddBirthdayToCal->setText(QStringLiteral("Add To Calendar")); 37 | ui->checkBoxBirthdayUnknown->setCheckState(Qt::Unchecked); 38 | ui->dateEditBirthDate->setDate(QDate::currentDate()); 39 | 40 | } 41 | 42 | DialogContact::DialogContact(Contact *theContact, QWidget *parent): 43 | QDialog(parent), 44 | ui(new Ui::DialogContact) 45 | { 46 | ui->setupUi(this); 47 | //Update Contact 48 | 49 | ui->checkBoxDelete->show(); 50 | //setLabelTranslations(); 51 | 52 | ui->lineEditFirstName->setText(theContact->m_firstname); 53 | ui->lineEditMiddleNames->setText(theContact->m_midnames); 54 | ui->lineEditLastName->setText(theContact->m_lastname); 55 | ui->lineEditEmail->setText(theContact->m_email); 56 | ui->lineEditStreet->setText(theContact->m_street); 57 | ui->lineEditDistrict->setText(theContact->m_district); 58 | ui->lineEditCity->setText(theContact->m_city); 59 | ui->lineEditCounty->setText(theContact->m_county); 60 | ui->lineEditPostcode->setText(theContact->m_postcode); 61 | ui->lineEditCountry->setText(theContact->m_country); 62 | ui->lineEditTelephone->setText(theContact->m_telephone); 63 | 64 | 65 | this->birthDate=QDate::fromString(theContact->m_birthdate); 66 | 67 | //qDebug()<<"Contact Dialog: birthdate = "<dateEditBirthDate->setDate(this->birthDate); 71 | } 72 | else { 73 | 74 | //qDebug()<<"Set checked state..."; 75 | ui->dateEditBirthDate->clear(); 76 | ui->checkBoxBirthdayUnknown->setCheckState(Qt::Checked); 77 | } 78 | 79 | this->addToCalendar=theContact->m_addToCalendar; 80 | 81 | if (addToCalendar==1) 82 | { 83 | ui->checkBoxAddBirthdayToCal->setCheckState(Qt::Checked); 84 | } 85 | else { 86 | ui->checkBoxAddBirthdayToCal->setCheckState(Qt::Unchecked); 87 | } 88 | 89 | } 90 | 91 | 92 | DialogContact::~DialogContact() 93 | { 94 | delete ui; 95 | } 96 | 97 | QString DialogContact::getFirstName() 98 | { 99 | firstName = ui->lineEditFirstName->text(); 100 | return firstName; 101 | } 102 | 103 | QString DialogContact::getMiddleNames() 104 | { 105 | middleNames=ui->lineEditMiddleNames->text(); 106 | return middleNames; 107 | } 108 | 109 | QString DialogContact::getLastName() 110 | { 111 | lastName=ui->lineEditLastName->text(); 112 | return lastName; 113 | } 114 | 115 | QString DialogContact::getEmail() 116 | { 117 | email=ui->lineEditEmail->text(); 118 | return email; 119 | } 120 | 121 | QDate DialogContact::getBirthDate() 122 | { 123 | return this->birthDate; 124 | } 125 | 126 | int DialogContact::getAddToCalendar() 127 | { 128 | return this->addToCalendar; 129 | } 130 | 131 | QString DialogContact::getStreet() 132 | { 133 | this->street=ui->lineEditStreet->text(); 134 | return this->street; 135 | } 136 | 137 | QString DialogContact::getDistrict() 138 | { 139 | this->district=ui->lineEditDistrict->text(); 140 | return this->district; 141 | } 142 | 143 | QString DialogContact::getCity() 144 | { 145 | this->city =ui->lineEditCity->text(); 146 | return this->city; 147 | } 148 | 149 | QString DialogContact::getCounty() 150 | { 151 | this->county=ui->lineEditCounty->text(); 152 | return this->county; 153 | } 154 | 155 | QString DialogContact::getPostcode() 156 | { 157 | this->postcode=ui->lineEditPostcode->text(); 158 | return this->postcode; 159 | 160 | } 161 | 162 | QString DialogContact::getCountry() 163 | { 164 | this->country=ui->lineEditCountry->text(); 165 | return this->country; 166 | } 167 | 168 | QString DialogContact::getPhoneNumber() 169 | { 170 | this->phoneNumber=ui->lineEditTelephone->text(); 171 | return this->phoneNumber; 172 | } 173 | 174 | bool DialogContact::getDeleteRequested() 175 | { 176 | return this->deleteRequested; 177 | } 178 | 179 | void DialogContact::setDialogTitleTranslation(QString translation) 180 | { 181 | t_dialog_title=translation; 182 | } 183 | 184 | void DialogContact::setFirstNameTranslation(QString translation) 185 | { 186 | t_first_name=translation; 187 | } 188 | 189 | void DialogContact::setMidNameTranslation(QString translation) 190 | { 191 | t_mid_name=translation; 192 | } 193 | 194 | void DialogContact::setLastNameTranslation(QString translation) 195 | { 196 | t_last_name=translation; 197 | } 198 | 199 | void DialogContact::setEmailTranslation(QString translation) 200 | { 201 | t_email=translation; 202 | } 203 | 204 | void DialogContact::setStreetTranslation(QString translation) 205 | { 206 | t_street=translation; 207 | } 208 | 209 | void DialogContact::setDistrictTranslation(QString translation) 210 | { 211 | t_district=translation; 212 | } 213 | 214 | void DialogContact::setCityTranslation(QString translation) 215 | { 216 | t_city=translation; 217 | } 218 | 219 | void DialogContact::setCountyTranslation(QString translation) 220 | { 221 | t_county=translation; 222 | } 223 | 224 | void DialogContact::setPostcodeTranslation(QString translation) 225 | { 226 | t_postcode=translation; 227 | } 228 | 229 | void DialogContact::setCountryTranslation(QString translation) 230 | { 231 | t_country=translation; 232 | } 233 | 234 | void DialogContact::setTelephoneTranslation(QString translation) 235 | { 236 | t_telephone=translation; 237 | } 238 | 239 | void DialogContact::setBornOnTranslation(QString translation) 240 | { 241 | t_born_on=translation; 242 | } 243 | 244 | void DialogContact::setBirthdayUnknownTranslation(QString translation) 245 | { 246 | t_birthday_unknown=translation; 247 | } 248 | 249 | void DialogContact::setAddToCalendarTranslation(QString translation) 250 | { 251 | t_add_to_calendar=translation; 252 | } 253 | 254 | void DialogContact::setDeleteTranslation(QString translation) 255 | { 256 | t_delete=translation; 257 | } 258 | 259 | void DialogContact::setLabelTranslations() 260 | { 261 | setWindowTitle(t_dialog_title); 262 | ui->labelFirstName->setText(t_first_name); 263 | ui->labelMidNames->setText(t_mid_name); 264 | ui->labelLastName->setText(t_last_name); 265 | ui->labelEmail->setText(t_email); 266 | ui->labelStreet->setText(t_street); 267 | ui->labelDistrict->setText(t_district); 268 | ui->labelCity->setText(t_city); 269 | ui->labelCounty->setText(t_county); 270 | ui->labelPostcode->setText(t_postcode); 271 | ui->labelCountry->setText(t_country); 272 | ui->labelPhone->setText(t_telephone); 273 | 274 | ui->checkBoxBirthdayUnknown->setText(t_birthday_unknown); 275 | ui->labelBornOn->setText(t_born_on); 276 | ui->checkBoxAddBirthdayToCal->setText(t_add_to_calendar); 277 | ui->checkBoxDelete->setText(t_delete); 278 | 279 | } 280 | 281 | void DialogContact::accept() 282 | { 283 | if (this->getFirstName().isEmpty() || this->getLastName().isEmpty()) 284 | { 285 | QMessageBox::information(this, QStringLiteral("Empty Details"), 286 | QStringLiteral("Must enter first and last name")); 287 | return; 288 | } 289 | else { 290 | //qDebug()<<"Success both fields completed by user"; 291 | QDialog::accept(); 292 | } 293 | } 294 | 295 | void DialogContact::on_checkBoxBirthdayUnknown_stateChanged(int arg1) 296 | { 297 | if (arg1==Qt::Unchecked) 298 | { 299 | ui->dateEditBirthDate->setEnabled(true); 300 | ui->checkBoxAddBirthdayToCal->setEnabled(true); 301 | ui->labelBornOn->setEnabled(true); 302 | ui->dateEditBirthDate->setDate(QDate::currentDate()); 303 | birthDate=QDate::currentDate(); 304 | } 305 | else if (arg1==Qt::Checked) { 306 | ui->dateEditBirthDate->setEnabled(false); 307 | ui->checkBoxAddBirthdayToCal->setEnabled(false); 308 | ui->labelBornOn->setEnabled(false); 309 | this->birthDate=QDate(); //null 310 | addToCalendar=0; 311 | } 312 | 313 | } 314 | 315 | void DialogContact::on_dateEditBirthDate_userDateChanged(const QDate &date) 316 | { 317 | this->birthDate=date; 318 | } 319 | 320 | void DialogContact::on_checkBoxAddBirthdayToCal_stateChanged(int arg1) 321 | { 322 | if (arg1==Qt::Unchecked) 323 | { 324 | addToCalendar=0; 325 | } 326 | else if (arg1==Qt::Checked) { 327 | addToCalendar=1; 328 | } 329 | } 330 | 331 | void DialogContact::on_checkBoxDelete_stateChanged(int arg1) 332 | { 333 | if (arg1==Qt::Unchecked) 334 | { 335 | deleteRequested=false; 336 | } 337 | else if (arg1==Qt::Checked) { 338 | deleteRequested =true; 339 | } 340 | } 341 | -------------------------------------------------------------------------------- /src/dialogcontact.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DialogContact 4 | 5 | 6 | 7 | 0 8 | 0 9 | 710 10 | 594 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | First Name: 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 400 33 | 0 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | Middle Names: 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 400 50 | 0 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | Last Name: 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 400 67 | 0 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | Email: 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 400 84 | 0 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | Birthday Unknown 97 | 98 | 99 | 100 | 101 | 102 | 103 | Qt::Horizontal 104 | 105 | 106 | 107 | 40 108 | 20 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | Born On: 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | Add To Calendar 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | Street: 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 400 146 | 0 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | District: 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 400 163 | 0 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | City: 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 400 180 | 0 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | County: 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 400 197 | 0 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | Postcode: 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 400 214 | 0 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | Country: 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 400 231 | 0 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | Phone: 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 400 248 | 0 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 75 262 | true 263 | 264 | 265 | 266 | Delete Contact 267 | 268 | 269 | 270 | 271 | 272 | 273 | Qt::Horizontal 274 | 275 | 276 | 277 | 40 278 | 20 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | Qt::Horizontal 291 | 292 | 293 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | buttonBox 303 | accepted() 304 | DialogContact 305 | accept() 306 | 307 | 308 | 248 309 | 254 310 | 311 | 312 | 157 313 | 274 314 | 315 | 316 | 317 | 318 | buttonBox 319 | rejected() 320 | DialogContact 321 | reject() 322 | 323 | 324 | 316 325 | 260 326 | 327 | 328 | 286 329 | 274 330 | 331 | 332 | 333 | 334 | 335 | -------------------------------------------------------------------------------- /src/dialogappointmentupdate.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | 19 | #include "dialogappointmentupdate.h" 20 | #include "ui_dialogappointmentupdate.h" 21 | 22 | 23 | DialogAppointmentUpdate::DialogAppointmentUpdate(QWidget *parent, Appointment *theAppointment) : 24 | QDialog(parent), 25 | ui(new Ui::DialogAppointmentUpdate) 26 | { 27 | ui->setupUi(this); 28 | //Update an appointment 29 | 30 | ui->checkBoxDelete->show(); 31 | setLabelTranslations(); //translations 32 | //setupComboBoxes(); 33 | //setComboBoxReminderTranslations(); 34 | 35 | //populate appointment details in dialog 36 | this->titleValue=theAppointment->m_title; 37 | ui->lineEditTitle->setText(this->titleValue); 38 | this->locationValue=theAppointment->m_location; 39 | ui->lineEditLocation->setText(this->locationValue); 40 | this->notesValue=theAppointment->m_description; 41 | ui->textEditDescription->setText(this->notesValue); 42 | this->startTime=QTime::fromString(theAppointment->m_startTime); 43 | this->endTime =QTime::fromString(theAppointment->m_endTime); 44 | ui->timeEditStartTime->setTime(startTime); 45 | ui->timeEditEndTime->setTime(endTime); 46 | 47 | this->appointmentDate=QDate::fromString(theAppointment->m_date); 48 | 49 | // QString date =locale.toString(appointmentDate,QStringLiteral("dddd dd MMMM yyyy")); 50 | // ui->labelDateValue->setText(date); 51 | 52 | 53 | 54 | isAllDay=theAppointment->m_isFullDay; 55 | 56 | if (isAllDay==1) 57 | { 58 | ui->checkBoxAllDay->setCheckState(Qt::Checked); 59 | } 60 | 61 | valid =false; 62 | this->hasReminder=theAppointment->m_hasReminder; 63 | this->reminderMins=theAppointment->m_reminderMinutes; 64 | 65 | 66 | 67 | if (hasReminder==1) 68 | { 69 | ui->checkBoxReminder->setCheckState(Qt::Checked); 70 | ui->comboBoxReminder->setEnabled(true); 71 | 72 | if(reminderMins==5){ 73 | ui->comboBoxReminder->setCurrentIndex(0); 74 | } 75 | else if(reminderMins==10){ 76 | ui->comboBoxReminder->setCurrentIndex(1); 77 | } 78 | else if(reminderMins==30){ 79 | ui->comboBoxReminder->setCurrentIndex(2); 80 | } 81 | else if(reminderMins==60){ 82 | ui->comboBoxReminder->setCurrentIndex(3); 83 | } 84 | else if(reminderMins==1440){ 85 | ui->comboBoxReminder->setCurrentIndex(4); 86 | } 87 | } 88 | else { 89 | ui->checkBoxReminder->setCheckState(Qt::Unchecked); 90 | ui->comboBoxReminder->setEnabled(false); 91 | } 92 | } 93 | 94 | 95 | 96 | DialogAppointmentUpdate::~DialogAppointmentUpdate() 97 | { 98 | delete ui; 99 | } 100 | 101 | QString DialogAppointmentUpdate::getTitle() 102 | { 103 | 104 | return this->titleValue; 105 | } 106 | 107 | QString DialogAppointmentUpdate::getLocation() 108 | { 109 | return this->locationValue; 110 | } 111 | 112 | QString DialogAppointmentUpdate::getDescription() 113 | { 114 | return this->notesValue; 115 | } 116 | 117 | QDate DialogAppointmentUpdate::getAppointmentDate() 118 | { 119 | return this->appointmentDate; 120 | } 121 | 122 | QTime DialogAppointmentUpdate::getStartTime() 123 | { 124 | return this->startTime; 125 | } 126 | 127 | QTime DialogAppointmentUpdate::getEndTime() 128 | { 129 | return this->endTime; 130 | } 131 | 132 | int DialogAppointmentUpdate::getAllDay() 133 | { 134 | return this->isAllDay; 135 | } 136 | 137 | 138 | 139 | bool DialogAppointmentUpdate::getDeleteRequested() 140 | { 141 | return this->deleteRequested; 142 | 143 | } 144 | 145 | 146 | void DialogAppointmentUpdate::setComboBoxReminderTranslations() 147 | { 148 | 149 | //Set up Reminder ComboBox 150 | ui->comboBoxReminder->addItem(t_reminder_5min); 151 | ui->comboBoxReminder->addItem(t_reminder_10min); 152 | ui->comboBoxReminder->addItem(t_reminder_30min); 153 | ui->comboBoxReminder->addItem(t_reminder_1hour); 154 | ui->comboBoxReminder->addItem(t_reminder_1day); 155 | } 156 | 157 | 158 | int DialogAppointmentUpdate::getReminderMins() 159 | { 160 | return reminderMins; 161 | } 162 | 163 | int DialogAppointmentUpdate::getHasReminder() 164 | { 165 | return hasReminder; 166 | } 167 | 168 | void DialogAppointmentUpdate::setDialogUpdateTranslation(QString translation) 169 | { 170 | t_dialog_update=translation; 171 | } 172 | 173 | void DialogAppointmentUpdate::setDateDisplayTranslation(QString translation) 174 | { 175 | t_date_display=translation; 176 | } 177 | 178 | void DialogAppointmentUpdate::setTitleTranslation(QString translation) 179 | { 180 | t_title=translation; 181 | } 182 | 183 | void DialogAppointmentUpdate::setLocationTranslation(QString translation) 184 | { 185 | t_location=translation; 186 | } 187 | 188 | void DialogAppointmentUpdate::setNotesTranslations(QString translation) 189 | { 190 | t_notes=translation; 191 | } 192 | 193 | void DialogAppointmentUpdate::setAllDaytranslation(QString translation) 194 | { 195 | t_all_day=translation; 196 | } 197 | 198 | void DialogAppointmentUpdate::setStartTimeTranslation(QString translation) 199 | { 200 | t_start_time=translation; 201 | } 202 | 203 | void DialogAppointmentUpdate::setEndTimeTranslation(QString translation) 204 | { 205 | t_end_time=translation; 206 | } 207 | 208 | void DialogAppointmentUpdate::setCategoryTranslation(QString translation) 209 | { 210 | t_category=translation; 211 | } 212 | 213 | void DialogAppointmentUpdate::setReminderTranslation(QString translation) 214 | { 215 | t_reminder=translation; 216 | } 217 | 218 | void DialogAppointmentUpdate::setDeleteTranslation(QString translation) 219 | { 220 | t_delete=translation; 221 | } 222 | 223 | void DialogAppointmentUpdate::setLabelTranslations() 224 | { 225 | setWindowTitle(t_dialog_update); 226 | ui->labelDate->setText(t_date_display); 227 | ui->labelTitle->setText(t_title); 228 | ui->labelLocation->setText(t_location); 229 | ui->labelDescription->setText(t_notes); 230 | ui->checkBoxAllDay->setText(t_all_day); 231 | ui->labelStartTime->setText(t_start_time); 232 | ui->labelEndTime->setText(t_end_time); 233 | 234 | ui->checkBoxReminder->setText(t_reminder); 235 | ui->checkBoxDelete->setText(t_delete); 236 | } 237 | 238 | 239 | void DialogAppointmentUpdate::setReminder5MinTranslation(QString translation) 240 | { 241 | t_reminder_5min=translation; 242 | } 243 | 244 | void DialogAppointmentUpdate::setReminder10MinTranslation(QString translation) 245 | { 246 | t_reminder_10min=translation; 247 | } 248 | 249 | void DialogAppointmentUpdate::setReminder30MinTranslation(QString translation) 250 | { 251 | t_reminder_30min=translation; 252 | } 253 | 254 | void DialogAppointmentUpdate::setReminder1HourTranslation(QString translation) 255 | { 256 | t_reminder_1hour=translation; 257 | } 258 | 259 | void DialogAppointmentUpdate::setReminder1DayTranslation(QString translation) 260 | { 261 | t_reminder_1day=translation; 262 | } 263 | 264 | 265 | void DialogAppointmentUpdate::setLocaleDate(QLocale locale) 266 | { 267 | this->locale=locale; 268 | QString date =locale.toString(appointmentDate,QStringLiteral("dddd dd MMMM yyyy")); 269 | ui->labelDateValue->setText(date); 270 | } 271 | 272 | void DialogAppointmentUpdate::accept() 273 | { 274 | 275 | 276 | //return original values if not changed 277 | 278 | if (valid==false) 279 | { 280 | QMessageBox::information(this, QStringLiteral("No Updates Made"),QStringLiteral("Press Cancel to Quit")); 281 | return; 282 | 283 | //QDialog::reject(); 284 | } 285 | else { 286 | QDialog::accept(); 287 | 288 | } 289 | 290 | } 291 | 292 | void DialogAppointmentUpdate::reject() 293 | { 294 | //Made no changes (return original values?) 295 | 296 | //qDebug("Cancel button pressed"); 297 | QDialog::reject(); 298 | 299 | } 300 | 301 | 302 | 303 | void DialogAppointmentUpdate::on_lineEditTitle_textChanged(const QString &arg1) 304 | { 305 | 306 | this->titleValue =arg1; 307 | valid=true; 308 | } 309 | 310 | void DialogAppointmentUpdate::on_lineEditLocation_textChanged(const QString &arg1) 311 | { 312 | 313 | this->locationValue=arg1; 314 | valid=true; 315 | } 316 | 317 | void DialogAppointmentUpdate::on_textEditDescription_textChanged() 318 | { 319 | this->notesValue =ui->textEditDescription->toPlainText(); 320 | valid =true; 321 | } 322 | 323 | void DialogAppointmentUpdate::on_checkBoxAllDay_stateChanged(int arg1) 324 | { 325 | if (arg1==Qt::Unchecked) 326 | { 327 | isAllDay=0; 328 | ui->timeEditStartTime->setEnabled(true); 329 | ui->timeEditEndTime->setEnabled(true); 330 | ui->labelStartTime->setEnabled(true); 331 | ui->labelEndTime->setEnabled(true); 332 | 333 | 334 | } 335 | else if (arg1==Qt::Checked) { 336 | isAllDay=1; 337 | ui->timeEditStartTime->setEnabled(false); 338 | ui->timeEditEndTime->setEnabled(false); 339 | ui->labelStartTime->setEnabled(false); 340 | ui->labelEndTime->setEnabled(false); 341 | } 342 | 343 | valid=true; 344 | 345 | } 346 | 347 | void DialogAppointmentUpdate::on_timeEditStartTime_userTimeChanged(const QTime &time) 348 | { 349 | this->startTime=time; 350 | valid=true; 351 | } 352 | 353 | void DialogAppointmentUpdate::on_timeEditEndTime_userTimeChanged(const QTime &time) 354 | { 355 | this->endTime=time; 356 | valid =true; 357 | } 358 | 359 | void DialogAppointmentUpdate::on_checkBoxDelete_stateChanged(int arg1) 360 | { 361 | if (arg1==Qt::Unchecked) 362 | { 363 | deleteRequested=false; 364 | } 365 | else if (arg1==Qt::Checked) { 366 | deleteRequested =true; 367 | } 368 | 369 | valid =true; 370 | 371 | } 372 | 373 | 374 | void DialogAppointmentUpdate::on_comboBoxReminder_currentIndexChanged(int index) 375 | { 376 | valid=true; 377 | if(index==0){ 378 | reminderMins=5; 379 | 380 | 381 | } 382 | else if(index==1){ 383 | reminderMins=10; 384 | 385 | } 386 | else if(index==2){ 387 | reminderMins=30; 388 | ; 389 | } 390 | else if(index==3){ 391 | reminderMins=60; //1 hour 392 | 393 | } 394 | else if(index==4){ 395 | reminderMins=1440; //minutes in a day i.e. 1 day = (24 hours/day) × (60 minutes/hour) = 1440 396 | 397 | } 398 | } 399 | 400 | void DialogAppointmentUpdate::on_checkBoxReminder_stateChanged(int arg1) 401 | { 402 | if (arg1==Qt::Unchecked) 403 | { 404 | 405 | ui->comboBoxReminder->setEnabled(false); 406 | hasReminder=0; 407 | reminderMins=0; 408 | valid=true; 409 | } 410 | else if (arg1==Qt::Checked) { 411 | 412 | ui->comboBoxReminder->setEnabled(true); 413 | hasReminder=1; 414 | //reminderMins=5; 415 | valid=true; 416 | } 417 | } 418 | -------------------------------------------------------------------------------- /src/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 1145 10 | 773 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 21 | 0 22 | 23 | 24 | 25 | Calendar 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 0 37 | 0 38 | 39 | 40 | 41 | MonthYear 42 | 43 | 44 | Qt::AlignCenter 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | QFrame::StyledPanel 54 | 55 | 56 | QFrame::Raised 57 | 58 | 59 | 4 60 | 61 | 62 | 1 63 | 64 | 65 | Qt::ScrollBarAlwaysOff 66 | 67 | 68 | QAbstractItemView::NoEditTriggers 69 | 70 | 71 | Qt::ElideRight 72 | 73 | 74 | QAbstractItemView::ScrollPerItem 75 | 76 | 77 | Qt::SolidLine 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | Contacts 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | Show Quick/Full View 104 | 105 | 106 | 107 | 108 | 109 | 110 | Mail To: 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 0 128 | 0 129 | 1145 130 | 39 131 | 132 | 133 | 134 | 135 | File 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | Edit 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | Appointments 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | Contacts 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | Help 175 | 176 | 177 | 178 | 179 | 180 | Calendar 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | TopToolBarArea 204 | 205 | 206 | false 207 | 208 | 209 | 210 | 211 | 212 | Exit 213 | 214 | 215 | 216 | 217 | Delete All Appointments 218 | 219 | 220 | 221 | 222 | Delete All Contacts 223 | 224 | 225 | 226 | 227 | New Appointment (Double Click) 228 | 229 | 230 | 231 | 232 | Generate Repeat Appointments 233 | 234 | 235 | 236 | 237 | Upcoming Schedule 238 | 239 | 240 | 241 | 242 | 243 | :/icons/icon-c.svg:/icons/icon-c.svg 244 | 245 | 246 | New Contact 247 | 248 | 249 | 250 | 251 | Check For Birthdays 252 | 253 | 254 | 255 | 256 | 257 | :/icons/icon-uparrow.svg:/icons/icon-uparrow.svg 258 | 259 | 260 | Next Month 261 | 262 | 263 | 264 | 265 | 266 | :/icons/icon-downarrow.svg:/icons/icon-downarrow.svg 267 | 268 | 269 | Previous Month 270 | 271 | 272 | 273 | 274 | 275 | :/icons/icon-spacebar.svg:/icons/icon-spacebar.svg 276 | 277 | 278 | Today 279 | 280 | 281 | 282 | 283 | About 284 | 285 | 286 | 287 | 288 | Export Appointments 289 | 290 | 291 | 292 | 293 | Import Appointments 294 | 295 | 296 | 297 | 298 | Export Contacts 299 | 300 | 301 | 302 | 303 | Import Contacts 304 | 305 | 306 | 307 | 308 | Preferences 309 | 310 | 311 | 312 | 313 | 314 | :/icons/icon-f.svg:/icons/icon-f.svg 315 | 316 | 317 | Increase Font 318 | 319 | 320 | 321 | 322 | 323 | :/icons/icon-d.svg:/icons/icon-d.svg 324 | 325 | 326 | Decrease Font 327 | 328 | 329 | 330 | 331 | 332 | :/icons/icon-r.svg:/icons/icon-r.svg 333 | 334 | 335 | Reset Font 336 | 337 | 338 | 339 | 340 | true 341 | 342 | 343 | Show Birthdays 344 | 345 | 346 | 347 | 348 | true 349 | 350 | 351 | Show Holidays 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | -------------------------------------------------------------------------------- /src/mainwindow.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Author Alan Crispin aka. crispina * 3 | * crispinalan@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | ***************************************************************************/ 18 | #ifndef MAINWINDOW_H 19 | #define MAINWINDOW_H 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #include 40 | #include 41 | 42 | #include "appointment.h" 43 | #include "contact.h" 44 | #include "holiday.h" 45 | 46 | #include "dbmanager.h" 47 | 48 | #include "dialogappointment.h" 49 | #include "dialogappointmentupdate.h" 50 | #include "dialogcontact.h" 51 | #include "contactmodel.h" 52 | #include "proxymodelcontacts.h" 53 | #include "dialogupcomingschedule.h" 54 | #include "dialogupcomingbirthdays.h" 55 | #include "dialogrepeatappointment.h" 56 | #include "daylistmodel.h" 57 | #include "dialogpreferences.h" 58 | #include "preferences.h" 59 | 60 | 61 | namespace Ui { 62 | class MainWindow; 63 | } 64 | 65 | class MainWindow : public QMainWindow 66 | { 67 | Q_OBJECT 68 | 69 | public: 70 | explicit MainWindow(QWidget *parent = nullptr); 71 | ~MainWindow(); 72 | 73 | //Database 74 | DbManager dbm; 75 | 76 | //Timers 77 | QTimer *timer; 78 | 79 | //Reminders 80 | void checkForReminders(); 81 | 82 | 83 | 84 | //Preferences default 85 | 86 | int playAudio=0; 87 | int darkCalendar=0; 88 | void setDarkCalendar(int darkCalendar); 89 | 90 | //QLocale locale=QLocale::English; 91 | QLocale locale=QLocale::system(); 92 | 93 | //Translation strings 94 | QString t_title; 95 | //Holidays 96 | QString t_holiday_christmas; 97 | QString t_holiday_boxing; 98 | QString t_holiday_new_year; 99 | QString t_holiday_easter; 100 | QString t_holiday_good_friday; 101 | QString t_holiday_easter_monday; 102 | QString t_holiday_may_bank; 103 | QString t_holiday_spring_bank; 104 | QString t_holiday_summer_bank; 105 | //File 106 | QString t_file; 107 | QString t_file_export_appointments; 108 | QString t_file_import_appointments; 109 | QString t_file_export_contacts; 110 | QString t_file_import_contacts; 111 | QString t_file_exit; 112 | //Edit 113 | QString t_edit; 114 | QString t_edit_delete_all_appointments; 115 | QString t_edit_delete_all_contacts; 116 | QString t_edit_preferences; 117 | //Appointments 118 | QString t_appointments; 119 | QString t_appointments_new_appointment; 120 | QString t_appointments_generate_repeat_appointments; 121 | QString t_appointments_upcoming_schedule; 122 | //Calendar 123 | QString t_calendar; 124 | QString t_calendar_show_holidays; 125 | QString t_calendar_show_birthdays; 126 | QString t_calendar_next_month; 127 | QString t_calendar_previous_month; 128 | QString t_calendar_today; 129 | QString t_calendar_increase_font; 130 | QString t_calendar_decrease_font; 131 | QString t_calendar_reset_font; 132 | 133 | 134 | //Contacts 135 | QString t_contacts; 136 | QString t_contacts_new_contact; 137 | QString t_contacts_upcoming_birthdays; 138 | //Help 139 | QString t_help; 140 | QString t_help_about; 141 | QString t_about_text; 142 | //Contact tab 143 | QString t_contact_tab_first_name; 144 | QString t_contact_tab_mid_name; 145 | QString t_contact_tab_last_name; 146 | QString t_contact_tab_email; 147 | QString t_contact_tab_street; 148 | QString t_contact_tab_district; 149 | QString t_contact_tab_city; 150 | QString t_contact_tab_county; 151 | QString t_contact_tab_postcode; 152 | QString t_contact_tab_country; 153 | QString t_contact_tab_telephone; 154 | QString t_contact_tab_birthday; 155 | 156 | QString t_contact_tab_quick_full_view; 157 | QString t_contact_tab_mailto; 158 | 159 | //Preferences 160 | QString t_preferences_title; 161 | QString t_preferences_font_size; 162 | QString t_preferences_locale; 163 | QString t_preferences_play_audio; 164 | QString t_preferences_dark_calendar; 165 | QString t_preferences_line_spacing; 166 | 167 | //Upcoming dialogs 168 | QString t_upcoming_birthdays_title; 169 | QString t_upcoming_schedule_title; 170 | QString t_label_upcoming_schedule; 171 | 172 | //Appointment dialogs 173 | QString t_dialog_appointment_dialog_title; 174 | QString t_dialog_appointment_date_display; 175 | QString t_dialog_appointment_title; 176 | QString t_dialog_appointment_location; 177 | QString t_dialog_appointment_notes; 178 | QString t_dialog_appointment_all_day; 179 | QString t_dialog_appointment_start_time; 180 | QString t_dialog_appointment_end_time; 181 | QString t_dialog_appointment_reminder; 182 | 183 | //update appointment 184 | QString t_dialog_appointment_update; 185 | QString t_dialog_appointment_delete; 186 | 187 | QString t_reminder_5min; 188 | QString t_reminder_10min; 189 | QString t_reminder_30min; 190 | QString t_reminder_1hour; 191 | QString t_reminder_1day; 192 | 193 | QString t_reminder_message_on; 194 | QString t_reminder_message_starts_at; 195 | 196 | //repeat appointments 197 | QString t_dialog_repeat_title; 198 | QString t_dialog_repeat_date_message; 199 | QString t_dialog_repeat_repeat_every; 200 | QString t_dialog_repeat_days; 201 | QString t_dialog_repeat_occurrences; 202 | 203 | //Contacts dialog 204 | 205 | QString t_dialog_contact_title; 206 | QString t_dialog_contact_first_name; 207 | QString t_dialog_contact_mid_name; 208 | QString t_dialog_contact_last_name; 209 | QString t_dialog_contact_email; 210 | QString t_dialog_contact_street; 211 | QString t_dialog_contact_district; 212 | QString t_dialog_contact_city; 213 | QString t_dialog_contact_county; 214 | QString t_dialog_contact_postcode; 215 | QString t_dialog_contact_country; 216 | QString t_dialog_contact_telephone; 217 | 218 | QString t_dialog_contact_born_on; 219 | QString t_dialog_contact_birthday_unknown; 220 | QString t_dialog_contact_add_to_calendar; 221 | QString t_dialog_contact_delete; 222 | 223 | int applicationFontSize=14; 224 | int newLineSpacing=0; 225 | Preferences currentPreferences; 226 | void SetPreferences(); 227 | 228 | //Appointments 229 | QString title=QLatin1String(""); 230 | QString location=QLatin1String(""); 231 | QString description=QLatin1String(""); 232 | 233 | QDate appointmentDate; 234 | QTime appointmentStartTime; 235 | QTime appointmentEndTime; 236 | 237 | int isAllDay=0; 238 | int appointmentId =0; 239 | int hasReminder=0; 240 | int reminderMinutes=0; 241 | 242 | int isRepeating=0; 243 | int repeatDayInterval=0; 244 | int repeatNumber=0; 245 | 246 | QList appointmentList; 247 | 248 | void NewAppointment(); 249 | void UpdateAppointment(int dbID, int selectedRowindex); 250 | void GenerateRepeatAppointments(); 251 | void LoadDatabaseAppointmentsToAppointmentList(); 252 | void UpdateAppointmentInAppointmentList(Appointment app, int appointmentId); 253 | void RemoveAppointmentFromAppointmentList(int appointmentId); 254 | 255 | void ShowAppointmentsOnListView(QDate theSelectedDate); 256 | 257 | //Sorting 258 | static bool compare(const Appointment& first, const Appointment& second); 259 | QList getSortedDayList(QDate theDate); 260 | 261 | //Models 262 | DayListModel *dayListModel; 263 | 264 | //Selected date 265 | QDate selectedDate; 266 | int selectedYear=2000; 267 | int selectedMonth=1; 268 | int selectedDay=1; 269 | int firstDay=1; 270 | QLabel *selectedDateLabel; 271 | QLabel *dateInfoLabel; 272 | 273 | 274 | //Widget Calendar 275 | int columnCount=7; 276 | int rowCount=6; 277 | //int dayArray[6][7]; 278 | int dayArray[6*7]; 279 | void UpdateCalendar(); 280 | 281 | int prevCellRow=0; 282 | int prevCellCol=0; 283 | 284 | void SetApplicationFontSize(int fontsize); 285 | 286 | void increaseFont(); 287 | void decreaseFont(); 288 | void resetFont(); 289 | 290 | QAction *increaseFontAction; 291 | QAction *decreaseFontAction; 292 | QAction *resetFontAction; 293 | 294 | QTableWidgetItem* dayItem; 295 | QTableWidgetItem* calendarItem; 296 | QTableWidgetItem* holidayItem; 297 | QTableWidgetItem* birthdayItem; 298 | 299 | //Helper methods 300 | QDate CalculateEaster(int year); 301 | void checkForBirthdaysNextSevenDays(); 302 | void checkAppointmentsNextSevenDays(); 303 | 304 | //Navigation 305 | void gotoNextMonth(); 306 | void gotoPreviousMonth(); 307 | void gotoToday(); 308 | 309 | //Keyboard navigation actions 310 | QAction *gotoNextMonthAction; 311 | QAction *gotoPreviousMonthAction; 312 | QAction *gotoTodayAction; 313 | 314 | QList holidayList; 315 | void AddHolidaysToHolidayList(int year); 316 | 317 | //Contacts 318 | QString contactFirstName =QLatin1String(""); 319 | QString contactMiddleNames=QLatin1String(""); 320 | QString contactLastName=QLatin1String(""); 321 | QString contactEmail=QLatin1String(""); 322 | QString street=QLatin1String(""); 323 | QString district=QLatin1String(""); 324 | QString city=QLatin1String(""); 325 | QString county=QLatin1String(""); 326 | QString postcode =QLatin1String(""); 327 | QString country =QLatin1String(""); 328 | QString phoneNumber=QLatin1String(""); 329 | 330 | QDate birthDate=QDate(); //(0,0,0) 331 | int addBirthdayToCalendar =0; 332 | int selectedContactDbId=0; 333 | Contact selectedContact; 334 | int contactId=0; 335 | 336 | ContactModel *contactModel; 337 | ProxyModelContacts *proxyModelContacts; 338 | 339 | QAction *newContactAction; 340 | 341 | void LoadDatebaseContactsToContactList(); 342 | void NewContact(); 343 | void UpdateContact(int dbID); 344 | void DisplayContactsOnTableView(); 345 | 346 | //ContactList methods 347 | void RemoveContactFromContactList(int contactId); 348 | 349 | QList contactList; 350 | 351 | //flags 352 | bool flagShowBirthdays=true; 353 | bool flagShowHolidays =true; 354 | bool flagQuickView=false; 355 | 356 | 357 | //Export Import 358 | void ExportContactsXML(); 359 | void ImportContactsXML(); 360 | void ExportAppointmentsXML(); 361 | void ImportAppointmentsXML(); 362 | 363 | 364 | private slots: 365 | 366 | void timerUpdateSlot(); 367 | 368 | void gotoNextMonthSlot(); 369 | void gotoPreviousMonthSlot(); 370 | void gotoTodaySlot(); 371 | void newContactSlot(); 372 | 373 | void increaseFontSlot(); 374 | void decreaseFontSlot(); 375 | void resetFontSlot(); 376 | 377 | void on_actionExit_triggered(); 378 | 379 | void on_tableWidgetCalendar_cellClicked(int row, int column); 380 | 381 | void on_actionNew_Appointment_triggered(); 382 | 383 | void on_listViewDay_doubleClicked(const QModelIndex &index); 384 | 385 | void on_tableWidgetCalendar_cellDoubleClicked(int row, int column); 386 | 387 | void on_actionGeneerate_Repeat_Appointments_triggered(); 388 | 389 | void on_actionUpcoming_Schedule_triggered(); 390 | 391 | void on_actionNew_Contact_triggered(); 392 | 393 | void on_actionDelete_All_Appointments_triggered(); 394 | 395 | void on_actionDelete_All_Contacts_triggered(); 396 | 397 | void on_actionAbout_triggered(); 398 | 399 | void on_tableViewContacts_clicked(const QModelIndex &index); 400 | 401 | void on_pushButtonMailTo_clicked(); 402 | 403 | void on_pushButtonShowQuickFullView_clicked(); 404 | 405 | void on_tableViewContacts_doubleClicked(const QModelIndex &index); 406 | 407 | void on_actionNext_Month_triggered(); 408 | 409 | void on_actionPrevious_Month_triggered(); 410 | 411 | void on_actionToday_triggered(); 412 | 413 | void on_actionCheck_For_Birthdays_triggered(); 414 | 415 | void on_actionShow_Birthdays_triggered(); 416 | 417 | void on_actionShow_Holidays_triggered(); 418 | 419 | void on_actionExport_Appointments_triggered(); 420 | 421 | void on_actionImport_Appointments_triggered(); 422 | 423 | void on_actionExport_Contacts_triggered(); 424 | 425 | void on_actionImport_Contacts_triggered(); 426 | 427 | void on_actionPreferences_triggered(); 428 | 429 | void on_actionIncrease_Font_triggered(); 430 | 431 | void on_actionDecrease_Font_triggered(); 432 | 433 | void on_actionReset_Font_triggered(); 434 | 435 | private: 436 | Ui::MainWindow *ui; 437 | void loadSettings(); 438 | void saveSettings(); 439 | }; 440 | 441 | #endif // MAINWINDOW_H 442 | --------------------------------------------------------------------------------