Skip to content

Replace deprecated Gtk.FileChooser by FileDialog #2320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 30, 2023
Merged

Replace deprecated Gtk.FileChooser by FileDialog #2320

merged 6 commits into from
Dec 30, 2023

Conversation

amolenaar
Copy link
Member

@amolenaar amolenaar commented May 22, 2023

PR Type

What kind of change does this PR introduce?

  • Bug fix
  • Feature
  • Chore (refactoring, formatting, local variables, other cleanup)
  • Documentation content changes

What is the current behavior?

Issue Number: #2231

What is the new behavior?

Use the modern FileDialog API.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Not sure if it's still using the native dialogs on Windows and macOS.

Gtk.FileDialog is introduced in GTK 4.10. We're still building on 4.6 (Ubuntu 22.04).
I think we can wait until we have GTK 4.10+ available on our build machines.

@github-actions github-actions bot added the python Pull requests that update Python code label May 22, 2023
@danyeaw
Copy link
Member

danyeaw commented May 26, 2023

I wonder if we could use the flatpak environment to run the test suite 🤔

@amolenaar
Copy link
Member Author

It would still be good to build it on a normal machine. We could use a Fedor container, but that would pose other challenges.

@amolenaar amolenaar changed the title Replace deprecated FileChooser by Filedialog Replace deprecated Gtk.FileChooser by FileDialog May 30, 2023
@danyeaw danyeaw mentioned this pull request Oct 14, 2023
8 tasks
@github-actions github-actions bot added the translation Everything regarding translation, localization, and internationalization label Nov 17, 2023
@danyeaw danyeaw added chore Maintenance related PR and removed python Pull requests that update Python code translation Everything regarding translation, localization, and internationalization labels Dec 4, 2023
@github-actions github-actions bot added python Pull requests that update Python code translation Everything regarding translation, localization, and internationalization labels Dec 12, 2023
@amolenaar amolenaar requested review from danyeaw and sz332 December 12, 2023 15:26
@danyeaw
Copy link
Member

danyeaw commented Dec 13, 2023

Hi @amolenaar, I went to Save As, then clicked Cancel and got the following traceback:

Traceback (most recent call last):
  File "/home/dan/Projects/gaphor/gaphor/ui/filedialog.py", line 85, in response
    filename = Path(dialog.save_finish(result).get_path())
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
gi.repository.GLib.GError: gtk-dialog-error-quark: Dismissed by user (2)

@amolenaar amolenaar mentioned this pull request Dec 21, 2023
3 tasks
@amolenaar
Copy link
Member Author

@danyeaw Fixed the issue with the cancel button.

@danyeaw
Copy link
Member

danyeaw commented Dec 27, 2023

@amolenaar Do you know why these tests are failing?

@amolenaar
Copy link
Member Author

Sorry, I should've run them before I committed 😨 .

@danyeaw danyeaw removed python Pull requests that update Python code translation Everything regarding translation, localization, and internationalization labels Dec 30, 2023
Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @amolenaar, this is a great upgrade!

@danyeaw danyeaw merged commit 31956c9 into main Dec 30, 2023
@danyeaw danyeaw deleted the filedialog branch December 30, 2023 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance related PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants