Skip to content

Commit

Permalink
Add Show OpenGL Info debug option
Browse files Browse the repository at this point in the history
  • Loading branch information
timangus committed Oct 11, 2023
1 parent d27db6f commit 007c876
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/app/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include "updates/updater.h"

#include "rendering/openglfunctions.h"

#include "shared/iapplication.h"
#include "shared/utils/qmlenum.h"
#include "shared/utils/downloadqueue.h"
Expand Down Expand Up @@ -135,6 +137,7 @@ class Application : public QObject, public IApplication
Q_PROPERTY(QStringList arguments READ arguments CONSTANT)

Q_PROPERTY(QStringList environment READ environment CONSTANT)
Q_PROPERTY(QString openGLInfo READ openGLInfo CONSTANT)

Q_PROPERTY(QStringList nameFilters READ nameFilters NOTIFY nameFiltersChanged)
Q_PROPERTY(QStringListModel* loadableExtensions READ loadableExtensions NOTIFY loadableExtensionsChanged)
Expand Down Expand Up @@ -168,6 +171,7 @@ class Application : public QObject, public IApplication
static QStringList arguments() { return QCoreApplication::arguments(); }

static QStringList environment() { return QProcessEnvironment::systemEnvironment().toStringList(); }
static QString openGLInfo() { return OpenGLFunctions::info(); }

Q_INVOKABLE bool canOpen(const QString& urlTypeName) const;
Q_INVOKABLE bool canOpenAnyOf(const QStringList& urlTypeNames) const;
Expand Down
14 changes: 14 additions & 0 deletions source/app/ui/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,12 @@ ApplicationWindow
text: mainWindow.environment
}

TextDialog
{
id: openGLInfoDialog
text: application.openGLInfo
}

ShowPaletteDialog { id: showPaletteDialog }

TextDialog
Expand Down Expand Up @@ -1872,6 +1878,13 @@ ApplicationWindow
onTriggered: function(source) { environmentDialog.show(); }
}

Action
{
id: showOpenGLInfoAction
text: qsTr("Show OpenGL Info")
onTriggered: function(source) { openGLInfoDialog.show(); }
}

Action
{
id: showPaletteAction
Expand Down Expand Up @@ -2444,6 +2457,7 @@ ApplicationWindow
PlatformMenuItem { action: reportScopeTimersAction }
PlatformMenuItem { action: showCommandLineArgumentsAction }
PlatformMenuItem { action: showEnvironmentAction }
PlatformMenuItem { action: showOpenGLInfoAction }
PlatformMenuItem { action: showPaletteAction }
PlatformMenuItem { action: testCommandAction }
PlatformMenuItem { action: testInfiniteParseAction }
Expand Down

0 comments on commit 007c876

Please sign in to comment.