Add Reversi game in Apps

This commit is contained in:
Nicolas Mailloux 2022-03-26 23:17:14 -04:00
parent 8065b8e1b6
commit da37cd7e1b
3 changed files with 120 additions and 84 deletions

View file

@ -16,6 +16,7 @@ apps::apps(QWidget *parent) :
ui->savedWordsLaunchBtn->setProperty("type", "borderless"); ui->savedWordsLaunchBtn->setProperty("type", "borderless");
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->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");
@ -24,6 +25,7 @@ apps::apps(QWidget *parent) :
ui->savedWordsLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px"); ui->savedWordsLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px");
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");
// 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) {
@ -128,3 +130,10 @@ void apps::on_vncLaunchBtn_clicked()
void apps::refreshScreenNative() { void apps::refreshScreenNative() {
emit refreshScreen(); emit refreshScreen();
} }
void apps::on_reversiLaunchBtn_clicked()
{
QProcess process;
process.startDetached("qreversi", QStringList());
qApp->quit();
}

1
apps.h
View file

@ -28,6 +28,7 @@ private slots:
void on_calculatorLaunchBtn_clicked(); void on_calculatorLaunchBtn_clicked();
void on_koboxAppsOpenButton_clicked(); void on_koboxAppsOpenButton_clicked();
void on_vncLaunchBtn_clicked(); void on_vncLaunchBtn_clicked();
void on_reversiLaunchBtn_clicked();
void refreshScreenNative(); void refreshScreenNative();
private: private:

194
apps.ui
View file

@ -56,7 +56,75 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item row="4" column="0"> <item row="6" column="1">
<widget class="QPushButton" name="calculatorLaunchBtn">
<property name="font">
<font>
<family>Inter</family>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Launch</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="calendarLaunchBtn">
<property name="font">
<font>
<family>Inter</family>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Launch</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Light Maps</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="scribbleLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Scribble</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QPushButton" name="savedWordsLaunchBtn">
<property name="font">
<font>
<family>Inter</family>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Launch</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="font"> <property name="font">
<font> <font>
@ -82,8 +150,8 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="calendarLabel">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -91,7 +159,36 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Calculator</string> <string>Calendar</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QPushButton" name="lightmapsLaunchBtn">
<property name="font">
<font>
<family>Inter</family>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Launch</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QPushButton" name="vncLaunchBtn">
<property name="font">
<font>
<family>Inter</family>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Launch</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -109,22 +206,21 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1"> <item row="6" column="0">
<widget class="QPushButton" name="vncLaunchBtn"> <widget class="QLabel" name="label_4">
<property name="font"> <property name="font">
<font> <font>
<family>Inter</family>
<weight>75</weight> <weight>75</weight>
<bold>true</bold> <bold>true</bold>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Launch</string> <string>Calculator</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="8" column="0">
<widget class="QLabel" name="scribbleLabel"> <widget class="QLabel" name="vncViewerLabel">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -132,21 +228,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Scribble</string> <string>VNC viewer</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QPushButton" name="calculatorLaunchBtn">
<property name="font">
<font>
<family>Inter</family>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Launch</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -165,21 +247,8 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="0">
<widget class="QLabel" name="vncViewerLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>VNC viewer</string>
</property>
</widget>
</item>
<item row="3" column="0"> <item row="3" column="0">
<widget class="QLabel" name="calendarLabel"> <widget class="QLabel" name="reversiLabel">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -187,15 +256,14 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Calendar</string> <string>Reversi</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="1">
<widget class="QPushButton" name="calendarLaunchBtn"> <widget class="QPushButton" name="reversiLaunchBtn">
<property name="font"> <property name="font">
<font> <font>
<family>Inter</family>
<weight>75</weight> <weight>75</weight>
<bold>true</bold> <bold>true</bold>
</font> </font>
@ -205,48 +273,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1">
<widget class="QPushButton" name="savedWordsLaunchBtn">
<property name="font">
<font>
<family>Inter</family>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Launch</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QPushButton" name="lightmapsLaunchBtn">
<property name="font">
<font>
<family>Inter</family>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Launch</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Light Maps</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">