From a5cb99707d2b93c4aed333655c308397d8d788c8 Mon Sep 17 00:00:00 2001 From: Yuriy Puchkov Date: Wed, 12 Aug 2020 20:28:39 +0300 Subject: [PATCH] Add notification on second simultaneous launch --- .../singleapplication/singleapplication.cpp | 22 +++++++++++++++++++ translations/Internationalization_ca.ts | 16 +++++++++----- translations/Internationalization_de_DE.ts | 16 +++++++++----- translations/Internationalization_es.ts | 16 +++++++++----- translations/Internationalization_fr.ts | 16 +++++++++----- translations/Internationalization_hu.ts | 5 +++++ translations/Internationalization_ja.ts | 16 +++++++++----- translations/Internationalization_ka.ts | 16 +++++++++----- translations/Internationalization_nl.ts | 16 +++++++++----- translations/Internationalization_pl.ts | 16 +++++++++----- translations/Internationalization_pt_br.ts | 16 +++++++++----- translations/Internationalization_ru.ts | 16 +++++++++----- translations/Internationalization_sk.ts | 16 +++++++++----- translations/Internationalization_sr.ts | 16 +++++++++----- translations/Internationalization_tr.ts | 16 +++++++++----- translations/Internationalization_uk.ts | 16 +++++++++----- translations/Internationalization_zh_CN.ts | 16 +++++++++----- translations/Internationalization_zh_TW.ts | 16 +++++++++----- 18 files changed, 203 insertions(+), 80 deletions(-) diff --git a/src/third-party/singleapplication/singleapplication.cpp b/src/third-party/singleapplication/singleapplication.cpp index f452e70d..1f34c7ed 100644 --- a/src/third-party/singleapplication/singleapplication.cpp +++ b/src/third-party/singleapplication/singleapplication.cpp @@ -32,6 +32,8 @@ #include #include #include +#include +#include #ifdef Q_OS_UNIX #include @@ -415,6 +417,26 @@ SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSeconda d->connectToPrimary( timeout, SingleApplicationPrivate::NewInstance ); delete d; + + // show message box with inforation that Flameshot is already launched + QMessageBox msgBox; + msgBox.setText(QObject::tr("Hi, I'm already running!\nYou can find me in the system tray.")); + int cnt = 3; + QTimer cntDown; + QObject::connect( + &cntDown, + &QTimer::timeout, + [&msgBox,&cnt, &cntDown]()->void{ + if(--cnt < 0){ + cntDown.stop(); + msgBox.close(); + } else { + msgBox.setWindowTitle(QString("Flameshot (%1)").arg(cnt + 1)); + } + }); + cntDown.start(1000); + msgBox.exec(); + ::exit( EXIT_SUCCESS ); } diff --git a/translations/Internationalization_ca.ts b/translations/Internationalization_ca.ts index 531de07d..2842d8ca 100644 --- a/translations/Internationalization_ca.ts +++ b/translations/Internationalization_ca.ts @@ -798,11 +798,11 @@ Press Space to open the side panel. S'ha produït un error en anomenar i guardar - - - - - + + + + + Unable to connect via DBus No es pot connectar mitjançant DBus @@ -826,6 +826,12 @@ Press Space to open the side panel. URL copied to clipboard. L'URL s'ha copiat al porta-retalls. + + + Hi, I'm already running! +You can find me in the system tray. + + RectangleTool diff --git a/translations/Internationalization_de_DE.ts b/translations/Internationalization_de_DE.ts index 362f135d..56b88531 100644 --- a/translations/Internationalization_de_DE.ts +++ b/translations/Internationalization_de_DE.ts @@ -806,11 +806,11 @@ Drücke die Leertaste um das Seitenmenü zu öffnen. Fehler beim Speichern unter - - - - - + + + + + Unable to connect via DBus Kann nicht via DBus verbinden @@ -829,6 +829,12 @@ Drücke die Leertaste um das Seitenmenü zu öffnen. URL copied to clipboard. URL kopiert. + + + Hi, I'm already running! +You can find me in the system tray. + + RectangleTool diff --git a/translations/Internationalization_es.ts b/translations/Internationalization_es.ts index a1c72751..ab3ec469 100644 --- a/translations/Internationalization_es.ts +++ b/translations/Internationalization_es.ts @@ -806,11 +806,11 @@ Presiona Espacio para abrir el panel lateral. Error intentando guardar como - - - - - + + + + + Unable to connect via DBus Imposible conectar mediante DBus @@ -829,6 +829,12 @@ Presiona Espacio para abrir el panel lateral. URL copied to clipboard. URL copiada al portapapeles. + + + Hi, I'm already running! +You can find me in the system tray. + + RectangleTool diff --git a/translations/Internationalization_fr.ts b/translations/Internationalization_fr.ts index 5ef43c67..58594fb2 100644 --- a/translations/Internationalization_fr.ts +++ b/translations/Internationalization_fr.ts @@ -806,11 +806,11 @@ Appuyer sur Espace pour ouvrir le panneau latéral. Erreur lors de la sauvegarde sous - - - - - + + + + + Unable to connect via DBus Impossible de se connecter via DBus @@ -829,6 +829,12 @@ Appuyer sur Espace pour ouvrir le panneau latéral. URL copied to clipboard. URL copiée dans le Presse-papier. + + + Hi, I'm already running! +You can find me in the system tray. + + RectangleTool diff --git a/translations/Internationalization_hu.ts b/translations/Internationalization_hu.ts index 3fce8960..50cf4d20 100644 --- a/translations/Internationalization_hu.ts +++ b/translations/Internationalization_hu.ts @@ -694,6 +694,11 @@ Press Space to open the side panel. URL copied to clipboard. URL másolva a vágólapra. + + Hi, I'm already running! +You can find me in the system tray. + + RectangleTool diff --git a/translations/Internationalization_ja.ts b/translations/Internationalization_ja.ts index a0891358..c3a833ce 100644 --- a/translations/Internationalization_ja.ts +++ b/translations/Internationalization_ja.ts @@ -806,11 +806,11 @@ Enter を押すと画面をキャプチャー。 保存時にエラーが発生しました: - - - - - + + + + + Unable to connect via DBus DBus に接続できません @@ -829,6 +829,12 @@ Enter を押すと画面をキャプチャー。 URL copied to clipboard. URL をクリップボードにコピーしました。 + + + Hi, I'm already running! +You can find me in the system tray. + + RectangleTool diff --git a/translations/Internationalization_ka.ts b/translations/Internationalization_ka.ts index 7134590f..26b8f8a8 100644 --- a/translations/Internationalization_ka.ts +++ b/translations/Internationalization_ka.ts @@ -802,11 +802,11 @@ Press Space to open the side panel. შეცდომა მცდელობისას შენახულიყო როგორც: - - - - - + + + + + Unable to connect via DBus DBus-ით დაკავშირება ვერ მოხერხდა @@ -825,6 +825,12 @@ Press Space to open the side panel. URL copied to clipboard. URL დაკოპირდა გაცვლის ბუფერში. + + + Hi, I'm already running! +You can find me in the system tray. + + RectangleTool diff --git a/translations/Internationalization_nl.ts b/translations/Internationalization_nl.ts index 87f7751d..98a20983 100644 --- a/translations/Internationalization_nl.ts +++ b/translations/Internationalization_nl.ts @@ -806,11 +806,11 @@ Druk op spatie om het zijpaneel te openen. Fout tijdens opslaan als - - - - - + + + + + Unable to connect via DBus Kan niet verbinden via DBus @@ -829,6 +829,12 @@ Druk op spatie om het zijpaneel te openen. URL copied to clipboard. URL gekopieerd naar klembord. + + + Hi, I'm already running! +You can find me in the system tray. + + RectangleTool diff --git a/translations/Internationalization_pl.ts b/translations/Internationalization_pl.ts index 9a8fe7aa..7cc84cdd 100644 --- a/translations/Internationalization_pl.ts +++ b/translations/Internationalization_pl.ts @@ -805,11 +805,11 @@ Spacja, aby pokazać panel boczny. Błąd przy próbie zapisu jako - - - - - + + + + + Unable to connect via DBus Nie udało się połączyć za pomocą DBus @@ -828,6 +828,12 @@ Spacja, aby pokazać panel boczny. URL copied to clipboard. URL skopiowany do schowka. + + + Hi, I'm already running! +You can find me in the system tray. + + RectangleTool diff --git a/translations/Internationalization_pt_br.ts b/translations/Internationalization_pt_br.ts index 2e409a6e..386a28e7 100644 --- a/translations/Internationalization_pt_br.ts +++ b/translations/Internationalization_pt_br.ts @@ -806,11 +806,11 @@ Pressione espaço abrir o painel lateral. Erro tentando salvar como - - - - - + + + + + Unable to connect via DBus Não foi possível conectar via DBus @@ -829,6 +829,12 @@ Pressione espaço abrir o painel lateral. URL copied to clipboard. URL copiada para o clipboard. + + + Hi, I'm already running! +You can find me in the system tray. + + RectangleTool diff --git a/translations/Internationalization_ru.ts b/translations/Internationalization_ru.ts index fd13d4c0..7dd54d2b 100644 --- a/translations/Internationalization_ru.ts +++ b/translations/Internationalization_ru.ts @@ -834,11 +834,11 @@ Press Space to open the side panel. Ошибка при попытке сохранить как - - - - - + + + + + Unable to connect via DBus Не удалось подключиться через DBus @@ -861,6 +861,12 @@ Press Space to open the side panel. File is deleted from S3 Файл удален с S3 + + + Hi, I'm already running! +You can find me in the system tray. + Привет, а я уже работаю!\nВы можете найти меня в системном трэе. + RectangleTool diff --git a/translations/Internationalization_sk.ts b/translations/Internationalization_sk.ts index 292a2eb5..f1a2f8fe 100644 --- a/translations/Internationalization_sk.ts +++ b/translations/Internationalization_sk.ts @@ -784,11 +784,11 @@ Stlačte medzerník pre otvorenie postranného panelu. QObject - - - - - + + + + + Unable to connect via DBus Nie je možné pripojiť sa prostredníctvom DBus @@ -829,6 +829,12 @@ Stlačte medzerník pre otvorenie postranného panelu. URL copied to clipboard. URL skopírovaná do schránky. + + + Hi, I'm already running! +You can find me in the system tray. + + RectangleTool diff --git a/translations/Internationalization_sr.ts b/translations/Internationalization_sr.ts index fa8a97b9..6b06e62b 100644 --- a/translations/Internationalization_sr.ts +++ b/translations/Internationalization_sr.ts @@ -806,11 +806,11 @@ Press Space to open the side panel. Грешка приликом уписивања као - - - - - + + + + + Unable to connect via DBus Нисам успео да се повежем кроз DBus @@ -829,6 +829,12 @@ Press Space to open the side panel. URL copied to clipboard. Интернет адреса је сачувана у привременој меморији. + + + Hi, I'm already running! +You can find me in the system tray. + + RectangleTool diff --git a/translations/Internationalization_tr.ts b/translations/Internationalization_tr.ts index d64c51e4..fb765026 100644 --- a/translations/Internationalization_tr.ts +++ b/translations/Internationalization_tr.ts @@ -806,11 +806,11 @@ Yan paneli açmak için Boşluk tuşuna basın. Farklı kaydetmeye çalışılırken hata oluştu - - - - - + + + + + Unable to connect via DBus DBus ile bağlanılamadı @@ -829,6 +829,12 @@ Yan paneli açmak için Boşluk tuşuna basın. URL copied to clipboard. URL panoya kopyalandı. + + + Hi, I'm already running! +You can find me in the system tray. + + RectangleTool diff --git a/translations/Internationalization_uk.ts b/translations/Internationalization_uk.ts index 02617ecb..f1b49d6c 100644 --- a/translations/Internationalization_uk.ts +++ b/translations/Internationalization_uk.ts @@ -834,11 +834,11 @@ Press Space to open the side panel. Помилка під час збереження як - - - - - + + + + + Unable to connect via DBus Не вдалось підключитись через DBus @@ -861,6 +861,12 @@ Press Space to open the side panel. File is deleted from S3 Файл видален з S3 + + + Hi, I'm already running! +You can find me in the system tray. + Привіт, а я вже працюю!\nВи можете знайти мене у системному трэї. + RectangleTool diff --git a/translations/Internationalization_zh_CN.ts b/translations/Internationalization_zh_CN.ts index dcb772de..4065063c 100644 --- a/translations/Internationalization_zh_CN.ts +++ b/translations/Internationalization_zh_CN.ts @@ -807,11 +807,11 @@ Press Space to open the side panel. 尝试另存为时出错 - - - - - + + + + + Unable to connect via DBus 无法通过DBus进行连接 @@ -830,6 +830,12 @@ Press Space to open the side panel. URL copied to clipboard. 复制链接到剪贴板。 + + + Hi, I'm already running! +You can find me in the system tray. + + RectangleTool diff --git a/translations/Internationalization_zh_TW.ts b/translations/Internationalization_zh_TW.ts index 2d0330fd..cab6270f 100644 --- a/translations/Internationalization_zh_TW.ts +++ b/translations/Internationalization_zh_TW.ts @@ -802,11 +802,11 @@ Press Space to open the side panel. 嘗試另存新檔時發生錯誤 - - - - - + + + + + Unable to connect via DBus 無法透過 DBus 進行連接 @@ -825,6 +825,12 @@ Press Space to open the side panel. URL copied to clipboard. 連結已複製到剪貼簿 + + + Hi, I'm already running! +You can find me in the system tray. + + RectangleTool