Fix some minor window issues

This commit is contained in:
GriffinR 2024-08-14 22:46:37 -04:00
parent 256f6eed54
commit 403bade407
4 changed files with 9 additions and 5 deletions

View file

@ -22,6 +22,8 @@ The **"Breaking Changes"** listed below are changes that have been made in the d
- Fix config files being written before the project is opened successfully. - Fix config files being written before the project is opened successfully.
- Fix the map and other project info still displaying if a new project fails to open. - Fix the map and other project info still displaying if a new project fails to open.
- Fix unsaved changes being ignored when quitting (such as with Cmd+Q on macOS). - Fix unsaved changes being ignored when quitting (such as with Cmd+Q on macOS).
- Fix `About porymap` opening a new window each time it's activated.
- Fix the `Edit History` window not raising to the front when reactivated.
## [5.4.1] - 2024-03-21 ## [5.4.1] - 2024-03-21
### Fixed ### Fixed

View file

@ -28,6 +28,7 @@
#include "projectsettingseditor.h" #include "projectsettingseditor.h"
#include "customscriptseditor.h" #include "customscriptseditor.h"
#include "updatepromoter.h" #include "updatepromoter.h"
#include "aboutporymap.h"
@ -312,6 +313,7 @@ private:
QPointer<CustomScriptsEditor> customScriptsEditor = nullptr; QPointer<CustomScriptsEditor> customScriptsEditor = nullptr;
QPointer<UpdatePromoter> updatePromoter = nullptr; QPointer<UpdatePromoter> updatePromoter = nullptr;
QPointer<NetworkAccessManager> networkAccessManager = nullptr; QPointer<NetworkAccessManager> networkAccessManager = nullptr;
QPointer<AboutPorymap> aboutWindow = nullptr;
FilterChildrenProxyModel *mapListProxyModel; FilterChildrenProxyModel *mapListProxyModel;
QStandardItemModel *mapListModel; QStandardItemModel *mapListModel;
QList<QStandardItem*> *mapGroupItemsList; QList<QStandardItem*> *mapGroupItemsList;

View file

@ -1,6 +1,5 @@
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "aboutporymap.h"
#include "project.h" #include "project.h"
#include "log.h" #include "log.h"
#include "editor.h" #include "editor.h"
@ -330,7 +329,7 @@ void MainWindow::initEditor() {
QAction *showHistory = new QAction("Show Edit History...", this); QAction *showHistory = new QAction("Show Edit History...", this);
showHistory->setObjectName("action_ShowEditHistory"); showHistory->setObjectName("action_ShowEditHistory");
showHistory->setShortcut(QKeySequence("Ctrl+E")); showHistory->setShortcut(QKeySequence("Ctrl+E"));
connect(showHistory, &QAction::triggered, [undoView](){ undoView->show(); }); connect(showHistory, &QAction::triggered, [this, undoView](){ openSubWindow(undoView); });
ui->menuEdit->addAction(showHistory); ui->menuEdit->addAction(showHistory);
@ -2774,9 +2773,9 @@ void MainWindow::on_toolButton_CollapseAll_clicked()
void MainWindow::on_actionAbout_Porymap_triggered() void MainWindow::on_actionAbout_Porymap_triggered()
{ {
AboutPorymap *window = new AboutPorymap(this); if (!this->aboutWindow)
window->setAttribute(Qt::WA_DeleteOnClose); this->aboutWindow = new AboutPorymap(this);
window->show(); openSubWindow(this->aboutWindow);
} }
void MainWindow::on_actionOpen_Log_File_triggered() { void MainWindow::on_actionOpen_Log_File_triggered() {

View file

@ -7,6 +7,7 @@ AboutPorymap::AboutPorymap(QWidget *parent) :
ui(new Ui::AboutPorymap) ui(new Ui::AboutPorymap)
{ {
ui->setupUi(this); ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
this->ui->label_Version->setText(QString("Version %1 - %2").arg(QCoreApplication::applicationVersion()).arg(QStringLiteral(__DATE__))); this->ui->label_Version->setText(QString("Version %1 - %2").arg(QCoreApplication::applicationVersion()).arg(QStringLiteral(__DATE__)));
this->ui->textBrowser->setSource(QUrl("qrc:/CHANGELOG.md")); this->ui->textBrowser->setSource(QUrl("qrc:/CHANGELOG.md"));