KVIrc  4.9.2
DeveloperAPIs
KviTalFileDialog.h
Go to the documentation of this file.
1 #ifndef _KVI_TAL_FILEDIALOG_H_
2 #define _KVI_TAL_FILEDIALOG_H_
3 
4 //=============================================================================
5 //
6 // File : KviTalFileDialog.h
7 // Creation date : Thu Sep 11 2003 04:41:08 by Szymon Stefanek
8 //
9 // This file is part of the KVIrc IRC client distribution
10 // Copyright (C) 2003-2010 Szymon Stefanek (pragma at kvirc dot net)
11 //
12 // This program is FREE software. You can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the HOPE that it will be USEFUL,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 // See the GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program. If not, write to the Free Software Foundation,
24 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 //
26 //=============================================================================
27 
34 #include "kvi_settings.h"
35 
36 #ifdef None
37 #undef None
38 #endif // otherwise gcc freaks out somewhere inside the include chain of KFileDialog
39 
45 #if defined(COMPILE_KDE4_SUPPORT)
46 
47 #include <KFileDialog>
48 class KVILIB_API KviTalFileDialog : public KFileDialog
49 
50 #else
51 
52 // no KDE or KDE5 (which has no KFileDialog)
53 
54 #include <QFileDialog>
55 class KVILIB_API KviTalFileDialog : public QFileDialog
56 
57 #endif
58 {
59  Q_OBJECT
60 public:
70  KviTalFileDialog(const QString & szDirName, const QString & szFilter = QString(), QWidget * pParent = 0, const char * pcName = 0, bool bModal = false);
71 
76 
77 public:
82  enum FileMode
83  {
88  DirectoryOnly
89  };
90 
96  void setFileMode(FileMode m);
97 
103  void setDirectory(const QString & szDirectory);
104 
112  static QString getExistingDirectoryPath(const QString & szDir = QString(), const QString & szCaption = QString(), QWidget * pParent = 0)
113  {
114 #if defined(COMPILE_KDE4_SUPPORT)
115  // QFileDialog allows making new directories...kfiledialog not :/
116  return KFileDialog::getExistingDirectory(KUrl(szDir), pParent, szCaption);
117 //return getExistingDirectory(dir,parent,caption);
118 #else
119  return getExistingDirectory(pParent, szCaption, szDir);
120 #endif
121  };
122 };
123 
124 #endif // _KVI_TAL_FILEDIALOG_H_
defined(COMPILE_KDE4_SUPPORT)
Definition: KviTalFileDialog.h:55
static QString getExistingDirectoryPath(const QString &szDir=QString(), const QString &szCaption=QString(), QWidget *pParent=0)
Returns an existing directory selected by the user.
Definition: KviTalFileDialog.h:112
#define m
Definition: detector.cpp:77
Definition: KviTalFileDialog.h:86
FileMode
Indicate what the user may select in the file dialog.
Definition: KviTalFileDialog.h:82
Definition: KviTalFileDialog.h:87
Definition: KviTalFileDialog.h:84
Definition: KviTalFileDialog.h:85
This file contains compile time settings.
#define KVILIB_API
Definition: kvi_settings.h:125