mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Centralize cancelation of export
An export can be canceled by clicking on the status bar icon or by executing export-cancel (e.g., via Document > Cancel Background Process). The centralized code kills the script and updates the status bar icons. No change in functionality intended. Related commits:70a71a82
and01abab9a
.
This commit is contained in:
parent
01abab9ad9
commit
3b30dbfca4
@ -835,10 +835,7 @@ void GuiView::checkCancelBackground()
|
||||
Alert::prompt(ttl, msg, 1, 1,
|
||||
_("&Cancel export"), _("Co&ntinue"));
|
||||
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();
|
||||
cancelExport();
|
||||
}
|
||||
}
|
||||
|
||||
@ -4448,8 +4445,7 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
||||
break;
|
||||
}
|
||||
case LFUN_EXPORT_CANCEL: {
|
||||
Systemcall::killscript();
|
||||
Q_EMIT scriptKilled();
|
||||
cancelExport();
|
||||
break;
|
||||
}
|
||||
case LFUN_BUFFER_SWITCH: {
|
||||
@ -5099,6 +5095,15 @@ bool GuiView::lfunUiToggle(string const & ui_component)
|
||||
}
|
||||
|
||||
|
||||
void GuiView::cancelExport()
|
||||
{
|
||||
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::toggleFullScreen()
|
||||
{
|
||||
setWindowState(windowState() ^ Qt::WindowFullScreen);
|
||||
|
@ -408,6 +408,9 @@ private:
|
||||
///
|
||||
bool lfunUiToggle(std::string const & ui_component);
|
||||
///
|
||||
/// kill the script and hide export-in-progress status bar icons
|
||||
void cancelExport();
|
||||
///
|
||||
void toggleFullScreen();
|
||||
/// \return whether we did anything
|
||||
bool insertLyXFile(docstring const & fname, bool ignorelang = false);
|
||||
|
Loading…
Reference in New Issue
Block a user