summaryrefslogtreecommitdiff
path: root/libopie/ofiledialog.cc
Side-by-side diff
Diffstat (limited to 'libopie/ofiledialog.cc') (more/less context) (show whitespace changes)
-rw-r--r--libopie/ofiledialog.cc40
1 files changed, 40 insertions, 0 deletions
diff --git a/libopie/ofiledialog.cc b/libopie/ofiledialog.cc
index 4783004..9e725c2 100644
--- a/libopie/ofiledialog.cc
+++ b/libopie/ofiledialog.cc
@@ -30,12 +30,23 @@
#include <qstring.h>
#include <qapplication.h>
#include <qlayout.h>
#include "ofiledialog.h"
+/**
+ * This constructs a modal dialog
+ *
+ * @param caption The caption of the dialog
+ * @param wid The parent widget
+ * @param mode The mode of the OFileSelector @see OFileSelector
+ * @param selector The selector of the OFileSelector
+ * @param dirName the dir or resource to start from
+ * @param fileName a proposed or existing filename
+ * @param mimetypes The mimeTypes
+ */
OFileDialog::OFileDialog(const QString &caption,
QWidget *wid, int mode, int selector,
const QString &dirName,
const QString &fileName,
const QMap<QString,QStringList>& mimetypes )
: QDialog( wid, "OFileDialog", true )
@@ -57,24 +68,48 @@ OFileDialog::OFileDialog(const QString &caption,
connect(file, SIGNAL(dirSelected(const QString &) ),
this, SLOT(slotDirSelected(const QString &) ) );
file->setYesCancelVisible( false ); // relayout
}
+/**
+ * @returns the mimetype of the selected
+ * currently it return QString::null
+ */
QString OFileDialog::mimetype()const
{
return QString::null;
}
+
+/**
+ * @return the fileName
+ */
QString OFileDialog::fileName()const
{
return file->selectedName();
}
+
+/**
+ * return a DocLnk to the current file
+ */
DocLnk OFileDialog::selectedDocument()const
{
return file->selectedDocument();
}
+
+/**
+ * This opens up a filedialog in Open mode
+ *
+ * @param selector the Selector Mode
+ * @param startDir Where to start from
+ * @param file A proposed filename
+ * @param mimes A list of MimeTypes
+ * @param wid the parent
+ * @param caption of the dialog if QString::null tr("Open") will be used
+ * @return the fileName or QString::null
+ */
QString OFileDialog::getOpenFileName(int selector,
const QString &startDir,
const QString &file,
const MimeTypes &mimes,
QWidget *wid,
const QString &caption )
@@ -85,12 +120,17 @@ QString OFileDialog::getOpenFileName(int selector,
dlg.showMaximized();
if( dlg.exec() )
ret = dlg.fileName();
return ret;
}
+
+/**
+ * This opens up a file dialog in save mode
+ * @see getOpenFileName
+ */
QString OFileDialog::getSaveFileName(int selector,
const QString &startDir,
const QString &file,
const MimeTypes &mimes,
QWidget *wid,
const QString &caption )