Fix #10
Added a bool flag to main. calendarLoaded. @liranbg - you method did not work (at least on linux)... now user will be prompted with an error message dialog. No Crash. Closing bug #10
This commit is contained in:
parent
3287bfe31b
commit
99aa0ed909
3 changed files with 14 additions and 3 deletions
|
@ -12,8 +12,8 @@ void CalendarManager::setCalendar(std::string html)
|
||||||
}
|
}
|
||||||
void CalendarManager::exportCalendarCSV() //need to add fix to the null pointer bug
|
void CalendarManager::exportCalendarCSV() //need to add fix to the null pointer bug
|
||||||
{
|
{
|
||||||
if (caliSchedPtr->getCourses() == NULL)
|
// if (caliSchedPtr->getCourses()->empty())
|
||||||
return;
|
// return;
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
int buttonClicked = caliDialog->exec();
|
int buttonClicked = caliDialog->exec();
|
||||||
if (buttonClicked == 0) //cancel?
|
if (buttonClicked == 0) //cancel?
|
||||||
|
|
|
@ -49,6 +49,9 @@ MainScreen::MainScreen(QWidget *parent) :QMainWindow(parent), ui(new Ui::MainScr
|
||||||
//Local Check and ui setting.
|
//Local Check and ui setting.
|
||||||
checkLocale();
|
checkLocale();
|
||||||
|
|
||||||
|
//calendar bug fix
|
||||||
|
calendarLoaded = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MainScreen::~MainScreen()
|
MainScreen::~MainScreen()
|
||||||
|
@ -264,6 +267,7 @@ void MainScreen::on_getCalendarBtn_clicked()
|
||||||
//ui->plainTextEdit->setPlainText(loginHandel->getCurrentPageContect());
|
//ui->plainTextEdit->setPlainText(loginHandel->getCurrentPageContect());
|
||||||
calendar->resetTable();
|
calendar->resetTable();
|
||||||
calendar->setCalendar(loginHandel->getCurrentPageContect().toStdString());
|
calendar->setCalendar(loginHandel->getCurrentPageContect().toStdString());
|
||||||
|
calendarLoaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (status == jceLogin::JCE_NOT_CONNECTED)
|
else if (status == jceLogin::JCE_NOT_CONNECTED)
|
||||||
|
@ -276,7 +280,12 @@ void MainScreen::on_exportToCVSBtn_clicked()
|
||||||
{
|
{
|
||||||
if (loginHandel->isLoggedInFlag())
|
if (loginHandel->isLoggedInFlag())
|
||||||
{
|
{
|
||||||
|
if(calendarLoaded)
|
||||||
this->calendar->exportCalendarCSV();
|
this->calendar->exportCalendarCSV();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QMessageBox::critical(this,tr("Error"),"No Calendar was loaded."); //Need Translation
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,8 @@ private:
|
||||||
coursesTableManager *courseTableMgr;
|
coursesTableManager *courseTableMgr;
|
||||||
loginHandler *loginHandel;
|
loginHandler *loginHandel;
|
||||||
|
|
||||||
|
bool calendarLoaded;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAINSCREEN_H
|
#endif // MAINSCREEN_H
|
||||||
|
|
Loading…
Reference in a new issue