GPL V2. Added settings to documentation
3 #include "exportoofiledialog.h"
5 ExportOOFileDialog::ExportOOFileDialog():QFileDialog()
10 ExportOOFileDialog::ExportOOFileDialog (QWidget * parent, const QString &caption ):QFileDialog(parent, caption)
15 bool ExportOOFileDialog::foundConfig()
17 return !filters.isEmpty();
21 QString ExportOOFileDialog::selectedConfig()
23 QStringList::Iterator itpath=configPaths.begin();
24 QStringList::Iterator itf=filters.begin();
25 while (itf != filters.end())
27 if (*itf==selectedFilter()) return *itpath;
31 qWarning ("ExportOOFileDialog::selectedConfig No filter found!");
35 void ExportOOFileDialog::newConfigPath(const QString &s)
40 QString ExportOOFileDialog::selectedFile()
42 return QFileDialog::selectedFile();
46 void ExportOOFileDialog::show()
52 void ExportOOFileDialog::init()
54 setMode( QFileDialog::AnyFile );
56 d.setPath ("/usr/share/vym/exports");
58 d.setPath (d.homeDirPath()+"/.vym/exports");
60 d.setPath (d.currentPath()+"/exports");
64 this,SIGNAL (filterSelected(const QString&)),
65 this, SLOT( newConfigPath(const QString &)));
68 void ExportOOFileDialog::addFilter(const QString &f)
74 void ExportOOFileDialog::scanExportConfigs(QDir dir)
76 // Scan existing export configurations
82 dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
84 QFileInfoList list = dir.entryInfoList();
85 for (int i = 0; i < list.size(); ++i) {
86 QFileInfo fi = list.at(i);
88 if (fi.fileName().endsWith(".conf") )
90 configPaths.append (fi.absFilePath());
92 set.readSettings (fi.absFilePath());
93 addFilter (set.readEntry(QString("Name")) + " (*.odp)");