Changeset View
Changeset View
Standalone View
Standalone View
src/kdeui/kaction.cpp
Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Line(s) | |||||
94 | { | 94 | { | ||
95 | d->init(this); | 95 | d->init(this); | ||
96 | setIcon(icon); | 96 | setIcon(icon); | ||
97 | setText(text); | 97 | setText(text); | ||
98 | } | 98 | } | ||
99 | 99 | | |||
100 | KAction::~KAction() | 100 | KAction::~KAction() | ||
101 | { | 101 | { | ||
102 | KGestureMap::self()->removeAllGestures(this); | | |||
103 | delete d; | 102 | delete d; | ||
104 | } | 103 | } | ||
105 | 104 | | |||
106 | bool KAction::isShortcutConfigurable() const | 105 | bool KAction::isShortcutConfigurable() const | ||
107 | { | 106 | { | ||
108 | return property("isShortcutConfigurable").toBool(); | 107 | return property("isShortcutConfigurable").toBool(); | ||
109 | } | 108 | } | ||
110 | 109 | | |||
▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Line(s) | |||||
210 | 209 | | |||
211 | void KAction::forgetGlobalShortcut() | 210 | void KAction::forgetGlobalShortcut() | ||
212 | { | 211 | { | ||
213 | if (isGlobalShortcutEnabled()) { | 212 | if (isGlobalShortcutEnabled()) { | ||
214 | KGlobalAccel::self()->removeAllShortcuts(this); | 213 | KGlobalAccel::self()->removeAllShortcuts(this); | ||
215 | } | 214 | } | ||
216 | } | 215 | } | ||
217 | 216 | | |||
218 | KShapeGesture KAction::shapeGesture(ShortcutTypes type) const | | |||
219 | { | | |||
220 | Q_ASSERT(type); | | |||
221 | if (type & DefaultShortcut) { | | |||
222 | return KGestureMap::self()->defaultShapeGesture(this); | | |||
223 | } else { | | |||
224 | return KGestureMap::self()->shapeGesture(this); | | |||
225 | } | | |||
226 | } | | |||
227 | | ||||
228 | KRockerGesture KAction::rockerGesture(ShortcutTypes type) const | | |||
229 | { | | |||
230 | Q_ASSERT(type); | | |||
231 | if (type & DefaultShortcut) { | | |||
232 | return KGestureMap::self()->defaultRockerGesture(this); | | |||
233 | } else { | | |||
234 | return KGestureMap::self()->rockerGesture(this); | | |||
235 | } | | |||
236 | } | | |||
237 | | ||||
238 | void KAction::setShapeGesture(const KShapeGesture &gest, ShortcutTypes type) | | |||
239 | { | | |||
240 | Q_ASSERT(type); | | |||
241 | | ||||
242 | if (type & DefaultShortcut) { | | |||
243 | KGestureMap::self()->setDefaultShapeGesture(this, gest); | | |||
244 | } | | |||
245 | | ||||
246 | if (type & ActiveShortcut) { | | |||
247 | if (KGestureMap::self()->findAction(gest)) { | | |||
248 | kDebug(283) << "New mouse gesture already in use, won't change gesture."; | | |||
249 | return; | | |||
250 | } | | |||
251 | KGestureMap::self()->setShapeGesture(this, gest); | | |||
252 | } | | |||
253 | } | | |||
254 | | ||||
255 | void KAction::setRockerGesture(const KRockerGesture &gest, ShortcutTypes type) | | |||
256 | { | | |||
257 | Q_ASSERT(type); | | |||
258 | | ||||
259 | if (type & DefaultShortcut) { | | |||
260 | KGestureMap::self()->setDefaultRockerGesture(this, gest); | | |||
261 | } | | |||
262 | | ||||
263 | if (type & ActiveShortcut) { | | |||
264 | if (KGestureMap::self()->findAction(gest)) { | | |||
265 | kDebug(283) << "New mouse gesture already in use, won't change gesture."; | | |||
266 | return; | | |||
267 | } | | |||
268 | KGestureMap::self()->setRockerGesture(this, gest); | | |||
269 | } | | |||
270 | } | | |||
271 | | ||||
272 | void KAction::setHelpText(const QString &text) | 217 | void KAction::setHelpText(const QString &text) | ||
273 | { | 218 | { | ||
274 | setStatusTip(text); | 219 | setStatusTip(text); | ||
275 | setToolTip(text); | 220 | setToolTip(text); | ||
276 | if (whatsThis().isEmpty()) { | 221 | if (whatsThis().isEmpty()) { | ||
277 | setWhatsThis(text); | 222 | setWhatsThis(text); | ||
278 | } | 223 | } | ||
279 | } | 224 | } | ||
Show All 17 Lines |