Remember progress details pinned state and default to "pinned".

Making the default "pinned" will hopefully make people realize earlier
that the progress information has moved to the new location.

Change-Id: I5dbb3cae3680f724369b1a025cf38c5317a29fd0
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Eike Ziller
2013-05-27 10:38:49 +02:00
parent a52063ee39
commit 8e50dc182c
2 changed files with 20 additions and 0 deletions

View File

@@ -51,6 +51,10 @@
#include <QStyle>
#include <QStyleOption>
#include <QTimer>
#include <QVariant>
static const char kSettingsGroup[] = "Progress";
static const char kDetailsPinned[] = "DetailsPinned";
using namespace Core;
using namespace Core::Internal;
@@ -283,8 +287,18 @@ ProgressManagerPrivate::~ProgressManagerPrivate()
cleanup();
}
void ProgressManagerPrivate::readSettings()
{
QSettings *settings = ICore::settings();
settings->beginGroup(QLatin1String(kSettingsGroup));
m_progressViewPinned = settings->value(QLatin1String(kDetailsPinned), true).toBool();
settings->endGroup();
}
void ProgressManagerPrivate::init()
{
readSettings();
m_statusBarWidgetContainer = new Core::StatusBarWidget;
m_statusBarWidget = new QWidget;
QHBoxLayout *layout = new QHBoxLayout(m_statusBarWidget);
@@ -658,6 +672,11 @@ void ProgressManagerPrivate::progressDetailsToggled(bool checked)
{
m_progressViewPinned = checked;
updateVisibility();
QSettings *settings = ICore::settings();
settings->beginGroup(QLatin1String(kSettingsGroup));
settings->setValue(QLatin1String(kDetailsPinned), m_progressViewPinned);
settings->endGroup();
}
ToggleButton::ToggleButton(QWidget *parent)