[gedit/zbrown/deteplification-src: 411/633] FileChooserDialogOSX: remove it, use the Gtk one on macOS
- From: Zander Brown <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/zbrown/deteplification-src: 411/633] FileChooserDialogOSX: remove it, use the Gtk one on macOS
- Date: Sat, 10 Apr 2021 12:48:05 +0000 (UTC)
commit 10b728c767a09d4a104414255d53d847a766cad9
Author: Sébastien Wilmet <swilmet gnome org>
Date: Tue Jun 9 23:30:27 2020 +0200
FileChooserDialogOSX: remove it, use the Gtk one on macOS
Ideally gedit should use GtkFileChooserNative in all situations.
GtkFileChooserNative has an implementation for macOS, probably similar
to what Jesse implemented for gedit with GeditFileChooserDialogOSX.
Unfortunately GtkFileChooserNative for macOS currently lacks support for
the new 'choice' API (gtk_file_chooser_add_choice() etc), see:
https://gitlab.gnome.org/GNOME/gtk/-/issues/1983
And when using GtkFileChooserNative, gedit needs to use the 'choice'
API.
In any case, we want to migrate gedit to GtkFileChooserNative
(gradually). Even if we don't enable GtkFileChooserNative everywhere,
the fact that it will be enabled on some platforms means that we will
have the code ready for GtkFileChooserNative.
One thing that I've started to do is to split the Open case from the
Save As case, to not mix the two in the same source file (with common
code in gedit-file-chooser.c), to hopefully have clearer code. Which
means: getting rid of the GeditFileChooserDialog interface (which mixes
the two cases).
It *would* be possible to keep GeditFileChooserDialogOSX and
GeditFileChooserDialog, just removing GeditFileChooserDialogGtk, and
implement the GeditFileChooserOpen/Save interfaces by using
GeditFileChooserDialog. But I would not be able to test it, I don't have
a mac machine.
Long story short, on macOS it's GtkFileChooserDialog that will be used,
like it was the case for gedit pre-2014.
gedit/gedit-file-chooser-dialog-osx.h | 46 --
gedit/gedit-file-chooser-dialog-osx.m | 934 ----------------------------------
gedit/gedit-file-chooser-dialog.c | 14 -
gedit/meson.build | 2 -
po/POTFILES.in | 1 -
5 files changed, 997 deletions(-)
---
diff --git a/gedit/gedit-file-chooser-dialog.c b/gedit/gedit-file-chooser-dialog.c
index 6ded06e30..b009e45f0 100644
--- a/gedit/gedit-file-chooser-dialog.c
+++ b/gedit/gedit-file-chooser-dialog.c
@@ -19,14 +19,8 @@
*/
#include "config.h"
-
#include "gedit-file-chooser-dialog.h"
-
-#ifdef OS_OSX
-#include "gedit-file-chooser-dialog-osx.h"
-#else
#include "gedit-file-chooser-dialog-gtk.h"
-#endif
G_DEFINE_INTERFACE (GeditFileChooserDialog, gedit_file_chooser_dialog, G_TYPE_OBJECT)
@@ -74,19 +68,11 @@ gedit_file_chooser_dialog_create (const gchar *title,
const gchar *accept_label,
const gchar *cancel_label)
{
-#ifdef OS_OSX
- return gedit_file_chooser_dialog_osx_create (title,
- parent,
- flags,
- accept_label,
- cancel_label);
-#else
return gedit_file_chooser_dialog_gtk_create (title,
parent,
flags,
accept_label,
cancel_label);
-#endif
}
void
diff --git a/gedit/meson.build b/gedit/meson.build
index f04767a30..9832165f2 100644
--- a/gedit/meson.build
+++ b/gedit/meson.build
@@ -50,7 +50,6 @@ libgedit_private_headers = [
'gedit-encodings-dialog.h',
'gedit-file-chooser-dialog-gtk.h',
'gedit-file-chooser-dialog.h',
- 'gedit-file-chooser-dialog-osx.h',
'gedit-file-chooser.h',
'gedit-file-chooser-open.h',
'gedit-highlight-mode-dialog.h',
@@ -138,7 +137,6 @@ libgedit_deps = [
if host_machine.system() == 'darwin'
libgedit_private_sources += [
'gedit-app-osx.m',
- 'gedit-file-chooser-dialog-osx.m',
]
libgedit_c_args += [
'-DOS_OSX=1',
diff --git a/po/POTFILES.in b/po/POTFILES.in
index e06ee67c0..c0492609c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -18,7 +18,6 @@ gedit/gedit-encoding-items.c
gedit/gedit-encodings-dialog.c
gedit/gedit-file-chooser.c
gedit/gedit-file-chooser-dialog-gtk.c
-gedit/gedit-file-chooser-dialog-osx.m
gedit/gedit-file-chooser-open-adapter.c
gedit/gedit-file-chooser-open.c
gedit/gedit-highlight-mode-dialog.c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]