mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -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()
|
LibraryWindow::LibraryWindow()
|
||||||
: QMainWindow(), fullscreen(false), previousFilter(""), fetching(false), status(LibraryWindow::Normal), removeError(false)
|
: QMainWindow(), fullscreen(false), previousFilter(""), fetching(false), status(LibraryWindow::Normal), removeError(false)
|
||||||
{
|
{
|
||||||
|
createSettings();
|
||||||
|
|
||||||
setupUI();
|
setupUI();
|
||||||
|
|
||||||
loadLibraries();
|
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()
|
void LibraryWindow::setupUI()
|
||||||
{
|
{
|
||||||
|
setupOpenglSetting();
|
||||||
|
|
||||||
setUnifiedTitleAndToolBarOnMac(true);
|
setUnifiedTitleAndToolBarOnMac(true);
|
||||||
|
|
||||||
libraryCreator = new LibraryCreator();
|
libraryCreator = new LibraryCreator();
|
||||||
packageManager = new PackageManager();
|
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);
|
historyController = new YACReaderHistoryController(this);
|
||||||
|
|
||||||
createActions();
|
createActions();
|
||||||
@ -196,20 +219,8 @@ void LibraryWindow::doLayout()
|
|||||||
libraryToolBar = new YACReaderMainToolBar(this);
|
libraryToolBar = new YACReaderMainToolBar(this);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NO_OPENGL
|
//FOLDERS FILTER-------------------------------------------------------------
|
||||||
//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
|
|
||||||
//FOLDERS FILTER-------------------------------------------------------------
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
#ifndef Q_OS_MAC
|
#ifndef Q_OS_MAC
|
||||||
//in MacOSX the searchEdit is created using the toolbar wrapper
|
//in MacOSX the searchEdit is created using the toolbar wrapper
|
||||||
searchEdit = new YACReaderSearchLineEdit();
|
searchEdit = new YACReaderSearchLineEdit();
|
||||||
|
@ -261,6 +261,8 @@ public:
|
|||||||
|
|
||||||
NavigationStatus status;
|
NavigationStatus status;
|
||||||
|
|
||||||
|
void createSettings();
|
||||||
|
void setupOpenglSetting();
|
||||||
void setupUI();
|
void setupUI();
|
||||||
void createActions();
|
void createActions();
|
||||||
void createToolBars();
|
void createToolBars();
|
||||||
|
Loading…
Reference in New Issue
Block a user