/** * executes the action if there is any */ void ExecuteAction() { if (action == 0) return; ActionEvent event(parent, TOKEN_ACTION_START); { wxString msg; msg.Printf(_("Execute: %s"), actionName.c_str()); event.init(parent, TOKEN_ACTION_START, msg); event.Post(); } unsigned int actionFlags = 0; try { state = ACTION_RUNNING; if (!action->Perform()) result = ACTION_ERROR; else result = ACTION_SUCCESS; actionFlags = action->GetFlags(); state = ACTION_NONE; } catch (svn::ClientException & e) { wxString msg, errtxt(Utf8ToLocal(e.message())); msg.Printf(_("Error while performing action: %s"), errtxt.c_str()); event.init(parent, TOKEN_SVN_INTERNAL_ERROR, msg); event.Post(); state = ACTION_NONE; result = ACTION_ERROR; DeleteAction(); return; } catch (...) { wxString msg(_("Error while performing action.")); event.init(parent, TOKEN_SVN_INTERNAL_ERROR, msg); event.Post(); state = ACTION_NONE; result = ACTION_ERROR; DeleteAction(); return; } event.init(parent, TOKEN_ACTION_END, (void*) new unsigned int(actionFlags)); event.Post(); DeleteAction(); }
status_t RuleRunner::RunAction(const BMessage &action, entry_ref &ref) { BString actionname; if (action.FindString("name",&actionname) != B_OK) { debugger("Couldn't find action name in RuleRunner::RunAction"); return B_ERROR; } if (actionname.Compare("Move it to…") == 0) return MoveAction(action,ref); else if (actionname.Compare("Copy it to…") == 0) return CopyAction(action,ref); else if (actionname.Compare("Rename it to…") == 0) return RenameAction(action,ref); else if (actionname.Compare("Open it") == 0) return OpenAction(action,ref); else if (actionname.Compare("Add it to the archive…") == 0) return ArchiveAction(action,ref); else if (actionname.Compare("Terminal command…") == 0) return CommandAction(action,ref); else if (actionname.Compare("Move it to the Trash") == 0) return TrashAction(action,ref); else if (actionname.Compare("Delete it") == 0) return DeleteAction(action,ref); return B_ERROR; }
//---------------------------------------------------- CPhoto::~CPhoto() { DeleteAction() ; DeleteTimers() ; SAFEDEL( m_pConf) ; SAFEDEL( m_pColl) ; delete ui ; }
void DeleteActionSet(OCActionSet** actionset) { OCAction* pointer = (*actionset)->head; OCAction* pDel = NULL; while (pointer) { pDel = pointer; pointer = pointer->next; DeleteAction(&pDel); pDel->next = NULL; } OCFree((*actionset)->actionsetName); (*actionset)->head = NULL; }
WiimoteSettingsPage::WiimoteSettingsPage(SettingsDialog* dialog) : SettingsPage(dialog), ui_(new Ui_WiimoteSettingsPage) { ui_->setupUi(this); ui_->list->header()->setResizeMode(QHeaderView::ResizeToContents); setWindowIcon(IconLoader::Load("wiimotedev", IconLoader::Base)); text_buttons_.insert(WIIMOTE_BTN_1, "Wiiremote 1"); text_buttons_.insert(WIIMOTE_BTN_2, "Wiiremote 2"); text_buttons_.insert(WIIMOTE_BTN_A, "Wiiremote A"); text_buttons_.insert(WIIMOTE_BTN_B, "Wiiremote B"); text_buttons_.insert(WIIMOTE_BTN_PLUS, "Wiiremote Plus"); text_buttons_.insert(WIIMOTE_BTN_MINUS, "Wiiremote Minus"); text_buttons_.insert(WIIMOTE_BTN_HOME, "Wiiremote Home"); text_buttons_.insert(WIIMOTE_BTN_UP, "Wiiremote Up"); text_buttons_.insert(WIIMOTE_BTN_DOWN, "Wiiremote Down"); text_buttons_.insert(WIIMOTE_BTN_LEFT, "Wiiremote Left"); text_buttons_.insert(WIIMOTE_BTN_RIGHT, "Wiiremote Right"); text_buttons_.insert(WIIMOTE_BTN_SHIFT_UP, "Wiiremote Shift Up"); text_buttons_.insert(WIIMOTE_BTN_SHIFT_DOWN, "Wiiremote Shift Down"); text_buttons_.insert(WIIMOTE_BTN_SHIFT_LEFT, "Wiiremote Shift Left"); text_buttons_.insert(WIIMOTE_BTN_SHIFT_RIGHT, "Wiiremote Shift Right"); text_buttons_.insert(WIIMOTE_BTN_SHIFT_FORWARD, "Wiiremote Shift Forward"); text_buttons_.insert(WIIMOTE_BTN_SHIFT_BACKWARD, "Wiiremote Shift Backward"); text_buttons_.insert(WIIMOTE_BTN_TILT_FRONT, "Wiiremote Tilt Front"); text_buttons_.insert(WIIMOTE_BTN_TILT_BACK, "Wiiremote Tilt Back"); text_buttons_.insert(WIIMOTE_BTN_TILT_LEFT, "Wiiremote Tilt Left"); text_buttons_.insert(WIIMOTE_BTN_TILT_RIGHT, "Wiiremote Tilt Right"); text_buttons_.insert(NUNCHUK_BTN_Z, "Nunchuk Z"); text_buttons_.insert(NUNCHUK_BTN_C, "Nunchuk B"); text_buttons_.insert(NUNCHUK_BTN_STICK_UP, "Nunchuk Stick Up"); text_buttons_.insert(NUNCHUK_BTN_STICK_DOWN, "Nunchuk Stick Down"); text_buttons_.insert(NUNCHUK_BTN_STICK_LEFT, "Nunchuk Stick Left"); text_buttons_.insert(NUNCHUK_BTN_STICK_RIGHT, "Nunchuk Stick Right"); text_buttons_.insert(NUNCHUK_BTN_SHIFT_UP, "Nunchuk Shift Up"); text_buttons_.insert(NUNCHUK_BTN_SHIFT_DOWN, "Nunchuk Shift Down"); text_buttons_.insert(NUNCHUK_BTN_SHIFT_LEFT, "Nunchuk Shift Left"); text_buttons_.insert(NUNCHUK_BTN_SHIFT_RIGHT, "Nunchuk Shift Right"); text_buttons_.insert(NUNCHUK_BTN_SHIFT_FORWARD, "Nunchuk Shift Forward"); text_buttons_.insert(NUNCHUK_BTN_SHIFT_BACKWARD, "Nunchuk Shift Backward"); text_buttons_.insert(NUNCHUK_BTN_TILT_FRONT, "Nunchuk Tilt Front"); text_buttons_.insert(NUNCHUK_BTN_TILT_BACK, "Nunchuk Tilt Back"); text_buttons_.insert(NUNCHUK_BTN_TILT_LEFT, "Nunchuk Tilt Left"); text_buttons_.insert(NUNCHUK_BTN_TILT_RIGHT, "Nunchuk Tilt Right"); text_buttons_.insert(CLASSIC_BTN_X, "Classic X"); text_buttons_.insert(CLASSIC_BTN_Y, "Classic Y"); text_buttons_.insert(CLASSIC_BTN_A, "Classic A"); text_buttons_.insert(CLASSIC_BTN_B, "Classic B"); text_buttons_.insert(CLASSIC_BTN_L, "Classic L"); text_buttons_.insert(CLASSIC_BTN_R, "Classic R"); text_buttons_.insert(CLASSIC_BTN_ZL, "Classic ZL"); text_buttons_.insert(CLASSIC_BTN_ZR, "Classic ZR"); text_buttons_.insert(CLASSIC_BTN_MINUS, "Classic Minus"); text_buttons_.insert(CLASSIC_BTN_PLUS, "Classic Plus"); text_buttons_.insert(CLASSIC_BTN_HOME, "Classic Home"); text_buttons_.insert(CLASSIC_BTN_UP, "Classic Up"); text_buttons_.insert(CLASSIC_BTN_DOWN, "Classic Down"); text_buttons_.insert(CLASSIC_BTN_LEFT, "Classic Left"); text_buttons_.insert(CLASSIC_BTN_RIGHT, "Classic Right"); text_buttons_.insert(CLASSIC_BTN_LSTICK_UP, "Classic Left-Stick Up"); text_buttons_.insert(CLASSIC_BTN_LSTICK_DOWN, "Classic Left-Stick Down"); text_buttons_.insert(CLASSIC_BTN_LSTICK_LEFT, "Classic Left-Stick Left"); text_buttons_.insert(CLASSIC_BTN_LSTICK_RIGHT, "Classic Left-Stick Right"); text_buttons_.insert(CLASSIC_BTN_RSTICK_UP, "Classic Right-Stick Up"); text_buttons_.insert(CLASSIC_BTN_RSTICK_DOWN, "Classic Right-Stick Down"); text_buttons_.insert(CLASSIC_BTN_RSTICK_LEFT, "Classic Right-Stick Left"); text_buttons_.insert(CLASSIC_BTN_RSTICK_RIGHT, "Classic Right-Stick Right"); text_buttons_.insert(WIIMOTE_BTN_SHIFT_SHAKE, "Wiiremote Shift Shake"); text_buttons_.insert(NUNCHUK_BTN_SHIFT_SHAKE, "Nunchuk Shift Shake"); text_actions_.insert(WiimotedevShortcuts::WiimotedevActiveDeactive, tr("Active/deactive Wiiremote")); text_actions_.insert(WiimotedevShortcuts::PlayerNextTrack, tr("Next track")); text_actions_.insert(WiimotedevShortcuts::PlayerPreviousTrack, tr("Previous track")); text_actions_.insert(WiimotedevShortcuts::PlayerPlay, tr("Play")); text_actions_.insert(WiimotedevShortcuts::PlayerStop, tr("Stop")); text_actions_.insert(WiimotedevShortcuts::PlayerIncVolume, tr("Increase volume")); text_actions_.insert(WiimotedevShortcuts::PlayerDecVolume, tr("Decrease volume")); text_actions_.insert(WiimotedevShortcuts::PlayerMute, tr("Mute")); text_actions_.insert(WiimotedevShortcuts::PlayerPause, tr("Pause")); text_actions_.insert(WiimotedevShortcuts::PlayerTogglePause, tr("Play/Pause")); text_actions_.insert(WiimotedevShortcuts::PlayerSeekBackward, tr("Seek backward")); text_actions_.insert(WiimotedevShortcuts::PlayerSeekForward, tr("Seek forward")); text_actions_.insert(WiimotedevShortcuts::PlayerStopAfter, tr("Stop after")); text_actions_.insert(WiimotedevShortcuts::PlayerShowOSD, tr("Show OSD")); connect(ui_->list, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), SLOT(ItemClicked(QTreeWidgetItem*))); connect(ui_->wiimotedev_add_action, SIGNAL(clicked()), this, SLOT(AddAction())); connect(ui_->wiimotedev_delete_action, SIGNAL(clicked()), this, SLOT(DeleteAction())); connect(ui_->wiimotedev_reload, SIGNAL(clicked()), this, SLOT(DefaultSettings())); }