File indexing completed on 2025-03-09 03:58:45
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2004-11-22 0007 * Description : digiKam light table - Configure 0008 * 0009 * SPDX-FileCopyrightText: 2007-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #include "lighttablewindow_p.h" 0016 0017 namespace Digikam 0018 { 0019 0020 void LightTableWindow::slotSetup() 0021 { 0022 Setup::execDialog(this); 0023 } 0024 0025 void LightTableWindow::slotColorManagementOptionsChanged() 0026 { 0027 ICCSettingsContainer settings = IccSettings::instance()->settings(); 0028 0029 d->viewCMViewAction->blockSignals(true); 0030 d->viewCMViewAction->setEnabled(settings.enableCM); 0031 d->viewCMViewAction->setChecked(settings.useManagedPreviews); 0032 d->viewCMViewAction->blockSignals(false); 0033 } 0034 0035 void LightTableWindow::slotThemeChanged() 0036 { 0037 d->previewView->checkForSelection(d->previewView->leftItemInfo()); 0038 d->previewView->checkForSelection(d->previewView->rightItemInfo()); 0039 } 0040 0041 void LightTableWindow::slotApplicationSettingsChanged() 0042 { 0043 d->leftSideBar->setStyle(ApplicationSettings::instance()->getSidebarTitleStyle()); 0044 d->rightSideBar->setStyle(ApplicationSettings::instance()->getSidebarTitleStyle()); 0045 0046 /// @todo Which part of the settings has to be reloaded? 0047 // d->rightSideBar->applySettings(); 0048 0049 d->previewView->setPreviewSettings(ApplicationSettings::instance()->getPreviewSettings()); 0050 } 0051 0052 void LightTableWindow::readSettings() 0053 { 0054 KSharedConfig::Ptr config = KSharedConfig::openConfig(); 0055 KConfigGroup group = config->group(configGroupName()); 0056 0057 d->hSplitter->restoreState(group, QLatin1String("Horizontal Splitter State")); 0058 d->barViewDock->setShouldBeVisible(group.readEntry(QLatin1String("Show Thumbbar"), true)); 0059 d->navigateByPairAction->setChecked(group.readEntry(QLatin1String("Navigate By Pair"), false)); 0060 slotToggleNavigateByPair(); 0061 0062 d->leftSideBar->setConfigGroup(KConfigGroup(&group, QLatin1String("Left Sidebar"))); 0063 d->leftSideBar->loadState(); 0064 d->rightSideBar->setConfigGroup(KConfigGroup(&group, QLatin1String("Right Sidebar"))); 0065 d->rightSideBar->loadState(); 0066 0067 readFullScreenSettings(group); 0068 } 0069 0070 void LightTableWindow::writeSettings() 0071 { 0072 KSharedConfig::Ptr config = KSharedConfig::openConfig(); 0073 KConfigGroup group = config->group(configGroupName()); 0074 d->hSplitter->saveState(group, QLatin1String("Horizontal Splitter State")); 0075 group.writeEntry(QLatin1String("Show Thumbbar"), d->barViewDock->shouldBeVisible()); 0076 group.writeEntry(QLatin1String("Navigate By Pair"), d->navigateByPairAction->isChecked()); 0077 group.writeEntry(QLatin1String("Clear On Close"), d->clearOnCloseAction->isChecked()); 0078 0079 d->leftSideBar->setConfigGroup(KConfigGroup(&group, QLatin1String("Left Sidebar"))); 0080 d->leftSideBar->saveState(); 0081 d->rightSideBar->setConfigGroup(KConfigGroup(&group, QLatin1String("Right Sidebar"))); 0082 d->rightSideBar->saveState(); 0083 0084 config->sync(); 0085 } 0086 0087 void LightTableWindow::applySettings() 0088 { 0089 KSharedConfig::Ptr config = KSharedConfig::openConfig(); 0090 KConfigGroup group = config->group(configGroupName()); 0091 d->autoLoadOnRightPanel = group.readEntry(QLatin1String("Auto Load Right Panel"), true); 0092 d->autoSyncPreview = group.readEntry(QLatin1String("Auto Sync Preview"), true); 0093 d->clearOnCloseAction->setChecked(group.readEntry(QLatin1String("Clear On Close"), false)); 0094 slotApplicationSettingsChanged(); 0095 0096 // Restore full screen Mode 0097 0098 readFullScreenSettings(group); 0099 0100 // NOTE: Image orientation settings in thumbbar is managed by image model. 0101 0102 refreshView(); 0103 } 0104 0105 } // namespace Digikam