GUI: Remember main window splitter state.
Save and restore the vertical splitter state (sizes of tree view and details panel).
This commit is contained in:
parent
81a599e260
commit
f1b511a366
|
@ -65,6 +65,7 @@ ShowTypes;
|
||||||
#define SETTINGS_TOOLBARS_VIEW_SHOW "Toolbars/ShowView"
|
#define SETTINGS_TOOLBARS_VIEW_SHOW "Toolbars/ShowView"
|
||||||
#define SETTINGS_LOG_VIEW_WIDTH "Log/View width"
|
#define SETTINGS_LOG_VIEW_WIDTH "Log/View width"
|
||||||
#define SETTINGS_LOG_VIEW_HEIGHT "Log/View height"
|
#define SETTINGS_LOG_VIEW_HEIGHT "Log/View height"
|
||||||
|
#define SETTINGS_MAINWND_SPLITTER_STATE "Mainwindow/Vertical splitter state"
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -206,7 +206,7 @@ void MainWindow::SaveSettings()
|
||||||
mApplications->SaveSettings(mSettings);
|
mApplications->SaveSettings(mSettings);
|
||||||
|
|
||||||
mSettings->setValue(SETTINGS_LANGUAGE, mTranslation->GetCurrentLanguage());
|
mSettings->setValue(SETTINGS_LANGUAGE, mTranslation->GetCurrentLanguage());
|
||||||
mUI.mResults->SaveSettings();
|
mUI.mResults->SaveSettings(mSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::DoCheckFiles(const QStringList &files)
|
void MainWindow::DoCheckFiles(const QStringList &files)
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QModelIndex>
|
#include <QModelIndex>
|
||||||
|
#include <QSettings>
|
||||||
#include "erroritem.h"
|
#include "erroritem.h"
|
||||||
#include "resultsview.h"
|
#include "resultsview.h"
|
||||||
#include "resultstree.h"
|
#include "resultstree.h"
|
||||||
|
@ -43,9 +44,11 @@ ResultsView::ResultsView(QWidget * parent) :
|
||||||
|
|
||||||
void ResultsView::Initialize(QSettings *settings, ApplicationList *list)
|
void ResultsView::Initialize(QSettings *settings, ApplicationList *list)
|
||||||
{
|
{
|
||||||
|
|
||||||
mUI.mProgress->setMinimum(0);
|
mUI.mProgress->setMinimum(0);
|
||||||
mUI.mProgress->setVisible(false);
|
mUI.mProgress->setVisible(false);
|
||||||
|
|
||||||
|
QByteArray state = settings->value(SETTINGS_MAINWND_SPLITTER_STATE).toByteArray();
|
||||||
|
mUI.mVerticalSplitter->restoreState(state);
|
||||||
mShowNoErrorsMessage = settings->value(SETTINGS_SHOW_NO_ERRORS, true).toBool();
|
mShowNoErrorsMessage = settings->value(SETTINGS_SHOW_NO_ERRORS, true).toBool();
|
||||||
|
|
||||||
mUI.mTree->Initialize(settings, list);
|
mUI.mTree->Initialize(settings, list);
|
||||||
|
@ -210,9 +213,12 @@ bool ResultsView::HasResults() const
|
||||||
return mUI.mTree->HasResults();
|
return mUI.mTree->HasResults();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResultsView::SaveSettings()
|
void ResultsView::SaveSettings(QSettings *settings)
|
||||||
{
|
{
|
||||||
mUI.mTree->SaveSettings();
|
mUI.mTree->SaveSettings();
|
||||||
|
QByteArray state = mUI.mVerticalSplitter->saveState();
|
||||||
|
settings->setValue(SETTINGS_MAINWND_SPLITTER_STATE, state);
|
||||||
|
mUI.mVerticalSplitter->restoreState(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResultsView::Translate()
|
void ResultsView::Translate()
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
class ErrorItem;
|
class ErrorItem;
|
||||||
class QModelIndex;
|
class QModelIndex;
|
||||||
|
class QSettings;
|
||||||
|
|
||||||
/// @addtogroup GUI
|
/// @addtogroup GUI
|
||||||
/// @{
|
/// @{
|
||||||
|
@ -121,8 +122,9 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief Save View's settings
|
* @brief Save View's settings
|
||||||
*
|
*
|
||||||
|
* @param settings program settings.
|
||||||
*/
|
*/
|
||||||
void SaveSettings();
|
void SaveSettings(QSettings *settings);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Translate this view
|
* @brief Translate this view
|
||||||
|
|
Loading…
Reference in New Issue