┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/information/informationpanelcontent.cpp
diff options
context:
space:
mode:
authorMéven Car <[email protected]>2019-03-17 19:38:31 +0100
committerMéven Car <[email protected]>2019-03-17 19:38:31 +0100
commitbc1a99bd11f4e1c054e55c8fde957ce0de89f989 (patch)
tree36120ef9aca194bbd87a058128c5bbb1e1d4a288 /src/panels/information/informationpanelcontent.cpp
parentbbfa6c4473b8278ce7636ca18dd3ad417f4c4cdb (diff)
parent1ff74854ecb4e5c9a2099759b71c378225c9e988 (diff)
Merge remote-tracking branch 'origin/Applications/19.04'
Diffstat (limited to 'src/panels/information/informationpanelcontent.cpp')
-rw-r--r--src/panels/information/informationpanelcontent.cpp60
1 files changed, 8 insertions, 52 deletions
diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp
index bf87f9b5a..7704bdf16 100644
--- a/src/panels/information/informationpanelcontent.cpp
+++ b/src/panels/information/informationpanelcontent.cpp
@@ -29,7 +29,6 @@
#include <KStringHandler>
#include <QIcon>
-#include <QMenu>
#include <QTextDocument>
#include <Baloo/FileMetaDataWidget>
@@ -48,7 +47,6 @@
#include <QStyle>
#include "dolphin_informationpanelsettings.h"
-#include "filemetadataconfigurationdialog.h"
#include "phononwidget.h"
#include "pixmapviewer.h"
@@ -264,56 +262,6 @@ bool InformationPanelContent::eventFilter(QObject* obj, QEvent* event)
return QWidget::eventFilter(obj, event);
}
-void InformationPanelContent::configureSettings(const QList<QAction*>& customContextMenuActions, const QPointF& pos)
-{
- QMenu popup(this);
-
- QAction* previewAction = popup.addAction(i18nc("@action:inmenu", "Preview"));
- previewAction->setIcon(QIcon::fromTheme(QStringLiteral("view-preview")));
- previewAction->setCheckable(true);
- previewAction->setChecked(InformationPanelSettings::previewsShown());
-
- QAction* configureAction = popup.addAction(i18nc("@action:inmenu", "Configure..."));
- configureAction->setIcon(QIcon::fromTheme(QStringLiteral("configure")));
-
- QAction* dateformatAction = popup.addAction(i18nc("@action:inmenu", "Condensed Date"));
- dateformatAction->setIcon(QIcon::fromTheme(QStringLiteral("change-date-symbolic")));
- dateformatAction->setCheckable(true);
- dateformatAction->setChecked(InformationPanelSettings::dateFormat() == static_cast<int>(Baloo::DateFormats::ShortFormat));
-
- popup.addSeparator();
- foreach (QAction* action, customContextMenuActions) {
- popup.addAction(action);
- }
-
- // Open the popup and adjust the settings for the
- // selected action.
- QAction* action = popup.exec(pos.toPoint());
- if (!action) {
- return;
- }
-
- const bool isChecked = action->isChecked();
- if (action == previewAction) {
- m_preview->setVisible(isChecked);
- InformationPanelSettings::setPreviewsShown(isChecked);
- } else if (action == configureAction) {
- FileMetaDataConfigurationDialog* dialog = new FileMetaDataConfigurationDialog(this);
- dialog->setDescription(i18nc("@label::textbox",
- "Select which data should be shown in the information panel:"));
- dialog->setItems(m_metaDataWidget->items());
- dialog->setAttribute(Qt::WA_DeleteOnClose);
- dialog->show();
- connect(dialog, &FileMetaDataConfigurationDialog::destroyed, this, &InformationPanelContent::refreshMetaData);
- }
- if (action == dateformatAction) {
- int dateFormat = static_cast<int>(isChecked ? Baloo::DateFormats::ShortFormat : Baloo::DateFormats::LongFormat);
-
- InformationPanelSettings::setDateFormat(dateFormat);
- refreshMetaData();
- }
-}
-
void InformationPanelContent::showIcon(const KFileItem& item)
{
m_outdatedPreviewTimer->stop();
@@ -342,6 +290,14 @@ void InformationPanelContent::markOutdatedPreview()
m_preview->setPixmap(disabledPixmap);
}
+void InformationPanelContent::setPreviewVisible(bool visible) {
+ m_preview->setVisible(visible);
+}
+
+KFileItemList InformationPanelContent::items() {
+ return m_metaDataWidget->items();
+}
+
void InformationPanelContent::slotHasVideoChanged(bool hasVideo)
{
m_preview->setVisible(!hasVideo);