MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / warningDialog

Method warningDialog

Gui/Gui30.cpp:142–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142void
143Gui::warningDialog(const std::string & title,
144 const std::string & text,
145 bool useHtml)
146{
147 ///don't show dialogs when about to close, otherwise we could enter in a deadlock situation
148 {
149 QMutexLocker l(&_imp->aboutToCloseMutex);
150 if (_imp->_aboutToClose) {
151 return;
152 }
153 }
154
155 StandardButtons buttons(eStandardButtonYes | eStandardButtonNo);
156
157 if ( QThread::currentThread() != QCoreApplication::instance()->thread() ) {
158 QMutexLocker locker(&_imp->_uiUsingMainThreadMutex);
159 while (_imp->_uiUsingMainThread) {
160 _imp->_uiUsingMainThreadCond.wait(locker.mutex());
161 }
162 ++_imp->_uiUsingMainThread;
163 locker.unlock();
164 Q_EMIT doDialog(1, QString::fromUtf8( title.c_str() ), QString::fromUtf8( text.c_str() ), useHtml, buttons, (int)eStandardButtonYes);
165 locker.relock();
166 while (_imp->_uiUsingMainThread) {
167 _imp->_uiUsingMainThreadCond.wait(locker.mutex());
168 }
169 } else {
170 {
171 QMutexLocker locker(&_imp->_uiUsingMainThreadMutex);
172 ++_imp->_uiUsingMainThread;
173 }
174 Q_EMIT doDialog(1, QString::fromUtf8( title.c_str() ), QString::fromUtf8( text.c_str() ), useHtml, buttons, (int)eStandardButtonYes);
175 }
176}
177
178void
179Gui::warningDialog(const std::string & title,

Callers 2

createInstanceFunction · 0.45

Calls 1

unlockMethod · 0.45

Tested by

no test coverage detected