Skip to content

Commit 450c3fc

Browse files
Merge branch 'development' into add-telnet-uri-support
2 parents e945b1f + 5baa6d8 commit 450c3fc

File tree

3 files changed

+76
-6
lines changed

3 files changed

+76
-6
lines changed

src/TConsole.cpp

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,13 @@ TConsole::TConsole(Host* pH, const QString& name, const ConsoleType type, QWidge
338338
replayButton->setMaximumSize(QSize(30, 30));
339339
replayButton->setSizePolicy(sizePolicy5);
340340
replayButton->setFocusPolicy(Qt::NoFocus);
341-
replayButton->setIcon(QIcon(qsl(":/icons/media-tape.png")));
342-
replayButton->setToolTip(utils::richText(tr("Toggle recording of replays")));
341+
342+
QIcon replayIcon;
343+
replayIcon.addPixmap(QPixmap(qsl(":/icons/media-tape.png")), QIcon::Normal, QIcon::Off);
344+
replayIcon.addPixmap(QPixmap(qsl(":/icons/media-tape-red-cross.png")), QIcon::Normal, QIcon::On);
345+
replayButton->setIcon(replayIcon);
346+
//: Button tooltip for the replay recording toggle button
347+
replayButton->setToolTip(utils::richText(tr("Start recording of replay")));
343348
connect(replayButton, &QAbstractButton::clicked, this, &TConsole::slot_toggleReplayRecording);
344349

345350
logButton = new QToolButton;
@@ -348,7 +353,8 @@ TConsole::TConsole(Host* pH, const QString& name, const ConsoleType type, QWidge
348353
logButton->setCheckable(true);
349354
logButton->setSizePolicy(sizePolicy5);
350355
logButton->setFocusPolicy(Qt::NoFocus);
351-
logButton->setToolTip(utils::richText(tr("Toggle logging")));
356+
//: Button tooltip for the logging button
357+
logButton->setToolTip(utils::richText(tr("Start logging game output to log file.")));
352358

353359
QIcon logIcon;
354360
logIcon.addPixmap(QPixmap(qsl(":/icons/folder-downloads.png")), QIcon::Normal, QIcon::Off);
@@ -399,7 +405,12 @@ TConsole::TConsole(Host* pH, const QString& name, const ConsoleType type, QWidge
399405

400406
emergencyStop->setMinimumSize(QSize(30, 30));
401407
emergencyStop->setMaximumSize(QSize(30, 30));
402-
emergencyStop->setIcon(QIcon(qsl(":/icons/edit-bomb.png")));
408+
409+
QIcon emergencyIcon;
410+
emergencyIcon.addPixmap(QPixmap(qsl(":/icons/edit-bomb.png")), QIcon::Normal, QIcon::Off);
411+
emergencyIcon.addPixmap(QPixmap(qsl(":/icons/red-bomb.png")), QIcon::Normal, QIcon::On);
412+
emergencyStop->setIcon(emergencyIcon);
413+
403414
emergencyStop->setSizePolicy(sizePolicy4);
404415
emergencyStop->setFocusPolicy(Qt::NoFocus);
405416
emergencyStop->setCheckable(true);
@@ -878,20 +889,30 @@ void TConsole::slot_toggleReplayRecording()
878889
mReplayFile.setFileName(mLogFileName);
879890
if (!mReplayFile.open(QIODevice::WriteOnly)) {
880891
qWarning() << "TConsole: failed to open replay file for writing:" << mReplayFile.errorString();
892+
mRecordReplay = false;
893+
//: Informational message displayed when replay recording file could not be opened
894+
printSystemMessage(tr("Failed to open replay recording file for writing.") % QChar::LineFeed);
895+
return;
881896
}
882897
if (mudlet::scmRunTimeQtVersion >= QVersionNumber(5, 13, 0)) {
883898
mReplayStream.setVersion(mudlet::scmQDataStreamFormat_5_12);
884899
}
885900
mReplayStream.setDevice(&mReplayFile);
886901
mpHost->mTelnet.recordReplay();
887902
printSystemMessage(tr("Replay recording has started. File: %1").arg(mReplayFile.fileName()) % QChar::LineFeed);
903+
//: Button tooltip for the replay recording toggle button
904+
replayButton->setToolTip(utils::richText(tr("Stop recording of replay")));
888905
} else {
889906
if (!mReplayFile.commit()) {
890907
qDebug() << "TConsole::slot_toggleReplayRecording: error saving replay: " << mReplayFile.errorString();
908+
//: Informational message displayed when replay recording is stopped but could not be saved
891909
printSystemMessage(tr("Replay recording has been stopped, but couldn't be saved.") % QChar::LineFeed);
892910
} else {
911+
//: Informational message displayed when replay recording is stopped
893912
printSystemMessage(tr("Replay recording has been stopped. File: %1").arg(mReplayFile.fileName()) % QChar::LineFeed);
894913
}
914+
//: Button tooltip for the replay recording toggle button
915+
replayButton->setToolTip(utils::richText(tr("Start recording of replay")));
895916
}
896917
}
897918

@@ -1904,10 +1925,8 @@ void TConsole::slot_stopAllItems(bool b)
19041925
{
19051926
if (b) {
19061927
mpHost->stopAllTriggers();
1907-
emergencyStop->setIcon(QIcon(qsl(":/icons/red-bomb.png")));
19081928
} else {
19091929
mpHost->reenableAllTriggers();
1910-
emergencyStop->setIcon(QIcon(qsl(":/icons/edit-bomb.png")));
19111930
}
19121931
}
19131932

0 commit comments

Comments
 (0)