Testing the Bug #10

This commit is contained in:
Sagi Dayan 2014-09-14 15:01:27 +03:00
parent 3ba347bcf8
commit 582a959fb3
3 changed files with 8 additions and 11 deletions

View file

@ -10,14 +10,14 @@ void CalendarManager::setCalendar(std::string html)
{
caliSchedPtr->setPage(html);
}
void CalendarManager::exportCalendarCSV() //need to add fix to the null pointer bug
bool CalendarManager::exportCalendarCSV() //need to add fix to the null pointer bug
{
// if (caliSchedPtr->getCourses()->empty())
// return;
if (this->caliSchedPtr->getCourses()->empty())
return false;
QMessageBox msgBox;
int buttonClicked = caliDialog->exec();
if (buttonClicked == 0) //cancel?
return;
return false;
//calDialog.getStartDate(),calDialog.getEndDate()
if(caliDialog->ok())
{
@ -26,6 +26,7 @@ void CalendarManager::exportCalendarCSV() //need to add fix to the null pointer
msgBox.setIcon(QMessageBox::Information);
msgBox.setText(QObject::tr("Exported Successfuly!"));
msgBox.exec();
return true;
}else
{
msgBox.setIcon(QMessageBox::Critical);
@ -39,6 +40,7 @@ void CalendarManager::exportCalendarCSV() //need to add fix to the null pointer
msgBox.setText(QObject::tr("Dates not valid"));
msgBox.exec();
}
return false;
}

View file

@ -17,7 +17,7 @@ public:
delete caliSchedPtr;
delete caliDialog;
}
void exportCalendarCSV();
bool exportCalendarCSV();
void setCalendar(std::string html);
void resetTable() { if (caliSchedPtr != NULL) caliSchedPtr->clearTableItems(); }

View file

@ -49,8 +49,6 @@ MainScreen::MainScreen(QWidget *parent) :QMainWindow(parent), ui(new Ui::MainScr
//Local Check and ui setting.
checkLocale();
//calendar bug fix
calendarLoaded = false;
}
@ -267,7 +265,6 @@ void MainScreen::on_getCalendarBtn_clicked()
//ui->plainTextEdit->setPlainText(loginHandel->getCurrentPageContect());
calendar->resetTable();
calendar->setCalendar(loginHandel->getCurrentPageContect().toStdString());
calendarLoaded = true;
}
else if (status == jceLogin::JCE_NOT_CONNECTED)
@ -280,9 +277,7 @@ void MainScreen::on_exportToCVSBtn_clicked()
{
if (loginHandel->isLoggedInFlag())
{
if(calendarLoaded)
this->calendar->exportCalendarCSV();
else
if(!this->calendar->exportCalendarCSV())
{
QMessageBox::critical(this,tr("Error"),"No Calendar was loaded."); //Need Translation
}