diff --git a/jceGrade.pro.user b/jceGrade.pro.user
index c29c631..f606ccd 100644
--- a/jceGrade.pro.user
+++ b/jceGrade.pro.user
@@ -1,7 +1,11 @@
-
+
+
+ EnvironmentId
+ {27d037c7-80c2-4adc-9ebd-7fcaa787aa69}
+
ProjectExplorer.Project.ActiveTarget
0
@@ -54,14 +58,14 @@
ProjectExplorer.Project.Target.0
- Desktop Qt 5.3.0 MinGW 32bit
- Desktop Qt 5.3.0 MinGW 32bit
- qt.53.win32_mingw482_kit
+ Desktop
+ Desktop
+ {5099a051-769d-496c-9c12-be2a0d9569cf}
0
0
0
- D:/Dropbox/cpp/jceConQT/build-jceGrade-Desktop_Qt_5_3_0_MinGW_32bit-Debug
+ /home/sagi/Development/SocialDev/build-jceGrade-Desktop-Debug
true
@@ -78,7 +82,10 @@
Make
Qt4ProjectManager.MakeStep
-
+
+ -w
+ -r
+
false
@@ -94,7 +101,10 @@
Make
Qt4ProjectManager.MakeStep
-
+
+ -w
+ -r
+
true
clean
@@ -114,7 +124,7 @@
true
- D:/Dropbox/cpp/jceConQT/build-jceGrade-Desktop_Qt_5_3_0_MinGW_32bit-Release
+ /home/sagi/Development/SocialDev/build-jceGrade-Desktop-Release
true
@@ -131,7 +141,10 @@
Make
Qt4ProjectManager.MakeStep
-
+
+ -w
+ -r
+
false
@@ -147,7 +160,10 @@
Make
Qt4ProjectManager.MakeStep
-
+
+ -w
+ -r
+
true
clean
@@ -220,7 +236,7 @@
jceGrade
- Qt4ProjectManager.Qt4RunConfiguration:D:/Dropbox/cpp/jceConQT/jceAverageCalculator/jceGrade.pro
+ Qt4ProjectManager.Qt4RunConfiguration:/home/sagi/Development/SocialDev/jceAverageCalculator/jceGrade.pro
jceGrade.pro
false
@@ -241,11 +257,11 @@
1
- ProjectExplorer.Project.Updater.EnvironmentId
- {f3f3b933-8225-47b3-aa78-fc5de0bd714b}
+ ProjectExplorer.Project.Updater.FileVersion
+ 16
- ProjectExplorer.Project.Updater.FileVersion
- 15
+ Version
+ 16
diff --git a/jceGrade.pro.user.3.2-pre1 b/jceGrade.pro.user.3.2-pre1
new file mode 100644
index 0000000..c29c631
--- /dev/null
+++ b/jceGrade.pro.user.3.2-pre1
@@ -0,0 +1,251 @@
+
+
+
+
+
+ ProjectExplorer.Project.ActiveTarget
+ 0
+
+
+ ProjectExplorer.Project.EditorSettings
+
+ true
+ false
+ true
+
+ Cpp
+
+ CppGlobal
+
+
+
+ QmlJS
+
+ QmlJSGlobal
+
+
+ 2
+ UTF-8
+ false
+ 4
+ false
+ 80
+ true
+ true
+ 1
+ true
+ false
+ 0
+ true
+ 0
+ 8
+ true
+ 1
+ true
+ true
+ true
+ false
+
+
+
+ ProjectExplorer.Project.PluginSettings
+
+
+
+ ProjectExplorer.Project.Target.0
+
+ Desktop Qt 5.3.0 MinGW 32bit
+ Desktop Qt 5.3.0 MinGW 32bit
+ qt.53.win32_mingw482_kit
+ 0
+ 0
+ 0
+
+ D:/Dropbox/cpp/jceConQT/build-jceGrade-Desktop_Qt_5_3_0_MinGW_32bit-Debug
+
+
+ true
+ qmake
+
+ QtProjectManager.QMakeBuildStep
+ false
+ true
+
+ false
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ false
+
+
+
+ 2
+ Build
+
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ true
+ clean
+
+
+ 1
+ Clean
+
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ Debug
+
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 2
+ true
+
+
+ D:/Dropbox/cpp/jceConQT/build-jceGrade-Desktop_Qt_5_3_0_MinGW_32bit-Release
+
+
+ true
+ qmake
+
+ QtProjectManager.QMakeBuildStep
+ false
+ true
+
+ false
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ false
+
+
+
+ 2
+ Build
+
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ true
+ clean
+
+
+ 1
+ Clean
+
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ Release
+
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 0
+ true
+
+ 2
+
+
+ 0
+ Deploy
+
+ ProjectExplorer.BuildSteps.Deploy
+
+ 1
+ Deploy locally
+
+ ProjectExplorer.DefaultDeployConfiguration
+
+ 1
+
+
+
+ false
+ false
+ false
+ false
+ true
+ 0.01
+ 10
+ true
+ 1
+ 25
+
+ 1
+ true
+ false
+ true
+ valgrind
+
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+
+ 2
+
+ jceGrade
+
+ Qt4ProjectManager.Qt4RunConfiguration:D:/Dropbox/cpp/jceConQT/jceAverageCalculator/jceGrade.pro
+
+ jceGrade.pro
+ false
+ false
+
+ 3768
+ false
+ true
+ false
+ false
+ true
+
+ 1
+
+
+
+ ProjectExplorer.Project.TargetCount
+ 1
+
+
+ ProjectExplorer.Project.Updater.EnvironmentId
+ {f3f3b933-8225-47b3-aa78-fc5de0bd714b}
+
+
+ ProjectExplorer.Project.Updater.FileVersion
+ 15
+
+
diff --git a/main/mainscreen.cpp b/main/mainscreen.cpp
index 39a3925..3d29cf1 100644
--- a/main/mainscreen.cpp
+++ b/main/mainscreen.cpp
@@ -32,13 +32,14 @@ MainScreen::MainScreen(QWidget *parent) :QMainWindow(parent), ui(new Ui::MainScr
this->courseTableMgr = new coursesTableManager(ui->coursesTable,userLoginSetting);
this->loginHandel = new loginHandler(userLoginSetting);
this->calendar = new CalendarManager(ui->calendartext);
+ this->data = new SaveData();
//check login File
- SaveData::init();
- if (SaveData::isSaved())
+ //SaveData::init(); --> No need. constructor dose everything.
+ if (data->isSaved())
{
- ui->usrnmLineEdit->setText(SaveData::getUsername());
- ui->pswdLineEdit->setText(SaveData::getPassword());
+ ui->usrnmLineEdit->setText(data->getUsername());
+ ui->pswdLineEdit->setText(data->getPassword());
ui->keepLogin->setChecked(true);
}
}
@@ -48,6 +49,9 @@ MainScreen::~MainScreen()
delete userLoginSetting;
delete loginHandel;
delete ui;
+
+ //Delete save data
+ delete data;
}
void MainScreen::on_loginButton_clicked()
{
@@ -261,10 +265,12 @@ void MainScreen::on_actionExit_triggered()
void MainScreen::on_keepLogin_clicked()
{
if (ui->keepLogin->isChecked())
- SaveData::save(ui->usrnmLineEdit->text(),ui->pswdLineEdit->text());
-
+ {
+ data->setUsername(ui->usrnmLineEdit->text());
+ data->setPassword(ui->pswdLineEdit->text());
+ }
else
- SaveData::deleteData();
+ data->reset();
}
void MainScreen::on_actionHow_To_triggered()
diff --git a/main/mainscreen.h b/main/mainscreen.h
index ddf79c3..2ea31d2 100644
--- a/main/mainscreen.h
+++ b/main/mainscreen.h
@@ -68,7 +68,7 @@ private:
Ui::MainScreen *ui;
user *userLoginSetting;
-
+ SaveData *data;
CalendarManager * calendar;
coursesTableManager *courseTableMgr;
loginHandler *loginHandel;
diff --git a/src/appDatabase/savedata.cpp b/src/appDatabase/savedata.cpp
index 0f1dbfd..edb1815 100644
--- a/src/appDatabase/savedata.cpp
+++ b/src/appDatabase/savedata.cpp
@@ -6,7 +6,7 @@
* if there is no file, it will create it and run the deleteData function
* so tags will be set.
*/
-void SaveData::init()
+SaveData::SaveData()
{
QFile file(FILE_NAME);
if(!file.exists())
@@ -27,34 +27,34 @@ bool SaveData::isSaved()
return true;
}
-bool SaveData::reset()
+void SaveData::reset()
{
DB.clear();
createDB();
save();
}
-QString SaveData::setUsername(QString username)
+void SaveData::setUsername(QString username)
{
- DB.value("username") = username;
+ DB.insert("username", username);
save();
}
-QString SaveData::setPassword(QString password)
+void SaveData::setPassword(QString password)
{
- DB.value("password") = password;
+ DB.insert("password", password);
save();
}
-QString SaveData::setCal(QString cal)
+void SaveData::setCal(QString cal)
{
- DB.value("calendar") = cal;
+ DB.insert("calendar", cal);
save();
}
-QString SaveData::setLocal(QString local)
+void SaveData::setLocal(QString local)
{
- DB.value("local") = local;
+ DB.insert("local", local);
save();
}
diff --git a/src/appDatabase/savedata.h b/src/appDatabase/savedata.h
index df1d7c4..3952e22 100644
--- a/src/appDatabase/savedata.h
+++ b/src/appDatabase/savedata.h
@@ -35,23 +35,23 @@
class SaveData
{
public:
- void static init();
- bool static isSaved();
- bool static reset();
- QString static setUsername(QString username);
- QString static setPassword(QString password);
- QString static setCal(QString cal);
- QString static setLocal(QString local);
- QString static getUsername();
- QString static getPassword();
- QString static getCal();
- QString static getLocal();
+ SaveData();
+ bool isSaved();
+ void reset();
+ void setUsername(QString username);
+ void setPassword(QString password);
+ void setCal(QString cal);
+ void setLocal(QString local);
+ QString getUsername();
+ QString getPassword();
+ QString getCal();
+ QString getLocal();
private:
QMap DB;
- void static load();
- void static save();
- void static createDB();
+ void load();
+ void save();
+ void createDB();
};
#endif // SAVEDATA_H
diff --git a/src/jceData/Page.h b/src/jceData/page.h
similarity index 100%
rename from src/jceData/Page.h
rename to src/jceData/page.h