2
0
mirror of https://github.com/Thracky/GlosSI.git synced 2024-11-19 03:25:29 +00:00

Add progress dialog when scanning UWP apps

This commit is contained in:
Peter Repukat 2017-11-12 02:29:02 +01:00
parent 7cff788b87
commit 872589826e
2 changed files with 12 additions and 1 deletions

View File

@ -343,7 +343,6 @@ void GloSC::on_pbSearchPath_clicked()
void GloSC::on_pbUWP_clicked() void GloSC::on_pbUWP_clicked()
{ {
//TODO: FIXME: Make Async
QSettings *settings = new QSettings("HKEY_CLASSES_ROOT", QSettings::NativeFormat); QSettings *settings = new QSettings("HKEY_CLASSES_ROOT", QSettings::NativeFormat);
QStringList childs = settings->childGroups(); QStringList childs = settings->childGroups();
@ -360,6 +359,9 @@ void GloSC::on_pbUWP_clicked()
delete settings; delete settings;
QProgressDialog progDialog("Scanning UWP apps...", "Cancel", 0, packages.size(), this);
progDialog.setWindowModality(Qt::WindowModal);
QList<UWPPair> pairs; QList<UWPPair> pairs;
QString AppName; QString AppName;
@ -371,6 +373,13 @@ void GloSC::on_pbUWP_clicked()
for (auto &package : packages) for (auto &package : packages)
{ {
progDialog.setValue(packages.indexOf(package));
if (progDialog.wasCanceled())
{
return;
}
settings = new QSettings("HKEY_CLASSES_ROOT\\"+package, QSettings::NativeFormat); settings = new QSettings("HKEY_CLASSES_ROOT\\"+package, QSettings::NativeFormat);
AppName = settings->value("Application/ApplicationName").toString(); AppName = settings->value("Application/ApplicationName").toString();
@ -432,6 +441,7 @@ void GloSC::on_pbUWP_clicked()
uwpPairs = pairs; uwpPairs = pairs;
progDialog.close();
UWPSelectDialog dialog(this); UWPSelectDialog dialog(this);
dialog.setUWPList(uwpPairs); dialog.setUWPList(uwpPairs);

View File

@ -31,6 +31,7 @@ limitations under the License.
#include <QTimer> #include <QTimer>
#include <QPropertyAnimation> #include <QPropertyAnimation>
#include <QGraphicsOpacityEffect> #include <QGraphicsOpacityEffect>
#include <QProgressDialog>
#include "UWPPair.h" #include "UWPPair.h"