57 #ifndef FILEPICKER_HH_
58 #define FILEPICKER_HH_
60 #include <OpenFlipper/common/RecentFiles.hh>
65 #include <QPushButton>
70 Q_PROPERTY(QString recent_files_ini_key
71 READ recent_files_ini_key
72 WRITE set_recent_files_ini_key)
73 Q_PROPERTY(QString dialog_title
75 WRITE set_dialog_title)
76 Q_PROPERTY(QString file_filter
78 WRITE set_file_filter)
79 Q_PROPERTY(DialogType dialog_type
81 WRITE set_dialog_type)
82 Q_PROPERTY(QString current_file_name
83 READ current_file_name
84 WRITE set_current_file_name)
89 DT_OPEN_FILE = OpenFlipper::Options::DT_OPEN,
90 DT_SAVE_FILE = OpenFlipper::Options::DT_SAVE,
91 DT_CHOOSE_PATH = OpenFlipper::Options::DT_CHOOSE_PATH
95 explicit FilePicker(QString recent_files_ini_key,
96 DialogType dialog_type,
100 QString current_file_name() {
101 return textBox_->currentText();
104 void set_current_file_name(QString value) {
105 return textBox_->lineEdit()->setText(value);
109 QString currentFileName() {
110 return current_file_name();
113 QString recent_files_ini_key() {
return recent_files_ini_key_; }
114 void set_recent_files_ini_key(QString value);
116 QString dialog_title() {
return dialog_title_; }
117 void set_dialog_title(QString value) {
118 dialog_title_ = value;
121 QString file_filter() {
return file_filter_; }
122 void set_file_filter(QString value) {
123 file_filter_ = value;
126 DialogType dialog_type() {
return dialog_type_; }
127 void set_dialog_type(DialogType value) {
128 dialog_type_ = value;
131 bool overwrite_confirmed_by_user() {
132 return overwrite_confirmed_by_user_;
136 bool confirm_overwrite_if_necessary();
147 QPushButton *browseButton_;
148 QString recent_files_ini_key_;
149 QString dialog_title_;
150 QString file_filter_;
151 DialogType dialog_type_;
152 bool overwrite_confirmed_by_user_;