MCPcopy Create free account
hub / github.com/TheAssassin/AppImageLauncher / SettingsDialog

Method SettingsDialog

src/ui/settings_dialog.cpp:12–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include "shared.h"
11
12SettingsDialog::SettingsDialog(QWidget* parent) :
13 QDialog(parent),
14 ui(new Ui::SettingsDialog) {
15 ui->setupUi(this);
16
17 ui->applicationsDirLineEdit->setPlaceholderText(integratedAppImagesDestination().absolutePath());
18
19 loadSettings();
20
21// cosmetic changes in lite mode
22#ifdef BUILD_LITE
23 ui->daemonIsEnabledCheckBox->setChecked(true);
24 ui->daemonIsEnabledCheckBox->setEnabled(false);
25
26 ui->askMoveCheckBox->setChecked(false);
27 ui->askMoveCheckBox->setEnabled(false);
28#endif
29
30 connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &SettingsDialog::onDialogAccepted);
31 connect(ui->chooseAppsDirToolButton, &QToolButton::released, this, &SettingsDialog::onChooseAppsDirClicked);
32 connect(ui->additionalDirsAddButton, &QToolButton::released, this, &SettingsDialog::onAddDirectoryToWatchButtonClicked);
33 connect(ui->additionalDirsRemoveButton, &QToolButton::released, this, &SettingsDialog::onRemoveDirectoryToWatchButtonClicked);
34 connect(ui->additionalDirsListWidget, &QListWidget::itemActivated, this, &SettingsDialog::onDirectoryToWatchItemActivated);
35 connect(ui->additionalDirsListWidget, &QListWidget::itemClicked, this, &SettingsDialog::onDirectoryToWatchItemActivated);
36
37 QStringList availableFeatures;
38
39#ifdef ENABLE_UPDATE_HELPER
40 availableFeatures << "<span style='color: green;'>✔</span> " + tr("updater available for AppImages supporting AppImageUpdate");
41#else
42 availableFeatures << "<span style='color: red;'>🞬</span> " + tr("updater unavailable");
43#endif
44
45#ifdef BUILD_LITE
46 availableFeatures << "<br /><br />"
47 << tr("<strong>Note: this is an AppImageLauncher Lite build, only supports a limited set of features</strong><br />"
48 "Please install the full version via the provided native packages to enjoy the full AppImageLauncher experience");
49#endif
50
51 ui->featuresLabel->setText(availableFeatures.join('\n'));
52
53 // no matter what tab was selected when saving in Qt designer, we want to start up with the first tab
54 ui->tabWidget->setCurrentWidget(ui->launcherTab);
55}
56
57SettingsDialog::~SettingsDialog() {
58 delete ui;

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected