]> git.lyx.org Git - features.git/commitdiff
GMO for BG
authorRichard Kimberly Heck <rikiheck@lyx.org>
Mon, 13 May 2019 03:30:13 +0000 (23:30 -0400)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:29 +0000 (15:48 +0200)
po/bg.gmo [new file with mode: 0644]
po/cs.gmo
po/de.gmo
po/sk.gmo
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiView.h
src/frontends/qt4/Makefile.am

diff --git a/po/bg.gmo b/po/bg.gmo
new file mode 100644 (file)
index 0000000..e0b4543
Binary files /dev/null and b/po/bg.gmo differ
index 0b26f6fca120abf5bc0a890f7dbf98f71aaf1079..b860e8dac0ca31257c0de5c2f49f65f88a9cd282 100644 (file)
Binary files a/po/cs.gmo and b/po/cs.gmo differ
index 66e0183271f70111162dae58cb4775d5328eaf29..596893654be122eeb60aa7259ad28f6e1af8c09c 100644 (file)
Binary files a/po/de.gmo and b/po/de.gmo differ
index e42ad6a5ac269e91876cd573b11969c6bba2e5db..b34d27d6bb24e04ab020e8a6d09e1a7534db538d 100644 (file)
Binary files a/po/sk.gmo and b/po/sk.gmo differ
index 98dba1dfa5544be735f2d36e1ee2bfb0b1de8f8d..220197ca57782beac24ca86e1f976b84df7ac2b2 100644 (file)
@@ -305,6 +305,26 @@ typedef map<string, GuiToolbar *> ToolbarMap;
 
 typedef shared_ptr<Dialog> DialogPtr;
 
+
+// see https://wiki.qt.io/Clickable_QLabel
+class QClickableLabel : public QLabel {
+       Q_OBJECT
+public:
+       explicit QClickableLabel(QWidget * parent)
+               : QLabel(parent)
+       {}
+
+       ~QClickableLabel() {}
+
+Q_SIGNALS:
+       void clicked();
+
+protected:
+       void mousePressEvent(QMouseEvent *) {
+               Q_EMIT clicked();
+       }
+};
+
 } // namespace
 
 
@@ -610,7 +630,7 @@ GuiView::GuiView(int id)
        setAcceptDrops(true);
 
        // add busy indicator to statusbar
-       QLabel * busylabel = new QLabel(statusBar());
+       QClickableLabel * busylabel = new QClickableLabel(statusBar());
        statusBar()->addPermanentWidget(busylabel);
        search_mode mode = theGuiApp()->imageSearchMode();
        QString fn = toqstr(lyx::libFileSearch("images", "busy", "gif", mode).absFileName());
@@ -623,6 +643,7 @@ GuiView::GuiView(int id)
                busylabel, SLOT(show()));
        connect(&d.processing_thread_watcher_, SIGNAL(finished()),
                busylabel, SLOT(hide()));
+       connect(busylabel, SIGNAL(clicked()), this, SLOT(checkKillBackground()));
 
        QFontMetrics const fm(statusBar()->fontMetrics());
        int const iconheight = max(int(d.normalIconSize), fm.height());
@@ -713,6 +734,17 @@ void GuiView::disableShellEscape()
 }
 
 
+void GuiView::checkKillBackground()
+{
+       docstring const ttl = _("Cancel background process?");
+       docstring const msg = _("Do you want to cancel the background export process?");
+       const int decision =
+               Alert::prompt(ttl, msg, 1, 1, _("&Cancel Export"), _("Conti&nue"));
+       if (decision == 0)
+               Systemcall::killscript();
+}
+
+
 QVector<GuiWorkArea*> GuiView::GuiViewPrivate::guiWorkAreas()
 {
        QVector<GuiWorkArea*> areas;
index fa36f7ff8b79406883897e6ca3c02c9d1a7e19c0..56b11fe6e5787b18ca3e8c9a47f25d85495b85f2 100644 (file)
@@ -231,6 +231,8 @@ public Q_SLOTS:
        void updateWindowTitle(GuiWorkArea * wa);
        ///
        void disableShellEscape();
+       ///
+       void checkKillBackground();
 
 private Q_SLOTS:
        ///
index e2e3e1ce5e7aab126dbcef3f3b1977c3fb732aa8..7e6b34f9d2fa9f2de804b6b48af71ea1f4438a76 100644 (file)
@@ -197,6 +197,7 @@ MOCHEADER = \
        GuiChanges.h \
        GuiCharacter.h \
        GuiCitation.h \
+       GuiClickableLabel.h \
        GuiClipboard.h \
        GuiCommandBuffer.h \
        GuiCommandEdit.h \