From 8d6f186d70c8983e029aea7b3bec554a74a59cbc Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Sun, 4 Dec 2016 22:20:01 +0100 Subject: [PATCH] GloSC-Main: Set instance name to application name after selecting --- GloSC/GloSC.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/GloSC/GloSC.cpp b/GloSC/GloSC.cpp index d089cee..dda3762 100644 --- a/GloSC/GloSC.cpp +++ b/GloSC/GloSC.cpp @@ -307,6 +307,16 @@ void GloSC::on_pbSearchPath_clicked() { QString filePath = QFileDialog::getOpenFileName(this, "Select Game", "", "*.exe"); ui.lePath->setText(filePath); + if (filePath.length() > 0) + { + QString name; + if (filePath.contains("\\")) + name = filePath.mid(filePath.lastIndexOf("\\") + 1, -1); + else + name = filePath.mid(filePath.lastIndexOf("/") + 1, -1); + name.chop(4); + ui.leName->setText(name); + } } void GloSC::on_pbUWP_clicked() @@ -407,6 +417,7 @@ void GloSC::on_pbUWP_clicked() if (selection > -1) { ui.lePath->setText(uwpPairs.at(selection).AppUMId); + ui.leName->setText(uwpPairs.at(selection).AppName); } }