mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-26 07:37:21 -08:00
GUI user applications: More improvements
This commit is contained in:
parent
c5ec3f3560
commit
99a145d5ee
6 changed files with 115 additions and 105 deletions
42
apps.cpp
42
apps.cpp
|
@ -35,6 +35,8 @@ apps::apps(QWidget *parent) :
|
||||||
ui->reversiLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px");
|
ui->reversiLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px");
|
||||||
ui->g2048LaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px");
|
ui->g2048LaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px");
|
||||||
|
|
||||||
|
ui->noUserAppsAvailableLabel->hide();
|
||||||
|
|
||||||
// Hiding KoBox apps button and label if X11 isn't enabled/wasn't started
|
// Hiding KoBox apps button and label if X11 isn't enabled/wasn't started
|
||||||
if(checkconfig("/external_root/boot/flags/X11_START") == false or checkconfig("/external_root/boot/flags/X11_STARTED") == false) {
|
if(checkconfig("/external_root/boot/flags/X11_START") == false or checkconfig("/external_root/boot/flags/X11_STARTED") == false) {
|
||||||
ui->label_5->hide();
|
ui->label_5->hide();
|
||||||
|
@ -68,6 +70,7 @@ apps::apps(QWidget *parent) :
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->editUserAppsBtn->setProperty("type", "borderless");
|
ui->editUserAppsBtn->setProperty("type", "borderless");
|
||||||
|
ui->editUserAppsBtn->setIcon(QIcon(":/resources/edit.png"));
|
||||||
|
|
||||||
// Refresh because Qt shows the scrollbar for one second then hides it, leaving a mark on the eInk screen
|
// Refresh because Qt shows the scrollbar for one second then hides it, leaving a mark on the eInk screen
|
||||||
QTimer::singleShot(1750, this, SLOT(refreshScreenNative()));
|
QTimer::singleShot(1750, this, SLOT(refreshScreenNative()));
|
||||||
|
@ -294,9 +297,12 @@ void apps::on_editUserAppsBtn_clicked()
|
||||||
// Settings page
|
// Settings page
|
||||||
showUserApps(userAppsSecondPage);
|
showUserApps(userAppsSecondPage);
|
||||||
emit showUserAppsEdit(userAppsSecondPage);
|
emit showUserAppsEdit(userAppsSecondPage);
|
||||||
|
|
||||||
|
QTimer::singleShot(500, this, SLOT(refreshScreenNative()));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
userAppsSecondPage = false;
|
userAppsSecondPage = false;
|
||||||
|
userAppsAvailable = false;
|
||||||
// Launch page
|
// Launch page
|
||||||
|
|
||||||
// It changed via updateJsonFileSlot, and now it writes it only once
|
// It changed via updateJsonFileSlot, and now it writes it only once
|
||||||
|
@ -308,7 +314,7 @@ void apps::on_editUserAppsBtn_clicked()
|
||||||
showUserApps(userAppsSecondPage);
|
showUserApps(userAppsSecondPage);
|
||||||
emit showUserAppsEdit(userAppsSecondPage);
|
emit showUserAppsEdit(userAppsSecondPage);
|
||||||
|
|
||||||
QTimer::singleShot(1000, this, SLOT(refreshScreenNative()));
|
QTimer::singleShot(500, this, SLOT(refreshScreenNative()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,20 +325,28 @@ void apps::showUserApps(bool showDisabledJson)
|
||||||
if(jsonParseSuccess == true) {
|
if(jsonParseSuccess == true) {
|
||||||
QString function = __func__; log(function + ": Main user applications' JSON is valid", className);
|
QString function = __func__; log(function + ": Main user applications' JSON is valid", className);
|
||||||
QJsonArray jsonListArray = jsonDocument.object()["list"].toArray();
|
QJsonArray jsonListArray = jsonDocument.object()["list"].toArray();
|
||||||
for(QJsonValueRef refJsonObject: jsonListArray) {
|
for(QJsonValueRef refJsonObject: jsonListArray) {
|
||||||
QJsonObject appInfo = refJsonObject.toObject();
|
QJsonObject appInfo = refJsonObject.toObject();
|
||||||
if(appInfo["Enabled"].toBool() == true or showDisabledJson == true) {
|
if(appInfo["Enabled"].toBool() == true or showDisabledJson == true) {
|
||||||
userapps * newUserApp = new userapps;
|
userAppsAvailable = true;
|
||||||
newUserApp->provideInfo(appInfo);
|
userapps * newUserApp = new userapps;
|
||||||
connect(this, SIGNAL(clearAppsLayout()), newUserApp, SLOT(deleteLater()));
|
newUserApp->provideInfo(appInfo);
|
||||||
connect(this, SIGNAL(showUserAppsEdit(bool)), newUserApp, SLOT(changePageEnabling(bool)));
|
connect(this, SIGNAL(clearAppsLayout()), newUserApp, SLOT(deleteLater()));
|
||||||
connect(this, SIGNAL(updateJsonFileSignal(QJsonDocument)), newUserApp, SLOT(updateJsonFileSlotUA(QJsonDocument)));
|
connect(this, SIGNAL(showUserAppsEdit(bool)), newUserApp, SLOT(changePageEnabling(bool)));
|
||||||
connect(newUserApp, SIGNAL(updateJsonFileSignalUA(QJsonDocument)), this, SLOT(updateJsonFileSlot(QJsonDocument)));
|
connect(this, SIGNAL(updateJsonFileSignal(QJsonDocument)), newUserApp, SLOT(updateJsonFileSlotUA(QJsonDocument)));
|
||||||
newUserApp->jsonDocument = jsonDocument;
|
connect(newUserApp, SIGNAL(updateJsonFileSignalUA(QJsonDocument)), this, SLOT(updateJsonFileSlot(QJsonDocument)));
|
||||||
newUserApp->jsonFilePath = jsonFile.fileName();
|
newUserApp->jsonDocument = jsonDocument;
|
||||||
ui->verticalLayout_4UserApps->addWidget(newUserApp);
|
newUserApp->jsonFilePath = jsonFile.fileName();
|
||||||
}
|
ui->verticalLayout_4->addWidget(newUserApp);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(userAppsAvailable == false) {
|
||||||
|
ui->noUserAppsAvailableLabel->show();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ui->noUserAppsAvailableLabel->hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QString function = __func__; log(function + ": Main user applications' JSON file is invalid", className);
|
QString function = __func__; log(function + ": Main user applications' JSON file is invalid", className);
|
||||||
|
|
1
apps.h
1
apps.h
|
@ -52,6 +52,7 @@ private:
|
||||||
QJsonDocument jsonDocument;
|
QJsonDocument jsonDocument;
|
||||||
bool jsonParseSuccess = false;
|
bool jsonParseSuccess = false;
|
||||||
bool userAppsSecondPage = false;
|
bool userAppsSecondPage = false;
|
||||||
|
bool userAppsAvailable = false;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void refreshScreen();
|
void refreshScreen();
|
||||||
|
|
157
apps.ui
157
apps.ui
|
@ -28,7 +28,10 @@
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="4" column="0">
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="5" column="0">
|
||||||
<widget class="QScrollArea" name="scrollArea">
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
@ -51,7 +54,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>428</width>
|
<width>428</width>
|
||||||
<height>542</height>
|
<height>510</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
@ -72,11 +75,14 @@
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>8</number>
|
||||||
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="rightMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>6</number>
|
<number>15</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="verticalSpacing">
|
<property name="verticalSpacing">
|
||||||
<number>10</number>
|
<number>10</number>
|
||||||
|
@ -311,22 +317,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Built-in apps</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="0">
|
<item row="8" column="0">
|
||||||
<widget class="QLabel" name="calendarLabel">
|
<widget class="QLabel" name="calendarLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
|
@ -340,19 +330,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" colspan="2">
|
|
||||||
<widget class="Line" name="line">
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="lineWidth">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -373,6 +350,12 @@
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -387,20 +370,30 @@
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_6">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<property name="font">
|
<property name="leftMargin">
|
||||||
<font>
|
<number>10</number>
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="rightMargin">
|
||||||
<string>User apps</string>
|
<number>10</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<item row="0" column="0">
|
||||||
<set>Qt::AlignCenter</set>
|
<widget class="QLabel" name="label_6">
|
||||||
</property>
|
<property name="font">
|
||||||
</widget>
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>User apps</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_3">
|
<spacer name="horizontalSpacer_3">
|
||||||
|
@ -420,31 +413,9 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="editUserAppsBtn">
|
<widget class="QPushButton" name="editUserAppsBtn">
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="://resources/edit.png">
|
|
||||||
<normaloff>://resources/edit.png</normaloff>://resources/edit.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>34</width>
|
|
||||||
<height>34</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -476,17 +447,26 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4UserApps">
|
<layout class="QGridLayout" name="gridLayout_4"/>
|
||||||
<property name="spacing">
|
</item>
|
||||||
<number>10</number>
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_4"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="noUserAppsAvailableLabel">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Chivo</family>
|
||||||
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin">
|
<property name="text">
|
||||||
<number>2</number>
|
<string>
|
||||||
|
No user apps currently available</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="alignment">
|
||||||
<number>0</number>
|
<set>Qt::AlignCenter</set>
|
||||||
</property>
|
</property>
|
||||||
</layout>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
|
@ -508,6 +488,35 @@
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Built-in apps</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="Line" name="line">
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Plain</enum>
|
||||||
|
</property>
|
||||||
|
<property name="lineWidth">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
@ -274,7 +274,7 @@ void generalDialog::on_cancelBtn_clicked()
|
||||||
global::userApps::launchApp = false;
|
global::userApps::launchApp = false;
|
||||||
global::userApps::appCompatibilityLastContinueStatus = false;
|
global::userApps::appCompatibilityLastContinueStatus = false;
|
||||||
global::userApps::appCompatibilityText = "";
|
global::userApps::appCompatibilityText = "";
|
||||||
global::userApps::appCompatibilityDialog = false;
|
global::userApps::appCompatibilityDialog = false;
|
||||||
}
|
}
|
||||||
generalDialog::close();
|
generalDialog::close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,8 @@ void userapps::provideInfo(QJsonObject jsonInfo)
|
||||||
QString message = ": Warning: Icon not found: ";
|
QString message = ": Warning: Icon not found: ";
|
||||||
message.append(iconPath.fileName());
|
message.append(iconPath.fileName());
|
||||||
log(function + message, className);
|
log(function + message, className);
|
||||||
|
ui->iconBtn->deleteLater();
|
||||||
|
ui->gridLayout->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
execPath.setFileName("/" + jsonInfo["ExecPath"].toString());
|
execPath.setFileName("/" + jsonInfo["ExecPath"].toString());
|
||||||
|
|
16
userapps.ui
16
userapps.ui
|
@ -166,22 +166,6 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Preferred</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>5</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="appNameLabel">
|
<widget class="QLabel" name="appNameLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
|
Loading…
Reference in a new issue