Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
3731ef29
Commit
3731ef29
authored
Nov 26, 2018
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QT: Replaced broken QFileDialog::getOpenFileName().
parent
513b6105
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
15 deletions
+14
-15
xtt/lib/cow/qt/cow_wow_qt.cqt
xtt/lib/cow/qt/cow_wow_qt.cqt
+14
-15
No files found.
xtt/lib/cow/qt/cow_wow_qt.cqt
View file @
3731ef29
...
...
@@ -486,40 +486,39 @@ void CoWowQt::CreateFileSelDia(const char* title, void* parent_ctx,
void (*file_selected_cb)(void*, char*, wow_eFileSelType),
wow_eFileSelType file_type)
{
pwr_tFileName fname;
QFileDialog dialog(object->parent_wid);
pwr_tFileName folder;
QString filter;
if (file_type == wow_eFileSelType_Dbs) {
dcli_translate_filename(folder, "$pwrp_load");
filter = "
*.dbs
";
filter = "
Database files (*.dbs)
";
} else if (file_type == wow_eFileSelType_Wbl) {
dcli_translate_filename(folder, "$pwrp_db");
filter = "
*.wb_load, *.wb_dmp
;;All Files (*)";
filter = "
Workbench loadfiles(*.wb_load, *.wb_dmp)
;;All Files (*)";
} else if (file_type == wow_eFileSelType_Graph) {
dcli_translate_filename(folder, "$pwrp_pop");
filter = "
*.pwg
";
filter = "
Graphs (*.pwg)
";
} else if (file_type == wow_eFileSelType_ColorTheme) {
dcli_translate_filename(folder, "$pwrp_pop");
filter = "
*.pwgc
";
filter = "
Color themes (*.pwgc)
";
} else if (file_type == wow_eFileSelType_Image) {
dcli_translate_filename(folder, "$pwrp_pop");
filter = "
*.png,*.jpg,*.gif,*.svg
;;All Files (*)";
filter = "
Images (*.png,*.jpg,*.gif,*.svg)
;;All Files (*)";
} else if (file_type == wow_eFileSelType_History) {
dcli_translate_filename(folder, "~");
filter = "
*.txt,*.csv,*.skv
;;All Files (*)";
filter = "
History files (*.txt,*.csv,*.skv)
;;All Files (*)";
} else if (file_type == wow_eFileSelType_Backup) {
dcli_translate_filename(folder, "$pwrp_load");
filter = "
*.bck
;;All Files (*)";
filter = "
Backup files (*.bck)
;;All Files (*)";
}
QString filename = QFileDialog::getOpenFileName(
object->parent_wid, fl(title), fl(folder), filter);
// QFileDialog::getOpenFileName() is broken
QFileDialog dialog(object->parent_wid, fl(title), fl(folder), filter);
dialog.setFileMode(QFileDialog::ExistingFile);
int sts = dialog.exec();
if (!filename.isEmpty()) {
strcpy(fname, qPrintable(filename));
if (sts == QDialog::Accepted && dialog.selectedFiles().length() > 0) {
pwr_tFileName fname;
strcpy(fname, qPrintable(dialog.selectedFiles().first()));
if (file_selected_cb) {
(file_selected_cb)(parent_ctx, fname, file_type);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment