From bc7d61fa388bb6d3da3cdda037385c24874b31d0 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Tue, 9 Sep 2014 14:40:11 +0300 Subject: [PATCH] Undeg HARD dev - calendar dialog for helping CSV exporter --- jceGrade.pro | 125 ++++++++++++------------ main/CalendarTab/CalendarManager.h | 2 + main/mainscreen.cpp | 7 ++ main/mainscreen.ui | 2 +- src/jceData/Calendar/calendardialog.cpp | 41 ++++++++ src/jceData/Calendar/calendardialog.h | 33 +++++++ src/jceData/Calendar/calendardialog.ui | 118 ++++++++++++++++++++++ 7 files changed, 266 insertions(+), 62 deletions(-) create mode 100644 src/jceData/Calendar/calendardialog.cpp create mode 100644 src/jceData/Calendar/calendardialog.h create mode 100644 src/jceData/Calendar/calendardialog.ui diff --git a/jceGrade.pro b/jceGrade.pro index b047781..60edea4 100644 --- a/jceGrade.pro +++ b/jceGrade.pro @@ -1,61 +1,64 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2014-05-31T19:49:42 -# -#------------------------------------------------- - -QT += core gui network widgets -TARGET = jceGrade -TEMPLATE = app -RC_FILE = appConfigure.rc -CONFIG += qt c++11 -CONFIG += console - - -FORMS += \ - main/mainscreen.ui - -OTHER_FILES += - -RESOURCES += \ - resources/connectionstatus.qrc - -HEADERS += \ - main/CalendarTab/CalendarManager.h \ - main/CourseTab/coursestablemanager.h \ - main/LoginTab/loginhandler.h \ - main/mainscreen.h \ - src/appDatabase/savedata.h \ - src/jceConnection/jcesslclient.h \ - src/jceData/Calendar/calendarPage.h \ - src/jceData/Grades/gradeCourse.h \ - src/jceData/Grades/gradePage.h \ - src/jceData/course.h \ - src/jceData/page.h \ - src/jceSettings/jcelogin.h \ - src/jceSettings/jceLoginHtmlScripts.h \ - src/jceSettings/user.h \ - src/jceData/Calendar/calendarCourse.h \ - src/jceData/Calendar/calendarSchedule.h \ - src/jceData/CSV/csv_exporter.h \ - src/appDatabase/simplecrypt.h - -SOURCES += \ - main/CalendarTab/CalendarManager.cpp \ - main/CourseTab/coursestablemanager.cpp \ - main/LoginTab/loginhandler.cpp \ - main/main.cpp \ - main/mainscreen.cpp \ - src/appDatabase/savedata.cpp \ - src/jceConnection/jcesslclient.cpp \ - src/jceData/Calendar/calendarPage.cpp \ - src/jceData/Grades/gradeCourse.cpp \ - src/jceData/Grades/gradePage.cpp \ - src/jceData/page.cpp \ - src/jceSettings/jcelogin.cpp \ - src/jceSettings/user.cpp \ - src/jceData/Calendar/calendarCourse.cpp \ - src/jceData/Calendar/calendarSchedule.cpp \ - src/jceData/CSV/csv_exporter.cpp \ - src/appDatabase/simplecrypt.cpp - +#------------------------------------------------- +# +# Project created by QtCreator 2014-05-31T19:49:42 +# +#------------------------------------------------- + +QT += core gui network widgets +TARGET = jceGrade +TEMPLATE = app +RC_FILE = appConfigure.rc +CONFIG += qt c++11 +CONFIG += console + + +FORMS += \ + main/mainscreen.ui \ + src/jceData/Calendar/calendardialog.ui + +OTHER_FILES += + +RESOURCES += \ + resources/connectionstatus.qrc + +HEADERS += \ + main/CalendarTab/CalendarManager.h \ + main/CourseTab/coursestablemanager.h \ + main/LoginTab/loginhandler.h \ + main/mainscreen.h \ + src/appDatabase/savedata.h \ + src/jceConnection/jcesslclient.h \ + src/jceData/Calendar/calendarPage.h \ + src/jceData/Grades/gradeCourse.h \ + src/jceData/Grades/gradePage.h \ + src/jceData/course.h \ + src/jceData/page.h \ + src/jceSettings/jcelogin.h \ + src/jceSettings/jceLoginHtmlScripts.h \ + src/jceSettings/user.h \ + src/jceData/Calendar/calendarCourse.h \ + src/jceData/Calendar/calendarSchedule.h \ + src/jceData/CSV/csv_exporter.h \ + src/appDatabase/simplecrypt.h \ + src/jceData/Calendar/calendardialog.h + +SOURCES += \ + main/CalendarTab/CalendarManager.cpp \ + main/CourseTab/coursestablemanager.cpp \ + main/LoginTab/loginhandler.cpp \ + main/main.cpp \ + main/mainscreen.cpp \ + src/appDatabase/savedata.cpp \ + src/jceConnection/jcesslclient.cpp \ + src/jceData/Calendar/calendarPage.cpp \ + src/jceData/Grades/gradeCourse.cpp \ + src/jceData/Grades/gradePage.cpp \ + src/jceData/page.cpp \ + src/jceSettings/jcelogin.cpp \ + src/jceSettings/user.cpp \ + src/jceData/Calendar/calendarCourse.cpp \ + src/jceData/Calendar/calendarSchedule.cpp \ + src/jceData/CSV/csv_exporter.cpp \ + src/appDatabase/simplecrypt.cpp \ + src/jceData/Calendar/calendardialog.cpp + diff --git a/main/CalendarTab/CalendarManager.h b/main/CalendarTab/CalendarManager.h index 43a8f4d..1a92f8c 100644 --- a/main/CalendarTab/CalendarManager.h +++ b/main/CalendarTab/CalendarManager.h @@ -4,6 +4,7 @@ #include "./src/jceData/Calendar/calendarPage.h" #include "./src/jceData/Calendar/calendarSchedule.h" #include "./src/jceData/CSV/csv_exporter.h" +#include "./src/jceData/Calendar/calendardialog.h" #include #include @@ -21,6 +22,7 @@ public: private: calendarSchedule * caliSchedPtr; + }; #endif // CALENDARMANAGER_H diff --git a/main/mainscreen.cpp b/main/mainscreen.cpp index a7c0ec7..f6c4b74 100644 --- a/main/mainscreen.cpp +++ b/main/mainscreen.cpp @@ -337,7 +337,14 @@ void MainScreen::on_actionHow_To_triggered() void MainScreen::on_exportToCVSBtn_clicked() { if (loginHandel->isLoggedInFlag()) + { + CalendarDialog calDialog; + int buttonClicked = calDialog.exec(); + if(buttonClicked == 0) + return; +//calDialog.getStartDate(),calDialog.getEndDate() this->calendar->exportCalendarCSV(); + } } void MainScreen::on_actionHebrew_triggered() diff --git a/main/mainscreen.ui b/main/mainscreen.ui index 837858b..8200986 100644 --- a/main/mainscreen.ui +++ b/main/mainscreen.ui @@ -61,7 +61,7 @@ background: qlineargradient(spread:pad, x1:0.496, y1:0, x2:0.508, y2:1, stop:0 r QTabWidget::Rounded - 0 + 2 false diff --git a/src/jceData/Calendar/calendardialog.cpp b/src/jceData/Calendar/calendardialog.cpp new file mode 100644 index 0000000..310ff1d --- /dev/null +++ b/src/jceData/Calendar/calendardialog.cpp @@ -0,0 +1,41 @@ +#include "calendardialog.h" +#include "ui_calendardialog.h" + + +CalendarDialog::CalendarDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::CalendarDialog) +{ + ui->setupUi(this); + ui->calEnd->showToday(); + ui->calStart->showToday(); +} + +CalendarDialog::~CalendarDialog() +{ + delete ui; +} + +QDate CalendarDialog::getStartDate() +{ + return ui->calStart->selectedDate(); +} + +QDate CalendarDialog::getEndDate() +{ + return ui->calEnd->selectedDate(); +} + + + + + +void CalendarDialog::on_calStart_clicked(const QDate &date) +{ + qDebug() << "FUCK!!!"; +} + +void CalendarDialog::on_calStart_selectionChanged() +{ + qDebug() << "selection **************************************"; +} diff --git a/src/jceData/Calendar/calendardialog.h b/src/jceData/Calendar/calendardialog.h new file mode 100644 index 0000000..36da197 --- /dev/null +++ b/src/jceData/Calendar/calendardialog.h @@ -0,0 +1,33 @@ +#ifndef CALENDARDIALOG_H +#define CALENDARDIALOG_H + +#include +#include +#include + +namespace Ui { +class CalendarDialog; +} + +class CalendarDialog : public QDialog +{ + Q_OBJECT + +public: + explicit CalendarDialog(QWidget *parent = 0); + ~CalendarDialog(); + QDate getStartDate(); + QDate getEndDate(); + +private slots: + void on_calStart_activated(const QDate &date); + + void on_calStart_selectionChanged(); + + void on_calStart_clicked(const QDate &date); + +private: + Ui::CalendarDialog *ui; +}; + +#endif // CALENDARDIALOG_H diff --git a/src/jceData/Calendar/calendardialog.ui b/src/jceData/Calendar/calendardialog.ui new file mode 100644 index 0000000..7dd0a69 --- /dev/null +++ b/src/jceData/Calendar/calendardialog.ui @@ -0,0 +1,118 @@ + + + CalendarDialog + + + + 0 + 0 + 671 + 343 + + + + Dialog + + + + + + + + <h1><b>For The Best CSV Export, Please Enter Correctly + + + + + + + + + + + + + Semester Starts At: + + + + + + + Semester Ends At: + + + + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + [ ! ] Start & End cannot be the same + + + + + + + + + + + + + buttonBox + accepted() + CalendarDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + CalendarDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +