forked from qt-creator/qt-creator
ScreenRecorder: Allow only one screen recorder dialog at a time
And show the dialog if it was already open but minimized. Change-Id: I9aebebba88488c795b253f6dadda7f356ffc9dc4 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -94,6 +94,19 @@ public:
|
||||
layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||
}
|
||||
|
||||
static void showDialog()
|
||||
{
|
||||
static QPointer<QDialog> staticInstance;
|
||||
|
||||
if (staticInstance.isNull()) {
|
||||
staticInstance = new ScreenRecorderDialog(Core::ICore::dialogParent());
|
||||
staticInstance->setAttribute(Qt::WA_DeleteOnClose);
|
||||
}
|
||||
staticInstance->show();
|
||||
staticInstance->raise();
|
||||
staticInstance->activateWindow();
|
||||
}
|
||||
|
||||
private:
|
||||
RecordWidget *m_recordWidget;
|
||||
TemporaryFile m_recordFile;
|
||||
@@ -132,9 +145,7 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
auto dialog = new ScreenRecorderDialog(Core::ICore::dialogParent());
|
||||
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||
dialog->show();
|
||||
ScreenRecorderDialog::showDialog();
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user