Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QT6 port #20

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package/contents/config/config.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import QtQuick 2.3
import org.kde.plasma.configuration 2.0
import QtQuick
import org.kde.plasma.configuration

ConfigModel {
ConfigCategory {
Expand Down
24 changes: 11 additions & 13 deletions package/contents/ui/CompactRepresentation.qml
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
import QtQuick 2.3
import QtQuick.Layouts 1.0
import QtQuick.Controls 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.plasmoid 2.0
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.plasmoid
import org.kde.ksvg as KSvg

Item {
anchors.fill: parent
PlasmaCore.SvgItem {

KSvg.SvgItem {
anchors.centerIn: parent
width: parent.width < parent.height ? parent.width : parent.height
height: width

svg: PlasmaCore.Svg {
imagePath: Qt.resolvedUrl("assets/logo.svg");
}
imagePath: Qt.resolvedUrl("assets/logo.svg");

MouseArea {
anchors.fill: parent

onClicked: {
plasmoid.expanded = !plasmoid.expanded
expanded = !expanded
}
}
}
}
}
109 changes: 57 additions & 52 deletions package/contents/ui/configAdvanced.qml
Original file line number Diff line number Diff line change
@@ -1,54 +1,59 @@
import QtQuick 2.3
import QtQuick.Layouts 1.0
import QtQuick.Controls 2.5 as QQC2
import org.kde.kirigami 2.4 as Kirigami

Kirigami.FormLayout {
id: page
property alias cfg_focusInterval: focusInterval.value
property alias cfg_maxReloadTime: maxReloadTime.value
property alias cfg_debugConsole: debugConsole.checked

Layout.fillHeight:true

QQC2.Slider {
Kirigami.FormData.label:i18n("Focus input after : %1ms",focusInterval.value );
id: focusInterval
from:0
stepSize:10
value:0
to:1000
live:true
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls as QQC2
import org.kde.kirigami as Kirigami
import org.kde.kcmutils as KCM

KCM.SimpleKCM {
id:root

property int cfg_focusInterval: focusInterval.value
property int cfg_maxReloadTime: maxReloadTime.value
property bool cfg_debugConsole: debugConsole.checked

Kirigami.FormLayout {
id: page

Layout.fillHeight:true

QQC2.Slider {
Kirigami.FormData.label:i18n("Focus input after : %1ms",focusInterval.value );
id: focusInterval
from:0
stepSize:10
value:0
to:1000
live:true
}

QQC2.Label {
opacity: 0.7
font.italic: true
text:i18n("This is a workaround to allow input field to be fcoused when using the widget shortcut.") +
"\n" +
i18n("incrase the timeout if theres issues with focusing on the input when using the shortcut.");
}

QQC2.CheckBox {
id: debugConsole
Layout.alignment: Qt.AlignBottom
Kirigami.FormData.label: i18n("Show debug console")
}


QQC2.Slider {
Kirigami.FormData.label:i18n("Max realod is set to : %1 second ",maxReloadTime.value );
id: maxReloadTime
from:0
stepSize:10
value:30
to:3600
live:true
}
QQC2.Label {
opacity: 0.7
font.italic: true
text:i18n("This is a limit on how often the widget will try to auto reload the page (when hidden) if the page failed to load.");
}
}

QQC2.Label {
font.pixelSize: 8
font.italic: true
text:i18n("This is a workaround to allow input field to be fcoused when using the widget shortcut.") +
"\n" +
i18n("incrase the timeout if theres issues with focusing on the input when using the shortcut.");
}

QQC2.CheckBox {
id: debugConsole
Layout.alignment: Qt.AlignBottom
Kirigami.FormData.label: i18n("Show debug console")
}


QQC2.Slider {
Kirigami.FormData.label:i18n("Max realod is set to : %1 second ",maxReloadTime.value );
id: maxReloadTime
from:0
stepSize:10
value:30
to:3600
live:true
}
QQC2.Label {
font.pixelSize: 8
font.italic: true
text:i18n("This is a limit on how often the widget will try to auto reload the page (when hidden) if the page failed to load.");
}

}
112 changes: 58 additions & 54 deletions package/contents/ui/configGeneral.qml
Original file line number Diff line number Diff line change
@@ -1,64 +1,68 @@
import QtQuick 2.3
import QtQuick.Layouts 1.0
import QtQuick.Dialogs 1.3
import QtQuick.Controls 2.5 as QQC2
import org.kde.kirigami 2.4 as Kirigami
import QtQuick
import QtQuick.Layouts
import QtQuick.Dialogs
import QtQuick.Controls as QQC2
import org.kde.kirigami as Kirigami
import org.kde.kcmutils as KCM

Kirigami.FormLayout {
id: page

property alias cfg_downloadLocation: fileDialog.folder
property alias cfg_sendOnEnter: sendOnEnter.checked
property alias cfg_matchTheme: matchTheme.checked
property alias cfg_allowClipboardAccess: allowClipboardAccess.checked
KCM.SimpleKCM {
id:root

Layout.fillHeight:true
property string cfg_downloadLocation: folderDialog.folder
property bool cfg_sendOnEnter: sendOnEnter.checked
property bool cfg_matchTheme: matchTheme.checked
property bool cfg_allowClipboardAccess: allowClipboardAccess.checked

QQC2.CheckBox {
id: sendOnEnter
text: i18n("Send On Enter")
}
QQC2.Label {
font.pixelSize: 12
text:i18n("When checked pressing Enter will send the query to ChatGPT.");
}
QQC2.Label {
font.pixelSize: 8
font.italic: true
text:i18n("For now please reload the page with the 'Reload' Button after changing this configuration.");
}

QQC2.CheckBox {
id: matchTheme
text: i18n("Match OS theme")
}
Kirigami.FormLayout {
id: page

QQC2.CheckBox {
id: allowClipboardAccess
text: i18n("Allow ChatGPT system clipboard access")
}
QQC2.Label {
font.pixelSize: 8
font.italic: true
text:i18n("This is enabled by default to allow for quick code/recipe/etc but can be disabled if you are worried about ChatCGPT examining your system clipboard");
}
Layout.fillHeight:true

QQC2.Button {
id: downloadLocation
text: i18n("Select Download Path : %1 ", fileDialog.folder )
onClicked:{
fileDialog.open();
QQC2.CheckBox {
id: sendOnEnter
text: i18n("Send On Enter")
}
QQC2.Label {
opacity: 0.7
text:i18n("When checked pressing Enter will send the query to ChatGPT.");
}
QQC2.Label {
opacity: 0.7
font.italic: true
text:i18n("For now please reload the page with the 'Reload' Button after changing this configuration.");
}
}
QQC2.Label {
font.pixelSize: 8
font.italic: true
text:i18n("Select the directory to download files to.");
}

FileDialog {
id:fileDialog
selectFolder:true;
}
QQC2.CheckBox {
id: matchTheme
text: i18n("Match OS theme")
}

QQC2.CheckBox {
id: allowClipboardAccess
text: i18n("Allow ChatGPT system clipboard access")
}
QQC2.Label {
opacity: 0.7
font.italic: true
text:i18n("This is enabled by default to allow for quick code/recipe/etc but can be disabled if you are worried about ChatCGPT examining your system clipboard");
}

QQC2.Button {
id: downloadLocation
text: i18n("Select Download Path : %1 ", folderDialog.folder )
onClicked:{
folderDialog.open();
}
}
QQC2.Label {
opacity: 0.7
font.italic: true
text:i18n("Select the directory to download files to.");
}

FolderDialog {
id:folderDialog
}
}
}
Loading