viewer: moved nouveau to application launch rather than viewer init
Viewer init was kind of too late since in many cases the sequence would start caching and crash the app before the user could even read the message. Moving to the startup makes it clearer from the beginning.
This commit is contained in:
@@ -415,6 +415,18 @@ void MainWindow::StatusBarDoubleClicked()
|
||||
task_man_panel_->raise();
|
||||
}
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
void MainWindow::ShowNouveauWarning()
|
||||
{
|
||||
QMessageBox::warning(this,
|
||||
tr("Driver Warning"),
|
||||
tr("Olive has detected your system is using the Nouveau graphics driver.\n\nThis driver is "
|
||||
"known to have stability and performance issues with Olive. It is highly recommended "
|
||||
"you install the proprietary NVIDIA driver before continuing to use Olive."),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
#endif
|
||||
|
||||
void MainWindow::UpdateTitle()
|
||||
{
|
||||
if (Core::instance()->GetActiveProject()) {
|
||||
@@ -626,6 +638,24 @@ void MainWindow::SetDefaultLayout()
|
||||
Qt::Vertical);
|
||||
}
|
||||
|
||||
void MainWindow::showEvent(QShowEvent *e)
|
||||
{
|
||||
QMainWindow::showEvent(e);
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
// Check for nouveau since that driver really doesn't work with Olive
|
||||
QOffscreenSurface surface;
|
||||
surface.create();
|
||||
QOpenGLContext context;
|
||||
context.create();
|
||||
context.makeCurrent(&surface);
|
||||
const char* vendor = reinterpret_cast<const char*>(context.functions()->glGetString(GL_VENDOR));
|
||||
if (!strcmp(vendor, "nouveau")) {
|
||||
QMetaObject::invokeMethod(this, "ShowNouveauWarning", Qt::QueuedConnection);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T *MainWindow::AppendPanelInternal(QList<T*>& list)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user