Commit 37ab6e6d authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/3.1'

Conflicts:
	src/shared/qbs

Change-Id: Ie56c48d3bcd42e1a15832c5e7a10fe69c5410d90
parents 954c61ff 0f05aa42
...@@ -983,7 +983,9 @@ class DumperBase: ...@@ -983,7 +983,9 @@ class DumperBase:
data, size, alloc = self.byteArrayDataHelper(objectName) data, size, alloc = self.byteArrayDataHelper(objectName)
if size == 0: # Object names are short, and GDB can crash on to big chunks.
# Since this here is a convenience feature only, limit it.
if size <= 0 or size > 80:
return False return False
raw = self.readMemory(data, 2 * size) raw = self.readMemory(data, 2 * size)
......
...@@ -289,6 +289,7 @@ void OutputPaneManager::init() ...@@ -289,6 +289,7 @@ void OutputPaneManager::init()
bool visible = outPane->priorityInStatusBar() != -1; bool visible = outPane->priorityInStatusBar() != -1;
button->setVisible(visible); button->setVisible(visible);
m_buttonVisibility.insert(id, visible);
connect(action, SIGNAL(triggered()), this, SLOT(shortcutTriggered())); connect(action, SIGNAL(triggered()), this, SLOT(shortcutTriggered()));
} }
...@@ -363,19 +364,18 @@ void OutputPaneManager::buttonTriggered(int idx) ...@@ -363,19 +364,18 @@ void OutputPaneManager::buttonTriggered(int idx)
void OutputPaneManager::readSettings() void OutputPaneManager::readSettings()
{ {
QMap<QString, bool> visibility;
QSettings *settings = ICore::settings(); QSettings *settings = ICore::settings();
int num = settings->beginReadArray(QLatin1String(outputPaneSettingsKeyC)); int num = settings->beginReadArray(QLatin1String(outputPaneSettingsKeyC));
for (int i = 0; i < num; ++i) { for (int i = 0; i < num; ++i) {
settings->setArrayIndex(i); settings->setArrayIndex(i);
visibility.insert(settings->value(QLatin1String(outputPaneIdKeyC)).toString(), m_buttonVisibility.insert(Id::fromSetting(settings->value(QLatin1String(outputPaneIdKeyC))),
settings->value(QLatin1String(outputPaneVisibleKeyC)).toBool()); settings->value(QLatin1String(outputPaneVisibleKeyC)).toBool());
} }
settings->endArray(); settings->endArray();
for (int i = 0; i < m_ids.size(); ++i) { for (int i = 0; i < m_ids.size(); ++i) {
if (visibility.contains(m_ids.at(i).toString())) if (m_buttonVisibility.contains(m_ids.at(i)))
m_buttons.at(i)->setVisible(visibility.value(m_ids.at(i).toString())); m_buttons.at(i)->setVisible(m_buttonVisibility.value(m_ids.at(i)));
} }
m_outputPaneHeight = settings->value(QLatin1String("OutputPanePlaceHolder/Height"), 0).toInt(); m_outputPaneHeight = settings->value(QLatin1String("OutputPanePlaceHolder/Height"), 0).toInt();
...@@ -555,7 +555,7 @@ void OutputPaneManager::popupMenu() ...@@ -555,7 +555,7 @@ void OutputPaneManager::popupMenu()
foreach (IOutputPane *pane, m_panes) { foreach (IOutputPane *pane, m_panes) {
QAction *act = menu.addAction(pane->displayName()); QAction *act = menu.addAction(pane->displayName());
act->setCheckable(true); act->setCheckable(true);
act->setChecked(m_buttons.at(idx)->isVisible()); act->setChecked(m_buttonVisibility.value(m_ids.at(idx)));
act->setData(idx); act->setData(idx);
++idx; ++idx;
} }
...@@ -563,14 +563,17 @@ void OutputPaneManager::popupMenu() ...@@ -563,14 +563,17 @@ void OutputPaneManager::popupMenu()
if (!result) if (!result)
return; return;
idx = result->data().toInt(); idx = result->data().toInt();
Id id = m_ids.at(idx);
QTC_ASSERT(idx >= 0 && idx < m_buttons.size(), return); QTC_ASSERT(idx >= 0 && idx < m_buttons.size(), return);
QToolButton *button = m_buttons.at(idx); QToolButton *button = m_buttons.at(idx);
if (button->isVisible()) { if (m_buttonVisibility.value(id)) {
m_panes.value(idx)->visibilityChanged(false); m_panes.value(idx)->visibilityChanged(false);
button->setChecked(false); button->setChecked(false);
button->hide(); button->hide();
m_buttonVisibility.insert(id, false);
} else { } else {
button->show(); button->show();
m_buttonVisibility.insert(id, true);
showPage(idx, IOutputPane::ModeSwitch); showPage(idx, IOutputPane::ModeSwitch);
} }
} }
...@@ -582,8 +585,9 @@ void OutputPaneManager::saveSettings() const ...@@ -582,8 +585,9 @@ void OutputPaneManager::saveSettings() const
m_ids.size()); m_ids.size());
for (int i = 0; i < m_ids.size(); ++i) { for (int i = 0; i < m_ids.size(); ++i) {
settings->setArrayIndex(i); settings->setArrayIndex(i);
settings->setValue(QLatin1String(outputPaneIdKeyC), m_ids.at(i).toString()); settings->setValue(QLatin1String(outputPaneIdKeyC), m_ids.at(i).toSetting());
settings->setValue(QLatin1String(outputPaneVisibleKeyC), m_buttons.at(i)->isVisible()); settings->setValue(QLatin1String(outputPaneVisibleKeyC),
m_buttonVisibility.value(m_ids.at(i)));
} }
settings->endArray(); settings->endArray();
settings->setValue(QLatin1String("OutputPanePlaceHolder/Height"), m_outputPaneHeight); settings->setValue(QLatin1String("OutputPanePlaceHolder/Height"), m_outputPaneHeight);
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <coreplugin/id.h> #include <coreplugin/id.h>
#include <QMap>
#include <QToolButton> #include <QToolButton>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
...@@ -126,6 +127,7 @@ private: ...@@ -126,6 +127,7 @@ private:
QVector<OutputPaneToggleButton *> m_buttons; QVector<OutputPaneToggleButton *> m_buttons;
QVector<QAction *> m_actions; QVector<QAction *> m_actions;
QVector<Id> m_ids; QVector<Id> m_ids;
QMap<Id, bool> m_buttonVisibility;
QStackedWidget *m_outputWidgetPane; QStackedWidget *m_outputWidgetPane;
QStackedWidget *m_opToolBarWidgets; QStackedWidget *m_opToolBarWidgets;
......
...@@ -145,6 +145,8 @@ RightPaneWidget *RightPaneWidget::instance() ...@@ -145,6 +145,8 @@ RightPaneWidget *RightPaneWidget::instance()
void RightPaneWidget::setWidget(QWidget *widget) void RightPaneWidget::setWidget(QWidget *widget)
{ {
if (widget == m_widget)
return;
clearWidget(); clearWidget();
m_widget = widget; m_widget = widget;
if (m_widget) { if (m_widget) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment