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 | { | 171 | { | ||
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 | if (m_inConfigurationMode) { | 186 | if (m_inConfigurationMode) { | ||
182 | configureAction->setEnabled(false); | 187 | configureAction->setEnabled(false); | ||
183 | } | 188 | } | ||
184 | 189 | | |||
185 | QAction* dateformatAction = popup.addAction(i18nc("@action:inmenu", "Condensed Date")); | 190 | QAction* dateformatAction = popup.addAction(i18nc("@action:inmenu", "Condensed Date")); | ||
186 | dateformatAction->setIcon(QIcon::fromTheme(QStringLiteral("change-date-symbolic"))); | 191 | dateformatAction->setIcon(QIcon::fromTheme(QStringLiteral("change-date-symbolic"))); | ||
Show All 16 Lines | |||||
203 | const bool isChecked = action->isChecked(); | 208 | const bool isChecked = action->isChecked(); | ||
204 | if (action == previewAction) { | 209 | if (action == previewAction) { | ||
205 | InformationPanelSettings::setPreviewsShown(isChecked); | 210 | InformationPanelSettings::setPreviewsShown(isChecked); | ||
206 | m_content->refreshPreview(); | 211 | m_content->refreshPreview(); | ||
207 | } else if (action == configureAction) { | 212 | } else if (action == configureAction) { | ||
208 | m_inConfigurationMode = true; | 213 | m_inConfigurationMode = true; | ||
209 | m_content->configureShownProperties(); | 214 | m_content->configureShownProperties(); | ||
210 | } | 215 | } | ||
211 | if (action == dateformatAction) { | 216 | if (action == dateformatAction) { | ||
212 | int dateFormat = static_cast<int>(isChecked ? Baloo::DateFormats::ShortFormat : Baloo::DateFormats::LongFormat); | 217 | int dateFormat = static_cast<int>(isChecked ? Baloo::DateFormats::ShortFormat : Baloo::DateFormats::LongFormat); | ||
213 | 218 | | |||
214 | InformationPanelSettings::setDateFormat(dateFormat); | 219 | InformationPanelSettings::setDateFormat(dateFormat); | ||
215 | m_content->refreshMetaData(); | 220 | m_content->refreshMetaData(); | ||
221 | } else if (action == previewAutoPlayAction) { | ||||
222 | InformationPanelSettings::setPreviewsAutoPlay(isChecked); | ||||
223 | m_content->setPreviewAutoPlay(isChecked); | ||||
216 | } | 224 | } | ||
217 | } | 225 | } | ||
elvisangelaccio: Please move the `else`s at the end of the previous lines. | |||||
218 | 226 | | |||
219 | void InformationPanel::showItemInfo() | 227 | void InformationPanel::showItemInfo() | ||
220 | { | 228 | { | ||
221 | if (!isVisible()) { | 229 | if (!isVisible()) { | ||
222 | return; | 230 | return; | ||
223 | } | 231 | } | ||
224 | 232 | | |||
225 | cancelRequest(); | 233 | cancelRequest(); | ||
▲ Show 20 Lines • Show All 195 Lines • Show Last 20 Lines |
Typo.
Also, I would re-word to say "Auto-play"