From 7ce6571e1f07ad457efef36450ab868e07acc3cd Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Tue, 10 Jan 2017 21:21:18 -0800 Subject: [PATCH 1/9] change to point to qmlterm fork --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index a5d28b3..f2b6192 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "qmltermwidget"] path = qmltermwidget - url = https://github.com/Swordfish90/qmltermwidget + url = https://github.com/adammathes/qmltermwidget -- 2.47.2 From d59ac20e38fbe73102895400998ae31eb0a8c04d Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Wed, 11 Jan 2017 17:36:37 -0800 Subject: [PATCH 2/9] merge multiterm branch --- app/main.cpp | 2 +- app/qml/CRTMainMenuBar.qml | 6 ++++++ app/qml/main.qml | 20 ++++++++++++++++++-- app/qml/resources.qrc | 1 + app/qml/root.qml | 33 +++++++++++++++++++++++++++++++++ qmltermwidget | 2 +- 6 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 app/qml/root.qml diff --git a/app/main.cpp b/app/main.cpp index 0cf128f..b8438a7 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) importPathList.prepend(QCoreApplication::applicationDirPath() + "/../../../qmltermwidget"); engine.setImportPathList(importPathList); - engine.load(QUrl(QStringLiteral ("qrc:/main.qml"))); + engine.load(QUrl(QStringLiteral ("qrc:/root.qml"))); if (engine.rootObjects().isEmpty()) { qDebug() << "Cannot load QML interface"; diff --git a/app/qml/CRTMainMenuBar.qml b/app/qml/CRTMainMenuBar.qml index 5be179d..0d27a1c 100644 --- a/app/qml/CRTMainMenuBar.qml +++ b/app/qml/CRTMainMenuBar.qml @@ -9,6 +9,12 @@ MenuBar { visible: defaultMenuBar.visible MenuItem {action: quitAction} } + Menu { + title: qsTr("Terminal") + visible: defaultMenuBar.visible + MenuItem {action: newAction} + MenuItem {action: closeAction} + } Menu { title: qsTr("Edit") visible: defaultMenuBar.visible diff --git a/app/qml/main.qml b/app/qml/main.qml index ed0801c..3d18a46 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -65,6 +65,22 @@ ApplicationWindow{ color: "#00000000" title: terminalContainer.title || qsTr("cool-retro-term") + Action { + id: newAction + text: qsTr("New Window") + shortcut: Qt.platform.os === "osx" ? StandardKey.New : "Ctrl+Shift+N" + onTriggered: { + root.newWindow() + } + } + Action { + id: closeAction + text: qsTr("Close Window") + shortcut: Qt.platform.os === "osx" ? StandardKey.Close : "Ctrl+Shift+W" + onTriggered: { + terminalWindow.close() + } + } Action { id: showMenubarAction text: qsTr("Show Menubar") @@ -162,7 +178,7 @@ ApplicationWindow{ onClosing: { // OSX Since we are currently supporting only one window // quit the application when it is closed. - if (Qt.platform.os === "osx") - Qt.quit() + //if (Qt.platform.os === "osx") + // Qt.quit() } } diff --git a/app/qml/resources.qrc b/app/qml/resources.qrc index 97f23c9..b5639f7 100644 --- a/app/qml/resources.qrc +++ b/app/qml/resources.qrc @@ -26,6 +26,7 @@ InsertNameDialog.qml SettingsEffectsTab.qml main.qml + root.qml SettingsTerminalTab.qml FontScanlines.qml fonts/1982-commodore64/C64_Pro_Mono_v1.0-STYLE.ttf diff --git a/app/qml/root.qml b/app/qml/root.qml new file mode 100644 index 0000000..bd279d9 --- /dev/null +++ b/app/qml/root.qml @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2013 "Filippo Scognamiglio" + * https://github.com/Swordfish90/cool-retro-term + * + * This file is part of cool-retro-term. + * + * cool-retro-term is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *******************************************************************************/ +import QtQuick 2.2 +import QtQuick.Window 2.1 + +QtObject { + id: root + function newWindow() { + var component = Qt.createComponent("main.qml") + var window = component.createObject() + window.show() + } + Component.onCompleted: { + root.newWindow() + } +} diff --git a/qmltermwidget b/qmltermwidget index 490eeaf..65225a5 160000 --- a/qmltermwidget +++ b/qmltermwidget @@ -1 +1 @@ -Subproject commit 490eeaf195cd5764a3798c2a2340ced648db4526 +Subproject commit 65225a5c47faf9358de82ba3c0de1230d87835f2 -- 2.47.2 From 9954fde6f1af3ae282f3433cec67fa5ad9117766 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sun, 17 Dec 2017 19:06:35 -0800 Subject: [PATCH 3/9] qmlterm update --- qmltermwidget | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmltermwidget b/qmltermwidget index 65225a5..c9258fe 160000 --- a/qmltermwidget +++ b/qmltermwidget @@ -1 +1 @@ -Subproject commit 65225a5c47faf9358de82ba3c0de1230d87835f2 +Subproject commit c9258fe7770a61c11eceef24a9132b8b6c2ea968 -- 2.47.2 From 10fd2a11ee5cde9832de39273691df9607d92345 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sat, 2 Feb 2019 08:01:05 -0800 Subject: [PATCH 4/9] qml --- qmltermwidget | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmltermwidget b/qmltermwidget index f03911d..48274c7 160000 --- a/qmltermwidget +++ b/qmltermwidget @@ -1 +1 @@ -Subproject commit f03911dafd1fa406d6188d082e0b6cfd52990861 +Subproject commit 48274c75660e28d44af7c195e79accdf1bd44963 -- 2.47.2 From 52140c4c45654f97f79136d4d6accdcf405beb46 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sat, 9 Feb 2019 19:30:29 -0800 Subject: [PATCH 5/9] count child terminals, qt.quit when none left --- app/qml/main.qml | 1 + app/qml/root.qml | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/qml/main.qml b/app/qml/main.qml index 9788380..94c5caa 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -173,6 +173,7 @@ ApplicationWindow{ } } onClosing: { + root.closeWindow() // OSX Since we are currently supporting only one window // quit the application when it is closed. //if (Qt.platform.os === "osx") diff --git a/app/qml/root.qml b/app/qml/root.qml index bd279d9..56dc32f 100644 --- a/app/qml/root.qml +++ b/app/qml/root.qml @@ -21,13 +21,23 @@ import QtQuick 2.2 import QtQuick.Window 2.1 QtObject { - id: root + id: root + property int terminalCount + function newWindow() { var component = Qt.createComponent("main.qml") var window = component.createObject() window.show() + terminalCount = terminalCount + 1 } - Component.onCompleted: { + function closeWindow() { + terminalCount = terminalCount - 1 + if (terminalCount == 0) { + Qt.quit() + } + } + Component.onCompleted: { + terminalCount = 0 root.newWindow() } } -- 2.47.2 From 32eab18da9ba2f1e5e103c2e936aa1ff3dfdfb99 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sat, 9 Feb 2019 19:56:43 -0800 Subject: [PATCH 6/9] cean closewindow --- app/qml/main.qml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/qml/main.qml b/app/qml/main.qml index 94c5caa..08257d3 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -174,9 +174,5 @@ ApplicationWindow{ } onClosing: { root.closeWindow() - // OSX Since we are currently supporting only one window - // quit the application when it is closed. - //if (Qt.platform.os === "osx") - // Qt.quit() } } -- 2.47.2 From 88f59d2016445e93ac20995d12b802fc9a59da46 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sat, 9 Feb 2019 20:23:51 -0800 Subject: [PATCH 7/9] fix spacing --- app/qml/root.qml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/qml/root.qml b/app/qml/root.qml index 56dc32f..7b5e3dc 100644 --- a/app/qml/root.qml +++ b/app/qml/root.qml @@ -21,15 +21,15 @@ import QtQuick 2.2 import QtQuick.Window 2.1 QtObject { - id: root + id: root property int terminalCount - - function newWindow() { - var component = Qt.createComponent("main.qml") - var window = component.createObject() - window.show() + + function newWindow() { + var component = Qt.createComponent("main.qml") + var window = component.createObject() + window.show() terminalCount = terminalCount + 1 - } + } function closeWindow() { terminalCount = terminalCount - 1 if (terminalCount == 0) { @@ -38,6 +38,6 @@ QtObject { } Component.onCompleted: { terminalCount = 0 - root.newWindow() - } + root.newWindow() + } } -- 2.47.2 From aa82250232e542e990585644c3e9f5ca44ae15f8 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sat, 9 Feb 2019 20:25:36 -0800 Subject: [PATCH 8/9] tabs -> spaces --- app/qml/main.qml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/app/qml/main.qml b/app/qml/main.qml index 08257d3..267f405 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -68,21 +68,21 @@ ApplicationWindow{ title: terminalContainer.title || qsTr(appSettings.wintitle) Action { - id: newAction - text: qsTr("New Window") - shortcut: Qt.platform.os === "osx" ? StandardKey.New : "Ctrl+Shift+N" - onTriggered: { - root.newWindow() - } - } - Action { - id: closeAction - text: qsTr("Close Window") - shortcut: Qt.platform.os === "osx" ? StandardKey.Close : "Ctrl+Shift+W" - onTriggered: { - terminalWindow.close() - } - } + id: newAction + text: qsTr("New Window") + shortcut: Qt.platform.os === "osx" ? StandardKey.New : "Ctrl+Shift+N" + onTriggered: { + root.newWindow() + } + } + Action { + id: closeAction + text: qsTr("Close Window") + shortcut: Qt.platform.os === "osx" ? StandardKey.Close : "Ctrl+Shift+W" + onTriggered: { + terminalWindow.close() + } + } Action { id: showMenubarAction text: qsTr("Show Menubar") -- 2.47.2 From e7e3dfed00eed00cb619eb934ca2235326d5775c Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sat, 9 Feb 2019 20:49:31 -0800 Subject: [PATCH 9/9] spacing --- app/qml/root.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/qml/root.qml b/app/qml/root.qml index 7b5e3dc..cb431c9 100644 --- a/app/qml/root.qml +++ b/app/qml/root.qml @@ -36,7 +36,7 @@ QtObject { Qt.quit() } } - Component.onCompleted: { + Component.onCompleted: { terminalCount = 0 root.newWindow() } -- 2.47.2