• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeutils API Reference
  • KDE Home
  • Contact Us
 

kremotecontrol

  • sources
  • kde-4.12
  • kdeutils
  • kremotecontrol
  • kcmremotecontrol
addaction.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) <2010> Michael Zanetti <michael_zanetti@gmx.net>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 
18 */
19 
20 #include "addaction.h"
21 #include "dbusaction.h"
22 #include "profileaction.h"
23 #include "keypressaction.h"
24 #include "editactioncontainer.h"
25 
26 #include <kdebug.h>
27 
28 
29 AddAction::AddAction() {
30  QWidget *widget = new QWidget(this);
31  ui.setupUi(widget);
32  setMainWidget(widget);
33 }
34 
35 Action::ActionType AddAction::getType() {
36 /* kDebug() << "current index" << ui.cbActionType->currentIndex() << "type" << ui.cbActionType->itemData(ui.cbActionType->currentIndex()).toInt();
37  return (Action::ActionType)ui.cbActionType->itemData(ui.cbActionType->currentIndex()).toInt();*/
38 
39  if(ui.rbTemplate->isChecked()){
40  return Action::ProfileAction;
41  } else if(ui.rbDBus->isChecked()){
42  return Action::DBusAction;
43  } else {
44  return Action::KeypressAction;
45  }
46 }
47 
48 Action *AddAction::createAction(const QString &remote) {
49  Action *action = 0;
50  if(exec() == KDialog::Accepted){
51  switch(getType()){
52  case Action::ProfileAction:
53  action = new ProfileAction();
54  break;
55  case Action::DBusAction:
56  action = new DBusAction();
57  break;
58  case Action::KeypressAction:
59  action = new KeypressAction();
60  break;
61  }
62  if(action){
63  EditActionContainer actionContainer(action, remote);
64  if(actionContainer.exec() != KDialog::Accepted){
65  delete action;
66  action = 0;
67  }
68  }
69  }
70  return action;
71 }
AddAction::createAction
Action * createAction(const QString &remote)
Definition: addaction.cpp:48
Action::ActionType
ActionType
Definition: action.h:33
addaction.h
QWidget
KeypressAction
Definition: keypressaction.h:27
keypressaction.h
dbusaction.h
Action::KeypressAction
Definition: action.h:33
AddAction::AddAction
AddAction()
Definition: addaction.cpp:29
Action
Definition: action.h:30
DBusAction
Definition: dbusaction.h:32
Action::DBusAction
Definition: action.h:33
Action::ProfileAction
Definition: action.h:33
EditActionContainer
Definition: editactioncontainer.h:29
profileaction.h
AddAction::getType
Action::ActionType getType()
Definition: addaction.cpp:35
editactioncontainer.h
ProfileAction
Definition: profileaction.h:26
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:07:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kremotecontrol

Skip menu "kremotecontrol"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • kremotecontrol
  • ktimer
  • kwallet
  • superkaramba
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal