From e6cfc6e12ad735378ca7e1e7658f71e011822371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikko=20Syrj=C3=A4?= Date: Thu, 28 Mar 2019 00:03:23 +0200 Subject: Labs branch with MessageDialog. --- main.cpp | 5 +++-- main.qml | 12 +++++++++++- symedit.pro | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 1cd4b49..ff2a60a 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,6 @@ #include -#include +//#include +#include #include #include #include @@ -16,7 +17,7 @@ int main(int argc, char *argv[]) QCoreApplication::setApplicationVersion("1.0"); QSettings::setDefaultFormat(QSettings::IniFormat); - QGuiApplication app(argc, argv); + QApplication app(argc, argv); // set base language translators QLocale locale; diff --git a/main.qml b/main.qml index edad4e7..32ab644 100644 --- a/main.qml +++ b/main.qml @@ -3,6 +3,8 @@ import QtQuick.Controls 1.4 import QtQuick.Layouts 1.0 import QtQuick.Dialogs 1.2 +import Qt.labs.platform 1.1 as Labs + ApplicationWindow { property int mousex: 0 @@ -326,7 +328,7 @@ ApplicationWindow editor.update() } } - +/* Dialog { id: aboutdialog @@ -339,6 +341,14 @@ ApplicationWindow } standardButtons: StandardButton.Ok } +*/ + Labs.MessageDialog + { + id: aboutdialog + title: qsTrId("id_dialog_about") + text: qsTrId("id_dialog_about_text") + "\n\n© 2019 Mikko Syrjä" + buttons: Labs.MessageDialog.Ok + } onXChanged: { manager.setGeometry(Qt.point(x, y), Qt.size(width, height)) } onYChanged: { manager.setGeometry(Qt.point(x, y), Qt.size(width, height)) } diff --git a/symedit.pro b/symedit.pro index eb4f653..130fbff 100644 --- a/symedit.pro +++ b/symedit.pro @@ -1,4 +1,4 @@ -QT += quick +QT += quick widgets CONFIG += c++11 # The following define makes your compiler emit warnings if you use -- cgit v1.2.3 From 0264982f440e0c0d0121556440b40e8b5ba6d750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikko=20Syrj=C3=A4?= Date: Thu, 28 Mar 2019 00:20:50 +0200 Subject: Use Labs file dialog. --- main.qml | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/main.qml b/main.qml index 32ab644..f554c75 100644 --- a/main.qml +++ b/main.qml @@ -1,7 +1,6 @@ import QtQuick 2.9 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.0 -import QtQuick.Dialogs 1.2 import Qt.labs.platform 1.1 as Labs @@ -311,37 +310,24 @@ ApplicationWindow } } - FileDialog + Labs.FileDialog { id: filedialog - title: (selectExisting ? qsTrId("id_dialog_open_file") : qsTrId("id_dialog_save_file")) + title: (fileMode === Labs.FileDialog.OpenFile ? qsTrId("id_dialog_open_file") : qsTrId("id_dialog_save_file")) nameFilters: [ qsTrId("id_dialog_symbol_files"), qsTrId("id_dialog_all_files") ] onAccepted: { - if ( selectExisting ) + if ( fileMode === Labs.FileDialog.OpenFile ) { - manager.open(fileUrl) + manager.open(file) symbol = manager.getSymbol(true) } else // save - manager.save(fileUrl) + manager.save(file) editor.update() } } -/* - Dialog - { - id: aboutdialog - title: qsTrId("id_dialog_about") - Label - { - anchors.fill: parent - text: qsTrId("id_dialog_about_text") + "\n\n© 2019 Mikko Syrjä" - horizontalAlignment: Text.AlignHCenter - } - standardButtons: StandardButton.Ok - } -*/ + Labs.MessageDialog { id: aboutdialog @@ -403,7 +389,7 @@ ApplicationWindow function open() { - filedialog.selectExisting = true + filedialog.fileMode = Labs.FileDialog.OpenFile filedialog.folder = manager.getTextSetting("Directory") filedialog.open() } @@ -412,7 +398,7 @@ ApplicationWindow { if ( ask ) { - filedialog.selectExisting = false + filedialog.fileMode = Labs.FileDialog.SaveFile filedialog.folder = manager.getTextSetting("Directory") filedialog.open() } -- cgit v1.2.3 From 184ba759a0cfb4f6da11270733bf6ec118df14be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikko=20Syrj=C3=A4?= Date: Thu, 28 Mar 2019 01:27:44 +0200 Subject: Some final cleanup for labs branch. --- README.md | 33 ++++++++++++++++++++------------- main.cpp | 2 -- symedit.cpp | 2 +- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index edcf5ca..bbef0c1 100644 --- a/README.md +++ b/README.md @@ -4,22 +4,29 @@ Simple symbol editor for use with 3D-Win. https://gentleface.com/free_icon_set.html -krita: - icons: - 48x48 - transparent - line width: 6px - brush: basic-1 +krita icons: + 48x48 + transparent + line width: 6px + brush: basic-1 + +Windows icon creation with ImageMagick: + +convert icon16.png icon24.png icon32.png icon48.png icon256.png icon.ico + +Build html help in Windows: + +sphinx-build -M html . _build Windows deployment: C:\Users\Mikko\Code\Qt\5.12.2\msvc2017_64\bin\windeployqt.exe - --release - --qmldir ../../symedit - --no-translations - --no-compiler-runtime - --no-webkit2 - --no-angle - --no-opengl-sw + --debug --qmldir ../../symedit + --no-translations --no-compiler-runtime --no-webkit2 --no-angle --no-opengl-sw + . + +C:\Users\Mikko\Code\Qt\5.12.2\msvc2017_64\bin\windeployqt.exe + --release --qmldir ../../symedit + --no-translations --no-compiler-runtime --no-webkit2 --no-angle --no-opengl-sw . diff --git a/main.cpp b/main.cpp index ff2a60a..3ed41d6 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,4 @@ #include -//#include #include #include #include @@ -22,7 +21,6 @@ int main(int argc, char *argv[]) // set base language translators QLocale locale; QTranslator backuptranslator, localetranslator, currenttranslator; -// if ( backuptranslator.load(":/locale/symedit.fi_FI.qm") ) if ( backuptranslator.load(":/locale/symedit.en_GB.qm") ) QCoreApplication::installTranslator(&backuptranslator); if ( localetranslator.load(locale, ":/locale/symedit.") ) diff --git a/symedit.cpp b/symedit.cpp index 2cf2ad9..555a0da 100644 --- a/symedit.cpp +++ b/symedit.cpp @@ -502,7 +502,7 @@ void SymEditManager::help(QString topic) const { Q_UNUSED(topic); QString path = QCoreApplication::applicationDirPath(); - path.append("/help/").append(Language).append("/index.html"); + path.append("/help/").append(Language).append("/symedit/index.html"); QDesktopServices::openUrl(QUrl(path)); } -- cgit v1.2.3