From 375b72feac95ba512c2f3ce80218bdabd695695e Mon Sep 17 00:00:00 2001 From: Liran BN Date: Thu, 11 Sep 2014 22:58:08 +0300 Subject: [PATCH] add icon the date dialog. dates changed by default. translate update. still bugged --- jce_en.qm | Bin 5213 -> 6460 bytes jce_en.ts | 89 ++++++--- jce_he.qm | Bin 4977 -> 6190 bytes jce_he.ts | 91 +++++++--- main/CalendarTab/CalendarManager.cpp | 3 +- resources/connectionstatus.qrc | 1 + resources/iconV.png | Bin 0 -> 580 bytes resources/iconX.png | Bin 379 -> 683 bytes src/jceData/CSV/csv_exporter.cpp | 6 +- src/jceData/Calendar/calendardialog.cpp | 64 ++++--- src/jceData/Calendar/calendardialog.h | 7 +- src/jceData/Calendar/calendardialog.ui | 228 +++++++++++++++++------- 12 files changed, 332 insertions(+), 157 deletions(-) create mode 100644 resources/iconV.png diff --git a/jce_en.qm b/jce_en.qm index 78fec6eb5b14c4a39a625152cf1033490b6de20c..c62920a47825e2ebd6302d5663fb0bf909a410ed 100644 GIT binary patch delta 1773 zcmZ`&ZERCz6n@&ZYiYZ78$)1zi8102G6#zWNyHzBnQ<|J@S$K7Au5{igC&w+Feb!A5)B3+QJ?n~Mi;g;x9`_E z&w0*s&biche3czLl3jG}+IyqlH$3pgwgV?FwFB-a0Ph4)bpcrSAyByw=xzh%jly&A zAW*#%p7S2Se-)moH1A)8cYO;`I|c996cD-&@0TjDU>wVTd>E+s02?0N3HX|^;T*C2 zesu5a<$4U=w%k--Lvj~^Yo9}pwukGhNcmp@g3FLf|I0Oxtw&w}!mX}_R~UHyJFd~6 zcLQ~YU3={U2}fM}zlj2#)vjABNZQ}we(W-d2d}z!bhZM4&)x4%hJl)T_oT$D_`&^? zewz2&-1gMiA7uJZ#kuR_%sAtjcI%ujebH^}#oynz4x%ZU*PktkDVfsF@IB%_LVpM$qGPCvJr_SFb z@H1i4evpK<$m?s~1|o^b+5O8HxFrwVccp^R8e-_jO0;tA<$ou17!cURTa{}&|4kbf zw{fJfnQH<&Fyxq7XySPzK~yL(9ft%8v{oIExMOATl;NF*qF*Lo$?x%4|H{@_Z)>M+ zh)w;fXje^3#8aC^V#knfSWRN1rYfc?5(P^&gdNunL(N!P(MR8KT+!4*RxvvAil+Cu zWEufkV}QhkvzC&PbWP{32VEsFn-OZeb$!4T`T)5Zs%eUz zuDOsKZ)=$%(x8KOM-VAa*1>Kg*|pPDYf|bU6=14~Le>;**4i1^c3GxPbAqP`sZe)o zmH_jo1Eeg)u8m*#g@LxH6{mlUuC8(3yoAa^+mrTip+d6JD+u8!iU zBUovrtmT(%5e*_O9R0;oCmqr+=$2&fWTgzMv$LEGxkFWJ>hUxQYsVP7qm}yF)DX?n9KfGemvtV z*00D<_V!>|wN@nzgJsYQLUm?2-%#j_ilNdxXZqF5fGFxChREeLR;kFYAKX(@TQ`}A HEb{&jm3f#2 delta 545 zcmWlVUr1A77{;G-c0N6xe_N*5KZONBxf)X2MKFSlOxNKAN)Uofr2hmJN@N!eiU{e? zf-y`9C2(C-V6_{gX)8h7Fs$gpK?BPuBB&^qRunz^Zr<;GzwddTA8&edVSO|-wtq$L z>y5;7@0!P*H^&Q&fbTC&p-nvt zl=q>n;~#4lk+F6H4M{Z%47Qe}#G9*tr&=1G^3y&p{b_hj;}Ln&Jb~2~`E=7Z>Z;{b zNe{pL^7vDrEFoXKd!9kAadAqd0QY%uw>0;hC~pouVc?>=(cypBKGk_pWZ$Yr3UBEfRBtc5 zXJB1Lb_eI$A+6V6$4zIV+NFCxNFLB0&i0TzrfZYzjXQeq0|kia_ViW~`}Bj}TU=R> zo*v|iJ+F+=Xe$jb8&1O<^&gE#QaAg*# + + CalendarDialog + + + Dialog + Dates + + + + <h1><b>For The Best CSV Export, Please Enter Correctly + <h1><b>For The Best CSV Export, Please Enter Correctly + + + + Semester Starts At: + <b>Semester Starts At: + + + + Semester Ends At: + <b>Semester Ends At: + + + + [ ! ] Start & End cannot be the same + [ ! ] Start & End cannot be set at the same day + + + + + The End of the semester can NOT be equal or before semester begins. + The End of the semester can NOT be equal or before semester begins. + + + + + Looks ok, Press OK + Looks ok, Press OK + + MainScreen @@ -189,80 +229,80 @@ Missmatching Data - + CREDITS-ROOL-UP1 - + CREDITS-ROOL-UP2 - + CREDITS-ROOL-UP3 - + CREDITS-ROOL-UP4 - + DevBy Developed By - + Liran Liran Ben Gida - + Sagi Sagi Dayan - + HELP1 - + HELP2 - + HELP3 - + HELP4 - + HELP5 - + HELP6 - - + + Settings Settings - - - + + + Your settings will take effect next time you start the program Your settings will take effect next time you start the program @@ -270,14 +310,19 @@ QObject - + Exported Successfuly! Exported Successfuly! - - <center>Something went wrong...<br></center>Maybe: <ul><li>You Canceled</li><li>Unable to save the File - try again</li></ul><br><br><b><center>In case of a serious problem, please file a bug report.<br>thank you. OpenJCE teem - + + Error on exporting. please check your file system. + Error on exporting. Please check your file system. + + + + Dates not valid + Invalid Dates diff --git a/jce_he.qm b/jce_he.qm index 952a5caae80d7bbfb4454724d26491572079d124..7181de754de3ee9996f6f9b529d9a7dfdc630c15 100644 GIT binary patch delta 1741 zcmZ`&ZA@EL7=Bysp`|T_6%5o3`Vlc~=7@yN(DH;B_Iq!Mz zd!F}sp7)$T^WQJh99LR44*mXi&v&_7K7X~0lw6Jf5Sh2qfh+q#=nq}a92(p1 z>3Sk3(LmCj(R?7BraM1qCz5h>_lm{cLss;;st*agl#BXN z(;Jun0^n)Wz;FNnQ)bgw*k>%5OK+h*C2Fp{ z{tSpq=GNSIq4;ZaP}>CJWWIV1Bgp>1Qu3&YNO#HN=-&(cS&Or15_P2(|49bN7A$>Z z529SVV;N}7hBXzIPjr3|*lqbHh=ZwT)6)w|aBy?_p`)+Y~;4*;@OEH@3_e_n~uVCB9=je()shF3=ojb3jO@9AVlBQevdzG582thY`nb z$UHQK@qdJki`HTV6%og)refLnJ{fkEusz{Jxwsp!fGe#$fY2YeMN@gR+sB=C`*@Sg z(PmeMGm1zINgTU{oB$FpHvW?B*o|O#B0I`% ziUzTa(7js4@xC!mHbJXndZJQQ;lJYJa_sqfd~J4qF!q8s^5%BAxq}Cl!zyp}crl(J NE_SCq^sDu_^e;y5_ILmQ delta 552 zcmWlVT}V@59LAq>_P*}yoU^lK7b<16i-I)AAic0gP{A5&oFMOl;YS(>L4_6>)Ig|^ zFrhVU!;m7oh{)(b*_V|?%SFtf3kMmNeOw5cgcTOiv-jrzKL7Xs@q3?}p~dyd@K}3g zeqkv6I#jyx(I0(j(&Qr`E`9SuJv=qqib&3c!u*|(Rd>$T>Y5B%VQc75&> z!Tx$CcQCIv>OH|Vbb2DGpS|^i@XU>umSswc&?Ge1IGTqHCi1p z9%gB=KWv6a_wWa8rX8AQ|6TKe(nXy!U-sw(SmpKBY~sAE_waE#WSN$~$|mR*t1DSe rfFa+h`hLK$T78ql8#vJF1Xi>-Q!*x%wNABh!kzkBUhCXn*)9G9v80fF diff --git a/jce_he.ts b/jce_he.ts index 0842582..d66194d 100644 --- a/jce_he.ts +++ b/jce_he.ts @@ -1,6 +1,46 @@ + + CalendarDialog + + + Dialog + בחירת תאריכים + + + + <h1><b>For The Best CSV Export, Please Enter Correctly + <h1><b>על מנת לקבל קובץ נכון, הקפד על התאריכים + + + + Semester Starts At: + <b> הסמסטר מתחיל ב: + + + + Semester Ends At: + <b>הסמסטר נגמר ב: + + + + [ ! ] Start & End cannot be the same + [!] התחלה וסוף לא יכולים להיות באותו היום + + + + + The End of the semester can NOT be equal or before semester begins. + סוף סמסטר לא יכול להיות לפני או באותו היום בו הסמסטר מתחיל. + + + + + Looks ok, Press OK + נראה טוב, לחץ על המשך + + MainScreen @@ -103,7 +143,7 @@ Export to CSV - CSV ייצא אל קובץ + .CSV ייצא אל קובץ @@ -189,80 +229,80 @@ שגיאה בהכנסת נתונים - + CREDITS-ROOL-UP1 - + CREDITS-ROOL-UP2 - + CREDITS-ROOL-UP3 - + CREDITS-ROOL-UP4 - + DevBy פותח על ידי - + Liran לירן בן גידה - + Sagi שגיא דיין - + HELP1 - + HELP2 - + HELP3 - + HELP4 - + HELP5 - + HELP6 - - + + Settings הגדרות - - - + + + Your settings will take effect next time you start the program ההגדרות שלך ייכנסו לתוקפן בפעם הבאה שתפעיל את התוכנה @@ -270,14 +310,19 @@ QObject - + Exported Successfuly! הייצוא הושלם! - - <center>Something went wrong...<br></center>Maybe: <ul><li>You Canceled</li><li>Unable to save the File - try again</li></ul><br><br><b><center>In case of a serious problem, please file a bug report.<br>thank you. OpenJCE teem - + + Error on exporting. please check your file system. + טעות בעת ייצוא הקובץ. אנא בדוק אם הקובץ פתוח. + + + + Dates not valid + תאריכים לא חוקיים diff --git a/main/CalendarTab/CalendarManager.cpp b/main/CalendarTab/CalendarManager.cpp index 174639b..29f23e3 100644 --- a/main/CalendarTab/CalendarManager.cpp +++ b/main/CalendarTab/CalendarManager.cpp @@ -27,11 +27,10 @@ void CalendarManager::exportCalendarCSV() }else { msgBox.setIcon(QMessageBox::Critical); - msgBox.setText(QObject::tr("Error on exporting. please check your file system.")); + msgBox.setText(QObject::tr("Error on exporting.")); msgBox.exec(); } } - else { msgBox.setIcon(QMessageBox::Critical); diff --git a/resources/connectionstatus.qrc b/resources/connectionstatus.qrc index 895a2c8..6023c12 100644 --- a/resources/connectionstatus.qrc +++ b/resources/connectionstatus.qrc @@ -5,5 +5,6 @@ redStatusIcon.png icon.ico iconX.png + iconV.png diff --git a/resources/iconV.png b/resources/iconV.png new file mode 100644 index 0000000000000000000000000000000000000000..d6a220e2c48ded7b4dea5f24f6e93c8d16646814 GIT binary patch literal 580 zcmV-K0=xZ*P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf0oh4JK~y+Tm6BaZ z(_s|GpA9#{i?oCkp(b7>qKPJR;76jCL}TjwLg>mMBm|i(!LAaO61$SR@S>ZrFA9R7 zjG~NG$Ous;YRiv>=ybL1KNZ*h>f_(_`dKFX-JSEi56|JeM@0pM$fNtu&~NVpHqD_> zT~){UdtkaLnjx7D`W#mDgz>ZmoVGcs7Ly!GLedH3J{*8r6N7w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_>1PgUWrj^|~!O&8eBqd^!^3`htlw1;WT zOK<3SUJynAvNTB;V+6CGiOuY6fAuN7bq~TQrTx46>URt>P6<_2)mLC1M!z?WWIR&U zIJg7W9tZ2zS>lQt2w<^No#pN+MxosMuBW=Co(`weTe^{KqMfX&-yT8|1 zlg=FclPXA(o8AH=1UVM;RGq=uOblF=OIdpSM_@&72kg3b|5DEd{sE=V|L~6K+>ihO N002ovPDHLkV1nTzrCtC4 diff --git a/src/jceData/CSV/csv_exporter.cpp b/src/jceData/CSV/csv_exporter.cpp index 3844eca..4ec5a23 100644 --- a/src/jceData/CSV/csv_exporter.cpp +++ b/src/jceData/CSV/csv_exporter.cpp @@ -50,7 +50,7 @@ bool CSV_Exporter::exportCalendar(calendarSchedule *calSched, CalendarDialog *ca if(line != NULL) out << line << char(0x0A); #endif -#ifdef Q_OS_OSX +#ifdef Q_OS_OSX if(line != NULL) out << line << char(0x0A); #endif @@ -59,11 +59,9 @@ bool CSV_Exporter::exportCalendar(calendarSchedule *calSched, CalendarDialog *ca out << line << char(0x0D) << char(0x0A); #endif } + out.flush(); } -here: - out.flush(); - file.close(); qDebug() << "Saved Successfuly! - HazZaA!"; diff --git a/src/jceData/Calendar/calendardialog.cpp b/src/jceData/Calendar/calendardialog.cpp index 7c4cd71..e1e3115 100644 --- a/src/jceData/Calendar/calendardialog.cpp +++ b/src/jceData/Calendar/calendardialog.cpp @@ -7,10 +7,8 @@ CalendarDialog::CalendarDialog(QWidget *parent) : ui(new Ui::CalendarDialog) { ui->setupUi(this); - ui->calEnd->showToday(); - ui->calStart->showToday(); - - this->isOK = false; + changeLabeStatusIcon(true);//be default the dates are ok, i Updated it according to jce official dates + this->isOK = true; } CalendarDialog::~CalendarDialog() @@ -32,22 +30,18 @@ bool CalendarDialog::ok() { return this->isOK; } - -void CalendarDialog::on_calStart_clicked(const QDate &date) -{ - -} - void CalendarDialog::on_calStart_selectionChanged() { - if(ui->calStart->selectedDate() > ui->calEnd->selectedDate()){ - ui->lbl_status->setText("[ X ] The End of the semester is before it starts... "); + if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate()) + { + changeLabeStatusIcon(false); + ui->lbl_status->setText(tr("The End of the semester can NOT be equal or before semester begins.")); this->isOK = false; - }else if(ui->calStart->selectedDate() == ui->calEnd->selectedDate()){ - ui->lbl_status->setText("[ ! ] Semester Cannot start and end on the same date... Where are you studying?! :)"); - this->isOK = false; - }else{ - ui->lbl_status->setText("[ V ] Looks ok, Press OK"); + } + else + { + changeLabeStatusIcon(true); + ui->lbl_status->setText(tr("Looks ok, Press OK")); this->isOK = true; } } @@ -58,26 +52,28 @@ void CalendarDialog::on_buttonBox_accepted() qDebug() << "start bigger than end!"; } -void CalendarDialog::on_calEnd_clicked(const QDate &date) -{ - -} - -void CalendarDialog::on_calStart_activated(const QDate &date) -{ - //null -} - void CalendarDialog::on_calEnd_selectionChanged() { - if(ui->calStart->selectedDate() > ui->calEnd->selectedDate()){ - ui->lbl_status->setText("[ X ] The End of the semester is before it starts... "); + if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate()) + { + changeLabeStatusIcon(false); + ui->lbl_status->setText(tr("The End of the semester can NOT be equal or before semester begins.")); this->isOK = false; - }else if(ui->calStart->selectedDate() == ui->calEnd->selectedDate()){ - ui->lbl_status->setText("[ ! ] Semester Cannot start and end on the same date... Where are you studying?! :)"); - this->isOK = false; - }else{ - ui->lbl_status->setText("[ V ] Looks ok, Press OK"); + } + else + { + changeLabeStatusIcon(true); + ui->lbl_status->setText(tr("Looks ok, Press OK")); this->isOK = true; } + +} + +void CalendarDialog::changeLabeStatusIcon(bool goodOrBad) +{ + if (goodOrBad == true) //good date! + iconPixStatus.load(":/icons/iconV.png"); + else + iconPixStatus.load(":/icons/iconX.png"); + this->ui->labelIconStatus->setPixmap(iconPixStatus); } diff --git a/src/jceData/Calendar/calendardialog.h b/src/jceData/Calendar/calendardialog.h index dc79173..e0c6edc 100644 --- a/src/jceData/Calendar/calendardialog.h +++ b/src/jceData/Calendar/calendardialog.h @@ -21,16 +21,15 @@ public: bool ok(); private slots: - void on_calStart_activated(const QDate &date); void on_calStart_selectionChanged(); - void on_calStart_clicked(const QDate &date); - void on_buttonBox_accepted(); - void on_calEnd_clicked(const QDate &date); void on_calEnd_selectionChanged(); + void on_buttonBox_accepted(); private: + void changeLabeStatusIcon(bool goodOrBad); Ui::CalendarDialog *ui; bool isOK; + QPixmap iconPixStatus; }; #endif // CALENDARDIALOG_H diff --git a/src/jceData/Calendar/calendardialog.ui b/src/jceData/Calendar/calendardialog.ui index 7dd0a69..d808852 100644 --- a/src/jceData/Calendar/calendardialog.ui +++ b/src/jceData/Calendar/calendardialog.ui @@ -6,79 +6,171 @@ 0 0 - 671 - 343 + 577 + 268 Dialog - - - - - - - <h1><b>For The Best CSV Export, Please Enter Correctly - - - - - - - - - - - - - Semester Starts At: - - - - - - - Semester Ends At: - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - [ ! ] Start & End cannot be the same - - - - - - - - + + + + 10 + 10 + 551 + 235 + + + + + + + <body><p><span style=" font-size:9pt; font-weight:600;">The dates were chosen according to JCE General Academic Calendar for the first semester</span></p> + + + + + + + + + + + + + Semester Starts At: + + + + + + + Semester Ends At: + + + + + + + + + + + + + + Qt::ImhNone + + + + 2014 + 10 + 26 + + + + + 2000 + 9 + 14 + + + + + 2080 + 12 + 31 + + + + true + + + QCalendarWidget::NoVerticalHeader + + + + + + + + 2015 + 2 + 1 + + + + + 2000 + 9 + 14 + + + + + 2080 + 12 + 31 + + + + true + + + QCalendarWidget::NoVerticalHeader + + + + + + + + + + + + + + + + + + + + <b>Please chose your dates correctly</b> + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + +