Merge branch 'feature/saveLoadItemsInFromFile' into develop

This commit is contained in:
2025-12-23 14:02:12 +01:00
3 changed files with 13 additions and 4 deletions

View File

@ -20,6 +20,7 @@ void EditItemDialog::createContent() {
m_contentContainer = m_detailMapper; m_contentContainer = m_detailMapper;
m_outerLayout->insertWidget(0, m_contentContainer); m_outerLayout->insertWidget(0, m_contentContainer);
}
void EditItemDialog::accept() { void EditItemDialog::accept() {
m_detailMapper->submit(); m_detailMapper->submit();

View File

@ -22,7 +22,8 @@ MainWindow::MainWindow(QWidget* parent)
ui->setupUi(this); ui->setupUi(this);
m_core = std::make_unique<GenericCore>(); m_core = std::make_unique<GenericCore>();
setWindowTitle(windowTitle() + " [*]");
setWindowTitle(QCoreApplication::applicationName() + " [*]");
/// application icon /// application icon
const QString iconString = "://feature.png"; const QString iconString = "://feature.png";
@ -76,7 +77,7 @@ void MainWindow::closeEvent(QCloseEvent* event) {
switch (ret) { switch (ret) {
case QMessageBox::Save: case QMessageBox::Save:
// TODO m_core->saveItems(); emit saveItems();
event->accept(); event->accept();
break; break;
case QMessageBox::Discard: case QMessageBox::Discard:
@ -232,6 +233,11 @@ void MainWindow::onShowUndoViewToggled(bool checked) {
} }
} }
void MainWindow::saveItems() {
showStatusMessage(tr("Invoked 'File|Save'"));
m_core->saveItems();
}
void MainWindow::createActions() { void MainWindow::createActions() {
// TODO add generic menu actions (file/new, edit/cut, ...) // TODO add generic menu actions (file/new, edit/cut, ...)
createFileActions(); createFileActions();
@ -257,8 +263,7 @@ void MainWindow::createFileActions() {
m_saveAct = make_unique<QAction>(tr("&Save"), this); m_saveAct = make_unique<QAction>(tr("&Save"), this);
m_saveAct->setShortcuts(QKeySequence::Save); m_saveAct->setShortcuts(QKeySequence::Save);
m_saveAct->setStatusTip(tr("Save the document to disk")); m_saveAct->setStatusTip(tr("Save the document to disk"));
// connect(m_saveAct, &QAction::triggered, this, &MainWindow::save); connect(m_saveAct.get(), &QAction::triggered, this, &MainWindow::saveItems);
m_saveAct->setEnabled(false);
ui->menu_File->addAction(m_saveAct.get()); ui->menu_File->addAction(m_saveAct.get());
ui->menu_File->addSeparator(); ui->menu_File->addSeparator();

View File

@ -54,6 +54,9 @@ class MainWindow : public QMainWindow {
void onCleanStateChanged(bool clean); void onCleanStateChanged(bool clean);
void onShowUndoViewToggled(bool checked); void onShowUndoViewToggled(bool checked);
/// 'File' slots
void saveItems();
private: private:
Ui::MainWindow* ui; Ui::MainWindow* ui;