Merge branch 'master' of https://github.com/liranbg/JceManager
This commit is contained in:
commit
fe5a144bd3
8 changed files with 539 additions and 540 deletions
11
jceGrade.pro
11
jceGrade.pro
|
@ -14,10 +14,8 @@ CONFIG += console static
|
|||
TRANSLATIONS = jce_en.ts \
|
||||
jce_he.ts
|
||||
|
||||
|
||||
FORMS += \
|
||||
main/mainscreen.ui \
|
||||
src/jceData/Calendar/calendardialog.ui
|
||||
main/mainscreen.ui
|
||||
|
||||
OTHER_FILES +=
|
||||
|
||||
|
@ -42,8 +40,7 @@ HEADERS += \
|
|||
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
|
||||
src/appDatabase/simplecrypt.h
|
||||
|
||||
SOURCES += \
|
||||
main/CalendarTab/CalendarManager.cpp \
|
||||
|
@ -62,6 +59,6 @@ SOURCES += \
|
|||
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
|
||||
src/appDatabase/simplecrypt.cpp
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ void CalendarManager::setCalendar(std::string html)
|
|||
}
|
||||
void CalendarManager::exportCalendarCSV() //need to add fix to the null pointer bug
|
||||
{
|
||||
if (caliSchedPtr->getCourses()->empty())
|
||||
if (caliSchedPtr->getCourses() == NULL)
|
||||
return;
|
||||
QMessageBox msgBox;
|
||||
int buttonClicked = caliDialog->exec();
|
||||
|
|
|
@ -1,68 +1,68 @@
|
|||
#ifndef CALENDARCOURSE_H
|
||||
#define CALENDARCOURSE_H
|
||||
|
||||
#include "../course.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
|
||||
#include <QTime>
|
||||
|
||||
#define CALENDAR_COURSE_FIELDS 8
|
||||
|
||||
class calendarCourse : public Course
|
||||
{
|
||||
public:
|
||||
enum CourseScheme
|
||||
{
|
||||
SERIAL,
|
||||
NAME,
|
||||
TYPE,
|
||||
LECTURER,
|
||||
POINTS,
|
||||
SEM_HOURS,
|
||||
DAY_AND_HOURS,
|
||||
ROOM
|
||||
};
|
||||
calendarCourse(int serial, std::string name, std::string type, std::string lecturer,
|
||||
double points, double semesterHours, std::string dayAndHour, std::string room);
|
||||
~calendarCourse(){}
|
||||
|
||||
int getDay() const;
|
||||
std::string getLecturer() const;
|
||||
std::string getRoom() const;
|
||||
double getSemesterHours() const;
|
||||
int getHourBegin() const;
|
||||
int getMinutesBegin() const;
|
||||
int getHourEnd() const;
|
||||
int getMinutesEnd() const;
|
||||
|
||||
void setDay(const std::string &value);
|
||||
void setLecturer(const std::string &value);
|
||||
void setRoom(const std::string &value);
|
||||
void setSemesterHours(double value);
|
||||
void setHourBegin(int value);
|
||||
void setMinutesBegin(int value);
|
||||
void setHourEnd(int value);
|
||||
void setMinutesEnd(int value);
|
||||
|
||||
std::string courseToString();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
void setDayAndHour(std::string phrase);
|
||||
|
||||
std::string lecturer;
|
||||
double semesterHours;
|
||||
int day;
|
||||
int hourBegin;
|
||||
int minutesBegin;
|
||||
int hourEnd;
|
||||
int minutesEnd;
|
||||
std::string room;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // CALENDARCOURSE_H
|
||||
#ifndef CALENDARCOURSE_H
|
||||
#define CALENDARCOURSE_H
|
||||
|
||||
#include "../course.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
|
||||
#include <QTime>
|
||||
|
||||
#define CALENDAR_COURSE_FIELDS 8
|
||||
|
||||
class calendarCourse : public Course
|
||||
{
|
||||
public:
|
||||
enum CourseScheme
|
||||
{
|
||||
SERIAL,
|
||||
NAME,
|
||||
TYPE,
|
||||
LECTURER,
|
||||
POINTS,
|
||||
SEM_HOURS,
|
||||
DAY_AND_HOURS,
|
||||
ROOM
|
||||
};
|
||||
calendarCourse(int serial, std::string name, std::string type, std::string lecturer,
|
||||
double points, double semesterHours, std::string dayAndHour, std::string room);
|
||||
~calendarCourse(){}
|
||||
|
||||
int getDay() const;
|
||||
std::string getLecturer() const;
|
||||
std::string getRoom() const;
|
||||
double getSemesterHours() const;
|
||||
int getHourBegin() const;
|
||||
int getMinutesBegin() const;
|
||||
int getHourEnd() const;
|
||||
int getMinutesEnd() const;
|
||||
|
||||
void setDay(const std::string &value);
|
||||
void setLecturer(const std::string &value);
|
||||
void setRoom(const std::string &value);
|
||||
void setSemesterHours(double value);
|
||||
void setHourBegin(int value);
|
||||
void setMinutesBegin(int value);
|
||||
void setHourEnd(int value);
|
||||
void setMinutesEnd(int value);
|
||||
|
||||
std::string courseToString();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
void setDayAndHour(std::string phrase);
|
||||
|
||||
std::string lecturer;
|
||||
double semesterHours;
|
||||
int day;
|
||||
int hourBegin;
|
||||
int minutesBegin;
|
||||
int hourEnd;
|
||||
int minutesEnd;
|
||||
std::string room;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // CALENDARCOURSE_H
|
||||
|
|
|
@ -1,106 +1,108 @@
|
|||
#include "calendarPage.h"
|
||||
|
||||
std::string CalendarPage::htmlToString()
|
||||
{
|
||||
return tempHtml;
|
||||
}
|
||||
|
||||
void CalendarPage::setPage(std::string html)
|
||||
{
|
||||
courses = new std::list<calendarCourse*>();
|
||||
tempHtml = getString(html);
|
||||
tempHtml = tokenToLines(tempHtml);
|
||||
calendarListInit(tempHtml);
|
||||
}
|
||||
|
||||
std::string CalendarPage::tokenToLines(std::string &textToPhrase)
|
||||
{
|
||||
int ctr = 0;
|
||||
std::string temp = "";
|
||||
char *tok;
|
||||
char* textToTok = strdup(textToPhrase.c_str());
|
||||
tok = strtok(textToTok, "\n");
|
||||
while(tok != NULL)
|
||||
{
|
||||
//amount of data before the actual needed data and no empty lines
|
||||
if (strcmp(tok," \t ") != 0)
|
||||
{
|
||||
temp += tok;
|
||||
temp += "\n";
|
||||
}
|
||||
ctr++;
|
||||
tok = strtok(NULL, "\n");
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
||||
void CalendarPage::calendarListInit(std::string &linesTokinzedString)
|
||||
{
|
||||
std::list<std::string> stringHolder;
|
||||
std::string temp;
|
||||
calendarCourse * cTemp = NULL;
|
||||
char* tok;
|
||||
char* textToTok = strdup(linesTokinzedString.c_str());
|
||||
tok = strtok(textToTok,"\n");
|
||||
while (tok != NULL)
|
||||
{
|
||||
temp = tok;
|
||||
stringHolder.push_back(temp);
|
||||
tok = strtok(NULL, "\n");
|
||||
}
|
||||
for(std::string temp: stringHolder)
|
||||
{
|
||||
cTemp = lineToCourse(temp);
|
||||
if (cTemp != NULL)
|
||||
courses->push_back(cTemp);
|
||||
}
|
||||
}
|
||||
|
||||
calendarCourse *CalendarPage::lineToCourse(std::string line)
|
||||
{
|
||||
|
||||
calendarCourse *tempC = NULL;
|
||||
std::string templinearray[CALENDAR_COURSE_FIELDS];//[serial,name,type,lecturer,points,semesterhours,dayandhours,room]
|
||||
int serial;
|
||||
double points,semesterHours;
|
||||
std::string name,type, lecturer,dayAndHour,room;
|
||||
std::string tempS = "";
|
||||
std::string emptyTab = " ";
|
||||
int i = 0;
|
||||
char* tok;
|
||||
char* cLine = strdup(line.c_str());
|
||||
tok = strtok(cLine, "\t");
|
||||
while(tok != NULL)
|
||||
{
|
||||
|
||||
tempS = tok;
|
||||
if (i>=1)
|
||||
templinearray[i-1] = tempS;
|
||||
i++;
|
||||
if (i > 8)
|
||||
break;
|
||||
tok=strtok(NULL, "\t");
|
||||
}
|
||||
if (templinearray[0] == "") //empty phrasing
|
||||
return NULL;
|
||||
serial = stoi(templinearray[calendarCourse::CourseScheme::SERIAL]);
|
||||
name = templinearray[calendarCourse::CourseScheme::NAME];
|
||||
type = templinearray[calendarCourse::CourseScheme::TYPE];
|
||||
lecturer = templinearray[calendarCourse::CourseScheme::LECTURER];
|
||||
|
||||
if (templinearray[calendarCourse::CourseScheme::POINTS].compare(" ") == 0)
|
||||
points = stod(templinearray[calendarCourse::CourseScheme::POINTS]);
|
||||
else
|
||||
points = 0;
|
||||
if (templinearray[calendarCourse::CourseScheme::SEM_HOURS].compare(" ") == 0)
|
||||
semesterHours = stod(templinearray[calendarCourse::CourseScheme::SEM_HOURS]);
|
||||
else
|
||||
semesterHours = 0;
|
||||
dayAndHour = templinearray[calendarCourse::CourseScheme::DAY_AND_HOURS];
|
||||
room = templinearray[calendarCourse::CourseScheme::ROOM];
|
||||
|
||||
|
||||
tempC = new calendarCourse(serial,name,type,lecturer,points,semesterHours,dayAndHour,room);
|
||||
|
||||
return tempC;
|
||||
}
|
||||
#include "calendarPage.h"
|
||||
|
||||
std::string CalendarPage::htmlToString()
|
||||
{
|
||||
return tempHtml;
|
||||
}
|
||||
|
||||
void CalendarPage::setPage(std::string html)
|
||||
{
|
||||
|
||||
courses = new std::list<calendarCourse*>();
|
||||
tempHtml = getString(html);
|
||||
tempHtml = tokenToLines(tempHtml);
|
||||
calendarListInit(tempHtml);
|
||||
|
||||
}
|
||||
|
||||
std::string CalendarPage::tokenToLines(std::string &textToPhrase)
|
||||
{
|
||||
int ctr = 0;
|
||||
std::string temp = "";
|
||||
char *tok;
|
||||
char* textToTok = strdup(textToPhrase.c_str());
|
||||
tok = strtok(textToTok, "\n");
|
||||
while(tok != NULL)
|
||||
{
|
||||
//amount of data before the actual needed data and no empty lines
|
||||
if (strcmp(tok," \t ") != 0)
|
||||
{
|
||||
temp += tok;
|
||||
temp += "\n";
|
||||
}
|
||||
ctr++;
|
||||
tok = strtok(NULL, "\n");
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
||||
void CalendarPage::calendarListInit(std::string &linesTokinzedString)
|
||||
{
|
||||
std::list<std::string> stringHolder;
|
||||
std::string temp;
|
||||
calendarCourse * cTemp = NULL;
|
||||
char* tok;
|
||||
char* textToTok = strdup(linesTokinzedString.c_str());
|
||||
tok = strtok(textToTok,"\n");
|
||||
while (tok != NULL)
|
||||
{
|
||||
temp = tok;
|
||||
stringHolder.push_back(temp);
|
||||
tok = strtok(NULL, "\n");
|
||||
}
|
||||
for(std::string temp: stringHolder)
|
||||
{
|
||||
cTemp = lineToCourse(temp);
|
||||
if (cTemp != NULL)
|
||||
courses->push_back(cTemp);
|
||||
}
|
||||
}
|
||||
|
||||
calendarCourse *CalendarPage::lineToCourse(std::string line)
|
||||
{
|
||||
|
||||
calendarCourse *tempC = NULL;
|
||||
std::string templinearray[CALENDAR_COURSE_FIELDS];//[serial,name,type,lecturer,points,semesterhours,dayandhours,room]
|
||||
int serial;
|
||||
double points,semesterHours;
|
||||
std::string name,type, lecturer,dayAndHour,room;
|
||||
std::string tempS = "";
|
||||
std::string emptyTab = " ";
|
||||
int i = 0;
|
||||
char* tok;
|
||||
char* cLine = strdup(line.c_str());
|
||||
tok = strtok(cLine, "\t");
|
||||
while(tok != NULL)
|
||||
{
|
||||
|
||||
tempS = tok;
|
||||
if (i>=1)
|
||||
templinearray[i-1] = tempS;
|
||||
i++;
|
||||
if (i > 8)
|
||||
break;
|
||||
tok=strtok(NULL, "\t");
|
||||
}
|
||||
if (templinearray[0] == "") //empty phrasing
|
||||
return NULL;
|
||||
serial = stoi(templinearray[calendarCourse::CourseScheme::SERIAL]);
|
||||
name = templinearray[calendarCourse::CourseScheme::NAME];
|
||||
type = templinearray[calendarCourse::CourseScheme::TYPE];
|
||||
lecturer = templinearray[calendarCourse::CourseScheme::LECTURER];
|
||||
|
||||
if (templinearray[calendarCourse::CourseScheme::POINTS].compare(" ") == 0)
|
||||
points = stod(templinearray[calendarCourse::CourseScheme::POINTS]);
|
||||
else
|
||||
points = 0;
|
||||
if (templinearray[calendarCourse::CourseScheme::SEM_HOURS].compare(" ") == 0)
|
||||
semesterHours = stod(templinearray[calendarCourse::CourseScheme::SEM_HOURS]);
|
||||
else
|
||||
semesterHours = 0;
|
||||
dayAndHour = templinearray[calendarCourse::CourseScheme::DAY_AND_HOURS];
|
||||
room = templinearray[calendarCourse::CourseScheme::ROOM];
|
||||
|
||||
|
||||
tempC = new calendarCourse(serial,name,type,lecturer,points,semesterHours,dayAndHour,room);
|
||||
|
||||
return tempC;
|
||||
}
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
#ifndef CALENDARPAGE_H
|
||||
#define CALENDARPAGE_H
|
||||
|
||||
#include "../page.h"
|
||||
#include "calendarCourse.h"
|
||||
#include <list>
|
||||
#include <string.h> //strlen and strtok to phrase the html file
|
||||
#include <ctype.h> //checks if character is numeric
|
||||
|
||||
class CalendarPage : public Page
|
||||
{
|
||||
public:
|
||||
|
||||
std::string htmlToString();
|
||||
std::list<calendarCourse*>* getCourses() { return courses; }
|
||||
|
||||
|
||||
protected:
|
||||
virtual void setPage(std::string html);
|
||||
CalendarPage() { }
|
||||
|
||||
|
||||
private:
|
||||
std::string tokenToLines(std::string& textToPhrase);
|
||||
void calendarListInit(std::string& linesTokinzedString);
|
||||
calendarCourse* lineToCourse(std::string line);
|
||||
|
||||
std::string tempHtml;
|
||||
std::list<calendarCourse*>* courses;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // CALENDARPAGE_H
|
||||
#ifndef CALENDARPAGE_H
|
||||
#define CALENDARPAGE_H
|
||||
|
||||
#include "../page.h"
|
||||
#include "calendarCourse.h"
|
||||
#include <list>
|
||||
#include <string.h> //strlen and strtok to phrase the html file
|
||||
#include <ctype.h> //checks if character is numeric
|
||||
|
||||
class CalendarPage : public Page
|
||||
{
|
||||
public:
|
||||
|
||||
std::string htmlToString();
|
||||
std::list<calendarCourse*>* getCourses() { return courses; }
|
||||
|
||||
|
||||
protected:
|
||||
virtual void setPage(std::string html);
|
||||
CalendarPage() { }
|
||||
|
||||
|
||||
private:
|
||||
std::string tokenToLines(std::string& textToPhrase);
|
||||
void calendarListInit(std::string& linesTokinzedString);
|
||||
calendarCourse* lineToCourse(std::string line);
|
||||
|
||||
std::string tempHtml;
|
||||
std::list<calendarCourse*>* courses;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // CALENDARPAGE_H
|
||||
|
|
|
@ -1,79 +1,79 @@
|
|||
#include "calendardialog.h"
|
||||
#include "ui_calendardialog.h"
|
||||
|
||||
|
||||
CalendarDialog::CalendarDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::CalendarDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
changeLabeStatusIcon(true);//be default the dates are ok, i Updated it according to jce official dates
|
||||
this->isOK = true;
|
||||
}
|
||||
|
||||
CalendarDialog::~CalendarDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
QDate CalendarDialog::getStartDate()
|
||||
{
|
||||
return ui->calStart->selectedDate();
|
||||
}
|
||||
|
||||
QDate CalendarDialog::getEndDate()
|
||||
{
|
||||
return ui->calEnd->selectedDate();
|
||||
}
|
||||
|
||||
bool CalendarDialog::ok()
|
||||
{
|
||||
return this->isOK;
|
||||
}
|
||||
void CalendarDialog::on_calStart_selectionChanged()
|
||||
{
|
||||
if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate())
|
||||
{
|
||||
changeLabeStatusIcon(false);
|
||||
ui->lbl_status->setText(tr("The End of the semester can NOT be equal or before semester begins."));
|
||||
this->isOK = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
changeLabeStatusIcon(true);
|
||||
ui->lbl_status->setText(tr("Looks ok, Press OK"));
|
||||
this->isOK = true;
|
||||
}
|
||||
}
|
||||
|
||||
void CalendarDialog::on_buttonBox_accepted()
|
||||
{
|
||||
if(ui->calStart->selectedDate() > ui->calEnd->selectedDate())
|
||||
qDebug() << "start bigger than end!";
|
||||
}
|
||||
|
||||
void CalendarDialog::on_calEnd_selectionChanged()
|
||||
{
|
||||
if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate())
|
||||
{
|
||||
changeLabeStatusIcon(false);
|
||||
ui->lbl_status->setText(tr("The End of the semester can NOT be equal or before semester begins."));
|
||||
this->isOK = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
changeLabeStatusIcon(true);
|
||||
ui->lbl_status->setText(tr("Looks ok, Press OK"));
|
||||
this->isOK = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CalendarDialog::changeLabeStatusIcon(bool goodOrBad)
|
||||
{
|
||||
if (goodOrBad == true) //good date!
|
||||
iconPixStatus.load(":/icons/iconV.png");
|
||||
else
|
||||
iconPixStatus.load(":/icons/iconX.png");
|
||||
this->ui->labelIconStatus->setPixmap(iconPixStatus);
|
||||
}
|
||||
#include "calendardialog.h"
|
||||
#include "ui_calendardialog.h"
|
||||
|
||||
|
||||
CalendarDialog::CalendarDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::CalendarDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
changeLabeStatusIcon(true);//be default the dates are ok, i Updated it according to jce official dates
|
||||
this->isOK = true;
|
||||
}
|
||||
|
||||
CalendarDialog::~CalendarDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
QDate CalendarDialog::getStartDate()
|
||||
{
|
||||
return ui->calStart->selectedDate();
|
||||
}
|
||||
|
||||
QDate CalendarDialog::getEndDate()
|
||||
{
|
||||
return ui->calEnd->selectedDate();
|
||||
}
|
||||
|
||||
bool CalendarDialog::ok()
|
||||
{
|
||||
return this->isOK;
|
||||
}
|
||||
void CalendarDialog::on_calStart_selectionChanged()
|
||||
{
|
||||
if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate())
|
||||
{
|
||||
changeLabeStatusIcon(false);
|
||||
ui->lbl_status->setText(tr("The End of the semester can NOT be equal or before semester begins."));
|
||||
this->isOK = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
changeLabeStatusIcon(true);
|
||||
ui->lbl_status->setText(tr("Looks ok, Press OK"));
|
||||
this->isOK = true;
|
||||
}
|
||||
}
|
||||
|
||||
void CalendarDialog::on_buttonBox_accepted()
|
||||
{
|
||||
if(ui->calStart->selectedDate() > ui->calEnd->selectedDate())
|
||||
qDebug() << "start bigger than end!";
|
||||
}
|
||||
|
||||
void CalendarDialog::on_calEnd_selectionChanged()
|
||||
{
|
||||
if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate())
|
||||
{
|
||||
changeLabeStatusIcon(false);
|
||||
ui->lbl_status->setText(tr("The End of the semester can NOT be equal or before semester begins."));
|
||||
this->isOK = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
changeLabeStatusIcon(true);
|
||||
ui->lbl_status->setText(tr("Looks ok, Press OK"));
|
||||
this->isOK = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CalendarDialog::changeLabeStatusIcon(bool goodOrBad)
|
||||
{
|
||||
if (goodOrBad == true) //good date!
|
||||
iconPixStatus.load(":/icons/iconV.png");
|
||||
else
|
||||
iconPixStatus.load(":/icons/iconX.png");
|
||||
this->ui->labelIconStatus->setPixmap(iconPixStatus);
|
||||
}
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
#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();
|
||||
bool ok();
|
||||
|
||||
private slots:
|
||||
void on_calStart_selectionChanged();
|
||||
void on_calEnd_selectionChanged();
|
||||
void on_buttonBox_accepted();
|
||||
|
||||
private:
|
||||
void changeLabeStatusIcon(bool goodOrBad);
|
||||
Ui::CalendarDialog *ui;
|
||||
bool isOK;
|
||||
QPixmap iconPixStatus;
|
||||
};
|
||||
|
||||
#endif // CALENDARDIALOG_H
|
||||
#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();
|
||||
bool ok();
|
||||
|
||||
private slots:
|
||||
void on_calStart_selectionChanged();
|
||||
void on_calEnd_selectionChanged();
|
||||
void on_buttonBox_accepted();
|
||||
|
||||
private:
|
||||
void changeLabeStatusIcon(bool goodOrBad);
|
||||
Ui::CalendarDialog *ui;
|
||||
bool isOK;
|
||||
QPixmap iconPixStatus;
|
||||
};
|
||||
|
||||
#endif // CALENDARDIALOG_H
|
||||
|
|
|
@ -1,210 +1,210 @@
|
|||
<?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>577</width>
|
||||
<height>268</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>551</width>
|
||||
<height>235</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string><body><p><span style=" font-size:9pt; font-weight:600;">The dates were chosen according to JCE General Academic Calendar for the first semester</span></p></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="labelSemesterStart">
|
||||
<property name="text">
|
||||
<string>Semester Starts At:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelSemesterEnd">
|
||||
<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">
|
||||
<property name="locale">
|
||||
<locale language="Hebrew" country="Israel"/>
|
||||
</property>
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::ImhNone</set>
|
||||
</property>
|
||||
<property name="selectedDate">
|
||||
<date>
|
||||
<year>2014</year>
|
||||
<month>10</month>
|
||||
<day>26</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="minimumDate">
|
||||
<date>
|
||||
<year>2000</year>
|
||||
<month>9</month>
|
||||
<day>14</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="maximumDate">
|
||||
<date>
|
||||
<year>2080</year>
|
||||
<month>12</month>
|
||||
<day>31</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="gridVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="verticalHeaderFormat">
|
||||
<enum>QCalendarWidget::NoVerticalHeader</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCalendarWidget" name="calEnd">
|
||||
<property name="selectedDate">
|
||||
<date>
|
||||
<year>2015</year>
|
||||
<month>2</month>
|
||||
<day>1</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="minimumDate">
|
||||
<date>
|
||||
<year>2000</year>
|
||||
<month>9</month>
|
||||
<day>14</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="maximumDate">
|
||||
<date>
|
||||
<year>2080</year>
|
||||
<month>12</month>
|
||||
<day>31</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="gridVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="verticalHeaderFormat">
|
||||
<enum>QCalendarWidget::NoVerticalHeader</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelIconStatus">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbl_status">
|
||||
<property name="text">
|
||||
<string><b>Please chose your dates correctly</b></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</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>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</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>
|
||||
<?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>577</width>
|
||||
<height>268</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>551</width>
|
||||
<height>235</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string><body><p><span style=" font-size:9pt; font-weight:600;">The dates were chosen according to JCE General Academic Calendar for the first semester</span></p></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="labelSemesterStart">
|
||||
<property name="text">
|
||||
<string>Semester Starts At:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelSemesterEnd">
|
||||
<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">
|
||||
<property name="locale">
|
||||
<locale language="Hebrew" country="Israel"/>
|
||||
</property>
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::ImhNone</set>
|
||||
</property>
|
||||
<property name="selectedDate">
|
||||
<date>
|
||||
<year>2014</year>
|
||||
<month>10</month>
|
||||
<day>26</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="minimumDate">
|
||||
<date>
|
||||
<year>2000</year>
|
||||
<month>9</month>
|
||||
<day>14</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="maximumDate">
|
||||
<date>
|
||||
<year>2080</year>
|
||||
<month>12</month>
|
||||
<day>31</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="gridVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="verticalHeaderFormat">
|
||||
<enum>QCalendarWidget::NoVerticalHeader</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCalendarWidget" name="calEnd">
|
||||
<property name="selectedDate">
|
||||
<date>
|
||||
<year>2015</year>
|
||||
<month>2</month>
|
||||
<day>1</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="minimumDate">
|
||||
<date>
|
||||
<year>2000</year>
|
||||
<month>9</month>
|
||||
<day>14</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="maximumDate">
|
||||
<date>
|
||||
<year>2080</year>
|
||||
<month>12</month>
|
||||
<day>31</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="gridVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="verticalHeaderFormat">
|
||||
<enum>QCalendarWidget::NoVerticalHeader</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelIconStatus">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbl_status">
|
||||
<property name="text">
|
||||
<string><b>Please chose your dates correctly</b></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</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>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</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>
|
||||
|
|
Loading…
Reference in a new issue