Add 2048 game in Apps

This commit is contained in:
Nicolas Mailloux 2022-03-27 23:17:02 -04:00
parent da37cd7e1b
commit dfba8eec90
3 changed files with 61 additions and 25 deletions

View file

@ -17,6 +17,7 @@ apps::apps(QWidget *parent) :
ui->calculatorLaunchBtn->setProperty("type", "borderless"); ui->calculatorLaunchBtn->setProperty("type", "borderless");
ui->vncLaunchBtn->setProperty("type", "borderless"); ui->vncLaunchBtn->setProperty("type", "borderless");
ui->reversiLaunchBtn->setProperty("type", "borderless"); ui->reversiLaunchBtn->setProperty("type", "borderless");
ui->g2048LaunchBtn->setProperty("type", "borderless");
ui->koboxAppsOpenButton->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px"); ui->koboxAppsOpenButton->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px");
ui->scribbleLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px"); ui->scribbleLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px");
@ -26,6 +27,7 @@ apps::apps(QWidget *parent) :
ui->calculatorLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px"); ui->calculatorLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px");
ui->vncLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px"); ui->vncLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px");
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");
// 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) {
@ -137,3 +139,10 @@ void apps::on_reversiLaunchBtn_clicked()
process.startDetached("qreversi", QStringList()); process.startDetached("qreversi", QStringList());
qApp->quit(); qApp->quit();
} }
void apps::on_g2048LaunchBtn_clicked()
{
QProcess process;
process.startDetached("2048", QStringList());
qApp->quit();
}

1
apps.h
View file

@ -30,6 +30,7 @@ private slots:
void on_vncLaunchBtn_clicked(); void on_vncLaunchBtn_clicked();
void on_reversiLaunchBtn_clicked(); void on_reversiLaunchBtn_clicked();
void refreshScreenNative(); void refreshScreenNative();
void on_g2048LaunchBtn_clicked();
private: private:
Ui::apps *ui; Ui::apps *ui;

76
apps.ui
View file

@ -56,7 +56,7 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item row="6" column="1"> <item row="7" column="1">
<widget class="QPushButton" name="calculatorLaunchBtn"> <widget class="QPushButton" name="calculatorLaunchBtn">
<property name="font"> <property name="font">
<font> <font>
@ -70,7 +70,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="5" column="1">
<widget class="QPushButton" name="calendarLaunchBtn"> <widget class="QPushButton" name="calendarLaunchBtn">
<property name="font"> <property name="font">
<font> <font>
@ -84,7 +84,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="0"> <item row="8" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="font"> <property name="font">
<font> <font>
@ -110,7 +110,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="6" column="1">
<widget class="QPushButton" name="savedWordsLaunchBtn"> <widget class="QPushButton" name="savedWordsLaunchBtn">
<property name="font"> <property name="font">
<font> <font>
@ -124,7 +124,20 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="3" column="0">
<widget class="QLabel" name="reversiLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Reversi</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="font"> <property name="font">
<font> <font>
@ -150,7 +163,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="5" column="0">
<widget class="QLabel" name="calendarLabel"> <widget class="QLabel" name="calendarLabel">
<property name="font"> <property name="font">
<font> <font>
@ -163,7 +176,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1"> <item row="8" column="1">
<widget class="QPushButton" name="lightmapsLaunchBtn"> <widget class="QPushButton" name="lightmapsLaunchBtn">
<property name="font"> <property name="font">
<font> <font>
@ -178,7 +191,20 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="1"> <item row="3" column="1">
<widget class="QPushButton" name="reversiLaunchBtn">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Launch</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QPushButton" name="vncLaunchBtn"> <widget class="QPushButton" name="vncLaunchBtn">
<property name="font"> <property name="font">
<font> <font>
@ -206,7 +232,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0"> <item row="7" column="0">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="font"> <property name="font">
<font> <font>
@ -219,7 +245,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="0"> <item row="9" column="0">
<widget class="QLabel" name="vncViewerLabel"> <widget class="QLabel" name="vncViewerLabel">
<property name="font"> <property name="font">
<font> <font>
@ -247,21 +273,8 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="4" column="1">
<widget class="QLabel" name="reversiLabel"> <widget class="QPushButton" name="g2048LaunchBtn">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Reversi</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="reversiLaunchBtn">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -273,6 +286,19 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0">
<widget class="QLabel" name="g2048Label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>2048</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">