Skip to content
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

[GTK4] Migrate FileDialog to new GTK FileDialog API #1482

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ptziegler
Copy link
Contributor

The FileChooser API has been marked as deprecated with GTK 4.10 and replaced by the FileDialog API. With this contribution, this old API has now been limited to GTK3.

Following methods have been added to OS.java:

  • g_list_store_new
  • g_list_store_append

Following methods have been moved from GTK.java to GTK3.java:

  • gtk_file_chooser_add_filter
  • gtk_file_chooser_get_filter
  • gtk_file_chooser_set_current_name
  • gtk_file_chooser_set_filter
  • gtk_file_chooser_set_select_multiple
  • gtk_file_chooser_native_new

Following constant has been added to GTK.java:

  • GTK_TYPE_FILE_FILTER

Following methods have been removed from GTK4.java:

  • gtk_file_chooser_get_files
  • gtk_file_chooser_get_file
  • gtk_file_chooser_set_current_folder
  • gtk_file_chooser_set_file

Following methods have been added to GTK4.java:

  • gtk_file_dialog_set_initial_name
  • gtk_file_dialog_set_initial_file
  • gtk_file_dialog_set_title
  • gtk_file_dialog_set_default_filter
  • gtk_file_dialog_set_filters
  • gtk_file_dialog_get_default_filter
  • gtk_file_dialog_open_multiple
  • gtk_file_dialog_open_multiple_finish
  • gtk_file_dialog_open
  • gtk_file_dialog_open_finish
  • gtk_file_dialog_save
  • gtk_file_dialog_save_finish

This commit also amends an oversight from
2e61b4b where the title of the directory dialog was no longer set.

Contributes to:
#652

@ptziegler
Copy link
Contributor Author

Open Dialog (GTK3)
OpenDialog_gtk3

Open Dialog (GTK4)
OpenDialog_gtk4

Save Dialog (GTK3)
SaveDialog_gtk3

Save Dialog (GTK4)
SaveDialog_gtk4

Copy link
Contributor

github-actions bot commented Sep 21, 2024

Test Results

   486 files  ±0     486 suites  ±0   7m 37s ⏱️ -40s
 4 158 tests ±0   4 150 ✅ ±0   8 💤 ±0  0 ❌ ±0 
16 386 runs  ±0  16 294 ✅ ±0  92 💤 ±0  0 ❌ ±0 

Results for commit 31a81f1. ± Comparison against base commit 3c8ed8e.

♻️ This comment has been updated with latest results.

@ptziegler
Copy link
Contributor Author

ptziegler commented Sep 21, 2024

The Mac crash is probably unrelated? And for GTK3, I seem to require a GTK3_LOAD_FUNCTION macro.

I'm not exactly sure how it plays into SWT, but couldn't I simply copy the macro?

#define GTK_LOAD_FUNCTION(var, name) LOAD_FUNCTION_LIB(var, LIB_GTK, name)

The FileChooser API has been marked as deprecated with GTK 4.10 and
replaced by the FileDialog API. With this contribution, this old API has
now been limited to GTK3.

Following methods have been added to OS.java:

- g_list_store_new
- g_list_store_append

Following methods have been moved from GTK.java to GTK3.java:

- gtk_file_chooser_add_filter
- gtk_file_chooser_get_filter
- gtk_file_chooser_set_current_name
- gtk_file_chooser_set_filter
- gtk_file_chooser_set_select_multiple
- gtk_file_chooser_native_new

Following constant has been added to GTK.java:

- GTK_TYPE_FILE_FILTER

Following methods have been removed from GTK4.java:

- gtk_file_chooser_get_files
- gtk_file_chooser_get_file
- gtk_file_chooser_set_current_folder
- gtk_file_chooser_set_file

Following methods have been added to GTK4.java:

- gtk_file_dialog_set_initial_name
- gtk_file_dialog_set_initial_file
- gtk_file_dialog_set_title
- gtk_file_dialog_set_default_filter
- gtk_file_dialog_set_filters
- gtk_file_dialog_get_default_filter
- gtk_file_dialog_open_multiple
- gtk_file_dialog_open_multiple_finish
- gtk_file_dialog_open
- gtk_file_dialog_open_finish
- gtk_file_dialog_save
- gtk_file_dialog_save_finish

This commit also amends an oversight from
2e61b4b where the title of the
directory dialog was no longer set.

Contributes to:
eclipse-platform#652
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant