This commit is contained in:
liranbg 2014-09-27 01:41:13 +03:00
commit 16704db667
8 changed files with 171 additions and 33 deletions

View file

@ -1,29 +1,59 @@
jceManager 1.0.0
====================
<p align="center"><a href="http://liranbg.github.io/JceManager/">![Visit our Website!][logo]<br>Visit our Website!</a></p>
Compile with QT
---
Launch, insert your JCE username and password.<br>
Once your logged in, go to GPA Tab and hit "ADD"<br>
Now you will see all your courses in a table content<br>
<br>
Edit your grade and see the average difference.<br>
Thanks to <br>
<ul>
<li><a href='mailto:sagidayan@gmail.com'>Sagi Dayan</a></li>
<li><a href='mailto:nadav2051@gmail.com'>Nadav Luzzato</a></li>
</ul>
## <i class="fa fa-cogs"></i> 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...
---
## <i class="fa fa-users"></i> 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.
---
## <i class="fa fa-plus-square-o"></i> 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 [<i class="fa fa-github"></i> Github page][github] and fork, send us a pull request !
Or file a <i class="fa fa-bug"></i> Bug report to help us improve.
## <i class="fa fa-gavel"></i> License
License under [GNU LESSER GENERAL PUBLIC LICENSE][gnu].
Made by
<ul>
<li><a href='mailto:liranbg@gmail.com'>Liran Ben Gida</a></li>
</ul>
More to come.
check us at <a href='http://liranbg.github.io/JceManager'>Jce Manager Developers</a>
[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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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