Changeset View
Changeset View
Standalone View
Standalone View
src/panels/information/informationpanel.cpp
Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Line(s) | |||||
171 | void InformationPanel::showContextMenu(const QPoint &pos) { | 171 | void InformationPanel::showContextMenu(const QPoint &pos) { | ||
172 | QMenu popup(this); | 172 | QMenu popup(this); | ||
173 | 173 | | |||
174 | QAction* previewAction = popup.addAction(i18nc("@action:inmenu", "Preview")); | 174 | QAction* previewAction = popup.addAction(i18nc("@action:inmenu", "Preview")); | ||
175 | previewAction->setIcon(QIcon::fromTheme(QStringLiteral("view-preview"))); | 175 | previewAction->setIcon(QIcon::fromTheme(QStringLiteral("view-preview"))); | ||
176 | previewAction->setCheckable(true); | 176 | previewAction->setCheckable(true); | ||
177 | previewAction->setChecked(InformationPanelSettings::previewsShown()); | 177 | previewAction->setChecked(InformationPanelSettings::previewsShown()); | ||
178 | 178 | | |||
179 | QAction* previewAutoPlayAction = popup.addAction(i18nc("@action:inmenu", "Auto-Play media files")); | ||||
ngraham: Typo.
Also, I would re-word to say "Auto-play" | |||||
180 | previewAutoPlayAction->setIcon(QIcon::fromTheme(QStringLiteral("media-playback-start"))); | ||||
181 | previewAutoPlayAction->setCheckable(true); | ||||
182 | previewAutoPlayAction->setChecked(InformationPanelSettings::previewsAutoPlay()); | ||||
183 | | ||||
179 | QAction* configureAction = popup.addAction(i18nc("@action:inmenu", "Configure...")); | 184 | QAction* configureAction = popup.addAction(i18nc("@action:inmenu", "Configure...")); | ||
180 | configureAction->setIcon(QIcon::fromTheme(QStringLiteral("configure"))); | 185 | configureAction->setIcon(QIcon::fromTheme(QStringLiteral("configure"))); | ||
181 | 186 | | |||
182 | QAction* dateformatAction = popup.addAction(i18nc("@action:inmenu", "Condensed Date")); | 187 | QAction* dateformatAction = popup.addAction(i18nc("@action:inmenu", "Condensed Date")); | ||
183 | dateformatAction->setIcon(QIcon::fromTheme(QStringLiteral("change-date-symbolic"))); | 188 | dateformatAction->setIcon(QIcon::fromTheme(QStringLiteral("change-date-symbolic"))); | ||
184 | dateformatAction->setCheckable(true); | 189 | dateformatAction->setCheckable(true); | ||
185 | dateformatAction->setChecked(InformationPanelSettings::dateFormat() == static_cast<int>(Baloo::DateFormats::ShortFormat)); | 190 | dateformatAction->setChecked(InformationPanelSettings::dateFormat() == static_cast<int>(Baloo::DateFormats::ShortFormat)); | ||
186 | 191 | | |||
Show All 17 Lines | |||||
204 | } else if (action == configureAction) { | 209 | } else if (action == configureAction) { | ||
205 | FileMetaDataConfigurationDialog* dialog = new FileMetaDataConfigurationDialog(this); | 210 | FileMetaDataConfigurationDialog* dialog = new FileMetaDataConfigurationDialog(this); | ||
206 | dialog->setDescription(i18nc("@label::textbox", | 211 | dialog->setDescription(i18nc("@label::textbox", | ||
207 | "Select which data should be shown in the information panel:")); | 212 | "Select which data should be shown in the information panel:")); | ||
208 | dialog->setItems(m_content->items()); | 213 | dialog->setItems(m_content->items()); | ||
209 | dialog->setAttribute(Qt::WA_DeleteOnClose); | 214 | dialog->setAttribute(Qt::WA_DeleteOnClose); | ||
210 | dialog->show(); | 215 | dialog->show(); | ||
211 | connect(dialog, &FileMetaDataConfigurationDialog::destroyed, m_content, &InformationPanelContent::refreshMetaData); | 216 | connect(dialog, &FileMetaDataConfigurationDialog::destroyed, m_content, &InformationPanelContent::refreshMetaData); | ||
212 | } | 217 | } else if (action == dateformatAction) { | ||
213 | if (action == dateformatAction) { | | |||
214 | int dateFormat = static_cast<int>(isChecked ? Baloo::DateFormats::ShortFormat : Baloo::DateFormats::LongFormat); | 218 | int dateFormat = static_cast<int>(isChecked ? Baloo::DateFormats::ShortFormat : Baloo::DateFormats::LongFormat); | ||
215 | 219 | | |||
216 | InformationPanelSettings::setDateFormat(dateFormat); | 220 | InformationPanelSettings::setDateFormat(dateFormat); | ||
217 | m_content->refreshMetaData(); | 221 | m_content->refreshMetaData(); | ||
222 | } else if (action == previewAutoPlayAction) { | ||||
223 | InformationPanelSettings::setPreviewsAutoPlay(isChecked); | ||||
224 | m_content->setPreviewAutoPlay(isChecked); | ||||
218 | } | 225 | } | ||
219 | } | 226 | } | ||
elvisangelaccio: Please move the `else`s at the end of the previous lines. | |||||
220 | 227 | | |||
221 | void InformationPanel::showItemInfo() | 228 | void InformationPanel::showItemInfo() | ||
222 | { | 229 | { | ||
223 | if (!isVisible()) { | 230 | if (!isVisible()) { | ||
224 | return; | 231 | return; | ||
225 | } | 232 | } | ||
226 | 233 | | |||
227 | cancelRequest(); | 234 | cancelRequest(); | ||
▲ Show 20 Lines • Show All 194 Lines • Show Last 20 Lines |
Typo.
Also, I would re-word to say "Auto-play"