diff --git a/jce_en.qm b/jce_en.qm index 78fec6e..c62920a 100644 Binary files a/jce_en.qm and b/jce_en.qm differ diff --git a/jce_en.ts b/jce_en.ts index a60083e..87fc04c 100644 --- a/jce_en.ts +++ b/jce_en.ts @@ -1,6 +1,46 @@ + + 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 952a5ca..7181de7 100644 Binary files a/jce_he.qm and b/jce_he.qm differ 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 0000000..d6a220e Binary files /dev/null and b/resources/iconV.png differ diff --git a/resources/iconX.png b/resources/iconX.png index cffc748..d260842 100644 Binary files a/resources/iconX.png and b/resources/iconX.png differ 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 + + + + + + + + +