1 /***************************************************************************
2                           rkpluginbrowser  -  description
3                              -------------------
4     begin                : Sat Mar 10 2005
5     copyright            : (C) 2005 - 2018 by Thomas Friedrichsmeier
6     email                : thomas.friedrichsmeier@kdemail.net
7  ***************************************************************************/
8 
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17 
18 #ifndef RKPLUGINBROWSER_H
19 #define RKPLUGINBROWSER_H
20 
21 #include "rkcomponent.h"
22 
23 #include "rkcomponentproperties.h"
24 
25 #include <QTimer>
26 
27 class GetFileNameWidget;
28 class QDomElement;
29 class QCheckBox;
30 
31 /** RKComponent to select one or more file(s) or directories
32 
33 TODO: Rename to something like RKComponentFileSelect or a similarly ugly name
34 TODO: I ripped out multiple file selection for now. GetFileNameWidget should be extended to handle that internally (tfry)
35 
36 @author Adrien d'Hardemare
37 */
38 
39 class RKPluginBrowser : public RKComponent {
40 	Q_OBJECT
41 public:
42 	RKPluginBrowser (const QDomElement &element, RKComponent *parent_component, QWidget *parent_widget);
43 	~RKPluginBrowser ();
44 
45 	RKComponentPropertyBase *selection;
46 	QVariant value (const QString &modifier=QString ()) override { return (selection->value (modifier)); };
47 	QStringList getUiLabelPair () const override;
type()48 	int type () override { return ComponentBrowser; };
49 	ComponentStatus recursiveStatus () override;
50 public slots:
51 	void textChangedFromUi ();
52 	void textChanged (RKComponentPropertyBase *);
53 	void validateInput ();
54 private:
55 	void updateColor ();
56 	QTimer validation_timer;
57 	ComponentStatus status;
58 	GetFileNameWidget *selector;
59 	bool updating;
60 	bool only_local;
61 	QString label_string;
62 	QCheckBox* overwrite_confirm;
63 };
64 
65 #endif
66