File tree 3 files changed +26
-1
lines changed 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 4
4
5
5
#include " DmsExport.h"
6
6
#include " DmsMainWindow.h"
7
+ #include " DmsTreeView.h"
7
8
#include " ExportInfo.h"
8
9
#include " utl/Environment.h"
9
10
#include " Parallel.h"
@@ -727,7 +728,14 @@ void DmsExportWindow::exportActiveTabInfoOrCloseAfterExport()
727
728
m_export_button->setText (" Exporting..." );
728
729
// m_export_button->setDisabled(true);
729
730
m_cancel_button->setDisabled (true );
730
- m_export_button->repaint ();
731
+
732
+
733
+ {
734
+ MainWindow::TheOne ()->m_treeview ->setUpdatesEnabled (false );
735
+ MainThreadBlocker blockThis;
736
+ m_export_button->repaint ();
737
+ MainWindow::TheOne ()->m_treeview ->setUpdatesEnabled (true );
738
+ }
731
739
732
740
try {
733
741
exportImpl ();
Original file line number Diff line number Diff line change @@ -129,6 +129,16 @@ RTC_CALL bool IsProcessingMainThreadOpers()
129
129
return s_ProcessMainThreadOperLevel != 0 ;
130
130
}
131
131
132
+ MainThreadBlocker::MainThreadBlocker ()
133
+ {
134
+ ++s_ProcessMainThreadOperLevel;
135
+ }
136
+
137
+ MainThreadBlocker::~MainThreadBlocker ()
138
+ {
139
+ --s_ProcessMainThreadOperLevel;
140
+ }
141
+
132
142
void ProcessMainThreadOpers ()
133
143
{
134
144
assert (IsMainThread ());
Original file line number Diff line number Diff line change @@ -45,5 +45,12 @@ RTC_CALL UInt32 GetCallCount();
45
45
RTC_CALL UInt32 GetThreadID ();
46
46
RTC_CALL void AddMainThreadOper (std::function<void ()>&& func, bool postAlways = false);
47
47
RTC_CALL void ProcessMainThreadOpers ();
48
+ RTC_CALL bool IsProcessingMainThreadOpers ();
49
+
50
+ struct MainThreadBlocker
51
+ {
52
+ RTC_CALL MainThreadBlocker ();
53
+ RTC_CALL ~MainThreadBlocker ();
54
+ };
48
55
49
56
#endif // __RTC_ACT_MAINTHREAD_H
You can’t perform that action at this time.
0 commit comments