From b25eaf91f13496722fe7a3f021f7fe5caa4cac6e Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Tue, 23 Sep 2014 12:26:37 +0300 Subject: [PATCH 1/2] Update README.md --- README.md | 74 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 5ab1628..b717582 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,59 @@ -jceManager 1.0.0 -==================== + + +

![Visit our Website!][logo]
Visit our Website!

-Compile with QT +--- - Launch, insert your JCE username and password.
- Once your logged in, go to GPA Tab and hit "ADD"
- Now you will see all your courses in a table content
-
- Edit your grade and see the average difference.
- - Thanks to
- +## The Vision & Muse +####We - The *"JCE Manager Team"* got tired of the cluttered and non-friendly Yedion Website. + +The data at the website is "static", and we wanted **more** functions regarding data manipulation. +After all its **our** data... + +for example, every semester we always needed to decide if we should take the chance and apply to another test. So, as all of us, we opened an excel spreadsheet and added formulas, and exhausting information... + +*JCE computer sys admin* didn't want to give us a public API, so we needed so hack the website. + +The project started as an [open API][openAPI] for the Yedion website, and rapidly changed to a full software! + +Now we can fetch our Grade-Sheet in one click and manipulate the grades to see our GPA. +There is no need to enter each and every course to our Google Calendar every Semester! One click and we can import all the calendar to Google... + +And we still have lots of ideas for future versions... + +--- + +## The Team +####*Just For Fun* + +The Founder of the idea [Liran Ben-Gida][liran] is the project manager. +[Sagi Dayan][sagi] is a full partner developer and the website maintainer. + +Both of us are Software Engineer Students at [JCE][jce]. And Develop the software for our fun on our spear time. and we don't have much of it... + +We have chosen to spread this useful tool to all students at no cost or any special requirements. Only, if possible, a feedback or a suggestion for optimization. + +The software is free and the source code is available to anyone who wants to look. + +--- + +## Join US +If you have some spear time, you know how to code (C++ / QT), and you are a friendly dude (Male / Female). +Head over to our [ Github page][github] and fork, send us a pull request ! + +Or file a Bug report to help us improve. + +## License +License under [GNU LESSER GENERAL PUBLIC LICENSE][gnu]. - Made by - - - - More to come. - check us at Jce Manager Developers +[gnu]: http://www.gnu.org/licenses/lgpl-2.1.html +[jce]: http://www.jce.ac.il/ +[github]: https://github.com/liranbg/JceManager +[sagi]: mailto:sagidayan@gmail.com +[liran]: mailto:liranbg@gmail.com +[openAPI]: https://github.com/liranbg/jceConnection +[logo]: http://liranbg.github.io/JceManager/assets/images/logo.png From 2a4b2452345b2904356a693eac3945a3d2c6dbe2 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Fri, 26 Sep 2014 23:00:40 +0300 Subject: [PATCH 2/2] Added some more documentation DocBlocks to all major functions. hope it helps... --- src/appDatabase/savedata.cpp | 73 ++++++++++++++++++++++++- src/jceData/CSV/csv_exporter.cpp | 9 ++- src/jceData/CSV/csv_exporter.h | 8 +++ src/jceData/Calendar/calendarDialog.cpp | 26 +++++++-- src/jceData/Calendar/calendarDialog.h | 9 +++ src/jceData/course.h | 3 +- src/jceData/page.h | 2 +- 7 files changed, 119 insertions(+), 11 deletions(-) diff --git a/src/appDatabase/savedata.cpp b/src/appDatabase/savedata.cpp index 107f7fa..bb0e439 100644 --- a/src/appDatabase/savedata.cpp +++ b/src/appDatabase/savedata.cpp @@ -20,6 +20,12 @@ SaveData::SaveData() load(); } +/** + * @brief This will check if the is data saved ie. username and password. + * the only way in JCE manager is to store a username and password together. therefore if there is + * a user name in the file, so there is a password ass well. + * @return true if the is a username in the file. (if not the username will be "") + */ bool SaveData::isSaved() { if(DB.value("username") == "") @@ -27,6 +33,14 @@ bool SaveData::isSaved() return true; } +/** + * @brief This void function will erase all data. QMap will be cleard and saved to the file. + * data thet will be deleted: + * # username + * # password + * # calendar + * # local + */ void SaveData::reset() { DB.clear(); @@ -34,52 +48,89 @@ void SaveData::reset() save(); } +/** + * @brief gest a username and saves it into the QMap. + * QMap then is saved to the file. + * @param username - users username from the mainwindow ui pointer. + */ void SaveData::setUsername(QString username) { DB.insert("username", username); save(); } +/** + * @brief gets a password, sends it to encyption, and saves the encrypter password to QMap. + * saves the QMap into the file. + * @param password - raw password (not encrypted) + */ void SaveData::setPassword(QString password) { DB.insert("password", encrypt(password)); save(); } +/** + * @brief gest a calendar and saves it into the QMap. + * QMap then is saved to the file. + * @param cal - last calendar that user seen + */ void SaveData::setCal(QString cal) { DB.insert("calendar", cal); save(); } +/** + * @brief gest a local and saves it into the QMap. + * QMap then is saved to the file. + * @param local - QString (he, en, default) + */ void SaveData::setLocal(QString local) { DB.insert("local", local); save(); } +/** + * @brief read from file + * @return - username + */ QString SaveData::getUsername() { return DB.value("username"); } +/** + * @brief read from file + * @return - unencrypted password + */ QString SaveData::getPassword() { return decrypte(DB.value("password")); } +/** + * @brief read from file + * @return local + */ QString SaveData::getLocal() { return DB.value("local"); } +/** + * @brief read from file + * @return calendar + */ QString SaveData::getCal() { return DB.value("calendar"); } - - +/** + * @brief read from file the QMap object into the DB inside "this" object. + */ void SaveData::load() { QFile file(FILE_NAME); @@ -89,6 +140,9 @@ void SaveData::load() file.close(); } +/** + * @brief Saves the QMap to the file. overriding the content of the file. + */ void SaveData::save() { QFile file(FILE_NAME); @@ -99,6 +153,9 @@ void SaveData::save() file.close(); } +/** + * @brief Creates en empty tamplate for QMap (use only on init! if there is no file.) + */ void SaveData::createDB() { DB.insert("username", ""); @@ -107,12 +164,24 @@ void SaveData::createDB() DB.insert("calendar", ""); } +/** + * @brief this function will connect this class to the simplecrypt class. + * sends the raw password to encryption and returns the encrypted one. + * @param pass - raw password. + * @return encrypted password. + */ QString SaveData::encrypt(QString pass) { SimpleCrypt crypto(Q_UINT64_C(0x0c2ad4a4acb9f027)); return crypto.encryptToString(pass); } +/** + * @brief this function will connect this class to the simplecrypt class. + * sends the encrypted password to decryption and returns the raw one. + * @param pass - encrypted password. + * @return raw password. + */ QString SaveData::decrypte(QString pass) { SimpleCrypt crypto(Q_UINT64_C(0x0c2ad4a4acb9f027)); diff --git a/src/jceData/CSV/csv_exporter.cpp b/src/jceData/CSV/csv_exporter.cpp index a5fb2ef..a79385c 100644 --- a/src/jceData/CSV/csv_exporter.cpp +++ b/src/jceData/CSV/csv_exporter.cpp @@ -124,7 +124,7 @@ QString CSV_Exporter::getFileFath() * @param name * @param date * @param startH - * @param startM + * @param startM - Not used at the moment. * @param endH * @param endM * @param lecturer @@ -203,6 +203,13 @@ QString CSV_Exporter::makeLine(QString name, QDate *date, int startH, int startM return CSV_line; } +/** + * @brief The QDate.dayOfWeek() returns an integer as follows (Sunday = 7, monday = 1... Friday = 5) + * This method will make that return integer more uderstandble and easy to use with the Calander classes of + * JCE Manager. so Sunday = 1, Monday = 2 and so on... + * + * @param QtDay - A Qt dayOfWeek integer pointer. it will cange his value. + */ void CSV_Exporter::changeDayNumberFromQtToNormal(int *QtDay) { switch(*QtDay){ diff --git a/src/jceData/CSV/csv_exporter.h b/src/jceData/CSV/csv_exporter.h index 99218b7..52d8dc8 100644 --- a/src/jceData/CSV/csv_exporter.h +++ b/src/jceData/CSV/csv_exporter.h @@ -1,3 +1,11 @@ +/** + * This simple static class will generate a csv file of a given semester. + * + * the class wat written for the JCE Manager and exporting a calendar to Goolgle Calendar. + * + * this CSV file should also work for iCal and Outlook. but have not been tested. + * + */ #ifndef CSV_EXPORTER_H #define CSV_EXPORTER_H diff --git a/src/jceData/Calendar/calendarDialog.cpp b/src/jceData/Calendar/calendarDialog.cpp index 7bbeaf7..cf6be72 100644 --- a/src/jceData/Calendar/calendarDialog.cpp +++ b/src/jceData/Calendar/calendarDialog.cpp @@ -26,30 +26,42 @@ QDate CalendarDialog::getEndDate() return ui->calEnd->selectedDate(); } +/** + * @breif This method will return the state of the dates aka User input. + * @return true - if dates are valid, invalid false. + */ bool CalendarDialog::ok() { return this->isOK; } + +/** + * @breif A Slot - triggers when the start calendar widget is selected (Date changed by user) + * it will change the status label (ui->lbl_status) according to the users input. + */ void CalendarDialog::on_calStart_selectionChanged() { - if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate()) + if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate()) //User input is invalid { changeLabeStatusIcon(false); ui->lbl_status->setText(tr("The end of the semester can NOT be equal or before the semester begin.")); this->isOK = false; } - else + else // input is valid { changeLabeStatusIcon(true); - ui->lbl_status->setText(tr("Looks ok, Press OK")); + ui->lbl_status->setText(tr("Looks fine, Click \"OK\"")); this->isOK = true; } } +/** + * @breif A Slot triggerd when OK clicked + */ void CalendarDialog::on_buttonBox_accepted() { - if(ui->calStart->selectedDate() > ui->calEnd->selectedDate()) - qDebug() << "start is bigger than end!"; + if(this->isOK) + qDebug() << "CalendarDialog: Valid input"; } void CalendarDialog::on_calEnd_selectionChanged() @@ -69,6 +81,10 @@ void CalendarDialog::on_calEnd_selectionChanged() } +/** + * @breif changes the status icon according to the... status... smart huh? + * @param goodOrBad - self explained + */ void CalendarDialog::changeLabeStatusIcon(bool goodOrBad) { if (goodOrBad == true) //good date! diff --git a/src/jceData/Calendar/calendarDialog.h b/src/jceData/Calendar/calendarDialog.h index 1c7ee38..8d26ba0 100644 --- a/src/jceData/Calendar/calendarDialog.h +++ b/src/jceData/Calendar/calendarDialog.h @@ -1,3 +1,12 @@ +/** + * JCE Manager (C) + * + * This QDialog widget will 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 + * all the courses within that period of time. + */ + #ifndef CALENDARDIALOG_H #define CALENDARDIALOG_H diff --git a/src/jceData/course.h b/src/jceData/course.h index 22921bb..3c90351 100644 --- a/src/jceData/course.h +++ b/src/jceData/course.h @@ -3,8 +3,7 @@ /* This Code Made By Sagi Dayan * SagiDayan@gmail.com - * - * minor changes by Liran Ben Gida + * & Liran Ben Gida * LiranBG@gmail.com */ diff --git a/src/jceData/page.h b/src/jceData/page.h index 1facc9f..2651366 100644 --- a/src/jceData/page.h +++ b/src/jceData/page.h @@ -4,7 +4,7 @@ /* This Code Made By Sagi Dayan * SagiDayan@gmail.com * - * Changes has been made by Liran Ben Gida + * Changes have been made by Liran Ben Gida * LiranBG@gmail.com */ #include