Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/plugins/folder/viewpropertiesmenu.cpp
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | 28 | { | |||
---|---|---|---|---|---|
89 | }; | 89 | }; | ||
90 | for (int i = 0; i < iconSizes.count(); ++i) { | 90 | for (int i = 0; i < iconSizes.count(); ++i) { | ||
91 | action = m_iconSizeMenu->addAction(iconSizes.at(i)); | 91 | action = m_iconSizeMenu->addAction(iconSizes.at(i)); | ||
92 | action->setCheckable(true); | 92 | action->setCheckable(true); | ||
93 | action->setData(i); | 93 | action->setData(i); | ||
94 | m_iconSize->addAction(action); | 94 | m_iconSize->addAction(action); | ||
95 | } | 95 | } | ||
96 | 96 | | |||
97 | m_previews = m_menu->addAction(QIcon::fromTheme(QStringLiteral("view-preview")), i18n("Show Previews"), this, &ViewPropertiesMenu::previewsChanged); | ||||
ngraham: How about "Show Previews"? Should generally start with an action verb. | |||||
98 | m_previews->setCheckable(true); | ||||
99 | | ||||
97 | m_locked = m_menu->addAction(i18n("Locked"), this, SIGNAL(lockedChanged())); | 100 | m_locked = m_menu->addAction(i18n("Locked"), this, SIGNAL(lockedChanged())); | ||
98 | m_locked->setCheckable(true); | 101 | m_locked->setCheckable(true); | ||
99 | } | 102 | } | ||
100 | 103 | | |||
101 | ViewPropertiesMenu::~ViewPropertiesMenu() | 104 | ViewPropertiesMenu::~ViewPropertiesMenu() | ||
102 | { | 105 | { | ||
103 | delete m_menu; | 106 | delete m_menu; | ||
104 | } | 107 | } | ||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | 183 | foreach (QAction *action, m_alignment->actions()) { | |||
181 | if (action->data().toInt() == alignment) { | 184 | if (action->data().toInt() == alignment) { | ||
182 | action->setChecked(true); | 185 | action->setChecked(true); | ||
183 | break; | 186 | break; | ||
184 | } | 187 | } | ||
185 | } | 188 | } | ||
186 | } | 189 | } | ||
187 | } | 190 | } | ||
188 | 191 | | |||
192 | bool ViewPropertiesMenu::previews() const | ||||
193 | { | ||||
194 | return m_previews->isChecked(); | ||||
195 | } | ||||
196 | | ||||
197 | void ViewPropertiesMenu::setPreviews(bool previews) | ||||
198 | { | ||||
199 | if (m_previews->isChecked() != previews) { | ||||
200 | m_previews->setChecked(previews); | ||||
201 | } | ||||
202 | } | ||||
203 | | ||||
189 | bool ViewPropertiesMenu::locked() const | 204 | bool ViewPropertiesMenu::locked() const | ||
190 | { | 205 | { | ||
191 | return m_locked->isChecked(); | 206 | return m_locked->isChecked(); | ||
192 | } | 207 | } | ||
193 | 208 | | |||
194 | void ViewPropertiesMenu::setLocked(bool locked) | 209 | void ViewPropertiesMenu::setLocked(bool locked) | ||
195 | { | 210 | { | ||
196 | if (m_locked->isChecked() != locked) { | 211 | if (m_locked->isChecked() != locked) { | ||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |
How about "Show Previews"? Should generally start with an action verb.