print/show config format execption
This commit is contained in:
orang tua
ee936541c6
melakukan
84ef555774
11
window.cpp
11
window.cpp
@ -23,6 +23,7 @@
|
|||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QFileIconProvider>
|
#include <QFileIconProvider>
|
||||||
|
#include <QDebug>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
@ -55,9 +56,19 @@ Window::~Window()
|
|||||||
|
|
||||||
|
|
||||||
void Window::initFromConfig()
|
void Window::initFromConfig()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
this->userEntryButtons = generateEntryButtons(configProvider->getUserEntries());
|
this->userEntryButtons = generateEntryButtons(configProvider->getUserEntries());
|
||||||
this->systemEntryButtons = generateEntryButtons(configProvider->getSystemEntries());
|
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);
|
populateGrid(this->userEntryButtons);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Memuat…
Reference in New Issue
Block a user