From 575780ec0d32a3dda6f08b201eb5d6fdf128ee46 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Thu, 18 Sep 2014 17:13:53 +1000 Subject: [PATCH] Display format settings working. --- apps/opencs/view/settings/settingsdialog.cpp | 17 +++ files/ui/settingstab.ui | 133 ++++++++++++------- 2 files changed, 100 insertions(+), 50 deletions(-) diff --git a/apps/opencs/view/settings/settingsdialog.cpp b/apps/opencs/view/settings/settingsdialog.cpp index 886ba6da6..8cd811e11 100644 --- a/apps/opencs/view/settings/settingsdialog.cpp +++ b/apps/opencs/view/settings/settingsdialog.cpp @@ -309,6 +309,17 @@ void CSVSettings::SettingsDialog::setViewValues() // status bar cbStatusBar->setChecked(mModel->settingValue("Display/show statusbar") == "true"); + + // display format + QString recStat = mModel->settingValue("Display Format/Record Status Display"); + index = cmbRecStatus->findData(recStat, Qt::DisplayRole); + if(index != -1) + cmbRecStatus->setCurrentIndex(index); + + QString refIdType = mModel->settingValue("Display Format/Referenceable ID Type Display"); + index = cmbRefIdType->findData(refIdType, Qt::DisplayRole); + if(index != -1) + cmbRefIdType->setCurrentIndex(index); } void CSVSettings::SettingsDialog::saveSettings() @@ -381,6 +392,12 @@ void CSVSettings::SettingsDialog::saveSettings() else mModel->setDefinitions("Display/show statusbar", QStringList("false")); + // display format + mModel->setDefinitions("Display Format/Record Status Display", + QStringList(cmbRecStatus->currentText())); + mModel->setDefinitions("Display Format/Referenceable ID Type Display", + QStringList(cmbRefIdType->currentText())); + mModel->saveDefinitions(); } diff --git a/files/ui/settingstab.ui b/files/ui/settingstab.ui index 0b365634e..ab559d9e7 100644 --- a/files/ui/settingstab.ui +++ b/files/ui/settingstab.ui @@ -227,24 +227,88 @@ Display Settings - + 10 10 371 - 71 + 81 - + Display Format + + + + 10 + 20 + 351 + 48 + + + + + + + Record Status: + + + + + + + + Text Only + + + + + Icon Only + + + + + Icon and Text + + + + + + + + Referenceable ID Type: + + + + + + + + Text Only + + + + + Icon Only + + + + + Icon and Text + + + + + + - + 9 - 110 + 140 371 111 @@ -253,51 +317,11 @@ Subviews - - - - 21 - 20 - 351 - 45 - - - - - - - Display Format: - - - - - - - - Text Only - - - - - Text + Icon - - - - - - - - Show Status Bar - - - - - 21 - 130 + 160 351 71 @@ -349,10 +373,19 @@ - groupBox_2 - groupBox - layoutWidget - layoutWidget2 + + + + 20 + 110 + 102 + 17 + + + + Show Status Bar + +