mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-07 20:44:35 +00:00
Fixed the hide / show columns using the settings.
This also changed a bit the behavior on how the QSettings are managed, till now, we used the QSettings constructor passing the name of the software and the 'company', but this is now default - so there's no need to pass anything by the QSettings contructor. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
parent
37ada91000
commit
3fdea49e70
3 changed files with 12 additions and 3 deletions
|
@ -61,6 +61,9 @@ const char *existing_filename;
|
||||||
void init_qt_ui(int *argcp, char ***argvp)
|
void init_qt_ui(int *argcp, char ***argvp)
|
||||||
{
|
{
|
||||||
application->installTranslator(new Translator(application));
|
application->installTranslator(new Translator(application));
|
||||||
|
QCoreApplication::setOrganizationName("hohndel");
|
||||||
|
QCoreApplication::setOrganizationDomain("hohndel.org");
|
||||||
|
QCoreApplication::setApplicationName("Subsurface");
|
||||||
MainWindow *window = new MainWindow();
|
MainWindow *window = new MainWindow();
|
||||||
window->show();
|
window->show();
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,8 +55,13 @@ void DiveListView::reload()
|
||||||
a->setProperty("index", i);
|
a->setProperty("index", i);
|
||||||
connect(a, SIGNAL(triggered(bool)), this, SLOT(hideColumnByIndex()));
|
connect(a, SIGNAL(triggered(bool)), this, SLOT(hideColumnByIndex()));
|
||||||
header()->addAction(a);
|
header()->addAction(a);
|
||||||
|
if (a->isChecked())
|
||||||
|
showColumn(true);
|
||||||
|
else
|
||||||
|
hideColumn(false);
|
||||||
}
|
}
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
s.sync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,6 +75,7 @@ void DiveListView::hideColumnByIndex()
|
||||||
s.beginGroup("DiveListColumnState");
|
s.beginGroup("DiveListColumnState");
|
||||||
s.setValue(action->text(), action->isChecked());
|
s.setValue(action->text(), action->isChecked());
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
s.sync();
|
||||||
|
|
||||||
if (action->isChecked())
|
if (action->isChecked())
|
||||||
showColumn(action->property("index").toInt());
|
showColumn(action->property("index").toInt());
|
||||||
|
|
|
@ -323,7 +323,7 @@ void MainWindow::readSettings()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
QVariant v;
|
QVariant v;
|
||||||
QSettings settings("hohndel.org","subsurface");
|
QSettings settings;
|
||||||
|
|
||||||
settings.beginGroup("MainWindow");
|
settings.beginGroup("MainWindow");
|
||||||
QSize sz = settings.value("size").value<QSize>();
|
QSize sz = settings.value("size").value<QSize>();
|
||||||
|
@ -416,7 +416,7 @@ void MainWindow::readSettings()
|
||||||
void MainWindow::writeSettings()
|
void MainWindow::writeSettings()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
QSettings settings("hohndel.org","subsurface");
|
QSettings settings;
|
||||||
|
|
||||||
settings.beginGroup("MainWindow");
|
settings.beginGroup("MainWindow");
|
||||||
settings.setValue("size",size());
|
settings.setValue("size",size());
|
||||||
|
|
Loading…
Add table
Reference in a new issue