diff --git a/window.cpp b/window.cpp index 11aa344..fc14693 100644 --- a/window.cpp +++ b/window.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include "window.h" @@ -56,8 +57,18 @@ Window::~Window() void Window::initFromConfig() { - this->userEntryButtons = generateEntryButtons(configProvider->getUserEntries()); - this->systemEntryButtons = generateEntryButtons(configProvider->getSystemEntries()); + try + { + this->userEntryButtons = generateEntryButtons(configProvider->getUserEntries()); + this->systemEntryButtons = generateEntryButtons(configProvider->getSystemEntries()); + } + catch(const ConfigFormatException &e) + { + qDebug() << "Config is misformated: " << e.what(); + QMessageBox::critical(this, "Misformated config file", e.what()); + qApp->quit(); + } + populateGrid(this->userEntryButtons); }