Subversion Repositories Scribus

Rev

Rev 10242 | Rev 10245 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
10242 subik 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
#include <QPushButton>
8
 
9
#include "scfilewidget.h"
10
 
11
 
10244 fschmid 12
ScFileWidget::ScFileWidget(QWidget * parent) : QFileDialog(parent, Qt::Widget)
10242 subik 13
{
14
        setSizeGripEnabled(false);
15
        setModal(false);
16
        setViewMode(QFileDialog::List);
17
        setWindowFlags(Qt::Widget);
10244 fschmid 18
        QList<QObject*> l = queryList("QPushButton");
19
        QListIterator<QObject*> it(l);
20
        QObject *obj;
21
        while (it.hasNext())
22
        {
23
                obj = it.next();
24
                ((QPushButton*)obj)->setVisible(false);
25
        }
10242 subik 26
        setMinimumSize(QSize(480, 310));
27
        setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
28
}
29
 
30
QString ScFileWidget::selectedFile()
31
{
32
        QStringList l(selectedFiles());
33
        if (l.count() == 0)
34
                return QString();
35
        return l.at(0);
36
}