diff --git a/main/CalendarTab/CalendarManager.cpp b/main/CalendarTab/CalendarManager.cpp
index ec2816d..403143c 100644
--- a/main/CalendarTab/CalendarManager.cpp
+++ b/main/CalendarTab/CalendarManager.cpp
@@ -19,6 +19,10 @@ void CalendarManager::setExamsSchedule(QString html)
{
examSchePtr->setPage(html);
examDialogPtr->initializingDataIntoTable();
+}
+
+void CalendarManager::showExamDialog()
+{
examDialogPtr->show();
}
void CalendarManager::exportCalendarCSV()
diff --git a/main/CalendarTab/CalendarManager.h b/main/CalendarTab/CalendarManager.h
index 182a527..e45430c 100644
--- a/main/CalendarTab/CalendarManager.h
+++ b/main/CalendarTab/CalendarManager.h
@@ -28,7 +28,7 @@ public:
void exportCalendarCSV();
void setCalendar(QString html);
void setExamsSchedule(QString html);
-
+ void showExamDialog();
void resetTable() { if (caliSchedPtr != NULL) caliSchedPtr->clearTableItems(); }
private:
diff --git a/main/CourseTab/coursestablemanager.cpp b/main/CourseTab/coursestablemanager.cpp
index da0d613..c60fa74 100644
--- a/main/CourseTab/coursestablemanager.cpp
+++ b/main/CourseTab/coursestablemanager.cpp
@@ -157,82 +157,84 @@ void coursesTableManager::addRow(const gradeCourse *courseToAdd)
c = courseToAdd;
if (!isCourseAlreadyInserted(c->getSerialNum()))
{
- courseTBL->setRowCount(courseTBL->rowCount() + 1);
- i = courseTBL->rowCount()-1;
+ courseTBL->setRowCount(courseTBL->rowCount() + 1);
+ i = courseTBL->rowCount()-1;
- number = new QTableWidgetItem();
- number->setData(Qt::EditRole, c->getCourseNumInList());
- number->setFlags(number->flags() & ~Qt::ItemIsEditable);
+ number = new QTableWidgetItem();
+ number->setData(Qt::EditRole, c->getCourseNumInList());
+ number->setFlags(number->flags() & ~Qt::ItemIsEditable);
- year = new QTableWidgetItem();
- year->setData(Qt::EditRole,c->getYear());
- year->setFlags(year->flags() & ~Qt::ItemIsEditable);
+ year = new QTableWidgetItem();
+ year->setData(Qt::EditRole,c->getYear());
+ year->setFlags(year->flags() & ~Qt::ItemIsEditable);
- semester = new QTableWidgetItem();
- semester->setData(Qt::EditRole,c->getSemester());
- semester->setFlags(semester->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);
+ 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);
+ 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);
+ 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);
+ 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);
+ hours = new QTableWidgetItem();
+ hours->setData(Qt::EditRole, c->getHours());
+ hours->setFlags(hours->flags() & ~Qt::ItemIsEditable);
- grade = new QTableWidgetItem();
- grade->setData(Qt::EditRole,c->getGrade());
+ grade = new QTableWidgetItem();
+ grade->setData(Qt::EditRole,c->getGrade());
- addition = new QTableWidgetItem();
- addition->setData(Qt::EditRole,c->getAddidtions());
+ 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);
- if(c->getGrade() < 55 && c->getGrade() != 0)
- {
- courseTBL->item(i, j)->setBackground(Qt::darkRed);
- courseTBL->item(i,j)->setTextColor(Qt::white);
- }
- else if(55 <= c->getGrade() && c->getGrade() < 70 )
- {
- courseTBL->item(i, j)->setBackground(Qt::darkYellow);
- courseTBL->item(i,j)->setTextColor(Qt::white);
- }
-// else if(70 < c->getGrade() && c->getGrade() <= 80 )
-// courseTBL->item(i, j)->setBackground(Qt::darkGreen); //They Look Bad!!
-// else if(c->getGrade() > 80)
-// courseTBL->item(i, j)->setBackground(Qt::green);
+ 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);
+ if(c->getGrade() < 55 && c->getGrade() != 0)
+ {
+ courseTBL->item(i, j)->setBackground(Qt::darkRed);
+ courseTBL->item(i,j)->setTextColor(Qt::white);
+ }
+ else if(55 <= c->getGrade() && c->getGrade() < 70 )
+ {
+ courseTBL->item(i, j)->setBackground(Qt::darkYellow);
+ courseTBL->item(i,j)->setTextColor(Qt::white);
+ }
+ // else if(70 < c->getGrade() && c->getGrade() <= 80 )
+ // courseTBL->item(i, j)->setBackground(Qt::darkGreen); //They Look Bad!!
+ // else if(c->getGrade() > 80)
+ // courseTBL->item(i, j)->setBackground(Qt::green);
- j++;
+ j++;
- courseTBL->setItem(i,j,addition);
+ courseTBL->setItem(i,j,addition);
}
}
else
{
- qCritical() << Q_FUNC_INFO << " no course to load!";
+ qCritical() << Q_FUNC_INFO << " no course to load!";
}
+
courseTBL->resizeColumnsToContents();
+ courseTBL->resizeRowsToContents();
}
double coursesTableManager::getAvg()
@@ -246,8 +248,8 @@ void coursesTableManager::showGraph()
{
if (gp != NULL)
{
- qDebug() << Q_FUNC_INFO << " Graph Dialog Opened. gp != NULL";
- this->graph->showGraph(gp);
+ qDebug() << Q_FUNC_INFO << " Graph Dialog Opened. gp != NULL";
+ this->graph->showGraph(gp);
}
}
diff --git a/main/LoginTab/loginhandler.cpp b/main/LoginTab/loginhandler.cpp
index c0c70e5..84b22d1 100644
--- a/main/LoginTab/loginhandler.cpp
+++ b/main/LoginTab/loginhandler.cpp
@@ -129,7 +129,7 @@ QString loginHandler::getCurrentPageContect()
if (isLoggedInFlag())
parse.setText(jceLog->getPage());
else
- throw jceLogin::ERROR_ON_GETTING_INFO;
+ return "";
return parse.toPlainText();
}
int loginHandler::makeGradeRequest(int fromYear, int toYear, int fromSemester, int toSemester)
diff --git a/main/mainscreen.cpp b/main/mainscreen.cpp
index 96e7988..67ad197 100644
--- a/main/mainscreen.cpp
+++ b/main/mainscreen.cpp
@@ -175,7 +175,6 @@ void MainScreen::on_ratesButton_clicked()
}
QApplication::restoreOverrideCursor();
}
-
bool MainScreen::checkIfValidDates()
{
bool flag = false;
@@ -199,28 +198,23 @@ void MainScreen::on_checkBoxCoursesInfluence_toggled(bool checked)
this->userLoginSetting->setInfluenceCourseOnly(checked);
this->courseTableMgr->influnceCourseChanged(checked);
}
-
void MainScreen::on_spinBoxCoursesFromYear_valueChanged(int arg1)
{
ui->spinBoxCoursesFromYear->setValue(arg1);
}
-
void MainScreen::on_spinBoxCoursesToYear_valueChanged(int arg1)
{
ui->spinBoxCoursesToYear->setValue(arg1);
}
-
void MainScreen::on_spinBoxCoursesFromSemester_valueChanged(int arg1)
{
ui->spinBoxCoursesFromSemester->setValue(arg1%4);
}
-
void MainScreen::on_spinBoxCoursesToSemester_valueChanged(int arg1)
{
ui->spinBoxCoursesToSemester->setValue(arg1%4);
}
-
void MainScreen::on_coursesTable_itemChanged(QTableWidgetItem *item)
{
if (this->courseTableMgr->changes(item->text(),item->row(),item->column()))
@@ -231,7 +225,6 @@ void MainScreen::on_coursesTable_itemChanged(QTableWidgetItem *item)
QMessageBox::critical(this,tr("Error"),tr("Missmatching data"));
}
}
-
void MainScreen::on_clearTableButton_clicked()
{
qDebug() << Q_FUNC_INFO << "in: " << ui->tabWidget->currentWidget()->objectName();
@@ -248,6 +241,11 @@ void MainScreen::on_graphButton_clicked()
//EVENTS ON CALENDAR TAB
void MainScreen::on_examsBtn_clicked()
+{
+ calendar->showExamDialog();
+
+}
+void MainScreen::on_getCalendarBtn_clicked()
{
ui->progressBar->setValue(0);
qDebug() << Q_FUNC_INFO << "in: " << ui->tabWidget->currentWidget()->objectName();
@@ -256,45 +254,38 @@ void MainScreen::on_examsBtn_clicked()
QApplication::setOverrideCursor(Qt::WaitCursor);
if (loginHandel->isLoggedInFlag())
{
- ui->statusBar->showMessage(tr("Getting exams..."));
- if ((status = loginHandel->makeExamsScheduleRequest(ui->spinBoxYear->value(),ui->spinBoxSemester->value())) == jceLogin::JCE_PAGE_PASSED)
+ ui->statusBar->showMessage(tr("Getting schedule..."));
+ if ((status = loginHandel->makeCalendarRequest(ui->spinBoxYear->value(),ui->spinBoxSemester->value())) == jceLogin::JCE_PAGE_PASSED)
{
- ui->statusBar->showMessage(tr("Done."),1000);
+ calendar->resetTable();
+ ui->statusBar->showMessage(tr("Done. Inserting schdule into table..."),1000);
page = loginHandel->getCurrentPageContect();
- calendar->setExamsSchedule(page);
- ui->progressBar->setValue(100);
- qDebug() << Q_FUNC_INFO << "exams schedule is loaded";
- ui->statusBar->showMessage(tr("Done"));
- }
- 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 << "exams request get ended with" << status;
- }
- QApplication::restoreOverrideCursor();
-}
-void MainScreen::on_getCalendarBtn_clicked()
-{
- ui->progressBar->setValue(0);
- qDebug() << Q_FUNC_INFO << "in: " << ui->tabWidget->currentWidget()->objectName();
- int status = 0;
- QString page;
- QApplication::setOverrideCursor(Qt::WaitCursor);
- if (loginHandel->isLoggedInFlag())
- {
- ui->statusBar->showMessage(tr("Getting schedule..."));
- if ((status = loginHandel->makeCalendarRequest(ui->spinBoxYear->value(),ui->spinBoxSemester->value())) == jceLogin::JCE_PAGE_PASSED)
+ calendar->setCalendar(page);
+
+ qDebug() << Q_FUNC_INFO << "calendar is loaded";
+
+ //auto getting exam
+ if (loginHandel->isLoggedInFlag())
{
- calendar->resetTable();
- ui->statusBar->showMessage(tr("Done. Inserting schdule into table..."),1000);
- page = loginHandel->getCurrentPageContect();
- calendar->setCalendar(page);
+ ui->statusBar->showMessage(tr("Getting exams..."));
+ if ((status = loginHandel->makeExamsScheduleRequest(ui->spinBoxYear->value(),ui->spinBoxSemester->value())) == jceLogin::JCE_PAGE_PASSED)
+ {
+ ui->statusBar->showMessage(tr("Done."),1000);
+ page = loginHandel->getCurrentPageContect();
+ calendar->setExamsSchedule(page);
+ qDebug() << Q_FUNC_INFO << "exams schedule is loaded";
+ }
+ 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 << "exams request get ended with" << status;
+
+
ui->progressBar->setValue(100);
- qDebug() << Q_FUNC_INFO << "calendar is loaded";
ui->statusBar->showMessage(tr("Done"));
}
else if (status == jceLogin::JCE_NOT_CONNECTED)
@@ -306,7 +297,8 @@ void MainScreen::on_getCalendarBtn_clicked()
else
qCritical() << Q_FUNC_INFO << "calendar get ended with" << status;
}
- QApplication::restoreOverrideCursor();
+ }
+ QApplication::restoreOverrideCursor();
}
void MainScreen::on_exportToCVSBtn_clicked()
{
diff --git a/main/mainscreen.h b/main/mainscreen.h
index 3f9a7f9..116c957 100644
--- a/main/mainscreen.h
+++ b/main/mainscreen.h
@@ -27,56 +27,42 @@ public:
private slots:
- void on_ratesButton_clicked();
-
+ //Login Tab slots
void on_loginButton_clicked();
-
+ void on_keepLogin_clicked();
void on_usrnmLineEdit_editingFinished();
- void on_actionCredits_triggered();
-
+ //GPA Tab slots
+ void on_ratesButton_clicked();
+ void on_graphButton_clicked();
void on_clearTableButton_clicked();
-
- void on_actionExit_triggered();
-
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);
+ //Schedule Tab slots
+ void on_getCalendarBtn_clicked();
+ void on_examsBtn_clicked();
void on_exportToCVSBtn_clicked();
+ //Menubar slots
+ void on_actionCredits_triggered();
+ void on_actionExit_triggered();
+ void on_actionHow_To_triggered();
void on_actionHebrew_triggered();
-
void on_actionEnglish_triggered();
-
void on_actionOS_Default_triggered();
+ //Main screen general slots
void on_spinBoxCoursesFromSemester_valueChanged(int arg1);
-
void on_spinBoxCoursesFromYear_valueChanged(int arg1);
-
void on_spinBoxCoursesToYear_valueChanged(int arg1);
-
void on_spinBoxCoursesToSemester_valueChanged(int arg1);
-
void on_labelMadeBy_linkActivated(const QString &link);
-
- void on_graphButton_clicked();
-
void on_progressBar_valueChanged(int value);
- void on_examsBtn_clicked();
-
private:
void checkLocale();
-
bool checkIfValidDates();
Ui::MainScreen *ui;
diff --git a/main/mainscreen.ui b/main/mainscreen.ui
index 4e24066..997f0a2 100644
--- a/main/mainscreen.ui
+++ b/main/mainscreen.ui
@@ -48,7 +48,7 @@ background: qlineargradient(spread:pad, x1:0.496, y1:0, x2:0.508, y2:1, stop:0 r
-
+
-
@@ -64,7 +64,7 @@ background: qlineargradient(spread:pad, x1:0.496, y1:0, x2:0.508, y2:1, stop:0 r
QTabWidget::Rounded
- 1
+ 0
false
@@ -119,7 +119,6 @@ background: qlineargradient(spread:pad, x1:0.496, y1:0, x2:0.508, y2:1, stop:0 r
#LoginFrame {
border: 3px solid rgb(160, 165, 170);
border-radius: 40px;
-
}
#loginButton {
color: white;
@@ -327,21 +326,290 @@ font-size: 15px;
0
-
-
-
-
- Qt::Horizontal
+
-
+
+
+
+ 0
+ 0
+
-
- QSizePolicy::Expanding
+
+ #frameTo {
+ border: 1px solids;
+ border-style: inset;
+ border-color: black;
+ border-radius: 10px;
+}
-
-
- 40
- 20
-
+
+ QFrame::StyledPanel
-
+
+ QFrame::Raised
+
+
+
+ 1
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 1
+
+ -
+
+
+ QLayout::SetDefaultConstraint
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+ Semester:
+
+
+
+ -
+
+
+ 1
+
+
+ 999
+
+
+ 3
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+ Year:
+
+
+
+ -
+
+
+ 2008
+
+
+ 2016
+
+
+ 2015
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+ <html><head/><body><p align="center">To</p></body></html>
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ #frameBtns {
+ border: 0px solids;
+}
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
+ 5
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 9
+
+
+ 0
+
+
-
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ 0
+
+
+ -1
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+ <html><head/><body><p><span style=" font-weight:600;">Clear table</span></p></body></html>
+
+
+ Clear Table
+
+
+
+ -
+
+
+ true
+
+
+
+ 0
+ 0
+
+
+
+ <html><head/><body><p><span style=" font-weight:600;">Get your grades</span></p></body></html>
+
+
+ Get GPA
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+
+
+
+ -
+
+
+ #frameMainCourses {
+ border: 0px solids;
+}
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+ Only Main Courses
+
+
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
-
@@ -353,9 +621,10 @@ font-size: 15px;
#frameFrom {
- border-width: 1px;
+ border: 1px solids;
border-style: inset;
border-color: black;
+ border-radius: 10px;
}
@@ -461,223 +730,8 @@ font-size: 15px;
- -
-
-
-
- 0
- 0
-
-
-
- #frameTo {
- border-width: 1px;
- border-style: inset;
- border-color: black;
-}
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
-
- 1
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 1
-
-
-
-
-
- QLayout::SetDefaultConstraint
-
-
-
-
-
-
- 0
- 0
-
-
-
-
-
-
- Year:
-
-
-
- -
-
-
- 2008
-
-
- 2016
-
-
- 2015
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
- Semester:
-
-
-
- -
-
-
- 1
-
-
- 999
-
-
- 3
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
- <html><head/><body><p align="center">To</p></body></html>
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
-
- 5
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 9
-
-
- 0
-
-
-
-
-
- true
-
-
- <html><head/><body><p><span style=" font-weight:600;">Get your grades</span></p></body></html>
-
-
- Get GPA
-
-
-
- -
-
-
- <html><head/><body><p><span style=" font-weight:600;">Clear table</span></p></body></html>
-
-
- Clear Table
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Only Main Courses
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Qt::RightToLeft
-
-
- QAbstractItemView::SingleSelection
-
-
- true
-
-
-
-
-
@@ -738,6 +792,25 @@ font-size: 15px;
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Qt::RightToLeft
+
+
+ QAbstractItemView::SingleSelection
+
+
+ true
+
+
+
@@ -782,7 +855,7 @@ font-size: 15px;
-
- Get Schedule
+ Get Schedule && Exam
@@ -823,13 +896,6 @@ font-size: 15px;
- -
-
-
- <p align="center">Made By <a href="http://liranbg.github.io/JceManager/"><span style=" text-decoration: underline; color:#0000ff;">JceManager</span></a></p>
-
-
-
-
@@ -869,6 +935,13 @@ background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 green, stop:
+ -
+
+
+ <p align="center">Made By <a href="http://liranbg.github.io/JceManager/"><span style=" text-decoration: underline; color:#0000ff;">JceManager</span></a></p>
+
+
+