4 * Copyright (c) 2002 Leo Savernik, per-domain settings
5 * Copyright (c) 2001, Daniel Naber, based on javaopts.h
6 * Copyright (c) 2000, Stefan Schimanski <1Stein@gmx.de>
14 #include <QtGui/QWidget>
16 #include "domainlistview.h"
23 #include "ui_nsconfigwidget.h"
27 class KProgressDialog
;
36 /** policies with plugin-specific constructor
38 class PluginPolicies
: public Policies
{
42 * @param config configuration to initialize this instance from
43 * @param group config group to use if this instance contains the global
44 * policies (global == true)
45 * @param global true if this instance contains the global policy settings,
46 * false if this instance contains policies specific for a domain.
47 * @param domain name of the domain this instance is used to configure the
48 * policies for (case insensitive, ignored if global == true)
50 PluginPolicies(KSharedConfig::Ptr config
, const QString
&group
, bool global
,
51 const QString
&domain
= QString());
53 virtual ~PluginPolicies();
56 /** Plugin-specific enhancements to the domain list view
58 class PluginDomainListView
: public DomainListView
{
61 PluginDomainListView(KSharedConfig::Ptr config
,const QString
&group
,KPluginOptions
*opt
,
63 virtual ~PluginDomainListView();
66 virtual PluginPolicies
*createPolicies();
67 virtual PluginPolicies
*copyPolicies(Policies
*pol
);
68 virtual void setupPolicyDlg(PushButton trigger
,PolicyDialog
&pDlg
,
73 KPluginOptions
*options
;
77 * dialog for embedding a PluginDomainListView widget
79 class PluginDomainDialog
: public QWidget
{
83 PluginDomainDialog(QWidget
*parent
);
84 virtual ~PluginDomainDialog();
86 void setMainWidget(QWidget
*widget
);
89 virtual void slotClose();
92 PluginDomainListView
*domainSpecific
;
93 QBoxLayout
*thisLayout
;
96 class KPluginOptions
: public KCModule
101 KPluginOptions( QWidget
* parent
, const QVariantList
& );
105 virtual void defaults();
106 QString
quickHelp() const;
110 void slotTogglePluginsEnabled();
111 void slotShowDomainDlg();
115 KSharedConfig::Ptr m_pConfig
;
117 KProcess
*nspluginscan
;
120 QCheckBox
*enablePluginsGloballyCB
, *enableHTTPOnly
, *enableUserDemand
;
125 void updatePLabel(int);
126 void change() { change( true ); }
127 void change( bool c
) { emit
changed(c
); m_changed
= c
; }
133 Ui::NSConfigWidget
*m_widget
;
135 KProgressDialog
*m_progress
;
137 QLabel
*priorityLabel
;
138 PluginPolicies global_policies
;
139 PluginDomainListView
*domainSpecific
;
140 KDialog
*domainSpecificDlg
;
142 /******************************************************************************/
145 void dirLoad( KSharedConfig::Ptr config
, bool useDefault
= false );
146 void dirSave( KSharedConfig::Ptr config
);
153 void dirEdited(const QString
&);
154 void dirSelect( QListWidgetItem
* );
156 /******************************************************************************/
159 void pluginLoad( KSharedConfig::Ptr config
);
160 void pluginSave( KSharedConfig::Ptr config
);
162 friend class PluginDomainListView
;
165 #endif // __PLUGINOPTS_H__