From 2b49bad66bdd7078e5e889b231c9b13fe4264af1 Mon Sep 17 00:00:00 2001 From: Mercury13 Date: Tue, 29 Mar 2022 18:22:08 +0300 Subject: [PATCH] +icon, fixed DisambigPair --- UTranslator/FmDisambigPair.cpp | 3 ++- UTranslator/FmMain.cpp | 17 ++++++++++++++++- UTranslator/FmMain.h | 2 ++ UTranslator/UTranslator-win.ico | Bin 0 -> 1406 bytes UTranslator/UTranslator.pro | 6 ++++++ 5 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 UTranslator/UTranslator-win.ico diff --git a/UTranslator/FmDisambigPair.cpp b/UTranslator/FmDisambigPair.cpp index b812527..0fccc7c 100644 --- a/UTranslator/FmDisambigPair.cpp +++ b/UTranslator/FmDisambigPair.cpp @@ -2,9 +2,10 @@ #include "ui_FmDisambigPair.h" #include "u_Qstrings.h" +#include "QtConsts.h" FmDisambigPair::FmDisambigPair(QWidget *parent) : - QDialog(parent), + QDialog(parent, QDlgType::FIXED), ui(new Ui::FmDisambigPair) { ui->setupUi(this); diff --git a/UTranslator/FmMain.cpp b/UTranslator/FmMain.cpp index 456922b..6b1ec81 100644 --- a/UTranslator/FmMain.cpp +++ b/UTranslator/FmMain.cpp @@ -465,9 +465,9 @@ void FmMain::reenable() bool hasProject {project }; bool isOriginal = (isMainVisible && hasProject && project->info.type == tr::PrjType::ORIGINAL); - //bool isTranslation = (hasProject && !isOriginal); // Menu: File + // New, Open are always available ui->acSave->setEnabled(hasProject); ui->acSaveAs->setEnabled(hasProject); @@ -633,3 +633,18 @@ void FmMain::updateCaption() s += "UTranslator"; setWindowTitle(s); } + + +void FmMain::doSaveAs() +{ + /// @todo [urgent] doSaveAs +} + + +void FmMain::doSave() +{ + if (!project) + return; + if (project->fname.empty()) + doSaveAs(); +} diff --git a/UTranslator/FmMain.h b/UTranslator/FmMain.h index dbf2d19..a0538f1 100644 --- a/UTranslator/FmMain.h +++ b/UTranslator/FmMain.h @@ -110,6 +110,8 @@ private slots: // Menu: File void doNew(); + void doSave(); + void doSaveAs(); // Menu: Edit void acceptCurrObject(); void revertCurrObject(); diff --git a/UTranslator/UTranslator-win.ico b/UTranslator/UTranslator-win.ico new file mode 100644 index 0000000000000000000000000000000000000000..edf97ca90a75b3d81b64a75d33e900509887581d GIT binary patch literal 1406 zcmZQzU<5(|0R|w+!H~hqz#zuJz@P!dKp_SNAO?x!1Lx-#F)T?nVQBYKV6a>Nhk>E; zD+5E!Iec11lt`kWMCMW@eZPAf1d% yOw2G7F!(^7jEsy-FcT=%53(DEK`sK>4Z~RZK)XTqgD?Zb2Yyt1fSG}T6bt|gwi!PF literal 0 HcmV?d00001 diff --git a/UTranslator/UTranslator.pro b/UTranslator/UTranslator.pro index 824635d..32262cd 100644 --- a/UTranslator/UTranslator.pro +++ b/UTranslator/UTranslator.pro @@ -47,4 +47,10 @@ FORMS += \ win32 { # and W64 too LIBS += -lcomdlg32 + + RC_ICONS = UTranslator-win.ico + QMAKE_TARGET_COMPANY = Mikhail Merkuryev + QMAKE_TARGET_PRODUCT = UTranslator + QMAKE_TARGET_DESCRIPTION = UTranslator: translation tool for Unicodia + QMAKE_TARGET_COPYRIGHT = Mikhail Merkuryev }