mirror of
https://github.com/YACReader/yacreader
synced 2025-05-27 19:00:29 -04:00
Configure OpenGL settings earlier to avoid wrong state in the options dialog
This commit is contained in:
parent
13d0f5fc75
commit
e2483217d9
@ -97,6 +97,8 @@ using namespace YACReader;
|
||||
LibraryWindow::LibraryWindow()
|
||||
: QMainWindow(), fullscreen(false), previousFilter(""), fetching(false), status(LibraryWindow::Normal), removeError(false)
|
||||
{
|
||||
createSettings();
|
||||
|
||||
setupUI();
|
||||
|
||||
loadLibraries();
|
||||
@ -119,16 +121,37 @@ void LibraryWindow::afterLaunchTasks()
|
||||
}
|
||||
}
|
||||
|
||||
void LibraryWindow::createSettings()
|
||||
{
|
||||
settings = new QSettings(YACReader::getSettingsPath() + "/YACReaderLibrary.ini", QSettings::IniFormat); //TODO unificar la creación del fichero de config con el servidor
|
||||
settings->beginGroup("libraryConfig");
|
||||
}
|
||||
|
||||
void LibraryWindow::setupOpenglSetting()
|
||||
{
|
||||
#ifndef NO_OPENGL
|
||||
//FLOW-----------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
OpenGLChecker openGLChecker;
|
||||
bool openGLAvailable = openGLChecker.hasCompatibleOpenGLVersion();
|
||||
|
||||
if (openGLAvailable && !settings->contains(USE_OPEN_GL))
|
||||
settings->setValue(USE_OPEN_GL, 2);
|
||||
else if (!openGLAvailable)
|
||||
settings->setValue(USE_OPEN_GL, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void LibraryWindow::setupUI()
|
||||
{
|
||||
setupOpenglSetting();
|
||||
|
||||
setUnifiedTitleAndToolBarOnMac(true);
|
||||
|
||||
libraryCreator = new LibraryCreator();
|
||||
packageManager = new PackageManager();
|
||||
|
||||
settings = new QSettings(YACReader::getSettingsPath() + "/YACReaderLibrary.ini", QSettings::IniFormat); //TODO unificar la creación del fichero de config con el servidor
|
||||
settings->beginGroup("libraryConfig");
|
||||
|
||||
historyController = new YACReaderHistoryController(this);
|
||||
|
||||
createActions();
|
||||
@ -196,20 +219,8 @@ void LibraryWindow::doLayout()
|
||||
libraryToolBar = new YACReaderMainToolBar(this);
|
||||
#endif
|
||||
|
||||
#ifndef NO_OPENGL
|
||||
//FLOW-----------------------------------------------------------------------
|
||||
//FOLDERS FILTER-------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
OpenGLChecker openGLChecker;
|
||||
bool openGLAvailable = openGLChecker.hasCompatibleOpenGLVersion();
|
||||
|
||||
if (openGLAvailable && !settings->contains(USE_OPEN_GL))
|
||||
settings->setValue(USE_OPEN_GL, 2);
|
||||
else if (!openGLAvailable)
|
||||
settings->setValue(USE_OPEN_GL, 0);
|
||||
#endif
|
||||
//FOLDERS FILTER-------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
#ifndef Q_OS_MAC
|
||||
//in MacOSX the searchEdit is created using the toolbar wrapper
|
||||
searchEdit = new YACReaderSearchLineEdit();
|
||||
|
@ -261,6 +261,8 @@ public:
|
||||
|
||||
NavigationStatus status;
|
||||
|
||||
void createSettings();
|
||||
void setupOpenglSetting();
|
||||
void setupUI();
|
||||
void createActions();
|
||||
void createToolBars();
|
||||
|
Loading…
Reference in New Issue
Block a user