diff options
author | hjk <qtc-committer@nokia.com> | 2011-03-16 18:48:14 +0100 |
---|---|---|
committer | hjk <qtc-committer@nokia.com> | 2011-03-16 18:49:01 +0100 |
commit | 82b7e9befd0eb6ef32acc1d87b7319c72e1f4bad (patch) | |
tree | 4c7d0255a831ab26a527b9b74b95c796f509e90f /src/plugins/debugger/snapshotwindow.cpp | |
parent | 429ed63f5d4ebcb338a925318fc154e1e9b1fe00 (diff) | |
download | qt-creator-82b7e9befd0eb6ef32acc1d87b7319c72e1f4bad.tar.gz |
debugger: persist 'AlwaysAdjust*ColumnWidths' settings
Task-number: QTCREATORBUG-2836
Diffstat (limited to 'src/plugins/debugger/snapshotwindow.cpp')
-rw-r--r-- | src/plugins/debugger/snapshotwindow.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/plugins/debugger/snapshotwindow.cpp b/src/plugins/debugger/snapshotwindow.cpp index 086dc25863..3bad2cb111 100644 --- a/src/plugins/debugger/snapshotwindow.cpp +++ b/src/plugins/debugger/snapshotwindow.cpp @@ -58,7 +58,6 @@ namespace Internal { /////////////////////////////////////////////////////////////////////// SnapshotWindow::SnapshotWindow(SnapshotHandler *handler) - : m_alwaysResizeColumnsToContents(false) { m_snapshotHandler = handler; @@ -76,6 +75,9 @@ SnapshotWindow::SnapshotWindow(SnapshotHandler *handler) SLOT(rowActivated(QModelIndex))); connect(act, SIGNAL(toggled(bool)), SLOT(setAlternatingRowColorsHelper(bool))); + connect(debuggerCore()->action(AlwaysAdjustSnapshotsColumnWidths), + SIGNAL(toggled(bool)), + SLOT(setAlwaysResizeColumnsToContents(bool))); } void SnapshotWindow::rowActivated(const QModelIndex &index) @@ -107,21 +109,14 @@ void SnapshotWindow::contextMenuEvent(QContextMenuEvent *ev) QAction *actCreate = menu.addAction(tr("Create Snapshot")); actCreate->setEnabled(idx.data(SnapshotCapabilityRole).toBool()); - menu.addSeparator(); QAction *actRemove = menu.addAction(tr("Remove Snapshot")); actRemove->setEnabled(idx.isValid()); - menu.addSeparator(); QAction *actAdjust = menu.addAction(tr("Adjust Column Widths to Contents")); - - QAction *actAlwaysAdjust = - menu.addAction(tr("Always Adjust Column Widths to Contents")); - actAlwaysAdjust->setCheckable(true); - actAlwaysAdjust->setChecked(m_alwaysResizeColumnsToContents); - + menu.addAction(debuggerCore()->action(AlwaysAdjustSnapshotsColumnWidths)); menu.addSeparator(); menu.addAction(debuggerCore()->action(SettingsDialog)); @@ -134,8 +129,6 @@ void SnapshotWindow::contextMenuEvent(QContextMenuEvent *ev) removeSnapshot(idx.row()); else if (act == actAdjust) resizeColumnsToContents(); - else if (act == actAlwaysAdjust) - setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents); } void SnapshotWindow::removeSnapshot(int i) @@ -151,7 +144,6 @@ void SnapshotWindow::resizeColumnsToContents() void SnapshotWindow::setAlwaysResizeColumnsToContents(bool on) { - m_alwaysResizeColumnsToContents = on; QHeaderView::ResizeMode mode = on ? QHeaderView::ResizeToContents : QHeaderView::Interactive; for (int i = model()->columnCount(); --i >= 0; ) |