1/*
2 This file is part of the KDE project
3 Copyright (C) 2009 by Dmitry Suzdalev <dimsuz@gmail.com>
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; see the file COPYING. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef EDIT_ACTION_DIALOG_H
22#define EDIT_ACTION_DIALOG_H
23
24#include <KDialog>
25
26namespace Ui
27{
28 class EditActionDialog;
29}
30
31class ClipAction;
32class ActionDetailModel;
33
34class EditActionDialog : public KDialog
35{
36 Q_OBJECT
37public:
38 EditActionDialog(QWidget* parent);
39 ~EditActionDialog();
40
41 /**
42 * Sets the action this dialog will work with
43 */
44 void setAction(ClipAction* act, int commandIdxToSelect = -1);
45
46private slots:
47 void onAddCommand();
48 void onRemoveCommand();
49 void onSelectionChanged();
50// void onItemChanged( QTreeWidgetItem*, int );
51
52private:
53 /**
54 * Updates dialog's widgets according to values
55 * in m_action.
56 * If commandIdxToSelect != -1 this command will be preselected
57 */
58 void updateWidgets(int commandIdxToSelect);
59
60 /**
61 * Saves a values from widgets to action
62 */
63 void saveAction();
64
65 virtual void slotButtonClicked( int button );
66
67private:
68 Ui::EditActionDialog* m_ui;
69
70 ClipAction* m_action;
71 ActionDetailModel* m_model;
72};
73#endif
74