Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit a319eca9 authored by Frederik Schwarzer's avatar Frederik Schwarzer

Show error message to the user

If the KMahjongg lib is not found, show a message to the user instead of
just showing an empty play field.

Differential Revision: https://phabricator.kde.org/D9805
parent 7843cfcd
......@@ -27,6 +27,7 @@
#include <array>
// Qt
#include <QMessageBox>
#include <QMouseEvent>
#include <QPainter>
#include <QStandardPaths>
......@@ -97,12 +98,16 @@ Board::Board(QWidget * parent)
void Board::loadSettings()
{
if (!loadTileset(Prefs::tileSet())) {
qCWarning(KSHISEN_General) << "An error occurred when loading the tileset. " << Prefs::tileSet() << " and the default tileset have been tried.";
QMessageBox::critical(this,
i18n("Error Loading Tiles"),
i18nc("%1 is a path to a tileset file", "An error occurred when loading the tileset. %1 and the default tileset have been tried.\nPlease install the KMahjongg library.", Prefs::tileSet()));
}
// Load background
if (!loadBackground(Prefs::background())) {
qCWarning(KSHISEN_General) << "An error occurred when loading the background. " << Prefs::background() << " and the default background have been tried.";
QMessageBox::critical(this,
i18n("Error Loading Background"),
i18nc("%1 is a path to a background image file", "An error occurred when loading the background. %1 and the default background have been tried.\nPlease install the KMahjongg library.", Prefs::background()));
}
// There are tile sets, that have only one tile for e.g. the flowers group.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment