]> git.lyx.org Git - features.git/commitdiff
After confirm cancel, hide busy and cancel buttons
authorScott Kostyshak <skostysh@lyx.org>
Tue, 22 Nov 2022 19:24:11 +0000 (14:24 -0500)
committerScott Kostyshak <skostysh@lyx.org>
Tue, 22 Nov 2022 19:24:11 +0000 (14:24 -0500)
src/frontends/qt/GuiView.cpp
src/frontends/qt/GuiView.h

index 2ec50374df890fb2a2c8424efe82ebff32452db7..82a6f173820eb82be645136b590f418c297ea5db 100644 (file)
@@ -663,6 +663,9 @@ GuiView::GuiView(int id)
                processStop, SLOT(hide()));
        connect(processStop, SIGNAL(pressed()), this, SLOT(checkCancelBackground()));
 
+       connect(this, SIGNAL(scriptKilled()), busySVG, SLOT(hide()));
+       connect(this, SIGNAL(scriptKilled()), processStop, SLOT(hide()));
+
        stat_counts_ = new GuiClickableLabel(statusBar());
        stat_counts_->setAlignment(Qt::AlignCenter);
        stat_counts_->setFrameStyle(QFrame::StyledPanel);
@@ -831,8 +834,12 @@ void GuiView::checkCancelBackground()
        int const ret =
                Alert::prompt(ttl, msg, 1, 1,
                        _("&Cancel export"), _("Co&ntinue"));
-       if (ret == 0)
+       if (ret == 0) {
                Systemcall::killscript();
+               // stop busy signal immediately so that in the subsequent
+               // "Export canceled" prompt the status bar icons are accurate.
+               Q_EMIT scriptKilled();
+       }
 }
 
 void GuiView::statsPressed()
index cbe805eed336d6c3d7db956806cc5625263bd2ca..5b22ea574b8a618dd77d1c56056a519c835ee6d2 100644 (file)
@@ -228,6 +228,8 @@ Q_SIGNALS:
        void bufferViewChanged();
        /// emitted when zoom is modified
        void currentZoomChanged(int);
+       /// emitted when script is killed (e.g., user cancels export)
+       void scriptKilled();
 
 public Q_SLOTS:
        ///