3 #include "exportoofiledialog.h"
5 ExportOOFileDialog::ExportOOFileDialog():QFileDialog()
10 ExportOOFileDialog::ExportOOFileDialog (QWidget * parent, const char* name, bool modal):QFileDialog(parent, name,modal)
15 QString ExportOOFileDialog::selectedConfig()
17 QStringList::Iterator itpath=configPaths.begin();
18 QStringList::Iterator itf=filters.begin();
19 while (itf != filters.end())
21 if (*itf==lastFilter) return *itpath;
25 qWarning ("ExportOOFileDialog::selectedConfig No filter found!");
29 void ExportOOFileDialog::newConfigPath(const QString &s)
34 QString ExportOOFileDialog::selectedFile()
36 return QFileDialog::selectedFile();
40 void ExportOOFileDialog::addFilter(const QString &f)
44 QFileDialog::addFilter (f);
47 void ExportOOFileDialog::init()
50 d.setPath ("/usr/share/vym/exports");
52 d.setPath (d.homeDirPath()+"/exports");
54 d.setPath ("exports");
58 this,SIGNAL (filterSelected(const QString&)),
59 this, SLOT( newConfigPath(const QString &)));
62 void ExportOOFileDialog::scanExportConfigs(QDir d)
64 // Scan existing export configurations
70 d.setFilter( QDir::Files| QDir::Hidden | QDir::NoSymLinks );
71 const QFileInfoList *filelist = d.entryInfoList();
72 QFileInfoListIterator itfile( *filelist );
75 while ( (fi = itfile.current()) != 0 )
77 if (fi->fileName().endsWith(".conf") )
79 configPaths.append (fi->absFilePath());
81 set.readSettings (fi->absFilePath());
82 addFilter (set.readEntry("Name") + " (*.odp)");