From: Richard Kimberly Heck Date: Mon, 13 May 2019 03:30:13 +0000 (-0400) Subject: GMO for BG X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=45555a08fa4511bb94775eb7344c2e5b35a4173e;p=features.git GMO for BG --- diff --git a/po/bg.gmo b/po/bg.gmo new file mode 100644 index 0000000000..e0b4543c3e Binary files /dev/null and b/po/bg.gmo differ diff --git a/po/cs.gmo b/po/cs.gmo index 0b26f6fca1..b860e8dac0 100644 Binary files a/po/cs.gmo and b/po/cs.gmo differ diff --git a/po/de.gmo b/po/de.gmo index 66e0183271..596893654b 100644 Binary files a/po/de.gmo and b/po/de.gmo differ diff --git a/po/sk.gmo b/po/sk.gmo index e42ad6a5ac..b34d27d6bb 100644 Binary files a/po/sk.gmo and b/po/sk.gmo differ diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 98dba1dfa5..220197ca57 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -305,6 +305,26 @@ typedef map ToolbarMap; typedef shared_ptr 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 GuiView::GuiViewPrivate::guiWorkAreas() { QVector areas; diff --git a/src/frontends/qt4/GuiView.h b/src/frontends/qt4/GuiView.h index fa36f7ff8b..56b11fe6e5 100644 --- a/src/frontends/qt4/GuiView.h +++ b/src/frontends/qt4/GuiView.h @@ -231,6 +231,8 @@ public Q_SLOTS: void updateWindowTitle(GuiWorkArea * wa); /// void disableShellEscape(); + /// + void checkKillBackground(); private Q_SLOTS: /// diff --git a/src/frontends/qt4/Makefile.am b/src/frontends/qt4/Makefile.am index e2e3e1ce5e..7e6b34f9d2 100644 --- a/src/frontends/qt4/Makefile.am +++ b/src/frontends/qt4/Makefile.am @@ -197,6 +197,7 @@ MOCHEADER = \ GuiChanges.h \ GuiCharacter.h \ GuiCitation.h \ + GuiClickableLabel.h \ GuiClipboard.h \ GuiCommandBuffer.h \ GuiCommandEdit.h \