[GB.GTK]
* BUG: Dialog.SaveFile() now uses the Dialog.Path property the same way as the gb.form.dialog component. [GB.QT4] * BUG: Dialog.SaveFile() now uses the Dialog.Path property the same way as the gb.form.dialog component. git-svn-id: svn://localhost/gambas/trunk@5893 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
690b7f56ba
commit
3503f80e66
2 changed files with 16 additions and 2 deletions
|
@ -505,7 +505,7 @@ bool gDialog::saveFile()
|
|||
|
||||
if (DIALOG_path)
|
||||
{
|
||||
if (g_file_test(DIALOG_path, G_FILE_TEST_IS_DIR))
|
||||
if (DIALOG_path[strlen(DIALOG_path) - 1] == '/' && g_file_test(DIALOG_path, G_FILE_TEST_IS_DIR))
|
||||
gtk_file_chooser_set_current_folder((GtkFileChooser*)msg, DIALOG_path);
|
||||
else
|
||||
gtk_file_chooser_select_filename((GtkFileChooser*)msg, DIALOG_path);
|
||||
|
|
|
@ -188,7 +188,21 @@ static QStringList my_getOpenFileNames()
|
|||
|
||||
static QString my_getSaveFileName()
|
||||
{
|
||||
QFileDialog dialog(qApp->activeWindow(), dialog_title, dialog_path, get_filter());
|
||||
QString dir, file;
|
||||
|
||||
dir = dialog_path;
|
||||
if (!dialog_path.endsWith('/'))
|
||||
{
|
||||
int pos = dialog_path.lastIndexOf('/');
|
||||
if (pos >= 0)
|
||||
{
|
||||
dir = dialog_path.left(pos);
|
||||
file = dialog_path.mid(pos + 1);
|
||||
}
|
||||
}
|
||||
|
||||
QFileDialog dialog(qApp->activeWindow(), dialog_title, dir, get_filter());
|
||||
dialog.selectFile(file);
|
||||
|
||||
dialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
dialog.setMode(QFileDialog::AnyFile);
|
||||
|
|
Loading…
Reference in a new issue