Skip to content

Commit ab8e30b

Browse files
committed
use global::sendToUser() to explain world inconsitencies to users
1 parent 13b9cee commit ab8e30b

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/mainwindow/mainwindow.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "../display/mapcanvas.h"
1818
#include "../display/mapwindow.h"
1919
#include "../global/AsyncTasks.h"
20+
#include "../global/SendToUser.h"
2021
#include "../global/SignalBlocker.h"
2122
#include "../global/Version.h"
2223
#include "../global/window_utils.h"
@@ -2020,6 +2021,8 @@ void MainWindow::onSuccessfulLoad(const MapLoadData &mapLoadData)
20202021

20212022
setCurrentFile(mapData.getFileName());
20222023
showStatusShort(tr("File loaded"));
2024+
2025+
global::sendToUser("Map loaded.\n");
20232026
}
20242027

20252028
void MainWindow::onSuccessfulMerge(const Map &map, const InfomarkDb &infomarks)

src/mapfrontend/mapfrontend.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include "mapfrontend.h"
88

9+
#include "../global/SendToUser.h"
910
#include "../global/Timer.h"
1011
#include "../global/logging.h"
1112
#include "../global/progresscounter.h"
@@ -73,7 +74,8 @@ bool MapFrontend::createEmptyRoom(const Coordinate &c)
7374
{
7475
const auto &map = getCurrentMap();
7576
if (map.findRoomHandle(c)) {
76-
qWarning() << "A room already exists at the chosen position.";
77+
MMLOG_ERROR() << "A room already exists at the chosen position.";
78+
global::sendToUser("A room already exists at the chosen position.\n");
7779
return false;
7880
}
7981

@@ -227,6 +229,7 @@ bool MapFrontend::applySingleChange(ProgressCounter &pc, const Change &change)
227229
result = m_current.map.applySingleChange(pc, change);
228230
} catch (const std::exception &e) {
229231
MMLOG_ERROR() << "Exception: " << e.what();
232+
global::sendToUser(QString("%1\n").arg(e.what()));
230233
return false;
231234
}
232235

@@ -247,6 +250,7 @@ bool MapFrontend::applyChanges(ProgressCounter &pc, const ChangeList &changes)
247250
result = m_current.map.apply(pc, changes);
248251
} catch (const std::exception &e) {
249252
MMLOG_ERROR() << "Exception: " << e.what();
253+
global::sendToUser(QString("%1\n").arg(e.what()));
250254
return false;
251255
}
252256

0 commit comments

Comments
 (0)