API Documentation
Loading...
Searching...
No Matches
FileChooserDialog Class Reference

A dialog designed to allow the user to navigate a filesytem and select or create one or more files or folders that match a criteria. More...

#include <FileChooserDialog.h>

Inheritance diagram for FileChooserDialog:
[legend]
Collaboration diagram for FileChooserDialog:
[legend]

Public Types

enum  DisplayMode { e_browser , e_recents , e_favorites }
 

Signals

void finishedSignal ()
 
void onCanceledSignal ()
 
void onFileChoosenSignal ()
 

Public Member Functions

TranslatedString actionName () const
 
void addToRecents (const Buffer< File > &files)
 
void addToRecents (const File &file)
 
void autoHideDialog (PopupInfo info=PopupInfo())
 
void autoShowDialog (PopupInfo info=PopupInfo())
 
void browseFile (PopupInfo popup_origin=PopupInfo())
 
const FilecurrentDirectory () const
 
bool event (QEvent *e) override
 
 FileChooserDialog (bool save_dialog=false, QWidget *parent=nullptr)
 
 FileChooserDialog (const File &ini_location, bool save_dialog=false, QWidget *parent=nullptr)
 
void finishReadingINI (INIFactory &factory) override
 
Buffer< FilegetSelected () const
 
const Buffer< FileRequest > & getSelectedRequests () const
 
bool isFolderBrowser () const
 
bool isSaveDialog () const
 
void prepareForINI (INIFactory &factory) override
 
const Buffer< UUID > & saveContent () const
 
void selectFileNameField ()
 
void setActionName (const TranslatedString &action_name)
 
void setAdditionalFavorites (Buffer< File > favorites)
 
void setAllowAny (bool allow_any)
 
void setCanReadCallback (const std::function< bool(const FileFormat &, const File &)> &callback)
 
void setCurrentDirectory (const File &current_directory)
 
void setCurrentExtension (const String &extension, bool update_format_to_first_match)
 
void setCurrentFile (const File &file)
 
void setCurrentFileName (const String &name)
 
void setFallbackDirectory (const File &file)
 
void setIconProvider (const std::function< String(const FileRequest &)> &icon_provider)
 
void setNativeParent (QWidget *native_parent)
 
void setOptions (const Buffer< FileFormat > &extensions, bool save_dialog)
 
void setSaveContent (const Buffer< UUID > &save_content)
 
void setShowRecents (bool show_recent)
 
void showAccessedTime (bool show_accessed_time)
 
bool showFavorites () const
 
void showFileSize (bool show_modified_time)
 
void showModifiedTime (bool show_modified_time)
 
void showRecents ()
 
bool showRecents () const
 
QSize sizeHint () const override
 
TranslatedString windowTitle () const
 
 ~FileChooserDialog ()
 
- Public Member Functions inherited from INIInterface
 INIInterface (const File &default_ini)
 
virtual bool readINIOptions ()
 
virtual bool readINIOptions (File &ini_file)
 
virtual bool saveINIOptions (bool multithead=false)
 
virtual bool saveINIOptions (File &ini_file, bool multithead=false)
 
void setDefaultINIFile (const File &file)
 
virtual void writeToLog (const String &title, ProgressInfo *log, uint01 log_level=2U)
 
virtual void writeToLog (ProgressInfo *log, uint01 log_level=2U)
 
virtual ~INIInterface ()
 

Protected Member Functions

void addItem (ButtonGallery *gallery, QCustomTableWidget *table, uint04 index, const File &item)
 
void autoSelectFavoritesItem ()
 
void browseFileNative ()
 
bool checkFileAgainstFilter (const File &file, const FileFormat &selected_format) const
 
void clearRecents ()
 
QWidget * createBottomPanel ()
 
QWidget * createfavoritesPanel ()
 
QWidget * createNavigationButtons ()
 
QWidget * createRequestWidget (File item)
 
const Buffer< File > & currentDirectoryFiles () const
 
FileFormat currentSelectedFormat () const
 
String extensionsString (const String &delimiter=";;") const
 
const Buffer< FilefavoriteFiles () const
 
Buffer< FilefilterFiles (const Buffer< File > &all_files) const
 
void finishBrowse ()
 
FileFormat getFileFormat (const File &file)
 
FileFormat getFileFormat (const QString &file, const QString &string) const
 
FileFormat getFileFormatFromExtension (const String &ext) const
 
void hidePopupDialog ()
 
void onFileChosen (File file)
 
void postResolveIcons ()
 
void removeFromRecents (File item)
 
void retranslate ()
 
void setIsFileChooser (bool is_file_chooser)
 
QWidget * settingsDialog ()
 
void setup ()
 
void SetupForBrowser ()
 
void SetupForFavorites ()
 
void updateBrowserWidgets ()
 
void updateGallery (Button *b)
 
void updateTableIconSize (QCustomTableWidget *table)
 

Protected Attributes

bool m_allow_any
 
bool m_neeeds_to_update = false
 
Buffer< FileRequestm_selected_files
 
- Protected Attributes inherited from INIInterface
File m_default_ini
 

Friends

class ImageCacheThread
 

Detailed Description

A dialog designed to allow the user to navigate a filesytem and select or create one or more files or folders that match a criteria.


Supports browsing the filesystem using a native dialog or in touch mode a touch-friendly dialog. Also supports favorites and recents when available.

Member Enumeration Documentation

◆ DisplayMode

Enumerator
e_browser 
e_recents 
e_favorites 

Constructor & Destructor Documentation

◆ FileChooserDialog() [1/2]

FileChooserDialog ( bool save_dialog = false,
QWidget * parent = nullptr )

◆ FileChooserDialog() [2/2]

FileChooserDialog ( const File & ini_location,
bool save_dialog = false,
QWidget * parent = nullptr )

◆ ~FileChooserDialog()

Member Function Documentation

◆ actionName()

TranslatedString actionName ( ) const

◆ addItem()

void addItem ( ButtonGallery * gallery,
QCustomTableWidget * table,
uint04 index,
const File & item )
protected

◆ addToRecents() [1/2]

void addToRecents ( const Buffer< File > & files)

◆ addToRecents() [2/2]

void addToRecents ( const File & file)

◆ autoHideDialog()

void autoHideDialog ( PopupInfo info = PopupInfo())

◆ autoSelectFavoritesItem()

void autoSelectFavoritesItem ( )
protected

◆ autoShowDialog()

void autoShowDialog ( PopupInfo info = PopupInfo())

◆ browseFile()

void browseFile ( PopupInfo popup_origin = PopupInfo())

◆ browseFileNative()

void browseFileNative ( )
protected

◆ checkFileAgainstFilter()

bool checkFileAgainstFilter ( const File & file,
const FileFormat & selected_format ) const
protected

◆ clearRecents()

void clearRecents ( )
protected

◆ createBottomPanel()

QWidget * createBottomPanel ( )
protected

◆ createfavoritesPanel()

QWidget * createfavoritesPanel ( )
protected

◆ createNavigationButtons()

QWidget * createNavigationButtons ( )
protected

◆ createRequestWidget()

QWidget * createRequestWidget ( File item)
protected

◆ currentDirectory()

const File & currentDirectory ( ) const
inline

◆ currentDirectoryFiles()

const Buffer< File > & currentDirectoryFiles ( ) const
protected

◆ currentSelectedFormat()

FileFormat currentSelectedFormat ( ) const
protected

◆ event()

bool event ( QEvent * e)
override

◆ extensionsString()

String extensionsString ( const String & delimiter = ";;") const
protected

◆ favoriteFiles()

const Buffer< File > favoriteFiles ( ) const
protected

◆ filterFiles()

Buffer< File > filterFiles ( const Buffer< File > & all_files) const
protected

◆ finishBrowse()

void finishBrowse ( )
protected

◆ finishedSignal

void finishedSignal ( )
signal

◆ finishReadingINI()

void finishReadingINI ( INIFactory & factory)
overridevirtual

Reimplemented from INIInterface.

◆ getFileFormat() [1/2]

FileFormat getFileFormat ( const File & file)
protected

◆ getFileFormat() [2/2]

FileFormat getFileFormat ( const QString & file,
const QString & string ) const
protected

◆ getFileFormatFromExtension()

FileFormat getFileFormatFromExtension ( const String & ext) const
protected

◆ getSelected()

Buffer< File > getSelected ( ) const

◆ getSelectedRequests()

const Buffer< FileRequest > & getSelectedRequests ( ) const

◆ hidePopupDialog()

void hidePopupDialog ( )
protected

◆ isFolderBrowser()

bool isFolderBrowser ( ) const

◆ isSaveDialog()

bool isSaveDialog ( ) const
inline

◆ onCanceledSignal

void onCanceledSignal ( )
signal

◆ onFileChoosenSignal

void onFileChoosenSignal ( )
signal

◆ onFileChosen()

void onFileChosen ( File file)
protected

◆ postResolveIcons()

void postResolveIcons ( )
protected

◆ prepareForINI()

void prepareForINI ( INIFactory & factory)
overridevirtual

Reimplemented from INIInterface.

◆ removeFromRecents()

void removeFromRecents ( File item)
protected

◆ retranslate()

void retranslate ( )
protected

◆ saveContent()

const Buffer< UUID > & saveContent ( ) const
inline

◆ selectFileNameField()

void selectFileNameField ( )

◆ setActionName()

void setActionName ( const TranslatedString & action_name)

◆ setAdditionalFavorites()

void setAdditionalFavorites ( Buffer< File > favorites)

◆ setAllowAny()

void setAllowAny ( bool allow_any)
inline

◆ setCanReadCallback()

void setCanReadCallback ( const std::function< bool(const FileFormat &, const File &)> & callback)

◆ setCurrentDirectory()

void setCurrentDirectory ( const File & current_directory)

◆ setCurrentExtension()

void setCurrentExtension ( const String & extension,
bool update_format_to_first_match )

◆ setCurrentFile()

void setCurrentFile ( const File & file)

◆ setCurrentFileName()

void setCurrentFileName ( const String & name)

◆ setFallbackDirectory()

void setFallbackDirectory ( const File & file)

◆ setIconProvider()

void setIconProvider ( const std::function< String(const FileRequest &)> & icon_provider)

◆ setIsFileChooser()

void setIsFileChooser ( bool is_file_chooser)
protected

◆ setNativeParent()

void setNativeParent ( QWidget * native_parent)

◆ setOptions()

void setOptions ( const Buffer< FileFormat > & extensions,
bool save_dialog )

◆ setSaveContent()

void setSaveContent ( const Buffer< UUID > & save_content)
inline

◆ setShowRecents()

void setShowRecents ( bool show_recent)

◆ settingsDialog()

QWidget * settingsDialog ( )
protected

◆ setup()

void setup ( )
protected

◆ SetupForBrowser()

void SetupForBrowser ( )
protected

◆ SetupForFavorites()

void SetupForFavorites ( )
protected

◆ showAccessedTime()

void showAccessedTime ( bool show_accessed_time)

◆ showFavorites()

bool showFavorites ( ) const

◆ showFileSize()

void showFileSize ( bool show_modified_time)

◆ showModifiedTime()

void showModifiedTime ( bool show_modified_time)

◆ showRecents() [1/2]

void showRecents ( )

◆ showRecents() [2/2]

bool showRecents ( ) const
inline

◆ sizeHint()

QSize sizeHint ( ) const
override

◆ updateBrowserWidgets()

void updateBrowserWidgets ( )
protected

◆ updateGallery()

void updateGallery ( Button * b)
protected

◆ updateTableIconSize()

void updateTableIconSize ( QCustomTableWidget * table)
protected

◆ windowTitle()

TranslatedString windowTitle ( ) const

Friends And Related Symbol Documentation

◆ ImageCacheThread

friend class ImageCacheThread
friend

Member Data Documentation

◆ m_allow_any

bool m_allow_any
protected

◆ m_neeeds_to_update

bool m_neeeds_to_update = false
protected

◆ m_selected_files

Buffer<FileRequest> m_selected_files
protected

The documentation for this class was generated from the following file: