[gedit/zbrown/deteplification-src: 369/633] FileChooserDialog: keep only the SAVE and OPEN flags
- From: Zander Brown <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/zbrown/deteplification-src: 369/633] FileChooserDialog: keep only the SAVE and OPEN flags
- Date: Sat, 10 Apr 2021 12:48:03 +0000 (UTC)
commit 335fd5126dae8eb7ea5bdc9346e574ebbd156c5c
Author: Sébastien Wilmet <swilmet gnome org>
Date: Thu Jun 4 22:55:40 2020 +0200
FileChooserDialog: keep only the SAVE and OPEN flags
GEDIT_FILE_CHOOSER_ENABLE_LINE_ENDING was set only when
GEDIT_FILE_CHOOSER_SAVE is set.
gedit/gedit-commands-file.c | 3 +--
gedit/gedit-file-chooser-dialog-gtk.c | 6 +-----
gedit/gedit-file-chooser-dialog-osx.m | 8 +-------
gedit/gedit-file-chooser-dialog.h | 5 ++---
4 files changed, 5 insertions(+), 17 deletions(-)
---
diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c
index 9d843dbf5..2a52ba67e 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -842,8 +842,7 @@ save_as_tab_async (GeditTab *tab,
/* Translators: "Save As" is the title of the file chooser window. */
save_dialog = gedit_file_chooser_dialog_create (C_("window title", "Save As"),
GTK_WINDOW (window),
- GEDIT_FILE_CHOOSER_SAVE |
- GEDIT_FILE_CHOOSER_ENABLE_LINE_ENDING,
+ GEDIT_FILE_CHOOSER_SAVE,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Save"), GTK_RESPONSE_OK);
diff --git a/gedit/gedit-file-chooser-dialog-gtk.c b/gedit/gedit-file-chooser-dialog-gtk.c
index 2e76f0a0f..6371683d4 100644
--- a/gedit/gedit-file-chooser-dialog-gtk.c
+++ b/gedit/gedit-file-chooser-dialog-gtk.c
@@ -420,16 +420,12 @@ static void
create_extra_widget (GeditFileChooserDialogGtk *dialog,
GeditFileChooserFlags flags)
{
- gboolean needs_line_ending;
-
- needs_line_ending = (flags & GEDIT_FILE_CHOOSER_ENABLE_LINE_ENDING) != 0;
-
dialog->extra_widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_widget_show (dialog->extra_widget);
create_option_menu (dialog, flags);
- if (needs_line_ending)
+ if ((flags & GEDIT_FILE_CHOOSER_SAVE) != 0)
{
create_newline_combo (dialog);
}
diff --git a/gedit/gedit-file-chooser-dialog-osx.m b/gedit/gedit-file-chooser-dialog-osx.m
index 1443332c9..0c6287066 100644
--- a/gedit/gedit-file-chooser-dialog-osx.m
+++ b/gedit/gedit-file-chooser-dialog-osx.m
@@ -660,22 +660,16 @@ create_newline_combo (GeditFileChooserDialogOSX *dialog,
static void
create_extra_widget (GeditFileChooserDialogOSX *dialog)
{
- gboolean needs_line_ending;
- GeditFileChooserFlags flags;
NSSize size;
NSView *parent;
NSView *container;
gint minw = 0;
- flags = dialog->flags;
-
- needs_line_ending = (flags & GEDIT_FILE_CHOOSER_ENABLE_LINE_ENDING) != 0;
-
container = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 400, 30)];
minw += create_encoding_combo (dialog, container);
- if (needs_line_ending)
+ if ((dialog->flags & GEDIT_FILE_CHOOSER_SAVE) != 0)
{
minw += create_newline_combo (dialog, container);
}
diff --git a/gedit/gedit-file-chooser-dialog.h b/gedit/gedit-file-chooser-dialog.h
index 5815709e7..57d6e9d35 100644
--- a/gedit/gedit-file-chooser-dialog.h
+++ b/gedit/gedit-file-chooser-dialog.h
@@ -82,9 +82,8 @@ struct _GeditFileChooserDialogInterface
typedef enum
{
- GEDIT_FILE_CHOOSER_SAVE = 1 << 0,
- GEDIT_FILE_CHOOSER_OPEN = 1 << 1,
- GEDIT_FILE_CHOOSER_ENABLE_LINE_ENDING = 1 << 2
+ GEDIT_FILE_CHOOSER_SAVE = 1 << 0,
+ GEDIT_FILE_CHOOSER_OPEN = 1 << 1
} GeditFileChooserFlags;
GeditFileChooserDialog *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]