From fad0937cd0649cc831e47ed92d0d845b7c82431a Mon Sep 17 00:00:00 2001 From: Liran BN Date: Sun, 15 Jun 2014 19:35:37 +0300 Subject: [PATCH] added input checks, remove logo if ill add graphics it must be good! --- jceGrade.pro.user | 251 ++++++++++ jceGrade.pro.user.63df886 | 263 ++++++++++ main/coursestablemanager.cpp | 51 +- main/coursestablemanager.h | 5 +- main/mainscreen.cpp | 37 +- main/mainscreen.h | 4 +- main/mainscreen.ui | 854 +++++++++++++++++---------------- resources/connectionstatus.qrc | 3 - resources/icon.png | Bin 3175 -> 4257 bytes resources/icon.xcf | Bin 0 -> 6031 bytes src/connection/qtsslsocket.cpp | 20 - src/connection/qtsslsocket.h | 8 - src/grades/Course.cpp | 20 - src/grades/Course.h | 10 +- src/grades/GradePage.cpp | 6 - src/grades/GradePage.h | 8 +- src/grades/Page.h | 11 +- src/jce/jcelogin.cpp | 41 +- src/jce/jcelogin.h | 3 - 19 files changed, 1070 insertions(+), 525 deletions(-) create mode 100644 jceGrade.pro.user create mode 100644 jceGrade.pro.user.63df886 create mode 100644 resources/icon.xcf diff --git a/jceGrade.pro.user b/jceGrade.pro.user new file mode 100644 index 0000000..459b4a0 --- /dev/null +++ b/jceGrade.pro.user @@ -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 + + qt5 static + qt5 static + {dd51eedf-ba55-40ee-bad5-3104352e8e7b} + 1 + 0 + 0 + + C:/Users/liran/Dropbox/cpp/jceConQT/build-jceGrade-qt5_static-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 + + + C:/Users/liran/Dropbox/cpp/jceConQT/build-jceGrade-qt5_static-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:C:/Users/liran/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/jceGrade.pro.user.63df886 b/jceGrade.pro.user.63df886 new file mode 100644 index 0000000..97e82f1 --- /dev/null +++ b/jceGrade.pro.user.63df886 @@ -0,0 +1,263 @@ + + + + + + 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 + Desktop + {7f000311-5c80-4b7b-b77f-8740d071d018} + 0 + 0 + 0 + + /home/liran/Dropbox/cpp/jceConQT/build-jceGrade-Desktop-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/liran/Dropbox/cpp/jceConQT/build-jceGrade-Desktop-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + 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:/home/liran/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 + {63df8866-8eec-41bd-97e5-f9d818bdbcac} + + + ProjectExplorer.Project.Updater.FileVersion + 15 + + diff --git a/main/coursestablemanager.cpp b/main/coursestablemanager.cpp index b877956..276702a 100644 --- a/main/coursestablemanager.cpp +++ b/main/coursestablemanager.cpp @@ -56,9 +56,13 @@ void coursesTableManager::setCoursesList(std::string &html) * @param change string change * @param row row index * @param col col index + * @return if change has been done */ -void coursesTableManager::changes(std::string change, int row, int col) +bool coursesTableManager::changes(QString change, int row, int col) { + + bool isNumFlag = true; + int serialCourse = courseTBL->item(row,Course::CourseScheme::SERIAL)->text().toInt(); for (Course *c: *gp->getCourses()) { @@ -67,27 +71,60 @@ void coursesTableManager::changes(std::string change, int row, int col) switch (col) { case (Course::CourseScheme::NAME): - c->setName(change); + c->setName(change.toStdString()); break; case (Course::CourseScheme::TYPE): - c->setType(change); + c->setType(change.toStdString()); break; case (Course::CourseScheme::POINTS): - c->setPoints(stod(change)); + { + change.toDouble(&isNumFlag); + + if (!isNumFlag) + { + courseTBL->item(row,col)->setText(QString::number(c->getPoints())); + } + else + c->setPoints(change.toDouble()); break; + } case (Course::CourseScheme::HOURS): - c->setHours(stod(change)); + { + change.toDouble(&isNumFlag); + + if (!isNumFlag) + { + courseTBL->item(row,col)->setText(QString::number(c->getHours())); + } + else + c->setHours(change.toDouble()); break; + } case (Course::CourseScheme::GRADE): - c->setGrade(stod(change)); + { + change.toDouble(&isNumFlag); + + if (!isNumFlag) + { + courseTBL->item(row,col)->setText(QString::number(c->getGrade())); + } + else + { + if ((change.toDouble() >= 0) && (change.toDouble() <= 100)) + c->setGrade(change.toDouble()); + else + courseTBL->item(row,col)->setText(QString::number(c->getGrade())); + } break; + } case (Course::CourseScheme::ADDITION): - c->setAdditions(change); + c->setAdditions(change.toStdString()); break; } break; } } + return isNumFlag; } /** diff --git a/main/coursestablemanager.h b/main/coursestablemanager.h index 0748947..5ce2e85 100644 --- a/main/coursestablemanager.h +++ b/main/coursestablemanager.h @@ -8,7 +8,8 @@ #include #include #include -#include +#include +#include #include @@ -23,7 +24,7 @@ public: ~coursesTableManager(); void insertJceCoursesIntoTable(); void setCoursesList(std::string &htmlPage); - void changes(std::string change, int row, int col); + bool changes(QString change, int row, int col); void addRow(const Course * courseToAdd = 0); double getAvg(); diff --git a/main/mainscreen.cpp b/main/mainscreen.cpp index 70d7b90..4f9c420 100644 --- a/main/mainscreen.cpp +++ b/main/mainscreen.cpp @@ -5,29 +5,36 @@ MainScreen::MainScreen(QWidget *parent) :QMainWindow(parent), ui(new Ui::MainScreen) { ui->setupUi(this); - // this->setWindowFlags(this->windowFlags() | Qt::MSWindowsFixedSizeDialogHint); this->setFixedSize(this->size()); //main not resizeable + + //Login Tab ui->pswdLineEdit->setEchoMode((QLineEdit::Password)); + + //Status Bar ui->statusBar->setStyleSheet("QStatusBar::item { border: 0px solid black };"); ButtomStatusLabel = new QLabel(this); statusLabel = new QLabel(this); - - - - ui->CoursesTab->setDisabled(true); - ui->SettingsTab->setDisabled(true); ui->statusBar->setMaximumSize(this->geometry().width(),StatusIconHeight); ui->statusBar->addPermanentWidget(ButtomStatusLabel,0); ui->statusBar->addPermanentWidget(statusLabel,1); + setLabelConnectionStatus(jceLogin::jceStatus::JCE_NOT_CONNECTED); + //Course and Setting Tab + ui->CoursesTab->setDisabled(true); + ui->SettingsTab->setDisabled(true); + ui->avgLCD->setPalette(QPalette(QPalette::WindowText,Qt::blue)); + + + + //Pointer allocating this->jceLog = NULL; this->userLoginSetting = new user("",""); - this->courseTableMgr = new coursesTableManager(ui->coursesTable,userLoginSetting); + updateDates(); - setLabelConnectionStatus(jceLogin::jceStatus::JCE_NOT_CONNECTED); + } @@ -103,15 +110,14 @@ void MainScreen::on_spinBoxToSemester_editingFinished() void MainScreen::on_coursesTable_itemChanged(QTableWidgetItem *item) { - this->courseTableMgr->changes(item->text().toStdString(),item->row(),item->column()); - ui->avgLCD->display(courseTableMgr->getAvg()); + if (this->courseTableMgr->changes(item->text(),item->row(),item->column())) + ui->avgLCD->display(courseTableMgr->getAvg()); + else + QMessageBox::critical(this,"Error","Missmatching data"); } void MainScreen::on_loginButton_clicked() { - setLabelConnectionStatus(jceLogin::jceStatus::JCE_START_VALIDATING_PROGRESS); - - if (this->jceLog == NULL) uiSetConnectMode(); else @@ -167,6 +173,8 @@ void MainScreen::uiSetConnectMode() //add icon near to username and password to mark it return; } + setLabelConnectionStatus(jceLogin::jceStatus::JCE_START_VALIDATING_PROGRESS); + username = ui->usrnmLineEdit->text().toStdString(); password = ui->pswdLineEdit->text().toStdString(); @@ -220,7 +228,7 @@ void MainScreen::setLabelConnectionStatus(jceLogin::jceStatus statusDescription) void MainScreen::on_actionCredits_triggered() { QMessageBox::about(this, "About", " A tiny application to calculate your grades average.

" - "This software is licensed under the
GNU LESSER GENERAL PUBLIC LICENSE V2
" + "This software is licensed under Qt5's
GNU LESSER GENERAL PUBLIC LICENSE V2
" "The source code is available at github:
" "jceAverageCalculator Repository" "

This front end is Powered by Jce Connection

" @@ -246,3 +254,4 @@ void MainScreen::on_actionExit_triggered() { exit(0); } + diff --git a/main/mainscreen.h b/main/mainscreen.h index fd44226..2da50a4 100644 --- a/main/mainscreen.h +++ b/main/mainscreen.h @@ -41,8 +41,6 @@ private slots: void on_spinBoxToSemester_editingFinished(); - void on_coursesTable_itemChanged(QTableWidgetItem *item); - void on_loginButton_clicked(); void on_checkBox_toggled(bool checked); @@ -55,6 +53,8 @@ private slots: void on_actionExit_triggered(); + void on_coursesTable_itemChanged(QTableWidgetItem *item); + private: void updateDates(); diff --git a/main/mainscreen.ui b/main/mainscreen.ui index 4094da2..da52fb8 100644 --- a/main/mainscreen.ui +++ b/main/mainscreen.ui @@ -6,8 +6,8 @@ 0 0 - 676 - 717 + 855 + 636 @@ -45,29 +45,14 @@ background: qlineargradient(spread:pad, x1:0.496, y1:0, x2:0.508, y2:1, stop:0 r - - + + true - #CoursesTab { -background: QLinearGradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #eef, stop: 1 #ccf); -border: none; -} -#LoginTab { -background: QLinearGradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #eef, stop: 1 #ccf); -border: none; -} -#SettingsTab { -background: QLinearGradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #eef, stop: 1 #ccf); -border: none; -} -#DebugTab { -background: QLinearGradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #eef, stop: 1 #ccf); -border: none; -} + QTabWidget::North @@ -88,29 +73,47 @@ border: none; false + + + + + + Login - - - - 200 - 230 - 301 - 146 - + + + QLayout::SetMinimumSize - - - 0 - 0 - + + 200 - - #LoginFrame { + + 100 + + + 200 + + + 100 + + + 0 + + + + + + 0 + 0 + + + + #LoginFrame { border: 3px solid rgb(160, 165, 170); border-radius: 40px; @@ -143,179 +146,160 @@ font-size: 15px; font-weight: bold; font-size: 15px; } - - - QFrame::StyledPanel - - - QFrame::Raised - - - - QLayout::SetDefaultConstraint - - - 20 - - - 15 - - - 20 - - - 15 - - - - - 0 + + + QFrame::StyledPanel + + + QFrame::Raised + + + + QLayout::SetDefaultConstraint - - - - + + 20 + + + 15 + + + 20 + + + 15 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + - + 0 0 + + + - <color=#000000>Username - - - Qt::RichText - - - - - - - - - - - 0 - 0 - - - - Qt::ImhLatinOnly|Qt::ImhNoPredictiveText - - - 20 - - - true + Login - - - - 0 - + + 0 - - - - 0 - 0 - - - - Password - - - Qt::RichText - - + + + + + + 0 + 0 + + + + Qt::ImhLatinOnly|Qt::ImhNoPredictiveText + + + 20 + + + true + + + + + + + + 0 + 0 + + + + <color=#000000>Username + + + Qt::RichText + + + + - - - - 0 - 0 - + + + 0 - - Qt::ImhHiddenText|Qt::ImhNoAutoUppercase|Qt::ImhNoPredictiveText|Qt::ImhSensitiveData + + 0 - - 20 - - - QLineEdit::Password - - - true - - + + + + + 0 + 0 + + + + Password + + + Qt::RichText + + + + + + + + 0 + 0 + + + + Qt::ImhHiddenText|Qt::ImhNoAutoUppercase|Qt::ImhNoPredictiveText|Qt::ImhSensitiveData + + + 20 + + + QLineEdit::Password + + + true + + + + - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - - - Login - - - - - - - - - - - 0 - 0 - 650 - 600 - - - - - - - :/icons/AVG_LOGO.png - - - label_2 - LoginFrame + + + @@ -361,6 +345,9 @@ font-size: 15px; false + + <html><head/><body><p><span style=" font-weight:600;">Get your grades</span></p></body></html> + Add @@ -368,6 +355,9 @@ font-size: 15px; + + <html><head/><body><p><span style=" font-weight:600;">Clear table</span></p></body></html> + Clear @@ -398,7 +388,29 @@ font-size: 15px; - + + + + 75 + true + + + + + + + 0 + + + 0 + + + false + + + QLCDNumber::Filled + + @@ -412,235 +424,251 @@ font-size: 15px; false + + + 0 + 0 + + Settings - + - 10 - 180 - 201 - 26 + 20 + 20 + 251 + 141 - - Only influences Courses - - - false - - - - - - 10 - 40 - 231 - 121 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 10 - - - 10 - + - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 48 - 20 - - - - - - - - - - Semester - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - Year - - - - - - - - - - - - - - - From - - - - - - - To - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - 3 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - false - - - false - - - 2009 - - - 2015 - - - 2009 - - - - - - - - - - - 3 - - - 3 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - 2010 - - - 2026 - - - 2015 - - - - - - - - - - + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 48 + 20 + + + + + + + + + + Semester + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + + + + Year + + + + + + + + + + + + + QLayout::SetMinimumSize + + + 0 + + + + + + 0 + 0 + + + + + 40 + 16777215 + + + + From + + + + + + + + 0 + 0 + + + + + 40 + 16777215 + + + + To + + + + + + + + + + + + + 3 + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + false + + + 2009 + + + 2015 + + + 2009 + + + false + + + + + + + + + + + 3 + + + 3 + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + 2010 + + + 2026 + + + 2015 + + + + + + + + + + + + + + + Only influences Courses + + + false + + + + + - @@ -652,8 +680,8 @@ font-size: 15px; 0 0 - 676 - 29 + 855 + 21 @@ -691,6 +719,20 @@ font-size: 15px; + + usrnmLineEdit + pswdLineEdit + loginButton + tabWidget + ratesButton + clearTableButton + checkBox + spinBoxFromSem + coursesTable + spinBoxFromYear + spinBoxToSemester + spinBoxToYear + diff --git a/resources/connectionstatus.qrc b/resources/connectionstatus.qrc index 547be37..61cb0fd 100644 --- a/resources/connectionstatus.qrc +++ b/resources/connectionstatus.qrc @@ -4,8 +4,5 @@ greenStatusIcon.png redStatusIcon.png icon.png - AVG_LOGO.png - - diff --git a/resources/icon.png b/resources/icon.png index efa2f5c1780131fdab04249147578a2c463a4e89..94232d4181f960daf1287a482fef6d833b029c2a 100644 GIT binary patch literal 4257 zcmV;S5MJ+zP)5H3kX zK~!ko?OA7ZROQxw_Iu9EnUZ8Cg(L(7AtKd6l_p(hK+)rdJRMVK?CPSK3#Xke+q=EZ{M5@pz>UlCW<>thJvcGb!!Hs za(i&>_@3s8l3v2*&`4FGum57Ad8)9#^p#Hz%$b(&xGqn(wC-sBQ2+$$W*7gawd2;L z$cA-RW+vfGp{l2z99R9!i=)lL^6Nx$ibk3RPy~d_r5Qh*Zd^I_v9)~i^a?W=yc7Ur z*hkEK!2!_OmOcA9{LUIxU-z-o()tRgQomu2dEz@g`o;cS``8hCZ5_Lv@Q)a>DYE*# zu1f9N1aJ*nFbE_FT&06!!KiIOw^pv@Z+>ffj;1SFx#chokZQSLNYv1R1!;lFlQbEu zK=}=M2t4`_xn|Bi4S|l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YAVPX^Ier_+!X0lR{lxJ!>E*lgW%`AZ;)ZOiWJAOivnx z8j;vrP=jZ0oP4JT?ju5CwTUpqjiP99MY1Qs(-h$G>D;WyJvWD@pc7SXkdZ<7S#i={y3h3-IzkSAetkos8<)p+v9N%U|Q7>kpkY%|B?`bk+i3M|0 zWXTWxJ@5)M%t5tZ1xUA3?Ufk!*2JjK)BRb7B3GFvW3ui$72K|XB-N9N1+EyP4>$Kq zgnCqtokEPzkvzCatH{B{Vi-;7n->TPzonEhsr{X(66z`gD34Lk!?1y({WDU~BqUQm z*By>ya-qnld8wHnU@^iQl0n%@6?b5d^f0o_w3MX8d7$14#rPeWoe(r zaTp60A*Xg{u3olo?WS4_tc#*B)O)B9cE!<6_{P0jScHya%QBE8V;?y?m=2%w#EA5@ z!5HaXY)r4CYN6P3Iw<}LN70Ckp^6j2aar6SbKCM}pS(3umNGw#PC|Rsplpv)cy-v< zvD`T*?ETIP^TtB%hrJYkXNfxDT?8AeVvs_kO!6_*4#eDJ8HW8q@(~za43nc2Qbz$Y zUQFSoc1;uYjZ_$l9O++Rj!_Q_vv708hodkWKlvpsK=`2UuJrHe+%67VK6WCE&STLC zwTr!*abM~n@b8OSO2#YhSX_P9;umaO?`5ZB`d zi!hmrn^Yd!ooZH;3FtBw--$FBVc>0Q5b|uBzwB6$%3D;piDNn2sWk4qdd(X{X$1dD zF-VKil*>V!kj0ZoxHSuyG^#shJ;@^B=ydv&J0BtmDqoyrknn5x2$ix#l+g&JKZ%|! z>5se=dpb_~k=QgdGFsHM!B0{#%>MKgbgxD@%2El=FE+GIN0mt0pb=ptr; - connect(this->socket,SIGNAL(encryptedBytesWritten(qint64)),this,SLOT(on_read())); - //connect(this->socket,SIGNAL(readChannelFinished()),this,SLOT(on_read())); - } - -} - -void qtsslsocket::on_read() -{ - if (this->pb != NULL) - { - if (pb->value() <= 90) - pb->setValue(pb->value() + 10); - } -} diff --git a/src/connection/qtsslsocket.h b/src/connection/qtsslsocket.h index 6a53416..35236ea 100644 --- a/src/connection/qtsslsocket.h +++ b/src/connection/qtsslsocket.h @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #define milisTimeOut 3000 @@ -17,23 +16,16 @@ class qtsslsocket : public QObject public: qtsslsocket(std::string server,int port); ~qtsslsocket() { - disconnect(this->socket,SIGNAL(encryptedBytesWritten(qint64)),this,SLOT(on_read())); socket->close(); socket = NULL; - pb = NULL; - } bool isCon(); bool send(std::string str); bool recieve(std::string &str); - void setProgressBar(QProgressBar *ptr); -private slots: - void on_read(); private: QSslSocket *socket; - QProgressBar *pb; bool flag; }; diff --git a/src/grades/Course.cpp b/src/grades/Course.cpp index 50464f6..bc08f75 100644 --- a/src/grades/Course.cpp +++ b/src/grades/Course.cpp @@ -15,26 +15,6 @@ Course::~Course() { } - -void Course::printCourse() -{ - double noGrade = NO_GRADE_YET; - - std::cout << "===== Course =====" << std::endl; - std::cout << "serial: " << this->serialNum << std::endl; - std::cout << "name: " << this->name << std::endl; - std::cout << "type: " << this->type << std::endl; - std::cout << "points: " << this->points << std::endl; - std::cout << "hours: " << this->hours << std::endl; - - if (this->grade != noGrade) - std::cout << "grade: " << this->grade << std::endl; - else - std::cout << "grade: " << "No Grade" << std::endl; - - std::cout << "additions: " << this->additions << std::endl; -} - double Course::getGrade() const { double noGrade = NO_GRADE_YET; diff --git a/src/grades/Course.h b/src/grades/Course.h index 688320f..b577d31 100644 --- a/src/grades/Course.h +++ b/src/grades/Course.h @@ -1,6 +1,13 @@ #ifndef COURSE_H #define COURSE_H +/* This Code Made By Sagi Dayan + * SagiDayan@gmail.com + * + * Minor changes has been made by Liran Ben Gida + * LiranBG@gmail.com +*/ + #include #include #include @@ -26,9 +33,6 @@ public: Course(int serial,std::string name, std::string type, double points, double hours, double grade, std::string additions); ~Course(); - - void printCourse(); - int getSerialNum() const {return this->serialNum;} std::string getName() const {return this->name;} std::string getType() const {return this->type;} diff --git a/src/grades/GradePage.cpp b/src/grades/GradePage.cpp index 5c73f3b..315a2f9 100644 --- a/src/grades/GradePage.cpp +++ b/src/grades/GradePage.cpp @@ -160,12 +160,6 @@ bool GradePage::isGradedYet(std::string grade) } return true; } -void GradePage::printCourses() -{ - for(Course* c : *courses) - c->printCourse(); -} - double GradePage::getAvg() { double avg = 0; diff --git a/src/grades/GradePage.h b/src/grades/GradePage.h index 912dae5..355dc1a 100644 --- a/src/grades/GradePage.h +++ b/src/grades/GradePage.h @@ -1,6 +1,13 @@ #ifndef GRADE_PAGE_H #define GRADE_PAGE_H +/* This Code Made By Sagi Dayan + * SagiDayan@gmail.com + * + * Minor changes has been made by Liran Ben Gida + * LiranBG@gmail.com +*/ + #include "Page.h" #include "Course.h" @@ -15,7 +22,6 @@ class GradePage : public Page public: GradePage(std::string html); - void printCourses(); ~GradePage(); void addCourse(Course *); diff --git a/src/grades/Page.h b/src/grades/Page.h index c40f2e8..5796487 100644 --- a/src/grades/Page.h +++ b/src/grades/Page.h @@ -1,6 +1,13 @@ #ifndef PAGE_H #define PAGE_H +/* This Code Made By Sagi Dayan + * SagiDayan@gmail.com + * + * Minor changes has been made by Liran Ben Gida + * LiranBG@gmail.com +*/ + #include #include @@ -11,8 +18,6 @@ public: ~Page() {} - - protected: Page(std::string& html); std::string getString(); @@ -34,4 +39,4 @@ private: }; -#endif \ No newline at end of file +#endif diff --git a/src/jce/jcelogin.cpp b/src/jce/jcelogin.cpp index cd8f003..8706f62 100644 --- a/src/jce/jcelogin.cpp +++ b/src/jce/jcelogin.cpp @@ -15,54 +15,42 @@ jceLogin::~jceLogin() JceConnector = NULL; recieverPage = NULL; } - +/** + * @brief jceLogin::makeConnection Connecting to JCE student web site with JceA (username object) and validate it. + * throws error upon the given error from JCE website or Socket error + */ void jceLogin::makeConnection() throw (jceStatus) { jceStatus status; - cout << "Connecting with username: " << jceA->getUsername() << std::endl; - if (checkConnection() == true) + if (checkConnection() == true) //connected to host { - cout << "first visiting..." << endl; - if (makeFirstVisit() == true) + if (makeFirstVisit() == true) //requst and send first validation { status = jceStatus::JCE_FIRST_VALIDATION_PASSED; - cout << "validating..." << endl; - if (checkValidation() == true) + if (checkValidation() == true) //check if username and password are matching { - cout << "singing in" << endl; status = jceStatus::JCE_SECOND_VALIDATION_PASSED; - if (makeSecondVisit() == true) + if (makeSecondVisit() == true) //siging in the website { status = jceStatus::JCE_YOU_ARE_IN; setLoginFlag(true); } else - { status = jceStatus::ERROR_ON_VALIDATION; - cout << "not in evantually. error!" << std::endl; - } - } else - { status = jceStatus::ERROR_ON_VALIDATION; - cout<< "error on validation" << std::endl; - } } else - { - cout << "error on first visit" << std::endl; status = jceStatus::ERROR_ON_VALIDATION_USER_BLOCKED; - } } else - { - cout << "error on creating socket" << std::endl; status = jceStatus::ERROR_ON_OPEN_SOCKET; - } + + //we throw status even if we are IN! throw status; } @@ -151,11 +139,6 @@ void jceLogin::setLoginFlag(bool x) { this->loginFlag = x; } - -void jceLogin::setProgressBar(QProgressBar *ptr) -{ - this->JceConnector->setProgressBar(ptr); -} bool jceLogin::isLoginFlag() const { return this->loginFlag; @@ -166,6 +149,10 @@ std::string jceLogin::getPage() return *recieverPage; } +/** + * @brief jceLogin::checkValidation Made by Nadav Luzzato + * @return true if second validation step is right + */ bool jceLogin::checkValidation() { //finds the hashed password diff --git a/src/jce/jcelogin.h b/src/jce/jcelogin.h index e9448f1..8d804a8 100644 --- a/src/jce/jcelogin.h +++ b/src/jce/jcelogin.h @@ -41,9 +41,6 @@ public: int getGrades(); bool isLoginFlag() const; - - void setProgressBar(QProgressBar *); - std::string getPage();