Implemented basic KoBox launcher

Now I'll test if it works in the real life... ;p
This commit is contained in:
Nicolas Mailloux 2021-04-30 18:19:48 -04:00
parent abf9cda602
commit 217dbca5ff
4 changed files with 34 additions and 5 deletions

View file

@ -67,7 +67,6 @@ koboxAppsDialog::~koboxAppsDialog()
void koboxAppsDialog::on_cancelBtn_clicked() void koboxAppsDialog::on_cancelBtn_clicked()
{ {
// Emergency TODO: Fix this giving a "free(): invalid next size(fast)..." error
koboxAppsDialog::close(); koboxAppsDialog::close();
} }
@ -79,6 +78,35 @@ void koboxAppsDialog::on_launchBtn_clicked()
QMessageBox::critical(this, tr("Invalid argument"), tr("Please select an application.")); QMessageBox::critical(this, tr("Invalid argument"), tr("Please select an application."));
} }
else { else {
qDebug() << itemText; // DPI setting
string_checkconfig(".config/00-kobox/dpiSetting");
dpiSetting = checkconfig_str_val.toStdString();
// Fullscreen or windowed (i3)
// Mostly windowed except for apps like KTerm which ships its own OSK
dpModeSetting = "windowed";
if(itemText == "Netsurf") {
// Bypass standard shell script launch shenanigans
string_writeconfig("/external_root/tmp/X_program", "!netsurf");
}
if(itemText == "KTerm") {
string_writeconfig("/external_root/tmp/X_program", "kterm");
dpiSetting = "fullscreen";
}
else {
QString itemTextLower = itemText.toLower();
std::string app = itemTextLower.toStdString();
string_writeconfig("/external_root/tmp/X_program", app);
}
string_writeconfig("/external_root/tmp/X_dpmode", dpModeSetting);
string_writeconfig("/external_root/tmp/X_dpi", dpiSetting);
// Wheeee!
string_writeconfig("/external_root/opt/ibxd", "x_gui_start");
qApp->quit();
} }
} }

View file

@ -20,6 +20,8 @@ public:
QString apps; QString apps;
QString itemText; QString itemText;
std::string dpiSetting;
std::string dpModeSetting;
QModelIndex index; QModelIndex index;
private slots: private slots:

View file

@ -600,9 +600,6 @@ void MainWindow::on_pushButton_clicked()
void MainWindow::on_searchBtn_clicked() void MainWindow::on_searchBtn_clicked()
{ {
// Hopefully this button will do something one day... // Hopefully this button will do something one day...
koboxAppsDialogWindow = new koboxAppsDialog(this);
koboxAppsDialogWindow->setAttribute(Qt::WA_DeleteOnClose);
koboxAppsDialogWindow->show();
} }
void MainWindow::on_quitBtn_clicked() void MainWindow::on_quitBtn_clicked()

View file

@ -15,6 +15,8 @@
#include <QTimer> #include <QTimer>
#include <QIcon> #include <QIcon>
#include <cstdio>
using namespace std; using namespace std;
settings::settings(QWidget *parent) : settings::settings(QWidget *parent) :