From 72dfc107787637c88332aefc6517138b1d4b2e38 Mon Sep 17 00:00:00 2001 From: Liran BN Date: Mon, 6 Oct 2014 19:15:24 +0300 Subject: [PATCH] fixed bugs. ready to make graph feature --- main/LoginTab/loginhandler.cpp | 1 - main/mainscreen.cpp | 71 +- main/mainscreen.h | 2 - main/mainscreen.ui | 1141 +-------------------- src/jceData/Calendar/calendarDialog.cpp | 2 +- src/jceData/Calendar/calendarPage.cpp | 157 ++- src/jceData/Calendar/calendarPage.h | 1 - src/jceData/Calendar/calendarSchedule.cpp | 4 +- src/jceData/Grades/gradePage.cpp | 21 - src/jceData/Grades/gradePage.h | 1 - src/jceData/page.cpp | 224 ++-- src/jceSettings/jcelogin.cpp | 306 +++--- src/jceSettings/jcelogin.h | 71 +- 13 files changed, 411 insertions(+), 1591 deletions(-) diff --git a/main/LoginTab/loginhandler.cpp b/main/LoginTab/loginhandler.cpp index d83b741..68061d5 100644 --- a/main/LoginTab/loginhandler.cpp +++ b/main/LoginTab/loginhandler.cpp @@ -130,7 +130,6 @@ QString loginHandler::getCurrentPageContect() parse.setText(jceLog->getPage()); else throw jceLogin::ERROR_ON_GETTING_INFO; - 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 1cf5a5f..0eb638a 100644 --- a/main/mainscreen.cpp +++ b/main/mainscreen.cpp @@ -2,7 +2,7 @@ #include "ui_mainscreen.h" -MainScreen::MainScreen(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainScreen), busyFlag() +MainScreen::MainScreen(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainScreen) { ui->setupUi(this); @@ -33,7 +33,6 @@ MainScreen::MainScreen(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainSc this->loginHandel = new loginHandler(userLoginSetting,ui->statusBar,ui->loginButton,ui->progressBar); this->calendar = new CalendarManager(ui->calendarGridLayoutMain); this->data = new SaveData(); - busyFlag = false; //check login File if (data->isSaved()) @@ -145,7 +144,7 @@ void MainScreen::on_ratesButton_clicked() QString pageString; int status = 0; QApplication::setOverrideCursor(Qt::WaitCursor); - if (loginHandel->isLoggedInFlag() && !busyFlag) + if (loginHandel->isLoggedInFlag()) { ui->statusBar->showMessage(tr("Getting grades...")); if ((status = loginHandel->makeGradeRequest(ui->spinBoxCoursesFromYear->value(), @@ -170,7 +169,6 @@ void MainScreen::on_ratesButton_clicked() { qCritical() << Q_FUNC_INFO << "grade get ended with" << status; } - busyFlag = true; } QApplication::restoreOverrideCursor(); } @@ -237,43 +235,34 @@ void MainScreen::on_graphButton_clicked() //EVENTS ON CALENDAR TAB void MainScreen::on_getCalendarBtn_clicked() { - QString page; - calendar->resetTable(); - page = ui->plainTextEdit->toPlainText(); - calendar->setCalendar(page); - // 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) - // { - - // //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(); - // ui->statusBar->showMessage(tr("Done. Inserting schdule into table..."),1000); - - // page = loginHandel->getCurrentPageContect(); - // calendar->setCalendar(page); - // ui->progressBar->setValue(100); - // qDebug() << Q_FUNC_INFO << "calendar 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 << "calendar get ended with" << status; - // } - // QApplication::restoreOverrideCursor(); + 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->resetTable(); + ui->statusBar->showMessage(tr("Done. Inserting schdule into table..."),1000); + page = loginHandel->getCurrentPageContect(); + calendar->setCalendar(page); + ui->progressBar->setValue(100); + qDebug() << Q_FUNC_INFO << "calendar 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 << "calendar get ended with" << status; + } + QApplication::restoreOverrideCursor(); } void MainScreen::on_exportToCVSBtn_clicked() { diff --git a/main/mainscreen.h b/main/mainscreen.h index e0f5d32..b04691c 100644 --- a/main/mainscreen.h +++ b/main/mainscreen.h @@ -85,8 +85,6 @@ private: coursesTableManager *courseTableMgr; loginHandler *loginHandel; - bool busyFlag; - }; #endif // MAINSCREEN_H diff --git a/main/mainscreen.ui b/main/mainscreen.ui index 74e7a2c..d7d4f53 100644 --- a/main/mainscreen.ui +++ b/main/mainscreen.ui @@ -586,1145 +586,6 @@ font-size: 15px; - - - - class="menuheader expandable">קבצים להורדה</h3> - <ul class="categoryitems"> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0134,','_self');"> - מינהל סטודנטים - </a> - </li> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0138,','_self');"> - ועדת הוראה - </a> - </li> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0125,','_self');"> - דיקנאט הסטודנטים - </a> - </li> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0123,','_self');"> - מדור שכ"ל - </a> - </li> - - - </ul> - <h3 class="menuheader expandable">שאלות נפוצות</h3> - <ul class="categoryitems"> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0151,','_self');"> - מינהל סטודנטים - </a> - </li> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0152,','_self');"> - מדור בחינות - </a> - </li> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0153,','_self');"> - ועדת הוראה - </a> - </li> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0154,','_self');"> - מדור סיוע - </a> - </li> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0155,','_self');"> - שכ"ל - </a> - </li> - - - </ul> - <h3 class="menuheader expandable">שנת הלימודים תשע"ה</h3> - <ul class="categoryitems"> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0139,','_self');"> - לוחות תאריכים - </a> - </li> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0140,','_self');"> - פתיחת שנה - </a> - </li> - - - </ul> - <h3 class="menuheader expandable">תוכניות לימודים</h3> - <ul class="categoryitems"> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0126,','_self');"> - תעשייה וניהול - </a> - </li> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0127,','_self');"> - אלקטרוניקה - </a> - </li> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0128,','_self');"> - תוכנה - </a> - </li> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0129,','_self');"> - חומרים מתקדמים - </a> - </li> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0130,','_self');"> - פרמצבטית - </a> - </li> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0132,','_self');"> - מכונות - </a> - </li> - - - </ul> - <h3 class="menuheader expandable">מלגות</h3> - <ul class="categoryitems"> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0008,','_self');"> - הגשת בקשה למלגה - </a> - </li> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0026,','_self');"> - צירוף קבצים למלגה - </a> - </li> - - - <li> - <a href="javascript:send_form('Menu','-N,-A,-N,-N0012,','_self');"> - עדכון פרטים אישיים - </a> - </li> - -</ul> - -</div> - -</td> - </tr> - </tbody> - </table></td> - </tr> - </tbody> - </table></td> - </tr> - - </tbody> - </table></td> - </tr> - </tbody> - </table></td> - </tr> - <tr> - <td class="bottomCornerBG"></td> - </tr> -</table> -</form> -</body> -</html> <!--FileName : Menu_Full_4.htm-->HTTP/1.1 200 OK -Date: Sun, 05 Oct 2014 11:29:00 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -X-AspNet-Version: 2.0.50727 -Set-Cookie: ASP.NET_SessionId=j0hjp245bbmffs55nvais255; path=/; HttpOnly -Cache-Control: private -Content-Type: text/html; charset=utf-8 -Content-Length: 28103 - - <!DOCTYPE html> -<html lang="he"> -<head> - <meta charset="UTF-8"> - <noscript><meta http-equiv="X-Frame-Options" content="SameOrigin"></noscript> - - <title>תחנת מידע לסטודנט עזריאלי, מכללה אקדמית להנדסה ירושלים</title> - <link href="/info/MagicStyles_Type_2.css" rel="stylesheet" type="text/css"> -<link rel="stylesheet" href="/info/sort/jquery-ui-custom.css" type="text/css"> - <link rel="shortcut icon" href="/info/images/Favicon.ico"> - <link rel="icon" href="/info/images/Favicon.ico"> - <link rel="stylesheet" href="/info/sort/jquery.ui.timepicker.css" /> - <link rel="stylesheet" href="/info/sort/select2A.css"> - - <style type="text/css"> - textarea,input[type='text'], input[type='email'], input[type='password'] - { - border:1px solid #ccc; - padding:5px; - font-size:120%; - font-family:Arial,sans-serif; - } - #shadow { - background-image:url(/info/images/shade1x1.png); - position:absolute; - left:0; - top:0; - width:100%; - z-index:4999; -} -.cke_skin_kama td { - background-color: inherit !important; -} -body { - padding-right: 10px; - padding-left: 10px; -} -table.tablesorter { - font-family:arial; - background-color: #CDCDCD; - font-size: 8pt; - width: 97%; - text-align: right; -} -table.tablesorter thead tr th, table.tablesorter tfoot tr th { - border: 1px solid #FFF; - font-size: 8pt; - padding: 4px; -} -table.tablesorter tfoot td { - padding: 4px; -} -table.tablesorter thead tr .header { - background-image: url(/info/images/bgTitle.gif); - background-repeat: no-repeat; - background-position: left; - cursor: pointer; -} -table.tablesorter tbody td { - color: #3D3D3D; - padding: 4px; - background-color: #FFF; - vertical-align: top; -} -table.tablesorter tbody tr.odd td { - background-color:#F0F0F6; -} -table.tablesorter thead tr .headerSortUp { - background-image: url(/info/images/asc.gif); - background-position: left; -} -table.tablesorter thead tr .headerSortDown { - background-image: url(/info/images/desc.gif); - background-position: left; -} -table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp { -background-color: #8dbdd8; -} -#preview{ - position:absolute; - border:1px solid #ccc; - background:#333; - padding:5px; - display:none; - color:#fff; - } - - - -.buttonA, .buttonTOP { - padding: 4px 10px 3px 25px; - border: 1px solid #DE5D51; - position: relative; - cursor: pointer; - display: inline-block; - background-image: url( '/info/images/buttonJumpBackground_red.png' ); - background-repeat: repeat-x; - font-size: 11px; - text-decoration: none; - color: #9D271E; - -moz-border-radius-bottomleft: 5px; - -moz-border-radius-bottomright: 5px; - -moz-border-radius-topleft: 5px; - -moz-border-radius-topright: 5px; - font-family: Arial, Helvetica, sans-serif; - } - .buttonA img,.buttonTOP img { - position: absolute; - top: -4px; - left: -12px; - border: none; - } - .buttonA:hover { - color: #DE5D51; - border: 1px solid #FFB3AA; - } - .buttonA:disabled { - visibility: hidden; - } - - -.buttonA_Big { - padding: 4px 10px 3px 25px; - border: 1px solid #DE5D51; - position: relative; - cursor: pointer; - display: inline-block; - background-image: url( '/info/images/buttonJumpBackground_red.png' ); - background-repeat: repeat-x; - font-size: 13px; - font-weight: bold; - text-decoration: none; - color: #9D271E; - -moz-border-radius-bottomleft: 5px; - -moz-border-radius-bottomright: 5px; - -moz-border-radius-topleft: 5px; - -moz-border-radius-topright: 5px; - font-family: Arial, Helvetica, sans-serif; - } - .buttonA_Big img { - position: absolute; - top: -4px; - left: -12px; - border: none; - } - .buttonA_Big:hover { - color: #DE5D51; - border: 1px solid #FFB3AA; - } - .buttonA_Big:disabled { - visibility: hidden; - } - - - - - -</style> -</head> - <body OnLoad="AutoExec()" class= text style="margin: 0; direction: rtl;font-size:12px;" -> - - -<script type="text/javascript" src="/info/sort/jquery.min.js"></script> -<script type="text/javascript" src="/info/sort/jquery-migrate.js"></script> - - -<script type="text/javascript"> - var SessionMesIdStr,SessionResIdStr; - SessionMesIdStr = ","; - SessionResIdStr = ","; - - function ShowHideContent(id,type){ - if (type == "msg") { - if (SessionMesIdStr.indexOf(","+id+",") == -1){ - SessionMesIdStr = SessionMesIdStr + id + ","; - } - } - else { - if (SessionResIdStr.indexOf(","+id+",") == -1){ - - SessionResIdStr = SessionResIdStr + id + ","; - } - } - div = document.getElementById("div" + type + id); - img = document.getElementById("IMG" + id); - if (div.style.display == "none") - { - div.style.display = 'block'; - img.src = '/info/images/box_open.png'; - } - else - { - div.style.display='none'; - img.src ='/info/images/box_closed.png'; - } - window.focus() - } - - </script> -<script type="text/javascript" src="/info/sort/jquery.tooltipster.min.js"></script> -<script type="text/javascript" src="/info/sort/select2.min.js"></script> -<script type="text/javascript"> -if(!($.browser.msie && ($.browser.version=="6.0" || $.browser.version=="7.0" || $.browser.version=="8.0"))) -{ - $(document).ready(function() { - $('#bigger, #smaller, #ConB, #ConL, #ConW, #Excel, #Outlook,.AboutOpen').tooltipster(); - $("select").select2(); - }); -} -</script> - - -<script type="text/javascript" src="/info/sort/jquery.tablesorter.js"></script> - <script src="/info/sort/jquery.ui.timepicker.js"></script> - <script src="/info/sort/jquery.ui.timepicker-he.js"></script> - - <script src="/info/sort/jquery.lazyload.js" type="text/javascript" charset="utf-8"></script> - <script type="text/javascript"> - $(function() { - $("img").lazyload(); - }); - </script> - -<script type="text/javascript" src="/info/sort/jquery.cookie.js"></script> - -<script type="text/javascript"> - var min=10; - var max=20; - var fontsize=12; - var fontsizeTitles=17; - var fs_elements = 'div,td,th,#Yedion a,select,p,span'; - var fs_elementsTitles = 'h1,h2,.white'; -$(document).ready(function(e){ - if ($.cookie("fs_styles")!=null) { - if ($.cookie("fs_styles")!='white') { - change_style($.cookie("fs_styles")); - } - } - if (($.cookie("fs_elements")!=null)&&($.cookie("fs_elementsTitles")!=null)) { - fontsize=parseInt($.cookie("fs_elements")); - fontsizeTitles=parseInt($.cookie("fs_elementsTitles")); - $.cookie("fs_elements", fontsize, { expires: 30 }); - $.cookie("fs_elementsTitles", fontsizeTitles, { expires: 30 }); - set_fontsizes(); - } -}); -function set_fontsizes() { - $(fs_elements).css('fontSize',fontsize+'px'); - $(fs_elementsTitles).css('fontSize',fontsizeTitles+'px'); - $.cookie("fs_elements", fontsize, { expires: 30 }); - $.cookie("fs_elementsTitles", fontsizeTitles, { expires: 30 }); -} -function enlarge() { - if (fontsize<max) { - fontsize+=2; - fontsizeTitles+=2; - set_fontsizes(); - } -} -function change_style(styletype) { - switch(styletype) { - case 'black': $('body').css('backgroundColor','black'); - $('.text').css('color','white'); - $('body').css('backgroundImage',''); - $('.tablesorter').css('backgroundColor','#35B3DC'); - $(fs_elements).css('backgroundColor','black'); - $(fs_elements).css('color','yellow'); - $(fs_elementsTitles).css('color','yellow'); - break; - case 'blue': $('body').css('backgroundColor','rgb(194, 211, 252)'); - $('.text').css('color','white'); - $('body').css('backgroundImage',''); - $('.tablesorter').css('backgroundColor','#35B3DC'); - $(fs_elements).css('backgroundColor','rgb(194, 211, 252)'); - $(fs_elements).css('color','black'); - $(fs_elementsTitles).css('color','black'); - break; - default: $('body').css('backgroundColor','white'); - $('.text').css('color','white'); - $('body').css('backgroundImage','url(/info/images/tile.gif)'); - $('.tablesorter').css('backgroundColor','#CDCDCD'); - $(fs_elements).css('backgroundColor',''); - $(fs_elements).css('color','black'); - $(fs_elementsTitles).css('color','black'); - $('th').css('color','white'); - break; - } - $.cookie("fs_styles", styletype, { expires: 30 }); -} -function shrink() { - if (fontsize>min) { - fontsize-=2; - fontsizeTitles-=2; - set_fontsizes(); - } -} -</script> - -<noscript> -<!-- <p><br />הגדלה והקטנה של מלל<br /></p> --> -</noscript> - - - -<script type="text/javascript"> -this.imagePreview = function(){ - /* CONFIG */ - - xOffset = 10; - yOffset = -300; - - // these 2 variable determine popup's distance from the cursor - // you might want to adjust to get the right result - - /* END CONFIG */ - $("a.preview").hover(function(e){ - this.t = this.title; - this.title = ""; - var c = (this.t != "") ? "<br/>" + this.t : ""; - $("body").append("<p id='preview'><img src='"+ this.href +"' alt='Image preview'>"+ c +"<\/p>"); - $("#preview") - .css("top",(e.pageY - xOffset) + "px") - .css("left",(e.pageX + yOffset) + "px") - .fadeIn("fast"); - }, - function(){ - this.title = this.t; - $("#preview").remove(); - }); - $("a.preview").mousemove(function(e){ - $("#preview") - .css("top",(e.pageY - xOffset) + "px") - .css("left",(e.pageX + yOffset) + "px"); - }); -}; - - -// starting the script on page load -$(document).ready(function(){ - imagePreview(); -}); -</script> -<noscript> -<!-- <p><br />הגדלה של תמונה כאשר עוברים עליה<br /></p> --> -</noscript> - - <script type="text/javascript" src="/info/sort/jquery-ui.custom.min.js"></script> - - <script type="text/javascript" src="/info/sort/jquery.ui.datepicker-he.js"></script> - -<noscript> -<!-- <p><br />תאריכון<br /></p> --> -</noscript> -<!-- script src="/info/Scripts/AC_RunActiveContent.js" type="text/javascript"></script> --> -<script type="text/javascript"> -function AutoExec() -{ - if (typeof(document.form) != 'undefined') { - if (typeof(document.form.R1C1) != 'undefined') - document.form.R1C1.focus(); - - document.form.onsubmit = OnSubmit; - } - return; -} - -function OnSubmit () -{ - if (typeof(document.form) != 'undefined') { - if (document.form.APPNAME.value == "") - { - return false; - } - } - return true; -} - - - -function SubmitFormConfirm(Obj,app, prg, arg, trg, confirmQuestion) -{ - confirmQuestion = confirmQuestion.replace("\\n","\n"); - confirmQuestion = confirmQuestion.replace("\\n","\n"); - confirmQuestion = confirmQuestion.replace("\\n","\n"); - confirmQuestion = confirmQuestion.replace("\\n","\n"); - confirmQuestion = confirmQuestion.replace("\\n","\n"); - confirmQuestion = confirmQuestion.replace("\\n","\n"); - confirmQuestion = confirmQuestion.replace("\\n","\n"); - confirmQuestion = confirmQuestion.replace("\\n","\n"); - var conf = confirm(confirmQuestion); - if (conf) { - SubmitForm(Obj,app, prg, arg, trg); - } -} - -function SubmitForm(Obj,app, prg, arg, trg) -{ - if(Obj==null) - Obj=event.srcElement; - if(Obj==null) - return; - - bConfirm=Obj.getAttribute("Confirm"); - if (bConfirm=="true") - { - confirmQuestion = Obj.getAttribute("ConfirmQuestion"); - confirmQuestion = confirmQuestion.replace("\\n","\n"); - confirmQuestion = confirmQuestion.replace("\\n","\n"); - confirmQuestion = confirmQuestion.replace("\\n","\n"); - confirmQuestion = confirmQuestion.replace("\\n","\n"); - confirmQuestion = confirmQuestion.replace("\\n","\n"); - confirmQuestion = confirmQuestion.replace("\\n","\n"); - confirmQuestion = confirmQuestion.replace("\\n","\n"); - confirmQuestion = confirmQuestion.replace("\\n","\n"); - result = confirm (confirmQuestion); - if (!result) - { - return; - } - } - - if((trg!="_blank")&&(trg!="jq_float")) trg=""; - - document.form.APPNAME.value=app; - document.form.PRGNAME.value=prg; - document.form.ARGUMENTS.value=arg; - document.form.target=trg; - - document.form.submit(); -} -</script> -<noscript> -<!-- <p><br />הפעלת כפתורים<br /></p> --> -</noscript> - - - <script type="text/javascript"> - $(document).ready(function(){ - $(".buttonJump").hover(function(){ - $(".buttonJump img") - .animate({top:"-10px"}, 200).animate({top:"-4px"}, 200) // first jump - .animate({top:"-7px"}, 100).animate({top:"-4px"}, 100) // second jump - .animate({top:"-6px"}, 100).animate({top:"-4px"}, 100); // the last jump - }); - }); - </script> - - -<noscript> -<!-- <p><br />עיצוב של כפתור<br /></p> --> -</noscript> - - - -<!-- Text area --> - -<script type="text/javascript" src="/info/ckeditor/ckeditor.js"></script> - -<noscript> -<!-- <p><br />הגדרות בעת הפעלת עורך מלל<br /></p> --> -<!-- <p><br />הגדרות ראשוניות בעת אתחול עורך מלל<br /></p> --> -</noscript> - -<script type="text/javascript"> -if(!($.browser.msie)) - { - CKEDITOR.on( 'dialogDefinition', function( ev ) - { - var dialogName = ev.data.name; - var dialogDefinition = ev.data.definition; - if ( dialogName == 'link' ) - { - var targetTab = dialogDefinition.getContents( 'target' ); - var targetField = targetTab.get( 'linkTargetType' ); - targetField[ 'default' ] = '_blank'; - - } - }); - CKEDITOR.on('instanceReady', function(ev) { - ev.editor.on('paste', function(evt) { - evt.data.dataValue = evt.data.dataValue.replace(/target=".*?"/g, '' ); - evt.data.dataValue = evt.data.dataValue.replace(/href/g, 'target="_blank" href' ); - console.log(evt.data.dataValue); - }, null, null, 9); - }); - } -</script> -<!-- End of Text area --> - -<script type="text/javascript" src="/info/sort/RowColor.js"></script> - - <div style="width: 100%;"> - <span class="white" style="float:right;">תחנת מידע לסטודנט</span> - - <span style="float:left;">05/10/2014 - 14:29 - -<a class="buttonTOP" onClick="window.print()" accesskey="P"><img src="/info/images/Printer.PNG" style="top: 2px; left: 8px;" alt="">הדפס</a> - - -<a class="buttonTOP" onClick="enlarge();" accesskey="+"><img src="/info/images/zoom_in.PNG" style="top: 2px; left: 8px;" alt="הגדלת פונט ">הגדל</a> -<a class="buttonTOP" onClick="shrink();" accesskey="-"><img src="/info/images/zoom_out.PNG" style="top: 2px; left: 8px;" alt="הקטנת פונט ">הקטן</a> -<a class="buttonTOP" onClick="change_style('black');" accesskey="B"><img src="/info/images/black.gif" style="top: 1px; left: 10px;" alt="קונטרסט גבוה">&nbsp;</a> -<a class="buttonTOP" onClick="change_style('blue');" accesskey="L"><img src="/info/images/blue.gif" style="top: 1px; left: 10px;" alt="קונטרסט עדין">&nbsp;</a> -<a class="buttonTOP" onClick="change_style('white');" accesskey="W"><img src="/info/images/white.gif" style="top: 1px; left: 10px;" alt="קונטרסט ברירת מחדל">&nbsp;</a> - - - - <a class="buttonTOP" onClick="javascript:EXCEL()" accesskey="E"><img src="/info/images/xls.PNG" style="top: 2px; left: 8px;" alt="">אקסל</a> - <script type="text/javascript"> - function EXCEL() - { - window.open("fireflyweb.aspx?prgname=GetFile&Arguments=-N7","Grade_To_Excel", "menubar=yes,toolbar=no,resizable=yes,scrollbars=yes,width=700,height=500, top=100,left=100"); - } - </script> - - - - - - - - </span></div> - -<table style="width:100%;height:100%;border:0"> - <tr> - <td style="text-align:left"> - </table> -<br> - -<script type="text/javascript"> - function send_form(prgname,arguments,target) - { - var input = '<input type="hidden" name="prgname" value="'+prgname+'">'; - var input = input+'<input type="hidden" name="arguments" value="'+arguments+'">'; - $('<form method="post" action="fireflyweb.aspx" target="'+target+'">'+input+'</form>').appendTo('body').submit(); - } -</script> -<script type="text/javascript"> - function load_img(img_id,arg) - { - $.post('fireflyweb.aspx', - { - prgname: 'GetFile', - Arguments: arg, - IsItPost: 'Y' - },function(e){ - $('#'+img_id).html('<img src="data:image/jpg;base64,'+e+'" style="border:0;margin:2;" alt="תמונה ממסד הנתונים">'); - }); - } -</script> - <!--FileName : Header_Of_HTML_Type_3.HTM--> - - - <table style="text-align:right;width:98%;margin:auto;" class="text"> - <tr> - <td>שם סטודנט - </td> - - <td> - - <b>בן גידה לירן - </b> - </td> - - <td> - ת.ז. - </td> - <td> 302539556 - </td> - </tr> - - <tr> - <td>כתובת - </td> - <td> הסוללים 7 א' דירה 1 - </td> - - <td> - - תאריך - </td> - <td>05/10/2014 - </td> - - </tr> - - <tr> - <td>עיר - </td> - <td>ירושלים - </td> - - <td>מיקוד - </td> - <td>9371648 - </td> - </tr> - - <TR style="text-align:right"><td>חוג : </td><td>הנדסת תוכנה</td><td>התמחות</td><td>תוכנה</td></tr> - -</table> - -<h1 style="text-align:center">רשימת מערכת שעות שנה : 2015 סמסטר : 1 תשע"ה</h1> - - - - - - <script type="text/javascript"> - $(function() { - $("#myTable0").tablesorter(); -// $("#options").tablesorter({sortList: [[0,0]], headers: { 3:{sorter: false}, 4:{sorter: false}}}); - }); - </script> - - -<table style="text-align:right;width:98%;margin:auto;" class="tablesorter Mtable" ID="myTable0" summary="רשימת הקורסים"> -<thead> - <Tr> - <th style="width:50px">סמסטר</th> - <th>קוד קורס </th> - <th>שם הקורס </th> - <th>סוג מקצוע </th> - <th>שם המרצה </th> - <th style="width:30">נ"ז </th> - <th style="width:30">ש"ס</th> - <th style="width:90">יום ושעות </th> - <th>חדר </th> - <th>קוד קבוצה</th> - <th>חוג</th> - <th>אתר</th> - -</tr> -</thead> -<tbody> - <tr> - <td>א&nbsp; </td> - <td> 10001&nbsp; </td> - <td>אותות ומערכות&nbsp; </td> - <td>הרצאה&nbsp; - </td> - <td>ד"ר גור ערן&nbsp; </td> - <td> 4.50&nbsp; </td> - <td> 4.00&nbsp; </td> - <td style="width:direction:rtl;width:90"> -א'&nbsp;14:00&nbsp;-&nbsp;15:45 -</td> - <td>כתה- L208&nbsp; </td> - <td>100015101&nbsp; </td> - <td>תוכנה&nbsp; </td> - <td>&nbsp; </td> - -</tr> - <tr> - <td>א&nbsp; </td> - <td> 10001&nbsp; </td> - <td>אותות ומערכות&nbsp; </td> - <td>הרצאה&nbsp; - </td> - <td>ד"ר גור ערן&nbsp; </td> - <td>&nbsp; </td> - <td>&nbsp; </td> - <td style="width:direction:rtl;width:90"> -ב'&nbsp;12:00&nbsp;-&nbsp;13:45 -</td> - <td>כיתה-A102&nbsp; </td> - <td>100015101&nbsp; </td> - <td>תוכנה&nbsp; </td> - <td>&nbsp; </td> - -</tr> - <tr> - <td>א&nbsp; </td> - <td> 10001&nbsp; </td> - <td>אותות ומערכות&nbsp; </td> - <td>תרגיל&nbsp; - </td> - <td>ד"ר גור ערן&nbsp; </td> - <td>&nbsp; </td> - <td> 1.00&nbsp; </td> - <td style="width:direction:rtl;width:90"> -ג'&nbsp;13:00&nbsp;-&nbsp;13:45 -</td> - <td>כתה-L201&nbsp; </td> - <td>100015103&nbsp; </td> - <td>תוכנה&nbsp; </td> - <td>&nbsp; </td> - -</tr> - <tr> - <td>א&nbsp; </td> - <td> 10016&nbsp; </td> - <td>הסתברות וסטטיסטיקה 2&nbsp; </td> - <td>הרצאה&nbsp; - </td> - <td><a HREF="fireflyweb.aspx?prgname=Show_Teacher_Card&amp;arguments=-N77,-A" title="פתיחה בעמוד חדש של אתר המרצה" target="_blank">ד"ר ביגון בוריס</a>&nbsp; </td> - <td> 2.50&nbsp; </td> - <td> 2.00&nbsp; </td> - <td style="width:direction:rtl;width:90"> -א'&nbsp;12:00&nbsp;-&nbsp;13:45 -</td> - <td>כתה- L204&nbsp; </td> - <td>100165101&nbsp; </td> - <td>תוכנה&nbsp; </td> - <td>&nbsp; </td> - -</tr> - <tr> - <td>א&nbsp; </td> - <td> 10016&nbsp; </td> - <td>הסתברות וסטטיסטיקה 2&nbsp; </td> - <td>תרגיל&nbsp; - </td> - <td><a HREF="fireflyweb.aspx?prgname=Show_Teacher_Card&amp;arguments=-N589,-A" title="פתיחה בעמוד חדש של אתר המרצה" target="_blank">גב' שטיינבוך ביאנה</a>&nbsp; </td> - <td>&nbsp; </td> - <td> 1.00&nbsp; </td> - <td style="width:direction:rtl;width:90"> -ב'&nbsp;09:00&nbsp;-&nbsp;09:45 -</td> - <td>כתה- L206&nbsp; </td> - <td>100165103&nbsp; </td> - <td>תוכנה&nbsp; </td> - <td>&nbsp; </td> - -</tr> - <tr> - <td>א&nbsp; </td> - <td> 10039&nbsp; </td> - <td>יישומי תקשורת מחשבים&nbsp; </td> - <td>הרצאה&nbsp; - </td> - <td><a HREF="fireflyweb.aspx?prgname=Show_Teacher_Card&amp;arguments=-N284,-A" title="פתיחה בעמוד חדש של אתר המרצה" target="_blank">ד"ר צור-דוד שמרית</a>&nbsp; </td> - <td> 2.50&nbsp; </td> - <td> 2.00&nbsp; </td> - <td style="width:direction:rtl;width:90"> -ב'&nbsp;10:00&nbsp;-&nbsp;11:45 -</td> - <td>כיתה-A102&nbsp; </td> - <td>100395101&nbsp; </td> - <td>תוכנה&nbsp; </td> - <td>&nbsp; </td> - -</tr> - <tr> - <td>א&nbsp; </td> - <td> 10039&nbsp; </td> - <td>יישומי תקשורת מחשבים&nbsp; </td> - <td>מעבדה&nbsp; - </td> - <td><a HREF="fireflyweb.aspx?prgname=Show_Teacher_Card&amp;arguments=-N284,-A" title="פתיחה בעמוד חדש של אתר המרצה" target="_blank">ד"ר צור-דוד שמרית</a>&nbsp; </td> - <td>&nbsp; </td> - <td> 1.00&nbsp; </td> - <td style="width:direction:rtl;width:90"> -ד'&nbsp;12:00&nbsp;-&nbsp;12:45 -</td> - <td>כיתת מחשבים-מ326&nbsp; </td> - <td>100395103&nbsp; </td> - <td>תוכנה&nbsp; </td> - <td>&nbsp; </td> - -</tr> - <tr> - <td>א&nbsp; </td> - <td> 10061&nbsp; </td> - <td>תקשורת מחשבים&nbsp; </td> - <td>הרצאה&nbsp; - </td> - <td><a HREF="fireflyweb.aspx?prgname=Show_Teacher_Card&amp;arguments=-N47,-A" title="פתיחה בעמוד חדש של אתר המרצה" target="_blank">ד"ר אקסמן יעקב</a>&nbsp; </td> - <td> 3.50&nbsp; </td> - <td> 3.00&nbsp; </td> - <td style="width:direction:rtl;width:90"> -ג'&nbsp;09:00&nbsp;-&nbsp;11:45 -</td> - <td>כיתה A106&nbsp; </td> - <td>100615101&nbsp; </td> - <td>תוכנה&nbsp; </td> - <td>&nbsp; </td> - -</tr> - <tr> - <td>א&nbsp; </td> - <td> 10061&nbsp; </td> - <td>תקשורת מחשבים&nbsp; </td> - <td>תרגיל&nbsp; - </td> - <td><a HREF="fireflyweb.aspx?prgname=Show_Teacher_Card&amp;arguments=-N742,-A" title="פתיחה בעמוד חדש של אתר המרצה" target="_blank">גב' נתנזון מרים</a>&nbsp; </td> - <td>&nbsp; </td> - <td> 1.00&nbsp; </td> - <td style="width:direction:rtl;width:90"> -ג'&nbsp;12:00&nbsp;-&nbsp;12:45 -</td> - <td>כיתת מחשבים A114&nbsp; </td> - <td>100615102&nbsp; </td> - <td>תוכנה&nbsp; </td> - <td>&nbsp; </td> - -</tr> - <tr> - <td>א&nbsp; </td> - <td> 10077&nbsp; </td> - <td>מבוא לתכנות מדעי&nbsp; </td> - <td>הרצאה&nbsp; - </td> - <td><a HREF="fireflyweb.aspx?prgname=Show_Teacher_Card&amp;arguments=-N135,-A" title="פתיחה בעמוד חדש של אתר המרצה" target="_blank">ד"ר חסין יהודה</a>&nbsp; </td> - <td> 3.50&nbsp; </td> - <td> 3.00&nbsp; </td> - <td style="width:direction:rtl;width:90"> -ד'&nbsp;08:00&nbsp;-&nbsp;10:45 -</td> - <td>אודיטוריום-001&nbsp; </td> - <td>100775101&nbsp; </td> - <td>תוכנה&nbsp; </td> - <td>&nbsp; </td> - -</tr> - <tr> - <td>א&nbsp; </td> - <td> 10077&nbsp; </td> - <td>מבוא לתכנות מדעי&nbsp; </td> - <td>תרגיל&nbsp; - </td> - <td><a HREF="fireflyweb.aspx?prgname=Show_Teacher_Card&amp;arguments=-N172,-A" title="פתיחה בעמוד חדש של אתר המרצה" target="_blank">מר הראלי שלמה</a>&nbsp; </td> - <td>&nbsp; </td> - <td> 1.00&nbsp; </td> - <td style="width:direction:rtl;width:90"> -ד'&nbsp;11:00&nbsp;-&nbsp;11:45 -</td> - <td>כיתת מחשבים-מ150&nbsp; </td> - <td>100775102&nbsp; </td> - <td>תוכנה&nbsp; </td> - <td>&nbsp; </td> - -</tr> - <tr> - <td>א&nbsp; </td> - <td> 10087&nbsp; </td> - <td>אוטומטים ושפות פורמליות&nbsp; </td> - <td>הרצאה&nbsp; - </td> - <td><a HREF="fireflyweb.aspx?prgname=Show_Teacher_Card&amp;arguments=-N233,-A" title="פתיחה בעמוד חדש של אתר המרצה" target="_blank">ד"ר רודה יואב</a>&nbsp; </td> - <td> 2.50&nbsp; </td> - <td> 2.00&nbsp; </td> - <td style="width:direction:rtl;width:90"> -ד'&nbsp;14:00&nbsp;-&nbsp;15:45 -</td> - <td>כיתה A103&nbsp; </td> - <td>100875101&nbsp; </td> - <td>תוכנה&nbsp; </td> - <td>&nbsp; </td> - -</tr> - <tr> - <td>א&nbsp; </td> - <td> 10087&nbsp; </td> - <td>אוטומטים ושפות פורמליות&nbsp; </td> - <td>תרגיל&nbsp; - </td> - <td>מר ידגר הראל עוז&nbsp; </td> - <td>&nbsp; </td> - <td> 1.00&nbsp; </td> - <td style="width:direction:rtl;width:90"> -ג'&nbsp;14:00&nbsp;-&nbsp;14:45 -</td> - <td>כתה-L201&nbsp; </td> - <td>100875103&nbsp; </td> - <td>תוכנה&nbsp; </td> - <td>&nbsp; </td> - -</tr> - <tr> - <td>א&nbsp; </td> - <td> 10091&nbsp; </td> - <td>תכנות בסביבת אינטרנט&nbsp; </td> - <td>הרצאה&nbsp; - </td> - <td><a HREF="fireflyweb.aspx?prgname=Show_Teacher_Card&amp;arguments=-N282,-A" title="פתיחה בעמוד חדש של אתר המרצה" target="_blank">מר תבור שי</a>&nbsp; </td> - <td> 2.50&nbsp; </td> - <td> 2.00&nbsp; </td> - <td style="width:direction:rtl;width:90"> -א'&nbsp;10:00&nbsp;-&nbsp;11:45 -</td> - <td>אודיטוריום-201&nbsp; </td> - <td>100915101&nbsp; </td> - <td>תוכנה&nbsp; </td> - <td>&nbsp; </td> - -</tr> - <tr> - <td>א&nbsp; </td> - <td> 10091&nbsp; </td> - <td>תכנות בסביבת אינטרנט&nbsp; </td> - <td>תרגיל&nbsp; - </td> - <td><a HREF="fireflyweb.aspx?prgname=Show_Teacher_Card&amp;arguments=-N282,-A" title="פתיחה בעמוד חדש של אתר המרצה" target="_blank">מר תבור שי</a>&nbsp; </td> - <td>&nbsp; </td> - <td> 1.00&nbsp; </td> - <td style="width:direction:rtl;width:90"> -ב'&nbsp;08:00&nbsp;-&nbsp;08:45 -</td> - <td>כיתת מחשבים A114&nbsp; </td> - <td>100915102&nbsp; </td> - <td>תוכנה&nbsp; </td> - <td>&nbsp; </td> - -</tr> -</tbody> -<tfoot> - <tr> - <td colspan=5>סה"כ נקודות זכות לסמסטר זה -( - קורס שנתי יחושב כמחצית בכל סמסטר -) </td> - <td><b>21.50</b></td> - <td><b>25.00</b></td> - <td colspan=5>&nbsp; </td> -</tr> -</tfoot> -</table> - -<div style="text-align:right" class="text"> - -<br> -ט.ל.ח -<br> -רשימת מערכת שעות שנה : 2015 סמסטר : 1 מותנה בעמידה בתנאי הקדם לקורסים -<br> - -רשימת מערכת שעות שנה : 2015 סמסטר : 1 זו אינה מהווה אישור רשמי של עזריאלי, מכללה אקדמית להנדסה ירושלים -</div> - -<script type="text/javascript"> propagateEventHandler(document.getElementById("myTable0"), "onmouseover", "TR", highlightTableRow, "lightblue");</script> - </body></html> - <!--FileName : TimeTable_List_For_Student.htm-->" - - - @@ -1829,7 +690,7 @@ background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 green, stop: 0 0 1133 - 22 + 21 diff --git a/src/jceData/Calendar/calendarDialog.cpp b/src/jceData/Calendar/calendarDialog.cpp index cf6be72..f3bd71c 100644 --- a/src/jceData/Calendar/calendarDialog.cpp +++ b/src/jceData/Calendar/calendarDialog.cpp @@ -61,7 +61,7 @@ void CalendarDialog::on_calStart_selectionChanged() void CalendarDialog::on_buttonBox_accepted() { if(this->isOK) - qDebug() << "CalendarDialog: Valid input"; + qDebug() << Q_FUNC_INFO << "CalendarDialog: Valid input"; } void CalendarDialog::on_calEnd_selectionChanged() diff --git a/src/jceData/Calendar/calendarPage.cpp b/src/jceData/Calendar/calendarPage.cpp index 2566146..0a68e38 100644 --- a/src/jceData/Calendar/calendarPage.cpp +++ b/src/jceData/Calendar/calendarPage.cpp @@ -2,123 +2,108 @@ QString CalendarPage::htmlToString() { - return tempHtml; + return tempHtml; } void CalendarPage::setPage(QString html) { - qDebug() << "parsing calendar"; - courses = new std::list(); - tempHtml = getString(html); - tempHtml = tokenToLines(tempHtml); - qDebug() << "creating courses list"; - calendarListInit(tempHtml); - qDebug() << "done"; + courses = new std::list(); + tempHtml = getString(html); + calendarListInit(tempHtml); } -QString CalendarPage::tokenToLines(QString &textToParse) -{ - int ctr = 0; - QString temp = ""; - char *tok; - char* textToTok = strdup(textToParse.toStdString().c_str()); - tok = strtok(textToTok, "\n"); - while(tok != NULL) - { - //amount of data before the actual needed data and no empty lines - if (strcmp(tok," \t ") != 0) - { - temp += tok; - temp += "\n"; - } - ctr++; - tok = strtok(NULL, "\n"); - } - return temp; -} - void CalendarPage::calendarListInit(QString &linesTokinzedString) { - std::list stringHolder; - QString temp; - calendarCourse * cTemp = NULL; - char* tok; - char* textToTok = strdup(linesTokinzedString.toStdString().c_str()); - tok = strtok(textToTok,"\n"); - while (tok != NULL) + std::list stringHolder; + QString temp; + calendarCourse * cTemp = NULL; + char* tok; + char* textToTok = strdup(linesTokinzedString.toStdString().c_str()); + tok = strtok(textToTok,"\n"); + while (tok != NULL) { - temp = tok; - stringHolder.push_back(temp); - tok = strtok(NULL, "\n"); + temp = tok; + stringHolder.push_back(temp); + tok = strtok(NULL, "\n"); } - for (QString temp: stringHolder) + for (QString temp: stringHolder) { - cTemp = lineToCourse(temp); - if (cTemp != NULL) - courses->push_back(cTemp); + cTemp = lineToCourse(temp); + if (cTemp != NULL) + courses->push_back(cTemp); } } calendarCourse *CalendarPage::lineToCourse(QString line) { - calendarCourse *tempC = NULL; - QString templinearray[CALENDAR_COURSE_FIELDS];//[serial,name,type,lecturer,points,semesterhours,dayandhours,room] - int serial; - double points,semesterHours; - QString name,type, lecturer,dayAndHour,room; - QString tempS = ""; - int i = 0; - char* tok; - char* cLine = strdup(line.toStdString().c_str()); - tok = strtok(cLine, "\t"); - while(tok != NULL) + calendarCourse *tempC = NULL; + QString templinearray[CALENDAR_COURSE_FIELDS];//[serial,name,type,lecturer,points,semesterhours,dayandhours,room] + int serial; + double points,semesterHours; + QString name,type, lecturer,dayAndHour,room; + QString tempS = ""; + int i = 0; + char* tok; + char* cLine = strdup(line.toStdString().c_str()); + tok = strtok(cLine, "\t"); + while(tok != NULL) { - tempS = QString(tok); + tempS = QString(tok); - if (i >= 1) + if (i >= 1) //skips on semester character { - templinearray[i-1] = tempS.trimmed(); + templinearray[i-1] = tempS.trimmed(); } - i++; - if (i > 8) - break; - tok=strtok(NULL, "\t"); + i++; + if (i > 8) + break; + tok=strtok(NULL, "\t"); } - if (templinearray[0] == "") //empty parsing - return NULL; + if (templinearray[0] == "") //empty parsing + return NULL; - serial = templinearray[calendarCourse::CourseScheme::SERIAL].toInt(); - name = templinearray[calendarCourse::CourseScheme::NAME]; - type = templinearray[calendarCourse::CourseScheme::TYPE]; + serial = templinearray[calendarCourse::CourseScheme::SERIAL].toInt(); + name = templinearray[calendarCourse::CourseScheme::NAME]; + type = templinearray[calendarCourse::CourseScheme::TYPE]; - if (!templinearray[calendarCourse::CourseScheme::LECTURER].isEmpty()) - lecturer = templinearray[calendarCourse::CourseScheme::LECTURER]; - else - lecturer = LECTURER_DEFAULT_STRING; + if (!templinearray[calendarCourse::CourseScheme::LECTURER].isEmpty()) + lecturer = templinearray[calendarCourse::CourseScheme::LECTURER]; + else + lecturer = LECTURER_DEFAULT_STRING; - if (!templinearray[calendarCourse::CourseScheme::POINTS].isEmpty()) - points = templinearray[calendarCourse::CourseScheme::POINTS].toDouble(); - else - points = 0; - if (!templinearray[calendarCourse::CourseScheme::SEM_HOURS].isEmpty()) - semesterHours = templinearray[calendarCourse::CourseScheme::SEM_HOURS].toDouble(); - else - semesterHours = 0; + if (!templinearray[calendarCourse::CourseScheme::POINTS].isEmpty()) + points = templinearray[calendarCourse::CourseScheme::POINTS].toDouble(); + else + points = 0; + if (!templinearray[calendarCourse::CourseScheme::SEM_HOURS].isEmpty()) + semesterHours = templinearray[calendarCourse::CourseScheme::SEM_HOURS].toDouble(); + else + semesterHours = 0; - dayAndHour = templinearray[calendarCourse::CourseScheme::DAY_AND_HOURS]; + dayAndHour = templinearray[calendarCourse::CourseScheme::DAY_AND_HOURS]; - if (!templinearray[calendarCourse::CourseScheme::ROOM].isEmpty()) - room = templinearray[calendarCourse::CourseScheme::ROOM]; - else - room = ROOM_DEFAULT_STRING; + if (!templinearray[calendarCourse::CourseScheme::ROOM].isEmpty()) + room = templinearray[calendarCourse::CourseScheme::ROOM]; + else + room = ROOM_DEFAULT_STRING; - qDebug() << serial << name << type << lecturer << points << semesterHours << dayAndHour << room; - tempC = new calendarCourse(serial,name,type,lecturer,points,semesterHours,dayAndHour,room); - return tempC; + tempC = new calendarCourse(serial,name,type,lecturer,points,semesterHours,dayAndHour,room); +// qDebug() << "serial is: " << tempC->getSerialNum(); +// qDebug() << tempC->getName(); +// qDebug() << tempC->getType(); +// qDebug() << tempC->getLecturer(); +// qDebug() << tempC->getPoints(); +// qDebug() << tempC->getHourBegin() << ":" << tempC->getMinutesBegin(); +// qDebug() << tempC->getHourEnd() << ":" << tempC->getMinutesEnd(); + +// qDebug() << tempC->getDay(); +// qDebug() << tempC->getRoom(); + + return tempC; } diff --git a/src/jceData/Calendar/calendarPage.h b/src/jceData/Calendar/calendarPage.h index c68fcba..75de858 100644 --- a/src/jceData/Calendar/calendarPage.h +++ b/src/jceData/Calendar/calendarPage.h @@ -22,7 +22,6 @@ protected: private: - QString tokenToLines(QString &textToParse); void calendarListInit(QString &linesTokinzedString); calendarCourse* lineToCourse(QString line); diff --git a/src/jceData/Calendar/calendarSchedule.cpp b/src/jceData/Calendar/calendarSchedule.cpp index e569c47..06e1837 100644 --- a/src/jceData/Calendar/calendarSchedule.cpp +++ b/src/jceData/Calendar/calendarSchedule.cpp @@ -38,7 +38,7 @@ void calendarSchedule::setPage(QString html) { CalendarPage::setPage(html); qDebug() << Q_FUNC_INFO << "inserting into table"; -// insertCourseIntoTable(); + insertCourseIntoTable(); } void calendarSchedule::clearTableItems() @@ -61,12 +61,10 @@ void calendarSchedule::insertCourseIntoTable() int row,col; for (calendarCourse *coursePtr: *getCourses()) { - qDebug() << coursePtr->getSerialNum(); courseString = ""; currentHour = coursePtr->getHourBegin(); currentDay = coursePtr->getDay(); blocksNumber = coursePtr->getHourEnd() - coursePtr->getHourBegin(); //every hour is a block to fill! - qDebug() << blocksNumber; while (blocksNumber >= 0) { row = currentHour - HOURS_BEGIN; diff --git a/src/jceData/Grades/gradePage.cpp b/src/jceData/Grades/gradePage.cpp index 786f132..8e0c08d 100644 --- a/src/jceData/Grades/gradePage.cpp +++ b/src/jceData/Grades/gradePage.cpp @@ -4,7 +4,6 @@ GradePage::GradePage(QString html) : Page() { courses = new std::list(); tempHtml = getString(html); - tempHtml = tokenToLines(tempHtml); coursesListInit(tempHtml); } @@ -49,26 +48,6 @@ void GradePage::coursesListInit(QString &linesTokinzedString) courses->push_back(cTemp); } } - -QString GradePage::tokenToLines(QString &textToPhrase) -{ - QString temp = ""; - char *tok; - char* textToTok = strdup(textToPhrase.toStdString().c_str()); - tok = strtok(textToTok, "\n"); - while(tok != NULL) - { - //amount of data before the actual needed data and no empty lines - if (strcmp(tok," \t ") != 0) - { - temp += tok; - temp += "\n"; - } - tok = strtok(NULL, "\n"); - } - return temp; - -} gradeCourse* GradePage::lineToCourse(QString line) { gradeCourse *tempC = NULL; diff --git a/src/jceData/Grades/gradePage.h b/src/jceData/Grades/gradePage.h index 00fc613..ea4ee28 100644 --- a/src/jceData/Grades/gradePage.h +++ b/src/jceData/Grades/gradePage.h @@ -27,7 +27,6 @@ public: private: - QString tokenToLines(QString &textToPhrase); void coursesListInit(QString &linesTokinzedString); gradeCourse* lineToCourse(QString line); diff --git a/src/jceData/page.cpp b/src/jceData/page.cpp index 7c65231..2d9b455 100644 --- a/src/jceData/page.cpp +++ b/src/jceData/page.cpp @@ -8,14 +8,14 @@ Page::Page() { dateHeader = "";} */ QString Page::getString(QString &htmlToParse) { - makeText(htmlToParse); - return this->text; + makeText(htmlToParse); + return this->text; } void Page::makeText(QString &html) { - int index = 0; - index = html.indexOf("",0); //set index into the place where the data is - manageTableContent(html, index); + int index = 0; + index = html.indexOf("",0); //set index into the place where the data is + manageTableContent(html, index); } /** * @brief Page::manageTableContent strip html, make it string @@ -24,141 +24,153 @@ void Page::makeText(QString &html) */ void Page::manageTableContent(QString &html, int index) { - if (index == -1) - return; - QString temp; - for (int i = index; i < html.length(); i++) + if (index == -1) + return; + QString temp; + for (int i = index; i < html.length(); i++) { - if (html.at(i) == '<') + if (html.at(i) == '<') { - // / / - QString endofTable = ""; - QString tableTag = html.mid(i, 4); //legth of "tr/td" - if (tableTag == "") - { - if (!dateHeader.isEmpty()) - temp += dateHeader; - i = stitchText(html, temp, i+4); - if (i == -1) //EOF - break; - - } - else if (tableTag == " new line - i+=5; - } - else if (tableTag == "" || tableTag == "") - { - if (!dateHeader.isEmpty()) - temp += "\t"; // new cell -> tab between data - if (html.mid(i, 6) == "") - break; - i++; - } - i = stitchText(html, temp, i); - - } - if (html.mid(i,(endofTable).length()) == endofTable) //is end of table + // / / + QString endofTable = ""; + QString tableTag = html.mid(i, 4); //legth of "tr/td" + if (tableTag == "") { + if (!dateHeader.isEmpty()) + temp += dateHeader; + i = stitchText(html, temp, i+4); + if (i == -1) //EOF break; + + } + else if (tableTag == " new line + i+=5; + } + else if (tableTag == "" || tableTag == "") + { + if (!dateHeader.isEmpty()) + temp += "\t"; // new cell -> tab between data + if (html.mid(i, 6) == "") //for gpa. year & semester title + { + break; + } + else if ((html.at(i) == '>') && (html.mid(i+4,3) != "")) //for calendar. day and hours + { + i += 1; //lenght of > + break; + } + i++; + } + i = stitchText(html, temp, i); + temp += "\t"; + } + if (html.mid(i,(endofTable).length()) == endofTable) //is end of table + { + break; } } } - this->text = temp; + this->text = temp; } int Page::stitchText(QString &from, QString &to, int index) { - if (from.at(index) == '<') + if (from.mid(index,3) == "") { - QString bTag = from.mid(index, 3); - QString dateline = from.mid(index,from.indexOf("",index+4)-index); - QString temp; - QString date; - char* tok; - int i = 0; - char* textToTok = strdup(dateline.toStdString().c_str()); - tok = strtok(textToTok,"<> :"); - while (tok != NULL) + QString bTag = from.mid(index, 3); + QString dateline = from.mid(index,from.indexOf("",index+4)-index); + QString temp; + QString date; + char* tok; + int i = 0; + char* textToTok = strdup(dateline.toStdString().c_str()); + tok = strtok(textToTok,"<> :"); + while (tok != NULL) { - if (i == 1) + if (i == 1) { - temp = tok; - date += temp + "\t"; + temp = tok; + date += temp + "\t"; } - else if (i == 3) + else if (i == 3) { - temp = tok; - date += temp; + temp = tok; + date += temp; } - i++; - tok = strtok(NULL, "<> :"); + i++; + tok = strtok(NULL, "<> :"); } - dateHeader = date; - if (bTag != "") - return index-1; //go back one step - for the main function to inc i - index += dateline.length(); + dateHeader = date; + if (bTag != "") + return index-1; //go back one step - for the main function to inc i + index += dateline.length(); } - while (from.at(index) != '<' && index < (int)from.length()) + while (from.at(index) != '<' && index < (int)from.length()) { - if (from[index] == '&') + if (from[index] == '&') { - //  - QString nbspChr = from.mid(index, 6); - if (nbspChr == " ") + //  + QString nbspChr = from.mid(index, 6); + if (nbspChr == " ") { - index += 5; - from.replace(index,1,' '); + index += 5; + from.replace(index,1,' '); } } - if (endOfString(index,(int) from.length())) - return -1; //EOF + if (endOfString(index,(int) from.length())) + return -1; //EOF - else if (from.at(index) == '<') - return index - 1; //go back one step - for the main function to inc i + else if (from.at(index) == '<') + return index - 1; //go back one step - for the main function to inc i - if ((from.at(index) != '\n') && (from.at(index) != '\t')) //check the actuall data before continue - to += from.at(index); - index++; + if ((from.at(index) != '\n') && (from.at(index) != '\t')) //check the actuall data before continue + to += from.at(index); + index++; } - return index-1; + return index-1; } bool Page::endOfString(int index, int length) { - if(index < length) - return false; - return true; + if(index < length) + return false; + return true; } diff --git a/src/jceSettings/jcelogin.cpp b/src/jceSettings/jcelogin.cpp index 900ef23..79e852c 100644 --- a/src/jceSettings/jcelogin.cpp +++ b/src/jceSettings/jcelogin.cpp @@ -6,21 +6,21 @@ */ jceLogin::jceLogin(user* username, QProgressBar *progressbarPtr) { - this->progressBar = progressbarPtr; - this->recieverPage = new QString(); - this->jceA = username; - this->JceConnector = new jceSSLClient(progressBar); - QObject::connect(JceConnector,SIGNAL(serverDisconnectedbyRemote()),this,SLOT(reValidation())); - QObject::connect(JceConnector,SIGNAL(noInternetLink()),this,SLOT(reMakeConnection())); + this->progressBar = progressbarPtr; + this->recieverPage = new QString(); + this->jceA = username; + this->JceConnector = new jceSSLClient(progressBar); + QObject::connect(JceConnector,SIGNAL(serverDisconnectedbyRemote()),this,SLOT(reValidation())); + QObject::connect(JceConnector,SIGNAL(noInternetLink()),this,SLOT(reMakeConnection())); } jceLogin::~jceLogin() { - this->jceA = NULL; - delete recieverPage; - delete JceConnector; - JceConnector = NULL; - recieverPage = NULL; + this->jceA = NULL; + delete recieverPage; + delete JceConnector; + JceConnector = NULL; + recieverPage = NULL; } /** * @brief jceLogin::makeConnection Connecting to JCE student web site with JceA (username object) and validate it. @@ -28,74 +28,74 @@ jceLogin::~jceLogin() */ int jceLogin::makeConnection() { - qDebug() << "jceLogin::makeConnection(); connection to be make"; + qDebug() << "jceLogin::makeConnection(); connection to be make"; - if (this->recieverPage == NULL) - this->recieverPage = new QString(); + if (this->recieverPage == NULL) + this->recieverPage = new QString(); - int returnMode; //gets status according to called function of validation step - jceStatus status = jceStatus::JCE_NOT_CONNECTED; + int returnMode; //gets status according to called function of validation step + jceStatus status = jceStatus::JCE_NOT_CONNECTED; - returnMode = checkConnection(); //checking socket status. is connected? + returnMode = checkConnection(); //checking socket status. is connected? - if (returnMode == false) + if (returnMode == false) { - if (JceConnector->makeConnect(dst_host,dst_port) == false) //couldnt make a connection - return jceStatus::ERROR_ON_OPEN_SOCKET; - else - returnMode = true; + if (JceConnector->makeConnect(dst_host,dst_port) == false) //couldnt make a connection + return jceStatus::ERROR_ON_OPEN_SOCKET; + else + returnMode = true; } - if (returnMode == true) //connected to host + if (returnMode == true) //connected to host { - returnMode = makeFirstVisit(); - if (returnMode == true) //requst and send first validation + returnMode = makeFirstVisit(); + if (returnMode == true) //requst and send first validation { - status = jceStatus::JCE_START_VALIDATING_PROGRESS; - returnMode = checkValidation(); - if (returnMode == true) //check if username and password are matching + status = jceStatus::JCE_START_VALIDATING_PROGRESS; + returnMode = checkValidation(); + if (returnMode == true) //check if username and password are matching { - status = jceStatus::JCE_VALIDATION_PASSED; - returnMode = makeSecondVisit(); - if (returnMode == true) //siging in the website + status = jceStatus::JCE_VALIDATION_PASSED; + returnMode = makeSecondVisit(); + if (returnMode == true) //siging in the website { - qDebug() << "jceLogin::makeConnection(); Signed in succeesfully"; - status = jceStatus::JCE_YOU_ARE_IN; - setLoginFlag(true); + qDebug() << "jceLogin::makeConnection(); Signed in succeesfully"; + status = jceStatus::JCE_YOU_ARE_IN; + setLoginFlag(true); } - else if (returnMode == jceLogin::ERROR_ON_GETTING_INFO) + else if (returnMode == jceLogin::ERROR_ON_GETTING_INFO) { - status = jceLogin::ERROR_ON_GETTING_INFO; + status = jceLogin::ERROR_ON_GETTING_INFO; } - else if (returnMode == jceLogin::ERROR_ON_SEND_REQUEST) + else if (returnMode == jceLogin::ERROR_ON_SEND_REQUEST) { - status = jceLogin::ERROR_ON_SEND_REQUEST; + status = jceLogin::ERROR_ON_SEND_REQUEST; } - else - status = jceStatus::ERROR_ON_VALIDATION; - } - else + else status = jceStatus::ERROR_ON_VALIDATION; + } + else + status = jceStatus::ERROR_ON_VALIDATION; } - else if (returnMode == jceLogin::ERROR_ON_GETTING_INFO) + else if (returnMode == jceLogin::ERROR_ON_GETTING_INFO) { - status = jceLogin::ERROR_ON_GETTING_INFO; + status = jceLogin::ERROR_ON_GETTING_INFO; } - else if (returnMode == jceLogin::ERROR_ON_SEND_REQUEST) + else if (returnMode == jceLogin::ERROR_ON_SEND_REQUEST) { - status = jceLogin::ERROR_ON_SEND_REQUEST; + status = jceLogin::ERROR_ON_SEND_REQUEST; } - else - status = jceStatus::ERROR_ON_VALIDATION_USER_BLOCKED; + else + status = jceStatus::ERROR_ON_VALIDATION_USER_BLOCKED; } - else - status = jceStatus::JCE_NOT_CONNECTED; + else + status = jceStatus::JCE_NOT_CONNECTED; - //we throw status even if we are IN! - qDebug() << "jceLogin::makeConnection(); return status: " << status; - return status; + //we throw status even if we are IN! + qDebug() << "jceLogin::makeConnection(); return status: " << status; + return status; } /** @@ -104,21 +104,21 @@ int jceLogin::makeConnection() */ bool jceLogin::checkConnection() const { - if (JceConnector->isConnected()) - return true; + if (JceConnector->isConnected()) + return true; - return false; + return false; } /** * @brief jceLogin::closeAll */ void jceLogin::closeAll() { - this->JceConnector->makeDiconnect(); - if ((this->recieverPage != NULL) && (!this->recieverPage->isEmpty())) + this->JceConnector->makeDiconnect(); + if ((this->recieverPage != NULL) && (!this->recieverPage->isEmpty())) { - delete recieverPage; - recieverPage = NULL; + delete recieverPage; + recieverPage = NULL; } } @@ -127,17 +127,17 @@ void jceLogin::closeAll() */ void jceLogin::reMakeConnection() { - if (this->JceConnector != NULL) - delete JceConnector; - if (this->recieverPage != NULL) - delete recieverPage; - recieverPage = NULL; - JceConnector = NULL; - this->recieverPage = new QString(); - this->JceConnector = new jceSSLClient(progressBar); - QObject::connect(JceConnector,SIGNAL(serverDisconnectedbyRemote()),this,SLOT(reValidation())); - QObject::connect(JceConnector,SIGNAL(noInternetLink()),this,SLOT(reMakeConnection())); - emit connectionReadyAfterDisconnection(); + if (this->JceConnector != NULL) + delete JceConnector; + if (this->recieverPage != NULL) + delete recieverPage; + recieverPage = NULL; + JceConnector = NULL; + this->recieverPage = new QString(); + this->JceConnector = new jceSSLClient(progressBar); + QObject::connect(JceConnector,SIGNAL(serverDisconnectedbyRemote()),this,SLOT(reValidation())); + QObject::connect(JceConnector,SIGNAL(noInternetLink()),this,SLOT(reMakeConnection())); + emit connectionReadyAfterDisconnection(); } /** @@ -146,17 +146,17 @@ void jceLogin::reMakeConnection() */ int jceLogin::makeFirstVisit() { - QString usr = jceA->getUsername(); - QString psw = jceA->getPassword(); - if (JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getFirstValidationStep(*jceA)))) + QString usr = jceA->getUsername(); + QString psw = jceA->getPassword(); + if (JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getFirstValidationStep(*jceA)))) { - if (!JceConnector->recieveData(*recieverPage,true)) - return jceLogin::ERROR_ON_GETTING_INFO; + if (!JceConnector->recieveData(*recieverPage,true)) + return jceLogin::ERROR_ON_GETTING_INFO; } - else - return jceLogin::ERROR_ON_SEND_REQUEST; + else + return jceLogin::ERROR_ON_SEND_REQUEST; - return true; + return true; } /** * @brief jceLogin::makeSecondVisit making the second validation step of jce student portal login @@ -164,19 +164,19 @@ int jceLogin::makeFirstVisit() */ int jceLogin::makeSecondVisit() { - QString usrid=jceA->getUserID(); - QString pswid=jceA->getHashedPassword(); - if ((JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getSecondValidationStep(*jceA))))) + QString usrid=jceA->getUserID(); + QString pswid=jceA->getHashedPassword(); + if ((JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getSecondValidationStep(*jceA))))) { - if (!(JceConnector->recieveData(*recieverPage,true))) - return jceLogin::ERROR_ON_GETTING_INFO; + if (!(JceConnector->recieveData(*recieverPage,true))) + return jceLogin::ERROR_ON_GETTING_INFO; - return true; + return true; } - else - return jceLogin::ERROR_ON_SEND_REQUEST; + else + return jceLogin::ERROR_ON_SEND_REQUEST; - return true; + return true; } /** * @brief jceLogin::getCalendar according to parameters, we make an HTML request and send it over socket to server @@ -186,17 +186,17 @@ int jceLogin::makeSecondVisit() */ int jceLogin::getCalendar(int year, int semester) { - if ((JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getCalendar(*jceA,year,semester))))) + if ((JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getCalendar(*jceA,year,semester))))) { - if (!(JceConnector->recieveData(*recieverPage,false))) - return jceLogin::ERROR_ON_GETTING_PAGE; - else - return jceLogin::JCE_PAGE_PASSED; + if (!(JceConnector->recieveData(*recieverPage,false))) + return jceLogin::ERROR_ON_GETTING_PAGE; + else + return jceLogin::JCE_PAGE_PASSED; } - else - return jceLogin::ERROR_ON_SEND_REQUEST; + else + return jceLogin::ERROR_ON_SEND_REQUEST; - return true; + return true; } /** @@ -209,17 +209,17 @@ int jceLogin::getCalendar(int year, int semester) */ int jceLogin::getGrades(int fromYear, int toYear, int fromSemester, int toSemester) { - if ((JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getGradesPath(*jceA,fromYear, toYear, fromSemester, toSemester))))) + if ((JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getGradesPath(*jceA,fromYear, toYear, fromSemester, toSemester))))) { - if (!(JceConnector->recieveData(*recieverPage,false))) - return jceLogin::ERROR_ON_GETTING_PAGE; - else - return jceLogin::JCE_PAGE_PASSED; + if (!(JceConnector->recieveData(*recieverPage,false))) + return jceLogin::ERROR_ON_GETTING_PAGE; + else + return jceLogin::JCE_PAGE_PASSED; } - else - return jceLogin::ERROR_ON_SEND_REQUEST; + else + return jceLogin::ERROR_ON_SEND_REQUEST; - return true; + return true; } /** @@ -229,43 +229,43 @@ int jceLogin::getGrades(int fromYear, int toYear, int fromSemester, int toSemest bool jceLogin::checkValidation() { - //finds the hashed password - QString constUserID_TAG = "value=\"-N"; - QString constHassID_TAG = "-A,-N"; - QString hasspass,hassid; - std::size_t hasspass_position1,hasspass_position2; - std::size_t id_position1,id_position2; + //finds the hashed password + QString constUserID_TAG = "value=\"-N"; + QString constHassID_TAG = "-A,-N"; + QString hasspass,hassid; + std::size_t hasspass_position1,hasspass_position2; + std::size_t id_position1,id_position2; - hasspass_position1 = this->recieverPage->toStdString().find(constHassID_TAG.toStdString()); //looking for hasspass index - if (hasspass_position1 == std::string::npos) //didnt find the tag - return false; - else - hasspass_position1 += constHassID_TAG.length(); //skip the index of tag - hasspass_position2 = this->recieverPage->toStdString().find(",-A,-A", hasspass_position1); - //finds the hass pass - if (hasspass_position2 != std::string::npos) //found the hasspass! storing it - hasspass = recieverPage->mid(hasspass_position1,hasspass_position2-hasspass_position1); - else - return false; - //finds the user id - id_position1 = this->recieverPage->toStdString().find(constUserID_TAG.toStdString(), 0); //looking for hassid index - if (id_position1 == std::string::npos) //didnt find the tag - return false; - else - id_position1 += constUserID_TAG.length(); //skip the index of tag - id_position2 = this->recieverPage->toStdString().find(",-A", id_position1); - if (id_position2 != std::string::npos) //found the hassid! storing it - hassid = recieverPage->mid(id_position1,id_position2-id_position1); - else - return false; + hasspass_position1 = this->recieverPage->toStdString().find(constHassID_TAG.toStdString()); //looking for hasspass index + if (hasspass_position1 == std::string::npos) //didnt find the tag + return false; + else + hasspass_position1 += constHassID_TAG.length(); //skip the index of tag + hasspass_position2 = this->recieverPage->toStdString().find(",-A,-A", hasspass_position1); + //finds the hass pass + if (hasspass_position2 != std::string::npos) //found the hasspass! storing it + hasspass = recieverPage->mid(hasspass_position1,hasspass_position2-hasspass_position1); + else + return false; + //finds the user id + id_position1 = this->recieverPage->toStdString().find(constUserID_TAG.toStdString(), 0); //looking for hassid index + if (id_position1 == std::string::npos) //didnt find the tag + return false; + else + id_position1 += constUserID_TAG.length(); //skip the index of tag + id_position2 = this->recieverPage->toStdString().find(",-A", id_position1); + if (id_position2 != std::string::npos) //found the hassid! storing it + hassid = recieverPage->mid(id_position1,id_position2-id_position1); + else + return false; - //setting user information with given data hassid and hasspass - jceA->setHashedPassword(hasspass); - jceA->setUserID(hassid); + //setting user information with given data hassid and hasspass + jceA->setHashedPassword(hasspass); + jceA->setUserID(hassid); - qDebug() << "jceLogin::checkValidation(); Found Hashed: " << hasspass << "And ID: " << hassid; + qDebug() << "jceLogin::checkValidation(); Found Hashed: " << hasspass << "And ID: " << hassid; - return true; + return true; } /** * @brief jceLogin::setLoginFlag @@ -273,7 +273,7 @@ bool jceLogin::checkValidation() */ void jceLogin::setLoginFlag(bool x) { - this->loginFlag = x; + this->loginFlag = x; } /** * @brief jceLogin::isLoginFlag checking if there is a connection, if true - > return if we signed in. otherwise, return not (not connected dough) @@ -281,9 +281,9 @@ void jceLogin::setLoginFlag(bool x) */ bool jceLogin::isLoginFlag() const { - if (checkConnection()) - return this->loginFlag; - return false; + if (checkConnection()) + return this->loginFlag; + return false; } /** @@ -292,27 +292,27 @@ bool jceLogin::isLoginFlag() const */ QString jceLogin::getPage() { - return *recieverPage; + return *recieverPage; } void jceLogin::reValidation() { - qDebug() << Q_FUNC_INFO << "Revalidating user"; + qDebug() << Q_FUNC_INFO << "Revalidating user"; - if (makeFirstVisit() == true) + if (makeFirstVisit() == true) { - if (checkValidation()) + if (checkValidation()) { - if (makeSecondVisit() == true) - qDebug() << Q_FUNC_INFO << "Validated"; - else - qWarning() << Q_FUNC_INFO << "Second visit finished with an error"; + if (makeSecondVisit() == true) + qDebug() << Q_FUNC_INFO << "Validated"; + else + qWarning() << Q_FUNC_INFO << "Second visit finished with an error"; } - else - qDebug() << Q_FUNC_INFO << "checking validation ended with an error"; + else + qDebug() << Q_FUNC_INFO << "checking validation ended with an error"; } - else + else { - qDebug() << Q_FUNC_INFO << "Couldnt Validate User"; + qDebug() << Q_FUNC_INFO << "Couldnt Validate User"; } } diff --git a/src/jceSettings/jcelogin.h b/src/jceSettings/jcelogin.h index 912b47b..44310a8 100644 --- a/src/jceSettings/jcelogin.h +++ b/src/jceSettings/jcelogin.h @@ -12,57 +12,58 @@ class jceLogin : public QObject { - Q_OBJECT + Q_OBJECT public: - jceLogin(user* username,QProgressBar *progressbarPtr); - ~jceLogin(); + jceLogin(user* username,QProgressBar *progressbarPtr); + ~jceLogin(); - enum jceStatus { - JCE_NOT_CONNECTED, - ERROR_ON_VALIDATION, - ERROR_ON_VALIDATION_USER_BLOCKED, - ERROR_ON_OPEN_SOCKET, - ERROR_ON_SEND_REQUEST, - ERROR_ON_GETTING_INFO, - ERROR_ON_GETTING_PAGE, + enum jceStatus { + JCE_NOT_CONNECTED, + ERROR_ON_VALIDATION, + ERROR_ON_VALIDATION_USER_BLOCKED, + ERROR_ON_OPEN_SOCKET, + ERROR_ON_SEND_REQUEST, + ERROR_ON_GETTING_INFO, + ERROR_ON_GETTING_PAGE, - JCE_START_VALIDATING_PROGRESS, - JCE_VALIDATION_PASSED, - JCE_YOU_ARE_IN, - JCE_PAGE_PASSED - }; + JCE_START_VALIDATING_PROGRESS, + JCE_VALIDATION_PASSED, + JCE_YOU_ARE_IN, + JCE_PAGE_PASSED + }; - int makeConnection(); - void closeAll(); - bool checkConnection() const; - bool isLoginFlag() const; + int makeConnection(); + void closeAll(); - int getCalendar(int year, int semester); - int getGrades(int fromYear, int toYear, int fromSemester, int toSemester); + bool checkConnection() const; + bool isLoginFlag() const; - QString getPage(); + int getCalendar(int year, int semester); + int getGrades(int fromYear, int toYear, int fromSemester, int toSemester); + + QString getPage(); private slots: - void reValidation(); - void reMakeConnection(); + void reValidation(); + void reMakeConnection(); signals: - void connectionReadyAfterDisconnection(); + void connectionReadyAfterDisconnection(); private: - int makeFirstVisit(); - int makeSecondVisit(); - bool checkValidation(); - void setLoginFlag(bool x); + int makeFirstVisit(); + int makeSecondVisit(); + bool checkValidation(); + void setLoginFlag(bool x); - bool loginFlag; - QString * recieverPage; - user * jceA; - jceSSLClient * JceConnector; - QProgressBar *progressBar; + bool loginFlag; + QString * recieverPage; + user * jceA; + jceSSLClient * JceConnector; + QProgressBar *progressBar; };