42
jceGrade.pro
|
@ -4,12 +4,13 @@
|
||||||
#
|
#
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
|
|
||||||
QT += core gui network widgets
|
QT += core gui network widgets printsupport
|
||||||
|
|
||||||
CONFIG += qt c++11
|
CONFIG += qt c++11
|
||||||
|
#CONFIG-=app_bundle
|
||||||
|
|
||||||
TARGET = jceManager
|
TARGET = jceManager
|
||||||
VERSION = 1.0.0
|
VERSION = 1.1.0
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
|
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
|
||||||
|
|
||||||
|
@ -25,7 +26,9 @@ TRANSLATIONS = jce_en.ts \
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
main/mainscreen.ui \
|
main/mainscreen.ui \
|
||||||
src/jceData/Calendar/calendarDialog.ui
|
src/jceData/Grades/graph/gradegraph.ui \
|
||||||
|
src/jceData/Calendar/Exams/examDialog.ui \
|
||||||
|
src/jceData/Calendar/coursesSchedule/calendarDialog.ui
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
resources/connectionstatus.qrc
|
resources/connectionstatus.qrc
|
||||||
|
@ -37,7 +40,6 @@ HEADERS += \
|
||||||
main/mainscreen.h \
|
main/mainscreen.h \
|
||||||
src/appDatabase/savedata.h \
|
src/appDatabase/savedata.h \
|
||||||
src/jceConnection/jcesslclient.h \
|
src/jceConnection/jcesslclient.h \
|
||||||
src/jceData/Calendar/calendarPage.h \
|
|
||||||
src/jceData/Grades/gradeCourse.h \
|
src/jceData/Grades/gradeCourse.h \
|
||||||
src/jceData/Grades/gradePage.h \
|
src/jceData/Grades/gradePage.h \
|
||||||
src/jceData/course.h \
|
src/jceData/course.h \
|
||||||
|
@ -45,12 +47,19 @@ HEADERS += \
|
||||||
src/jceSettings/jcelogin.h \
|
src/jceSettings/jcelogin.h \
|
||||||
src/jceSettings/jceLoginHtmlScripts.h \
|
src/jceSettings/jceLoginHtmlScripts.h \
|
||||||
src/jceSettings/user.h \
|
src/jceSettings/user.h \
|
||||||
src/jceData/Calendar/calendarCourse.h \
|
|
||||||
src/jceData/Calendar/calendarSchedule.h \
|
|
||||||
src/jceData/CSV/csv_exporter.h \
|
src/jceData/CSV/csv_exporter.h \
|
||||||
src/appDatabase/simplecrypt.h \
|
src/appDatabase/simplecrypt.h \
|
||||||
src/jceData/Calendar/calendarDialog.h \
|
src/appDatabase/jce_logger.h \
|
||||||
src/appDatabase/jce_logger.h
|
src/jceData/Grades/graph/qcustomplot.h \
|
||||||
|
src/jceData/Grades/graph/gradegraph.h \
|
||||||
|
src/jceData/Calendar/Exams/examDialog.h \
|
||||||
|
src/jceData/Calendar/Exams/calendarExam.h \
|
||||||
|
src/jceData/Calendar/Exams/calendarExamCourse.h \
|
||||||
|
src/jceData/Calendar/coursesSchedule/calendarDialog.h \
|
||||||
|
src/jceData/Calendar/coursesSchedule/calendarPage.h \
|
||||||
|
src/jceData/Calendar/coursesSchedule/calendarPageCourse.h \
|
||||||
|
src/jceData/Calendar/coursesSchedule/calendarSchedule.h \
|
||||||
|
main/jceWidgets/jcestatusbar.h
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
main/CalendarTab/CalendarManager.cpp \
|
main/CalendarTab/CalendarManager.cpp \
|
||||||
|
@ -60,15 +69,22 @@ SOURCES += \
|
||||||
main/mainscreen.cpp \
|
main/mainscreen.cpp \
|
||||||
src/appDatabase/savedata.cpp \
|
src/appDatabase/savedata.cpp \
|
||||||
src/jceConnection/jcesslclient.cpp \
|
src/jceConnection/jcesslclient.cpp \
|
||||||
src/jceData/Calendar/calendarPage.cpp \
|
|
||||||
src/jceData/Grades/gradeCourse.cpp \
|
src/jceData/Grades/gradeCourse.cpp \
|
||||||
src/jceData/Grades/gradePage.cpp \
|
src/jceData/Grades/gradePage.cpp \
|
||||||
src/jceData/page.cpp \
|
src/jceData/page.cpp \
|
||||||
src/jceSettings/jcelogin.cpp \
|
src/jceSettings/jcelogin.cpp \
|
||||||
src/jceSettings/user.cpp \
|
src/jceSettings/user.cpp \
|
||||||
src/jceData/Calendar/calendarCourse.cpp \
|
|
||||||
src/jceData/Calendar/calendarSchedule.cpp \
|
|
||||||
src/jceData/CSV/csv_exporter.cpp \
|
src/jceData/CSV/csv_exporter.cpp \
|
||||||
src/appDatabase/simplecrypt.cpp \
|
src/appDatabase/simplecrypt.cpp \
|
||||||
src/jceData/Calendar/calendarDialog.cpp \
|
src/appDatabase/jce_logger.cpp \
|
||||||
src/appDatabase/jce_logger.cpp
|
src/jceData/Grades/graph/qcustomplot.cpp \
|
||||||
|
src/jceData/Grades/graph/gradegraph.cpp \
|
||||||
|
src/jceData/Calendar/Exams/examDialog.cpp \
|
||||||
|
src/jceData/Calendar/Exams/calendarExam.cpp \
|
||||||
|
src/jceData/Calendar/Exams/calendarExamCourse.cpp \
|
||||||
|
src/jceData/Calendar/coursesSchedule/calendarDialog.cpp \
|
||||||
|
src/jceData/Calendar/coursesSchedule/calendarPage.cpp \
|
||||||
|
src/jceData/Calendar/coursesSchedule/calendarPageCourse.cpp \
|
||||||
|
src/jceData/Calendar/coursesSchedule/calendarSchedule.cpp \
|
||||||
|
main/jceWidgets/jcestatusbar.cpp
|
||||||
|
|
||||||
|
|
BIN
jce_en.qm
595
jce_en.ts
|
@ -1,43 +1,57 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE TS>
|
<!DOCTYPE TS>
|
||||||
<TS version="2.0" language="en_US">
|
<TS version="2.1" language="en_US">
|
||||||
<context>
|
<context>
|
||||||
<name>CalendarDialog</name>
|
<name>CalendarDialog</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceData/Calendar/calendarDialog.ui" line="14"/>
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarDialog.ui" line="26"/>
|
||||||
<source>Dates Dialog</source>
|
<source>Dates Dialog</source>
|
||||||
<oldsource>Dialog</oldsource>
|
<oldsource>Dialog</oldsource>
|
||||||
<translation>Dates Dialog</translation>
|
<translation>Dates Dialog</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceData/Calendar/calendarDialog.ui" line="29"/>
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarDialog.ui" line="34"/>
|
||||||
<source><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></source>
|
<source><html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:600;">Schedule Exportation</span></p></body></html></source>
|
||||||
<translation><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></translation>
|
<translation><html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:600;">Schedule Exportation</span></p></body></html></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceData/Calendar/calendarDialog.ui" line="42"/>
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarDialog.ui" line="45"/>
|
||||||
<source>Semester Starts At:</source>
|
<source><html><head/><body><p align="center">Semester Starts At:</p></body></html></source>
|
||||||
<translation><b>Semester Starts At:</translation>
|
<translation><html><head/><body><p align="center">Semester Starts At:</p></body></html></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceData/Calendar/calendarDialog.ui" line="49"/>
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarDialog.ui" line="96"/>
|
||||||
<source>Semester Ends At:</source>
|
<source><html><head/><body><p align="center">Semester Ends At:</p></body></html></source>
|
||||||
<translation><b>Semester Ends At:</translation>
|
<translation><html><head/><body><p align="center">Semester Ends At:</p></body></html></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceData/Calendar/calendarDialog.ui" line="141"/>
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarDialog.ui" line="144"/>
|
||||||
|
<source><html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:600;">The dates were chosen according to JCE General Academic Calendar for the first semester</span></p></body></html></source>
|
||||||
|
<translation><html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:600;">The dates were chosen according to JCE General Academic Calendar for the first semester</span></p></body></html></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarDialog.ui" line="189"/>
|
||||||
|
<source>Include Exams</source>
|
||||||
|
<translation>Include Exams</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarDialog.ui" line="169"/>
|
||||||
<source><b>Please chose your dates correctly</b></source>
|
<source><b>Please chose your dates correctly</b></source>
|
||||||
<translation><b>Please chose your dates correctly</b></translation>
|
<translation><b>Please chose your dates correctly</b></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceData/Calendar/calendarDialog.cpp" line="38"/>
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarDialog.cpp" line="48"/>
|
||||||
<location filename="src/jceData/Calendar/calendarDialog.cpp" line="60"/>
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarDialog.cpp" line="74"/>
|
||||||
<source>The end of the semester can NOT be equal or before the semester begin.</source>
|
<source>Invalid dates interval</source>
|
||||||
<translation>The end of the semester can NOT be equal or before the semester begin.</translation>
|
<translation>Invalid dates interval</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceData/Calendar/calendarDialog.cpp" line="44"/>
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarDialog.cpp" line="55"/>
|
||||||
<location filename="src/jceData/Calendar/calendarDialog.cpp" line="66"/>
|
<source>Looks fine, Click "OK"</source>
|
||||||
|
<translation>Looks fine, Click "OK"</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarDialog.cpp" line="81"/>
|
||||||
<source>Looks ok, Press OK</source>
|
<source>Looks ok, Press OK</source>
|
||||||
<translation>Looks ok, Press OK</translation>
|
<translation>Looks ok, Press OK</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -50,250 +64,246 @@
|
||||||
<translation>JCE Manager</translation>
|
<translation>JCE Manager</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.ui" line="86"/>
|
<location filename="main/mainscreen.ui" line="89"/>
|
||||||
<location filename="main/mainscreen.ui" line="178"/>
|
<location filename="main/mainscreen.ui" line="183"/>
|
||||||
<source>Login</source>
|
<source>Login</source>
|
||||||
<translation>Login</translation>
|
<translation>Login</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.ui" line="162"/>
|
<location filename="main/mainscreen.ui" line="164"/>
|
||||||
<source>Keep login</source>
|
<source>Keep login</source>
|
||||||
<translation>Keep login</translation>
|
<translation>Keep login</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.ui" line="240"/>
|
<location filename="main/mainscreen.ui" line="251"/>
|
||||||
<source>Username</source>
|
<source>Username</source>
|
||||||
<translation>Username</translation>
|
<translation>Username</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.ui" line="281"/>
|
<location filename="main/mainscreen.ui" line="292"/>
|
||||||
<source>Password</source>
|
<source>Password</source>
|
||||||
<translation>Password</translation>
|
<translation>Password</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.ui" line="314"/>
|
<location filename="main/mainscreen.ui" line="325"/>
|
||||||
<source>GPA</source>
|
<source>GPA</source>
|
||||||
<translation>GPA</translation>
|
<translation>GPA</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.ui" line="351"/>
|
<location filename="main/mainscreen.ui" line="551"/>
|
||||||
<source><html><head/><body><p><span style=" font-weight:600;">Get your grades</span></p></body></html></source>
|
<source><html><head/><body><p><span style=" font-weight:600;">Get your grades</span></p></body></html></source>
|
||||||
<translation><html><head/><body><p><span style=" font-weight:600;">Get your grades</span></p></body></html></translation>
|
<translation><html><head/><body><p><span style=" font-weight:600;">Get your grades</span></p></body></html></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.ui" line="354"/>
|
<location filename="main/mainscreen.ui" line="532"/>
|
||||||
<source>Add</source>
|
|
||||||
<translation>Add</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="main/mainscreen.ui" line="361"/>
|
|
||||||
<source><html><head/><body><p><span style=" font-weight:600;">Clear table</span></p></body></html></source>
|
<source><html><head/><body><p><span style=" font-weight:600;">Clear table</span></p></body></html></source>
|
||||||
<translation><html><head/><body><p><span style=" font-weight:600;">Clear table</span></p></body></html></translation>
|
<translation><html><head/><body><p><span style=" font-weight:600;">Clear table</span></p></body></html></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.ui" line="364"/>
|
<location filename="main/mainscreen.ui" line="784"/>
|
||||||
<source>Clear</source>
|
|
||||||
<translation>Clear</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="main/mainscreen.ui" line="388"/>
|
|
||||||
<source>Average:</source>
|
<source>Average:</source>
|
||||||
<translation>Average:</translation>
|
<translation>Average:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.ui" line="426"/>
|
<location filename="main/mainscreen.ui" line="611"/>
|
||||||
<source>Only Main Courses</source>
|
<source>Only Main Courses</source>
|
||||||
<translation>Only Main Courses</translation>
|
<translation>Only Main Courses</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.ui" line="439"/>
|
<location filename="main/mainscreen.ui" line="425"/>
|
||||||
<source>From</source>
|
<location filename="main/mainscreen.ui" line="691"/>
|
||||||
<translation><b>From</b></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="main/mainscreen.ui" line="446"/>
|
|
||||||
<location filename="main/mainscreen.ui" line="512"/>
|
|
||||||
<source>Year:</source>
|
<source>Year:</source>
|
||||||
<translation>Year:</translation>
|
<translation>Year:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.ui" line="466"/>
|
<location filename="main/mainscreen.ui" line="396"/>
|
||||||
|
<location filename="main/mainscreen.ui" line="720"/>
|
||||||
<source>Semester:</source>
|
<source>Semester:</source>
|
||||||
<translation>Semester:</translation>
|
<translation>Semester:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.ui" line="505"/>
|
<location filename="main/mainscreen.ui" line="897"/>
|
||||||
<source>To</source>
|
|
||||||
<translation><b>To</b></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="main/mainscreen.ui" line="532"/>
|
|
||||||
<source>Semester</source>
|
|
||||||
<translation>Semester</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="main/mainscreen.ui" line="557"/>
|
|
||||||
<source>Calendar</source>
|
|
||||||
<translation>Calendar</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="main/mainscreen.ui" line="595"/>
|
|
||||||
<source>Get Calendar</source>
|
|
||||||
<translation>Get Calendar</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="main/mainscreen.ui" line="602"/>
|
|
||||||
<source>Export to CSV</source>
|
<source>Export to CSV</source>
|
||||||
<translation>Export to .CSV</translation>
|
<translation>Export to .CSV</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.ui" line="632"/>
|
<location filename="main/mainscreen.ui" line="927"/>
|
||||||
<source><p align="center">Made By <a href="http://liranbg.github.io/JceManager/"><span style=" text-decoration: underline; color:#0000ff;">JceManager</span></a></p></source>
|
<source><p align="center">Made By <a href="http://liranbg.github.io/JceManager/"><span style=" text-decoration: underline; color:#0000ff;">JceManager</span></a></p></source>
|
||||||
<oldsource><p align="right">Made By <a href="http://liranbg.github.io/JceManager/"><span style=" text-decoration: underline; color:#0000ff;">JceManager</span></a></p></oldsource>
|
<oldsource><p align="right">Made By <a href="http://liranbg.github.io/JceManager/"><span style=" text-decoration: underline; color:#0000ff;">JceManager</span></a></p></oldsource>
|
||||||
<translation><p align="center">Made By <a href="http://liranbg.github.io/JceManager/"><span style=" text-decoration: underline; color:#0000ff;">JceManager</span></a></p></translation>
|
<translation><p align="center">Made By <a href="http://liranbg.github.io/JceManager/"><span style=" text-decoration: underline; color:#0000ff;">JceManager</span></a></p></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.ui" line="649"/>
|
<location filename="main/mainscreen.ui" line="456"/>
|
||||||
<source>&File</source>
|
<source><html><head/><body><p align="center">To</p></body></html></source>
|
||||||
<translation>&File</translation>
|
<translation><html><head/><body><p align="center">To</p></body></html></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.ui" line="653"/>
|
<location filename="main/mainscreen.ui" line="177"/>
|
||||||
|
<source>login</source>
|
||||||
|
<translation>login</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/mainscreen.ui" line="535"/>
|
||||||
|
<source>Clear Table</source>
|
||||||
|
<translation>Clear Table</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/mainscreen.ui" line="554"/>
|
||||||
|
<source>Get GPA</source>
|
||||||
|
<translation>Get GPA</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/mainscreen.ui" line="570"/>
|
||||||
|
<source>Revert Changes</source>
|
||||||
|
<translation>Revert Changes</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/mainscreen.ui" line="748"/>
|
||||||
|
<source><html><head/><body><p align="center">From</p></body></html></source>
|
||||||
|
<translation><html><head/><body><p align="center">From</p></body></html></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/mainscreen.ui" line="777"/>
|
||||||
|
<source>Graph View</source>
|
||||||
|
<translation>Graph View</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/mainscreen.ui" line="845"/>
|
||||||
|
<source>Schedule</source>
|
||||||
|
<translation>Schedule</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/mainscreen.ui" line="883"/>
|
||||||
|
<source>Get Schedule && Exam</source>
|
||||||
|
<translation>Get Schedule && Exam</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/mainscreen.ui" line="890"/>
|
||||||
|
<source>Show Exams</source>
|
||||||
|
<translation>Show Exams</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/mainscreen.ui" line="988"/>
|
||||||
|
<location filename="main/mainscreen.ui" line="1036"/>
|
||||||
|
<source>Team Credit</source>
|
||||||
|
<translation>Team Credit</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/mainscreen.ui" line="1198"/>
|
||||||
|
<location filename="main/mainscreen.ui" line="1249"/>
|
||||||
|
<source>Help</source>
|
||||||
|
<translation>Help</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/mainscreen.ui" line="1090"/>
|
||||||
|
<location filename="main/mainscreen.ui" line="1138"/>
|
||||||
<source>Language</source>
|
<source>Language</source>
|
||||||
<translation>Language</translation>
|
<translation>Language</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.ui" line="682"/>
|
<location filename="main/mainscreen.cpp" line="139"/>
|
||||||
<source>Credits</source>
|
<location filename="main/mainscreen.cpp" line="161"/>
|
||||||
<translation>Credits</translation>
|
<location filename="main/mainscreen.cpp" line="220"/>
|
||||||
</message>
|
<location filename="main/mainscreen.cpp" line="234"/>
|
||||||
<message>
|
<location filename="main/mainscreen.cpp" line="286"/>
|
||||||
<location filename="main/mainscreen.ui" line="687"/>
|
<location filename="main/mainscreen.cpp" line="296"/>
|
||||||
<source>Exit</source>
|
|
||||||
<translation>Exit</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="main/mainscreen.ui" line="695"/>
|
|
||||||
<source>Hebrew</source>
|
|
||||||
<translation>עברית</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="main/mainscreen.ui" line="703"/>
|
|
||||||
<source>English</source>
|
|
||||||
<translation>English</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="main/mainscreen.ui" line="711"/>
|
|
||||||
<source>OS Default</source>
|
|
||||||
<translation>OS Default</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="main/mainscreen.ui" line="716"/>
|
|
||||||
<source>How To</source>
|
|
||||||
<translation>How To</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="main/mainscreen.cpp" line="23"/>
|
|
||||||
<source>Ready</source>
|
|
||||||
<translation>Ready</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="main/mainscreen.cpp" line="136"/>
|
|
||||||
<location filename="main/mainscreen.cpp" line="157"/>
|
|
||||||
<location filename="main/mainscreen.cpp" line="212"/>
|
|
||||||
<location filename="main/mainscreen.cpp" line="242"/>
|
|
||||||
<source>Error</source>
|
<source>Error</source>
|
||||||
<translation>Error</translation>
|
<translation>Error</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="136"/>
|
<location filename="main/mainscreen.cpp" line="139"/>
|
||||||
<source>Invalid Dates.
|
<source>Invalid Dates.
|
||||||
Make Sure everything is correct and try again</source>
|
Make Sure everything is correct and try again</source>
|
||||||
<translation>Invalid dates. Make sure everything is correct and try again</translation>
|
<translation>Invalid dates. Make sure everything is correct and try again</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="157"/>
|
<location filename="main/mainscreen.cpp" line="161"/>
|
||||||
<location filename="main/mainscreen.cpp" line="242"/>
|
<location filename="main/mainscreen.cpp" line="286"/>
|
||||||
|
<location filename="main/mainscreen.cpp" line="296"/>
|
||||||
<source>Not Connected</source>
|
<source>Not Connected</source>
|
||||||
<translation>Not Connected</translation>
|
<translation>Not Connected</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="212"/>
|
<location filename="main/mainscreen.cpp" line="220"/>
|
||||||
<source>Missmatching data</source>
|
<source>Missmatching data</source>
|
||||||
<translation>Missmatching Data</translation>
|
<translation>Missmatching Data</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="264"/>
|
<location filename="main/mainscreen.cpp" line="411"/>
|
||||||
<source>License:</source>
|
<source>License:</source>
|
||||||
<translation>License:</translation>
|
<translation>License:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="269"/>
|
<location filename="main/mainscreen.cpp" line="416"/>
|
||||||
<source>Powered By: </source>
|
<source>Powered By: </source>
|
||||||
<oldsource>powered by: </oldsource>
|
<oldsource>powered by: </oldsource>
|
||||||
<translation>Powered By: </translation>
|
<translation>Powered By: </translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="271"/>
|
<location filename="main/mainscreen.cpp" line="418"/>
|
||||||
<source>Developed By</source>
|
<source>Developed By</source>
|
||||||
<translation>Developed By</translation>
|
<translation>Developed By</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="287"/>
|
<location filename="main/mainscreen.cpp" line="430"/>
|
||||||
<source>Help Guide</source>
|
<source>Help Guide</source>
|
||||||
<oldsource>Guide</oldsource>
|
<oldsource>Guide</oldsource>
|
||||||
<translation>Help Guide</translation>
|
<translation>Help Guide</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="273"/>
|
<location filename="main/mainscreen.cpp" line="420"/>
|
||||||
<source>Liran</source>
|
<source>Liran</source>
|
||||||
<translation>Liran Ben Gida</translation>
|
<translation>Liran Ben Gida</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="274"/>
|
<location filename="main/mainscreen.cpp" line="234"/>
|
||||||
|
<source>You must to load GPA first
|
||||||
|
Click on 'Get GPA'</source>
|
||||||
|
<translation>You must to load GPA first
|
||||||
|
Click on 'Get GPA'</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/mainscreen.cpp" line="421"/>
|
||||||
<source>Sagi</source>
|
<source>Sagi</source>
|
||||||
<translation>Sagi Dayan</translation>
|
<translation>Sagi Dayan</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="289"/>
|
<location filename="main/mainscreen.cpp" line="432"/>
|
||||||
<source><br><li>Login: <ul><li>Type your username and password and click Login.</li><li>Once you are connected, you will see a green ball in the right buttom panel.</li></ul></li></source>
|
<source><br><li>Login: <ul><li>Type your username and password and click Login.</li><li>Once you are connected, you will see a green ball in the right buttom panel.</li></ul></li></source>
|
||||||
<translation><br><li>Login: <ul><li>Type your username and password and click Login.</li><li>Once you are connected, you will see a green ball in the right buttom panel.</li></ul></li></translation>
|
<translation><br><li>Login: <ul><li>Type your username and password and click Login.</li><li>Once you are connected, you will see a green ball in the right buttom panel.</li></ul></li></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="290"/>
|
<location filename="main/mainscreen.cpp" line="433"/>
|
||||||
<source><br><li>Getting GPA sheet<ul><li>Click on GPA Tab</li><li> Select your dates and click on Add</li></ul></li></source>
|
<source><br><li>Getting GPA sheet<ul><li>Click on GPA Tab</li><li> Select your dates and click on Add</li></ul></li></source>
|
||||||
<translation><br><li>Getting GPA sheet<ul><li>Click on GPA Tab</li><li> Select your dates and click on Add</li></ul></li></translation>
|
<translation><br><li>Getting GPA sheet<ul><li>Click on GPA Tab</li><li> Select your dates and click on Add</li></ul></li></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="291"/>
|
<location filename="main/mainscreen.cpp" line="434"/>
|
||||||
<source><br><li>Average Changing<ul><li>Change one of your grade and see the average in the buttom panel changing.</li></ul></li></source>
|
<source><br><li>Average Changing<ul><li>Change one of your grade and see the average in the buttom panel changing.</li></ul></li></source>
|
||||||
<translation><br><li>Average Changing<ul><li>Change one of your grade and see the average in the buttom panel changing.</li></ul></li></translation>
|
<translation><br><li>Average Changing<ul><li>Change one of your grade and see the average in the buttom panel changing.</li></ul></li></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="292"/>
|
<location filename="main/mainscreen.cpp" line="435"/>
|
||||||
<source><br><li>Getting Calendar<ul><li>Click on Calendar Tab</li><li> Select your dates and click on Get Calendar</li></ul></li></source>
|
<source><br><li>Getting Calendar<ul><li>Click on Calendar Tab</li><li> Select your dates and click on Get Calendar</li></ul></li></source>
|
||||||
<translation><br><li>Getting Calendar<ul><li>Click on Calendar Tab</li><li> Select your dates and click on Get Calendar</li></ul></li></translation>
|
<translation><br><li>Getting Calendar<ul><li>Click on Calendar Tab</li><li> Select your dates and click on Get Calendar</li></ul></li></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="293"/>
|
<location filename="main/mainscreen.cpp" line="436"/>
|
||||||
<source><br><li>For exporting your calendar to a .CSV file:<ul><li>Do previous step and continue to next step</li><li> Click on Export to CSV</li><li>Select your dates and click OK</li><li>Once you're Done, go on your calendar and import your csv file</li></li></source>
|
<source><br><li>For exporting your calendar to a .CSV file:<ul><li>Do previous step and continue to next step</li><li> Click on Export to CSV</li><li>Select your dates and click OK</li><li>Once you're Done, go on your calendar and import your csv file</li></li></source>
|
||||||
<translation><br><li>For exporting your calendar to a .CSV file:<ul><li>Do previous step and continue to next step</li><li> Click on Export to CSV</li><li>Select your dates and click OK</li><li>Once you're Done, go on your calendar and import your csv file</li></li></translation>
|
<translation><br><li>For exporting your calendar to a .CSV file:<ul><li>Do previous step and continue to next step</li><li> Click on Export to CSV</li><li>Select your dates and click OK</li><li>Once you're Done, go on your calendar and import your csv file</li></li></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="295"/>
|
<location filename="main/mainscreen.cpp" line="438"/>
|
||||||
<source><b>For more information, please visit us at: <a href='http://liranbg.github.io/JceManager/'>Jce Manager site</a></b></source>
|
<source><b>For more information, please visit us at: <a href='http://liranbg.github.io/JceManager/'>Jce Manager site</a></b></source>
|
||||||
<translation><b>For more information, please visit us at: <a href='http://liranbg.github.io/JceManager/'>Jce Manager site</a></b></translation>
|
<translation><b>For more information, please visit us at: <a href='http://liranbg.github.io/JceManager/'>Jce Manager site</a></b></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="306"/>
|
<location filename="main/mainscreen.cpp" line="402"/>
|
||||||
<location filename="main/mainscreen.cpp" line="334"/>
|
|
||||||
<source>Settings</source>
|
<source>Settings</source>
|
||||||
<translation>Settings</translation>
|
<translation>Settings</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/mainscreen.cpp" line="306"/>
|
<location filename="main/mainscreen.cpp" line="402"/>
|
||||||
<location filename="main/mainscreen.cpp" line="320"/>
|
|
||||||
<location filename="main/mainscreen.cpp" line="334"/>
|
|
||||||
<source>Your settings will take effect next time you start the program</source>
|
<source>Your settings will take effect next time you start the program</source>
|
||||||
<translation>Your settings will take effect next time you start the program</translation>
|
<translation>Your settings will take effect next time you start the program</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -301,20 +311,15 @@ Make Sure everything is correct and try again</source>
|
||||||
<context>
|
<context>
|
||||||
<name>QObject</name>
|
<name>QObject</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/CalendarTab/CalendarManager.cpp" line="28"/>
|
<location filename="main/CalendarTab/CalendarManager.cpp" line="42"/>
|
||||||
<source>Exported Successfuly!</source>
|
<source>Exported Successfuly!</source>
|
||||||
<translation>Exported Successfuly!</translation>
|
<translation>Exported Successfuly!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/CalendarTab/CalendarManager.cpp" line="36"/>
|
<location filename="main/CalendarTab/CalendarManager.cpp" line="50"/>
|
||||||
<source>Dates not valid</source>
|
<source>Dates not valid</source>
|
||||||
<translation>Invalid Dates</translation>
|
<translation>Invalid Dates</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<location filename="main/CourseTab/coursestablemanager.cpp" line="15"/>
|
|
||||||
<source>Code</source>
|
|
||||||
<translation>Code</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/CourseTab/coursestablemanager.cpp" line="15"/>
|
<location filename="main/CourseTab/coursestablemanager.cpp" line="15"/>
|
||||||
<source>Name</source>
|
<source>Name</source>
|
||||||
|
@ -346,227 +351,439 @@ Make Sure everything is correct and try again</source>
|
||||||
<translation>Additions</translation>
|
<translation>Additions</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/LoginTab/loginhandler.cpp" line="35"/>
|
<location filename="main/CourseTab/coursestablemanager.cpp" line="15"/>
|
||||||
|
<source>Number</source>
|
||||||
|
<translation>Number</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/CourseTab/coursestablemanager.cpp" line="15"/>
|
||||||
|
<source>Year</source>
|
||||||
|
<translation>Year</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/CourseTab/coursestablemanager.cpp" line="15"/>
|
||||||
|
<source>Semester</source>
|
||||||
|
<translation>Semester</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/CourseTab/coursestablemanager.cpp" line="15"/>
|
||||||
|
<source>Serial</source>
|
||||||
|
<translation>Serial</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/LoginTab/loginhandler.cpp" line="33"/>
|
||||||
<source>Logout</source>
|
<source>Logout</source>
|
||||||
<translation>Logout</translation>
|
<translation>Logout</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/LoginTab/loginhandler.cpp" line="47"/>
|
<location filename="main/LoginTab/loginhandler.cpp" line="46"/>
|
||||||
<source>Login</source>
|
<source>Login</source>
|
||||||
<translation>Login</translation>
|
<translation>Login</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/LoginTab/loginhandler.cpp" line="68"/>
|
<location filename="main/LoginTab/loginhandler.cpp" line="67"/>
|
||||||
<source>Please Check Your Username & Password</source>
|
<source>Please Check Your Username & Password</source>
|
||||||
<translation>Please Check Your Username & Password</translation>
|
<translation>Please Check Your Username & Password</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/LoginTab/loginhandler.cpp" line="73"/>
|
<location filename="main/LoginTab/loginhandler.cpp" line="72"/>
|
||||||
<source>You have been <b>BLOCKED</b> by JCE, please try in a couple of minutes.</source>
|
<source>You have been <b>BLOCKED</b> by JCE, please try in a couple of minutes.</source>
|
||||||
<oldsource>You have been blocked by JCE, please try in a couple of minutes.</oldsource>
|
<oldsource>You have been blocked by JCE, please try in a couple of minutes.</oldsource>
|
||||||
<translation>You have been <b>blocked</b> by JCE, please try in a couple of minutes.</translation>
|
<translation>You have been <b>blocked</b> by JCE, please try in a couple of minutes.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/LoginTab/loginhandler.cpp" line="78"/>
|
<location filename="main/LoginTab/loginhandler.cpp" line="77"/>
|
||||||
<source>Please Check Your Internet Connection.</source>
|
<source>Please Check Your Internet Connection.</source>
|
||||||
<translation>Please Check Your Internet Connection.</translation>
|
<translation>Please Check Your Internet Connection.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/LoginTab/loginhandler.cpp" line="87"/>
|
<location filename="main/LoginTab/loginhandler.cpp" line="86"/>
|
||||||
<source>Receive Request Timeout.</source>
|
<source>Receive Request Timeout.</source>
|
||||||
<translation>Receive Request Timeout.</translation>
|
<translation>Receive Request Timeout.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/LoginTab/loginhandler.cpp" line="92"/>
|
<location filename="main/LoginTab/loginhandler.cpp" line="91"/>
|
||||||
<source>Send Request Timeout.</source>
|
<source>Send Request Timeout.</source>
|
||||||
<translation>Send Request Timeout.</translation>
|
<translation>Send Request Timeout.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/LoginTab/loginhandler.cpp" line="172"/>
|
<location filename="main/LoginTab/loginhandler.cpp" line="163"/>
|
||||||
<source>
|
<source>
|
||||||
If this message appear without reason, please contact me at liranbg@gmail.com</source>
|
If this message appear without reason, please contact me at liranbg@gmail.com</source>
|
||||||
<translation>
|
<translation>
|
||||||
If this message appear without reason, please contact me at liranbg@gmail.com</translation>
|
If this message appear without reason, please contact me at liranbg@gmail.com</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/LoginTab/loginhandler.cpp" line="175"/>
|
<location filename="main/LoginTab/loginhandler.cpp" line="166"/>
|
||||||
<source>Error</source>
|
<source>Error</source>
|
||||||
<translation>Error</translation>
|
<translation>Error</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceData/Calendar/calendarSchedule.cpp" line="22"/>
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarSchedule.cpp" line="21"/>
|
||||||
<source>Sunday</source>
|
<source>Sunday</source>
|
||||||
<translation>Sunday</translation>
|
<translation>Sunday</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceData/Calendar/calendarSchedule.cpp" line="22"/>
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarSchedule.cpp" line="21"/>
|
||||||
<source>Monday</source>
|
<source>Monday</source>
|
||||||
<translation>Monday</translation>
|
<translation>Monday</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceData/Calendar/calendarSchedule.cpp" line="22"/>
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarSchedule.cpp" line="21"/>
|
||||||
<source>Tuesday</source>
|
<source>Tuesday</source>
|
||||||
<translation>Thesday</translation>
|
<translation>Thesday</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceData/Calendar/calendarSchedule.cpp" line="22"/>
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarSchedule.cpp" line="21"/>
|
||||||
<source>Wednesday</source>
|
<source>Wednesday</source>
|
||||||
<translation>Wednesday</translation>
|
<translation>Wednesday</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceData/Calendar/calendarSchedule.cpp" line="22"/>
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarSchedule.cpp" line="21"/>
|
||||||
<source>Thursday</source>
|
<source>Thursday</source>
|
||||||
<translation>Thursday</translation>
|
<translation>Thursday</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceData/Calendar/calendarSchedule.cpp" line="22"/>
|
<location filename="src/jceData/Calendar/coursesSchedule/calendarSchedule.cpp" line="21"/>
|
||||||
<source>Friday</source>
|
<source>Friday</source>
|
||||||
<translation>Friday</translation>
|
<translation>Friday</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="263"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="300"/>
|
||||||
<source>ConnectionRefusedError</source>
|
<source>ConnectionRefusedError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="268"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="305"/>
|
||||||
<source>RemoteHostClosedError</source>
|
<source>RemoteHostClosedError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="278"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="315"/>
|
||||||
<source>HostNotFoundError</source>
|
<source>HostNotFoundError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="283"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="320"/>
|
||||||
<source>SocketAccessError</source>
|
<source>SocketAccessError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="287"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="324"/>
|
||||||
<source>SocketTimeoutError</source>
|
<source>SocketTimeoutError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="294"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="331"/>
|
||||||
<source>NetworkError</source>
|
<source>NetworkError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="303"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="340"/>
|
||||||
<source>SslHandshakeFailedError</source>
|
<source>SslHandshakeFailedError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="307"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="344"/>
|
||||||
<source>SslInternalError</source>
|
<source>SslInternalError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="311"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="348"/>
|
||||||
<source>SslInvalidUserDataError</source>
|
<source>SslInvalidUserDataError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="315"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="352"/>
|
||||||
<source>DatagramTooLargeError</source>
|
<source>DatagramTooLargeError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="320"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="357"/>
|
||||||
<source>OperationError</source>
|
<source>OperationError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="323"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="360"/>
|
||||||
<source>AddressInUseError</source>
|
<source>AddressInUseError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="326"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="363"/>
|
||||||
<source>SocketAddressNotAvailableError</source>
|
<source>SocketAddressNotAvailableError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="329"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="366"/>
|
||||||
<source>UnsupportedSocketOperationError</source>
|
<source>UnsupportedSocketOperationError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="332"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="369"/>
|
||||||
<source>ProxyAuthenticationRequiredError</source>
|
<source>ProxyAuthenticationRequiredError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="335"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="372"/>
|
||||||
<source>ProxyConnectionRefusedError</source>
|
<source>ProxyConnectionRefusedError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="338"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="375"/>
|
||||||
<source>UnfinishedSocketOperationError</source>
|
<source>UnfinishedSocketOperationError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="341"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="378"/>
|
||||||
<source>ProxyConnectionClosedError</source>
|
<source>ProxyConnectionClosedError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="344"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="381"/>
|
||||||
<source>ProxyConnectionTimeoutError</source>
|
<source>ProxyConnectionTimeoutError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="347"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="384"/>
|
||||||
<source>ProxyNotFoundError</source>
|
<source>ProxyNotFoundError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="350"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="387"/>
|
||||||
<source>ProxyProtocolError</source>
|
<source>ProxyProtocolError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="353"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="390"/>
|
||||||
<source>TemporaryError</source>
|
<source>TemporaryError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceConnection/jcesslclient.cpp" line="356"/>
|
<location filename="src/jceConnection/jcesslclient.cpp" line="393"/>
|
||||||
<source>UnknownSocketError</source>
|
<source>UnknownSocketError</source>
|
||||||
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
<translation>Your error is critical. Our team need your help, please send your log file named J_M_Log.log to us. see link in About. The file DOES NOT CONTAIN YOUR PASSWORD</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/jceData/CSV/csv_exporter.cpp" line="45"/>
|
<location filename="src/jceData/CSV/csv_exporter.cpp" line="44"/>
|
||||||
<source>Unable to open or create the file.
|
<source>Unable to open or create the file.
|
||||||
Exporting Failed</source>
|
Exporting Failed</source>
|
||||||
<translation>Unable to open or create the file.
|
<translation>Unable to open or create the file.
|
||||||
Exporting Failed</translation>
|
Exporting Failed</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/CSV/csv_exporter.cpp" line="143"/>
|
||||||
|
<source>JceManager Save Schedule Dialog</source>
|
||||||
|
<translation>JceManager Save Schedule Dialog</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/CSV/csv_exporter.cpp" line="144"/>
|
||||||
|
<source>CSV Files (*.csv);;All Files (*)</source>
|
||||||
|
<translation>CSV Files (*.csv);;All Files (*)</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>loginHandler</name>
|
<name>examDialog</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/LoginTab/loginhandler.cpp" line="150"/>
|
<location filename="src/jceData/Calendar/Exams/examDialog.ui" line="20"/>
|
||||||
<source>Connecting...</source>
|
<source>Exam Dialog</source>
|
||||||
<translation>Connecting...</translation>
|
<oldsource>Dialog</oldsource>
|
||||||
|
<translation>Exam Dialog</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/LoginTab/loginhandler.cpp" line="154"/>
|
<location filename="src/jceData/Calendar/Exams/examDialog.ui" line="71"/>
|
||||||
<source>Connected</source>
|
<source><html><head/><body><p>Revert changes</p></body></html></source>
|
||||||
<translation>Connected</translation>
|
<translation><html><head/><body><p>Revert changes</p></body></html></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/LoginTab/loginhandler.cpp" line="158"/>
|
<location filename="src/jceData/Calendar/Exams/examDialog.ui" line="74"/>
|
||||||
|
<source>Revert</source>
|
||||||
|
<translation>Revert</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/Exams/examDialog.ui" line="81"/>
|
||||||
|
<source><html><head/><body><p>Discard and hide</p></body></html></source>
|
||||||
|
<translation><html><head/><body><p>Discard and hide</p></body></html></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/Exams/examDialog.ui" line="84"/>
|
||||||
|
<source>Cancel</source>
|
||||||
|
<translation>Cancel</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/Exams/examDialog.ui" line="91"/>
|
||||||
|
<source><html><head/><body><p>Save and hide</p></body></html></source>
|
||||||
|
<translation><html><head/><body><p>Save and hide</p></body></html></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/Exams/examDialog.ui" line="94"/>
|
||||||
|
<source>Ok</source>
|
||||||
|
<translation>Ok</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/Exams/examDialog.ui" line="120"/>
|
||||||
|
<source><html><head/><body><p align="center"><span style=" font-size:14pt;">Exams Schedule</span></p></body></html></source>
|
||||||
|
<translation><html><head/><body><p align="center"><span style=" font-size:14pt;">Exams Schedule</span></p></body></html></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/Exams/examDialog.cpp" line="18"/>
|
||||||
|
<source>Serial</source>
|
||||||
|
<translation>Serial</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/Exams/examDialog.cpp" line="18"/>
|
||||||
|
<source>Course</source>
|
||||||
|
<translation>Course</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/Exams/examDialog.cpp" line="18"/>
|
||||||
|
<source>Lecturer</source>
|
||||||
|
<translation>Lecturer</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/Exams/examDialog.cpp" line="18"/>
|
||||||
|
<source>Field</source>
|
||||||
|
<translation>Field</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/Exams/examDialog.cpp" line="18"/>
|
||||||
|
<source>Type</source>
|
||||||
|
<translation>Type</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/Exams/examDialog.cpp" line="18"/>
|
||||||
|
<source>Exam 1 Date</source>
|
||||||
|
<translation>Exam 1 Date</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/Exams/examDialog.cpp" line="18"/>
|
||||||
|
<source>Starting Hour</source>
|
||||||
|
<translation>Starting Hour</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/Exams/examDialog.cpp" line="18"/>
|
||||||
|
<source>Exam 2 Date</source>
|
||||||
|
<translation>Exam 2 Date</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/Exams/examDialog.cpp" line="158"/>
|
||||||
|
<source>Error</source>
|
||||||
|
<translation>Error</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Calendar/Exams/examDialog.cpp" line="158"/>
|
||||||
|
<source>Missmatching data.
|
||||||
|
Format: hh:mm
|
||||||
|
In Example: 08:25 or 12:05</source>
|
||||||
|
<translation>Missmatching data.
|
||||||
|
Format: hh:mm
|
||||||
|
In Example: 08:25 or 12:05</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>gradegraph</name>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Grades/graph/gradegraph.ui" line="14"/>
|
||||||
|
<source>GPA Graph View</source>
|
||||||
|
<translation>GPA Graph View</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Grades/graph/gradegraph.ui" line="36"/>
|
||||||
|
<source><html><head/><body><p align="center"><span style=" font-size:18pt; font-weight:600;">GPA Graph View</span></p></body></html></source>
|
||||||
|
<translation><html><head/><body><p align="center"><span style=" font-size:18pt; font-weight:600;">GPA Graph View</span></p></body></html></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Grades/graph/gradegraph.ui" line="71"/>
|
||||||
|
<source>Close</source>
|
||||||
|
<translation>Close</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Grades/graph/gradegraph.cpp" line="124"/>
|
||||||
|
<source>Yearly Average</source>
|
||||||
|
<translation>Yearly Average</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Grades/graph/gradegraph.cpp" line="129"/>
|
||||||
|
<source>Semesterial Average</source>
|
||||||
|
<translation>Semesterial Average</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Grades/graph/gradegraph.cpp" line="147"/>
|
||||||
|
<source>A</source>
|
||||||
|
<translation>A</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Grades/graph/gradegraph.cpp" line="151"/>
|
||||||
|
<source>B</source>
|
||||||
|
<translation>B</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Grades/graph/gradegraph.cpp" line="155"/>
|
||||||
|
<source>C</source>
|
||||||
|
<translation>Summer</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Grades/graph/gradegraph.cpp" line="166"/>
|
||||||
|
<source>AVG Grade</source>
|
||||||
|
<translation>Grade Axis</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="src/jceData/Grades/graph/gradegraph.cpp" line="175"/>
|
||||||
|
<source>Years</source>
|
||||||
|
<translation>Year Axis</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>jceStatusBar</name>
|
||||||
|
<message>
|
||||||
|
<location filename="main/jceWidgets/jcestatusbar.cpp" line="7"/>
|
||||||
|
<location filename="main/jceWidgets/jcestatusbar.cpp" line="81"/>
|
||||||
|
<source>Ready</source>
|
||||||
|
<translation>Ready</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/jceWidgets/jcestatusbar.cpp" line="71"/>
|
||||||
|
<source>Error</source>
|
||||||
|
<translation>Error</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/jceWidgets/jcestatusbar.cpp" line="76"/>
|
||||||
<source>Disconnected</source>
|
<source>Disconnected</source>
|
||||||
<translation>Disconnected</translation>
|
<translation>Disconnected</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="main/LoginTab/loginhandler.cpp" line="162"/>
|
<location filename="main/jceWidgets/jcestatusbar.cpp" line="86"/>
|
||||||
<source>Ready.</source>
|
<source>Connecting...</source>
|
||||||
<translation>Ready.</translation>
|
<translation>Connecting...</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/jceWidgets/jcestatusbar.cpp" line="92"/>
|
||||||
|
<source>Sending...</source>
|
||||||
|
<translation>Sending...</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/jceWidgets/jcestatusbar.cpp" line="98"/>
|
||||||
|
<source>Recieving...</source>
|
||||||
|
<translation>Recieving...</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/jceWidgets/jcestatusbar.cpp" line="103"/>
|
||||||
|
<source>Connected</source>
|
||||||
|
<translation>Connected</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/jceWidgets/jcestatusbar.cpp" line="108"/>
|
||||||
|
<source>Inserting</source>
|
||||||
|
<translation>Inserting</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/jceWidgets/jcestatusbar.cpp" line="113"/>
|
||||||
|
<source>Logged In.</source>
|
||||||
|
<translation>Logged In.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="main/jceWidgets/jcestatusbar.cpp" line="118"/>
|
||||||
|
<source>Done</source>
|
||||||
|
<translation>Done</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
</TS>
|
</TS>
|
||||||
|
|
BIN
jce_he.qm
|
@ -1,19 +1,33 @@
|
||||||
#include "CalendarManager.h"
|
#include "CalendarManager.h"
|
||||||
|
|
||||||
CalendarManager::CalendarManager(QGridLayout *ptr)
|
CalendarManager::CalendarManager(QWidget *parent, QGridLayout *ptr) : QWidget(parent)
|
||||||
{
|
{
|
||||||
caliSchedPtr = new calendarSchedule();
|
caliSchedPtr = new calendarSchedule(this);
|
||||||
|
examSchePtr = new calendarExam();
|
||||||
ptr->addWidget(caliSchedPtr);
|
ptr->addWidget(caliSchedPtr);
|
||||||
caliDialog = new CalendarDialog();
|
caliDialog = new CalendarDialog(this);
|
||||||
|
examDialogPtr = new examDialog(this,examSchePtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalendarManager::setCalendar(QString html)
|
void CalendarManager::setCalendar(QString html)
|
||||||
{
|
{
|
||||||
caliSchedPtr->setPage(html);
|
caliSchedPtr->setPage(html);
|
||||||
|
|
||||||
}
|
}
|
||||||
void CalendarManager::exportCalendarCSV() //need to add fix to the null pointer bug
|
|
||||||
|
void CalendarManager::setExamsSchedule(QString html)
|
||||||
{
|
{
|
||||||
if (this->caliSchedPtr->getCourses() == NULL)
|
examSchePtr->setPage(html);
|
||||||
|
examDialogPtr->initializingDataIntoTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CalendarManager::showExamDialog()
|
||||||
|
{
|
||||||
|
examDialogPtr->show();
|
||||||
|
}
|
||||||
|
void CalendarManager::exportCalendarCSV()
|
||||||
|
{
|
||||||
|
if (this->caliSchedPtr->getCourses().isEmpty())
|
||||||
return;
|
return;
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
int buttonClicked = caliDialog->exec();
|
int buttonClicked = caliDialog->exec();
|
||||||
|
@ -22,7 +36,7 @@ void CalendarManager::exportCalendarCSV() //need to add fix to the null pointer
|
||||||
//calDialog.getStartDate(),calDialog.getEndDate()
|
//calDialog.getStartDate(),calDialog.getEndDate()
|
||||||
if (caliDialog->ok())
|
if (caliDialog->ok())
|
||||||
{
|
{
|
||||||
if (CSV_Exporter::exportCalendar(caliSchedPtr, caliDialog))
|
if (CSV_Exporter::exportCalendar(caliSchedPtr, caliDialog, examSchePtr))
|
||||||
{
|
{
|
||||||
msgBox.setIcon(QMessageBox::Information);
|
msgBox.setIcon(QMessageBox::Information);
|
||||||
msgBox.setText(QObject::tr("Exported Successfuly!"));
|
msgBox.setText(QObject::tr("Exported Successfuly!"));
|
||||||
|
|
|
@ -1,21 +1,25 @@
|
||||||
#ifndef CALENDARMANAGER_H
|
#ifndef CALENDARMANAGER_H
|
||||||
#define CALENDARMANAGER_H
|
#define CALENDARMANAGER_H
|
||||||
|
|
||||||
#include "./src/jceData/Calendar/calendarPage.h"
|
#include "../../src/jceData/Calendar/coursesSchedule/calendarPage.h"
|
||||||
#include "./src/jceData/Calendar/calendarSchedule.h"
|
#include "../../src/jceData/Calendar/coursesSchedule/calendarSchedule.h"
|
||||||
#include "./src/jceData/CSV/csv_exporter.h"
|
#include "../../src/jceData/Calendar/coursesSchedule/calendarDialog.h"
|
||||||
#include "./src/jceData/Calendar/calendarDialog.h"
|
#include "../../src/jceData/CSV/csv_exporter.h"
|
||||||
|
|
||||||
|
#include "../../src/jceData/Calendar/Exams/calendarExam.h"
|
||||||
|
#include "../../src/jceData/Calendar/Exams/examDialog.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QWidget>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
class CalendarManager : public QObject
|
class CalendarManager : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CalendarManager(QGridLayout *ptr);
|
CalendarManager(QWidget *parent = 0, QGridLayout *ptr = 0);
|
||||||
~CalendarManager()
|
~CalendarManager()
|
||||||
{
|
{
|
||||||
delete caliSchedPtr;
|
delete caliSchedPtr;
|
||||||
|
@ -23,9 +27,15 @@ public:
|
||||||
}
|
}
|
||||||
void exportCalendarCSV();
|
void exportCalendarCSV();
|
||||||
void setCalendar(QString html);
|
void setCalendar(QString html);
|
||||||
|
void setExamsSchedule(QString html);
|
||||||
|
void showExamDialog();
|
||||||
void resetTable() { if (caliSchedPtr != NULL) caliSchedPtr->clearTableItems(); }
|
void resetTable() { if (caliSchedPtr != NULL) caliSchedPtr->clearTableItems(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
calendarExam * examSchePtr;
|
||||||
|
examDialog * examDialogPtr;
|
||||||
|
|
||||||
|
|
||||||
calendarSchedule * caliSchedPtr;
|
calendarSchedule * caliSchedPtr;
|
||||||
CalendarDialog * caliDialog;
|
CalendarDialog * caliDialog;
|
||||||
|
|
||||||
|
|
|
@ -1,37 +1,41 @@
|
||||||
#include "coursestablemanager.h"
|
#include "coursestablemanager.h"
|
||||||
|
|
||||||
coursesTableManager::coursesTableManager(QTableWidget *ptr, user *usrPtr)
|
coursesTableManager::coursesTableManager(QTableWidget *ptr, user *usrPtr)
|
||||||
{
|
{
|
||||||
this->gp = NULL;
|
this->gp = NULL;
|
||||||
this->us = usrPtr;
|
this->gpCpy = NULL;
|
||||||
this->courseTBL = ptr;
|
this->us = usrPtr;
|
||||||
|
this->courseTBL = ptr;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initilizing Table
|
* Initilizing Table
|
||||||
*/
|
*/
|
||||||
courseTBL->setRowCount(0);
|
courseTBL->setRowCount(0);
|
||||||
courseTBL->setColumnCount(COURSE_FIELDS);
|
courseTBL->setColumnCount(COURSE_FIELDS);
|
||||||
QStringList mz;
|
QStringList mz;
|
||||||
mz << QObject::tr("Code") << QObject::tr("Name") << QObject::tr("Type") << QObject::tr("Points") << QObject::tr("Hours") << QObject::tr("Grade") << QObject::tr("Additions");
|
mz << QObject::tr("Number") << QObject::tr("Year") << QObject::tr("Semester") << QObject::tr("Serial") << QObject::tr("Name") << QObject::tr("Type") << QObject::tr("Points") << QObject::tr("Hours") << QObject::tr("Grade") << QObject::tr("Additions");
|
||||||
courseTBL->setHorizontalHeaderLabels(mz);
|
courseTBL->setHorizontalHeaderLabels(mz);
|
||||||
courseTBL->verticalHeader()->setVisible(true);
|
courseTBL->verticalHeader()->setVisible(false);
|
||||||
courseTBL->setSelectionMode(QAbstractItemView::SingleSelection);
|
courseTBL->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||||
courseTBL->setShowGrid(true);
|
courseTBL->setShowGrid(true);
|
||||||
courseTBL->setStyleSheet("QTableView {selection-background-color: red;}");
|
courseTBL->setStyleSheet("QTableView {selection-background-color: red;}");
|
||||||
|
|
||||||
|
graph = new gradegraph(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
coursesTableManager::~coursesTableManager()
|
coursesTableManager::~coursesTableManager()
|
||||||
{
|
{
|
||||||
courseTBL = NULL;
|
courseTBL = NULL;
|
||||||
delete gp;
|
delete gp;
|
||||||
gp = NULL;
|
delete gpCpy;
|
||||||
|
gpCpy = NULL;
|
||||||
|
gp = NULL;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief coursesTableManager::insertJceCoursesIntoTable phrasing the course list to rows in table
|
* @brief coursesTableManager::insertJceCoursesIntoTable phrasing the course list to rows in table
|
||||||
*/
|
*/
|
||||||
void coursesTableManager::insertJceCoursesIntoTable()
|
void coursesTableManager::insertJceCoursesIntoTable()
|
||||||
{
|
{
|
||||||
for (gradeCourse *c: *gp->getCourses())
|
for (gradeCourse *c: gp->getCourses())
|
||||||
{
|
{
|
||||||
if (us->getInfluenceCourseOnly())
|
if (us->getInfluenceCourseOnly())
|
||||||
{
|
{
|
||||||
|
@ -48,7 +52,10 @@ void coursesTableManager::insertJceCoursesIntoTable()
|
||||||
*/
|
*/
|
||||||
void coursesTableManager::setCoursesList(QString &html)
|
void coursesTableManager::setCoursesList(QString &html)
|
||||||
{
|
{
|
||||||
gp = new GradePage(html);
|
clearTable();
|
||||||
|
gp = new GradePage(html);
|
||||||
|
this->gpCpy = new GradePage(*gp);
|
||||||
|
insertJceCoursesIntoTable();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief coursesTableManager::changes when user changes the table manually it updates it
|
* @brief coursesTableManager::changes when user changes the table manually it updates it
|
||||||
|
@ -59,16 +66,26 @@ void coursesTableManager::setCoursesList(QString &html)
|
||||||
*/
|
*/
|
||||||
bool coursesTableManager::changes(QString change, int row, int col)
|
bool coursesTableManager::changes(QString change, int row, int col)
|
||||||
{
|
{
|
||||||
|
bool isNumFlag = true;
|
||||||
|
if (courseTBL->item(row,gradeCourse::CourseScheme::SERIAL) == NULL)
|
||||||
|
return true;
|
||||||
|
|
||||||
bool isNumFlag = true;
|
int serialCourse = courseTBL->item(row,gradeCourse::CourseScheme::SERIAL)->text().toInt();
|
||||||
|
for (gradeCourse *c: gp->getCourses())
|
||||||
int serialCourse = courseTBL->item(row,gradeCourse::CourseScheme::SERIAL)->text().toInt();
|
|
||||||
for (gradeCourse *c: *gp->getCourses())
|
|
||||||
{
|
{
|
||||||
if (c->getSerialNum() == serialCourse)
|
if (c->getSerialNum() == serialCourse)
|
||||||
{
|
{
|
||||||
switch (col)
|
switch (col)
|
||||||
{
|
{
|
||||||
|
case (gradeCourse::CourseScheme::COURSE_NUMBER_IN_LIST):
|
||||||
|
c->setCourseNumInList(change.toInt());
|
||||||
|
break;
|
||||||
|
case (gradeCourse::CourseScheme::YEAR):
|
||||||
|
c->setYear(change.toInt());
|
||||||
|
break;
|
||||||
|
case (gradeCourse::CourseScheme::SEMESTER):
|
||||||
|
c->setSemester(change.toInt());
|
||||||
|
break;
|
||||||
case (gradeCourse::CourseScheme::NAME):
|
case (gradeCourse::CourseScheme::NAME):
|
||||||
c->setName(change);
|
c->setName(change);
|
||||||
break;
|
break;
|
||||||
|
@ -100,17 +117,21 @@ bool coursesTableManager::changes(QString change, int row, int col)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (gradeCourse::CourseScheme::GRADE):
|
case (gradeCourse::CourseScheme::GRADE):
|
||||||
{
|
{
|
||||||
|
|
||||||
change.toDouble(&isNumFlag);
|
change.toDouble(&isNumFlag);
|
||||||
|
|
||||||
if (!isNumFlag)
|
if (!isNumFlag) //not a number
|
||||||
{
|
{
|
||||||
courseTBL->item(row,col)->setText(QString::number(c->getGrade()));
|
courseTBL->item(row,col)->setText(QString::number(c->getGrade()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((change.toDouble() >= 0) && (change.toDouble() <= 100))
|
if ((change.toDouble() >= 0) && (change.toDouble() <= 100))
|
||||||
c->setGrade(change.toDouble());
|
{
|
||||||
|
c->setGrade(change.toDouble());
|
||||||
|
colorTheGrade(row);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
courseTBL->item(row,col)->setText(QString::number(c->getGrade()));
|
courseTBL->item(row,col)->setText(QString::number(c->getGrade()));
|
||||||
}
|
}
|
||||||
|
@ -132,44 +153,82 @@ bool coursesTableManager::changes(QString change, int row, int col)
|
||||||
*/
|
*/
|
||||||
void coursesTableManager::addRow(const gradeCourse *courseToAdd)
|
void coursesTableManager::addRow(const gradeCourse *courseToAdd)
|
||||||
{
|
{
|
||||||
int i,j;
|
int i=1,j=1;
|
||||||
i = courseTBL->rowCount();
|
|
||||||
j = 0;
|
j = 0;
|
||||||
QTableWidgetItem *serial,*name,*type,*points,*hours,*grade,*addition;
|
QTableWidgetItem *number,*year,*semester,*serial,*name,*type,*points,*hours,*grade,*addition;
|
||||||
const gradeCourse * c;
|
const gradeCourse * c;
|
||||||
if (courseToAdd != NULL)
|
if (courseToAdd != NULL)
|
||||||
{
|
{
|
||||||
c = courseToAdd;
|
c = courseToAdd;
|
||||||
if (!isCourseAlreadyInserted(c->getSerialNum()))
|
if (!isCourseAlreadyInserted(c->getSerialNum()))
|
||||||
{
|
{
|
||||||
courseTBL->setRowCount(courseTBL->rowCount()+1);
|
courseTBL->setRowCount(courseTBL->rowCount() + 1);
|
||||||
serial = new QTableWidgetItem(QString::number(c->getSerialNum()));
|
i = courseTBL->rowCount()-1;
|
||||||
serial->setFlags(serial->flags() & ~Qt::ItemIsEditable);
|
|
||||||
points = new QTableWidgetItem(QString::number(c->getPoints()));
|
|
||||||
points->setFlags(serial->flags() & ~Qt::ItemIsEditable);
|
|
||||||
hours = new QTableWidgetItem(QString::number(c->getHours()));
|
|
||||||
hours->setFlags(serial->flags() & ~Qt::ItemIsEditable);
|
|
||||||
grade = new QTableWidgetItem(QString::number(c->getGrade()));
|
|
||||||
name = new QTableWidgetItem(c->getName());
|
|
||||||
name->setFlags(serial->flags() & ~Qt::ItemIsEditable);
|
|
||||||
type = new QTableWidgetItem(c->getType());
|
|
||||||
type->setFlags(serial->flags() & ~Qt::ItemIsEditable);
|
|
||||||
addition = new QTableWidgetItem(c->getAddidtions());
|
|
||||||
|
|
||||||
courseTBL->setItem(i,j++,serial);
|
number = new QTableWidgetItem();
|
||||||
courseTBL->setItem(i,j++,name);
|
number->setData(Qt::EditRole, c->getCourseNumInList());
|
||||||
courseTBL->setItem(i,j++,type);
|
number->setFlags(number->flags() & ~Qt::ItemIsEditable);
|
||||||
courseTBL->setItem(i,j++,points);
|
|
||||||
courseTBL->setItem(i,j++,hours);
|
year = new QTableWidgetItem();
|
||||||
courseTBL->setItem(i,j++,grade);
|
year->setData(Qt::EditRole,c->getYear());
|
||||||
courseTBL->setItem(i,j,addition);
|
year->setFlags(year->flags() & ~Qt::ItemIsEditable);
|
||||||
|
|
||||||
|
semester = new QTableWidgetItem();
|
||||||
|
semester->setData(Qt::EditRole,c->getSemester());
|
||||||
|
semester->setFlags(semester->flags() & ~Qt::ItemIsEditable);
|
||||||
|
|
||||||
|
serial = new QTableWidgetItem();
|
||||||
|
serial->setData(Qt::EditRole,c->getSerialNum());
|
||||||
|
serial->setFlags(serial->flags() & ~Qt::ItemIsEditable);
|
||||||
|
|
||||||
|
name = new QTableWidgetItem();
|
||||||
|
name->setData(Qt::EditRole,c->getName());
|
||||||
|
name->setFlags(name->flags() & ~Qt::ItemIsEditable);
|
||||||
|
|
||||||
|
type = new QTableWidgetItem();
|
||||||
|
type->setData(Qt::EditRole, c->getType());
|
||||||
|
type->setFlags(type->flags() & ~Qt::ItemIsEditable);
|
||||||
|
|
||||||
|
points = new QTableWidgetItem();
|
||||||
|
points->setData(Qt::EditRole, c->getPoints());
|
||||||
|
points->setFlags(points->flags() & ~Qt::ItemIsEditable);
|
||||||
|
|
||||||
|
hours = new QTableWidgetItem();
|
||||||
|
hours->setData(Qt::EditRole, c->getHours());
|
||||||
|
hours->setFlags(hours->flags() & ~Qt::ItemIsEditable);
|
||||||
|
|
||||||
|
grade = new QTableWidgetItem();
|
||||||
|
//grade->setData(Qt::EditRole,c->getGrade());
|
||||||
|
//BUG QT bug
|
||||||
|
//good for sorting, the problem is when you edit -> the cell indicator disappear
|
||||||
|
grade->setText(QString::number(c->getGrade()));
|
||||||
|
|
||||||
|
addition = new QTableWidgetItem();
|
||||||
|
addition->setData(Qt::EditRole,c->getAddidtions());
|
||||||
|
|
||||||
|
courseTBL->setItem(i,j++,number);
|
||||||
|
courseTBL->setItem(i,j++,year);
|
||||||
|
courseTBL->setItem(i,j++,semester);
|
||||||
|
courseTBL->setItem(i,j++,serial);
|
||||||
|
courseTBL->setItem(i,j++,name);
|
||||||
|
courseTBL->setItem(i,j++,type);
|
||||||
|
courseTBL->setItem(i,j++,points);
|
||||||
|
courseTBL->setItem(i,j++,hours);
|
||||||
|
courseTBL->setItem(i,j++,grade);
|
||||||
|
courseTBL->setItem(i,j,addition);
|
||||||
|
|
||||||
|
colorTheGrade(i);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
qCritical() << Q_FUNC_INFO << " no course to load!";
|
||||||
}
|
}
|
||||||
courseTBL->resizeColumnsToContents();
|
|
||||||
|
courseTBL->resizeColumnsToContents();
|
||||||
|
courseTBL->resizeRowsToContents();
|
||||||
|
|
||||||
}
|
}
|
||||||
double coursesTableManager::getAvg()
|
double coursesTableManager::getAvg()
|
||||||
|
@ -179,6 +238,18 @@ double coursesTableManager::getAvg()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool coursesTableManager::showGraph()
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
if (gp != NULL)
|
||||||
|
{
|
||||||
|
this->graph->showGraph(gp);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
qWarning() << Q_FUNC_INFO << "open with null grade page";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void coursesTableManager::influnceCourseChanged(bool ignoreCourseStatus)
|
void coursesTableManager::influnceCourseChanged(bool ignoreCourseStatus)
|
||||||
{
|
{
|
||||||
|
@ -194,13 +265,13 @@ void coursesTableManager::influnceCourseChanged(bool ignoreCourseStatus)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (gp != NULL)
|
if (this->gp != NULL)
|
||||||
for (gradeCourse *c: *gp->getCourses())
|
for (gradeCourse *c: gp->getCourses())
|
||||||
{
|
{
|
||||||
if (!(isCourseAlreadyInserted(c->getSerialNum())))
|
if (!(isCourseAlreadyInserted(c->getSerialNum())))
|
||||||
if (c->getPoints() == 0)
|
if (c->getPoints() == 0)
|
||||||
addRow(c);
|
addRow(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -213,17 +284,50 @@ void coursesTableManager::clearTable()
|
||||||
int i = 0; //starting point
|
int i = 0; //starting point
|
||||||
while (courseTBL->rowCount() > i)
|
while (courseTBL->rowCount() > i)
|
||||||
{
|
{
|
||||||
gp->removeCourse(courseTBL->item(i,gradeCourse::CourseScheme::SERIAL)->text());
|
if (gp != NULL)
|
||||||
courseTBL->removeRow(i);
|
gp->removeCourse(courseTBL->item(i,gradeCourse::CourseScheme::SERIAL)->text());
|
||||||
|
courseTBL->removeRow(i);
|
||||||
}
|
}
|
||||||
gp = NULL;
|
if (gp != NULL)
|
||||||
courseTBL->repaint();
|
delete gp;
|
||||||
|
gp = NULL;
|
||||||
|
courseTBL->repaint();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @brief coursesTableManager::revertChanges
|
||||||
|
*
|
||||||
|
* restored data from the copy of grade page
|
||||||
|
* TODO: revert-> make it efficient
|
||||||
|
*/
|
||||||
|
void coursesTableManager::revertChanges()
|
||||||
|
{
|
||||||
|
if (courseTBL->rowCount() <= 0)
|
||||||
|
return;
|
||||||
|
if (this->gpCpy == NULL)
|
||||||
|
return;
|
||||||
|
if (this->gp == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (int i = 0; i < courseTBL->rowCount(); ++i)
|
||||||
|
{
|
||||||
|
gradeCourse * temp = getCourseByRow(i);
|
||||||
|
for (gradeCourse * notChangedCourse: gpCpy->getCourses())
|
||||||
|
{
|
||||||
|
if ((temp->getGrade() != notChangedCourse->getGrade()) &&
|
||||||
|
(temp->getSerialNum() == notChangedCourse->getSerialNum()))
|
||||||
|
{
|
||||||
|
courseTBL->item(i,gradeCourse::CourseScheme::GRADE)->setText(QString::number(notChangedCourse->getGrade()));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gradeCourse *coursesTableManager::getCourseByRow(int row)
|
gradeCourse *coursesTableManager::getCourseByRow(int row)
|
||||||
{
|
{
|
||||||
QString courseSerial = courseTBL->item(row,gradeCourse::CourseScheme::SERIAL)->text();
|
QString courseSerial = courseTBL->item(row,gradeCourse::CourseScheme::SERIAL)->text();
|
||||||
for (gradeCourse *c: *gp->getCourses())
|
for (gradeCourse *c: gp->getCourses())
|
||||||
{
|
{
|
||||||
if (c->getSerialNum() == courseSerial.toDouble())
|
if (c->getSerialNum() == courseSerial.toDouble())
|
||||||
return c;
|
return c;
|
||||||
|
@ -233,12 +337,15 @@ gradeCourse *coursesTableManager::getCourseByRow(int row)
|
||||||
|
|
||||||
bool coursesTableManager::isCourseAlreadyInserted(double courseID)
|
bool coursesTableManager::isCourseAlreadyInserted(double courseID)
|
||||||
{
|
{
|
||||||
int i=0;
|
int i;
|
||||||
for (i = 0; i < courseTBL->rowCount(); ++i)
|
for (i = courseTBL->rowCount(); i >= 0; --i)
|
||||||
{
|
{
|
||||||
QString courseSerial = courseTBL->item(i,gradeCourse::CourseScheme::SERIAL)->text();
|
if (courseTBL->item(i,gradeCourse::CourseScheme::SERIAL) != NULL)
|
||||||
if (QString::number(courseID) == courseSerial)
|
{
|
||||||
return true;
|
QString courseSerial = courseTBL->item(i,gradeCourse::CourseScheme::SERIAL)->text();
|
||||||
|
if (QString::number(courseID) == courseSerial)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -250,3 +357,28 @@ bool coursesTableManager::isCourseInfluence(const gradeCourse *courseToCheck)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @brief coursesTableManager::colorTheGrade - color the course grade
|
||||||
|
* @param rowIndex - course's row index
|
||||||
|
*/
|
||||||
|
void coursesTableManager::colorTheGrade(int rowIndex)
|
||||||
|
{
|
||||||
|
gradeCourse * temp = getCourseByRow(rowIndex);
|
||||||
|
if (temp != NULL)
|
||||||
|
{
|
||||||
|
if (temp->getGrade() != 0)
|
||||||
|
{
|
||||||
|
float green,red, blue = 0;
|
||||||
|
float grade = ((float)temp->getGrade());
|
||||||
|
|
||||||
|
green = qRound(grade * 255 / 100);
|
||||||
|
red = qRound((255 * (100 - grade) / 100));
|
||||||
|
blue = 0;
|
||||||
|
//higher the grade -> the greener it is
|
||||||
|
courseTBL->item(rowIndex,gradeCourse::CourseScheme::GRADE)->setBackground(QColor(red,green,blue));
|
||||||
|
courseTBL->item(rowIndex,gradeCourse::CourseScheme::GRADE)->setTextColor(Qt::black);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -2,19 +2,16 @@
|
||||||
#define COURSESTABLEMANAGER_H
|
#define COURSESTABLEMANAGER_H
|
||||||
|
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QtGlobal>
|
||||||
#include <QDesktopWidget>
|
|
||||||
#include <QtCore/QCoreApplication>
|
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QTableWidget>
|
#include <QTableWidget>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
#include <list>
|
#include "../../src/jceData/Grades/graph/gradegraph.h"
|
||||||
|
#include "../../src/jceData/Grades/gradePage.h"
|
||||||
#include "./src/jceData/Grades/gradePage.h"
|
#include "../../src/jceSettings/user.h"
|
||||||
#include "./src/jceSettings/user.h"
|
|
||||||
|
|
||||||
class coursesTableManager
|
class coursesTableManager
|
||||||
{
|
{
|
||||||
|
@ -27,17 +24,25 @@ public:
|
||||||
void addRow(const gradeCourse * courseToAdd = 0);
|
void addRow(const gradeCourse * courseToAdd = 0);
|
||||||
double getAvg();
|
double getAvg();
|
||||||
|
|
||||||
|
bool showGraph();
|
||||||
|
|
||||||
void influnceCourseChanged(bool status);
|
void influnceCourseChanged(bool status);
|
||||||
void clearTable();
|
void clearTable();
|
||||||
|
|
||||||
|
void revertChanges();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
gradegraph *graph;
|
||||||
QTableWidget *courseTBL;
|
QTableWidget *courseTBL;
|
||||||
GradePage *gp;
|
GradePage *gp;
|
||||||
|
GradePage *gpCpy;
|
||||||
user *us;
|
user *us;
|
||||||
|
|
||||||
gradeCourse * getCourseByRow(int row);
|
gradeCourse * getCourseByRow(int row);
|
||||||
bool isCourseAlreadyInserted(double courseID);
|
bool isCourseAlreadyInserted(double courseID);
|
||||||
bool isCourseInfluence(const gradeCourse *courseToCheck);
|
bool isCourseInfluence(const gradeCourse *courseToCheck);
|
||||||
|
|
||||||
|
void colorTheGrade(int rowIndex);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COURSESTABLEMANAGER_H
|
#endif // COURSESTABLEMANAGER_H
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
#include "loginhandler.h"
|
#include "loginhandler.h"
|
||||||
|
|
||||||
loginHandler::loginHandler(user *ptr, QStatusBar *statusBarPtr,QPushButton *loginButtonPtr): logggedInFlag(false)
|
loginHandler::loginHandler(user *ptr, QPushButton *loginButtonPtr, jceStatusBar *progressbarPtr): logggedInFlag(false)
|
||||||
{
|
{
|
||||||
this->loginButtonPtr = loginButtonPtr;
|
this->loginButtonPtr = loginButtonPtr;
|
||||||
|
this->statusBar = progressbarPtr;
|
||||||
|
|
||||||
//statusBar
|
|
||||||
statusBar = statusBarPtr;
|
|
||||||
iconButtomStatusLabel = new QLabel();
|
statusBar->setIconConnectionStatus(jceStatusBar::Disconnected);
|
||||||
statusBar->addPermanentWidget(iconButtomStatusLabel,0);
|
|
||||||
setIconConnectionStatus(jceLogin::jceStatus::JCE_NOT_CONNECTED);
|
|
||||||
|
|
||||||
//user settings
|
//user settings
|
||||||
userPtr = ptr;
|
userPtr = ptr;
|
||||||
this->jceLog = new jceLogin(userPtr);
|
this->jceLog = new jceLogin(userPtr,statusBar);
|
||||||
QObject::connect(this->jceLog,SIGNAL(connectionReadyAfterDisconnection()),this,SLOT(readyAfterConnectionLost()));
|
QObject::connect(this->jceLog,SIGNAL(connectionReadyAfterDisconnection()),this,SLOT(readyAfterConnectionLost()));
|
||||||
|
|
||||||
}
|
}
|
||||||
bool loginHandler::login(QString username,QString password)
|
bool loginHandler::login(QString username,QString password)
|
||||||
{
|
{
|
||||||
|
@ -24,19 +24,18 @@ bool loginHandler::login(QString username,QString password)
|
||||||
logout();
|
logout();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
setIconConnectionStatus(jceLogin::jceStatus::JCE_START_VALIDATING_PROGRESS);
|
|
||||||
|
|
||||||
userPtr->setUsername(username);
|
userPtr->setUsername(username);
|
||||||
userPtr->setPassword(password);
|
userPtr->setPassword(password);
|
||||||
|
|
||||||
if (makeConnection() == true)
|
if (makeConnection() == true)
|
||||||
{
|
{
|
||||||
setIconConnectionStatus(jceLogin::jceStatus::JCE_YOU_ARE_IN);
|
|
||||||
loginButtonPtr->setText(QObject::tr("Logout"));
|
loginButtonPtr->setText(QObject::tr("Logout"));
|
||||||
return isLoggedInFlag();
|
return isLoggedInFlag();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
logout();
|
logout();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +44,7 @@ bool loginHandler::login(QString username,QString password)
|
||||||
void loginHandler::logout()
|
void loginHandler::logout()
|
||||||
{
|
{
|
||||||
loginButtonPtr->setText(QObject::tr("Login"));
|
loginButtonPtr->setText(QObject::tr("Login"));
|
||||||
setIconConnectionStatus(jceLogin::jceStatus::JCE_NOT_CONNECTED);
|
statusBar->setIconConnectionStatus(jceStatusBar::Disconnected);
|
||||||
jceLog->closeAll();
|
jceLog->closeAll();
|
||||||
logggedInFlag = false;
|
logggedInFlag = false;
|
||||||
}
|
}
|
||||||
|
@ -101,6 +100,7 @@ void loginHandler::readyAfterConnectionLost()
|
||||||
{
|
{
|
||||||
qWarning() << Q_FUNC_INFO;
|
qWarning() << Q_FUNC_INFO;
|
||||||
setLoginFlag(false);
|
setLoginFlag(false);
|
||||||
|
statusBar->setIconConnectionStatus(jceStatusBar::Disconnected);
|
||||||
login(userPtr->getUsername(),userPtr->getPassword());
|
login(userPtr->getUsername(),userPtr->getPassword());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -118,54 +118,45 @@ void loginHandler::setLoginFlag(bool flag)
|
||||||
}
|
}
|
||||||
QString loginHandler::getCurrentPageContect()
|
QString loginHandler::getCurrentPageContect()
|
||||||
{
|
{
|
||||||
QTextEdit phrase;
|
QTextEdit parse;
|
||||||
if (isLoggedInFlag())
|
if (isLoggedInFlag())
|
||||||
phrase.setText(jceLog->getPage());
|
parse.setText(jceLog->getPage());
|
||||||
else
|
else
|
||||||
throw jceLogin::ERROR_ON_GETTING_INFO;
|
return "";
|
||||||
|
return parse.toPlainText();
|
||||||
return phrase.toPlainText();
|
|
||||||
}
|
}
|
||||||
int loginHandler::makeGradeRequest(int fromYear, int toYear, int fromSemester, int toSemester)
|
int loginHandler::makeGradeRequest(int fromYear, int toYear, int fromSemester, int toSemester)
|
||||||
{
|
{
|
||||||
if (isLoggedInFlag())
|
if (isLoggedInFlag())
|
||||||
|
{
|
||||||
|
statusBar->setIconConnectionStatus(jceStatusBar::Sending);
|
||||||
return jceLog->getGrades(fromYear, toYear, fromSemester, toSemester);
|
return jceLog->getGrades(fromYear, toYear, fromSemester, toSemester);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return jceLogin::JCE_NOT_CONNECTED;
|
return jceLogin::JCE_NOT_CONNECTED;
|
||||||
}
|
}
|
||||||
int loginHandler::makeCalendarRequest(int year, int semester)
|
int loginHandler::makeCalendarRequest(int year, int semester)
|
||||||
{
|
{
|
||||||
if (isLoggedInFlag())
|
if (isLoggedInFlag())
|
||||||
|
{
|
||||||
|
statusBar->setIconConnectionStatus(jceStatusBar::Sending);
|
||||||
return jceLog->getCalendar(year,semester);
|
return jceLog->getCalendar(year,semester);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return jceLogin::JCE_NOT_CONNECTED;
|
return jceLogin::JCE_NOT_CONNECTED;
|
||||||
}
|
}
|
||||||
void loginHandler::setIconConnectionStatus(jceLogin::jceStatus statusDescription)
|
int loginHandler::makeExamsScheduleRequest(int year, int semester)
|
||||||
{
|
{
|
||||||
QPixmap iconPix;
|
|
||||||
switch (statusDescription)
|
|
||||||
{
|
|
||||||
case jceLogin::jceStatus::JCE_START_VALIDATING_PROGRESS:
|
|
||||||
iconPix.load(":/icons/blueStatusIcon.png");
|
|
||||||
statusBar->showMessage(tr("Connecting..."));
|
|
||||||
break;
|
|
||||||
case jceLogin::jceStatus::JCE_YOU_ARE_IN:
|
|
||||||
iconPix.load(":/icons/greenStatusIcon.png");
|
|
||||||
statusBar->showMessage(tr("Connected"));
|
|
||||||
break;
|
|
||||||
case jceLogin::jceStatus::JCE_NOT_CONNECTED:
|
|
||||||
iconPix.load(":/icons/redStatusIcon.png");
|
|
||||||
statusBar->showMessage(tr("Disconnected"));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
iconPix.load(":/icons/redStatusIcon.png");
|
|
||||||
statusBar->showMessage(tr("Ready."));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
iconButtomStatusLabel->setPixmap(iconPix);
|
|
||||||
|
|
||||||
this->statusBar->repaint();
|
if (isLoggedInFlag())
|
||||||
|
{
|
||||||
|
statusBar->setIconConnectionStatus(jceStatusBar::Sending);
|
||||||
|
return jceLog->getExams(year,semester);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return jceLogin::JCE_NOT_CONNECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
void loginHandler::popMessage(QString message,bool addInfo)
|
void loginHandler::popMessage(QString message,bool addInfo)
|
||||||
{
|
{
|
||||||
if (addInfo)
|
if (addInfo)
|
||||||
|
|
|
@ -6,27 +6,25 @@
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QStatusBar>
|
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
#include "./src/jceSettings/jcelogin.h"
|
#include "../../src/jceSettings/jcelogin.h"
|
||||||
#include "./src/appDatabase/savedata.h"
|
#include "../../src/appDatabase/savedata.h"
|
||||||
|
#include "../../main/jceWidgets/jcestatusbar.h"
|
||||||
|
|
||||||
|
|
||||||
class loginHandler : public QObject
|
class loginHandler : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
loginHandler(user *ptr, QStatusBar *statusBarPtr,QPushButton *loginButtonPtr);
|
loginHandler(user *ptr, QPushButton *loginButtonPtr, jceStatusBar *progressbarPtr);
|
||||||
~loginHandler()
|
~loginHandler()
|
||||||
{
|
{
|
||||||
delete iconButtomStatusLabel;
|
|
||||||
delete jceLog;
|
delete jceLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool login(QString username,QString password);
|
bool login(QString username,QString password);
|
||||||
void logout();
|
void logout();
|
||||||
void setIconConnectionStatus(jceLogin::jceStatus statusDescription);
|
|
||||||
|
|
||||||
bool makeConnection();
|
bool makeConnection();
|
||||||
|
|
||||||
|
@ -36,6 +34,7 @@ public:
|
||||||
|
|
||||||
int makeGradeRequest(int fromYear, int toYear, int fromSemester, int toSemester);
|
int makeGradeRequest(int fromYear, int toYear, int fromSemester, int toSemester);
|
||||||
int makeCalendarRequest(int year,int semester);
|
int makeCalendarRequest(int year,int semester);
|
||||||
|
int makeExamsScheduleRequest(int year, int semester);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void readyAfterConnectionLost();
|
void readyAfterConnectionLost();
|
||||||
|
@ -48,8 +47,8 @@ private:
|
||||||
jceLogin * jceLog;
|
jceLogin * jceLog;
|
||||||
user * userPtr;
|
user * userPtr;
|
||||||
|
|
||||||
QStatusBar *statusBar;
|
jceStatusBar *statusBar;
|
||||||
QLabel *iconButtomStatusLabel;
|
|
||||||
QPushButton *loginButtonPtr;
|
QPushButton *loginButtonPtr;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
150
main/jceWidgets/jcestatusbar.cpp
Normal file
|
@ -0,0 +1,150 @@
|
||||||
|
#include "jcestatusbar.h"
|
||||||
|
|
||||||
|
jceStatusBar::jceStatusBar(QWidget *parent) :
|
||||||
|
QStatusBar(parent)
|
||||||
|
{
|
||||||
|
this->setFixedHeight(STATUS_ICON_HEIGH+30);
|
||||||
|
this->showMessage(tr("Ready"));
|
||||||
|
this->setStyleSheet("QStatusBar {"
|
||||||
|
"border: 0px solid black;"
|
||||||
|
"background: rgba(255, 255, 255, 255);"
|
||||||
|
"padding: 3px;"
|
||||||
|
"padding-left: 1px;"
|
||||||
|
"padding-right: 1px;"
|
||||||
|
"min-height: 50px;"
|
||||||
|
"max-height: 50px;"
|
||||||
|
"}");
|
||||||
|
//Icon
|
||||||
|
iconButtomStatusLabel = new QLabel(this);
|
||||||
|
iconButtomStatusLabel->setStyleSheet("QLabel {"
|
||||||
|
"border: 0px solid black"
|
||||||
|
"border-radius: 16px;"
|
||||||
|
"padding: 1px;"
|
||||||
|
"padding-left: 1px;"
|
||||||
|
"padding-right: 1px;"
|
||||||
|
"min-width: 48px;"
|
||||||
|
"max-width: 48px;"
|
||||||
|
"min-height: 48px;"
|
||||||
|
"max-height: 48px;"
|
||||||
|
"}");
|
||||||
|
iconButtomStatusLabel->setMaximumHeight(STATUS_ICON_HEIGH+2);
|
||||||
|
iconButtomStatusLabel->setMinimumHeight(STATUS_ICON_HEIGH+2);
|
||||||
|
iconButtomStatusLabel->setAlignment(Qt::AlignHCenter);
|
||||||
|
|
||||||
|
//ProgressBar
|
||||||
|
progressBar = new QProgressBar(this);
|
||||||
|
connect(progressBar,SIGNAL(valueChanged(int)),this,SLOT(setProgressValue(int)));
|
||||||
|
connect(this,SIGNAL(progressHasPacket(int)),this,SLOT(addValueToProgressBar(int)));
|
||||||
|
|
||||||
|
progressBar->setFixedWidth(120);
|
||||||
|
progressBar->setFixedHeight(STATUS_ICON_HEIGH);
|
||||||
|
progressBar->setStyleSheet("QProgressBar {"
|
||||||
|
"border: 1px solid gray;"
|
||||||
|
"border-radius: 3px;"
|
||||||
|
"background: transparent;"
|
||||||
|
"padding: 1px;"
|
||||||
|
"}"
|
||||||
|
"QProgressBar::chunk {"
|
||||||
|
"background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 #b4e391 , stop: 1 #61c419);"
|
||||||
|
"}");
|
||||||
|
progressBar->setRange(0,100);
|
||||||
|
progressBar->setValue(0);
|
||||||
|
progressBar->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
|
progressBar->setTextVisible(true);
|
||||||
|
progressBar->setFormat("%p%");
|
||||||
|
progressBar->setOrientation(Qt::Horizontal);
|
||||||
|
|
||||||
|
|
||||||
|
addPermanentWidget(progressBar,0);
|
||||||
|
addPermanentWidget(iconButtomStatusLabel,0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void jceStatusBar::setIconConnectionStatus(jceProgressStatus update)
|
||||||
|
{
|
||||||
|
QPixmap iconPix;
|
||||||
|
switch (update)
|
||||||
|
{
|
||||||
|
case jceProgressStatus::Error:
|
||||||
|
setProgressValue(0);
|
||||||
|
iconPix.load(":/icons/disconnected.png");
|
||||||
|
showMessage(tr("Error"));
|
||||||
|
break;
|
||||||
|
case jceProgressStatus::Disconnected:
|
||||||
|
setProgressValue(0);
|
||||||
|
iconPix.load(":/icons/disconnected.png");
|
||||||
|
showMessage(tr("Disconnected"));
|
||||||
|
break;
|
||||||
|
case jceProgressStatus::Ready:
|
||||||
|
setProgressValue(0);
|
||||||
|
iconPix.load(":/icons/disconnected.png");
|
||||||
|
showMessage(tr("Ready"));
|
||||||
|
break;
|
||||||
|
case jceProgressStatus::Connecting:
|
||||||
|
setProgressValue(5);
|
||||||
|
iconPix.load(":/icons/busy.png");
|
||||||
|
showMessage(tr("Connecting..."));
|
||||||
|
break;
|
||||||
|
case jceProgressStatus::Sending:
|
||||||
|
if (progressBar->value() < 10)
|
||||||
|
setProgressValue(10);
|
||||||
|
iconPix.load(":/icons/busy.png");
|
||||||
|
showMessage(tr("Sending..."));
|
||||||
|
break;
|
||||||
|
case jceProgressStatus::Recieving:
|
||||||
|
if (progressBar->value() < 15)
|
||||||
|
setProgressValue(15);
|
||||||
|
iconPix.load(":/icons/busy.png");
|
||||||
|
showMessage(tr("Recieving..."));
|
||||||
|
break;
|
||||||
|
case jceProgressStatus::Connected:
|
||||||
|
setProgressValue(30);
|
||||||
|
iconPix.load(":/icons/busy.png");
|
||||||
|
showMessage(tr("Connected"));
|
||||||
|
break;
|
||||||
|
case jceProgressStatus::Inserting:
|
||||||
|
setProgressValue(80);
|
||||||
|
iconPix.load(":/icons/busy.png");
|
||||||
|
showMessage(tr("Inserting"));
|
||||||
|
break;
|
||||||
|
case jceProgressStatus::LoggedIn:
|
||||||
|
setProgressValue(100);
|
||||||
|
iconPix.load(":/icons/connected.png");
|
||||||
|
showMessage(tr("Logged In."));
|
||||||
|
break;
|
||||||
|
case jceProgressStatus::Done:
|
||||||
|
setProgressValue(100);
|
||||||
|
iconPix.load(":/icons/connected.png");
|
||||||
|
showMessage(tr("Done"));
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
iconButtomStatusLabel->setPixmap(iconPix);
|
||||||
|
|
||||||
|
repaint();
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @brief Every time the value changes this method will be called
|
||||||
|
* @param value = the value of the progress Bar
|
||||||
|
*/
|
||||||
|
void jceStatusBar::setProgressValue(int value)
|
||||||
|
{
|
||||||
|
if (value == 0 || value == 100)
|
||||||
|
{
|
||||||
|
progressBar->setVisible(false);
|
||||||
|
progressBar->setValue(0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
progressBar->setValue(value);
|
||||||
|
progressBar->setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void jceStatusBar::addValueToProgressBar(int value)
|
||||||
|
{
|
||||||
|
progressBar->setValue(progressBar->value() + value);
|
||||||
|
|
||||||
|
}
|
54
main/jceWidgets/jcestatusbar.h
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
#ifndef JCESTATUSBAR_H
|
||||||
|
#define JCESTATUSBAR_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QLayout>
|
||||||
|
#include <QStatusBar>
|
||||||
|
#include <QProgressBar>
|
||||||
|
#include <QLabel>
|
||||||
|
|
||||||
|
#define STATUS_ICON_HEIGH 48
|
||||||
|
|
||||||
|
class jceStatusBar : public QStatusBar
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
enum jceProgressStatus
|
||||||
|
{
|
||||||
|
Ready,
|
||||||
|
Disconnected,
|
||||||
|
Connecting,
|
||||||
|
Connected,
|
||||||
|
LoggedIn,
|
||||||
|
Sending,
|
||||||
|
Recieving,
|
||||||
|
Inserting,
|
||||||
|
Done,
|
||||||
|
Error
|
||||||
|
};
|
||||||
|
|
||||||
|
jceStatusBar(QWidget *parent = 0);
|
||||||
|
|
||||||
|
void setIconConnectionStatus(jceProgressStatus update);
|
||||||
|
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void progressHasPacket(int num);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void setProgressValue(int val);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void addValueToProgressBar(int value);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
QProgressBar * progressBar;
|
||||||
|
QLabel *iconButtomStatusLabel;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // JCESTATUSBAR_H
|
|
@ -5,34 +5,34 @@
|
||||||
#include "../src/appDatabase/savedata.h"
|
#include "../src/appDatabase/savedata.h"
|
||||||
#include "../src/appDatabase/jce_logger.h"
|
#include "../src/appDatabase/jce_logger.h"
|
||||||
|
|
||||||
|
//TODO: Project todo list
|
||||||
|
//update translation, update site spelling, release notes, update help
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#ifdef QT_DEBUG // Incase QtCreator is in Debug mode all qDebug messages will go to terminal
|
#ifdef QT_DEBUG // Incase QtCreator is in Debug mode all qDebug messages will go to terminal
|
||||||
qDebug() << "Running a debug build";
|
qDebug() << Q_FUNC_INFO << "Running a debug build";
|
||||||
#else // If QtCreator is on Release mode , qDebug messages will be logged in a log file.
|
#else // If QtCreator is on Release mode , qDebug messages will be logged in a log file.
|
||||||
// qDebug() << "Running a release build";
|
// qDebug() << "Running a release build";
|
||||||
qInstallMessageHandler(jce_logger::customMessageHandler);
|
qInstallMessageHandler(jce_logger::customMessageHandler);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qDebug() << "Start : JCE Manager Launched";
|
qDebug() << Q_FUNC_INFO << "Start : JCE Manager Launched";
|
||||||
|
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
QTranslator translator;
|
QTranslator translator;
|
||||||
QString loco;
|
|
||||||
SaveData data;
|
SaveData data;
|
||||||
loco = data.getLocal();
|
|
||||||
//Loading Local (From Settings file (SaveData.cpp)
|
//Loading Local (From Settings file (SaveData.cpp)
|
||||||
if(loco == "default")
|
if(data.getLocale() == "en")
|
||||||
{
|
{
|
||||||
QString locale = QLocale::system().name();
|
translator.load("jce_" + data.getLocale() , a.applicationDirPath());
|
||||||
translator.load("jce_"+locale , a.applicationDirPath());
|
qDebug() << Q_FUNC_INFO << "Locale : English Local Loaded";
|
||||||
qDebug() << "Local : Default Local Loaded";
|
}else if(data.getLocale() == "he"){
|
||||||
}else if(loco == "he"){
|
translator.load("jce_" + data.getLocale() , a.applicationDirPath());
|
||||||
translator.load("jce_he" , a.applicationDirPath());
|
qDebug() << Q_FUNC_INFO << "Local : Hebrew Local Loaded";
|
||||||
qDebug() << "Local : Hebrew Local Loaded";
|
|
||||||
}else{
|
}else{
|
||||||
translator.load("jce_en" , a.applicationDirPath());
|
translator.load("jce_en" , a.applicationDirPath());
|
||||||
qDebug() << "Local : English Local Loaded";
|
data.reset();
|
||||||
|
qCritical() << Q_FUNC_INFO << "save data corrupted, reset file.";
|
||||||
}
|
}
|
||||||
a.installTranslator(&translator); //Setting local
|
a.installTranslator(&translator); //Setting local
|
||||||
a.setApplicationVersion(APP_VERSION);
|
a.setApplicationVersion(APP_VERSION);
|
||||||
|
@ -42,8 +42,8 @@ int main(int argc, char *argv[])
|
||||||
//Getting the exit code from QApplication. for debug reasons
|
//Getting the exit code from QApplication. for debug reasons
|
||||||
int returnCode = a.exec();
|
int returnCode = a.exec();
|
||||||
if(returnCode == 0)
|
if(returnCode == 0)
|
||||||
qDebug() << "End : JCE Manager Ended Successfully With A Return Code: " << returnCode;
|
qDebug() << Q_FUNC_INFO << "End : JCE Manager Ended Successfully With A Return Code: " << returnCode;
|
||||||
else
|
else
|
||||||
qCritical() << "End : JCE Manager Ended Unusccessfully With A Return Code: " << returnCode;
|
qCritical() << Q_FUNC_INFO << "End : JCE Manager Ended Unusccessfully With A Return Code: " << returnCode;
|
||||||
return returnCode;
|
return returnCode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,362 +1,458 @@
|
||||||
#include "mainscreen.h"
|
#include "mainscreen.h"
|
||||||
#include "ui_mainscreen.h"
|
#include "ui_mainscreen.h"
|
||||||
|
|
||||||
|
|
||||||
MainScreen::MainScreen(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainScreen)
|
MainScreen::MainScreen(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainScreen)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
//this->setFixedSize(this->size()); //main not resizeable
|
this->isBlocked = false;
|
||||||
|
//Login Tab
|
||||||
|
iconPix.load(":/icons/iconX.png");
|
||||||
|
ui->pswdLineEdit->setEchoMode((QLineEdit::Password));
|
||||||
|
ui->labelUsrInputStatus->setVisible(false);
|
||||||
|
ui->labelPswInputStatus->setVisible(false);
|
||||||
|
ui->labelUsrInputStatus->setPixmap(iconPix);
|
||||||
|
ui->labelPswInputStatus->setPixmap(iconPix);
|
||||||
|
|
||||||
ui->labelMadeBy->setOpenExternalLinks(true);
|
//StatusBar
|
||||||
|
statusBar = new jceStatusBar(this);
|
||||||
|
this->setStatusBar(statusBar);
|
||||||
|
|
||||||
//Login Tab
|
//GPA Tab
|
||||||
iconPix.load(":/icons/iconX.png");
|
ui->avgLCD->setPalette(QPalette(QPalette::WindowText,Qt::blue));
|
||||||
ui->pswdLineEdit->setEchoMode((QLineEdit::Password));
|
|
||||||
ui->labelUsrInputStatus->setVisible(false);
|
|
||||||
ui->labelPswInputStatus->setVisible(false);
|
|
||||||
ui->labelUsrInputStatus->setPixmap(iconPix);
|
|
||||||
ui->labelPswInputStatus->setPixmap(iconPix);
|
|
||||||
|
|
||||||
//StatusBar
|
//Pointer allocating
|
||||||
ui->statusBar->setStyleSheet("QStatusBar::item { border: 0px solid black };");
|
qDebug() << Q_FUNC_INFO << "Allocating pointers";
|
||||||
ui->statusBar->setFixedHeight(STATUS_ICON_HEIGH);
|
this->userLoginSetting = new user("","");
|
||||||
ui->statusBar->showMessage(tr("Ready"));
|
this->courseTableMgr = new coursesTableManager(ui->coursesTable,userLoginSetting);
|
||||||
|
this->loginHandel = new loginHandler(userLoginSetting, ui->loginButton, statusBar);
|
||||||
|
this->calendar = new CalendarManager(this,ui->calendarGridLayoutMain);
|
||||||
|
this->data = new SaveData();
|
||||||
|
|
||||||
//GPA Tab
|
//check login File
|
||||||
ui->avgLCD->setPalette(QPalette(QPalette::WindowText,Qt::blue));
|
if (data->isSaved())
|
||||||
|
|
||||||
//Pointer allocating
|
|
||||||
qDebug() << Q_FUNC_INFO << "Allocating pointers";
|
|
||||||
this->userLoginSetting = new user("","");
|
|
||||||
this->courseTableMgr = new coursesTableManager(ui->coursesTable,userLoginSetting);
|
|
||||||
this->loginHandel = new loginHandler(userLoginSetting,ui->statusBar,ui->loginButton);
|
|
||||||
this->calendar = new CalendarManager(ui->calendarGridLayoutMain);
|
|
||||||
this->data = new SaveData();
|
|
||||||
|
|
||||||
//check login File
|
|
||||||
if (data->isSaved())
|
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "Loading data from file";
|
qDebug() << Q_FUNC_INFO << "Loading data from file";
|
||||||
ui->usrnmLineEdit->setText(data->getUsername());
|
ui->usrnmLineEdit->setText(data->getUsername());
|
||||||
ui->pswdLineEdit->setText(data->getPassword());
|
ui->pswdLineEdit->setText(data->getPassword());
|
||||||
ui->keepLogin->setChecked(true);
|
ui->keepLogin->setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//language
|
//language
|
||||||
qDebug() << Q_FUNC_INFO << "Checking locale";
|
qDebug() << Q_FUNC_INFO << "Checking locale";
|
||||||
checkLocale();
|
checkLocale();
|
||||||
qDebug() << Q_FUNC_INFO << "Ready.";
|
qDebug() << Q_FUNC_INFO << "Ready.";
|
||||||
|
|
||||||
}
|
}
|
||||||
MainScreen::~MainScreen()
|
MainScreen::~MainScreen()
|
||||||
{
|
{
|
||||||
delete calendar;
|
delete statusBar;
|
||||||
delete courseTableMgr;
|
delete calendar;
|
||||||
delete userLoginSetting;
|
delete courseTableMgr;
|
||||||
delete loginHandel;
|
delete userLoginSetting;
|
||||||
delete data;
|
delete loginHandel;
|
||||||
delete ui;
|
delete data;
|
||||||
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
//EVENTS ON LOGIN TAB
|
//EVENTS ON LOGIN TAB
|
||||||
void MainScreen::on_loginButton_clicked()
|
void MainScreen::on_loginButton_clicked()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "in: " << ui->tabWidget->currentWidget()->objectName();
|
if (!isBusy())
|
||||||
if ((ui->usrnmLineEdit->text().isEmpty()) || (ui->pswdLineEdit->text().isEmpty()))
|
|
||||||
{
|
{
|
||||||
if (ui->usrnmLineEdit->text().isEmpty())
|
lock();
|
||||||
|
qDebug() << Q_FUNC_INFO << "in: " << ui->tabWidget->currentWidget()->objectName();
|
||||||
|
if ((ui->usrnmLineEdit->text().isEmpty()) || (ui->pswdLineEdit->text().isEmpty()))
|
||||||
{
|
{
|
||||||
ui->labelUsrInputStatus->setVisible(true);
|
if (ui->usrnmLineEdit->text().isEmpty())
|
||||||
qDebug() << Q_FUNC_INFO << "username input is empty";
|
{
|
||||||
}
|
ui->labelUsrInputStatus->setVisible(true);
|
||||||
else
|
qDebug() << Q_FUNC_INFO << "username input is empty";
|
||||||
ui->labelUsrInputStatus->setVisible(false);
|
}
|
||||||
if (ui->pswdLineEdit->text().isEmpty())
|
else
|
||||||
{
|
ui->labelUsrInputStatus->setVisible(false);
|
||||||
ui->labelPswInputStatus->setVisible(true);
|
if (ui->pswdLineEdit->text().isEmpty())
|
||||||
qDebug() << Q_FUNC_INFO << "password input is empty";
|
{
|
||||||
}
|
ui->labelPswInputStatus->setVisible(true);
|
||||||
else
|
qDebug() << Q_FUNC_INFO << "password input is empty";
|
||||||
ui->labelPswInputStatus->setVisible(false);
|
}
|
||||||
return;
|
else
|
||||||
}
|
ui->labelPswInputStatus->setVisible(false);
|
||||||
else
|
|
||||||
{
|
|
||||||
ui->labelUsrInputStatus->setVisible(false);
|
|
||||||
ui->labelPswInputStatus->setVisible(false);
|
|
||||||
}
|
|
||||||
qDebug() << Q_FUNC_INFO << "login session start";
|
|
||||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
|
||||||
if (this->loginHandel->login(ui->usrnmLineEdit->text(),ui->pswdLineEdit->text()) == true)
|
|
||||||
{
|
|
||||||
qDebug() << Q_FUNC_INFO << "login session end with true";
|
|
||||||
ui->pswdLineEdit->setDisabled(true);
|
|
||||||
ui->usrnmLineEdit->setDisabled(true);
|
|
||||||
if (ui->keepLogin->isChecked())
|
|
||||||
{
|
|
||||||
qDebug() << Q_FUNC_INFO << "saving data";
|
|
||||||
data->setUsername(ui->usrnmLineEdit->text());
|
|
||||||
data->setPassword(ui->pswdLineEdit->text());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
qDebug() << Q_FUNC_INFO << "login session end with false";
|
|
||||||
ui->pswdLineEdit->setDisabled(false);
|
|
||||||
ui->usrnmLineEdit->setDisabled(false);
|
|
||||||
|
|
||||||
|
unlock();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->labelUsrInputStatus->setVisible(false);
|
||||||
|
ui->labelPswInputStatus->setVisible(false);
|
||||||
|
}
|
||||||
|
qDebug() << Q_FUNC_INFO << "login session start";
|
||||||
|
if (this->loginHandel->login(ui->usrnmLineEdit->text(),ui->pswdLineEdit->text()) == true)
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO << "login session end with true";
|
||||||
|
ui->pswdLineEdit->setDisabled(true);
|
||||||
|
ui->usrnmLineEdit->setDisabled(true);
|
||||||
|
if (ui->keepLogin->isChecked())
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO << "saving data";
|
||||||
|
data->setUsername(ui->usrnmLineEdit->text());
|
||||||
|
data->setPassword(ui->pswdLineEdit->text());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO << "login session end with false";
|
||||||
|
ui->pswdLineEdit->setDisabled(false);
|
||||||
|
ui->usrnmLineEdit->setDisabled(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
unlock();
|
||||||
}
|
}
|
||||||
QApplication::restoreOverrideCursor();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
void MainScreen::on_keepLogin_clicked()
|
void MainScreen::on_keepLogin_clicked()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "in: " << ui->tabWidget->currentWidget()->objectName();
|
qDebug() << Q_FUNC_INFO << "in: " << ui->tabWidget->currentWidget()->objectName();
|
||||||
if (ui->keepLogin->isChecked())
|
if (ui->keepLogin->isChecked())
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "saving data";
|
qDebug() << Q_FUNC_INFO << "saving data";
|
||||||
data->setUsername(ui->usrnmLineEdit->text());
|
data->setUsername(ui->usrnmLineEdit->text());
|
||||||
data->setPassword(ui->pswdLineEdit->text());
|
data->setPassword(ui->pswdLineEdit->text());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
data->reset();
|
data->reset();
|
||||||
}
|
}
|
||||||
void MainScreen::on_usrnmLineEdit_editingFinished()
|
void MainScreen::on_usrnmLineEdit_editingFinished()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "in: " << ui->tabWidget->currentWidget()->objectName();
|
ui->usrnmLineEdit->setText(ui->usrnmLineEdit->text().toLower());
|
||||||
ui->usrnmLineEdit->setText(ui->usrnmLineEdit->text().toLower());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//EVENTS ON GPA TAB
|
//EVENTS ON GPA TAB
|
||||||
void MainScreen::on_ratesButton_clicked()
|
void MainScreen::on_ratesButton_clicked()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "in: " << ui->tabWidget->currentWidget()->objectName();
|
qDebug() << Q_FUNC_INFO << "in: " << ui->tabWidget->currentWidget()->objectName();
|
||||||
if (!checkIfValidDates())
|
if (!isBusy())
|
||||||
{
|
{
|
||||||
qWarning() << Q_FUNC_INFO << "Invalid dates! return";
|
lock();
|
||||||
QMessageBox::critical(this,tr("Error"),tr("Invalid Dates.\nMake Sure everything is correct and try again"));
|
if (!checkIfValidDates())
|
||||||
return;
|
{
|
||||||
|
qWarning() << Q_FUNC_INFO << "Invalid dates! return";
|
||||||
|
QMessageBox::critical(this,tr("Error"),tr("Invalid Dates.\nMake Sure everything is correct and try again"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QString pageString;
|
||||||
|
int status = 0;
|
||||||
|
if (loginHandel->isLoggedInFlag())
|
||||||
|
{
|
||||||
|
statusBar->setIconConnectionStatus(jceStatusBar::Ready);
|
||||||
|
if ((status = loginHandel->makeGradeRequest(ui->spinBoxCoursesFromYear->value(),
|
||||||
|
ui->spinBoxCoursesToYear->value(),ui->spinBoxCoursesFromSemester->value(),
|
||||||
|
ui->spinBoxCoursesToSemester->value())) == jceLogin::JCE_PAGE_PASSED)
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO << "grade page is ready";
|
||||||
|
statusBar->setIconConnectionStatus(jceStatusBar::Inserting);
|
||||||
|
pageString = loginHandel->getCurrentPageContect();
|
||||||
|
courseTableMgr->setCoursesList(pageString);
|
||||||
|
statusBar->setIconConnectionStatus(jceStatusBar::Done);
|
||||||
|
}
|
||||||
|
else if (status == jceLogin::JCE_NOT_CONNECTED)
|
||||||
|
{
|
||||||
|
qWarning() << Q_FUNC_INFO << "not connected";
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
|
QMessageBox::critical(this,tr("Error"),tr("Not Connected"));
|
||||||
|
statusBar->setIconConnectionStatus(jceStatusBar::Disconnected);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
statusBar->setIconConnectionStatus(jceStatusBar::Error);
|
||||||
|
qCritical() << Q_FUNC_INFO << "grade get ended with" << status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unlock();
|
||||||
}
|
}
|
||||||
QString pageString;
|
|
||||||
int status = 0;
|
|
||||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
|
||||||
if (loginHandel->isLoggedInFlag())
|
|
||||||
{
|
|
||||||
if ((status = loginHandel->makeGradeRequest(ui->spinBoxCoursesFromYear->value(),
|
|
||||||
ui->spinBoxCoursesToYear->value(),ui->spinBoxCoursesFromSemester->value(),
|
|
||||||
ui->spinBoxCoursesToSemester->value())) == jceLogin::JCE_PAGE_PASSED)
|
|
||||||
{
|
|
||||||
qDebug() << Q_FUNC_INFO << "grade page is ready";
|
|
||||||
pageString = loginHandel->getCurrentPageContect();
|
|
||||||
courseTableMgr->setCoursesList(pageString);
|
|
||||||
courseTableMgr->insertJceCoursesIntoTable();
|
|
||||||
}
|
|
||||||
else if (status == jceLogin::JCE_NOT_CONNECTED)
|
|
||||||
{
|
|
||||||
qWarning() << Q_FUNC_INFO << "not connected";
|
|
||||||
QApplication::restoreOverrideCursor();
|
|
||||||
QMessageBox::critical(this,tr("Error"),tr("Not Connected"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
qCritical() << Q_FUNC_INFO << "grade get ended with" << status;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QApplication::restoreOverrideCursor();
|
|
||||||
}
|
}
|
||||||
bool MainScreen::checkIfValidDates()
|
bool MainScreen::checkIfValidDates()
|
||||||
{
|
{
|
||||||
bool flag = false;
|
bool flag = false;
|
||||||
if (ui->spinBoxCoursesFromYear->value() < ui->spinBoxCoursesToYear->value())
|
if (ui->spinBoxCoursesFromYear->value() < ui->spinBoxCoursesToYear->value())
|
||||||
{
|
{
|
||||||
//doesnt matter what is the semester, its valid!
|
//doesnt matter what is the semester, its valid!
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
else if ((ui->spinBoxCoursesFromYear->value() == ui->spinBoxCoursesToYear->value()))
|
|
||||||
{
|
|
||||||
//semester from must be equal or less than to semester
|
|
||||||
if (ui->spinBoxCoursesFromSemester->value() <= ui->spinBoxCoursesToSemester->value())
|
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
return flag;
|
else if ((ui->spinBoxCoursesFromYear->value() == ui->spinBoxCoursesToYear->value()))
|
||||||
|
{
|
||||||
|
//semester from must be equal or less than to semester
|
||||||
|
if (ui->spinBoxCoursesFromSemester->value() <= ui->spinBoxCoursesToSemester->value())
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainScreen::on_checkBoxCoursesInfluence_toggled(bool checked)
|
void MainScreen::on_checkBoxCoursesInfluence_toggled(bool checked)
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "only main courses toggeled" << checked;
|
qDebug() << Q_FUNC_INFO << "only main courses toggeled" << checked;
|
||||||
this->userLoginSetting->setInfluenceCourseOnly(checked);
|
this->userLoginSetting->setInfluenceCourseOnly(checked);
|
||||||
this->courseTableMgr->influnceCourseChanged(checked);
|
this->courseTableMgr->influnceCourseChanged(checked);
|
||||||
}
|
}
|
||||||
void MainScreen::on_spinBoxCoursesFromYear_valueChanged(int arg1)
|
void MainScreen::on_spinBoxCoursesFromYear_valueChanged(int arg1)
|
||||||
{
|
{
|
||||||
ui->spinBoxCoursesFromYear->setValue(arg1);
|
ui->spinBoxCoursesFromYear->setValue(arg1);
|
||||||
}
|
}
|
||||||
void MainScreen::on_spinBoxCoursesToYear_valueChanged(int arg1)
|
void MainScreen::on_spinBoxCoursesToYear_valueChanged(int arg1)
|
||||||
{
|
{
|
||||||
ui->spinBoxCoursesToYear->setValue(arg1);
|
ui->spinBoxCoursesToYear->setValue(arg1);
|
||||||
|
|
||||||
}
|
}
|
||||||
void MainScreen::on_spinBoxCoursesFromSemester_valueChanged(int arg1)
|
void MainScreen::on_spinBoxCoursesFromSemester_valueChanged(int arg1)
|
||||||
{
|
{
|
||||||
ui->spinBoxCoursesFromSemester->setValue(arg1%4);
|
ui->spinBoxCoursesFromSemester->setValue(arg1%4);
|
||||||
}
|
}
|
||||||
void MainScreen::on_spinBoxCoursesToSemester_valueChanged(int arg1)
|
void MainScreen::on_spinBoxCoursesToSemester_valueChanged(int arg1)
|
||||||
{
|
{
|
||||||
ui->spinBoxCoursesToSemester->setValue(arg1%4);
|
ui->spinBoxCoursesToSemester->setValue(arg1%4);
|
||||||
}
|
}
|
||||||
void MainScreen::on_coursesTable_itemChanged(QTableWidgetItem *item)
|
void MainScreen::on_coursesTable_itemChanged(QTableWidgetItem *item)
|
||||||
{
|
{
|
||||||
if (this->courseTableMgr->changes(item->text(),item->row(),item->column()))
|
if (this->courseTableMgr->changes(item->text(),item->row(),item->column()))
|
||||||
ui->avgLCD->display(courseTableMgr->getAvg());
|
ui->avgLCD->display(courseTableMgr->getAvg());
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qWarning() << Q_FUNC_INFO << "missmatch data";
|
qWarning() << Q_FUNC_INFO << "missmatch data";
|
||||||
QMessageBox::critical(this,tr("Error"),tr("Missmatching data"));
|
QMessageBox::critical(this,tr("Error"),tr("Missmatching data"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void MainScreen::on_clearTableButton_clicked()
|
void MainScreen::on_clearTableButton_clicked()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "in: " << ui->tabWidget->currentWidget()->objectName();
|
qDebug() << Q_FUNC_INFO << "in: " << ui->tabWidget->currentWidget()->objectName();
|
||||||
courseTableMgr->clearTable();
|
courseTableMgr->clearTable();
|
||||||
ui->avgLCD->display(courseTableMgr->getAvg());
|
ui->avgLCD->display(courseTableMgr->getAvg());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainScreen::on_graphButton_clicked()
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
if (!courseTableMgr->showGraph())
|
||||||
|
QMessageBox::critical(this,tr("Error"),tr("You must to load GPA first\nClick on 'Get GPA'"));
|
||||||
|
}
|
||||||
|
void MainScreen::on_revertBtn_clicked()
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
if (!isBusy())
|
||||||
|
{
|
||||||
|
lock();
|
||||||
|
courseTableMgr->revertChanges();
|
||||||
|
unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//EVENTS ON CALENDAR TAB
|
//EVENTS ON CALENDAR TAB
|
||||||
|
void MainScreen::on_examsBtn_clicked()
|
||||||
|
{
|
||||||
|
calendar->showExamDialog();
|
||||||
|
}
|
||||||
void MainScreen::on_getCalendarBtn_clicked()
|
void MainScreen::on_getCalendarBtn_clicked()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "in: " << ui->tabWidget->currentWidget()->objectName();
|
qDebug() << Q_FUNC_INFO << "in: " << ui->tabWidget->currentWidget()->objectName();
|
||||||
int status = 0;
|
if (!isBusy())
|
||||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
|
||||||
if (loginHandel->isLoggedInFlag())
|
|
||||||
{
|
{
|
||||||
if ((status = loginHandel->makeCalendarRequest(ui->spinBoxYear->value(),ui->spinBoxSemester->value())) == jceLogin::JCE_PAGE_PASSED)
|
lock();
|
||||||
|
int status = 0;
|
||||||
|
QString page;
|
||||||
|
if (loginHandel->isLoggedInFlag())
|
||||||
{
|
{
|
||||||
//Use it for debug. add plain text and change the object name to 'plainTextEdit' so you will get the html request
|
statusBar->setIconConnectionStatus(jceStatusBar::Ready);
|
||||||
//ui->plainTextEdit->setPlainText(loginHandel->getCurrentPageContect());
|
if ((status = loginHandel->makeCalendarRequest(ui->spinBoxYear->value(),ui->spinBoxSemester->value())) == jceLogin::JCE_PAGE_PASSED)
|
||||||
calendar->resetTable();
|
{
|
||||||
calendar->setCalendar(loginHandel->getCurrentPageContect());
|
statusBar->setIconConnectionStatus(jceStatusBar::Inserting);
|
||||||
qDebug() << Q_FUNC_INFO << "calendar is loaded";
|
calendar->resetTable();
|
||||||
}
|
page = loginHandel->getCurrentPageContect();
|
||||||
|
calendar->setCalendar(page);
|
||||||
|
|
||||||
else if (status == jceLogin::JCE_NOT_CONNECTED)
|
qDebug() << Q_FUNC_INFO << "calendar is loaded";
|
||||||
{
|
|
||||||
qWarning() << Q_FUNC_INFO << "not connected";
|
//auto getting exam
|
||||||
QApplication::restoreOverrideCursor();
|
if (loginHandel->isLoggedInFlag())
|
||||||
QMessageBox::critical(this,tr("Error"),tr("Not Connected"));
|
{
|
||||||
|
if ((status = loginHandel->makeExamsScheduleRequest(ui->spinBoxYear->value(),ui->spinBoxSemester->value())) == jceLogin::JCE_PAGE_PASSED)
|
||||||
|
{
|
||||||
|
page = loginHandel->getCurrentPageContect();
|
||||||
|
calendar->setExamsSchedule(page);
|
||||||
|
qDebug() << Q_FUNC_INFO << "exams schedule is loaded";
|
||||||
|
statusBar->setIconConnectionStatus(jceStatusBar::Done);
|
||||||
|
}
|
||||||
|
else if (status == jceLogin::JCE_NOT_CONNECTED)
|
||||||
|
{
|
||||||
|
qWarning() << Q_FUNC_INFO << "not connected";
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
|
QMessageBox::critical(this,tr("Error"),tr("Not Connected"));
|
||||||
|
statusBar->setIconConnectionStatus(jceStatusBar::Disconnected);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
qCritical() << Q_FUNC_INFO << "exams request get ended with" << status;
|
||||||
|
}
|
||||||
|
else if (status == jceLogin::JCE_NOT_CONNECTED)
|
||||||
|
{
|
||||||
|
qWarning() << Q_FUNC_INFO << "not connected";
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
|
QMessageBox::critical(this,tr("Error"),tr("Not Connected"));
|
||||||
|
statusBar->setIconConnectionStatus(jceStatusBar::Disconnected);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
qCritical() << Q_FUNC_INFO << "calendar get ended with" << status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
unlock();
|
||||||
qCritical() << Q_FUNC_INFO << "calendar get ended with" << status;
|
|
||||||
}
|
}
|
||||||
QApplication::restoreOverrideCursor();
|
|
||||||
}
|
}
|
||||||
void MainScreen::on_exportToCVSBtn_clicked()
|
void MainScreen::on_exportToCVSBtn_clicked()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "in: " << ui->tabWidget->currentWidget()->objectName();
|
qDebug() << Q_FUNC_INFO << "in: " << ui->tabWidget->currentWidget()->objectName();
|
||||||
if (loginHandel->isLoggedInFlag())
|
if (loginHandel->isLoggedInFlag())
|
||||||
{
|
{
|
||||||
this->calendar->exportCalendarCSV();
|
this->calendar->exportCalendarCSV();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//EVENTS ON MENU BAR
|
//EVENTS ON MENU BAR
|
||||||
void MainScreen::on_actionCredits_triggered()
|
//void MainScreen::on_actionHebrew_triggered()
|
||||||
{
|
//{
|
||||||
qDebug() << Q_FUNC_INFO;
|
// qDebug() << Q_FUNC_INFO;
|
||||||
QMessageBox::about(this, "About",
|
// if (ui->actionEnglish->isChecked() || ui->actionOS_Default->isChecked())
|
||||||
"<a href='http://liranbg.github.io/JceManager/'>Jce Manager</a> v1.0.0<br><br>"
|
// {
|
||||||
+tr("License:")+
|
// ui->actionEnglish->setChecked(false);
|
||||||
"<br>GNU LESSER GENERAL PUBLIC LICENSE V2.1<br>"
|
// ui->actionOS_Default->setChecked(false);
|
||||||
+"<br>"+
|
// qDebug() << Q_FUNC_INFO << "Changed Language to hebrew";
|
||||||
"<a href='https://github.com/liranbg/JceManager'>JceManager Repository</a>"+
|
// data->setLocal("he");
|
||||||
"<br><br>"
|
// QMessageBox::information(this,tr("Settings"),tr("Your settings will take effect next time you start the program"),QMessageBox::Ok);
|
||||||
+tr("Powered By: ")+
|
// }
|
||||||
"<a href='https://github.com/liranbg/jceConnection'> Jce Connection</a><br><br>"
|
// else
|
||||||
+tr("Developed By")+
|
// ui->actionHebrew->setChecked(true);
|
||||||
":<ul>"+
|
//}
|
||||||
"<li><a href='mailto:liranbg@gmail.com'>"+tr("Liran")+"</a></li>"+
|
//void MainScreen::on_actionEnglish_triggered()
|
||||||
"<li><a href='mailto:sagidayan@gmail.com'>"+tr("Sagi")+"</a></li></ul>"
|
//{
|
||||||
);
|
// qDebug() << Q_FUNC_INFO;
|
||||||
}
|
// if (ui->actionHebrew->isChecked() || ui->actionOS_Default->isChecked())
|
||||||
void MainScreen::on_actionExit_triggered()
|
// {
|
||||||
{
|
// ui->actionHebrew->setChecked(false);
|
||||||
qDebug() << Q_FUNC_INFO;
|
// ui->actionOS_Default->setChecked(false);
|
||||||
exit(0);
|
// qDebug() << Q_FUNC_INFO << "Changed Language to English";
|
||||||
}
|
// data->setLocal("en");
|
||||||
void MainScreen::on_actionHow_To_triggered()
|
// QMessageBox::information(this,"Settings",tr("Your settings will take effect next time you start the program"),QMessageBox::Ok);
|
||||||
{
|
// }
|
||||||
qDebug() << Q_FUNC_INFO;
|
// else
|
||||||
QMessageBox::information(this,"How To",
|
// ui->actionEnglish->setChecked(true);
|
||||||
"<b>"
|
//}
|
||||||
+tr("Help Guide")+
|
//void MainScreen::on_actionOS_Default_triggered()
|
||||||
"</b><ul>"
|
//{
|
||||||
+tr("<br><li>Login: <ul><li>Type your username and password and click Login.</li><li>Once you are connected, you will see a green ball in the right buttom panel.</li></ul></li>")
|
// qDebug() << Q_FUNC_INFO;
|
||||||
+tr("<br><li>Getting GPA sheet<ul><li>Click on GPA Tab</li><li> Select your dates and click on Add</li></ul></li>")
|
// if (ui->actionHebrew->isChecked() || ui->actionEnglish->isChecked())
|
||||||
+tr("<br><li>Average Changing<ul><li>Change one of your grade and see the average in the buttom panel changing.</li></ul></li>")
|
// {
|
||||||
+tr("<br><li>Getting Calendar<ul><li>Click on Calendar Tab</li><li> Select your dates and click on Get Calendar</li></ul></li>")
|
// ui->actionHebrew->setChecked(false);
|
||||||
+tr("<br><li>For exporting your calendar to a .CSV file:<ul><li>Do previous step and continue to next step</li><li> Click on Export to CSV</li><li>Select your dates and click OK</li><li>Once you're Done, go on your calendar and import your csv file</li></li>")+
|
// ui->actionEnglish->setChecked(false);
|
||||||
"<br><br>"
|
// qDebug() << Q_FUNC_INFO << "Changed Language to OS Default";
|
||||||
+tr("<b>For more information, please visit us at: <a href='http://liranbg.github.io/JceManager/'>Jce Manager site</a></b>"));
|
// data->setLocal("default");
|
||||||
}
|
//
|
||||||
void MainScreen::on_actionHebrew_triggered()
|
// }
|
||||||
{
|
// else
|
||||||
qDebug() << Q_FUNC_INFO;
|
// ui->actionOS_Default->setChecked(true);
|
||||||
if (ui->actionEnglish->isChecked() || ui->actionOS_Default->isChecked())
|
//}
|
||||||
{
|
//MAIN SCREEN
|
||||||
ui->actionEnglish->setChecked(false);
|
|
||||||
ui->actionOS_Default->setChecked(false);
|
|
||||||
qDebug() << Q_FUNC_INFO << "Changed Language to hebrew";
|
|
||||||
data->setLocal("he");
|
|
||||||
QMessageBox::information(this,tr("Settings"),tr("Your settings will take effect next time you start the program"),QMessageBox::Ok);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ui->actionHebrew->setChecked(true);
|
|
||||||
}
|
|
||||||
void MainScreen::on_actionEnglish_triggered()
|
|
||||||
{
|
|
||||||
qDebug() << Q_FUNC_INFO;
|
|
||||||
if (ui->actionHebrew->isChecked() || ui->actionOS_Default->isChecked())
|
|
||||||
{
|
|
||||||
ui->actionHebrew->setChecked(false);
|
|
||||||
ui->actionOS_Default->setChecked(false);
|
|
||||||
qDebug() << Q_FUNC_INFO << "Changed Language to English";
|
|
||||||
data->setLocal("en");
|
|
||||||
QMessageBox::information(this,"Settings",tr("Your settings will take effect next time you start the program"),QMessageBox::Ok);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ui->actionEnglish->setChecked(true);
|
|
||||||
}
|
|
||||||
void MainScreen::on_actionOS_Default_triggered()
|
|
||||||
{
|
|
||||||
qDebug() << Q_FUNC_INFO;
|
|
||||||
if (ui->actionHebrew->isChecked() || ui->actionEnglish->isChecked())
|
|
||||||
{
|
|
||||||
ui->actionHebrew->setChecked(false);
|
|
||||||
ui->actionEnglish->setChecked(false);
|
|
||||||
qDebug() << Q_FUNC_INFO << "Changed Language to OS Default";
|
|
||||||
data->setLocal("default");
|
|
||||||
QMessageBox::information(this,tr("Settings"),tr("Your settings will take effect next time you start the program"),QMessageBox::Ok);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ui->actionOS_Default->setChecked(true);
|
|
||||||
}
|
|
||||||
void MainScreen::checkLocale()
|
|
||||||
{
|
|
||||||
if(data->getLocal() == "en")
|
|
||||||
{
|
|
||||||
ui->actionHebrew->setChecked(false);
|
|
||||||
ui->actionOS_Default->setChecked(false);
|
|
||||||
ui->actionEnglish->setChecked(true);
|
|
||||||
}else if(data->getLocal() == "he"){
|
|
||||||
ui->actionHebrew->setChecked(true);
|
|
||||||
ui->actionOS_Default->setChecked(false);
|
|
||||||
ui->actionEnglish->setChecked(false);
|
|
||||||
}else{
|
|
||||||
ui->actionHebrew->setChecked(false);
|
|
||||||
ui->actionOS_Default->setChecked(true);
|
|
||||||
ui->actionEnglish->setChecked(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainScreen::on_labelMadeBy_linkActivated(const QString &link)
|
void MainScreen::on_labelMadeBy_linkActivated(const QString &link)
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "link: " << link;
|
qDebug() << Q_FUNC_INFO << "link: " << link;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @brief MainScreen::lock
|
||||||
|
* turn isblocked into true to avoid multiple requests and to cause errors
|
||||||
|
*/
|
||||||
|
void MainScreen::lock()
|
||||||
|
{
|
||||||
|
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||||
|
this->isBlocked = true;
|
||||||
|
}
|
||||||
|
void MainScreen::unlock()
|
||||||
|
{
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
|
this->isBlocked = false;
|
||||||
|
}
|
||||||
|
bool MainScreen::isBusy()
|
||||||
|
{
|
||||||
|
return this->isBlocked;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainScreen::on_langButton_clicked()
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
if (data->getLocale() == "en")
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO << "Changed lang to he";
|
||||||
|
data->setLocale("he");
|
||||||
|
|
||||||
|
}else if(data->getLocale() == "he"){
|
||||||
|
qDebug() << Q_FUNC_INFO << "Changed lang to en";
|
||||||
|
data->setLocale("en");
|
||||||
|
}else{
|
||||||
|
qCritical() << Q_FUNC_INFO << "currupted data. reset to en";
|
||||||
|
data->reset();
|
||||||
|
data->setLocale("en");
|
||||||
|
}
|
||||||
|
checkLocale();
|
||||||
|
|
||||||
|
|
||||||
|
QMessageBox::information(this,tr("Settings"),tr("Your settings will take effect next time you start the program"),QMessageBox::Ok);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainScreen::on_creditButton_clicked()
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
QMessageBox::about(this, "About",
|
||||||
|
"<a href='http://liranbg.github.io/JceManager/'>Jce Manager</a> v1.0.0<br><br>"
|
||||||
|
+tr("License:")+
|
||||||
|
"<br>GNU LESSER GENERAL PUBLIC LICENSE V2.1<br>"
|
||||||
|
+"<br>"+
|
||||||
|
"<a href='https://github.com/liranbg/JceManager'>JceManager Repository</a>"+
|
||||||
|
"<br><br>"
|
||||||
|
+tr("Powered By: ")+
|
||||||
|
"<a href='https://github.com/liranbg/jceConnection'> Jce Connection</a><br><br>"
|
||||||
|
+tr("Developed By")+
|
||||||
|
":<ul>"+
|
||||||
|
"<li><a href='mailto:liranbg@gmail.com'>"+tr("Liran")+"</a></li>"+
|
||||||
|
"<li><a href='mailto:sagidayan@gmail.com'>"+tr("Sagi")+"</a></li></ul>"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainScreen::on_howtoButton_clicked()
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
QMessageBox::information(this,"How To",
|
||||||
|
"<b>"
|
||||||
|
+tr("Help Guide")+
|
||||||
|
"</b><ul>"
|
||||||
|
+tr("<br><li>Login: <ul><li>Type your username and password and click Login.</li><li>Once you are connected, you will see a green ball in the right buttom panel.</li></ul></li>")
|
||||||
|
+tr("<br><li>Getting GPA sheet<ul><li>Click on GPA Tab</li><li> Select your dates and click on Add</li></ul></li>")
|
||||||
|
+tr("<br><li>Average Changing<ul><li>Change one of your grade and see the average in the buttom panel changing.</li></ul></li>")
|
||||||
|
+tr("<br><li>Getting Calendar<ul><li>Click on Calendar Tab</li><li> Select your dates and click on Get Calendar</li></ul></li>")
|
||||||
|
+tr("<br><li>For exporting your calendar to a .CSV file:<ul><li>Do previous step and continue to next step</li><li> Click on Export to CSV</li><li>Select your dates and click OK</li><li>Once you're Done, go on your calendar and import your csv file</li></li>")+
|
||||||
|
"<br><br>"
|
||||||
|
+tr("<b>For more information, please visit us at: <a href='http://liranbg.github.io/JceManager/'>Jce Manager site</a></b>"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainScreen::checkLocale()
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
if (data->getLocale() == "en")
|
||||||
|
{
|
||||||
|
ui->langButton->setIcon(QIcon(":/icons/us.png"));
|
||||||
|
|
||||||
|
}else if(data->getLocale() == "he"){
|
||||||
|
ui->langButton->setIcon(QIcon(":/icons/il.png"));
|
||||||
|
}else{
|
||||||
|
qCritical() << Q_FUNC_INFO << "currupted data. reset eng";
|
||||||
|
data->reset();
|
||||||
|
ui->langButton->setIcon(QIcon(":/icons/us.png"));
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,9 +10,10 @@
|
||||||
#include "./CourseTab/coursestablemanager.h"
|
#include "./CourseTab/coursestablemanager.h"
|
||||||
#include "./LoginTab/loginhandler.h"
|
#include "./LoginTab/loginhandler.h"
|
||||||
#include "./CalendarTab/CalendarManager.h"
|
#include "./CalendarTab/CalendarManager.h"
|
||||||
|
#include "./jceWidgets/jcestatusbar.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define STATUS_ICON_HEIGH 35
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class MainScreen;
|
class MainScreen;
|
||||||
}
|
}
|
||||||
|
@ -27,54 +28,50 @@ public:
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void on_ratesButton_clicked();
|
//Login Tab slots
|
||||||
|
|
||||||
void on_loginButton_clicked();
|
void on_loginButton_clicked();
|
||||||
|
void on_keepLogin_clicked();
|
||||||
void on_usrnmLineEdit_editingFinished();
|
void on_usrnmLineEdit_editingFinished();
|
||||||
|
|
||||||
void on_actionCredits_triggered();
|
//GPA Tab slots
|
||||||
|
void on_ratesButton_clicked();
|
||||||
|
void on_graphButton_clicked();
|
||||||
|
void on_revertBtn_clicked();
|
||||||
void on_clearTableButton_clicked();
|
void on_clearTableButton_clicked();
|
||||||
|
|
||||||
void on_actionExit_triggered();
|
|
||||||
|
|
||||||
void on_coursesTable_itemChanged(QTableWidgetItem *item);
|
void on_coursesTable_itemChanged(QTableWidgetItem *item);
|
||||||
|
|
||||||
void on_keepLogin_clicked();
|
|
||||||
|
|
||||||
void on_actionHow_To_triggered();
|
|
||||||
|
|
||||||
void on_getCalendarBtn_clicked();
|
|
||||||
|
|
||||||
void on_checkBoxCoursesInfluence_toggled(bool checked);
|
void on_checkBoxCoursesInfluence_toggled(bool checked);
|
||||||
|
|
||||||
|
//Schedule Tab slots
|
||||||
|
void on_getCalendarBtn_clicked();
|
||||||
|
void on_examsBtn_clicked();
|
||||||
void on_exportToCVSBtn_clicked();
|
void on_exportToCVSBtn_clicked();
|
||||||
|
|
||||||
void on_actionHebrew_triggered();
|
//Main screen general slots
|
||||||
|
|
||||||
void on_actionEnglish_triggered();
|
|
||||||
|
|
||||||
void on_actionOS_Default_triggered();
|
|
||||||
|
|
||||||
void on_spinBoxCoursesFromSemester_valueChanged(int arg1);
|
void on_spinBoxCoursesFromSemester_valueChanged(int arg1);
|
||||||
|
|
||||||
void on_spinBoxCoursesFromYear_valueChanged(int arg1);
|
void on_spinBoxCoursesFromYear_valueChanged(int arg1);
|
||||||
|
|
||||||
void on_spinBoxCoursesToYear_valueChanged(int arg1);
|
void on_spinBoxCoursesToYear_valueChanged(int arg1);
|
||||||
|
|
||||||
void on_spinBoxCoursesToSemester_valueChanged(int arg1);
|
void on_spinBoxCoursesToSemester_valueChanged(int arg1);
|
||||||
|
|
||||||
void on_labelMadeBy_linkActivated(const QString &link);
|
void on_labelMadeBy_linkActivated(const QString &link);
|
||||||
|
|
||||||
|
//Setting dock
|
||||||
|
void on_langButton_clicked();
|
||||||
|
|
||||||
|
void on_creditButton_clicked();
|
||||||
|
|
||||||
|
void on_howtoButton_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void checkLocale();
|
void checkLocale();
|
||||||
|
|
||||||
bool checkIfValidDates();
|
bool checkIfValidDates();
|
||||||
|
|
||||||
|
bool isBusy();
|
||||||
|
void lock();
|
||||||
|
void unlock();
|
||||||
|
|
||||||
Ui::MainScreen *ui;
|
Ui::MainScreen *ui;
|
||||||
|
|
||||||
|
bool isBlocked;
|
||||||
|
|
||||||
QPixmap iconPix;
|
QPixmap iconPix;
|
||||||
user *userLoginSetting;
|
user *userLoginSetting;
|
||||||
SaveData *data;
|
SaveData *data;
|
||||||
|
@ -83,6 +80,8 @@ private:
|
||||||
coursesTableManager *courseTableMgr;
|
coursesTableManager *courseTableMgr;
|
||||||
loginHandler *loginHandel;
|
loginHandler *loginHandel;
|
||||||
|
|
||||||
|
jceStatusBar *statusBar;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAINSCREEN_H
|
#endif // MAINSCREEN_H
|
||||||
|
|
1348
main/mainscreen.ui
Before Width: | Height: | Size: 1.9 KiB |
BIN
resources/busy.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
resources/connected.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
|
@ -1,10 +1,15 @@
|
||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/icons">
|
<qresource prefix="/icons">
|
||||||
<file>blueStatusIcon.png</file>
|
|
||||||
<file>greenStatusIcon.png</file>
|
|
||||||
<file>redStatusIcon.png</file>
|
|
||||||
<file>icon.ico</file>
|
<file>icon.ico</file>
|
||||||
<file>iconX.png</file>
|
<file>iconX.png</file>
|
||||||
<file>iconV.png</file>
|
<file>iconV.png</file>
|
||||||
|
<file>il.png</file>
|
||||||
|
<file>us.png</file>
|
||||||
|
<file>help.png</file>
|
||||||
|
<file>team.png</file>
|
||||||
|
<file>busy.png</file>
|
||||||
|
<file>connected.png</file>
|
||||||
|
<file>disconnected.png</file>
|
||||||
|
<file>logo.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
BIN
resources/disconnected.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
resources/flags/il.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
resources/flags/us.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 1.8 KiB |
BIN
resources/help.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
resources/il.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
resources/logo.png
Normal file
After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 1.7 KiB |
BIN
resources/team.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
resources/us.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
|
@ -8,7 +8,7 @@
|
||||||
* Message types cam be:
|
* Message types cam be:
|
||||||
*
|
*
|
||||||
* - DEBUG
|
* - DEBUG
|
||||||
* - WARNING
|
* - WARNINGS
|
||||||
* - CRITICAL
|
* - CRITICAL
|
||||||
* - FATAL
|
* - FATAL
|
||||||
*
|
*
|
||||||
|
|
|
@ -39,7 +39,7 @@ bool SaveData::isSaved()
|
||||||
* # username
|
* # username
|
||||||
* # password
|
* # password
|
||||||
* # calendar
|
* # calendar
|
||||||
* # local
|
* # locale
|
||||||
*/
|
*/
|
||||||
void SaveData::reset()
|
void SaveData::reset()
|
||||||
{
|
{
|
||||||
|
@ -82,13 +82,13 @@ void SaveData::setCal(QString cal)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief gest a local and saves it into the QMap.
|
* @brief gest a locale and saves it into the QMap.
|
||||||
* QMap then is saved to the file.
|
* QMap then is saved to the file.
|
||||||
* @param local - QString (he, en, default)
|
* @param locale - QString (he, en)
|
||||||
*/
|
*/
|
||||||
void SaveData::setLocal(QString local)
|
void SaveData::setLocale(QString local)
|
||||||
{
|
{
|
||||||
DB.insert("local", local);
|
DB.insert("locale", local);
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,11 +112,11 @@ QString SaveData::getPassword()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief read from file
|
* @brief read from file
|
||||||
* @return local
|
* @return locale
|
||||||
*/
|
*/
|
||||||
QString SaveData::getLocal()
|
QString SaveData::getLocale()
|
||||||
{
|
{
|
||||||
return DB.value("local");
|
return DB.value("locale");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -160,7 +160,7 @@ void SaveData::createDB()
|
||||||
{
|
{
|
||||||
DB.insert("username", "");
|
DB.insert("username", "");
|
||||||
DB.insert("password", "");
|
DB.insert("password", "");
|
||||||
DB.insert("local", "default");
|
DB.insert("locale", "en");
|
||||||
DB.insert("calendar", "");
|
DB.insert("calendar", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
* Keys:
|
* Keys:
|
||||||
* "username"
|
* "username"
|
||||||
* "password"
|
* "password"
|
||||||
* "local"
|
* "locale"
|
||||||
* "calendar"
|
* "calendar"
|
||||||
*
|
*
|
||||||
* Note that the password will be encrypted using the SimpleCrypt class!
|
* Note that the password will be encrypted using the SimpleCrypt class!
|
||||||
|
@ -40,11 +40,11 @@ public:
|
||||||
void setUsername(QString username);
|
void setUsername(QString username);
|
||||||
void setPassword(QString password);
|
void setPassword(QString password);
|
||||||
void setCal(QString cal);
|
void setCal(QString cal);
|
||||||
void setLocal(QString local);
|
void setLocale(QString locale);
|
||||||
QString getUsername();
|
QString getUsername();
|
||||||
QString getPassword();
|
QString getPassword();
|
||||||
QString getCal();
|
QString getCal();
|
||||||
QString getLocal();
|
QString getLocale();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMap<QString, QString> DB;
|
QMap<QString, QString> DB;
|
||||||
|
|
|
@ -3,17 +3,20 @@
|
||||||
/**
|
/**
|
||||||
* @brief jceSSLClient::jceSSLClient Constructer, setting the signals
|
* @brief jceSSLClient::jceSSLClient Constructer, setting the signals
|
||||||
*/
|
*/
|
||||||
jceSSLClient::jceSSLClient() : flag(false), packet(""),networkConf(), reConnection(false)
|
jceSSLClient::jceSSLClient(jceStatusBar *statusBar) : loggedIAndConnectedFlag(false), readingFlag(false),
|
||||||
|
reConnectionFlag(false), networkConf(), packet(""), recieveLastPacket(false), packetSizeRecieved(0)
|
||||||
{
|
{
|
||||||
//setting signals
|
this->statusBar = statusBar;
|
||||||
connect(this,SIGNAL(error(QAbstractSocket::SocketError)),this,SLOT(checkErrors(QAbstractSocket::SocketError)));
|
//setting signals
|
||||||
connect(this,SIGNAL(connected()),this,SLOT(setConnected()));
|
connect(this,SIGNAL(error(QAbstractSocket::SocketError)),this,SLOT(checkErrors(QAbstractSocket::SocketError)));
|
||||||
connect(this,SIGNAL(encrypted()),this,SLOT(setEncrypted()));
|
connect(this,SIGNAL(connected()),this,SLOT(setConnected()));
|
||||||
connect(this,SIGNAL(disconnected()),this,SLOT(setDisconnected()));
|
connect(this,SIGNAL(encrypted()),this,SLOT(setEncrypted()));
|
||||||
connect(&networkConf,SIGNAL(onlineStateChanged(bool)),this,SLOT(setOnlineState(bool)));
|
connect(this,SIGNAL(disconnected()),this,SLOT(setDisconnected()));
|
||||||
//loop event will connect the server, and when it is connected, it will quit - but connection will be open
|
connect(&networkConf,SIGNAL(onlineStateChanged(bool)),this,SLOT(setOnlineState(bool)));
|
||||||
connect(this, SIGNAL(encrypted()), &loop, SLOT(quit()));
|
|
||||||
connect(this, SIGNAL(error(QAbstractSocket::SocketError)),&loop,SLOT(quit()));
|
//loop event will connect the server, and when it is connected, it will quit - but connection will be open
|
||||||
|
connect(this, SIGNAL(encrypted()), &loginThreadLoop, SLOT(quit()));
|
||||||
|
connect(this, SIGNAL(error(QAbstractSocket::SocketError)),&loginThreadLoop,SLOT(quit()));
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -24,48 +27,48 @@ jceSSLClient::jceSSLClient() : flag(false), packet(""),networkConf(), reConnecti
|
||||||
*/
|
*/
|
||||||
bool jceSSLClient::makeConnect(QString server, int port)
|
bool jceSSLClient::makeConnect(QString server, int port)
|
||||||
{
|
{
|
||||||
if (this->supportsSsl() == false)
|
if (this->supportsSsl() == false)
|
||||||
{
|
{
|
||||||
qCritical() << Q_FUNC_INFO << "Couldnt load ssl package. ERROR";
|
qCritical() << Q_FUNC_INFO << "Couldnt load ssl package. ERROR";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
qDebug() << Q_FUNC_INFO << "ssl loaded.";
|
qDebug() << Q_FUNC_INFO << "ssl loaded.";
|
||||||
|
|
||||||
if (isConnectedToNetwork() == false)
|
if (isConnectedToNetwork() == false)
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "return false. not online";
|
qDebug() << Q_FUNC_INFO << "return false. not online";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
qDebug() << Q_FUNC_INFO << "we're online";
|
qDebug() << Q_FUNC_INFO << "we're online";
|
||||||
|
|
||||||
|
|
||||||
if (reConnection) //reset reconnectiong flag
|
if (reConnectionFlag) //reset reconnectiong flag
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "Making Reconnection";
|
qDebug() << Q_FUNC_INFO << "Making Reconnection";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
qDebug() << Q_FUNC_INFO << "Making Connection";
|
qDebug() << Q_FUNC_INFO << "Making Connection";
|
||||||
|
|
||||||
if (isConnected())
|
if (isConnected())
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "flag=true, calling makeDisconnect()";
|
qDebug() << Q_FUNC_INFO << "flag=true, calling makeDisconnect()";
|
||||||
makeDiconnect();
|
makeDiconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "Connection to: " << server << "On Port: " << port;
|
qDebug() << Q_FUNC_INFO << "Connection to: " << server << "On Port: " << port;
|
||||||
connectToHostEncrypted(server.toStdString().c_str(), port);
|
connectToHostEncrypted(server.toStdString().c_str(), port);
|
||||||
|
|
||||||
loop.exec(); //starting connection, waiting to encryption and then it ends
|
loginThreadLoop.exec(); //starting connection, waiting to encryption and then it ends
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "returning the connection status: " << isConnected();
|
qDebug() << Q_FUNC_INFO << "returning the connection status: " << isConnected();
|
||||||
if (reConnection)
|
if (reConnectionFlag)
|
||||||
{
|
{
|
||||||
reConnection = false;
|
reConnectionFlag = false;
|
||||||
emit serverDisconnectedbyRemote();
|
emit serverDisconnectedbyRemote();
|
||||||
}
|
}
|
||||||
return isConnected();
|
return isConnected();
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -74,15 +77,15 @@ bool jceSSLClient::makeConnect(QString server, int port)
|
||||||
*/
|
*/
|
||||||
bool jceSSLClient::makeDiconnect()
|
bool jceSSLClient::makeDiconnect()
|
||||||
{
|
{
|
||||||
if (loop.isRunning())
|
if (loginThreadLoop.isRunning())
|
||||||
{
|
{
|
||||||
qWarning() << Q_FUNC_INFO << "Killing connection thread";
|
qWarning() << Q_FUNC_INFO << "Killing connection thread";
|
||||||
loop.exit();
|
loginThreadLoop.exit();
|
||||||
}
|
}
|
||||||
qDebug() << Q_FUNC_INFO << "disconnecting from host and emitting disconnected()";
|
qDebug() << Q_FUNC_INFO << "disconnecting from host and emitting disconnected()";
|
||||||
this->disconnectFromHost(); //emits disconnected > setDisconnected
|
this->disconnectFromHost(); //emits disconnected > setDisconnected
|
||||||
setSocketState(QAbstractSocket::SocketState::UnconnectedState);
|
setSocketState(QAbstractSocket::SocketState::UnconnectedState);
|
||||||
return (!isConnected());
|
return (!isConnected());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,30 +95,30 @@ bool jceSSLClient::makeDiconnect()
|
||||||
*/
|
*/
|
||||||
bool jceSSLClient::isConnected()
|
bool jceSSLClient::isConnected()
|
||||||
{
|
{
|
||||||
bool tempFlag = false;
|
bool tempFlag = false;
|
||||||
//checking state before returning flag!
|
//checking state before returning flag!
|
||||||
if (state() == QAbstractSocket::SocketState::UnconnectedState)
|
if (state() == QAbstractSocket::SocketState::UnconnectedState)
|
||||||
{
|
{
|
||||||
tempFlag = false;
|
tempFlag = false;
|
||||||
}
|
}
|
||||||
else if (state() == QAbstractSocket::SocketState::ClosingState)
|
else if (state() == QAbstractSocket::SocketState::ClosingState)
|
||||||
{
|
{
|
||||||
tempFlag = false;
|
tempFlag = false;
|
||||||
}
|
}
|
||||||
else if (state() == QAbstractSocket::SocketState::ConnectedState)
|
else if (state() == QAbstractSocket::SocketState::ConnectedState)
|
||||||
{
|
{
|
||||||
if (isConnectedToNetwork())
|
if (isConnectedToNetwork())
|
||||||
tempFlag = true;
|
tempFlag = true;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->setSocketState(QAbstractSocket::SocketState::UnconnectedState);
|
this->setSocketState(QAbstractSocket::SocketState::UnconnectedState);
|
||||||
tempFlag = false;
|
tempFlag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!isConnectedToNetwork()) //no link, ethernet\wifi
|
if (!isConnectedToNetwork()) //no link, ethernet\wifi
|
||||||
tempFlag = false;
|
tempFlag = false;
|
||||||
return ((flag) && (tempFlag));
|
return ((loggedIAndConnectedFlag) && (tempFlag));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief jceSSLClient::sendData - given string, send it to server
|
* @brief jceSSLClient::sendData - given string, send it to server
|
||||||
|
@ -124,88 +127,122 @@ bool jceSSLClient::isConnected()
|
||||||
*/
|
*/
|
||||||
bool jceSSLClient::sendData(QString str)
|
bool jceSSLClient::sendData(QString str)
|
||||||
{
|
{
|
||||||
bool sendDataFlag = false;
|
bool sendDataFlag = false;
|
||||||
|
int amount = 0;
|
||||||
if (isConnected()) //if connected
|
if (isConnected()) //if connected
|
||||||
{
|
{
|
||||||
write(str.toStdString().c_str(),str.length());
|
statusBar->setIconConnectionStatus(jceStatusBar::Sending);
|
||||||
if (waitForBytesWritten())
|
amount = write(str.toStdString().c_str(),str.length());
|
||||||
sendDataFlag = true;
|
qDebug() << Q_FUNC_INFO << "lenght send: " << str.length() << "lenght recieved: " << amount;
|
||||||
}
|
if (amount == -1)
|
||||||
qDebug() << Q_FUNC_INFO << "Sending Data status is: " << sendDataFlag;
|
|
||||||
return sendDataFlag;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @brief jceSSLClient::recieveData
|
|
||||||
* @param str this variable will store the recieved data
|
|
||||||
* @param fast true for LOGIN ONLY, false to retrieve all data
|
|
||||||
* @return true if recieved data bigger than zero
|
|
||||||
*/
|
|
||||||
bool jceSSLClient::recieveData(QString &str, bool fast)
|
|
||||||
{
|
|
||||||
qDebug() << Q_FUNC_INFO << "Data receiving!";
|
|
||||||
packet = "";
|
|
||||||
bool sflag = false;
|
|
||||||
|
|
||||||
if (fast) //fast mode connection, good only for login step!!!!
|
|
||||||
{
|
|
||||||
qDebug() << "jceSSLClient::recieveData login step receiving";
|
|
||||||
QEventLoop loop;
|
|
||||||
connect(this, SIGNAL(readyRead()), &loop, SLOT(quit()));
|
|
||||||
connect(this, SIGNAL(readyRead()), this, SLOT(readIt()));
|
|
||||||
loop.exec();
|
|
||||||
disconnect(this, SIGNAL(readyRead()), &loop, SLOT(quit()));
|
|
||||||
disconnect(this, SIGNAL(readyRead()), this, SLOT(readIt()));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
qDebug() << "jceSSLClient::recieveData normal receiving";
|
|
||||||
QString p;
|
|
||||||
while (waitForReadyRead(milisTimeOut))
|
|
||||||
{
|
{
|
||||||
do
|
qCritical() << Q_FUNC_INFO << "SendData ended with -1";
|
||||||
{
|
sendDataFlag = false;
|
||||||
p = readAll();
|
|
||||||
packet.append(p);
|
|
||||||
}while (p.size() > 0);
|
|
||||||
}
|
}
|
||||||
|
else if (waitForBytesWritten())
|
||||||
|
sendDataFlag = true;
|
||||||
}
|
}
|
||||||
str = packet;
|
qDebug() << Q_FUNC_INFO << "Sending Data status is: " << sendDataFlag;
|
||||||
qDebug() << Q_FUNC_INFO << "received bytes: " << str.length() ;
|
return sendDataFlag;
|
||||||
if (str.length() > 0)
|
}
|
||||||
sflag = true;
|
/**
|
||||||
qDebug() << Q_FUNC_INFO << "return with flag: " << sflag;
|
* @brief jceSSLClient::recieveData - recieving data through threaded reading and mutex
|
||||||
return sflag;
|
* @param str - string to fill with data.
|
||||||
|
* @return true if packet has recieced the last packet -> true, otherwise ->false
|
||||||
|
*/
|
||||||
|
bool jceSSLClient::recieveData(QString *str)
|
||||||
|
{
|
||||||
|
statusBar->setIconConnectionStatus(jceStatusBar::Recieving);
|
||||||
|
qDebug() << Q_FUNC_INFO << "Data receiving!";
|
||||||
|
str->clear();
|
||||||
|
packet = "";
|
||||||
|
recieveLastPacket = false;
|
||||||
|
packetSizeRecieved = 0; //counting packet size
|
||||||
|
readingFlag = true; //to ignore timeout socket error
|
||||||
|
|
||||||
|
timer.setSingleShot(true); //counting just once.
|
||||||
|
timer.start(milisTimeOut); //if timer is timeout -> it means the connection takes long time
|
||||||
|
|
||||||
|
connect(this, SIGNAL(readyRead()), this, SLOT(readIt())); //we have something to read
|
||||||
|
connect(&timer, SIGNAL(timeout()), &readerLoop, SLOT(quit())); //if timer timeout > exiting event
|
||||||
|
|
||||||
|
readerLoop.exec();
|
||||||
|
|
||||||
|
disconnect(&timer, SIGNAL(timeout()), &readerLoop, SLOT(quit()));
|
||||||
|
disconnect(this, SIGNAL(readyRead()), this, SLOT(readIt()));
|
||||||
|
|
||||||
|
str->append(packet);
|
||||||
|
// qDebug() << *str; //if you want to see the whole packet, unmark me
|
||||||
|
|
||||||
|
qDebug() << Q_FUNC_INFO << "packet size: " << packetSizeRecieved << "received data lenght: " << str->length();
|
||||||
|
qDebug() << Q_FUNC_INFO << "return with flag: " << recieveLastPacket;
|
||||||
|
|
||||||
|
readingFlag = false; //finished reading session
|
||||||
|
return recieveLastPacket; //we have the last packet
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief jceSSLClient::readIt function to read for fast mode in recieved data
|
* @brief jceSSLClient::readIt
|
||||||
|
* this method, called by a thread to read the bytes avilable by the remote server
|
||||||
|
* each packet we append into the class private var 'packet' (mutexed)
|
||||||
|
* if we recieve the last packet (see tags below) we set the timer of the calling function to 100msc
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
void jceSSLClient::readIt()
|
void jceSSLClient::readIt()
|
||||||
{
|
{
|
||||||
QString p;
|
int packSize = bytesAvailable();
|
||||||
do
|
int doTimes=0;
|
||||||
|
QByteArray tempPacket;
|
||||||
|
|
||||||
|
do
|
||||||
{
|
{
|
||||||
p = readAll();
|
// qDebug() << Q_FUNC_INFO << "packet size" << packSize;
|
||||||
packet.append(p);
|
|
||||||
}while (p.size() > 0);
|
|
||||||
|
|
||||||
|
if (doTimes++ > 0) //for debbuging, checking thread looping times
|
||||||
|
qDebug() << Q_FUNC_INFO << "do loop" << doTimes;
|
||||||
|
|
||||||
|
waitForReadyRead(100);
|
||||||
|
tempPacket = read(packSize);
|
||||||
|
|
||||||
|
readerAppendingLocker.lock();
|
||||||
|
packetSizeRecieved += packSize;
|
||||||
|
packet.append(tempPacket);
|
||||||
|
packet.append("\0");
|
||||||
|
readerAppendingLocker.unlock();
|
||||||
|
|
||||||
|
emit statusBar->progressHasPacket(10);
|
||||||
|
|
||||||
|
if ((tempPacket.mid(tempPacket.length()-7,7) == ".HTM-->")
|
||||||
|
|| (tempPacket.mid(tempPacket.length()-7,7) == ".htm-->")
|
||||||
|
|| tempPacket.contains("</html>")
|
||||||
|
)
|
||||||
|
|
||||||
|
{
|
||||||
|
//we have the last packet. (uses only in login first step
|
||||||
|
recieveLastPacket = true;
|
||||||
|
timer.setInterval(200);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//just a packet with data
|
||||||
|
}
|
||||||
|
|
||||||
|
}while ((packSize = bytesAvailable()) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void jceSSLClient::setOnlineState(bool isOnline)
|
void jceSSLClient::setOnlineState(bool isOnline)
|
||||||
{
|
{
|
||||||
qWarning() << Q_FUNC_INFO << "isOnline status change: " << isOnline;
|
qWarning() << Q_FUNC_INFO << "isOnline status change: " << isOnline;
|
||||||
if (isOnline) //to be added later
|
if (isOnline) //to be added later
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "Online Statue has been changed. we are online";
|
qDebug() << Q_FUNC_INFO << "Online Statue has been changed. we are online";
|
||||||
//we can add here auto reconnect if wifi\ethernet link has appear
|
//we can add here auto reconnect if wifi\ethernet link has appear
|
||||||
//will be added next version
|
//will be added next version
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qWarning() << Q_FUNC_INFO << "Online State has been changed. emitting NoInternetLink";
|
qWarning() << Q_FUNC_INFO << "Online State has been changed. emitting NoInternetLink";
|
||||||
this->makeDiconnect();
|
this->makeDiconnect();
|
||||||
emit noInternetLink();
|
emit noInternetLink();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -214,19 +251,19 @@ void jceSSLClient::setOnlineState(bool isOnline)
|
||||||
*/
|
*/
|
||||||
void jceSSLClient::setConnected()
|
void jceSSLClient::setConnected()
|
||||||
{
|
{
|
||||||
waitForEncrypted();
|
waitForEncrypted();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief jceSSLClient::setDisconnected closing socket, updating state and setting flag to false
|
* @brief jceSSLClient::setDisconnected closing socket, updating state and setting flag to false
|
||||||
*/
|
*/
|
||||||
void jceSSLClient::setDisconnected()
|
void jceSSLClient::setDisconnected()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "connection has been DISCONNECTED";
|
qDebug() << Q_FUNC_INFO << "connection has been DISCONNECTED";
|
||||||
this->setSocketState(QAbstractSocket::SocketState::UnconnectedState);
|
this->setSocketState(QAbstractSocket::SocketState::UnconnectedState);
|
||||||
packet.clear();
|
packet.clear();
|
||||||
flag = false;
|
loggedIAndConnectedFlag = false;
|
||||||
if (reConnection)
|
if (reConnectionFlag)
|
||||||
makeConnect();
|
makeConnect();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -235,14 +272,14 @@ void jceSSLClient::setDisconnected()
|
||||||
*/
|
*/
|
||||||
void jceSSLClient::setEncrypted()
|
void jceSSLClient::setEncrypted()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "connection has been ENCRYPTED";
|
qDebug() << Q_FUNC_INFO << "connection has been ENCRYPTED";
|
||||||
setReadBufferSize(10000);
|
setReadBufferSize(packetSize);
|
||||||
setSocketOption(QAbstractSocket::KeepAliveOption,true);
|
setSocketOption(QAbstractSocket::KeepAliveOption,true);
|
||||||
flag = true;
|
loggedIAndConnectedFlag = true;
|
||||||
if (!isConnected())
|
if (!isConnected())
|
||||||
{
|
{
|
||||||
qWarning() << Q_FUNC_INFO << "Connection status didnt change! reseting flag to false";
|
qWarning() << Q_FUNC_INFO << "Connection status didnt change! reseting flag to false";
|
||||||
flag = false;
|
loggedIAndConnectedFlag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -253,116 +290,116 @@ void jceSSLClient::setEncrypted()
|
||||||
*/
|
*/
|
||||||
void jceSSLClient::showIfErrorMsg()
|
void jceSSLClient::showIfErrorMsg()
|
||||||
{
|
{
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
SocketError enumError = error();
|
SocketError enumError = error();
|
||||||
QString errorString;
|
QString errorString;
|
||||||
bool relevantError = false;
|
bool relevantError = false;
|
||||||
switch (enumError)
|
switch (enumError)
|
||||||
{
|
{
|
||||||
case QAbstractSocket::SocketError::ConnectionRefusedError: /**/
|
case QAbstractSocket::SocketError::ConnectionRefusedError: /**/
|
||||||
errorString = QObject::tr("ConnectionRefusedError");
|
errorString = QObject::tr("ConnectionRefusedError");
|
||||||
//The connection was refused by the peer (or timed out).
|
//The connection was refused by the peer (or timed out).
|
||||||
relevantError = true;
|
relevantError = true;
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::RemoteHostClosedError: /**/
|
case QAbstractSocket::SocketError::RemoteHostClosedError: /**/
|
||||||
errorString = QObject::tr("RemoteHostClosedError");
|
errorString = QObject::tr("RemoteHostClosedError");
|
||||||
//The remote host closed the connection
|
//The remote host closed the connection
|
||||||
if (isConnectedToNetwork()) //we can reconnect
|
if (isConnectedToNetwork()) //we can reconnect
|
||||||
{
|
{
|
||||||
reConnection = true;
|
reConnectionFlag = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
relevantError = true;
|
relevantError = true;
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::HostNotFoundError: /**/
|
case QAbstractSocket::SocketError::HostNotFoundError: /**/
|
||||||
errorString = QObject::tr("HostNotFoundError");
|
errorString = QObject::tr("HostNotFoundError");
|
||||||
//The host address was not found.
|
//The host address was not found.
|
||||||
relevantError = true;
|
|
||||||
break;
|
|
||||||
case QAbstractSocket::SocketError::SocketAccessError: /**/
|
|
||||||
errorString = QObject::tr("SocketAccessError");
|
|
||||||
//The socket operation failed because the application lacked the required privileges.
|
|
||||||
break;
|
|
||||||
case QAbstractSocket::SocketError::SocketTimeoutError: /**/
|
|
||||||
errorString = QObject::tr("SocketTimeoutError");
|
|
||||||
//The socket operation timed out.
|
|
||||||
if (isConnected()); //ignore it if connected.
|
|
||||||
else
|
|
||||||
relevantError = true;
|
relevantError = true;
|
||||||
break;
|
break;
|
||||||
|
case QAbstractSocket::SocketError::SocketAccessError: /**/
|
||||||
|
errorString = QObject::tr("SocketAccessError");
|
||||||
|
//The socket operation failed because the application lacked the required privileges.
|
||||||
|
break;
|
||||||
|
case QAbstractSocket::SocketError::SocketTimeoutError: /**/
|
||||||
|
errorString = QObject::tr("SocketTimeoutError");
|
||||||
|
//The socket operation timed out.
|
||||||
|
if (isConnected()); //ignore it if connected.
|
||||||
|
else
|
||||||
|
relevantError = true;
|
||||||
|
break;
|
||||||
case QAbstractSocket::SocketError::NetworkError: /**/
|
case QAbstractSocket::SocketError::NetworkError: /**/
|
||||||
errorString = QObject::tr("NetworkError");
|
errorString = QObject::tr("NetworkError");
|
||||||
//An error occurred with the network (e.g., the network cable was accidentally plugged out).
|
//An error occurred with the network (e.g., the network cable was accidentally plugged out).
|
||||||
if (isConnectedToNetwork()) //we can reconnect
|
if (isConnectedToNetwork()) //we can reconnect
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
relevantError = true;
|
relevantError = true;
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::SslHandshakeFailedError: /**/
|
case QAbstractSocket::SocketError::SslHandshakeFailedError: /**/
|
||||||
errorString = QObject::tr("SslHandshakeFailedError");
|
errorString = QObject::tr("SslHandshakeFailedError");
|
||||||
relevantError = true;
|
relevantError = true;
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::SslInternalError: /**/
|
case QAbstractSocket::SocketError::SslInternalError: /**/
|
||||||
errorString = QObject::tr("SslInternalError");
|
errorString = QObject::tr("SslInternalError");
|
||||||
relevantError = true;
|
relevantError = true;
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::SslInvalidUserDataError: /**/
|
case QAbstractSocket::SocketError::SslInvalidUserDataError: /**/
|
||||||
errorString = QObject::tr("SslInvalidUserDataError");
|
errorString = QObject::tr("SslInvalidUserDataError");
|
||||||
relevantError = true;
|
relevantError = true;
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::DatagramTooLargeError: //not relevant to us
|
case QAbstractSocket::SocketError::DatagramTooLargeError: //not relevant to us
|
||||||
errorString = QObject::tr("DatagramTooLargeError");
|
errorString = QObject::tr("DatagramTooLargeError");
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::SocketResourceError: //not relevant to us
|
case QAbstractSocket::SocketError::SocketResourceError: //not relevant to us
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::OperationError: //not relevant, except for debug
|
case QAbstractSocket::SocketError::OperationError: //not relevant, except for debug
|
||||||
errorString = QObject::tr("OperationError");
|
errorString = QObject::tr("OperationError");
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::AddressInUseError: //not relevant to us
|
case QAbstractSocket::SocketError::AddressInUseError: //not relevant to us
|
||||||
errorString = QObject::tr("AddressInUseError");
|
errorString = QObject::tr("AddressInUseError");
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::SocketAddressNotAvailableError: //not relevant to us
|
case QAbstractSocket::SocketError::SocketAddressNotAvailableError: //not relevant to us
|
||||||
errorString = QObject::tr("SocketAddressNotAvailableError");
|
errorString = QObject::tr("SocketAddressNotAvailableError");
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::UnsupportedSocketOperationError: //for very old computers, not relevant to us
|
case QAbstractSocket::SocketError::UnsupportedSocketOperationError: //for very old computers, not relevant to us
|
||||||
errorString = QObject::tr("UnsupportedSocketOperationError");
|
errorString = QObject::tr("UnsupportedSocketOperationError");
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::ProxyAuthenticationRequiredError: //not relevant to us
|
case QAbstractSocket::SocketError::ProxyAuthenticationRequiredError: //not relevant to us
|
||||||
errorString = QObject::tr("ProxyAuthenticationRequiredError");
|
errorString = QObject::tr("ProxyAuthenticationRequiredError");
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::ProxyConnectionRefusedError: //not relevant to us
|
case QAbstractSocket::SocketError::ProxyConnectionRefusedError: //not relevant to us
|
||||||
errorString = QObject::tr("ProxyConnectionRefusedError");
|
errorString = QObject::tr("ProxyConnectionRefusedError");
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::UnfinishedSocketOperationError: //not relevant to us
|
case QAbstractSocket::SocketError::UnfinishedSocketOperationError: //not relevant to us
|
||||||
errorString = QObject::tr("UnfinishedSocketOperationError");
|
errorString = QObject::tr("UnfinishedSocketOperationError");
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::ProxyConnectionClosedError: //not relevant to us
|
case QAbstractSocket::SocketError::ProxyConnectionClosedError: //not relevant to us
|
||||||
errorString = QObject::tr("ProxyConnectionClosedError");
|
errorString = QObject::tr("ProxyConnectionClosedError");
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::ProxyConnectionTimeoutError: //not relevant to us
|
case QAbstractSocket::SocketError::ProxyConnectionTimeoutError: //not relevant to us
|
||||||
errorString = QObject::tr("ProxyConnectionTimeoutError");
|
errorString = QObject::tr("ProxyConnectionTimeoutError");
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::ProxyNotFoundError: //not relevant to us
|
case QAbstractSocket::SocketError::ProxyNotFoundError: //not relevant to us
|
||||||
errorString = QObject::tr("ProxyNotFoundError");
|
errorString = QObject::tr("ProxyNotFoundError");
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::ProxyProtocolError: //not relevant to us
|
case QAbstractSocket::SocketError::ProxyProtocolError: //not relevant to us
|
||||||
errorString = QObject::tr("ProxyProtocolError");
|
errorString = QObject::tr("ProxyProtocolError");
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::TemporaryError: //not relevant to us
|
case QAbstractSocket::SocketError::TemporaryError: //not relevant to us
|
||||||
errorString = QObject::tr("TemporaryError");
|
errorString = QObject::tr("TemporaryError");
|
||||||
break;
|
break;
|
||||||
case QAbstractSocket::SocketError::UnknownSocketError: //not relevant, except for debug
|
case QAbstractSocket::SocketError::UnknownSocketError: //not relevant, except for debug
|
||||||
errorString = QObject::tr("UnknownSocketError");
|
errorString = QObject::tr("UnknownSocketError");
|
||||||
relevantError = true;
|
relevantError = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (relevantError) //informative string to be shown
|
if (relevantError) //informative string to be shown
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "relevant error.";
|
qDebug() << Q_FUNC_INFO << "relevant error.";
|
||||||
msgBox.setIcon(QMessageBox::Warning);
|
msgBox.setIcon(QMessageBox::Warning);
|
||||||
msgBox.setText(errorString);
|
msgBox.setText(errorString);
|
||||||
msgBox.exec();
|
msgBox.exec();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -371,46 +408,50 @@ void jceSSLClient::showIfErrorMsg()
|
||||||
*/
|
*/
|
||||||
void jceSSLClient::checkErrors(QAbstractSocket::SocketError a)
|
void jceSSLClient::checkErrors(QAbstractSocket::SocketError a)
|
||||||
{
|
{
|
||||||
//ignore this stupid error
|
//ignore this stupid error
|
||||||
bool timeout = (a == QAbstractSocket::SocketError::SocketTimeoutError);
|
bool timeout = (a == QAbstractSocket::SocketError::SocketTimeoutError);
|
||||||
if (!((isConnected()) && (timeout)))
|
if (!((isConnected()) && (timeout)))
|
||||||
{
|
{
|
||||||
qWarning() << Q_FUNC_INFO << "isOnline?: " << isConnectedToNetwork();
|
qWarning() << Q_FUNC_INFO << "isOnline?: " << isConnectedToNetwork();
|
||||||
qWarning() << Q_FUNC_INFO << "state is: " << state();
|
qWarning() << Q_FUNC_INFO << "state is: " << state();
|
||||||
qWarning() << Q_FUNC_INFO << "Var Error: " << a;
|
qWarning() << Q_FUNC_INFO << "Var Error: " << a;
|
||||||
qWarning() << Q_FUNC_INFO << "Error: " << errorString();
|
qWarning() << Q_FUNC_INFO << "Error: " << errorString();
|
||||||
}
|
}
|
||||||
else
|
else if (!readingFlag)
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "isConnected?: " << isConnected() << "is timeout?" << timeout;
|
qWarning() << Q_FUNC_INFO << "isConnected?: " << isConnected() << "is timeout?" << timeout;
|
||||||
qWarning() << Q_FUNC_INFO << "isOnline?: " << isConnectedToNetwork();
|
qWarning() << Q_FUNC_INFO << "isOnline?: " << isConnectedToNetwork() << "state is: " << state();
|
||||||
qWarning() << Q_FUNC_INFO << "state is: " << state();
|
qWarning() << Q_FUNC_INFO << "Error: " << errorString();
|
||||||
qWarning() << Q_FUNC_INFO << "Var Error: " << a;
|
|
||||||
qWarning() << Q_FUNC_INFO << "Error: " << errorString();
|
|
||||||
}
|
}
|
||||||
showIfErrorMsg();
|
else
|
||||||
|
{
|
||||||
|
//timeout when reading
|
||||||
|
}
|
||||||
|
showIfErrorMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** written by KARAN BALKAR
|
/** written by KARAN BALKAR
|
||||||
* @brief jceSSLClient::isConnectedToNetwork
|
* @brief jceSSLClient::isConnectedToNetwork
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bool jceSSLClient::isConnectedToNetwork(){
|
bool jceSSLClient::isConnectedToNetwork(){
|
||||||
|
|
||||||
QList<QNetworkInterface> ifaces = QNetworkInterface::allInterfaces();
|
QList<QNetworkInterface> ifaces = QNetworkInterface::allInterfaces();
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
for (int i = 0; i < ifaces.count(); ++i)
|
for (int i = 0; i < ifaces.count(); ++i)
|
||||||
{
|
{
|
||||||
QNetworkInterface iface = ifaces.at(i);
|
QNetworkInterface iface = ifaces.at(i);
|
||||||
|
|
||||||
if ( iface.flags().testFlag(QNetworkInterface::IsUp) && !iface.flags().testFlag(QNetworkInterface::IsLoopBack))
|
if ( iface.flags().testFlag(QNetworkInterface::IsUp) && !iface.flags().testFlag(QNetworkInterface::IsLoopBack))
|
||||||
for (int j=0; j < iface.addressEntries().count(); ++j)
|
for (int j=0; j < iface.addressEntries().count(); ++j)
|
||||||
// got an interface which is up, and has an ip address
|
// got an interface which is up, and has an ip address
|
||||||
if (result == false)
|
if (result == false)
|
||||||
result = true;
|
result = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,49 +1,70 @@
|
||||||
#ifndef JCESSLCLIENT_H
|
#ifndef JCESSLCLIENT_H
|
||||||
#define JCESSLCLIENT_H
|
#define JCESSLCLIENT_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QString>
|
||||||
#include <QSslSocket>
|
#include <QSslSocket>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QEventLoop>
|
#include <QEventLoop>
|
||||||
|
#include <QTimer>
|
||||||
|
#include <QMutex>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QNetworkConfigurationManager>
|
#include <QNetworkConfigurationManager>
|
||||||
#include <QtNetwork/QNetworkInterface>
|
#include <QtNetwork/QNetworkInterface>
|
||||||
|
|
||||||
#define milisTimeOut 4000
|
#include "../../main/jceWidgets/jcestatusbar.h"
|
||||||
|
|
||||||
|
#define packetSize 4096 //4k
|
||||||
|
#define milisTimeOut 5000 //4 seconds
|
||||||
|
|
||||||
class jceSSLClient : public QSslSocket
|
class jceSSLClient : public QSslSocket
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
jceSSLClient();
|
jceSSLClient(jceStatusBar *statusBar);
|
||||||
|
|
||||||
bool makeConnect(QString server = "yedion.jce.ac.il", int port = 443);
|
bool makeConnect(QString server = "yedion.jce.ac.il", int port = 443);
|
||||||
bool makeDiconnect();
|
bool makeDiconnect();
|
||||||
bool isConnected();
|
bool isConnected();
|
||||||
bool sendData(QString str);
|
bool sendData(QString str);
|
||||||
bool recieveData(QString &str, bool fast);
|
bool recieveData(QString *str);
|
||||||
void showIfErrorMsg();
|
void showIfErrorMsg();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void serverDisconnectedbyRemote();
|
void serverDisconnectedbyRemote();
|
||||||
void noInternetLink();
|
void noInternetLink();
|
||||||
void socketDisconnected();
|
void socketDisconnected();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void checkErrors(QAbstractSocket::SocketError a);
|
void checkErrors(QAbstractSocket::SocketError a);
|
||||||
void setConnected();
|
void setConnected();
|
||||||
void setEncrypted();
|
void setEncrypted();
|
||||||
void setDisconnected();
|
void setDisconnected();
|
||||||
void readIt();
|
void readIt();
|
||||||
void setOnlineState(bool isOnline);
|
void setOnlineState(bool isOnline);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool isConnectedToNetwork(); //checking if online
|
|
||||||
bool flag;
|
bool isConnectedToNetwork(); //checking if online
|
||||||
QString packet;
|
|
||||||
QEventLoop loop; //handle the connection as thread
|
bool loggedIAndConnectedFlag;
|
||||||
QNetworkConfigurationManager networkConf; //checking if online
|
bool readingFlag;
|
||||||
bool reConnection; //used for remote host disconnecting
|
bool reConnectionFlag; //used for remote host disconnecting
|
||||||
|
|
||||||
|
QNetworkConfigurationManager networkConf; //checking if online
|
||||||
|
|
||||||
|
QString packet;
|
||||||
|
bool recieveLastPacket;
|
||||||
|
int packetSizeRecieved;
|
||||||
|
|
||||||
|
QEventLoop loginThreadLoop; //handle the connection as thread
|
||||||
|
QEventLoop readerLoop;
|
||||||
|
|
||||||
|
QMutex readerAppendingLocker; //locking packet when appending
|
||||||
|
QTimer timer; //uses to check if reading has reached its timeout
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jceStatusBar *statusBar; //progressbar pointer
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Class doc can be bound in csv_exporter.h
|
* Class doc can be found in csv_exporter.h
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
CSV_Exporter::CSV_Exporter()
|
CSV_Exporter::CSV_Exporter()
|
||||||
{
|
{
|
||||||
|
@ -18,12 +17,12 @@ CSV_Exporter::CSV_Exporter()
|
||||||
* @param cal - The Calendar dialog witch holdes the starting date and the eand date.
|
* @param cal - The Calendar dialog witch holdes the starting date and the eand date.
|
||||||
* @return - True if *all* went well, false if something on the way went wrong.
|
* @return - True if *all* went well, false if something on the way went wrong.
|
||||||
*/
|
*/
|
||||||
bool CSV_Exporter::exportCalendar(calendarSchedule *calSched, CalendarDialog *cal)
|
bool CSV_Exporter::exportCalendar(calendarSchedule *calSched, CalendarDialog *cal, calendarExam *exams)
|
||||||
{
|
{
|
||||||
if ((cal == NULL) || (calSched == NULL)) //pointers checking!
|
if ((cal == NULL) || (calSched == NULL)) //pointers checking!
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (calSched->getCourses() == NULL)
|
if (calSched->getCourses().isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "Getting path for csv file from user...";
|
qDebug() << Q_FUNC_INFO << "Getting path for csv file from user...";
|
||||||
|
@ -53,7 +52,7 @@ bool CSV_Exporter::exportCalendar(calendarSchedule *calSched, CalendarDialog *ca
|
||||||
|
|
||||||
out << CSV_CALENDAR_HEADER << "\n"; // macro in header file
|
out << CSV_CALENDAR_HEADER << "\n"; // macro in header file
|
||||||
|
|
||||||
for (calendarCourse *coursePtr: *(calSched->getCourses())) //main loop - running though all courses
|
for (calendarCourse *coursePtr: (calSched->getCourses())) //main loop - running though all courses
|
||||||
{
|
{
|
||||||
// Getting course info - store in vars for easy access
|
// Getting course info - store in vars for easy access
|
||||||
int day = coursePtr->getDay();
|
int day = coursePtr->getDay();
|
||||||
|
@ -97,6 +96,36 @@ bool CSV_Exporter::exportCalendar(calendarSchedule *calSched, CalendarDialog *ca
|
||||||
out.flush();
|
out.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(cal->isExams()) //Export Exams as well
|
||||||
|
{
|
||||||
|
qDebug() << "Exporting Exams!";
|
||||||
|
for(calendarExamCourse* exam:exams->getExams())
|
||||||
|
{
|
||||||
|
QTime startH = exam->getFirstHourbegin();
|
||||||
|
QTime endH = startH.addSecs(60*60*3);//add 3 hours
|
||||||
|
QString type = "מועד א";
|
||||||
|
QString name = exam->getName();
|
||||||
|
QDate date = exam->getFirstDate();
|
||||||
|
QString line = makeLine(name, &date, startH.hour(), startH.minute(), endH.hour(), endH.minute(), "", "", type);
|
||||||
|
if(line != NULL)
|
||||||
|
out << line << char(0x0A);
|
||||||
|
else
|
||||||
|
qWarning() << Q_FUNC_INFO << "CSV : Got A NULL in Line! in function: " << Q_FUNC_INFO;
|
||||||
|
//===============
|
||||||
|
// Second Date
|
||||||
|
//===============
|
||||||
|
startH = exam->getSecondHourbegin();
|
||||||
|
endH = startH.addSecs(60*60*3);//add 3 hours
|
||||||
|
date = exam->getSecondDate();
|
||||||
|
type = "מועד ב";
|
||||||
|
line = makeLine(name, &date, startH.hour(), startH.minute(), endH.hour(), endH.minute(), "", "", type);
|
||||||
|
if(line != NULL)
|
||||||
|
out << line << char(0x0A);
|
||||||
|
else
|
||||||
|
qWarning() << Q_FUNC_INFO << "CSV : Got A NULL in Line! in function: " << Q_FUNC_INFO;
|
||||||
|
}
|
||||||
|
out.flush();
|
||||||
|
}
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
qDebug() << Q_FUNC_INFO << "CSV : Exported Successfully";
|
qDebug() << Q_FUNC_INFO << "CSV : Exported Successfully";
|
||||||
|
@ -110,10 +139,14 @@ bool CSV_Exporter::exportCalendar(calendarSchedule *calSched, CalendarDialog *ca
|
||||||
*/
|
*/
|
||||||
QString CSV_Exporter::getFileFath()
|
QString CSV_Exporter::getFileFath()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getSaveFileName();
|
QString fileName = QFileDialog::getSaveFileName(NULL,
|
||||||
|
QObject::tr("JceManager Save Schedule Dialog"), "",
|
||||||
|
QObject::tr("CSV Files (*.csv);;All Files (*)"));
|
||||||
if (fileName == "")
|
if (fileName == "")
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!fileName.contains(".csv", Qt::CaseInsensitive))
|
|
||||||
|
//IMPORTENT! ADD CSV EXTENTION
|
||||||
|
if(!fileName.contains(".csv") && !fileName.contains(".CSV"))
|
||||||
fileName.append(".csv");
|
fileName.append(".csv");
|
||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
|
@ -124,7 +157,7 @@ QString CSV_Exporter::getFileFath()
|
||||||
* @param name
|
* @param name
|
||||||
* @param date
|
* @param date
|
||||||
* @param startH
|
* @param startH
|
||||||
* @param startM - Not used at the moment.
|
* @param startM
|
||||||
* @param endH
|
* @param endH
|
||||||
* @param endM
|
* @param endM
|
||||||
* @param lecturer
|
* @param lecturer
|
||||||
|
@ -149,20 +182,32 @@ QString CSV_Exporter::makeLine(QString name, QDate *date, int startH, int startM
|
||||||
|
|
||||||
QString start;
|
QString start;
|
||||||
start.append(QString::number(startH));
|
start.append(QString::number(startH));
|
||||||
start.append(":00");
|
if(startM != 0)
|
||||||
// start.append(QString::number(startM));
|
{
|
||||||
|
start.append(":");
|
||||||
|
start.append(QString::number(startM));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
start.append(":00");
|
||||||
start.append(":00");
|
start.append(":00");
|
||||||
|
|
||||||
QString end;
|
QString end;
|
||||||
end.append(QString::number(endH));
|
end.append(QString::number(endH));
|
||||||
end.append(":");
|
if(endM != 0)
|
||||||
end.append(QString::number(endM));
|
{
|
||||||
|
end.append(":");
|
||||||
|
end.append(QString::number(endM));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
end.append(":00");
|
||||||
end.append(":00");
|
end.append(":00");
|
||||||
|
|
||||||
QString description = "\"מרצה ";
|
QString description = "\"מרצה ";
|
||||||
|
|
||||||
if (lecturer == LECTURER_DEFAULT_STRING)
|
if (lecturer == LECTURER_DEFAULT_STRING)
|
||||||
description.append("טרם נקבע מרצה או מתרגל");
|
description.append("טרם נקבע מרצה או מתרגל");
|
||||||
|
else if(lecturer == "")
|
||||||
|
description = "";
|
||||||
else
|
else
|
||||||
description.append(lecturer);
|
description.append(lecturer);
|
||||||
|
|
||||||
|
@ -172,11 +217,14 @@ QString CSV_Exporter::makeLine(QString name, QDate *date, int startH, int startM
|
||||||
description.append("טרם נקבע מיקום");
|
description.append("טרם נקבע מיקום");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
description.append(" ב");
|
description.append(" ב");
|
||||||
description.append(room);
|
description.append(room);
|
||||||
}
|
}
|
||||||
|
|
||||||
description.append("\n Created with JCE Manager.\"");
|
if(room == "")
|
||||||
|
description = "\"Good Luck!\n";
|
||||||
|
|
||||||
|
description.append("\nCreated with JCE Manager.\"");
|
||||||
|
|
||||||
//Create the Fucking Line
|
//Create the Fucking Line
|
||||||
//Header: Subject,Start Date,Start Time,End Date,End Time,Description,Location
|
//Header: Subject,Start Date,Start Time,End Date,End Time,Description,Location
|
||||||
|
@ -237,3 +285,4 @@ void CSV_Exporter::changeDayNumberFromQtToNormal(int *QtDay)
|
||||||
}
|
}
|
||||||
return; //Done.
|
return; //Done.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,9 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
#include "../Calendar/calendarSchedule.h"
|
#include "../Calendar/coursesSchedule/calendarSchedule.h"
|
||||||
#include "../Calendar/calendarDialog.h"
|
#include "../Calendar/coursesSchedule/calendarDialog.h"
|
||||||
|
#include "../Calendar/Exams/calendarExam.h"
|
||||||
|
|
||||||
|
|
||||||
#define CSV_CALENDAR_HEADER "Subject,Start Date,Start Time,End Date,End Time,Description,Location"
|
#define CSV_CALENDAR_HEADER "Subject,Start Date,Start Time,End Date,End Time,Description,Location"
|
||||||
|
@ -26,7 +27,7 @@ class CSV_Exporter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CSV_Exporter();
|
CSV_Exporter();
|
||||||
static bool exportCalendar(calendarSchedule* calSched, CalendarDialog *cal);
|
static bool exportCalendar(calendarSchedule* calSched, CalendarDialog *cal, calendarExam* exams);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
127
src/jceData/Calendar/Exams/calendarExam.cpp
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
#include "calendarExam.h"
|
||||||
|
|
||||||
|
calendarExam::calendarExam()
|
||||||
|
{
|
||||||
|
htmlDataHolderParsed = "";
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @brief calendarExam::calendarExam
|
||||||
|
* copy constructor
|
||||||
|
* @param other
|
||||||
|
*/
|
||||||
|
calendarExam::calendarExam(calendarExam &other)
|
||||||
|
{
|
||||||
|
examsCounter = 0;
|
||||||
|
exams.clear();
|
||||||
|
for (calendarExamCourse * tempExam: other.getExams())
|
||||||
|
{
|
||||||
|
this->exams.push_back(new calendarExamCourse(*tempExam));
|
||||||
|
examsCounter++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief calendarExam::setPage - getting a html page and stripping it into a exams schedule in a list
|
||||||
|
* @param html - html page with tags
|
||||||
|
*/
|
||||||
|
void calendarExam::setPage(QString html)
|
||||||
|
{
|
||||||
|
examsCounter = 0;
|
||||||
|
exams.clear();
|
||||||
|
this->htmlDataHolderParsed = getString(html);
|
||||||
|
examListInit(htmlDataHolderParsed);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief calendarExam::examListInit spliting the stripped html into lines, and using linetocourse function to make it an object
|
||||||
|
* @param linesTokinzedString - list of lines, each line has differen exam information
|
||||||
|
*/
|
||||||
|
void calendarExam::examListInit(QString &linesTokinzedString)
|
||||||
|
{
|
||||||
|
QString tempToken;
|
||||||
|
|
||||||
|
QStringList holder = linesTokinzedString.split("\n");
|
||||||
|
QStringList::iterator iterator;
|
||||||
|
for (iterator = holder.begin(); iterator != holder.end(); ++iterator)
|
||||||
|
{
|
||||||
|
tempToken = (*iterator);
|
||||||
|
if (!tempToken.isEmpty())
|
||||||
|
{
|
||||||
|
calendarExamCourse *cTemp = lineToCourse(tempToken);
|
||||||
|
if (cTemp != NULL)
|
||||||
|
this->exams.push_back(cTemp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief calendarExam::lineToCourse getting line of exam with data and make it an object containing data (date, time, course name and etc)
|
||||||
|
* @param line - parsed line with tabs between each relevant data
|
||||||
|
* @return object of examcourse with its data
|
||||||
|
*/
|
||||||
|
calendarExamCourse *calendarExam::lineToCourse(QString line)
|
||||||
|
{
|
||||||
|
calendarExamCourse *tempC = NULL;
|
||||||
|
QString templinearray[EXAM_SCHEDULE_FIELDS];
|
||||||
|
//SERIAL, NAME, LECTURER, FIELD, TYPE, FIRST_DATE, FIRST_HOUR_BEGIN, SECOND_DATE, SECOND_HOUR_BEGIN
|
||||||
|
|
||||||
|
int serial;
|
||||||
|
QString name, lecturer, field, type, firstDate, firstHourbegin, secondDate, secondHourbegin;
|
||||||
|
|
||||||
|
QString tempToken;
|
||||||
|
int i = 0;
|
||||||
|
QStringList holder = line.split("\t");
|
||||||
|
QStringList::iterator iterator;
|
||||||
|
for (iterator = holder.begin(); iterator != holder.end(); ++iterator)
|
||||||
|
{
|
||||||
|
|
||||||
|
tempToken = (*iterator);
|
||||||
|
templinearray[i] = tempToken.trimmed();
|
||||||
|
i++;
|
||||||
|
if (i >= EXAM_SCHEDULE_FIELDS)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (templinearray[0] == "") //empty parsing
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
|
||||||
|
serial = templinearray[calendarExamCourse::CourseScheme::SERIAL].toInt();
|
||||||
|
name = templinearray[calendarExamCourse::CourseScheme::NAME];
|
||||||
|
|
||||||
|
lecturer = templinearray[calendarExamCourse::CourseScheme::LECTURER];
|
||||||
|
if (lecturer.isEmpty())
|
||||||
|
lecturer = LECTURER_DEFAULT_STRING;
|
||||||
|
|
||||||
|
field = templinearray[calendarExamCourse::CourseScheme::FIELD];
|
||||||
|
type = templinearray[calendarExamCourse::CourseScheme::TYPE];
|
||||||
|
|
||||||
|
firstDate = templinearray[calendarExamCourse::CourseScheme::FIRST_DATE];
|
||||||
|
if (firstDate.isEmpty())
|
||||||
|
return NULL; //can't set a default date to an exam. must be an error
|
||||||
|
|
||||||
|
firstHourbegin = templinearray[calendarExamCourse::CourseScheme::FIRST_HOUR_BEGIN];
|
||||||
|
if (firstHourbegin.isEmpty())
|
||||||
|
firstHourbegin = HOUR_DEFAULT_STRING;
|
||||||
|
secondDate = templinearray[calendarExamCourse::CourseScheme::SECOND_DATE];
|
||||||
|
if (secondDate.isEmpty())
|
||||||
|
{
|
||||||
|
secondDate = SECOND_DATE_DEFAULT_STRING;
|
||||||
|
secondHourbegin = HOUR_DEFAULT_STRING;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
secondHourbegin = templinearray[calendarExamCourse::CourseScheme::SECOND_HOUR_BEGIN];
|
||||||
|
if (secondHourbegin.isEmpty())
|
||||||
|
secondHourbegin = HOUR_DEFAULT_STRING;
|
||||||
|
}
|
||||||
|
|
||||||
|
tempC = new calendarExamCourse(serial,name,lecturer,field,type,firstDate,firstHourbegin,secondDate,secondHourbegin);
|
||||||
|
examsCounter++;
|
||||||
|
return tempC;
|
||||||
|
}
|
||||||
|
int calendarExam::getExamsCounter() const
|
||||||
|
{
|
||||||
|
return examsCounter;
|
||||||
|
}
|
||||||
|
|
42
src/jceData/Calendar/Exams/calendarExam.h
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
#ifndef CALENDAREXAM_H
|
||||||
|
#define CALENDAREXAM_H
|
||||||
|
|
||||||
|
#include "../../page.h"
|
||||||
|
#include "calendarExamCourse.h"
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <QStringList>
|
||||||
|
#include <QList>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The calendarExam class
|
||||||
|
*
|
||||||
|
* This class generating html string to a list of examcourses
|
||||||
|
* Each item in a list is a course with its information (hour, day, name, serial and etc)
|
||||||
|
*
|
||||||
|
* Made By liran ben gida, LiranBG@gmail.com On 08/10/2014
|
||||||
|
*/
|
||||||
|
class calendarExam : public Page
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
calendarExam();
|
||||||
|
calendarExam(calendarExam &other);
|
||||||
|
void setPage(QString html);
|
||||||
|
|
||||||
|
QList<calendarExamCourse*> getExams() { return exams; }
|
||||||
|
int getExamsCounter() const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void examListInit(QString &linesTokinzedString);
|
||||||
|
calendarExamCourse * lineToCourse(QString line);
|
||||||
|
|
||||||
|
QString htmlDataHolderParsed;
|
||||||
|
QList<calendarExamCourse*> exams;
|
||||||
|
|
||||||
|
int examsCounter; //not including madei b
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CALENDAREXAM_H
|
113
src/jceData/Calendar/Exams/calendarExamCourse.cpp
Normal file
|
@ -0,0 +1,113 @@
|
||||||
|
#include "calendarExamCourse.h"
|
||||||
|
|
||||||
|
|
||||||
|
calendarExamCourse::calendarExamCourse(int serial, QString name, QString lecturer, QString field,
|
||||||
|
QString type, QString firstDate, QString firstHourbegin,
|
||||||
|
QString secondDate, QString secondHourbegin) : Course (serial,name,type)
|
||||||
|
{
|
||||||
|
this->lecturer = lecturer;
|
||||||
|
this->field = field;
|
||||||
|
setDate(firstDate,true);
|
||||||
|
setDate(secondDate,false);
|
||||||
|
setTime(firstHourbegin,true);
|
||||||
|
setTime(secondHourbegin,false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
calendarExamCourse::calendarExamCourse(calendarExamCourse &other)
|
||||||
|
:Course (other.getSerialNum(),other.getName(),other.getType())
|
||||||
|
{
|
||||||
|
this->lecturer = other.lecturer;
|
||||||
|
this->field = other.field;
|
||||||
|
this->firstDate = other.getFirstDate();
|
||||||
|
this->firstHourbegin = other.firstHourbegin;
|
||||||
|
this->secondDate = other.secondDate;
|
||||||
|
this->secondHourbegin = other.secondHourbegin;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @brief calendarExamCourse::setDate
|
||||||
|
* @param date
|
||||||
|
* @param isFirst if true > first. otherwise > second
|
||||||
|
*/
|
||||||
|
void calendarExamCourse::setDate(QString date, bool isFirst)
|
||||||
|
{
|
||||||
|
if (isFirst)
|
||||||
|
this->firstDate = QDate::fromString(date,"dd/MM/yyyy");
|
||||||
|
else
|
||||||
|
this->secondDate = QDate::fromString(date,"dd/MM/yyyy");
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @brief calendarExamCourse::setTime
|
||||||
|
* @param time
|
||||||
|
* @param isFirst if true > first. otherwise > second
|
||||||
|
*/
|
||||||
|
void calendarExamCourse::setTime(QString time, bool isFirst)
|
||||||
|
{
|
||||||
|
// qDebug() << "time string is: " << time;
|
||||||
|
if (isFirst)
|
||||||
|
this->firstHourbegin = QTime::fromString(time,"hh:mm");
|
||||||
|
else
|
||||||
|
this->secondHourbegin = QTime::fromString(time,"hh:mm");
|
||||||
|
}
|
||||||
|
QTime calendarExamCourse::getSecondHourbegin() const
|
||||||
|
{
|
||||||
|
return secondHourbegin;
|
||||||
|
}
|
||||||
|
|
||||||
|
void calendarExamCourse::setSecondHourbegin(const QTime &value)
|
||||||
|
{
|
||||||
|
secondHourbegin = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDate calendarExamCourse::getSecondDate() const
|
||||||
|
{
|
||||||
|
return secondDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
void calendarExamCourse::setSecondDate(const QDate &value)
|
||||||
|
{
|
||||||
|
secondDate = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTime calendarExamCourse::getFirstHourbegin() const
|
||||||
|
{
|
||||||
|
return firstHourbegin;
|
||||||
|
}
|
||||||
|
|
||||||
|
void calendarExamCourse::setFirstHourbegin(const QTime &value)
|
||||||
|
{
|
||||||
|
firstHourbegin = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDate calendarExamCourse::getFirstDate() const
|
||||||
|
{
|
||||||
|
return firstDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
void calendarExamCourse::setFirstDate(const QDate &value)
|
||||||
|
{
|
||||||
|
firstDate = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString calendarExamCourse::getField() const
|
||||||
|
{
|
||||||
|
return field;
|
||||||
|
}
|
||||||
|
|
||||||
|
void calendarExamCourse::setField(const QString &value)
|
||||||
|
{
|
||||||
|
field = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString calendarExamCourse::getLecturer() const
|
||||||
|
{
|
||||||
|
return lecturer;
|
||||||
|
}
|
||||||
|
|
||||||
|
void calendarExamCourse::setLecturer(const QString &value)
|
||||||
|
{
|
||||||
|
lecturer = value;
|
||||||
|
}
|
||||||
|
|
82
src/jceData/Calendar/Exams/calendarExamCourse.h
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
#ifndef CALENDAREXAMCOURSE_H
|
||||||
|
#define CALENDAREXAMCOURSE_H
|
||||||
|
|
||||||
|
#include "../../course.h"
|
||||||
|
|
||||||
|
#include <QTime>
|
||||||
|
#include <QString>
|
||||||
|
#include <QDate>
|
||||||
|
|
||||||
|
#define EXAM_SCHEDULE_FIELDS 9
|
||||||
|
|
||||||
|
#define LECTURER_DEFAULT_STRING "nullLecturer"
|
||||||
|
#define HOUR_DEFAULT_STRING "00:00"
|
||||||
|
#define SECOND_DATE_DEFAULT_STRING "nullSECOND_DATE"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The calendarExamCourse class
|
||||||
|
*
|
||||||
|
* This class holds each exam course
|
||||||
|
* the course scheme can be found below, inside the enum CourseScheme
|
||||||
|
*
|
||||||
|
* The class's constructor gets the data and manipulate it into an object
|
||||||
|
* with its relevant information.
|
||||||
|
*
|
||||||
|
* Made By liran ben gida, LiranBG@gmail.com On 08/10/2014
|
||||||
|
*/
|
||||||
|
class calendarExamCourse : public Course
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
enum CourseScheme
|
||||||
|
{
|
||||||
|
SERIAL,
|
||||||
|
NAME,
|
||||||
|
LECTURER,
|
||||||
|
FIELD,
|
||||||
|
TYPE,
|
||||||
|
FIRST_DATE,
|
||||||
|
FIRST_HOUR_BEGIN,
|
||||||
|
SECOND_DATE,
|
||||||
|
SECOND_HOUR_BEGIN
|
||||||
|
};
|
||||||
|
|
||||||
|
calendarExamCourse(int serial, QString name, QString lecturer, QString field,
|
||||||
|
QString type, QString firstDate, QString firstHourbegin,
|
||||||
|
QString secondDate, QString secondHourbegin);
|
||||||
|
calendarExamCourse(calendarExamCourse &other);
|
||||||
|
|
||||||
|
|
||||||
|
QString getLecturer() const;
|
||||||
|
void setLecturer(const QString &value);
|
||||||
|
|
||||||
|
QString getField() const;
|
||||||
|
void setField(const QString &value);
|
||||||
|
|
||||||
|
QDate getFirstDate() const;
|
||||||
|
void setFirstDate(const QDate &value);
|
||||||
|
|
||||||
|
QTime getFirstHourbegin() const;
|
||||||
|
void setFirstHourbegin(const QTime &value);
|
||||||
|
|
||||||
|
QDate getSecondDate() const;
|
||||||
|
void setSecondDate(const QDate &value);
|
||||||
|
|
||||||
|
QTime getSecondHourbegin() const;
|
||||||
|
void setSecondHourbegin(const QTime &value);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void setDate(QString date, bool isFirst); //isFirst = true > first. otherwise > second
|
||||||
|
void setTime(QString time, bool isFirst); //isFirst = true > first. otherwise > second
|
||||||
|
|
||||||
|
QString lecturer;
|
||||||
|
QString field;
|
||||||
|
QDate firstDate;
|
||||||
|
QTime firstHourbegin;
|
||||||
|
QDate secondDate;
|
||||||
|
QTime secondHourbegin;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CALENDAREXAMCOURSE_H
|
245
src/jceData/Calendar/Exams/examDialog.cpp
Normal file
|
@ -0,0 +1,245 @@
|
||||||
|
#include "examDialog.h"
|
||||||
|
#include "ui_examDialog.h"
|
||||||
|
/**
|
||||||
|
* @brief examDialog::examDialog
|
||||||
|
* @param parent
|
||||||
|
* @param calSchedPtr - list of courses with information about each exam
|
||||||
|
*/
|
||||||
|
examDialog::examDialog(QWidget *parent, calendarExam *calExamPtr) : QDialog(parent),
|
||||||
|
ui(new Ui::examDialog)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
exams = calExamPtr;
|
||||||
|
this->examsCpy = NULL;
|
||||||
|
|
||||||
|
QStringList headLine;
|
||||||
|
//SERIAL, NAME, LECTURER, FIELD, TYPE, FIRST_DATE, FIRST_HOUR_BEGIN, SECOND_DATE, SECOND_HOUR_BEGIN
|
||||||
|
|
||||||
|
headLine << tr("Serial") << tr("Course") << tr("Lecturer") << tr("Field") << tr("Type") << tr("Exam 1 Date") << tr("Starting Hour") << tr("Exam 2 Date") << tr("Starting Hour");
|
||||||
|
|
||||||
|
ui->tableWidget->verticalHeader()->setVisible(false);
|
||||||
|
ui->tableWidget->horizontalHeader()->setVisible(true);
|
||||||
|
ui->tableWidget->setColumnCount(EXAM_SCHEDULE_FIELDS);
|
||||||
|
ui->tableWidget->setHorizontalHeaderLabels(headLine);
|
||||||
|
ui->tableWidget->setLayoutDirection(Qt::LayoutDirection::RightToLeft);
|
||||||
|
ui->tableWidget->setSortingEnabled(false);
|
||||||
|
|
||||||
|
this->setModal(true); //always on top
|
||||||
|
|
||||||
|
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
|
||||||
|
ui->tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::Interactive);
|
||||||
|
|
||||||
|
connect(ui->tableWidget,SIGNAL(itemChanged(QTableWidgetItem*)),this,SLOT(upgradeExamsTime(QTableWidgetItem*)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief examDialog::initializingDataIntoTable
|
||||||
|
*
|
||||||
|
* Inserting each object of exam into the table
|
||||||
|
*/
|
||||||
|
void examDialog::initializingDataIntoTable()
|
||||||
|
{
|
||||||
|
disconnect(ui->tableWidget,SIGNAL(itemChanged(QTableWidgetItem*)),this,SLOT(upgradeExamsTime(QTableWidgetItem*)));
|
||||||
|
ui->tableWidget->setRowCount(exams->getExamsCounter());
|
||||||
|
this->examsCpy = new calendarExam(*exams);
|
||||||
|
|
||||||
|
int i=0,j=0;
|
||||||
|
int year,month,day; //for constructin qdate by setdate
|
||||||
|
QTableWidgetItem *lecturer,*name,*type;
|
||||||
|
QTableWidgetItem *serial;
|
||||||
|
QTableWidgetItem *field;
|
||||||
|
QTableWidgetItem *firstDate;
|
||||||
|
QTableWidgetItem *firstHourbegin;
|
||||||
|
QTableWidgetItem *secondDate;
|
||||||
|
QTableWidgetItem *secondHourbegin;
|
||||||
|
for (calendarExamCourse * tempExam: exams->getExams())
|
||||||
|
{
|
||||||
|
j=0;
|
||||||
|
|
||||||
|
lecturer = new QTableWidgetItem();
|
||||||
|
lecturer->setData(Qt::EditRole, tempExam->getLecturer());
|
||||||
|
lecturer->setFlags(lecturer->flags() & ~Qt::ItemIsEditable);
|
||||||
|
|
||||||
|
name = new QTableWidgetItem();
|
||||||
|
name->setData(Qt::EditRole, tempExam->getName());
|
||||||
|
name->setFlags(name->flags() & ~Qt::ItemIsEditable);
|
||||||
|
|
||||||
|
type = new QTableWidgetItem();
|
||||||
|
type->setData(Qt::EditRole, tempExam->getType());
|
||||||
|
type->setFlags(type->flags() & ~Qt::ItemIsEditable);
|
||||||
|
|
||||||
|
serial = new QTableWidgetItem();
|
||||||
|
serial->setData(Qt::EditRole, tempExam->getSerialNum());
|
||||||
|
serial->setFlags(serial->flags() & ~Qt::ItemIsEditable);
|
||||||
|
|
||||||
|
field = new QTableWidgetItem();
|
||||||
|
field->setData(Qt::EditRole, tempExam->getField());
|
||||||
|
field->setFlags(field->flags() & ~Qt::ItemIsEditable);
|
||||||
|
|
||||||
|
firstDate = new QTableWidgetItem();
|
||||||
|
tempExam->getFirstDate().getDate(&year,&month,&day);
|
||||||
|
firstDate->setData(Qt::EditRole, QDate(year,month,day).toString("d/M/yy"));
|
||||||
|
firstDate->setFlags(firstDate->flags() & ~Qt::ItemIsEditable);
|
||||||
|
|
||||||
|
secondDate = new QTableWidgetItem();
|
||||||
|
tempExam->getSecondDate().getDate(&year,&month,&day);
|
||||||
|
secondDate->setData(Qt::EditRole, QDate(year,month,day).toString("d/M/yy"));
|
||||||
|
secondDate->setFlags(secondDate->flags() & ~Qt::ItemIsEditable);
|
||||||
|
|
||||||
|
firstHourbegin = new QTableWidgetItem();
|
||||||
|
firstHourbegin->setData(Qt::EditRole, QTime(tempExam->getFirstHourbegin().hour(),tempExam->getFirstHourbegin().minute()).toString("hh:mm"));
|
||||||
|
|
||||||
|
secondHourbegin = new QTableWidgetItem();
|
||||||
|
secondHourbegin->setData(Qt::EditRole, QTime(tempExam->getSecondHourbegin().hour(),tempExam->getSecondHourbegin().minute()).toString("hh:mm"));
|
||||||
|
|
||||||
|
|
||||||
|
ui->tableWidget->setItem(i,j++,serial);
|
||||||
|
ui->tableWidget->setItem(i,j++,name);
|
||||||
|
ui->tableWidget->setItem(i,j++,lecturer);
|
||||||
|
ui->tableWidget->setItem(i,j++,field);
|
||||||
|
ui->tableWidget->setItem(i,j++,type);
|
||||||
|
ui->tableWidget->setItem(i,j++,firstDate);
|
||||||
|
ui->tableWidget->setItem(i,j++,firstHourbegin);
|
||||||
|
ui->tableWidget->setItem(i,j++,secondDate);
|
||||||
|
ui->tableWidget->setItem(i,j++,secondHourbegin);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
resetGeo();
|
||||||
|
connect(ui->tableWidget,SIGNAL(itemChanged(QTableWidgetItem*)),this,SLOT(upgradeExamsTime(QTableWidgetItem*)));
|
||||||
|
}
|
||||||
|
examDialog::~examDialog()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief examDialog::upgradeExamsTime
|
||||||
|
* gets an item and check if its value is valid by time.
|
||||||
|
* currently we allow only modification of time
|
||||||
|
*
|
||||||
|
* @param item - tablewidet from ui->tablewidet.
|
||||||
|
* @return true if has been changed. false otherwise
|
||||||
|
*/
|
||||||
|
bool examDialog::upgradeExamsTime(QTableWidgetItem *item)
|
||||||
|
{
|
||||||
|
QString text;
|
||||||
|
int row,col;
|
||||||
|
text = item->text();
|
||||||
|
row = item->row();
|
||||||
|
col = item->column();
|
||||||
|
if (ui->tableWidget->item(row,calendarExamCourse::CourseScheme::SERIAL) == NULL)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
int serialCourse = ui->tableWidget->item(row,calendarExamCourse::CourseScheme::SERIAL)->text().toInt();
|
||||||
|
for (calendarExamCourse * tempExam: exams->getExams())
|
||||||
|
{
|
||||||
|
if (tempExam->getSerialNum() == serialCourse)
|
||||||
|
{
|
||||||
|
if (QTime::fromString(text).isValid())
|
||||||
|
{
|
||||||
|
if (col == calendarExamCourse::CourseScheme::FIRST_HOUR_BEGIN)
|
||||||
|
tempExam->setFirstHourbegin(QTime::fromString(text));
|
||||||
|
else if (col == calendarExamCourse::CourseScheme::SECOND_HOUR_BEGIN)
|
||||||
|
tempExam->setSecondHourbegin(QTime::fromString(text));
|
||||||
|
else
|
||||||
|
qCritical() << Q_FUNC_INFO; //is doesnt need to get here. we allow modifications only at hours
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (col == calendarExamCourse::CourseScheme::FIRST_HOUR_BEGIN)
|
||||||
|
ui->tableWidget->item(row,col)->setData(Qt::EditRole, QTime(tempExam->getFirstHourbegin().hour(),tempExam->getFirstHourbegin().minute()).toString("hh:mm"));
|
||||||
|
else if (col == calendarExamCourse::CourseScheme::SECOND_HOUR_BEGIN)
|
||||||
|
ui->tableWidget->item(row,col)->setData(Qt::EditRole, QTime(tempExam->getSecondHourbegin().hour(),tempExam->getSecondHourbegin().minute()).toString("hh:mm"));
|
||||||
|
else
|
||||||
|
qCritical() << Q_FUNC_INFO; //is doesnt need to get here. we allow modifications only at hours
|
||||||
|
qWarning() << Q_FUNC_INFO << "missmatch data";
|
||||||
|
QMessageBox::critical(this,tr("Error"),tr("Missmatching data.\nFormat: hh:mm\nIn Example: 08:25 or 12:05"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief examDialog::resetGeo
|
||||||
|
* Resizes Dialog according to widgets and table content
|
||||||
|
*/
|
||||||
|
void examDialog::resetGeo()
|
||||||
|
{
|
||||||
|
|
||||||
|
ui->tableWidget->resizeColumnsToContents();
|
||||||
|
ui->tableWidget->resizeRowsToContents();
|
||||||
|
|
||||||
|
int mWidth=0,mHeight=0;
|
||||||
|
mHeight += ui->tableWidget->horizontalHeader()->height() + 4;
|
||||||
|
for (int i=0,j=0; i < ui->tableWidget->rowCount() && j < ui->tableWidget->columnCount();++i,++j)
|
||||||
|
{
|
||||||
|
mWidth += ui->tableWidget->columnWidth(j);
|
||||||
|
mHeight += ui->tableWidget->rowHeight(i) + 4;
|
||||||
|
|
||||||
|
}
|
||||||
|
mHeight += ui->frameBtns->height() + 30;
|
||||||
|
mHeight += ui->labelHeader->height() + 4;
|
||||||
|
|
||||||
|
|
||||||
|
this->setMinimumHeight(mHeight);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void examDialog::on_pushButtonOk_clicked()
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
this->hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
void examDialog::on_pushButtonRevert_clicked()
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
|
if (ui->tableWidget->rowCount() <= 0)
|
||||||
|
return;
|
||||||
|
if (this->exams == NULL)
|
||||||
|
return;
|
||||||
|
if (this->examsCpy == NULL)
|
||||||
|
return;
|
||||||
|
for (int i = 0; i < ui->tableWidget->rowCount(); ++i)
|
||||||
|
{
|
||||||
|
calendarExamCourse * temp = getExamByRow(i);
|
||||||
|
for (calendarExamCourse * notChangedCourse: examsCpy->getExams())
|
||||||
|
{
|
||||||
|
if (temp->getSerialNum() == notChangedCourse->getSerialNum())
|
||||||
|
{
|
||||||
|
if (temp->getFirstHourbegin() != notChangedCourse->getFirstHourbegin())
|
||||||
|
{
|
||||||
|
ui->tableWidget->item(i,calendarExamCourse::CourseScheme::FIRST_HOUR_BEGIN)->setData(Qt::EditRole, QTime(notChangedCourse->getFirstHourbegin().hour(),notChangedCourse->getFirstHourbegin().minute()).toString("hh:mm"));
|
||||||
|
}
|
||||||
|
if (temp->getSecondHourbegin() != notChangedCourse->getSecondHourbegin())
|
||||||
|
{
|
||||||
|
ui->tableWidget->item(i,calendarExamCourse::CourseScheme::SECOND_HOUR_BEGIN)->setData(Qt::EditRole, QTime(notChangedCourse->getSecondHourbegin().hour(),notChangedCourse->getSecondHourbegin().minute()).toString("hh:mm"));
|
||||||
|
}
|
||||||
|
break; //done with course. go to next row
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
calendarExamCourse *examDialog::getExamByRow(int row)
|
||||||
|
{
|
||||||
|
int serialNum = ui->tableWidget->item(row,calendarExamCourse::CourseScheme::SERIAL)->text().toInt();
|
||||||
|
for (calendarExamCourse * temp : exams->getExams())
|
||||||
|
{
|
||||||
|
if (serialNum == temp->getSerialNum())
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void examDialog::on_pushButtonCancel_clicked()
|
||||||
|
{
|
||||||
|
on_pushButtonRevert_clicked(); //make revert to discard all changes
|
||||||
|
this->hide();
|
||||||
|
}
|
54
src/jceData/Calendar/Exams/examDialog.h
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
#ifndef EXAMDIALOG_H
|
||||||
|
#define EXAMDIALOG_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
#include <QTime>
|
||||||
|
#include <QTableWidgetItem>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QScrollBar>
|
||||||
|
#include "calendarExam.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class examDialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The examDialog class
|
||||||
|
*
|
||||||
|
* This class preseting a Dialog with dates, information and time of exams
|
||||||
|
*
|
||||||
|
* This dialog main goal is to let the user an option to edit and see the containing data of his exam schedule.
|
||||||
|
* The user will be able to export the exam schedule into .CSV file through CalendarTab
|
||||||
|
*
|
||||||
|
* Made By liran ben gida, LiranBG@gmail.com On 08/10/2014
|
||||||
|
*/
|
||||||
|
class examDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit examDialog(QWidget *parent, calendarExam * calExamPtr);
|
||||||
|
void initializingDataIntoTable();
|
||||||
|
~examDialog();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
bool upgradeExamsTime(QTableWidgetItem* item);
|
||||||
|
|
||||||
|
void on_pushButtonOk_clicked();
|
||||||
|
|
||||||
|
void on_pushButtonRevert_clicked();
|
||||||
|
|
||||||
|
void on_pushButtonCancel_clicked();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
calendarExamCourse *getExamByRow(int row);
|
||||||
|
void resetGeo();
|
||||||
|
|
||||||
|
Ui::examDialog *ui;
|
||||||
|
calendarExam * exams;
|
||||||
|
calendarExam * examsCpy;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // EXAMDIALOG_H
|
133
src/jceData/Calendar/Exams/examDialog.ui
Normal file
|
@ -0,0 +1,133 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>examDialog</class>
|
||||||
|
<widget class="QDialog" name="examDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>810</width>
|
||||||
|
<height>306</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Exam Dialog</string>
|
||||||
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset resource="../../../../resources/connectionstatus.qrc">
|
||||||
|
<normaloff>:/icons/icon.ico</normaloff>:/icons/icon.ico</iconset>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QFrame" name="frameAll">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">#frameAll {
|
||||||
|
border: 0px solids;
|
||||||
|
}</string>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QFrame" name="frameBtns">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">#frameBtns {
|
||||||
|
border: 0px solids;
|
||||||
|
}</string>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>510</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonRevert">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Revert changes</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Revert</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonCancel">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Discard and hide</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Cancel</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonOk">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Save and hide</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Ok</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QTableWidget" name="tableWidget">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="labelHeader">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p align="center"><span style=" font-size:14pt;">Exams Schedule</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="../../../../resources/connectionstatus.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
|
@ -1,216 +0,0 @@
|
||||||
<?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>631</width>
|
|
||||||
<height>281</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Dates Dialog</string>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="layoutWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>10</y>
|
|
||||||
<width>613</width>
|
|
||||||
<height>263</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>
|
|
|
@ -1,120 +0,0 @@
|
||||||
#include "calendarPage.h"
|
|
||||||
|
|
||||||
QString CalendarPage::htmlToString()
|
|
||||||
{
|
|
||||||
return tempHtml;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CalendarPage::setPage(QString html)
|
|
||||||
{
|
|
||||||
|
|
||||||
courses = new std::list<calendarCourse*>();
|
|
||||||
tempHtml = getString(html);
|
|
||||||
tempHtml = tokenToLines(tempHtml);
|
|
||||||
calendarListInit(tempHtml);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CalendarPage::tokenToLines(QString &textToParse)
|
|
||||||
{
|
|
||||||
int ctr = 0;
|
|
||||||
QString temp = "";
|
|
||||||
char *tok;
|
|
||||||
char* textToTok = strdup(textToParse.toStdString().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(QString &linesTokinzedString)
|
|
||||||
{
|
|
||||||
std::list<QString> stringHolder;
|
|
||||||
QString temp;
|
|
||||||
calendarCourse * cTemp = NULL;
|
|
||||||
char* tok;
|
|
||||||
char* textToTok = strdup(linesTokinzedString.toStdString().c_str());
|
|
||||||
tok = strtok(textToTok,"\n");
|
|
||||||
while (tok != NULL)
|
|
||||||
{
|
|
||||||
temp = tok;
|
|
||||||
stringHolder.push_back(temp);
|
|
||||||
tok = strtok(NULL, "\n");
|
|
||||||
}
|
|
||||||
for (QString temp: stringHolder)
|
|
||||||
{
|
|
||||||
cTemp = lineToCourse(temp);
|
|
||||||
if (cTemp != NULL)
|
|
||||||
courses->push_back(cTemp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
calendarCourse *CalendarPage::lineToCourse(QString line)
|
|
||||||
{
|
|
||||||
|
|
||||||
calendarCourse *tempC = NULL;
|
|
||||||
QString templinearray[CALENDAR_COURSE_FIELDS];//[serial,name,type,lecturer,points,semesterhours,dayandhours,room]
|
|
||||||
int serial;
|
|
||||||
double points,semesterHours;
|
|
||||||
QString name,type, lecturer,dayAndHour,room;
|
|
||||||
QString tempS = "";
|
|
||||||
int i = 0;
|
|
||||||
char* tok;
|
|
||||||
char* cLine = strdup(line.toStdString().c_str());
|
|
||||||
tok = strtok(cLine, "\t");
|
|
||||||
while(tok != NULL)
|
|
||||||
{
|
|
||||||
tempS = QString(tok);
|
|
||||||
|
|
||||||
if (i >= 1)
|
|
||||||
{
|
|
||||||
templinearray[i-1] = tempS.trimmed();
|
|
||||||
}
|
|
||||||
|
|
||||||
i++;
|
|
||||||
if (i > 8)
|
|
||||||
break;
|
|
||||||
tok=strtok(NULL, "\t");
|
|
||||||
}
|
|
||||||
if (templinearray[0] == "") //empty parsing
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
serial = templinearray[calendarCourse::CourseScheme::SERIAL].toInt();
|
|
||||||
name = templinearray[calendarCourse::CourseScheme::NAME];
|
|
||||||
type = templinearray[calendarCourse::CourseScheme::TYPE];
|
|
||||||
|
|
||||||
|
|
||||||
if (!templinearray[calendarCourse::CourseScheme::LECTURER].isEmpty())
|
|
||||||
lecturer = templinearray[calendarCourse::CourseScheme::LECTURER];
|
|
||||||
else
|
|
||||||
lecturer = LECTURER_DEFAULT_STRING;
|
|
||||||
|
|
||||||
if (!templinearray[calendarCourse::CourseScheme::POINTS].isEmpty())
|
|
||||||
points = templinearray[calendarCourse::CourseScheme::POINTS].toDouble();
|
|
||||||
else
|
|
||||||
points = 0;
|
|
||||||
if (!templinearray[calendarCourse::CourseScheme::SEM_HOURS].isEmpty())
|
|
||||||
semesterHours = templinearray[calendarCourse::CourseScheme::SEM_HOURS].toDouble();
|
|
||||||
else
|
|
||||||
semesterHours = 0;
|
|
||||||
|
|
||||||
dayAndHour = templinearray[calendarCourse::CourseScheme::DAY_AND_HOURS];
|
|
||||||
|
|
||||||
if (!templinearray[calendarCourse::CourseScheme::ROOM].isEmpty())
|
|
||||||
room = templinearray[calendarCourse::CourseScheme::ROOM];
|
|
||||||
else
|
|
||||||
room = ROOM_DEFAULT_STRING;
|
|
||||||
|
|
||||||
tempC = new calendarCourse(serial,name,type,lecturer,points,semesterHours,dayAndHour,room);
|
|
||||||
|
|
||||||
return tempC;
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
#ifndef CALENDARPAGE_H
|
|
||||||
#define CALENDARPAGE_H
|
|
||||||
|
|
||||||
#include "../page.h"
|
|
||||||
#include "calendarCourse.h"
|
|
||||||
#include <list>
|
|
||||||
|
|
||||||
#define ROOM_DEFAULT_STRING "nullRoom"
|
|
||||||
#define LECTURER_DEFAULT_STRING "nullLecturer"
|
|
||||||
|
|
||||||
class CalendarPage : public Page
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
QString htmlToString();
|
|
||||||
std::list<calendarCourse*>* getCourses() { return courses; }
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual void setPage(QString html);
|
|
||||||
CalendarPage() { courses = NULL; }
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
QString tokenToLines(QString &textToParse);
|
|
||||||
void calendarListInit(QString &linesTokinzedString);
|
|
||||||
calendarCourse* lineToCourse(QString line);
|
|
||||||
|
|
||||||
QString tempHtml;
|
|
||||||
std::list<calendarCourse*>* courses;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // CALENDARPAGE_H
|
|
|
@ -43,12 +43,14 @@ void CalendarDialog::on_calStart_selectionChanged()
|
||||||
{
|
{
|
||||||
if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate()) //User input is invalid
|
if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate()) //User input is invalid
|
||||||
{
|
{
|
||||||
|
|
||||||
changeLabeStatusIcon(false);
|
changeLabeStatusIcon(false);
|
||||||
ui->lbl_status->setText(tr("The end of the semester can NOT be equal or before the semester begin."));
|
ui->lbl_status->setText(tr("Invalid dates interval"));
|
||||||
this->isOK = false;
|
this->isOK = false;
|
||||||
}
|
}
|
||||||
else // input is valid
|
else // input is valid
|
||||||
{
|
{
|
||||||
|
this->resize(610,310);
|
||||||
changeLabeStatusIcon(true);
|
changeLabeStatusIcon(true);
|
||||||
ui->lbl_status->setText(tr("Looks fine, Click \"OK\""));
|
ui->lbl_status->setText(tr("Looks fine, Click \"OK\""));
|
||||||
this->isOK = true;
|
this->isOK = true;
|
||||||
|
@ -61,7 +63,7 @@ void CalendarDialog::on_calStart_selectionChanged()
|
||||||
void CalendarDialog::on_buttonBox_accepted()
|
void CalendarDialog::on_buttonBox_accepted()
|
||||||
{
|
{
|
||||||
if(this->isOK)
|
if(this->isOK)
|
||||||
qDebug() << "CalendarDialog: Valid input";
|
qDebug() << Q_FUNC_INFO << "CalendarDialog: Valid input";
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalendarDialog::on_calEnd_selectionChanged()
|
void CalendarDialog::on_calEnd_selectionChanged()
|
||||||
|
@ -69,7 +71,8 @@ void CalendarDialog::on_calEnd_selectionChanged()
|
||||||
if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate())
|
if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate())
|
||||||
{
|
{
|
||||||
changeLabeStatusIcon(false);
|
changeLabeStatusIcon(false);
|
||||||
ui->lbl_status->setText(tr("The end of the semester can NOT be equal or before the semester begin."));
|
ui->lbl_status->setText(tr("Invalid dates interval"));
|
||||||
|
|
||||||
this->isOK = false;
|
this->isOK = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -93,3 +96,7 @@ void CalendarDialog::changeLabeStatusIcon(bool goodOrBad)
|
||||||
iconPixStatus.load(":/icons/iconX.png");
|
iconPixStatus.load(":/icons/iconX.png");
|
||||||
this->ui->labelIconStatus->setPixmap(iconPixStatus);
|
this->ui->labelIconStatus->setPixmap(iconPixStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CalendarDialog::isExams(){
|
||||||
|
return ui->isExam->isChecked();
|
||||||
|
}
|
|
@ -1,10 +1,12 @@
|
||||||
/**
|
/**
|
||||||
* JCE Manager (C)
|
* JCE Manager (C)
|
||||||
*
|
*
|
||||||
* This QDialog widget will hold the dates of a Semester, Start and End.
|
* This QDialog widget hold the dates of a Semester, Start and End.
|
||||||
*
|
*
|
||||||
* this dialog will help the csv_exporter class to export a CSV file that will contain
|
* this dialog will help the csv_exporter class to export a CSV file that will contain
|
||||||
* all the courses within that period of time.
|
* all the courses within that period of time.
|
||||||
|
*
|
||||||
|
* Made By Sagi Dayan, sagidayan@gmail.com On 22/09/2014
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CALENDARDIALOG_H
|
#ifndef CALENDARDIALOG_H
|
||||||
|
@ -28,6 +30,7 @@ public:
|
||||||
QDate getStartDate();
|
QDate getStartDate();
|
||||||
QDate getEndDate();
|
QDate getEndDate();
|
||||||
bool ok();
|
bool ok();
|
||||||
|
bool isExams();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_calStart_selectionChanged();
|
void on_calStart_selectionChanged();
|
247
src/jceData/Calendar/coursesSchedule/calendarDialog.ui
Normal file
|
@ -0,0 +1,247 @@
|
||||||
|
<?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>830</width>
|
||||||
|
<height>310</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Dates Dialog</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="labelHeader">
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:600;">Schedule Exportation</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<layout class="QGridLayout" name="gridLayoutSem">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<layout class="QGridLayout" name="gridLayoutSemStart">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="labelSemesterStart">
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p align="center">Semester Starts At:</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QCalendarWidget" name="calStart">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</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>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<layout class="QGridLayout" name="gridLayoutSemEnd">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="labelSemesterEnd">
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p align="center">Semester Ends At:</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QCalendarWidget" name="calEnd">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<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 row="2" column="0">
|
||||||
|
<widget class="QLabel" name="labelNote">
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:600;">The dates were chosen according to JCE General Academic Calendar for the first semester</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<layout class="QGridLayout" name="gridLayoutButtomPanel">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="labelIconStatus">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="lbl_status">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><b>Please chose your dates correctly</b></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<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 row="0" column="3">
|
||||||
|
<widget class="QCheckBox" name="isExam">
|
||||||
|
<property name="text">
|
||||||
|
<string>Include Exams</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="4">
|
||||||
|
<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>
|
||||||
|
<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>
|
112
src/jceData/Calendar/coursesSchedule/calendarPage.cpp
Normal file
|
@ -0,0 +1,112 @@
|
||||||
|
#include "calendarPage.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief CalendarPage::setPage getting the html and stripping it into a courses schedule in a list
|
||||||
|
* @param html
|
||||||
|
*/
|
||||||
|
void CalendarPage::setPage(QString html)
|
||||||
|
{
|
||||||
|
courses.clear();
|
||||||
|
tempHtml = getString(html);
|
||||||
|
calendarListInit(tempHtml);
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @brief CalendarPage::calendarListInit - make an object from each line of course
|
||||||
|
* @param linesTokinzedString - string contain lines of coureses. each string contain single course information
|
||||||
|
*/
|
||||||
|
void CalendarPage::calendarListInit(QString &linesTokinzedString)
|
||||||
|
{
|
||||||
|
QString tempToken;
|
||||||
|
|
||||||
|
QStringList holder = linesTokinzedString.split("\n");
|
||||||
|
QStringList::iterator iterator;
|
||||||
|
for (iterator = holder.begin(); iterator != holder.end(); ++iterator)
|
||||||
|
{
|
||||||
|
tempToken = (*iterator);
|
||||||
|
|
||||||
|
if (!tempToken.isEmpty())
|
||||||
|
{
|
||||||
|
calendarCourse *cTemp = lineToCourse(tempToken);
|
||||||
|
if (cTemp != NULL)
|
||||||
|
this->courses.push_back(cTemp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief CalendarPage::lineToCourse
|
||||||
|
* @param line - line of course contain its data and information
|
||||||
|
* @return calendarcourse object with its information
|
||||||
|
*/
|
||||||
|
calendarCourse *CalendarPage::lineToCourse(QString line)
|
||||||
|
{
|
||||||
|
|
||||||
|
calendarCourse *tempC = NULL;
|
||||||
|
QString templinearray[CALENDAR_COURSE_FIELDS];//[serial,name,type,lecturer,points,semesterhours,dayandhours,room]
|
||||||
|
int serial;
|
||||||
|
double points,semesterHours;
|
||||||
|
QString name,type, lecturer,dayAndHour,room;
|
||||||
|
|
||||||
|
QString tempToken;
|
||||||
|
int i = 0;
|
||||||
|
QStringList holder = line.split("\t");
|
||||||
|
QStringList::iterator iterator;
|
||||||
|
for (iterator = holder.begin(); iterator != holder.end(); ++iterator)
|
||||||
|
{
|
||||||
|
tempToken = (*iterator);
|
||||||
|
|
||||||
|
if (i >= 1) //skips on semester character
|
||||||
|
{
|
||||||
|
templinearray[i-1] = tempToken.trimmed();
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
if (i > CALENDAR_COURSE_FIELDS)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (templinearray[0] == "") //empty parsing
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
|
||||||
|
serial = templinearray[calendarCourse::CourseScheme::SERIAL].toInt();
|
||||||
|
name = templinearray[calendarCourse::CourseScheme::NAME];
|
||||||
|
type = templinearray[calendarCourse::CourseScheme::TYPE];
|
||||||
|
|
||||||
|
|
||||||
|
if (!templinearray[calendarCourse::CourseScheme::LECTURER].isEmpty())
|
||||||
|
lecturer = templinearray[calendarCourse::CourseScheme::LECTURER];
|
||||||
|
else
|
||||||
|
lecturer = LECTURER_DEFAULT_STRING;
|
||||||
|
|
||||||
|
if (!templinearray[calendarCourse::CourseScheme::POINTS].isEmpty())
|
||||||
|
points = templinearray[calendarCourse::CourseScheme::POINTS].toDouble();
|
||||||
|
else
|
||||||
|
points = 0;
|
||||||
|
if (!templinearray[calendarCourse::CourseScheme::SEM_HOURS].isEmpty())
|
||||||
|
semesterHours = templinearray[calendarCourse::CourseScheme::SEM_HOURS].toDouble();
|
||||||
|
else
|
||||||
|
semesterHours = 0;
|
||||||
|
|
||||||
|
dayAndHour = templinearray[calendarCourse::CourseScheme::DAY_AND_HOURS];
|
||||||
|
|
||||||
|
if (!templinearray[calendarCourse::CourseScheme::ROOM].isEmpty())
|
||||||
|
room = templinearray[calendarCourse::CourseScheme::ROOM];
|
||||||
|
else
|
||||||
|
room = ROOM_DEFAULT_STRING;
|
||||||
|
|
||||||
|
|
||||||
|
tempC = new calendarCourse(serial,name,type,lecturer,points,semesterHours,dayAndHour,room);
|
||||||
|
// qDebug() << "serial is: " << tempC->getSerialNum();
|
||||||
|
// qDebug() << tempC->getName();
|
||||||
|
// qDebug() << tempC->getType();
|
||||||
|
// qDebug() << tempC->getLecturer();
|
||||||
|
// qDebug() << tempC->getPoints();
|
||||||
|
// qDebug() << tempC->getHourBegin() << ":" << tempC->getMinutesBegin();
|
||||||
|
// qDebug() << tempC->getHourEnd() << ":" << tempC->getMinutesEnd();
|
||||||
|
|
||||||
|
// qDebug() << tempC->getDay();
|
||||||
|
// qDebug() << tempC->getRoom();
|
||||||
|
|
||||||
|
return tempC;
|
||||||
|
}
|
42
src/jceData/Calendar/coursesSchedule/calendarPage.h
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
#ifndef CALENDARPAGE_H
|
||||||
|
#define CALENDARPAGE_H
|
||||||
|
|
||||||
|
#include "../../page.h"
|
||||||
|
#include "calendarPageCourse.h"
|
||||||
|
#include <QList>
|
||||||
|
|
||||||
|
#define ROOM_DEFAULT_STRING "nullRoom"
|
||||||
|
#define LECTURER_DEFAULT_STRING "nullLecturer"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The CalendarPage class
|
||||||
|
*
|
||||||
|
* This class generating html string to a list of calendarCourses
|
||||||
|
* Each item in a list is a course with its information (hour, day, name, serial and etc)
|
||||||
|
*
|
||||||
|
* Made By liran ben gida, LiranBG@gmail.com On 31/8/2014
|
||||||
|
*/
|
||||||
|
class CalendarPage : public Page
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
QList<calendarCourse*> getCourses() { return courses; }
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual void setPage(QString html);
|
||||||
|
CalendarPage() { }
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void calendarListInit(QString &linesTokinzedString);
|
||||||
|
calendarCourse * lineToCourse(QString line);
|
||||||
|
|
||||||
|
QString tempHtml;
|
||||||
|
QList<calendarCourse*> courses;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CALENDARPAGE_H
|
|
@ -1,9 +1,10 @@
|
||||||
#include "calendarCourse.h"
|
#include "calendarPageCourse.h"
|
||||||
|
|
||||||
calendarCourse::calendarCourse(int serial, QString name, QString type, QString lecturer, double points,
|
calendarCourse::calendarCourse(int serial, QString name, QString type, QString lecturer, double points,
|
||||||
double semesterHours, QString dayAndHour,
|
double semesterHours, QString dayAndHour,
|
||||||
QString room) : Course(serial,name, type,points)
|
QString room) : Course(serial,name, type)
|
||||||
{
|
{
|
||||||
|
this->points = points;
|
||||||
this->lecturer = lecturer;
|
this->lecturer = lecturer;
|
||||||
this->semesterHours = semesterHours;
|
this->semesterHours = semesterHours;
|
||||||
this->room = room;
|
this->room = room;
|
||||||
|
@ -16,35 +17,35 @@ calendarCourse::calendarCourse(int serial, QString name, QString type, QString l
|
||||||
*/
|
*/
|
||||||
void calendarCourse::setDayAndHour(QString parse)
|
void calendarCourse::setDayAndHour(QString parse)
|
||||||
{
|
{
|
||||||
int ctr = 0;
|
int ctr = 0;
|
||||||
QString temp = "";
|
QString temp = "";
|
||||||
QTime timetemp;
|
QTime timetemp;
|
||||||
char *tok;
|
char *tok;
|
||||||
char* textToTok = strdup(parse.toStdString().c_str());
|
char* textToTok = strdup(parse.toStdString().c_str());
|
||||||
tok = strtok(textToTok, " -");
|
tok = strtok(textToTok, " -");
|
||||||
while(tok != NULL)
|
while(tok != NULL)
|
||||||
{
|
|
||||||
temp = tok;
|
|
||||||
switch (ctr)
|
|
||||||
{
|
{
|
||||||
case 0: //day
|
temp = tok;
|
||||||
setDay(temp);
|
switch (ctr)
|
||||||
break;
|
{
|
||||||
case 1: //hour it begins
|
case 0: //day
|
||||||
timetemp = QTime::fromString(temp,"hh:mm");
|
setDay(temp);
|
||||||
setHourBegin(timetemp.hour());
|
break;
|
||||||
setMinutesBegin(timetemp.minute());
|
case 1: //hour it begins
|
||||||
break;
|
timetemp = QTime::fromString(temp,"hh:mm");
|
||||||
case 2: //hour it ends
|
setHourBegin(timetemp.hour());
|
||||||
timetemp = QTime::fromString(temp,"hh:mm");
|
setMinutesBegin(timetemp.minute());
|
||||||
setHourEnd(timetemp.hour());
|
break;
|
||||||
setMinutesEnd(timetemp.minute());
|
case 2: //hour it ends
|
||||||
break;
|
timetemp = QTime::fromString(temp,"hh:mm");
|
||||||
}
|
setHourEnd(timetemp.hour());
|
||||||
|
setMinutesEnd(timetemp.minute());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
ctr++;
|
ctr++;
|
||||||
tok = strtok(NULL, " -");
|
tok = strtok(NULL, " -");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString calendarCourse::getLecturer() const
|
QString calendarCourse::getLecturer() const
|
||||||
|
@ -101,26 +102,6 @@ void calendarCourse::setMinutesEnd(int value)
|
||||||
{
|
{
|
||||||
minutesEnd = value;
|
minutesEnd = value;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* @brief calendarCourse::courseToString
|
|
||||||
* @return prints the course into string pattern
|
|
||||||
*/
|
|
||||||
QString calendarCourse::courseToString()
|
|
||||||
{
|
|
||||||
QString courseText = "";
|
|
||||||
courseText += " " + QString::number(this->getSerialNum());
|
|
||||||
courseText += " " + this->getName();
|
|
||||||
courseText += " " + this->getType();
|
|
||||||
courseText += " " + this->lecturer;
|
|
||||||
courseText += " " + QString::number(this->getPoints());
|
|
||||||
courseText += " " + QString::number(this->semesterHours);
|
|
||||||
courseText += " " + QString::number(this->day);
|
|
||||||
courseText += " " + QString::number(this->hourBegin) + ":" + QString::number(this->minutesBegin) + "-" + QString::number(this->hourEnd) + ":" + QString::number(this->minutesEnd);
|
|
||||||
courseText += " " + this->room;
|
|
||||||
courseText += "\n";
|
|
||||||
return courseText;
|
|
||||||
|
|
||||||
}
|
|
||||||
int calendarCourse::getDay() const
|
int calendarCourse::getDay() const
|
||||||
{
|
{
|
||||||
return day;
|
return day;
|
||||||
|
@ -157,10 +138,31 @@ void calendarCourse::setRoom(const QString &value)
|
||||||
{
|
{
|
||||||
room = value;
|
room = value;
|
||||||
}
|
}
|
||||||
|
double calendarCourse::getPoints() const
|
||||||
|
{
|
||||||
|
return points;
|
||||||
|
}
|
||||||
|
|
||||||
|
void calendarCourse::setPoints(double value)
|
||||||
|
{
|
||||||
|
points = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
double points;
|
||||||
|
QString lecturer;
|
||||||
|
double semesterHours;
|
||||||
|
int day;
|
||||||
|
int hourBegin;
|
||||||
|
int minutesBegin;
|
||||||
|
int hourEnd;
|
||||||
|
int minutesEnd;
|
||||||
|
QString room;
|
||||||
|
|
||||||
|
QString calendarCourse::toString()
|
||||||
|
{
|
||||||
|
QTime begin,end;
|
||||||
|
begin.setHMS(hourBegin,minutesBegin,0);
|
||||||
|
end.setHMS(hourEnd,minutesEnd,0);
|
||||||
|
return QString("%1 %2 %3\n%4 %5\n%6 - %7").arg(QString::number(this->getSerialNum()),this->getName(),QString::number(this->points),this->getLecturer(),this->getRoom(),
|
||||||
|
begin.toString("hh:mm"),end.toString(("hh:mm")));
|
||||||
|
}
|
|
@ -1,14 +1,26 @@
|
||||||
#ifndef CALENDARCOURSE_H
|
#ifndef CALENDARCOURSE_H
|
||||||
#define CALENDARCOURSE_H
|
#define CALENDARCOURSE_H
|
||||||
|
|
||||||
#include "../course.h"
|
#include "../../course.h"
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
|
|
||||||
#define CALENDAR_COURSE_FIELDS 8
|
#define CALENDAR_COURSE_FIELDS 8
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The calendarCourse class
|
||||||
|
*
|
||||||
|
* This class holds each scheduled course
|
||||||
|
* the course scheme can be found below, inside the enum CourseScheme
|
||||||
|
*
|
||||||
|
* The class's constructor gets the data and manipulate it into an object
|
||||||
|
* with its relevant information.
|
||||||
|
*
|
||||||
|
* Made By liran ben gida, LiranBG@gmail.com On 31/8/2014
|
||||||
|
*/
|
||||||
class calendarCourse : public Course
|
class calendarCourse : public Course
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum CourseScheme
|
enum CourseScheme
|
||||||
{
|
{
|
||||||
SERIAL,
|
SERIAL,
|
||||||
|
@ -20,8 +32,11 @@ public:
|
||||||
DAY_AND_HOURS,
|
DAY_AND_HOURS,
|
||||||
ROOM
|
ROOM
|
||||||
};
|
};
|
||||||
|
|
||||||
calendarCourse(int serial, QString name, QString type, QString lecturer,
|
calendarCourse(int serial, QString name, QString type, QString lecturer,
|
||||||
double points, double semesterHours, QString dayAndHour, QString room);
|
double points, double semesterHours, QString dayAndHour,
|
||||||
|
QString room);
|
||||||
|
|
||||||
~calendarCourse(){}
|
~calendarCourse(){}
|
||||||
|
|
||||||
int getDay() const;
|
int getDay() const;
|
||||||
|
@ -32,6 +47,7 @@ public:
|
||||||
int getMinutesBegin() const;
|
int getMinutesBegin() const;
|
||||||
int getHourEnd() const;
|
int getHourEnd() const;
|
||||||
int getMinutesEnd() const;
|
int getMinutesEnd() const;
|
||||||
|
double getPoints() const;
|
||||||
|
|
||||||
void setDay(const QString &value);
|
void setDay(const QString &value);
|
||||||
void setLecturer(const QString &value);
|
void setLecturer(const QString &value);
|
||||||
|
@ -41,14 +57,15 @@ public:
|
||||||
void setMinutesBegin(int value);
|
void setMinutesBegin(int value);
|
||||||
void setHourEnd(int value);
|
void setHourEnd(int value);
|
||||||
void setMinutesEnd(int value);
|
void setMinutesEnd(int value);
|
||||||
|
void setPoints(double value);
|
||||||
|
|
||||||
QString courseToString();
|
QString toString();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void setDayAndHour(QString parse);
|
void setDayAndHour(QString parse);
|
||||||
|
|
||||||
|
double points;
|
||||||
QString lecturer;
|
QString lecturer;
|
||||||
double semesterHours;
|
double semesterHours;
|
||||||
int day;
|
int day;
|
|
@ -1,6 +1,5 @@
|
||||||
#include "calendarSchedule.h"
|
#include "calendarSchedule.h"
|
||||||
|
calendarSchedule::calendarSchedule(QWidget *parent) : QTableWidget(parent)
|
||||||
calendarSchedule::calendarSchedule()
|
|
||||||
{
|
{
|
||||||
QStringList days,hours;
|
QStringList days,hours;
|
||||||
QTextStream hourString;
|
QTextStream hourString;
|
||||||
|
@ -22,7 +21,7 @@ calendarSchedule::calendarSchedule()
|
||||||
days << QObject::tr("Sunday") << QObject::tr("Monday") << QObject::tr("Tuesday") << QObject::tr("Wednesday") << QObject::tr("Thursday") << QObject::tr("Friday");
|
days << QObject::tr("Sunday") << QObject::tr("Monday") << QObject::tr("Tuesday") << QObject::tr("Wednesday") << QObject::tr("Thursday") << QObject::tr("Friday");
|
||||||
|
|
||||||
setRowCount(endingHour - startingHour + 1);
|
setRowCount(endingHour - startingHour + 1);
|
||||||
setColumnCount(6);
|
setColumnCount(6); //number of days not including saturday ofcourse :)
|
||||||
|
|
||||||
setLayoutDirection(Qt::LayoutDirection::RightToLeft);\
|
setLayoutDirection(Qt::LayoutDirection::RightToLeft);\
|
||||||
|
|
||||||
|
@ -37,7 +36,7 @@ calendarSchedule::calendarSchedule()
|
||||||
void calendarSchedule::setPage(QString html)
|
void calendarSchedule::setPage(QString html)
|
||||||
{
|
{
|
||||||
CalendarPage::setPage(html);
|
CalendarPage::setPage(html);
|
||||||
|
qDebug() << Q_FUNC_INFO << "inserting into table";
|
||||||
insertCourseIntoTable();
|
insertCourseIntoTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,15 +56,15 @@ void calendarSchedule::insertCourseIntoTable()
|
||||||
|
|
||||||
QTableWidgetItem *item;
|
QTableWidgetItem *item;
|
||||||
QString courseString;
|
QString courseString;
|
||||||
int currentHour,currentDay,blocksNumer;
|
int currentHour,currentDay,blocksNumber;
|
||||||
int row,col;
|
int row,col;
|
||||||
for (calendarCourse *coursePtr: *getCourses())
|
for (calendarCourse *coursePtr: getCourses())
|
||||||
{
|
{
|
||||||
courseString = "";
|
courseString = "";
|
||||||
currentHour = coursePtr->getHourBegin();
|
currentHour = coursePtr->getHourBegin();
|
||||||
currentDay = coursePtr->getDay();
|
currentDay = coursePtr->getDay();
|
||||||
blocksNumer = coursePtr->getHourEnd() - coursePtr->getHourBegin(); //every hour is a block to fill!
|
blocksNumber = coursePtr->getHourEnd() - coursePtr->getHourBegin(); //every hour is a block to fill!
|
||||||
while (blocksNumer >= 0)
|
while (blocksNumber >= 0)
|
||||||
{
|
{
|
||||||
row = currentHour - HOURS_BEGIN;
|
row = currentHour - HOURS_BEGIN;
|
||||||
col = currentDay-1;
|
col = currentDay-1;
|
||||||
|
@ -83,12 +82,13 @@ void calendarSchedule::insertCourseIntoTable()
|
||||||
|
|
||||||
|
|
||||||
item = new QTableWidgetItem(courseString);
|
item = new QTableWidgetItem(courseString);
|
||||||
|
item->setToolTip(coursePtr->toString());
|
||||||
if (this->takeItem(row,col) != NULL)
|
if (this->takeItem(row,col) != NULL)
|
||||||
delete this->takeItem(row,col);
|
delete this->takeItem(row,col);
|
||||||
this->setItem(row,col,item);
|
this->setItem(row,col,item);
|
||||||
|
|
||||||
currentHour++;
|
currentHour++;
|
||||||
--blocksNumer;
|
--blocksNumber;
|
||||||
}
|
}
|
||||||
horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||||
verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
|
@ -12,11 +12,19 @@
|
||||||
#define HOURS_END 20
|
#define HOURS_END 20
|
||||||
#define ACADEMIN_HOUR 45
|
#define ACADEMIN_HOUR 45
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The calendarSchedule class
|
||||||
|
*
|
||||||
|
* This class combining the courses schedule with each course into a table
|
||||||
|
* setpage -> insertingIntoTable -> showing data
|
||||||
|
*
|
||||||
|
* Made By liran ben gida, LiranBG@gmail.com On 31/8/2014
|
||||||
|
*/
|
||||||
class calendarSchedule : public QTableWidget, public CalendarPage
|
class calendarSchedule : public QTableWidget, public CalendarPage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
calendarSchedule();
|
calendarSchedule(QWidget *parent = 0);
|
||||||
~calendarSchedule() { clearTableItems(); }
|
~calendarSchedule() { clearTableItems(); }
|
||||||
void setPage(QString html);
|
void setPage(QString html);
|
||||||
void clearTableItems();
|
void clearTableItems();
|
|
@ -1,16 +1,32 @@
|
||||||
#include "gradeCourse.h"
|
#include "gradeCourse.h"
|
||||||
|
|
||||||
gradeCourse::gradeCourse(int serial, QString name, QString type, double points, double hours, double grade, QString additions) : Course(serial,name,type,points)
|
gradeCourse::gradeCourse(int year, int semester, int courseNumInList, int serial, QString name, QString type, double points,double hours, double grade, QString additions) : Course(serial,name,type)
|
||||||
{
|
{
|
||||||
|
this->points = points;
|
||||||
this->hours = hours;
|
this->hours = hours;
|
||||||
this->grade = grade;
|
this->grade = grade;
|
||||||
this->additions = additions;
|
this->additions = additions;
|
||||||
|
this->year = year;
|
||||||
|
this->semester = semester;
|
||||||
|
this->courseNumInList = courseNumInList;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradeCourse::gradeCourse(gradeCourse &other) : Course(other.getSerialNum(),other.getName(),other.getType())
|
||||||
|
{
|
||||||
|
this->points = other.points;
|
||||||
|
this->hours = other.hours;
|
||||||
|
this->grade = other.grade;
|
||||||
|
this->additions = other.additions;
|
||||||
|
this->year = other.year;
|
||||||
|
this->semester = other.semester;
|
||||||
|
this->courseNumInList = other.courseNumInList;
|
||||||
}
|
}
|
||||||
|
|
||||||
gradeCourse::~gradeCourse()
|
gradeCourse::~gradeCourse()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double gradeCourse::getGrade() const
|
double gradeCourse::getGrade() const
|
||||||
{
|
{
|
||||||
double noGrade = NO_GRADE_YET;
|
double noGrade = NO_GRADE_YET;
|
||||||
|
@ -34,3 +50,33 @@ void gradeCourse::setAdditions(QString additions)
|
||||||
{
|
{
|
||||||
this->additions = additions;
|
this->additions = additions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gradeCourse::setYear(int year)
|
||||||
|
{
|
||||||
|
this->year = year;
|
||||||
|
|
||||||
|
}
|
||||||
|
void gradeCourse::setSemester(int semester)
|
||||||
|
{
|
||||||
|
this->semester = semester;
|
||||||
|
}
|
||||||
|
int gradeCourse::getCourseNumInList() const
|
||||||
|
{
|
||||||
|
return courseNumInList;
|
||||||
|
}
|
||||||
|
|
||||||
|
void gradeCourse::setCourseNumInList(int value)
|
||||||
|
{
|
||||||
|
courseNumInList = value;
|
||||||
|
}
|
||||||
|
double gradeCourse::getPoints() const
|
||||||
|
{
|
||||||
|
return points;
|
||||||
|
}
|
||||||
|
|
||||||
|
void gradeCourse::setPoints(double value)
|
||||||
|
{
|
||||||
|
points = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,26 +1,33 @@
|
||||||
#ifndef GRADE_COURSE_H
|
#ifndef GRADE_COURSE_H
|
||||||
#define GRADE_COURSE_H
|
#define GRADE_COURSE_H
|
||||||
|
|
||||||
/* This Code Made By Sagi Dayan
|
|
||||||
* SagiDayan@gmail.com
|
|
||||||
*
|
|
||||||
* Minor changes has been made by Liran Ben Gida
|
|
||||||
* LiranBG@gmail.com
|
|
||||||
*/
|
|
||||||
#include "../course.h"
|
#include "../course.h"
|
||||||
#include <string>
|
|
||||||
#include <iostream>
|
|
||||||
#include <list>
|
|
||||||
|
|
||||||
#define COURSE_FIELDS 7
|
#define COURSE_FIELDS 10
|
||||||
#define NO_GRADE_YET 101;
|
#define NO_GRADE_YET 101;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The gradeCourse class
|
||||||
|
*
|
||||||
|
* This class holds a list of course in GPA
|
||||||
|
* the course scheme can be found below, inside the enum CourseScheme
|
||||||
|
*
|
||||||
|
* The class's constructor gets the data and manipulate it into an object
|
||||||
|
* with its relevant information.
|
||||||
|
*
|
||||||
|
* Made By:
|
||||||
|
* Sagi Dayan, SagiDayan@gmail.com
|
||||||
|
* Liran Ben Gida, LiranBG@gmail.com
|
||||||
|
* On 31/8/2014
|
||||||
|
*/
|
||||||
class gradeCourse : public Course {
|
class gradeCourse : public Course {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum CourseScheme
|
enum CourseScheme
|
||||||
{
|
{
|
||||||
|
YEAR,
|
||||||
|
SEMESTER,
|
||||||
|
COURSE_NUMBER_IN_LIST,
|
||||||
SERIAL,
|
SERIAL,
|
||||||
NAME,
|
NAME,
|
||||||
TYPE,
|
TYPE,
|
||||||
|
@ -30,22 +37,35 @@ public:
|
||||||
ADDITION
|
ADDITION
|
||||||
};
|
};
|
||||||
|
|
||||||
gradeCourse(int serial, QString name, QString type, double points,double hours, double grade, QString additions);
|
gradeCourse(int year, int semester, int courseNumInList, int serial, QString name, QString type, double points,double hours, double grade, QString additions);
|
||||||
|
gradeCourse(gradeCourse &other);
|
||||||
~gradeCourse();
|
~gradeCourse();
|
||||||
|
|
||||||
|
int getYear() const { return this->year; }
|
||||||
|
int getSemester() const { return this->semester; }
|
||||||
double getHours() const {return this->hours;}
|
double getHours() const {return this->hours;}
|
||||||
double getGrade() const ;
|
double getGrade() const;
|
||||||
QString getAddidtions() const {return this->additions;}
|
QString getAddidtions() const {return this->additions;}
|
||||||
|
int getCourseNumInList() const;
|
||||||
|
double getPoints() const;
|
||||||
|
|
||||||
void setHours(double hours);
|
void setHours(double hours);
|
||||||
void setGrade(double grade);
|
void setGrade(double grade);
|
||||||
void setAdditions(QString additions);
|
void setAdditions(QString additions);
|
||||||
|
void setYear(int year);
|
||||||
|
void setSemester(int semester);
|
||||||
|
void setCourseNumInList(int value);
|
||||||
|
void setPoints(double value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
double hours;
|
double points;
|
||||||
double grade;
|
double hours;
|
||||||
|
double grade;
|
||||||
QString additions;
|
QString additions;
|
||||||
|
int year;
|
||||||
|
int semester;
|
||||||
|
int courseNumInList;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,119 +1,130 @@
|
||||||
#include "gradePage.h"
|
#include "gradePage.h"
|
||||||
|
|
||||||
|
static int maxYear = 0;
|
||||||
|
static int minYear = 9999;
|
||||||
|
|
||||||
GradePage::GradePage(QString html) : Page()
|
GradePage::GradePage(QString html) : Page()
|
||||||
{
|
{
|
||||||
courses = new std::list<gradeCourse*>();
|
|
||||||
tempHtml = getString(html);
|
tempHtml = getString(html);
|
||||||
tempHtml = tokenToLines(tempHtml);
|
|
||||||
coursesListInit(tempHtml);
|
coursesListInit(tempHtml);
|
||||||
|
}
|
||||||
|
|
||||||
|
GradePage::GradePage(GradePage &other)
|
||||||
|
{
|
||||||
|
for(gradeCourse* c : other.getCourses())
|
||||||
|
{
|
||||||
|
courses.push_back(new gradeCourse(*c));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
GradePage::~GradePage()
|
GradePage::~GradePage()
|
||||||
{
|
{
|
||||||
for(Course* c : *courses)
|
for (Course* c : courses)
|
||||||
delete c;
|
delete c;
|
||||||
delete courses;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief GradePage::removeCourse
|
||||||
|
* @param courseSerialID - course ID to remove
|
||||||
|
*/
|
||||||
void GradePage::removeCourse(QString courseSerialID)
|
void GradePage::removeCourse(QString courseSerialID)
|
||||||
{
|
{
|
||||||
for(gradeCourse* c : *courses)
|
for(gradeCourse* c : courses)
|
||||||
{
|
{
|
||||||
if (c->getSerialNum() == courseSerialID.toInt())
|
if (c->getSerialNum() == courseSerialID.toInt())
|
||||||
{
|
{
|
||||||
courses->remove(c);
|
courses.removeAll(c);
|
||||||
delete c;
|
delete c;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief GradePage::coursesListInit
|
||||||
|
* using lineToCourse function, its making a list of gradeCourse object from a given string of information
|
||||||
|
* @param linesTokinzedString list of courses, tokenized by lines. containing data of each course
|
||||||
|
*/
|
||||||
void GradePage::coursesListInit(QString &linesTokinzedString)
|
void GradePage::coursesListInit(QString &linesTokinzedString)
|
||||||
{
|
{
|
||||||
std::list<QString> stringHolder;
|
QString tempToken;
|
||||||
QString temp;
|
|
||||||
gradeCourse* cTemp = NULL;
|
|
||||||
char* tok;
|
|
||||||
char* textToTok = strdup(linesTokinzedString.toStdString().c_str());
|
|
||||||
tok = strtok(textToTok,"\n");
|
|
||||||
while (tok != NULL)
|
|
||||||
{
|
|
||||||
temp = tok;
|
|
||||||
stringHolder.push_back(temp);
|
|
||||||
tok = strtok(NULL, "\n");
|
|
||||||
}
|
|
||||||
for(QString temp: stringHolder)
|
|
||||||
{
|
|
||||||
cTemp = lineToCourse(temp);
|
|
||||||
if (cTemp != NULL)
|
|
||||||
courses->push_back(cTemp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString GradePage::tokenToLines(QString &textToPhrase)
|
QStringList holder = linesTokinzedString.split("\n");
|
||||||
{
|
QStringList::iterator iterator;
|
||||||
int ctr = 0;
|
for (iterator = holder.begin(); iterator != holder.end(); ++iterator)
|
||||||
QString temp = "";
|
|
||||||
char *tok;
|
|
||||||
char* textToTok = strdup(textToPhrase.toStdString().c_str());
|
|
||||||
tok = strtok(textToTok, "\n");
|
|
||||||
while(tok != NULL)
|
|
||||||
{
|
{
|
||||||
//amount of data before the actual needed data and no empty lines
|
tempToken = (*iterator);
|
||||||
if (strcmp(tok," \t ") != 0)
|
if ((!tempToken.isEmpty()) && (tempToken.length() > 1))
|
||||||
{
|
{
|
||||||
temp += tok;
|
gradeCourse *cTemp = lineToCourse(tempToken);
|
||||||
temp += "\n";
|
if (cTemp != NULL)
|
||||||
|
this->courses.push_back(cTemp);
|
||||||
}
|
}
|
||||||
ctr++;
|
|
||||||
tok = strtok(NULL, "\n");
|
|
||||||
}
|
}
|
||||||
return temp;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief GradePage::lineToCourse
|
||||||
|
* making an object of gradepage with the given information from string
|
||||||
|
* @param line - lines tokenized by tabs containing each course information (year, serial, name, points and etc..)
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
gradeCourse* GradePage::lineToCourse(QString line)
|
gradeCourse* GradePage::lineToCourse(QString line)
|
||||||
{
|
{
|
||||||
gradeCourse *tempC = NULL;
|
gradeCourse *tempC = NULL;
|
||||||
QString templinearray[COURSE_FIELDS];//[serial,name,type,points,hours,grade,additions]
|
QString templinearray[COURSE_FIELDS];//[year,semester,numInList,serial,name,type,points,hours,grade,additions]
|
||||||
int serial;
|
int serial,year,semester,courseNumInList;
|
||||||
double points,hours,grade;
|
double points,hours,grade;
|
||||||
QString name,type, additions;
|
QString name,type, additions;
|
||||||
QString tempS = "";
|
|
||||||
|
QString tempToken;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
char* tok;
|
QStringList holder = line.split("\t");
|
||||||
char* cLine = strdup(line.toStdString().c_str());
|
QStringList::iterator iterator;
|
||||||
tok = strtok(cLine, "\t");
|
for (iterator = holder.begin(); iterator != holder.end(); ++iterator)
|
||||||
while(tok != NULL)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
tempS = tok;
|
tempToken = (*iterator);
|
||||||
if (i == 1) //skip the tokenizing loop just once
|
tempToken = tempToken.trimmed();
|
||||||
|
//we are checking it because in GPA, serial and course name are mixed
|
||||||
|
if (i == gradeCourse::CourseScheme::SERIAL)
|
||||||
{
|
{
|
||||||
tempS = "";
|
QString tempDataOfSerialCourseName;
|
||||||
char *tokTemp;
|
|
||||||
tokTemp = tok;
|
|
||||||
while (!(isdigit((int)*tokTemp)))
|
|
||||||
tokTemp++;
|
|
||||||
|
|
||||||
while (isdigit((int)*tokTemp))
|
//getting serial
|
||||||
|
QStringList secHolder = tempToken.split(" ");
|
||||||
|
QStringList::iterator secIterator = secHolder.begin();
|
||||||
|
tempDataOfSerialCourseName = *secIterator;
|
||||||
|
templinearray[i] = tempDataOfSerialCourseName.trimmed();
|
||||||
|
//getting course name;
|
||||||
|
++secIterator;
|
||||||
|
tempDataOfSerialCourseName.clear();
|
||||||
|
while (secIterator != secHolder.end())
|
||||||
{
|
{
|
||||||
tempS += QString(*tokTemp);
|
tempDataOfSerialCourseName.append(*secIterator + " ");
|
||||||
tokTemp++;
|
secIterator++;
|
||||||
}
|
}
|
||||||
templinearray[i-1] = tempS.trimmed();
|
templinearray[++i] = tempDataOfSerialCourseName.trimmed();
|
||||||
templinearray[i] = QString(tokTemp).trimmed();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (i > 1)
|
else
|
||||||
{
|
{
|
||||||
templinearray[i] = tempS;
|
templinearray[i] = tempToken;
|
||||||
}
|
}
|
||||||
i++;
|
|
||||||
tok=strtok(NULL, "\t");
|
|
||||||
}
|
|
||||||
if (templinearray[0] == "") //empty phrasing
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
|
i++;
|
||||||
|
if (i >= COURSE_FIELDS)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (templinearray[0] == "") //empty parsing
|
||||||
|
{
|
||||||
|
qCritical() << Q_FUNC_INFO << "empty parsing";
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
year = templinearray[gradeCourse::CourseScheme::YEAR].toInt();
|
||||||
|
semester = templinearray[gradeCourse::CourseScheme::SEMESTER].toInt();
|
||||||
|
courseNumInList = templinearray[gradeCourse::CourseScheme::COURSE_NUMBER_IN_LIST].toInt();
|
||||||
serial = templinearray[gradeCourse::CourseScheme::SERIAL].toInt();
|
serial = templinearray[gradeCourse::CourseScheme::SERIAL].toInt();
|
||||||
|
|
||||||
name = templinearray[gradeCourse::CourseScheme::NAME];
|
name = templinearray[gradeCourse::CourseScheme::NAME];
|
||||||
|
@ -129,31 +140,49 @@ gradeCourse* GradePage::lineToCourse(QString line)
|
||||||
|
|
||||||
additions = templinearray[gradeCourse::CourseScheme::ADDITION];
|
additions = templinearray[gradeCourse::CourseScheme::ADDITION];
|
||||||
|
|
||||||
tempC = new gradeCourse(serial,name,type,points,hours,grade,additions);
|
if (year >= maxYear)
|
||||||
|
maxYear = year;
|
||||||
|
|
||||||
|
if ((year <= minYear) && (points > 0)) //not graded yet isnt influced year!
|
||||||
|
{
|
||||||
|
minYear = year;
|
||||||
|
}
|
||||||
|
|
||||||
|
tempC = new gradeCourse(year,semester,courseNumInList,serial,name,type,points,hours,grade,additions);
|
||||||
return tempC;
|
return tempC;
|
||||||
}
|
}
|
||||||
|
|
||||||
//checking if one of the chars inside grade is not a number
|
/**
|
||||||
|
* @brief GradePage::isGradedYet checking if one of the chars inside grade is not a number
|
||||||
|
* @param grade
|
||||||
|
* @return if has bee graded or not
|
||||||
|
*/
|
||||||
bool GradePage::isGradedYet(QString grade)
|
bool GradePage::isGradedYet(QString grade)
|
||||||
{
|
{
|
||||||
if (strlen(grade.toStdString().c_str()) <= 1)
|
if (strlen(grade.toStdString().c_str()) <= 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (char c: grade.toStdString())
|
for (QChar c: grade)
|
||||||
{
|
{
|
||||||
if (c == '\0')
|
if (c == '\0')
|
||||||
break;
|
break;
|
||||||
if (((!isdigit((int)c)) && (!isspace((int)c)))) //48 = 0, 57 = 9
|
|
||||||
|
if (((!c.isDigit()) && (!c.isSpace()))) //48 = 0, 57 = 9
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief GradePage::getAvg getting avg
|
||||||
|
* @return - gpa avg of all courses
|
||||||
|
*/
|
||||||
double GradePage::getAvg()
|
double GradePage::getAvg()
|
||||||
{
|
{
|
||||||
double avg = 0;
|
double avg = 0;
|
||||||
double points = 0;
|
double points = 0;
|
||||||
for(gradeCourse* c : *courses)
|
for (gradeCourse* c : courses)
|
||||||
{
|
{
|
||||||
if ((c->getGrade() != 0))
|
if ((c->getGrade() != 0))
|
||||||
{
|
{
|
||||||
|
@ -165,3 +194,67 @@ double GradePage::getAvg()
|
||||||
avg /= points;
|
avg /= points;
|
||||||
return avg;
|
return avg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief GradePage::getAvg getting avg of given year
|
||||||
|
* @param year - year (yyyy)
|
||||||
|
* @return - gpa avg of given year
|
||||||
|
*/
|
||||||
|
double GradePage::getAvg(int year)
|
||||||
|
{
|
||||||
|
double avg = 0;
|
||||||
|
double points = 0;
|
||||||
|
for (gradeCourse* c : courses)
|
||||||
|
{
|
||||||
|
if ((c->getGrade() != 0) && (c->getYear() == year))
|
||||||
|
{
|
||||||
|
avg += c->getGrade() * c->getPoints();
|
||||||
|
points += c->getPoints();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (points != 0)
|
||||||
|
avg /= points;
|
||||||
|
else
|
||||||
|
avg=0;
|
||||||
|
return avg;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief GradePage::getAvg
|
||||||
|
* @param year - year (yyyy)
|
||||||
|
* @param semester - semeser (1-3)
|
||||||
|
* @return -gpa avg of given year in given semester
|
||||||
|
*/
|
||||||
|
|
||||||
|
double GradePage::getAvg(int year, int semester)
|
||||||
|
{
|
||||||
|
double avg = 0;
|
||||||
|
double points = 0;
|
||||||
|
for (gradeCourse* c : courses)
|
||||||
|
{
|
||||||
|
if ((c->getGrade() != 0) && (c->getYear() == year) && (c->getSemester() == semester))
|
||||||
|
{
|
||||||
|
avg += c->getGrade() * c->getPoints();
|
||||||
|
points += c->getPoints();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (points != 0)
|
||||||
|
avg /= points;
|
||||||
|
else
|
||||||
|
avg=0;
|
||||||
|
return avg;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief GradePage::getMinYearInList
|
||||||
|
* @return the minimal year inside courses list
|
||||||
|
*/
|
||||||
|
int GradePage::getMinYearInList()
|
||||||
|
{
|
||||||
|
return minYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
int GradePage::getMaxYearInList()
|
||||||
|
{
|
||||||
|
return maxYear;
|
||||||
|
}
|
||||||
|
|
|
@ -11,29 +11,48 @@
|
||||||
#include "../page.h"
|
#include "../page.h"
|
||||||
#include "../Grades/gradeCourse.h"
|
#include "../Grades/gradeCourse.h"
|
||||||
|
|
||||||
#include <list>
|
#include <QList>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The GradePage class
|
||||||
|
*
|
||||||
|
* This class generating html string to a list of gradeCourse
|
||||||
|
* Each item in a list is a course with its information (grade, points, name, serial and etc)
|
||||||
|
*
|
||||||
|
* Made By:
|
||||||
|
* Sagi Dayan, SagiDayan@gmail.com
|
||||||
|
* Liran Ben Gida, LiranBG@gmail.com
|
||||||
|
* On 31/8/2014
|
||||||
|
*/
|
||||||
class GradePage : public Page
|
class GradePage : public Page
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GradePage(QString html);
|
GradePage(QString html);
|
||||||
~GradePage();
|
GradePage(GradePage &other);
|
||||||
|
~GradePage();
|
||||||
|
|
||||||
void removeCourse(QString courseSerialID);
|
void removeCourse(QString courseSerialID);
|
||||||
double getAvg();
|
|
||||||
|
|
||||||
std::list<gradeCourse*>* getCourses() { return courses; }
|
double getAvg();
|
||||||
|
double getAvg(int year);
|
||||||
|
double getAvg(int year, int semester);
|
||||||
|
|
||||||
|
int getMinYearInList();
|
||||||
|
int getMaxYearInList();
|
||||||
|
|
||||||
|
|
||||||
|
QList<gradeCourse*> getCourses() { return courses; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
QString tokenToLines(QString &textToPhrase);
|
|
||||||
void coursesListInit(QString &linesTokinzedString);
|
void coursesListInit(QString &linesTokinzedString);
|
||||||
gradeCourse* lineToCourse(QString line);
|
gradeCourse* lineToCourse(QString line);
|
||||||
|
|
||||||
bool isGradedYet(QString grade);
|
bool isGradedYet(QString grade);
|
||||||
|
|
||||||
std::list<gradeCourse*>* courses;
|
QList<gradeCourse*> courses;
|
||||||
|
|
||||||
QString tempHtml;
|
QString tempHtml;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
202
src/jceData/Grades/graph/gradegraph.cpp
Normal file
|
@ -0,0 +1,202 @@
|
||||||
|
#include "gradegraph.h"
|
||||||
|
#include "ui_gradegraph.h"
|
||||||
|
gradegraph::gradegraph(QWidget *parent) : QDialog(parent), ui(new Ui::gradegraph)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
this->setModal(true); //makes it on top of application
|
||||||
|
this->gp = NULL;
|
||||||
|
tableWidget = new QCustomPlot(this);
|
||||||
|
ui->verticalLayoutTable->addWidget(tableWidget);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void gradegraph::showGraph(GradePage *gpPTR)
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
this->gp = gpPTR;
|
||||||
|
|
||||||
|
if (tableWidget->graphCount() > 0)
|
||||||
|
clearGraph();
|
||||||
|
|
||||||
|
setVisualization();
|
||||||
|
setGraphsData();
|
||||||
|
|
||||||
|
|
||||||
|
tableWidget->replot();
|
||||||
|
|
||||||
|
this->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
gradegraph::~gradegraph()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void gradegraph::setGraphsData()
|
||||||
|
{
|
||||||
|
int minYearInList = gp->getMinYearInList()-1;
|
||||||
|
int maxYearInList = gp->getMaxYearInList()+1;
|
||||||
|
int xRangeForYear = (maxYearInList - minYearInList+2)*3;
|
||||||
|
QVector<double> SemesterialAvg(xRangeForYear),yearlyAvg(xRangeForYear),indicatorX(xRangeForYear);
|
||||||
|
|
||||||
|
for (int yearCount=0,i=1; i<xRangeForYear; ++i) //filling data
|
||||||
|
{
|
||||||
|
|
||||||
|
indicatorX[i] = i;
|
||||||
|
if (i%4==1) //years
|
||||||
|
{
|
||||||
|
QCPItemText *textLabel = new QCPItemText(tableWidget);
|
||||||
|
tableWidget->addItem(textLabel);
|
||||||
|
|
||||||
|
double lastAvg = gp->getAvg(minYearInList+yearCount);
|
||||||
|
|
||||||
|
if (lastAvg > 0)
|
||||||
|
{
|
||||||
|
// add the text label at the top:
|
||||||
|
if (lastAvg <= MIN_GRADE) //will be below the graph
|
||||||
|
{
|
||||||
|
textLabel->position->setCoords(i, MIN_GRADE+5); // place position at center/top of axis rect
|
||||||
|
textLabel->setText(QString::number(lastAvg,'g',4) + "<= Min Grade (" + QString::number(MIN_GRADE) + ")");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
textLabel->position->setCoords(i, lastAvg+1.5); // place position at center/top of axis rect
|
||||||
|
textLabel->setText(QString::number(lastAvg,'g',4));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
textLabel->setFont(QFont(font().family(), 8)); // make font a bit larger
|
||||||
|
textLabel->setPen(QPen(Qt::black)); // show black border around text
|
||||||
|
|
||||||
|
yearlyAvg[i] = lastAvg;
|
||||||
|
yearCount++;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (i+4 < xRangeForYear) //semesters
|
||||||
|
{
|
||||||
|
QCPItemText *textLabel = new QCPItemText(tableWidget);
|
||||||
|
tableWidget->addItem(textLabel);
|
||||||
|
|
||||||
|
//qDebug() << "year: " << minYearInList+yearCount << "sem " << (i-1)%4;
|
||||||
|
double avg = gp->getAvg(minYearInList+yearCount,(i-1)%4);
|
||||||
|
//qDebug() << "avg: " << avg;
|
||||||
|
|
||||||
|
if (avg > 0)
|
||||||
|
{
|
||||||
|
// add the text label at the top:
|
||||||
|
if (avg <= MIN_GRADE) //will be below the graph
|
||||||
|
{
|
||||||
|
textLabel->position->setCoords(i+4, MIN_GRADE+1.5); // place position at center/top of axis rect
|
||||||
|
textLabel->setText(QString::number(avg,'g',4) + "<= Min Grade (" + QString::number(MIN_GRADE) + ")");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
textLabel->position->setCoords(i+4, avg+1.5); // place position at center/top of axis rect
|
||||||
|
textLabel->setText(QString::number(avg,'g',4));
|
||||||
|
}
|
||||||
|
|
||||||
|
textLabel->setFont(QFont(font().family(), 8)); // make font a bit larger
|
||||||
|
textLabel->setPen(QPen(Qt::black)); // show black border around text
|
||||||
|
|
||||||
|
SemesterialAvg[i+4] = avg;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
yearlyAvg[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//yearly
|
||||||
|
tableWidget->graph(0)->setData(indicatorX,yearlyAvg);
|
||||||
|
//yearly
|
||||||
|
tableWidget->graph(1)->setData(indicatorX,SemesterialAvg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief gradegraph::setvisualization set graph borders text, range and looking
|
||||||
|
*/
|
||||||
|
void gradegraph::setVisualization()
|
||||||
|
{
|
||||||
|
tableWidget->setBackground(QBrush(Qt::white));
|
||||||
|
tableWidget->axisRect()->setupFullAxesBox(true); //make the graph looks like a box
|
||||||
|
|
||||||
|
tableWidget->addGraph(); //yearly and semesterial graphs
|
||||||
|
tableWidget->addGraph();
|
||||||
|
|
||||||
|
tableWidget->graph(0)->setName(tr("Yearly Average"));
|
||||||
|
tableWidget->graph(0)->setPen(QPen(Qt::GlobalColor::blue));
|
||||||
|
tableWidget->graph(0)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssCircle, Qt::blue, Qt::blue, 7));
|
||||||
|
tableWidget->graph(0)->setLineStyle(QCPGraph::lsImpulse );
|
||||||
|
|
||||||
|
tableWidget->graph(1)->setName(tr("Semesterial Average"));
|
||||||
|
tableWidget->graph(1)->setLineStyle(QCPGraph::lsStepLeft);
|
||||||
|
tableWidget->graph(1)->setPen(QPen( QColor(Qt::GlobalColor::red)));
|
||||||
|
tableWidget->graph(1)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssCircle, Qt::red, Qt::red, 7));
|
||||||
|
|
||||||
|
int minYearInList = gp->getMinYearInList()-1;
|
||||||
|
int maxYearInList = gp->getMaxYearInList()+1;
|
||||||
|
int xRangeForYear = (maxYearInList - minYearInList+2)*3;
|
||||||
|
|
||||||
|
QVector<QString> xStrings(0);
|
||||||
|
for (int year=minYearInList,i = 0; i < xRangeForYear-1; ++i)
|
||||||
|
{
|
||||||
|
//set year x axe label to be yyyy A B C yyyy+1 A B C yyyy+2....
|
||||||
|
int semesterChar = i%4;
|
||||||
|
QString tempString;
|
||||||
|
switch (semesterChar)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
tempString = tr("A");
|
||||||
|
xStrings << tempString;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
tempString = tr("B");
|
||||||
|
xStrings << tempString;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
tempString = tr("C");
|
||||||
|
xStrings << tempString;
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
tempString = QString::number(year);
|
||||||
|
xStrings << tempString;
|
||||||
|
year++;
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tableWidget->yAxis->setLabel(tr("AVG Grade"));
|
||||||
|
tableWidget->yAxis->setTickLabelFont(QFont(QFont().family(), 8));
|
||||||
|
tableWidget->yAxis->setRange(MIN_GRADE,MAX_GRADE);
|
||||||
|
tableWidget->yAxis->setTickStep(2);
|
||||||
|
tableWidget->yAxis->setAutoSubTicks(false);
|
||||||
|
tableWidget->yAxis->setAutoTickStep(false);
|
||||||
|
tableWidget->yAxis->setSubTickCount(5);
|
||||||
|
|
||||||
|
|
||||||
|
tableWidget->xAxis->setLabel(tr("Years"));
|
||||||
|
tableWidget->xAxis->setAutoTickLabels(false);
|
||||||
|
tableWidget->xAxis->setTickLabelFont(QFont(QFont().family(), 7));
|
||||||
|
tableWidget->xAxis->setAutoTickStep(false);
|
||||||
|
tableWidget->xAxis->setTickStep(1);
|
||||||
|
tableWidget->xAxis->setAutoSubTicks(false);
|
||||||
|
tableWidget->xAxis->setSubTickCount(0);
|
||||||
|
tableWidget->xAxis->setTickVectorLabels(xStrings);
|
||||||
|
tableWidget->xAxis->setRange(1,xRangeForYear);
|
||||||
|
|
||||||
|
tableWidget->legend->setVisible(true); //show graph name on top right
|
||||||
|
}
|
||||||
|
void gradegraph::clearGraph()
|
||||||
|
{
|
||||||
|
int itemDeleted,graphs,plots;
|
||||||
|
itemDeleted = tableWidget->clearItems();
|
||||||
|
graphs = tableWidget->clearGraphs();
|
||||||
|
plots = tableWidget->clearPlottables();
|
||||||
|
qDebug() << Q_FUNC_INFO << "items:" << itemDeleted << "graphs" << graphs << "plots:" << plots;
|
||||||
|
}
|
||||||
|
void gradegraph::on_pushButton_clicked()
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO << " Closed Graph Dialog";
|
||||||
|
this->done(0);
|
||||||
|
}
|
39
src/jceData/Grades/graph/gradegraph.h
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
#ifndef GRADEGRAPH_H
|
||||||
|
#define GRADEGRAPH_H
|
||||||
|
|
||||||
|
#include "../gradePage.h"
|
||||||
|
#include "qcustomplot.h"
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class gradegraph;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define MIN_GRADE 50
|
||||||
|
#define MAX_GRADE 100
|
||||||
|
|
||||||
|
class gradegraph : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
gradegraph(QWidget *parent = 0);
|
||||||
|
void showGraph(GradePage *gpPTR);
|
||||||
|
~gradegraph();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void on_pushButton_clicked();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
GradePage *gp;
|
||||||
|
|
||||||
|
QCustomPlot *tableWidget;
|
||||||
|
void setVisualization();
|
||||||
|
void setGraphsData();
|
||||||
|
void clearGraph();
|
||||||
|
|
||||||
|
Ui::gradegraph *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // GRADEGRAPH_H
|
86
src/jceData/Grades/graph/gradegraph.ui
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>gradegraph</class>
|
||||||
|
<widget class="QDialog" name="gradegraph">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>624</width>
|
||||||
|
<height>531</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>GPA Graph View</string>
|
||||||
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset resource="../../../../resources/connectionstatus.qrc">
|
||||||
|
<normaloff>:/icons/icon.ico</normaloff>:/icons/icon.ico</iconset>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p align="center"><span style=" font-size:18pt; font-weight:600;">GPA Graph View</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayoutMain">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayoutTable"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayoutButtomPanel">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="sizeConstraint">
|
||||||
|
<enum>QLayout::SetMinimumSize</enum>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>90</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Close</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="../../../../resources/connectionstatus.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
21370
src/jceData/Grades/graph/qcustomplot.cpp
Normal file
3529
src/jceData/Grades/graph/qcustomplot.h
Normal file
|
@ -10,27 +10,33 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The Course class
|
||||||
|
*
|
||||||
|
* This class is a prototype of a basic course structure
|
||||||
|
*
|
||||||
|
* Made By:
|
||||||
|
* Sagi Dayan, SagiDayan@gmail.com
|
||||||
|
* Liran Ben Gida, LiranBG@gmail.com
|
||||||
|
* On 31/8/2014
|
||||||
|
*/
|
||||||
class Course {
|
class Course {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Course(int serial,QString name, QString type, double points) {
|
Course(int serial,QString name, QString type) {
|
||||||
this->serialNum = serial;
|
this->serialNum = serial;
|
||||||
this->name = name;
|
this->name = name;
|
||||||
this->type = type;
|
this->type = type;
|
||||||
this->points = points;
|
|
||||||
}
|
}
|
||||||
virtual ~Course() { }
|
virtual ~Course() { }
|
||||||
|
|
||||||
int getSerialNum() const {return this->serialNum;}
|
int getSerialNum() const {return this->serialNum;}
|
||||||
virtual QString getName() const {return this->name;}
|
virtual QString getName() const {return this->name;}
|
||||||
virtual QString getType() const {return this->type;}
|
virtual QString getType() const {return this->type;}
|
||||||
virtual double getPoints() const {return this->points;}
|
|
||||||
|
|
||||||
virtual void setName(QString name) { this->name = name;}
|
virtual void setName(QString name) { this->name = name;}
|
||||||
virtual void setType(QString type){ this->type = type;}
|
virtual void setType(QString type){ this->type = type;}
|
||||||
virtual void setPoints(double points){ this->points = points;}
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -38,7 +44,6 @@ private:
|
||||||
int serialNum;
|
int serialNum;
|
||||||
QString name;
|
QString name;
|
||||||
QString type;
|
QString type;
|
||||||
double points;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "page.h"
|
#include "page.h"
|
||||||
|
|
||||||
Page::Page() {}
|
Page::Page() { dateHeader = "";}
|
||||||
/**
|
/**
|
||||||
* @brief Page::getString
|
* @brief Page::getString
|
||||||
* @param htmlToPhrased
|
* @param htmlToPhrased
|
||||||
|
@ -8,14 +8,14 @@ Page::Page() {}
|
||||||
*/
|
*/
|
||||||
QString Page::getString(QString &htmlToParse)
|
QString Page::getString(QString &htmlToParse)
|
||||||
{
|
{
|
||||||
makeText(htmlToParse);
|
makeText(htmlToParse);
|
||||||
return this->text;
|
return this->text;
|
||||||
}
|
}
|
||||||
void Page::makeText(QString &html)
|
void Page::makeText(QString &html)
|
||||||
{
|
{
|
||||||
int index = 0;
|
int index = 0;
|
||||||
index = html.indexOf("<tbody>",0); //set index into the place where the data is
|
index = html.indexOf("<tbody>",0); //set index into the place where the data is
|
||||||
manageTableContent(html, index);
|
manageTableContent(html, index);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief Page::manageTableContent strip html, make it string
|
* @brief Page::manageTableContent strip html, make it string
|
||||||
|
@ -24,95 +24,153 @@ void Page::makeText(QString &html)
|
||||||
*/
|
*/
|
||||||
void Page::manageTableContent(QString &html, int index)
|
void Page::manageTableContent(QString &html, int index)
|
||||||
{
|
{
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
return;
|
return;
|
||||||
QString temp;
|
QString temp;
|
||||||
for (int i = index; i < html.length(); i++)
|
for (int i = index; i < html.length(); i++)
|
||||||
{
|
{
|
||||||
if(html.at(i) == '<')
|
if (html.at(i) == '<')
|
||||||
{
|
{
|
||||||
//<tr> / <td> / <th>
|
//<tr> / <td> / <th>
|
||||||
QString endofTable = "</tbody>";
|
QString endofTable = "</tbody>";
|
||||||
QString tableTag = html.mid(i, 4); //legth of "tr/td"
|
QString tableTag = html.mid(i, 4); //legth of "tr/td"
|
||||||
if (tableTag == "<tr>")
|
if (tableTag == "<tr>")
|
||||||
{
|
|
||||||
temp += "\n"; //new row -> new line
|
|
||||||
i = stitchText(html, temp, i+4);
|
|
||||||
if(i == -1) //EOF
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (tableTag == "<td>" || tableTag == "<th>")
|
|
||||||
{
|
|
||||||
temp += "\t"; // new cell -> tab between data
|
|
||||||
if (html.mid(i, 6) == "<td><a") //link to lecturer portal, need to be deleted
|
|
||||||
{
|
|
||||||
i += 6;
|
|
||||||
while (html.at(++i) != '>');
|
|
||||||
i = stitchText(html, temp, i+1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
i = stitchText(html, temp, i+4);
|
|
||||||
if (i == -1) //EOF
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if(tableTag == "<td ") // a Year title (in grades table)
|
|
||||||
{
|
|
||||||
temp += "\t";
|
|
||||||
while(html.at(i) != '>')
|
|
||||||
i++;
|
|
||||||
i = stitchText(html, temp, i+1);
|
|
||||||
}
|
|
||||||
else if (html.mid(i,(endofTable).length()) == endofTable) //is end of table
|
|
||||||
{
|
{
|
||||||
|
if (!dateHeader.isEmpty())
|
||||||
|
temp += dateHeader;
|
||||||
|
i = stitchText(html, temp, i+4);
|
||||||
|
if (i == -1) //EOF
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (tableTag == "</tr")
|
||||||
|
{
|
||||||
|
temp += "\n"; //end row -> new line
|
||||||
|
i+=5;
|
||||||
|
}
|
||||||
|
else if (tableTag == "<td>" || tableTag == "<th>")
|
||||||
|
{
|
||||||
|
if (!dateHeader.isEmpty())
|
||||||
|
temp += "\t"; // new cell -> tab between data
|
||||||
|
if (html.mid(i, 6) == "<td><a") //link to lecturer portal, need to be deleted
|
||||||
|
{
|
||||||
|
i += 6;
|
||||||
|
while (html.at(++i) != '>');
|
||||||
|
i = stitchText(html, temp, i+1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
i = stitchText(html, temp, i+4);
|
||||||
|
|
||||||
|
if (dateHeader.isEmpty())
|
||||||
|
temp += "\t";
|
||||||
|
|
||||||
|
if (i == -1) //EOF
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (tableTag == "<td ") // a Year title (in grades table) or Day and Hour (in calendar page)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!dateHeader.isEmpty())
|
||||||
|
{
|
||||||
|
//checking if theres a need to fill a timestamp of course
|
||||||
|
//if the string is not empty, then we will chop the last date stamp to avoid multiple date stamp in empty rows
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
if (temp.lastIndexOf(dateHeader) == temp.length()-dateHeader.length())
|
||||||
|
{
|
||||||
|
temp.chop(dateHeader.length()+5);
|
||||||
|
temp += "\t";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while ((html.mid(i,5) != "</td>") && (i < (int)html.length()))
|
||||||
|
{
|
||||||
|
if (html.mid(i,3) == "<b>") //for gpa. year & semester title
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if ((html.at(i) == '>') && (html.mid(i+4,3) != "<b>")) //for calendar. day and hours
|
||||||
|
{
|
||||||
|
i += 1; //lenght of >
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
i = stitchText(html, temp, i);
|
||||||
|
temp += "\t";
|
||||||
|
}
|
||||||
|
if (html.mid(i,(endofTable).length()) == endofTable) //is end of table
|
||||||
|
{
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this->text = temp;
|
this->text = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Page::stitchText(QString &from, QString &to, int index)
|
int Page::stitchText(QString &from, QString &to, int index)
|
||||||
{
|
{
|
||||||
if (from.at(index) == '<')
|
if (from.mid(index,3) == "<b>")
|
||||||
{
|
{
|
||||||
QString bTag = from.mid(index, 3);
|
QString bTag = from.mid(index, 3);
|
||||||
if (bTag != "<b>")
|
QString dateline = from.mid(index,from.indexOf("</b>",index+4)-index);
|
||||||
return index-1; //go back one step - for the main function to inc i
|
QString temp;
|
||||||
index += 3;
|
QString date;
|
||||||
|
char* tok;
|
||||||
|
int i = 0;
|
||||||
|
char* textToTok = strdup(dateline.toStdString().c_str());
|
||||||
|
tok = strtok(textToTok,"<> :");
|
||||||
|
while (tok != NULL)
|
||||||
|
{
|
||||||
|
if (i == 1)
|
||||||
|
{
|
||||||
|
temp = tok;
|
||||||
|
date += temp + "\t";
|
||||||
|
}
|
||||||
|
else if (i == 3)
|
||||||
|
{
|
||||||
|
temp = tok;
|
||||||
|
date += temp;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
tok = strtok(NULL, "<> :");
|
||||||
|
}
|
||||||
|
dateHeader = date;
|
||||||
|
if (bTag != "<b>")
|
||||||
|
return index-1; //go back one step - for the main function to inc i
|
||||||
|
index += dateline.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
while (from.at(index) != '<' && index < (int)from.length())
|
while (from.at(index) != '<' && index < (int)from.length())
|
||||||
{
|
{
|
||||||
if (from[index] == '&')
|
if (from[index] == '&')
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
QString nbspChr = from.mid(index, 6);
|
QString nbspChr = from.mid(index, 6);
|
||||||
if (nbspChr == " ")
|
if (nbspChr == " ")
|
||||||
{
|
{
|
||||||
index += 5;
|
index += 5;
|
||||||
from.replace(index,1,' ');
|
from.replace(index,1,' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (endOfString(index,(int) from.length()))
|
if (endOfString(index,(int) from.length()))
|
||||||
return -1; //EOF
|
return -1; //EOF
|
||||||
|
|
||||||
else if (from.at(index) == '<')
|
else if (from.at(index) == '<')
|
||||||
return index - 1; //go back one step - for the main function to inc i
|
return index - 1; //go back one step - for the main function to inc i
|
||||||
|
|
||||||
if (from.at(index) != '\n') //check the actuall data before continue
|
if ((from.at(index) != '\n') && (from.at(index) != '\t')) //check the actuall data before continue
|
||||||
to += from.at(index);
|
to += from.at(index);
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return index-1;
|
return index-1;
|
||||||
}
|
}
|
||||||
bool Page::endOfString(int index, int length)
|
bool Page::endOfString(int index, int length)
|
||||||
{
|
{
|
||||||
if(index < length)
|
if(index < length)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
#ifndef PAGE_H
|
#ifndef PAGE_H
|
||||||
#define PAGE_H
|
#define PAGE_H
|
||||||
|
|
||||||
/* This Code Made By Sagi Dayan
|
|
||||||
* SagiDayan@gmail.com
|
|
||||||
*
|
|
||||||
* Changes have been made by Liran Ben Gida
|
|
||||||
* LiranBG@gmail.com
|
|
||||||
*/
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
@ -14,6 +8,11 @@
|
||||||
* @brief The Page class
|
* @brief The Page class
|
||||||
* parsing given page - strip and clean html tags
|
* parsing given page - strip and clean html tags
|
||||||
* use only with JCE
|
* use only with JCE
|
||||||
|
*
|
||||||
|
* Made By:
|
||||||
|
* Sagi Dayan, SagiDayan@gmail.com
|
||||||
|
* Liran Ben Gida, LiranBG@gmail.com
|
||||||
|
* On 31/8/2014
|
||||||
*/
|
*/
|
||||||
class Page
|
class Page
|
||||||
{
|
{
|
||||||
|
@ -33,6 +32,7 @@ private:
|
||||||
bool endOfString(int index, int length);
|
bool endOfString(int index, int length);
|
||||||
|
|
||||||
QString text;
|
QString text;
|
||||||
|
QString dateHeader;
|
||||||
QString title;
|
QString title;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef JCELOGINHTMLSCRIPTS_H
|
#ifndef JCELOGINHTMLSCRIPTS_H
|
||||||
#define JCELOGINHTMLSCRIPTS_H
|
#define JCELOGINHTMLSCRIPTS_H
|
||||||
|
|
||||||
#include "./src/jceSettings/user.h"
|
#include "../../src/jceSettings/user.h"
|
||||||
|
|
||||||
#define dst_host "yedion.jce.ac.il"
|
#define dst_host "yedion.jce.ac.il"
|
||||||
#define dst_port 443
|
#define dst_port 443
|
||||||
|
@ -84,6 +84,17 @@ public:
|
||||||
parameters += "R1C2=" + QString::number(semester) + "&";
|
parameters += "R1C2=" + QString::number(semester) + "&";
|
||||||
return parameters;
|
return parameters;
|
||||||
}
|
}
|
||||||
|
const static QString getExamSchedule(const user &usr,int year, int semester)
|
||||||
|
{
|
||||||
|
QString parameters;
|
||||||
|
parameters = "PRGNAME=HADPASAT_TOCHNIT_BEHINOT&ARGUMENTS=TZ,UNIQ,R1C1,R1C2,R1C3&";
|
||||||
|
parameters += "TZ=" + usr.getUserID() + "&";
|
||||||
|
parameters += "UNIQ=" + usr.getHashedPassword() + "&";
|
||||||
|
parameters += "R1C1=" + QString::number(year) + "&";
|
||||||
|
parameters += "R1C2=" + QString::number(semester) + "&";
|
||||||
|
parameters += "R1C3=0";
|
||||||
|
return parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,22 +4,23 @@
|
||||||
* @brief jceLogin::jceLogin
|
* @brief jceLogin::jceLogin
|
||||||
* @param username pointer to allocated user settings
|
* @param username pointer to allocated user settings
|
||||||
*/
|
*/
|
||||||
jceLogin::jceLogin(user* username)
|
jceLogin::jceLogin(user* username, jceStatusBar *statusBar)
|
||||||
{
|
{
|
||||||
this->recieverPage = new QString();
|
this->statusBar = statusBar;
|
||||||
this->jceA = username;
|
this->recieverPage = new QString();
|
||||||
this->JceConnector = new jceSSLClient();
|
this->jceA = username;
|
||||||
QObject::connect(JceConnector,SIGNAL(serverDisconnectedbyRemote()),this,SLOT(reValidation()));
|
this->JceConnector = new jceSSLClient(statusBar);
|
||||||
QObject::connect(JceConnector,SIGNAL(noInternetLink()),this,SLOT(reMakeConnection()));
|
QObject::connect(JceConnector,SIGNAL(serverDisconnectedbyRemote()),this,SLOT(reValidation()));
|
||||||
|
QObject::connect(JceConnector,SIGNAL(noInternetLink()),this,SLOT(reMakeConnection()));
|
||||||
}
|
}
|
||||||
|
|
||||||
jceLogin::~jceLogin()
|
jceLogin::~jceLogin()
|
||||||
{
|
{
|
||||||
this->jceA = NULL;
|
this->jceA = NULL;
|
||||||
delete recieverPage;
|
delete recieverPage;
|
||||||
delete JceConnector;
|
delete JceConnector;
|
||||||
JceConnector = NULL;
|
JceConnector = NULL;
|
||||||
recieverPage = NULL;
|
recieverPage = NULL;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief jceLogin::makeConnection Connecting to JCE student web site with JceA (username object) and validate it.
|
* @brief jceLogin::makeConnection Connecting to JCE student web site with JceA (username object) and validate it.
|
||||||
|
@ -27,74 +28,79 @@ jceLogin::~jceLogin()
|
||||||
*/
|
*/
|
||||||
int jceLogin::makeConnection()
|
int jceLogin::makeConnection()
|
||||||
{
|
{
|
||||||
qDebug() << "jceLogin::makeConnection(); connection to be make";
|
qDebug() << Q_FUNC_INFO << "connection to be make";
|
||||||
|
|
||||||
if (this->recieverPage == NULL)
|
if (this->recieverPage == NULL)
|
||||||
this->recieverPage = new QString();
|
this->recieverPage = new QString();
|
||||||
|
|
||||||
int returnMode; //gets status according to called function of validation step
|
int returnMode; //gets status according to called function of validation step
|
||||||
jceStatus status = jceStatus::JCE_NOT_CONNECTED;
|
jceStatus status = jceStatus::JCE_NOT_CONNECTED;
|
||||||
|
|
||||||
returnMode = checkConnection(); //checking socket status. is connected?
|
returnMode = checkConnection(); //checking socket status. is connected?
|
||||||
|
|
||||||
if (returnMode == false)
|
if (returnMode == (int)false)
|
||||||
{
|
{
|
||||||
if (JceConnector->makeConnect(dst_host,dst_port) == false) //couldnt make a connection
|
statusBar->setIconConnectionStatus(jceStatusBar::Connecting);
|
||||||
return jceStatus::ERROR_ON_OPEN_SOCKET;
|
if (JceConnector->makeConnect(dst_host,dst_port) == false) //couldnt make a connection
|
||||||
else
|
return jceStatus::ERROR_ON_OPEN_SOCKET;
|
||||||
returnMode = true;
|
else
|
||||||
|
returnMode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (returnMode == true) //connected to host
|
if (returnMode == (int)true) //connected to host
|
||||||
{
|
{
|
||||||
returnMode = makeFirstVisit();
|
statusBar->setIconConnectionStatus(jceStatusBar::Connected);
|
||||||
if (returnMode == true) //requst and send first validation
|
returnMode = makeFirstVisit();
|
||||||
|
if (returnMode == (int)true) //requst and send first validation
|
||||||
{
|
{
|
||||||
status = jceStatus::JCE_START_VALIDATING_PROGRESS;
|
status = jceStatus::JCE_START_VALIDATING_PROGRESS;
|
||||||
returnMode = checkValidation();
|
returnMode = checkValidation();
|
||||||
if (returnMode == true) //check if username and password are matching
|
if (returnMode == (int)true) //check if username and password are matching
|
||||||
{
|
{
|
||||||
status = jceStatus::JCE_VALIDATION_PASSED;
|
status = jceStatus::JCE_VALIDATION_PASSED;
|
||||||
returnMode = makeSecondVisit();
|
returnMode = makeSecondVisit();
|
||||||
if (returnMode == true) //siging in the website
|
if (returnMode == (int)true) //siging in the website
|
||||||
{
|
{
|
||||||
qDebug() << "jceLogin::makeConnection(); Signed in succeesfully";
|
qDebug() << Q_FUNC_INFO << "Signed in succeesfully";
|
||||||
status = jceStatus::JCE_YOU_ARE_IN;
|
status = jceStatus::JCE_YOU_ARE_IN;
|
||||||
setLoginFlag(true);
|
setLoginFlag(true);
|
||||||
|
statusBar->setIconConnectionStatus(jceStatusBar::LoggedIn);
|
||||||
}
|
}
|
||||||
else if (returnMode == jceLogin::ERROR_ON_GETTING_INFO)
|
else if (returnMode == jceLogin::ERROR_ON_GETTING_INFO)
|
||||||
{
|
{
|
||||||
status = jceLogin::ERROR_ON_GETTING_INFO;
|
status = jceLogin::ERROR_ON_GETTING_INFO;
|
||||||
}
|
}
|
||||||
else if (returnMode == jceLogin::ERROR_ON_SEND_REQUEST)
|
else if (returnMode == jceLogin::ERROR_ON_SEND_REQUEST)
|
||||||
{
|
{
|
||||||
status = jceLogin::ERROR_ON_SEND_REQUEST;
|
status = jceLogin::ERROR_ON_SEND_REQUEST;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
status = jceStatus::ERROR_ON_VALIDATION;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
status = jceStatus::ERROR_ON_VALIDATION;
|
status = jceStatus::ERROR_ON_VALIDATION;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
status = jceStatus::ERROR_ON_VALIDATION;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (returnMode == jceLogin::ERROR_ON_GETTING_INFO)
|
else if (returnMode == jceLogin::ERROR_ON_GETTING_INFO)
|
||||||
{
|
{
|
||||||
status = jceLogin::ERROR_ON_GETTING_INFO;
|
status = jceLogin::ERROR_ON_GETTING_INFO;
|
||||||
}
|
}
|
||||||
else if (returnMode == jceLogin::ERROR_ON_SEND_REQUEST)
|
else if (returnMode == jceLogin::ERROR_ON_SEND_REQUEST)
|
||||||
{
|
{
|
||||||
status = jceLogin::ERROR_ON_SEND_REQUEST;
|
status = jceLogin::ERROR_ON_SEND_REQUEST;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
status = jceStatus::ERROR_ON_VALIDATION_USER_BLOCKED;
|
status = jceStatus::ERROR_ON_VALIDATION_USER_BLOCKED;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
status = jceStatus::JCE_NOT_CONNECTED;
|
status = jceStatus::JCE_NOT_CONNECTED;
|
||||||
|
|
||||||
//we throw status even if we are IN!
|
if (status != jceStatus::JCE_YOU_ARE_IN)
|
||||||
qDebug() << "jceLogin::makeConnection(); return status: " << status;
|
statusBar->setIconConnectionStatus(jceStatusBar::Error);
|
||||||
return status;
|
//we throw status even if we are IN!
|
||||||
|
qDebug() << Q_FUNC_INFO << "return status: " << status;
|
||||||
|
return status;
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -103,21 +109,22 @@ int jceLogin::makeConnection()
|
||||||
*/
|
*/
|
||||||
bool jceLogin::checkConnection() const
|
bool jceLogin::checkConnection() const
|
||||||
{
|
{
|
||||||
if (JceConnector->isConnected())
|
if (JceConnector->isConnected())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief jceLogin::closeAll
|
* @brief jceLogin::closeAll
|
||||||
*/
|
*/
|
||||||
void jceLogin::closeAll()
|
void jceLogin::closeAll()
|
||||||
{
|
{
|
||||||
this->JceConnector->makeDiconnect();
|
statusBar->setIconConnectionStatus(jceStatusBar::Disconnected);
|
||||||
if ((this->recieverPage != NULL) && (!this->recieverPage->isEmpty()))
|
this->JceConnector->makeDiconnect();
|
||||||
|
if ((this->recieverPage != NULL) && (!this->recieverPage->isEmpty()))
|
||||||
{
|
{
|
||||||
delete recieverPage;
|
delete recieverPage;
|
||||||
recieverPage = NULL;
|
recieverPage = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -126,17 +133,17 @@ void jceLogin::closeAll()
|
||||||
*/
|
*/
|
||||||
void jceLogin::reMakeConnection()
|
void jceLogin::reMakeConnection()
|
||||||
{
|
{
|
||||||
if (this->JceConnector != NULL)
|
if (this->JceConnector != NULL)
|
||||||
delete JceConnector;
|
delete JceConnector;
|
||||||
if (this->recieverPage != NULL)
|
if (this->recieverPage != NULL)
|
||||||
delete recieverPage;
|
delete recieverPage;
|
||||||
recieverPage = NULL;
|
recieverPage = NULL;
|
||||||
JceConnector = NULL;
|
JceConnector = NULL;
|
||||||
this->recieverPage = new QString();
|
this->recieverPage = new QString();
|
||||||
this->JceConnector = new jceSSLClient();
|
this->JceConnector = new jceSSLClient(statusBar);
|
||||||
QObject::connect(JceConnector,SIGNAL(serverDisconnectedbyRemote()),this,SLOT(reValidation()));
|
QObject::connect(JceConnector,SIGNAL(serverDisconnectedbyRemote()),this,SLOT(reValidation()));
|
||||||
QObject::connect(JceConnector,SIGNAL(noInternetLink()),this,SLOT(reMakeConnection()));
|
QObject::connect(JceConnector,SIGNAL(noInternetLink()),this,SLOT(reMakeConnection()));
|
||||||
emit connectionReadyAfterDisconnection();
|
emit connectionReadyAfterDisconnection();
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -145,17 +152,15 @@ void jceLogin::reMakeConnection()
|
||||||
*/
|
*/
|
||||||
int jceLogin::makeFirstVisit()
|
int jceLogin::makeFirstVisit()
|
||||||
{
|
{
|
||||||
QString usr = jceA->getUsername();
|
if (JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getFirstValidationStep(*jceA))))
|
||||||
QString psw = jceA->getPassword();
|
|
||||||
if (JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getFirstValidationStep(*jceA))))
|
|
||||||
{
|
{
|
||||||
if (!JceConnector->recieveData(*recieverPage,true))
|
if (!JceConnector->recieveData(recieverPage))
|
||||||
return jceLogin::ERROR_ON_GETTING_INFO;
|
return jceLogin::ERROR_ON_GETTING_INFO;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return jceLogin::ERROR_ON_SEND_REQUEST;
|
return jceLogin::ERROR_ON_SEND_REQUEST;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief jceLogin::makeSecondVisit making the second validation step of jce student portal login
|
* @brief jceLogin::makeSecondVisit making the second validation step of jce student portal login
|
||||||
|
@ -163,19 +168,19 @@ int jceLogin::makeFirstVisit()
|
||||||
*/
|
*/
|
||||||
int jceLogin::makeSecondVisit()
|
int jceLogin::makeSecondVisit()
|
||||||
{
|
{
|
||||||
QString usrid=jceA->getUserID();
|
QString usrid=jceA->getUserID();
|
||||||
QString pswid=jceA->getHashedPassword();
|
QString pswid=jceA->getHashedPassword();
|
||||||
if ((JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getSecondValidationStep(*jceA)))))
|
if ((JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getSecondValidationStep(*jceA)))))
|
||||||
{
|
{
|
||||||
if (!(JceConnector->recieveData(*recieverPage,true)))
|
if (!(JceConnector->recieveData(recieverPage)))
|
||||||
return jceLogin::ERROR_ON_GETTING_INFO;
|
return jceLogin::ERROR_ON_GETTING_INFO;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return jceLogin::ERROR_ON_SEND_REQUEST;
|
return jceLogin::ERROR_ON_SEND_REQUEST;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief jceLogin::getCalendar according to parameters, we make an HTML request and send it over socket to server
|
* @brief jceLogin::getCalendar according to parameters, we make an HTML request and send it over socket to server
|
||||||
|
@ -185,18 +190,32 @@ int jceLogin::makeSecondVisit()
|
||||||
*/
|
*/
|
||||||
int jceLogin::getCalendar(int year, int semester)
|
int jceLogin::getCalendar(int year, int semester)
|
||||||
{
|
{
|
||||||
if ((JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getCalendar(*jceA,year,semester)))))
|
if ((JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getCalendar(*jceA,year,semester)))))
|
||||||
{
|
{
|
||||||
if (!(JceConnector->recieveData(*recieverPage,false)))
|
if (!(JceConnector->recieveData(recieverPage)))
|
||||||
return jceLogin::ERROR_ON_GETTING_PAGE;
|
return jceLogin::ERROR_ON_GETTING_PAGE;
|
||||||
else
|
else
|
||||||
return jceLogin::JCE_PAGE_PASSED;
|
return jceLogin::JCE_PAGE_PASSED;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return jceLogin::ERROR_ON_SEND_REQUEST;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
int jceLogin::getExams(int year, int semester)
|
||||||
|
{
|
||||||
|
if ((JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getExamSchedule(*jceA,year,semester)))))
|
||||||
|
{
|
||||||
|
if (!(JceConnector->recieveData(recieverPage)))
|
||||||
|
return jceLogin::ERROR_ON_GETTING_PAGE;
|
||||||
|
else
|
||||||
|
return jceLogin::JCE_PAGE_PASSED;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return jceLogin::ERROR_ON_SEND_REQUEST;
|
return jceLogin::ERROR_ON_SEND_REQUEST;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief jceLogin::getGrades according to parameters, we make an HTML request and send it over socket to server
|
* @brief jceLogin::getGrades according to parameters, we make an HTML request and send it over socket to server
|
||||||
|
@ -208,17 +227,17 @@ int jceLogin::getCalendar(int year, int semester)
|
||||||
*/
|
*/
|
||||||
int jceLogin::getGrades(int fromYear, int toYear, int fromSemester, int toSemester)
|
int jceLogin::getGrades(int fromYear, int toYear, int fromSemester, int toSemester)
|
||||||
{
|
{
|
||||||
if ((JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getGradesPath(*jceA,fromYear, toYear, fromSemester, toSemester)))))
|
if ((JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getGradesPath(*jceA,fromYear, toYear, fromSemester, toSemester)))))
|
||||||
{
|
{
|
||||||
if (!(JceConnector->recieveData(*recieverPage,false)))
|
if (!(JceConnector->recieveData(recieverPage)))
|
||||||
return jceLogin::ERROR_ON_GETTING_PAGE;
|
return jceLogin::ERROR_ON_GETTING_PAGE;
|
||||||
else
|
else
|
||||||
return jceLogin::JCE_PAGE_PASSED;
|
return jceLogin::JCE_PAGE_PASSED;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return jceLogin::ERROR_ON_SEND_REQUEST;
|
return jceLogin::ERROR_ON_SEND_REQUEST;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -228,43 +247,43 @@ int jceLogin::getGrades(int fromYear, int toYear, int fromSemester, int toSemest
|
||||||
bool jceLogin::checkValidation()
|
bool jceLogin::checkValidation()
|
||||||
{
|
{
|
||||||
|
|
||||||
//finds the hashed password
|
//finds the hashed password
|
||||||
QString constUserID_TAG = "value=\"-N";
|
QString constUserID_TAG = "value=\"-N";
|
||||||
QString constHassID_TAG = "-A,-N";
|
QString constHassID_TAG = "-A,-N";
|
||||||
QString hasspass,hassid;
|
QString hasspass,hassid;
|
||||||
std::size_t hasspass_position1,hasspass_position2;
|
std::size_t hasspass_position1,hasspass_position2;
|
||||||
std::size_t id_position1,id_position2;
|
std::size_t id_position1,id_position2;
|
||||||
|
|
||||||
hasspass_position1 = this->recieverPage->toStdString().find(constHassID_TAG.toStdString()); //looking for hasspass index
|
hasspass_position1 = this->recieverPage->toStdString().find(constHassID_TAG.toStdString()); //looking for hasspass index
|
||||||
if (hasspass_position1 == std::string::npos) //didnt find the tag
|
if (hasspass_position1 == std::string::npos) //didnt find the tag
|
||||||
return false;
|
return false;
|
||||||
else
|
else
|
||||||
hasspass_position1 += constHassID_TAG.length(); //skip the index of tag
|
hasspass_position1 += constHassID_TAG.length(); //skip the index of tag
|
||||||
hasspass_position2 = this->recieverPage->toStdString().find(",-A,-A", hasspass_position1);
|
hasspass_position2 = this->recieverPage->toStdString().find(",-A,-A", hasspass_position1);
|
||||||
//finds the hass pass
|
//finds the hass pass
|
||||||
if (hasspass_position2 != std::string::npos) //found the hasspass! storing it
|
if (hasspass_position2 != std::string::npos) //found the hasspass! storing it
|
||||||
hasspass = recieverPage->mid(hasspass_position1,hasspass_position2-hasspass_position1);
|
hasspass = recieverPage->mid(hasspass_position1,hasspass_position2-hasspass_position1);
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
//finds the user id
|
//finds the user id
|
||||||
id_position1 = this->recieverPage->toStdString().find(constUserID_TAG.toStdString(), 0); //looking for hassid index
|
id_position1 = this->recieverPage->toStdString().find(constUserID_TAG.toStdString(), 0); //looking for hassid index
|
||||||
if (id_position1 == std::string::npos) //didnt find the tag
|
if (id_position1 == std::string::npos) //didnt find the tag
|
||||||
return false;
|
return false;
|
||||||
else
|
else
|
||||||
id_position1 += constUserID_TAG.length(); //skip the index of tag
|
id_position1 += constUserID_TAG.length(); //skip the index of tag
|
||||||
id_position2 = this->recieverPage->toStdString().find(",-A", id_position1);
|
id_position2 = this->recieverPage->toStdString().find(",-A", id_position1);
|
||||||
if (id_position2 != std::string::npos) //found the hassid! storing it
|
if (id_position2 != std::string::npos) //found the hassid! storing it
|
||||||
hassid = recieverPage->mid(id_position1,id_position2-id_position1);
|
hassid = recieverPage->mid(id_position1,id_position2-id_position1);
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//setting user information with given data hassid and hasspass
|
//setting user information with given data hassid and hasspass
|
||||||
jceA->setHashedPassword(hasspass);
|
jceA->setHashedPassword(hasspass);
|
||||||
jceA->setUserID(hassid);
|
jceA->setUserID(hassid);
|
||||||
|
|
||||||
qDebug() << "jceLogin::checkValidation(); Found Hashed: " << hasspass << "And ID: " << hassid;
|
qDebug() << "jceLogin::checkValidation(); Found Hashed: " << hasspass << "And ID: " << hassid;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief jceLogin::setLoginFlag
|
* @brief jceLogin::setLoginFlag
|
||||||
|
@ -272,7 +291,7 @@ bool jceLogin::checkValidation()
|
||||||
*/
|
*/
|
||||||
void jceLogin::setLoginFlag(bool x)
|
void jceLogin::setLoginFlag(bool x)
|
||||||
{
|
{
|
||||||
this->loginFlag = x;
|
this->loginFlag = x;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief jceLogin::isLoginFlag checking if there is a connection, if true - > return if we signed in. otherwise, return not (not connected dough)
|
* @brief jceLogin::isLoginFlag checking if there is a connection, if true - > return if we signed in. otherwise, return not (not connected dough)
|
||||||
|
@ -280,9 +299,9 @@ void jceLogin::setLoginFlag(bool x)
|
||||||
*/
|
*/
|
||||||
bool jceLogin::isLoginFlag() const
|
bool jceLogin::isLoginFlag() const
|
||||||
{
|
{
|
||||||
if (checkConnection())
|
if (checkConnection())
|
||||||
return this->loginFlag;
|
return this->loginFlag;
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -291,26 +310,30 @@ bool jceLogin::isLoginFlag() const
|
||||||
*/
|
*/
|
||||||
QString jceLogin::getPage()
|
QString jceLogin::getPage()
|
||||||
{
|
{
|
||||||
return *recieverPage;
|
return *recieverPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
void jceLogin::reValidation()
|
void jceLogin::reValidation()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "Revalidating user";
|
qDebug() << Q_FUNC_INFO << "Revalidating user";
|
||||||
if (makeFirstVisit() == true)
|
|
||||||
|
if (makeFirstVisit() == (int)true)
|
||||||
{
|
{
|
||||||
if (checkValidation())
|
if (checkValidation())
|
||||||
{
|
{
|
||||||
if (makeSecondVisit() == true)
|
if (makeSecondVisit() == (int)true)
|
||||||
qDebug() << Q_FUNC_INFO << "Validated";
|
{
|
||||||
else
|
statusBar->setIconConnectionStatus(jceStatusBar::LoggedIn);
|
||||||
qWarning() << Q_FUNC_INFO << "Second visit finished with an error";
|
qDebug() << Q_FUNC_INFO << "Validated";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
qWarning() << Q_FUNC_INFO << "Second visit finished with an error";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
qDebug() << Q_FUNC_INFO << "checking validation ended with an error";
|
qDebug() << Q_FUNC_INFO << "checking validation ended with an error";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "Couldnt Validate User";
|
qDebug() << Q_FUNC_INFO << "Couldnt Validate User";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,66 +1,71 @@
|
||||||
#ifndef JCELOGIN_H
|
#ifndef JCELOGIN_H
|
||||||
#define JCELOGIN_H
|
#define JCELOGIN_H
|
||||||
|
|
||||||
#include "./src/jceConnection/jcesslclient.h"
|
|
||||||
#include "./src/jceSettings/user.h"
|
#include "../../src/jceConnection/jcesslclient.h"
|
||||||
|
#include "../../src/jceSettings/user.h"
|
||||||
#include "jceLoginHtmlScripts.h"
|
#include "jceLoginHtmlScripts.h"
|
||||||
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
class jceLogin : public QObject
|
class jceLogin : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
jceLogin() {}
|
|
||||||
jceLogin(user* username);
|
|
||||||
~jceLogin();
|
|
||||||
|
|
||||||
enum jceStatus {
|
jceLogin(user* username, jceStatusBar *statusBar);
|
||||||
JCE_NOT_CONNECTED,
|
~jceLogin();
|
||||||
ERROR_ON_VALIDATION,
|
|
||||||
ERROR_ON_VALIDATION_USER_BLOCKED,
|
|
||||||
ERROR_ON_OPEN_SOCKET,
|
|
||||||
ERROR_ON_SEND_REQUEST,
|
|
||||||
ERROR_ON_GETTING_INFO,
|
|
||||||
ERROR_ON_GETTING_PAGE,
|
|
||||||
|
|
||||||
JCE_START_VALIDATING_PROGRESS,
|
enum jceStatus {
|
||||||
JCE_VALIDATION_PASSED,
|
JCE_NOT_CONNECTED,
|
||||||
JCE_YOU_ARE_IN,
|
ERROR_ON_VALIDATION,
|
||||||
JCE_PAGE_PASSED
|
ERROR_ON_VALIDATION_USER_BLOCKED,
|
||||||
};
|
ERROR_ON_OPEN_SOCKET,
|
||||||
|
ERROR_ON_SEND_REQUEST,
|
||||||
|
ERROR_ON_GETTING_INFO,
|
||||||
|
ERROR_ON_GETTING_PAGE,
|
||||||
|
|
||||||
int makeConnection();
|
JCE_START_VALIDATING_PROGRESS,
|
||||||
void closeAll();
|
JCE_VALIDATION_PASSED,
|
||||||
|
JCE_YOU_ARE_IN,
|
||||||
|
JCE_PAGE_PASSED
|
||||||
|
};
|
||||||
|
|
||||||
bool checkConnection() const;
|
|
||||||
bool isLoginFlag() const;
|
|
||||||
|
|
||||||
int getCalendar(int year, int semester);
|
int makeConnection();
|
||||||
int getGrades(int fromYear, int toYear, int fromSemester, int toSemester);
|
void closeAll();
|
||||||
|
|
||||||
QString getPage();
|
bool checkConnection() const;
|
||||||
|
bool isLoginFlag() const;
|
||||||
|
|
||||||
|
int getExams(int year, int semester);
|
||||||
|
int getCalendar(int year, int semester);
|
||||||
|
int getGrades(int fromYear, int toYear, int fromSemester, int toSemester);
|
||||||
|
|
||||||
|
QString getPage();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void reValidation();
|
void reValidation();
|
||||||
void reMakeConnection();
|
void reMakeConnection();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void connectionReadyAfterDisconnection();
|
void connectionReadyAfterDisconnection();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
int makeFirstVisit();
|
int makeFirstVisit();
|
||||||
int makeSecondVisit();
|
int makeSecondVisit();
|
||||||
bool checkValidation();
|
bool checkValidation();
|
||||||
void setLoginFlag(bool x);
|
void setLoginFlag(bool x);
|
||||||
|
|
||||||
bool loginFlag;
|
bool loginFlag;
|
||||||
QString * recieverPage;
|
QString * recieverPage;
|
||||||
user * jceA;
|
user * jceA;
|
||||||
jceSSLClient * JceConnector;
|
jceSSLClient * JceConnector;
|
||||||
|
jceStatusBar *statusBar;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,8 +2,8 @@ IDI_ICON1 ICON DISCARDABLE "./resources/icon.ico"
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1, 0, 0
|
FILEVERSION 1, 1, 0
|
||||||
PRODUCTVERSION 1, 0, 0
|
PRODUCTVERSION 1, 1, 0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
FILEFLAGS 0
|
FILEFLAGS 0
|
||||||
FILEOS VOS_NT_WINDOWS32
|
FILEOS VOS_NT_WINDOWS32
|
||||||
|
@ -20,12 +20,12 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Jce Manager\0"
|
VALUE "CompanyName", "Jce Manager\0"
|
||||||
VALUE "FileDescription", "\0"
|
VALUE "FileDescription", "\0"
|
||||||
VALUE "FileVersion", "1.0.0\0"
|
VALUE "FileVersion", "1.1.0\0"
|
||||||
VALUE "InternalName", "jceManager\0"
|
VALUE "InternalName", "jceManager\0"
|
||||||
VALUE "LegalCopyright", "Jce Manager Team, liranbg@gmail.com\0"
|
VALUE "LegalCopyright", "Jce Manager Team, liranbg@gmail.com\0"
|
||||||
VALUE "OriginalFilename", "jceManager\0"
|
VALUE "OriginalFilename", "jceManager\0"
|
||||||
VALUE "ProductName", "Jce Manager\0"
|
VALUE "ProductName", "Jce Manager\0"
|
||||||
VALUE "ProductVersion", "1.0.0\0"
|
VALUE "ProductVersion", "1.1.0\0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|