Skip to content

Commit

Permalink
Provide instruction on how to manually add in case shortcut writing f…
Browse files Browse the repository at this point in the history
…ails
  • Loading branch information
Alia5 committed Jan 4, 2022
1 parent 139432c commit 0daa67e
Show file tree
Hide file tree
Showing 8 changed files with 326 additions and 11 deletions.
156 changes: 152 additions & 4 deletions GlosSIConfig/Resource.rc
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,3,103000945081
PRODUCTVERSION 0,0,3,103000945081
FILEVERSION 0,0,3,105001394320
PRODUCTVERSION 0,0,3,105001394320
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -69,12 +69,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Peter Repukat - FlatspotSoftware"
VALUE "FileDescription", "GlosSI - Config"
VALUE "FileVersion", "0.0.3.1-3-ge945c81"
VALUE "FileVersion", "0.0.3.1-5-g139432c"
VALUE "InternalName", "GlosSIConfig"
VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware"
VALUE "OriginalFilename", "GlosSIConfig.exe"
VALUE "ProductName", "GlosSi"
VALUE "ProductVersion", "0.0.3.1-3-ge945c81"
VALUE "ProductVersion", "0.0.3.1-5-g139432c"
END
END
BLOCK "VarFileInfo"
Expand Down Expand Up @@ -530,6 +530,154 @@ END


























































































































































Expand Down
20 changes: 20 additions & 0 deletions GlosSIConfig/UIModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,26 @@ bool UIModel::removeFromSteam(const QString& name, const QString& shortcutspath,
return writeShortcutsVDF(L"remove", name.toStdWString(), shortcutspath.toStdWString(), from_cmd);
}

QVariantMap UIModel::manualProps(QVariant shortcut)
{
QDir appDir = QGuiApplication::applicationDirPath();
const auto map = shortcut.toMap();
const auto name = map["name"].toString();
const auto maybeLaunchPath = map["launchPath"].toString();
const auto launch = map["launch"].toBool();

QVariantMap res;
res.insert("name", name);
res.insert("config", name + ".json");
res.insert("launch", ("\"" + appDir.absolutePath() + "/GlosSITarget.exe" + "\""));
res.insert("launchDir", (
launch && !maybeLaunchPath.isEmpty()
? (QString("\"") + QString::fromStdString(std::filesystem::path(maybeLaunchPath.toStdString()).parent_path().string()) + "\"")
: ("\"" + appDir.absolutePath() + "\""))
);
return res;
}

#ifdef _WIN32
QVariantList UIModel::uwpApps()
{
Expand Down
1 change: 1 addition & 0 deletions GlosSIConfig/UIModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class UIModel : public QObject {
Q_INVOKABLE bool addToSteam(QVariant shortcut, const QString& shortcutspath, bool from_cmd = false);
bool addToSteam(const QString& name, const QString& shortcutspath, bool from_cmd = false);
Q_INVOKABLE bool removeFromSteam(const QString& name, const QString& shortcutspath, bool from_cmd = false);
Q_INVOKABLE QVariantMap manualProps(QVariant shortcut);
#ifdef _WIN32
Q_INVOKABLE QVariantList uwpApps();
#endif
Expand Down
1 change: 1 addition & 0 deletions GlosSIConfig/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
<file>svg/steam.svg</file>
<file>qml/UWPSelectDialog.qml</file>
<file>qml/InfoDialog.qml</file>
<file>steamscreener.png</file>
</qresource>
</RCC>
15 changes: 15 additions & 0 deletions GlosSIConfig/qml/InfoDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Dialog {

property var confirmedParam: null
signal confirmed(var param)
signal confirmedExtra(var param)

visible: false
modal: true
Expand All @@ -40,6 +41,10 @@ Dialog {
property alias titleText: title.text
property alias text: text.text

property bool extraButton: false
property alias extraButtonText: extrabutton.text
property var confirmedExtraParam: null

enter: Transition {
NumberAnimation{target: content; property: "y"; from: parent.height; to: 16; duration: 300; easing.type: Easing.OutQuad }
NumberAnimation{target: background; property: "y"; from: parent.height; to: 0; duration: 300; easing.type: Easing.OutQuad }
Expand Down Expand Up @@ -84,6 +89,16 @@ Dialog {
anchors.top: col.bottom
anchors.topMargin: parent.spacing
spacing: 16

Button {
id: extrabutton
visible: extraButton
onClicked: function(){
close()
confirmedExtra(confirmedExtraParam)
}
}

Button {
text: qsTr("OK")
onClicked: function(){
Expand Down
Loading

0 comments on commit 0daa67e

Please sign in to comment.