Skip to content

Commit 0f37b16

Browse files
committed
[win-nix] tab could be closed while doc building operation
1 parent fac8b7b commit 0f37b16

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

win-linux/src/asctabwidget.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,18 @@ bool CAscTabWidget::isFragmented(int index)
10091009
return false;
10101010
}
10111011

1012+
bool CAscTabWidget::isProcessed(int index) const
1013+
{
1014+
if (!(index < 0) && index < count()) {
1015+
CTabPanel * panel = static_cast<CTabPanel *>(widget(index));
1016+
CAscTabData * doc = panel->data();
1017+
1018+
return !doc->closed() && doc->isViewType(cvwtEditor) && ((CCefViewEditor *)panel->cef())->IsBuilding();
1019+
}
1020+
1021+
return false;
1022+
}
1023+
10121024
void CAscTabWidget::setFullScreen(bool apply, int id)
10131025
{
10141026
QWidget * fsWidget;

win-linux/src/asctabwidget.h

+1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ class CAscTabWidget : public QTabWidget, public CScalingWrapper
182182
int findModified(const QString& portal = QString());
183183
int findFragmented(const QString& portal = QString());
184184
bool isFragmented(int index);
185+
bool isProcessed(int index) const;
185186

186187
void adjustTabsSize();
187188
void activate(bool);

win-linux/src/cmainpanel.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,9 @@ void CMainPanel::onTabChanged(int index)
490490

491491
void CMainPanel::onTabCloseRequest(int index)
492492
{
493+
if ( m_pTabs->isProcessed(index) ) {
494+
return;
495+
} else
493496
if ( !m_pTabs->isFragmented(index) ) {
494497
if (trySaveDocument(index) == MODAL_RESULT_NO) {
495498
m_pTabs->closeEditorByIndex(index, false);

win-linux/src/version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939

4040
#define VER_NUM_MAJOR 5
4141
#define VER_NUM_MINOR 2
42-
#define VER_NUM_BUILD 79
43-
#define VER_NUM_REVISION 468
42+
#define VER_NUM_BUILD 80
43+
#define VER_NUM_REVISION 470
4444
#define VER_NUMBER VER_NUM_MAJOR,VER_NUM_MINOR,VER_NUM_BUILD,VER_NUM_REVISION
4545
#define VER_STRING VER_STR_LONG(VER_NUM_MAJOR,VER_NUM_MINOR,VER_NUM_BUILD,VER_NUM_REVISION)
4646
#define VER_STRING_SHORT VER_STR_SHORT(VER_NUM_MAJOR,VER_NUM_MINOR)

0 commit comments

Comments
 (0)