aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Helio Chissini de Castro <helio@kde.org>2013-06-09 20:09:39 -0300
committerGravatar Helio Chissini de Castro <helio@kde.org>2013-06-09 20:09:39 -0300
commit4b0c053e48abc7a4e0a624d2b868e6f29e376610 (patch)
tree0bf8f0f9ddbde3f2db214b547077e7ab4fbffa1f /qt-ui
parentbdee5ea9a6b523a088a89567bb6cd9f4fa2b0935 (diff)
downloadsubsurface-4b0c053e48abc7a4e0a624d2b868e6f29e376610.tar.gz
Ticket 127 - Repopulate context menu on preferences change
Ticket 127 mention that context menu is fixed on imperial mode, which is partial true. Context menu only not have the changes on header model updated when preferences are chenges during execution. Hard to note because if program is closed and opened again, the context is initialized properly. Since actions aren't bound to the header model, we need iteract of current items and change the title. Signed-off-by: Helio Chissini de Castro <helio@kde.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/divelistview.cpp6
-rw-r--r--qt-ui/mainwindow.cpp1
2 files changed, 7 insertions, 0 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp
index 297fbf321..fd189e926 100644
--- a/qt-ui/divelistview.cpp
+++ b/qt-ui/divelistview.cpp
@@ -186,6 +186,12 @@ void DiveListView::reloadHeaderActions()
setColumnHidden(i, !shown);
}
s.endGroup();
+ } else {
+ // Skip first QAction item ( static text Visible )
+ for(int i = 0; i < model()->columnCount(); i++) {
+ QString title = QString("%1").arg(model()->headerData(i, Qt::Horizontal).toString());
+ header()->actions()[i+1]->setText( title );
+ }
}
}
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 286aba43e..9496f6160 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -44,6 +44,7 @@ MainWindow::MainWindow() : ui(new Ui::MainWindow()), helpView(0)
connect(ui->ListWidget, SIGNAL(currentDiveChanged(int)), this, SLOT(current_dive_changed(int)));
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(readSettings()));
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui->ListWidget, SLOT(update()));
+ connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui->ListWidget, SLOT(reloadHeaderActions()));
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui->ProfileWidget, SLOT(refresh()));
ui->mainErrorMessage->hide();
ui->ProfileWidget->setFocusProxy(ui->ListWidget);