~ubuntu-branches/ubuntu/wily/zanshin/wily-proposed

« back to all changes in this revision

Viewing changes to src/actionlisteditor.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2009-08-13 23:19:32 UTC
  • Revision ID: james.westby@ubuntu.com-20090813231932-lewqphiry1qs7w80
Tags: upstream-0.1+svn1006410
ImportĀ upstreamĀ versionĀ 0.1+svn1006410

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of Zanshin Todo.
 
2
 
 
3
   Copyright 2008-2009 Kevin Ottens <ervin@kde.org>
 
4
 
 
5
   This program is free software; you can redistribute it and/or
 
6
   modify it under the terms of the GNU General Public License as
 
7
   published by the Free Software Foundation; either version 2 of
 
8
   the License or (at your option) version 3 or any later version
 
9
   accepted by the membership of KDE e.V. (or its successor approved
 
10
   by the membership of KDE e.V.), which shall act as a proxy
 
11
   defined in Section 14 of version 3 of the license.
 
12
 
 
13
   This program is distributed in the hope that it will be useful,
 
14
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
16
   GNU General Public License for more details.
 
17
 
 
18
   You should have received a copy of the GNU General Public License
 
19
   along with this program; if not, write to the Free Software
 
20
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 
21
   USA.
 
22
*/
 
23
 
 
24
#ifndef ZANSHIN_ACTIONLISTEDITOR_H
 
25
#define ZANSHIN_ACTIONLISTEDITOR_H
 
26
 
 
27
#include <QtCore/QModelIndex>
 
28
#include <QtGui/QWidget>
 
29
 
 
30
class ActionListModel;
 
31
class ActionListView;
 
32
class KAction;
 
33
class KActionCollection;
 
34
class KLineEdit;
 
35
 
 
36
class ActionListEditor : public QWidget
 
37
{
 
38
    Q_OBJECT
 
39
 
 
40
public:
 
41
    ActionListEditor(QWidget *parent, KActionCollection *ac);
 
42
 
 
43
    ActionListView *view() const;
 
44
 
 
45
public slots:
 
46
    void showNoProjectInbox();
 
47
    void focusOnProject(const QModelIndex &index);
 
48
 
 
49
    void showNoContextInbox();
 
50
    void focusOnContext(const QModelIndex &index);
 
51
 
 
52
protected:
 
53
    virtual bool eventFilter(QObject *watched, QEvent *event);
 
54
 
 
55
private slots:
 
56
    void updateActions(const QModelIndex &index);
 
57
    void onAddActionRequested();
 
58
    void onRemoveAction();
 
59
    void onMoveAction();
 
60
    void focusActionEdit();
 
61
 
 
62
private:
 
63
    void setupActions(KActionCollection *ac);
 
64
 
 
65
    ActionListView *m_view;
 
66
    KLineEdit *m_addActionEdit;
 
67
 
 
68
    ActionListModel *m_model;
 
69
 
 
70
    KAction *m_add;
 
71
    KAction *m_cancelAdd;
 
72
    KAction *m_remove;
 
73
    KAction *m_move;
 
74
};
 
75
 
 
76
#endif
 
77