From 35595fc2911eddb6d4f27f291635e0b9b85c7e34 Mon Sep 17 00:00:00 2001 From: Mouad-Scriptz-0 Date: Fri, 23 Oct 2026 23:12:20 +0000 Subject: [PATCH] Show launcher dialog when ask_to_move is disabled, integrate in place ask_to_move=false used to make AppImageLauncher skip the integration dialog entirely and just run the AppImage without integrating it. This contradicts how the option is presented in the settings and first run dialogs ("Ask whether to move AppImage files into the applications directory", a checkbox inside the "Launcher Dialog" section), and effectively disables AppImageLauncher's core feature for users who merely opted out of having their files relocated. The launcher dialog is now always shown for integrable AppImages. When the user opted out of moving, the AppImage is integrated in place (like the daemon already does for watched directories) and the dialog message no longer claims the file will be moved. The "already integrated but not in destination directory" prompt is also skipped in that case, as there is nothing to move. --- src/ui/integration_dialog.cpp | 21 +++++++++++++++++++-- src/ui/integration_dialog.h | 3 ++- src/ui/main.cpp | 23 ++++++++++++++++------- 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/src/ui/integration_dialog.cpp b/src/ui/integration_dialog.cpp index f5d533e0..ca22ca55 100644 --- a/src/ui/integration_dialog.cpp +++ b/src/ui/integration_dialog.cpp @@ -10,10 +10,11 @@ #include "ui_integration_dialog.h" IntegrationDialog::IntegrationDialog(QString pathToAppImage, QString integratedAppImagesDestinationPath, - QWidget* parent) : + bool integrateInPlace, QWidget* parent) : QDialog(parent), ui(new Ui::IntegrationDialog), pathToAppImage(std::move(pathToAppImage)), - integratedAppImagesDestinationPath(std::move(integratedAppImagesDestinationPath)) { + integratedAppImagesDestinationPath(std::move(integratedAppImagesDestinationPath)), + integrateInPlace(integrateInPlace) { ui->setupUi(this); setIcon(); @@ -29,6 +30,22 @@ IntegrationDialog::IntegrationDialog(QString pathToAppImage, QString integratedA } void IntegrationDialog::setMessage() { + // the message designed in the .ui file describes integrating and moving the AppImage into the integration + // destination directory; when the AppImage is going to be integrated in place, use an alternate message + // which does not mention the move + if (integrateInPlace) { + ui->message->setText( + tr("%1 has not been integrated into your system.\n" + "\n" + "Integrating it will include the AppImage in your application launcher, and leave the file in its " + "current location.\n" + "\n" + "To remove or update the AppImage, please use the context menu of the application icon in your " + "task bar or launcher.").arg(pathToAppImage) + ); + return; + } + QString message = ui->message->text(); message = message.arg(pathToAppImage, integratedAppImagesDestinationPath); ui->message->setText(message); diff --git a/src/ui/integration_dialog.h b/src/ui/integration_dialog.h index 6ccc6788..e6bf85eb 100644 --- a/src/ui/integration_dialog.h +++ b/src/ui/integration_dialog.h @@ -18,7 +18,7 @@ Q_OBJECT }; explicit IntegrationDialog(QString pathToAppImage, QString integratedAppImagesDestinationPath, - QWidget* parent = nullptr); + bool integrateInPlace = false, QWidget* parent = nullptr); ~IntegrationDialog() override; @@ -35,6 +35,7 @@ Q_OBJECT Ui::IntegrationDialog* ui; QString pathToAppImage; QString integratedAppImagesDestinationPath; + bool integrateInPlace; void setIcon(); diff --git a/src/ui/main.cpp b/src/ui/main.cpp index c99e4ae4..99bdff9c 100644 --- a/src/ui/main.cpp +++ b/src/ui/main.cpp @@ -283,10 +283,12 @@ int main(int argc, char** argv) { displayError("Could not read config file"); } - // if the user opted out of the "ask move" thing, we can just run the AppImage - if (config->contains("AppImageLauncher/ask_to_move") && !config->value("AppImageLauncher/ask_to_move").toBool()) { - return runAppImage(pathToAppImage, appImageArgv.size(), appImageArgv.data()); - } + // the "ask to move" option is presented in the settings and first run dialogs (a checkbox inside the + // "Launcher Dialog" section) as merely controlling whether AppImages are moved into the integration + // destination directory; opting out must not disable the launcher dialog altogether, therefore AppImages + // are integrated in place instead of not being integrated at all + const auto askToMove = !config->contains("AppImageLauncher/ask_to_move") || + config->value("AppImageLauncher/ask_to_move").toBool(); // check for X-AppImage-Integrate=false auto shallNotBeIntegrated = appimage_shall_not_be_integrated(pathToAppImage.toStdString().c_str()); @@ -312,7 +314,11 @@ int main(int argc, char** argv) { if (pathToAppImage.startsWith("/tmp/.mount_")) return runAppImage(pathToAppImage, appImageArgv.size(), appImageArgv.data()); - const auto pathToIntegratedAppImage = buildPathToIntegratedAppImage(pathToAppImage); + // when the user opted out of moving AppImages into the integration destination directory, the AppImage + // is integrated in place by using its current path as the target; integrateAppImage() skips the move + // if both paths are identical + const auto pathToIntegratedAppImage = + askToMove ? buildPathToIntegratedAppImage(pathToAppImage) : QString(pathToAppImage); auto integrateAndRunAppImage = [&pathToAppImage, &pathToIntegratedAppImage, &appImageArgv]() { // check whether integration was successful @@ -350,7 +356,9 @@ int main(int argc, char** argv) { // assume we have to ask // prove me wrong! - bool needToAskAboutMoving = true; + // if the user opted out of moving AppImages into the integration destination directory, there's no + // point in asking them about moving an already integrated AppImage, either + bool needToAskAboutMoving = askToMove; // okay, I'll try to prove you wrong { @@ -420,7 +428,8 @@ int main(int argc, char** argv) { } QString integratedAppImagesDestinationPath = integratedAppImagesDestination().path(); - auto integrationDialog = new IntegrationDialog(pathToAppImage, integratedAppImagesDestinationPath); + auto integrationDialog = + new IntegrationDialog(pathToAppImage, integratedAppImagesDestinationPath, !askToMove); integrationDialog->show(); // As the integration dialog is the only window in our application we can safely use its exec method