Subversion Repositories Scribus

Rev

Rev 24665 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
24706 jghali 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
7
#ifndef SCFILEWIDGET_H
8
#define SCFILEWIDGET_H
9
 
10
#include <QFileDialog>
11
 
12
#include "scribusapi.h"
13
 
14
/*! \brief Simple wrapper simulating the QFileDialog as a common widget.
15
Usage is simple - everything is like in QFileDialog except it is not
16
a dialog, it's a widget. It can be used for extension features etc.
24665 jghali 17
\note Original QFileDialog OK/Cancel buttons are hidden. You must
18
write your own dialog accept/reject handling.
19
There is one good idea - it's quite good to handle original dialog
20
accepted() signal on your own to prevent ugly widget hiding when
21
user e.g. doubleclicks the "open" file (in the parent (new) dialog):
22
connect(fileWidget, SIGNAL(accepted()), this, SLOT(accept()));
23
\author Petr Vanek <petr@scribus.info>
24706 jghali 24
*/
25
class SCRIBUS_API ScFileWidget : public QFileDialog
26
{
27
        Q_OBJECT
28
 
29
public:
30
        ScFileWidget(QWidget * parent);
31
 
32
        QString selectedFile();
33
        void forceDoubleClickActivation(bool force);
34
 
35
public slots:
36
        void locationDropped(const QString& fileUrl);
37
        void gotoParentDirectory();
38
        void gotoSelectedDirectory();
39
        void gotoDesktopDirectory();
40
        void gotoHomeDirectory();
41
 
42
private:
43
        bool m_forceDoubleClickActivation { false };
44
};
45
 
46
#endif