Undeg HARD dev - calendar dialog for helping CSV exporter

This commit is contained in:
Sagi Dayan 2014-09-09 14:40:11 +03:00
parent df791d62b4
commit bc7d61fa38
7 changed files with 266 additions and 62 deletions

View file

@ -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

View file

@ -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 <iostream>
#include <QMessageBox>
@ -21,6 +22,7 @@ public:
private:
calendarSchedule * caliSchedPtr;
};
#endif // CALENDARMANAGER_H

View file

@ -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()

View file

@ -61,7 +61,7 @@ background: qlineargradient(spread:pad, x1:0.496, y1:0, x2:0.508, y2:1, stop:0 r
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>0</number>
<number>2</number>
</property>
<property name="documentMode">
<bool>false</bool>

View file

@ -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 **************************************";
}

View file

@ -0,0 +1,33 @@
#ifndef CALENDARDIALOG_H
#define CALENDARDIALOG_H
#include <QDialog>
#include <QDate>
#include <QDebug>
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

View file

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CalendarDialog</class>
<widget class="QDialog" name="CalendarDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>671</width>
<height>343</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>&lt;h1&gt;&lt;b&gt;For The Best CSV Export, Please Enter Correctly</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Semester Starts At:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Semester Ends At:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCalendarWidget" name="calStart"/>
</item>
<item>
<widget class="QCalendarWidget" name="calEnd"/>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_status">
<property name="text">
<string>[ ! ] Start &amp; End cannot be the same</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>CalendarDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>CalendarDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>