summaryrefslogtreecommitdiffstats
path: root/quanta/dialogs/actionconfigdialog.h
blob: 6eaa9746ed4d5d89c28189a2c64bd9054a9cc591 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/***************************************************************************
                             actionconfigdialog.cpp
                             ---------------------
    copyright            : (C) 2003 by Andras Mantia <amantia@kde.org>
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; version 2 of the License.               *
 *                                                                         *
 ***************************************************************************/

#ifndef ACTIONCONFIGDIALOG_H
#define ACTIONCONFIGDIALOG_H

#include <tqmap.h>
#include "actionconfigdialogs.h"

class TQDomDocument;
class TQPopupMenu;

class KAction;
class KMainWindow;
class KPopupMenu;
class KShortcut;
class KXMLGUIClient;

typedef struct ToolbarEntry{
  KXMLGUIClient *guiClient;
  TQDomDocument *dom;
  TQPopupMenu *menu;
  KURL url;
  TQString name;
  TQString id;
  bool user;
  bool visible;
  bool nameModified; ///< True if the name of the toolbar was modified by Quanta on loading:" (n)" was added
};

class ActionConfigDialog: public ActionConfigDialogS
{
  Q_OBJECT

public:

  ActionConfigDialog(const TQDict<ToolbarEntry> &toolbarList, KMainWindow* parent = 0, const char* name = 0, bool modal = true, WFlags fl = 0 , const TQString& defaultAction = TQString::null);
  ~ActionConfigDialog();
  void createScriptAction(const TQString& a_name, const TQString& a_script);

public slots:
  virtual void accept();
  virtual void reject();
  void slotToggled(bool);
  void slotTextChanged();
  void slotTextChanged(const TQString&);
  void slotNewAction();

private slots:
  void slotAddToolbar();
  void slotRemoveToolbar();
  void slotEditToolbar();
  void slotContextMenu(KListView *,TQListViewItem *,const TQPoint &);
  void slotSelectionChanged(TQListViewItem *);
  void slotShortcutCaptured(const KShortcut&);
  void slotDeleteAction();
  void slotApply();
  void slotAddContainerToolbar();
  void slotRemoveContainerToolbar();
  void slotToolbarRemoved(const TQString& toolbarName);
  
signals:
  void addToolbar();
  void removeToolbar(const TQString&);      
  void deleteUserAction(KAction *);
  void configureToolbars(const TQString&);

private:
  void saveCurrentAction();

  KPopupMenu *treeMenu;
  KAction *currentAction;
  TQListViewItem *allActionsItem;
  TQMap<TQString, TQString> globalShortcuts;
  KShortcut selectedShortcut;
  KMainWindow *m_mainWindow;
  TQDict<ToolbarEntry> m_toolbarList;
  TQListViewItem *m_toolbarItem;
};

#endif