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

#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 onFileChoosenSignal ()
 
void onCanceledSignal ()
 

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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

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

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 files: