1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2026-02-08 00:32:27 +00:00

Make it compile with Qt6.

This commit is contained in:
Filippo Scognamiglio
2025-12-09 10:41:41 +01:00
parent f157648d1e
commit 1d73abda51
9 changed files with 29 additions and 29 deletions

1
.gitignore vendored
View File

@@ -43,6 +43,7 @@ Makefile*
# Excludes compiled files # Excludes compiled files
imports imports
cool-retro-term cool-retro-term
build
# Mac OSX # Mac OSX

View File

@@ -49,15 +49,15 @@ int main(int argc, char *argv[])
if (argc>1 && (!strcmp(argv[1],"-h") || !strcmp(argv[1],"--help"))) { if (argc>1 && (!strcmp(argv[1],"-h") || !strcmp(argv[1],"--help"))) {
QTextStream cout(stdout, QIODevice::WriteOnly); QTextStream cout(stdout, QIODevice::WriteOnly);
cout << "Usage: " << argv[0] << " [--default-settings] [--workdir <dir>] [--program <prog>] [-p|--profile <prof>] [--fullscreen] [-h|--help]" << endl; cout << "Usage: " << argv[0] << " [--default-settings] [--workdir <dir>] [--program <prog>] [-p|--profile <prof>] [--fullscreen] [-h|--help]" << Qt::endl;
cout << " --default-settings Run cool-retro-term with the default settings" << endl; cout << " --default-settings Run cool-retro-term with the default settings" << Qt::endl;
cout << " --workdir <dir> Change working directory to 'dir'" << endl; cout << " --workdir <dir> Change working directory to 'dir'" << Qt::endl;
cout << " -e <cmd> Command to execute. This option will catch all following arguments, so use it as the last option." << endl; cout << " -e <cmd> Command to execute. This option will catch all following arguments, so use it as the last option." << Qt::endl;
cout << " -T <title> Set window title to 'title'." << endl; cout << " -T <title> Set window title to 'title'." << Qt::endl;
cout << " --fullscreen Run cool-retro-term in fullscreen." << endl; cout << " --fullscreen Run cool-retro-term in fullscreen." << Qt::endl;
cout << " -p|--profile <prof> Run cool-retro-term with the given profile." << endl; cout << " -p|--profile <prof> Run cool-retro-term with the given profile." << Qt::endl;
cout << " -h|--help Print this help." << endl; cout << " -h|--help Print this help." << Qt::endl;
cout << " --verbose Print additional information such as profiles and settings." << endl; cout << " --verbose Print additional information such as profiles and settings." << Qt::endl;
return 0; return 0;
} }
@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
if (argc>1 && (!strcmp(argv[1],"-v") || !strcmp(argv[1],"--version"))) { if (argc>1 && (!strcmp(argv[1],"-v") || !strcmp(argv[1],"--version"))) {
QTextStream cout(stdout, QIODevice::WriteOnly); QTextStream cout(stdout, QIODevice::WriteOnly);
cout << "cool-retro-term " << appVersion << endl; cout << "cool-retro-term " << appVersion << Qt::endl;
return 0; return 0;
} }

View File

@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ *******************************************************************************/
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Dialogs 1.1 import QtQuick.Dialogs
Item { Item {
id: rootItem id: rootItem
@@ -31,11 +31,13 @@ Item {
id: colorDialog id: colorDialog
title: qsTr("Choose a color") title: qsTr("Choose a color")
modality: Qt.ApplicationModal modality: Qt.ApplicationModal
visible: false selectedColor: rootItem.color
//This is a workaround to a Qt 5.2 bug. onSelectedColorChanged: {
onColorChanged: if (!appSettings.isMacOS) colorSelected(color) if (!appSettings.isMacOS && visible)
onAccepted: if (appSettings.isMacOS) colorSelected(color) colorSelected(selectedColor)
}
onAccepted: colorSelected(selectedColor)
} }
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
@@ -57,6 +59,6 @@ Item {
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: colorDialog.visible = true onClicked: colorDialog.open()
} }
} }

View File

@@ -21,7 +21,7 @@ import QtQuick 2.2
import QtQuick.Window 2.0 import QtQuick.Window 2.0
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.1 import QtQuick.Dialogs
Window { Window {
id: insertnamedialog id: insertnamedialog

View File

@@ -20,7 +20,7 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.1 import QtQuick.Dialogs
ColumnLayout { ColumnLayout {
GroupBox { GroupBox {
@@ -237,6 +237,7 @@ ColumnLayout {
MessageDialog { MessageDialog {
id: messageDialog id: messageDialog
title: qsTr("File Error") title: qsTr("File Error")
buttons: MessageDialog.Ok
onAccepted: { onAccepted: {
messageDialog.close() messageDialog.close()
} }
@@ -248,10 +249,8 @@ ColumnLayout {
sourceComponent: FileDialog { sourceComponent: FileDialog {
nameFilters: ["Json files (*.json)"] nameFilters: ["Json files (*.json)"]
selectMultiple: false fileMode: fileDialog.selectExisting ? FileDialog.OpenFile : FileDialog.SaveFile
selectFolder: false onAccepted: callBack(selectedFile)
selectExisting: fileDialog.selectExisting
onAccepted: callBack(fileUrl)
} }
onSelectExistingChanged: reload() onSelectExistingChanged: reload()

View File

@@ -22,7 +22,7 @@ import QtQuick 2.2
import QtQuick.Controls 2.1 import QtQuick.Controls 2.1
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.1 import QtQuick.Dialogs
Window { Window {
id: settings_window id: settings_window

View File

@@ -19,7 +19,6 @@
*******************************************************************************/ *******************************************************************************/
import QtQuick 2.2 import QtQuick 2.2
import QtGraphicalEffects 1.0
import "utils.js" as Utils import "utils.js" as Utils
@@ -377,7 +376,7 @@ Item {
property color fontColor: parent.fontColor property color fontColor: parent.fontColor
property color backgroundColor: parent.backgroundColor property color backgroundColor: parent.backgroundColor
property real bloom: appSettings.bloom * 2.5 property real bloom: bloomSource ? appSettings.bloom * 2.5 : 0
property real screenCurvature: parent.screenCurvature property real screenCurvature: parent.screenCurvature

View File

@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ *******************************************************************************/
import QtQuick 2.2 import QtQuick 2.2
import QtGraphicalEffects 1.0 import Qt5Compat.GraphicalEffects
import "utils.js" as Utils import "utils.js" as Utils
@@ -38,6 +38,7 @@ ShaderTerminal {
terminalWindow.width * devicePixelRatio * appSettings.windowScaling, terminalWindow.width * devicePixelRatio * appSettings.windowScaling,
terminalWindow.height * devicePixelRatio * appSettings.windowScaling terminalWindow.height * devicePixelRatio * appSettings.windowScaling
) )
bloomSource: bloomSourceLoader.item
TimeManager { TimeManager {
id: timeManager id: timeManager
@@ -75,6 +76,4 @@ ShaderTerminal {
visible: false visible: false
} }
} }
bloomSource: bloomSourceLoader.item
} }