3 #include "exportoofiledialog.h"
5 ExportOOFileDialog::ExportOOFileDialog():QFileDialog()
10 ExportOOFileDialog::ExportOOFileDialog (QWidget * parent, const char* name, bool modal):QFileDialog(parent, name,modal)
15 bool ExportOOFileDialog::foundConfig()
17 return !filters.isEmpty();
20 QString ExportOOFileDialog::selectedConfig()
22 QStringList::Iterator itpath=configPaths.begin();
23 QStringList::Iterator itf=filters.begin();
24 while (itf != filters.end())
26 if (*itf==lastFilter) return *itpath;
30 qWarning ("ExportOOFileDialog::selectedConfig No filter found!");
34 void ExportOOFileDialog::newConfigPath(const QString &s)
39 QString ExportOOFileDialog::selectedFile()
41 return QFileDialog::selectedFile();
45 void ExportOOFileDialog::addFilter(const QString &f)
49 QFileDialog::addFilter (f);
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 ("exports");
64 this,SIGNAL (filterSelected(const QString&)),
65 this, SLOT( newConfigPath(const QString &)));
68 void ExportOOFileDialog::scanExportConfigs(QDir d)
70 // Scan existing export configurations
76 d.setFilter( QDir::Files| QDir::Hidden | QDir::NoSymLinks );
77 const QFileInfoList *filelist = d.entryInfoList();
78 QFileInfoListIterator itfile( *filelist );
81 while ( (fi = itfile.current()) != 0 )
83 if (fi->fileName().endsWith(".conf") )
85 configPaths.append (fi->absFilePath());
87 set.readSettings (fi->absFilePath());
88 addFilter (set.readEntry("Name") + " (*.odp)");