Changeset View
Changeset View
Standalone View
Standalone View
src/panels/information/informationpanel.cpp
Show All 30 Lines | |||||
31 | 31 | | |||
32 | #include <QApplication> | 32 | #include <QApplication> | ||
33 | #include <QShowEvent> | 33 | #include <QShowEvent> | ||
34 | #include <QVBoxLayout> | 34 | #include <QVBoxLayout> | ||
35 | #include <QTimer> | 35 | #include <QTimer> | ||
36 | #include <QMenu> | 36 | #include <QMenu> | ||
37 | 37 | | |||
38 | #include "dolphin_informationpanelsettings.h" | 38 | #include "dolphin_informationpanelsettings.h" | ||
39 | #include "filemetadataconfigurationdialog.h" | | |||
40 | 39 | | |||
41 | InformationPanel::InformationPanel(QWidget* parent) : | 40 | InformationPanel::InformationPanel(QWidget* parent) : | ||
42 | Panel(parent), | 41 | Panel(parent), | ||
43 | m_initialized(false), | 42 | m_initialized(false), | ||
44 | m_infoTimer(nullptr), | 43 | m_infoTimer(nullptr), | ||
45 | m_urlChangedTimer(nullptr), | 44 | m_urlChangedTimer(nullptr), | ||
46 | m_resetUrlTimer(nullptr), | 45 | m_resetUrlTimer(nullptr), | ||
47 | m_shownUrl(), | 46 | m_shownUrl(), | ||
▲ Show 20 Lines • Show All 149 Lines • ▼ Show 20 Line(s) | 195 | if (!action) { | |||
197 | return; | 196 | return; | ||
198 | } | 197 | } | ||
199 | 198 | | |||
200 | const bool isChecked = action->isChecked(); | 199 | const bool isChecked = action->isChecked(); | ||
201 | if (action == previewAction) { | 200 | if (action == previewAction) { | ||
202 | InformationPanelSettings::setPreviewsShown(isChecked); | 201 | InformationPanelSettings::setPreviewsShown(isChecked); | ||
203 | m_content->refreshPreview(); | 202 | m_content->refreshPreview(); | ||
204 | } else if (action == configureAction) { | 203 | } else if (action == configureAction) { | ||
205 | FileMetaDataConfigurationDialog* dialog = new FileMetaDataConfigurationDialog(this); | 204 | m_content->configureShownProperties(); | ||
206 | dialog->setDescription(i18nc("@label::textbox", | | |||
207 | "Select which data should be shown in the information panel:")); | | |||
208 | dialog->setItems(m_content->items()); | | |||
209 | dialog->setAttribute(Qt::WA_DeleteOnClose); | | |||
210 | dialog->show(); | | |||
211 | connect(dialog, &FileMetaDataConfigurationDialog::destroyed, m_content, &InformationPanelContent::refreshMetaData); | | |||
212 | } | 205 | } | ||
213 | if (action == dateformatAction) { | 206 | if (action == dateformatAction) { | ||
214 | int dateFormat = static_cast<int>(isChecked ? Baloo::DateFormats::ShortFormat : Baloo::DateFormats::LongFormat); | 207 | int dateFormat = static_cast<int>(isChecked ? Baloo::DateFormats::ShortFormat : Baloo::DateFormats::LongFormat); | ||
215 | 208 | | |||
216 | InformationPanelSettings::setDateFormat(dateFormat); | 209 | InformationPanelSettings::setDateFormat(dateFormat); | ||
217 | m_content->refreshMetaData(); | 210 | m_content->refreshMetaData(); | ||
218 | } | 211 | } | ||
219 | } | 212 | } | ||
▲ Show 20 Lines • Show All 202 Lines • Show Last 20 Lines |