diff --git a/jceGrade.pro.user b/jceGrade.pro.user
deleted file mode 100644
index 09074ff..0000000
--- a/jceGrade.pro.user
+++ /dev/null
@@ -1,251 +0,0 @@
-
-
-
-
-
- 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/CalendarTab/CalendarManager.cpp b/main/CalendarTab/CalendarManager.cpp
index e157e11..addeaac 100644
--- a/main/CalendarTab/CalendarManager.cpp
+++ b/main/CalendarTab/CalendarManager.cpp
@@ -5,24 +5,12 @@ CalendarManager::CalendarManager(calendarSchedule *ptr)
this->caliSchedPtr = ptr;
}
-void CalendarManager::exportCalendarCSV()
-{
- if(CSV_Exporter::exportCalendar(this->caliSchedPtr))
- {
- QMessageBox msgBox;
- msgBox.setText("
Exported Successfuly!
HaazZaA!!");
- msgBox.exec();
- }else
- {
- QMessageBox msgBox;
- msgBox.setIcon(QMessageBox::Critical);
- msgBox.setText("Something went wrong...
Maybe: - You Canceled
- Unable to save the File - try again
"
- "In case of a serious problem, please file a bug report.
thank you. OpenJCE teem");
- msgBox.exec();
- }
-}
-
void CalendarManager::setCalendar(std::string html)
{
caliSchedPtr->setPage(html);
}
+
+calendarSchedule *CalendarManager::getSch()
+{
+ return this->caliSchedPtr;
+}
diff --git a/main/CalendarTab/CalendarManager.h b/main/CalendarTab/CalendarManager.h
index 90083dc..e7a9737 100644
--- a/main/CalendarTab/CalendarManager.h
+++ b/main/CalendarTab/CalendarManager.h
@@ -3,9 +3,6 @@
#include "./src/jceData/Calendar/calendarPage.h"
#include "./src/jceData/Calendar/calendarSchedule.h"
-#include "./src/jceData/CSV/csv_exporter.h"
-
-#include
#include
class CalendarManager
@@ -16,10 +13,10 @@ public:
{
delete caliSchedPtr;
}
- void exportCalendarCSV();
+
void setCalendar(std::string html);
void resetTable() { if (caliSchedPtr != NULL) caliSchedPtr->clearTableItems(); }
-
+ calendarSchedule* getSch();
private:
calendarSchedule * caliSchedPtr;
};
diff --git a/main/LoginTab/loginhandler.cpp b/main/LoginTab/loginhandler.cpp
index 4beb8ae..5480bd7 100644
--- a/main/LoginTab/loginhandler.cpp
+++ b/main/LoginTab/loginhandler.cpp
@@ -85,11 +85,7 @@ bool loginHandler::makeConnection()
bool loginHandler::isLoggedInFlag()
{
- if (jceLog->isLoginFlag()) //checking connection and then if logged in
- return this->logggedInFlag;
- else
- this->setLoginFlag(false);
- return false;
+ return this->logggedInFlag;
}
void loginHandler::setLoginFlag(bool flag)
diff --git a/main/mainscreen.cpp b/main/mainscreen.cpp
index 19ed402..b7f4d6b 100644
--- a/main/mainscreen.cpp
+++ b/main/mainscreen.cpp
@@ -13,7 +13,6 @@ MainScreen::MainScreen(QWidget *parent) :QMainWindow(parent), ui(new Ui::MainScr
ui->pswdLineEdit->setEchoMode((QLineEdit::Password));
//Status Bar
- ui->actionEnglish->setChecked(true);
ui->statusBar->setStyleSheet("QStatusBar::item { border: 0px solid black };");
ButtomStatusLabel = new QLabel(this);
statusLabel = new QLabel(this);
@@ -53,6 +52,7 @@ MainScreen::~MainScreen()
delete userLoginSetting;
delete loginHandel;
delete ui;
+
//Delete save data
delete data;
}
@@ -60,16 +60,12 @@ void MainScreen::on_loginButton_clicked()
{
if (loginHandel->isLoggedInFlag())
uiSetDisconnectMode();
+
else
uiSetConnectMode();
-}
-void MainScreen::on_exportToCVSBtn_clicked()
-{
- if (loginHandel->isLoggedInFlag())
- this->calendar->exportCalendarCSV();
}
-void MainScreen::on_getCalendarBtn_clicked()
+void MainScreen::on_pushButton_clicked()
{
int status = 0;
if (loginHandel->isLoggedInFlag())
@@ -78,7 +74,7 @@ void MainScreen::on_getCalendarBtn_clicked()
{
//Use it for debug. add plain text and change the object name to 'plainTextEdit' so you will get the html request
//ui->plainTextEdit->setPlainText(loginHandel->getCurrentPageContect());
- calendar->resetTable();
+ calendar->resetTable();
calendar->setCalendar(loginHandel->getCurrentPageContect().toStdString());
}
@@ -106,6 +102,9 @@ void MainScreen::on_ratesButton_clicked()
QMessageBox::critical(this,tr("Error"),tr("Not Connected"));
}
}
+
+
+
}
void MainScreen::on_checkBoxCoursesInfluence_toggled(bool checked)
{
@@ -175,9 +174,7 @@ void MainScreen::uiSetDisconnectMode()
loginHandel->makeDisconnectionRequest();
ui->loginButton->setText("&Login");
- ui->ratesButton->setDisabled(true);
- ui->exportToCVSBtn->setDisabled(true);
- ui->getCalendarBtn->setDisabled(true);
+ this->ui->ratesButton->setDisabled(true);
return;
}
@@ -206,12 +203,9 @@ void MainScreen::uiSetConnectMode() //fix before distrbute
{
setLabelConnectionStatus(jceLogin::jceStatus::JCE_YOU_ARE_IN);
ui->loginButton->setText("&Logout");
- ui->ratesButton->setEnabled(true);
+ this->ui->ratesButton->setEnabled(true);
ui->CoursesTab->setEnabled(true);
- ui->exportToCVSBtn->setEnabled(true);
- ui->getCalendarBtn->setEnabled(true);
-
}
else
{
@@ -252,6 +246,10 @@ void MainScreen::on_actionCredits_triggered()
""
+ +tr("Tnks")+ "... :"
+ "");
}
@@ -294,30 +292,19 @@ void MainScreen::on_actionHow_To_triggered()
}
-void MainScreen::on_actionHebrew_triggered()
+void MainScreen::on_pushButton_2_clicked()
{
- if (ui->actionEnglish->isChecked())
+ if(CSV_Exporter::exportCalendar(this->calendar->getSch()))
{
- ui->actionEnglish->setChecked(false);
- qDebug() << "Changed Language";
- }
- else
+ QMessageBox msgBox;
+ msgBox.setText("Exported Successfuly!
HaazZaA!!");
+ msgBox.exec();
+ }else
{
- ui->actionHebrew->setChecked(true);
- qDebug() << "Set Hebrew Language: ";
- }
-}
-
-void MainScreen::on_actionEnglish_triggered()
-{
- if (ui->actionHebrew->isChecked())
- {
- ui->actionHebrew->setChecked(false);
- qDebug() << "Changed Language";
- }
- else
- {
- ui->actionEnglish->setChecked(true);
- qDebug() << "Set English Language: ";
+ QMessageBox msgBox;
+ msgBox.setIcon(QMessageBox::Critical);
+ msgBox.setText("Something went wrong...
Maybe: - You Canceled
- Unable to save the File - try again
"
+ "In case of a serious problem, please file a bug report.
thank you. OpenJCE teem");
+ msgBox.exec();
}
}
diff --git a/main/mainscreen.h b/main/mainscreen.h
index 5b05ba4..0c68e4b 100644
--- a/main/mainscreen.h
+++ b/main/mainscreen.h
@@ -13,6 +13,7 @@
#include "./CourseTab/coursestablemanager.h"
#include "./LoginTab/loginhandler.h"
#include "./CalendarTab/CalendarManager.h"
+#include "../src/jceData/CSV/csv_exporter.h"
#define StatusIconHeight 35
namespace Ui {
@@ -55,15 +56,11 @@ private slots:
void on_actionHow_To_triggered();
+ void on_pushButton_clicked();
+
void on_checkBoxCoursesInfluence_toggled(bool checked);
- void on_exportToCVSBtn_clicked();
-
- void on_getCalendarBtn_clicked();
-
- void on_actionHebrew_triggered();
-
- void on_actionEnglish_triggered();
+ void on_pushButton_2_clicked();
private:
diff --git a/main/mainscreen.ui b/main/mainscreen.ui
index 0132891..a9c42a5 100644
--- a/main/mainscreen.ui
+++ b/main/mainscreen.ui
@@ -582,20 +582,14 @@ font-size: 15px;
-
-
-
- false
-
+
Get Calendar
-
-
-
- false
-
+
Export to CSV
@@ -632,21 +626,13 @@ font-size: 15px;
0
0
855
- 21
+ 29
diff --git a/src/jceData/CSV/csv_exporter.cpp b/src/jceData/CSV/csv_exporter.cpp
index b7f9ab9..dc2159e 100644
--- a/src/jceData/CSV/csv_exporter.cpp
+++ b/src/jceData/CSV/csv_exporter.cpp
@@ -7,8 +7,6 @@ CSV_Exporter::CSV_Exporter()
bool CSV_Exporter::exportCalendar(calendarSchedule *calSched)
{
- if (calSched == NULL)
- return false;
qDebug() << "Getting path for csv file from user...";
QString filePath = getFileFath();
if(filePath == NULL) //User canceled
@@ -42,10 +40,6 @@ bool CSV_Exporter::exportCalendar(calendarSchedule *calSched)
QString room = QString(coursePtr->getRoom().c_str());
QString line = makeLine(name, day, startH, startM, endH, endM, lecturer, room, type);
-#ifndef Q_OS_WIN32
- if(line != NULL)
- out << line << char(0x0D) << " ";
-#endif
if(line != NULL)
out << line << char(0x0A);
}
diff --git a/src/jceData/Calendar/calendarCourse.cpp b/src/jceData/Calendar/calendarCourse.cpp
index 0296266..8e534b5 100644
--- a/src/jceData/Calendar/calendarCourse.cpp
+++ b/src/jceData/Calendar/calendarCourse.cpp
@@ -107,7 +107,7 @@ std::string calendarCourse::courseToString()
courseText += " " + this->lecturer;
courseText += " " + std::to_string(this->getPoints());
courseText += " " + std::to_string(this->semesterHours);
- courseText += " " + std::to_string(this->day);
+ courseText += " " + this->day;
courseText += " " + std::to_string(this->hourBegin) + ":" + std::to_string(this->minutesBegin) + "-" + std::to_string(this->hourEnd) + ":" + std::to_string(this->minutesEnd);
courseText += " " + this->room;
courseText += "\n";
diff --git a/src/jceSettings/jcelogin.cpp b/src/jceSettings/jcelogin.cpp
index b666e76..161cdea 100644
--- a/src/jceSettings/jcelogin.cpp
+++ b/src/jceSettings/jcelogin.cpp
@@ -82,7 +82,7 @@ void jceLogin::makeConnection() throw (jceStatus)
}
-bool jceLogin::checkConnection() const
+bool jceLogin::checkConnection()
{
if (JceConnector->isConnected())
return true;
@@ -187,9 +187,7 @@ void jceLogin::setLoginFlag(bool x)
}
bool jceLogin::isLoginFlag() const
{
- if (checkConnection())
- return this->loginFlag;
- return false;
+ return this->loginFlag;
}
std::string jceLogin::getPage()
diff --git a/src/jceSettings/jcelogin.h b/src/jceSettings/jcelogin.h
index d861d6d..dfcb593 100644
--- a/src/jceSettings/jcelogin.h
+++ b/src/jceSettings/jcelogin.h
@@ -30,7 +30,7 @@ public:
jceLogin(user* username);
~jceLogin();
void makeConnection() throw (jceStatus);
- bool checkConnection() const;
+ bool checkConnection();
void reConnect() throw (jceStatus);
void closeAll();
int getCalendar(int year, int semester);