LauncherApplet::LauncherApplet(SessionAppletDef * appletDef, const QString & id, LauncherPlugin * plugin) : SessionApplet(appletDef, id), _plugin(plugin), _fileItem(0) { _button = new LauncherButton(); addContextAction(new KAction(i18n("&Preferences"), KShortcut(), this, SLOT(slotShowPreferences()), this, "clockPreferences")); // The second last argument of KAction passes an owner applet which gives auto deletion // Removing Launcher applets is now handled generally though a slot on the host connect(_plugin, SIGNAL(settingsChanged()), this, SLOT(slotSettingsChanged())); connect(_button, SIGNAL(clicked()), this, SLOT(slotButtonClicked())); setIcon(_button); slotSettingsChanged(); }
void squareToolDock::processToolChange(toolChangeDirection direction, const toolChangeData& data) { if (direction == T_ACTIVATE) { data.toolButton()->setDown(true); if (data.contextAction()) { emit addContextAction(data.contextAction()); } } else { data.toolButton()->setDown(false); if (data.contextAction()) { emit removeContextAction(data.contextAction()); } } if (data.enableToolLabel() != triNoop) { const bool b = (data.enableToolLabel() == triTrue) ? true : false; toolColorLabel_->setEnabled(b); } if (data.showDetailDock() != triNoop) { const bool b = (data.showDetailDock() == triTrue) ? true : false; showDetailDock(b); } }