fix dates validation. remove debugging in page
This commit is contained in:
parent
03a75ab737
commit
13eef8a2ed
4 changed files with 59 additions and 59 deletions
|
@ -28,7 +28,6 @@ MainScreen::MainScreen(QWidget *parent) :QMainWindow(parent), ui(new Ui::MainScr
|
||||||
//Course, Setting, Calendar Tab
|
//Course, Setting, Calendar Tab
|
||||||
calendarSchedule * calendarSchedulePtr = new calendarSchedule();
|
calendarSchedule * calendarSchedulePtr = new calendarSchedule();
|
||||||
ui->calendarGridLayoutMain->addWidget(calendarSchedulePtr);
|
ui->calendarGridLayoutMain->addWidget(calendarSchedulePtr);
|
||||||
ui->CoursesTab->setDisabled(true);
|
|
||||||
ui->avgLCD->setPalette(QPalette(QPalette::WindowText,Qt::blue));
|
ui->avgLCD->setPalette(QPalette(QPalette::WindowText,Qt::blue));
|
||||||
|
|
||||||
//Pointer allocating
|
//Pointer allocating
|
||||||
|
@ -181,6 +180,12 @@ void MainScreen::uiSetConnectMode()
|
||||||
//EVENTS ON GPA TAB
|
//EVENTS ON GPA TAB
|
||||||
void MainScreen::on_ratesButton_clicked()
|
void MainScreen::on_ratesButton_clicked()
|
||||||
{
|
{
|
||||||
|
if (!checkIfValidDates())
|
||||||
|
{
|
||||||
|
qWarning() << "MainScreen::on_ratesButton_clicked; Invalid dates! ";
|
||||||
|
QMessageBox::critical(this,tr("Error"),tr("Invalid Dates.\nMake Sure everything is correct and try again"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
QString pageString;
|
QString pageString;
|
||||||
int status = 0;
|
int status = 0;
|
||||||
if (loginHandel->isLoggedInFlag())
|
if (loginHandel->isLoggedInFlag())
|
||||||
|
@ -197,50 +202,44 @@ void MainScreen::on_ratesButton_clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
bool MainScreen::checkIfValidDates()
|
||||||
|
{
|
||||||
|
bool flag = false;
|
||||||
|
if (ui->spinBoxCoursesFromYear->value() < ui->spinBoxCoursesToYear->value())
|
||||||
|
{
|
||||||
|
//doesnt matter what is the semester, its valid!
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
else if ((ui->spinBoxCoursesFromYear->value() == ui->spinBoxCoursesToYear->value()))
|
||||||
|
{
|
||||||
|
//semester from must be equal or less than to semester
|
||||||
|
if (ui->spinBoxCoursesFromSemester->value() <= ui->spinBoxCoursesToSemester->value())
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
void MainScreen::on_checkBoxCoursesInfluence_toggled(bool checked)
|
void MainScreen::on_checkBoxCoursesInfluence_toggled(bool checked)
|
||||||
{
|
{
|
||||||
this->userLoginSetting->setInfluenceCourseOnly(checked);
|
this->userLoginSetting->setInfluenceCourseOnly(checked);
|
||||||
this->courseTableMgr->influnceCourseChanged(checked);
|
this->courseTableMgr->influnceCourseChanged(checked);
|
||||||
}
|
}
|
||||||
void MainScreen::on_spinBoxCoursesFromYear_editingFinished()
|
void MainScreen::on_spinBoxCoursesFromYear_valueChanged(int arg1)
|
||||||
{
|
{
|
||||||
if (ui->spinBoxCoursesFromYear->value() > ui->spinBoxCoursesToYear->value())
|
ui->spinBoxCoursesFromYear->setValue(arg1);
|
||||||
{
|
}
|
||||||
ui->spinBoxCoursesFromYear->setValue(ui->spinBoxCoursesToYear->value());
|
|
||||||
ui->spinBoxCoursesFromYear->setFocus();
|
void MainScreen::on_spinBoxCoursesToYear_valueChanged(int arg1)
|
||||||
}
|
{
|
||||||
|
ui->spinBoxCoursesToYear->setValue(arg1);
|
||||||
|
|
||||||
}
|
}
|
||||||
void MainScreen::on_spinBoxCoursesToYear_editingFinished()
|
void MainScreen::on_spinBoxCoursesFromSemester_valueChanged(int arg1)
|
||||||
{
|
{
|
||||||
if (ui->spinBoxCoursesFromYear->value() > ui->spinBoxCoursesToYear->value())
|
ui->spinBoxCoursesFromSemester->setValue(arg1%4);
|
||||||
{
|
|
||||||
ui->spinBoxCoursesToYear->setValue(ui->spinBoxCoursesFromYear->value());
|
|
||||||
ui->spinBoxCoursesToYear->setFocus();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
void MainScreen::on_spinBoxCoursesFromSemester_editingFinished()
|
void MainScreen::on_spinBoxCoursesToSemester_valueChanged(int arg1)
|
||||||
{
|
{
|
||||||
if (ui->spinBoxCoursesFromYear->value() == ui->spinBoxCoursesToYear->value())
|
ui->spinBoxCoursesToSemester->setValue(arg1%4);
|
||||||
{
|
|
||||||
if (ui->spinBoxCoursesFromSemester->value() > ui->spinBoxCoursesToSemester->value())
|
|
||||||
{
|
|
||||||
ui->spinBoxCoursesFromSemester->setValue(ui->spinBoxCoursesToSemester->value());
|
|
||||||
ui->spinBoxCoursesFromSemester->setFocus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void MainScreen::on_spinBoxCoursesToSemester_editingFinished()
|
|
||||||
{
|
|
||||||
if (ui->spinBoxCoursesFromYear->value() == ui->spinBoxCoursesToYear->value())
|
|
||||||
{
|
|
||||||
if (ui->spinBoxCoursesFromSemester->value() > ui->spinBoxCoursesToSemester->value())
|
|
||||||
{
|
|
||||||
ui->spinBoxCoursesToSemester->setValue(ui->spinBoxCoursesFromSemester->value());
|
|
||||||
ui->spinBoxCoursesToSemester->setFocus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
void MainScreen::on_coursesTable_itemChanged(QTableWidgetItem *item)
|
void MainScreen::on_coursesTable_itemChanged(QTableWidgetItem *item)
|
||||||
{
|
{
|
||||||
|
@ -291,13 +290,13 @@ void MainScreen::on_actionCredits_triggered()
|
||||||
QMessageBox::about(this, "About", tr("CREDITS-ROOL-UP1") + " v1.0<br><br>"
|
QMessageBox::about(this, "About", tr("CREDITS-ROOL-UP1") + " v1.0<br><br>"
|
||||||
+ tr("CREDITS-ROOL-UP2")+"<br>GNU LESSER GENERAL PUBLIC LICENSE V2<br>"
|
+ tr("CREDITS-ROOL-UP2")+"<br>GNU LESSER GENERAL PUBLIC LICENSE V2<br>"
|
||||||
+ tr("CREDITS-ROOL-UP3")+"<br>"
|
+ tr("CREDITS-ROOL-UP3")+"<br>"
|
||||||
"<a href='https://github.com/liranbg/jceAverageCalculator'>jceAverageCalculator Repository</a>"
|
"<a href='https://github.com/liranbg/jceAverageCalculator'>jceAverageCalculator Repository</a>"
|
||||||
"<br><br>"+tr("CREDITS-ROOL-UP4")+"<a href='https://github.com/liranbg/jceConnection'> Jce Connection</a><br><br>"
|
"<br><br>"+tr("CREDITS-ROOL-UP4")+"<a href='https://github.com/liranbg/jceConnection'> Jce Connection</a><br><br>"
|
||||||
+tr("DevBy")+":"
|
+tr("DevBy")+":"
|
||||||
"<ul>"
|
"<ul>"
|
||||||
"<li><a href='mailto:liranbg@gmail.com'>"+tr("Liran")+"</a></li>"
|
"<li><a href='mailto:liranbg@gmail.com'>"+tr("Liran")+"</a></li>"
|
||||||
"<li><a href='mailto:sagidayan@gmail.com'>"+tr("Sagi")+"</a></li>"
|
"<li><a href='mailto:sagidayan@gmail.com'>"+tr("Sagi")+"</a></li>"
|
||||||
"</ul>");
|
"</ul>");
|
||||||
}
|
}
|
||||||
void MainScreen::on_actionExit_triggered()
|
void MainScreen::on_actionExit_triggered()
|
||||||
{
|
{
|
||||||
|
@ -309,11 +308,11 @@ void MainScreen::on_actionHow_To_triggered()
|
||||||
"<b>How To..</b>"
|
"<b>How To..</b>"
|
||||||
"<ul>"
|
"<ul>"
|
||||||
"<br><li>"+tr("HELP1")+"</li>"
|
"<br><li>"+tr("HELP1")+"</li>"
|
||||||
"<br><li>"+tr("HELP2")+"</li>"
|
"<br><li>"+tr("HELP2")+"</li>"
|
||||||
"<br><li>"+tr("HELP3")+"</li>"
|
"<br><li>"+tr("HELP3")+"</li>"
|
||||||
"<br><li>"+tr("HELP4")+"</li>"
|
"<br><li>"+tr("HELP4")+"</li>"
|
||||||
"<br><li>"+tr("HELP5")+"</li>"
|
"<br><li>"+tr("HELP5")+"</li>"
|
||||||
"<br><br>"+tr("HELP6")+
|
"<br><br>"+tr("HELP6")+
|
||||||
"</ul>");
|
"</ul>");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,14 +32,6 @@ private slots:
|
||||||
|
|
||||||
void on_ratesButton_clicked();
|
void on_ratesButton_clicked();
|
||||||
|
|
||||||
void on_spinBoxCoursesFromYear_editingFinished();
|
|
||||||
|
|
||||||
void on_spinBoxCoursesFromSemester_editingFinished();
|
|
||||||
|
|
||||||
void on_spinBoxCoursesToYear_editingFinished();
|
|
||||||
|
|
||||||
void on_spinBoxCoursesToSemester_editingFinished();
|
|
||||||
|
|
||||||
void on_loginButton_clicked();
|
void on_loginButton_clicked();
|
||||||
|
|
||||||
void on_usrnmLineEdit_editingFinished();
|
void on_usrnmLineEdit_editingFinished();
|
||||||
|
@ -68,6 +60,14 @@ private slots:
|
||||||
|
|
||||||
void on_actionOS_Default_triggered();
|
void on_actionOS_Default_triggered();
|
||||||
|
|
||||||
|
void on_spinBoxCoursesFromSemester_valueChanged(int arg1);
|
||||||
|
|
||||||
|
void on_spinBoxCoursesFromYear_valueChanged(int arg1);
|
||||||
|
|
||||||
|
void on_spinBoxCoursesToYear_valueChanged(int arg1);
|
||||||
|
|
||||||
|
void on_spinBoxCoursesToSemester_valueChanged(int arg1);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void uiSetDisconnectMode();
|
void uiSetDisconnectMode();
|
||||||
|
@ -75,6 +75,8 @@ private:
|
||||||
void setLabelConnectionStatus(jceLogin::jceStatus statusDescription);
|
void setLabelConnectionStatus(jceLogin::jceStatus statusDescription);
|
||||||
void checkLocale();
|
void checkLocale();
|
||||||
|
|
||||||
|
bool checkIfValidDates();
|
||||||
|
|
||||||
Ui::MainScreen *ui;
|
Ui::MainScreen *ui;
|
||||||
|
|
||||||
QLabel *ButtomStatusLabel;
|
QLabel *ButtomStatusLabel;
|
||||||
|
|
|
@ -61,7 +61,7 @@ background: qlineargradient(spread:pad, x1:0.496, y1:0, x2:0.508, y2:1, stop:0 r
|
||||||
<enum>QTabWidget::Rounded</enum>
|
<enum>QTabWidget::Rounded</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="documentMode">
|
<property name="documentMode">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
|
@ -305,7 +305,7 @@ font-size: 15px;
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="CoursesTab">
|
<widget class="QWidget" name="CoursesTab">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
|
@ -473,7 +473,7 @@ font-size: 15px;
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>3</number>
|
<number>999</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -539,7 +539,7 @@ font-size: 15px;
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>3</number>
|
<number>999</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
|
@ -634,7 +634,7 @@ font-size: 15px;
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>855</width>
|
<width>855</width>
|
||||||
<height>21</height>
|
<height>22</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuA_about">
|
<widget class="QMenu" name="menuA_about">
|
||||||
|
|
|
@ -16,7 +16,6 @@ void Page::makeText(QString &html)
|
||||||
int index = 0;
|
int index = 0;
|
||||||
index = html.indexOf("<tbody>",0); //set index into the place where the data is
|
index = html.indexOf("<tbody>",0); //set index into the place where the data is
|
||||||
manageTableContent(html, index);
|
manageTableContent(html, index);
|
||||||
qDebug() << "page after parsing " << text;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief Page::manageTableContent strip html, make it string
|
* @brief Page::manageTableContent strip html, make it string
|
||||||
|
|
Loading…
Reference in a new issue