Show status message on program save
MODIFY
src/mainwindow.cpp
src/mainwindow.cpp
@@ -145,6 +145,9 @@ void MainWindow::setupStatusBar() {
// Setup systemIO status widget
setupStatusWidget(SystemIO);
+
+ // Setup general info status widget
+ setupStatusWidget(General);
}
void MainWindow::tabChanged(int index) {
@@ -333,17 +336,28 @@ void MainWindow::saveFilesTriggered() {
return;
}
+ bool didSave = false;
+ QStringList savedFiles;
+
if (!diag.assemblyPath().isEmpty()) {
QFile file(diag.assemblyPath());
+ savedFiles << diag.assemblyPath();
writeTextFile(file, static_cast<EditTab*>(m_tabWidgets.at(EditTabID).tab)->getAssemblyText());
+ didSave |= true;
}
if (!diag.binaryPath().isEmpty()) {
QFile file(diag.binaryPath());
if (auto* program = static_cast<EditTab*>(m_tabWidgets.at(EditTabID).tab)->getBinaryData()) {
+ savedFiles << diag.binaryPath();
writeBinaryFile(file, *program);
+ didSave |= true;
}
}
+
+ if (didSave) {
+ GeneralStatusManager::setStatusTimed("Saved files " + savedFiles.join(", "), 2000);
+ }
}
void MainWindow::saveFilesAsTriggered() {

MODIFY
src/mainwindow.h
src/mainwindow.h
#include <QMainWindow>
#include "assembler/program.h"
+#include "statusmanager.h"
QT_FORWARD_DECLARE_CLASS(QToolBar)
QT_FORWARD_DECLARE_CLASS(QStackedWidget)
@@ -10,6 +11,8 @@ QT_FORWARD_DECLARE_CLASS(QActionGroup)
namespace Ripes {
+StatusManager(General);
+
namespace Ui {
class MainWindow;
}

Show status message on program save