43 #ifndef FILEPICKER_HH_ 44 #define FILEPICKER_HH_ 46 #include <OpenFlipper/common/RecentFiles.hh> 51 #include <QPushButton> 56 Q_PROPERTY(QString recent_files_ini_key
57 READ recent_files_ini_key
58 WRITE set_recent_files_ini_key)
59 Q_PROPERTY(QString dialog_title
61 WRITE set_dialog_title)
62 Q_PROPERTY(QString file_filter
64 WRITE set_file_filter)
65 Q_PROPERTY(DialogType dialog_type
67 WRITE set_dialog_type)
68 Q_PROPERTY(QString current_file_name
69 READ current_file_name
70 WRITE set_current_file_name)
75 DT_OPEN_FILE = OpenFlipper::Options::DT_OPEN,
76 DT_SAVE_FILE = OpenFlipper::Options::DT_SAVE,
77 DT_CHOOSE_PATH = OpenFlipper::Options::DT_CHOOSE_PATH
81 explicit FilePicker(QString recent_files_ini_key,
82 DialogType dialog_type,
86 QString current_file_name() {
87 return textBox_->currentText();
90 void set_current_file_name(QString value) {
91 return textBox_->lineEdit()->setText(value);
95 QString currentFileName() {
96 return current_file_name();
99 QString recent_files_ini_key() {
return recent_files_ini_key_; }
100 void set_recent_files_ini_key(QString value);
102 QString dialog_title() {
return dialog_title_; }
103 void set_dialog_title(QString value) {
104 dialog_title_ = value;
107 QString file_filter() {
return file_filter_; }
108 void set_file_filter(QString value) {
109 file_filter_ = value;
112 DialogType dialog_type() {
return dialog_type_; }
113 void set_dialog_type(DialogType value) {
114 dialog_type_ = value;
117 bool overwrite_confirmed_by_user() {
118 return overwrite_confirmed_by_user_;
122 bool confirm_overwrite_if_necessary();
133 QPushButton *browseButton_;
134 QString recent_files_ini_key_;
135 QString dialog_title_;
136 QString file_filter_;
137 DialogType dialog_type_;
138 bool overwrite_confirmed_by_user_;