diff --git a/AntidoteIcone.png b/AntidoteIcone.png deleted file mode 100644 index 6878441e3..000000000 Binary files a/AntidoteIcone.png and /dev/null differ diff --git a/NEWS.yml b/NEWS.yml index d33e72585..88cd248f3 100644 --- a/NEWS.yml +++ b/NEWS.yml @@ -57,7 +57,7 @@ Description: - "Writing games: forbid Ctrl+Z" Version: 1.9.27 -Date: 2021-08-01 +Date: 2021-08-02 Type: stable Description: - "Minimap: new minimap scrollbar" diff --git a/eu.skribisto.skribisto.appdata.xml b/eu.skribisto.skribisto.appdata.xml index a6591a8a8..7e4739599 100644 --- a/eu.skribisto.skribisto.appdata.xml +++ b/eu.skribisto.skribisto.appdata.xml @@ -28,7 +28,7 @@ - +
  • Minimap: new minimap scrollbar
  • diff --git a/package/flatpak/eu.skribisto.skribisto.json b/package/flatpak/eu.skribisto.skribisto.json index ddc7737de..2d921d5bf 100755 --- a/package/flatpak/eu.skribisto.skribisto.json +++ b/package/flatpak/eu.skribisto.skribisto.json @@ -10,7 +10,9 @@ "--socket=fallback-x11", "--socket=wayland", "--filesystem=home", - "--device=dri" + "--device=dri", + "--own-name=com.druide.antidote.*", + "--talk-name=org.freedesktop.Flatpak" ], "separate-locales": false, "modules": [ diff --git a/package/flatpak/eu.skribisto.skribisto.yml b/package/flatpak/eu.skribisto.skribisto.yml index 6fa0b6ec0..867cf3bd5 100755 --- a/package/flatpak/eu.skribisto.skribisto.yml +++ b/package/flatpak/eu.skribisto.skribisto.yml @@ -10,6 +10,8 @@ finish-args: - --socket=wayland - --filesystem=home - --device=dri + - --own-name=com.druide.antidote.* + - --talk-name=org.freedesktop.Flatpak separate-locales: false modules: diff --git a/package/flatpak/local/eu.skribisto.skribisto.yml b/package/flatpak/local/eu.skribisto.skribisto.yml index 14ef7fbde..e3bb33e58 100755 --- a/package/flatpak/local/eu.skribisto.skribisto.yml +++ b/package/flatpak/local/eu.skribisto.skribisto.yml @@ -8,8 +8,10 @@ finish-args: - --share=network - --socket=fallback-x11 - --socket=wayland - - --filesystem=host + - --filesystem=home - --device=dri + - --own-name=com.druide.antidote.* + - --talk-name=org.freedesktop.Flatpak separate-locales: false modules: diff --git a/src/app/src/main.cpp b/src/app/src/main.cpp index 503959a7d..1972bc293 100755 --- a/src/app/src/main.cpp +++ b/src/app/src/main.cpp @@ -412,16 +412,32 @@ int main(int argc, char *argv[]) if (returnCode == -1) { QProcess *proc = new QProcess(); - proc->start(QCoreApplication::applicationFilePath(), app.arguments()); + + if (QFile("/app/manifest.json").exists()) { // means it's in Flatpak + QStringList allArguments; + allArguments << "--host" << "flatpak" << "run" << "eu.skribisto.skribisto"; + proc->start("flatpak-spawn", allArguments); + } + else { + proc->start(QCoreApplication::applicationFilePath(), QStringList()); + } } // restart with Fist step opened and at plugin page: if (returnCode == -2) { - QStringList args = app.arguments(); - args << "--firstStepsAtPluginPage"; QProcess *proc = new QProcess(); - proc->start(QCoreApplication::applicationFilePath(), args); + + if (QFile("/app/manifest.json").exists()) { // means it's in Flatpak + QStringList allArguments; + allArguments << "--host" << "flatpak" << "run" << "eu.skribisto.skribisto" << "--firstStepsAtPluginPage"; + proc->start("flatpak-spawn", allArguments); + } + else { + QStringList args; + args << "--firstStepsAtPluginPage"; + proc->start(QCoreApplication::applicationFilePath(), args); + } } return returnCode; diff --git a/src/plugins/antidotePageToolbox/AdaptateurAntidote.h b/src/plugins/antidotePageToolbox/AdaptateurAntidote.h index 17dc122c8..6b35f1478 100644 --- a/src/plugins/antidotePageToolbox/AdaptateurAntidote.h +++ b/src/plugins/antidotePageToolbox/AdaptateurAntidote.h @@ -1,6 +1,7 @@ /* * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c AdaptateurAntidote -a AdaptateurAntidote API_DBus.xml + * Command line was: qdbusxml2cpp -c AdaptateurAntidote -a AdaptateurAntidote + *API_DBus.xml * * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. * @@ -16,8 +17,8 @@ #include QT_BEGIN_NAMESPACE class QByteArray; -template class QList; -template class QMap; +templateclass QList; +templateclass QMap; class QString; class QStringList; class QVariant; @@ -26,76 +27,90 @@ QT_END_NAMESPACE /* * Adaptor class for interface com.druide.antidote.dbus.api */ -class AdaptateurAntidote: public QDBusAbstractAdaptor -{ +class AdaptateurAntidote : public QDBusAbstractAdaptor { Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "com.druide.antidote.dbus.api") + Q_CLASSINFO("D-Bus Interface", "com.druide.antidote.dbus.api") Q_CLASSINFO("D-Bus Introspection", "" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" - "") + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + "") + public: + AdaptateurAntidote(QObject *parent); virtual ~AdaptateurAntidote(); -public: // PROPERTIES -public Q_SLOTS: // METHODS +public: + + // PROPERTIES + +public Q_SLOTS: + + // METHODS void ActiveDocument(); - void CorrigeDansTexteur(int leDebut, int laFin, const QString &laChaine, bool automatique); - QString DonneBloc(int leDebut, int laFin); - int DonneDebutSelection(); - int DonneFinDocument(); - int DonneFinSelection(); - int DonnePositionFinBoite(int unePos); + void CorrigeDansTexteur(int leDebut, + int laFin, + const QString& laChaine, + bool automatique); + QString DonneBloc(int leDebut, + int laFin); + int DonneDebutSelection(); + int DonneFinDocument(); + int DonneFinSelection(); + int DonnePositionFinBoite(int unePos); QString DonneRetourDeCharriot(); QString DonneTitreDocument(); - bool PermetsRetourDeCharriot(); - void RetourneAuTexteur(); - void RompsLienCorrecteur(); - void RompsLienTexteur(); - void SelectionneIntervalle(int leDebut, int laFin); -Q_SIGNALS: // SIGNALS + bool PermetsRetourDeCharriot(); + void RetourneAuTexteur(); + void RompsLienCorrecteur(); + void RompsLienTexteur(); + void SelectionneIntervalle(int leDebut, + int laFin); + +Q_SIGNALS: + + // SIGNALS }; -#endif +#endif // ifndef ADAPTATEURANTIDOTE_H diff --git a/src/plugins/antidotePageToolbox/ImplementationAntidote.cpp b/src/plugins/antidotePageToolbox/ImplementationAntidote.cpp index 3ea4b98f6..75eb8841c 100644 --- a/src/plugins/antidotePageToolbox/ImplementationAntidote.cpp +++ b/src/plugins/antidotePageToolbox/ImplementationAntidote.cpp @@ -7,7 +7,8 @@ ImplementationAntidote::ImplementationAntidote(QObject *parent) : QObject(parent), m_textDoc(nullptr), m_language(Context), - m_connexionDBus(QDBusConnection::sessionBus()), m_adaptateur(nullptr) + m_connexionDBus(QDBusConnection::sessionBus()), + m_adaptateur(nullptr) { m_textTopMargin = 2; m_textIndent = 2; @@ -266,7 +267,30 @@ void ImplementationAntidote::launchAntidote(TypeOuvrage ouvrage) break; } - QProcess::startDetached(cheminCompletVersAntidote, arguments); + QFile antidoteFile(cheminCompletVersAntidote); + + if (antidoteFile.exists()) { + qDebug() << "Found" << cheminCompletVersAntidote; + + if (!QProcess::startDetached(cheminCompletVersAntidote, arguments)) { + qCritical() << "Antidote wouldn't start"; + } + } + else if (QFile("/app/manifest.json").exists()) { // means it's in Flatpak + qDebug() << "Found /app/manifest.json --> Flatpak !"; + + QProcess *proc = new QProcess(); + QStringList allArguments; + allArguments << "--host" << cheminCompletVersAntidote << arguments; + proc->start("flatpak-spawn", allArguments); + + if (!proc->waitForStarted(2000)) { + qCritical() << "Antidote wouldn't start"; + } + } + else { + qCritical() << "Antidote wouldn't find the executable at" << cheminCompletVersAntidote; + } } // -------------------------------------------------------------------------