8 #include "pqCoreModule.h" 18 #include <QStringList> 67 typedef QDialog Superclass;
95 ExistingFilesAndDirectories
108 vtkTypeUInt32 location,
128 const QString& directory = QString(),
const QString& filter = QString(),
129 bool supportGroupFiles =
true,
bool onlyBrowseRemotely =
true);
136 void setFileMode(
FileMode, vtkTypeUInt32);
144 void setRecentlyUsedExtension(
const QString& fileExtension, vtkTypeUInt32 location);
145 void setRecentlyUsedExtension(
const QString& fileExtension);
153 void setFileValidityCallback(
154 const std::optional<pqFileValidityCallback>& callback = std::nullopt);
159 std::optional<pqFileValidityCallback> getFileValidityCallback();
164 QStringList getSelectedFiles(
int index = 0);
169 QList<QStringList> getAllSelectedFiles();
174 int getSelectedFilterIndex();
179 void accept()
override;
184 bool selectFile(
const QString&);
189 void setShowHidden(
const bool& hidden);
194 bool getShowHidden();
208 const QString& title = QString(),
const QString& directory = QString(),
209 const QString& filter = QString())
211 const QPair<QString, vtkTypeUInt32> result =
215 static QPair<QString, vtkTypeUInt32> getSaveFileNameAndLocation(
pqServer* server,
216 QWidget* parentWdg,
const QString&
title = QString(),
const QString& directory = QString(),
217 const QString& filter = QString(),
bool supportGroupFiles =
false,
218 bool onlyBrowseRemotely =
true);
224 void filesSelected(
const QList<QStringList>&);
233 void filesSelected(
const QStringList&);
240 void fileAccepted(
const QString&);
243 bool acceptExistingFiles();
244 bool acceptDefault(
const bool& checkForGrouping);
246 QStringList buildFileGroup(
const QString& filename);
247 bool areFilesValid(
const QStringList& filenames, QString& reason);
249 void showEvent(QShowEvent* showEvent)
override;
252 void onLocationChanged(
int fs);
254 void onNavigate(
const QString& = QString());
256 void onNavigateBack();
257 void onNavigateForward();
258 void onNavigateDown(
const QModelIndex&);
259 void onFilterChange(
const QString&);
261 void onClickedRecent(
const QModelIndex&);
262 void onClickedFavorite(
const QModelIndex&);
263 void onClickedFile(
const QModelIndex&);
265 void onActivateFavorite(
const QModelIndex&);
266 void onActivateLocation(
const QModelIndex&);
267 void onActivateRecent(
const QModelIndex&);
268 void onDoubleClickFile(
const QModelIndex&);
270 void onTextEdited(
const QString&);
272 void onShowHiddenFiles(
const bool& hide);
274 void onShowDetailToggled(
bool show);
276 void onGroupFilesToggled(
bool group);
279 void fileSelectionChanged();
282 void onContextMenuRequested(
const QPoint& pos);
285 void onFavoritesContextMenuRequested(
const QPoint& pos);
287 void AddDirectoryToFavorites(QString
const&);
288 void RemoveDirectoryFromFavorites(QString
const&);
289 void FilterDirectoryFromFavorites(
const QString& filter);
291 void onAddCurrentDirectoryToFavorites();
292 void onRemoveSelectedDirectoriesFromFavorites();
293 void onResetFavoritesToSystemDefault();
296 void onCreateNewFolder();
301 void addToFilesSelected(
const QStringList&);
306 void emitFilesSelectionDone();
313 void updateButtonStates(vtkTypeUInt32 fileSystem);
319 class pqImplementation;
320 QMap<vtkTypeUInt32, QPointer<pqImplementation>> Implementations;
321 vtkTypeUInt32 SelectedLocation;
323 QPointer<pqServer> Server;
324 const QString StartDirectory;
325 const QString NameFilter;
326 bool SupportsGroupFiles;
327 vtkTypeUInt32 DefaultLocation;
328 QString RecentlyUsedExtension;
329 std::optional<pqFileValidityCallback> FileValidityCallback;
331 void addImplementation(vtkTypeUInt32
location);
334 bool acceptInternal(
const QStringList& selected_files);
335 QString fixFileExtension(
const QString& filename,
const QString& filter);
341 void saveState(vtkTypeUInt32 fileSystem);
349 void restoreState(vtkTypeUInt32 fileSystem);
354 #endif // pqFileDialog_h
vtkTypeUInt32 getSelectedLocation() const
Get the location that the selected files/directories belong to.
static QString getSaveFileName(pqServer *server, QWidget *parentWdg, const QString &title=QString(), const QString &directory=QString(), const QString &filter=QString())
static method similar to QFileDialog::getSaveFileName(...) to make it easier to get a file name to sa...
FileMode
choose mode for selecting file/folder.
Provides a standard file dialog "front-end" for the pqFileDialogModel "back-end", i...
static QPair< QString, vtkTypeUInt32 > getSaveFileNameAndLocation(pqServer *server, QWidget *parentWdg, const QString &title=QString(), const QString &directory=QString(), const QString &filter=QString(), bool supportGroupFiles=false, bool onlyBrowseRemotely=true)
static method similar to QFileDialog::getSaveFileName(...) to make it easier to get a file name to sa...
std::function< bool(QStringList group, vtkTypeUInt32 location, QString &reason)> pqFileValidityCallback
Callback to evaluate the validity of a selected file group.
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...