[gnome-text-editor] preferences: remove preferences window



commit b413feb1acf54e6bbc802d708a9a5eb00d44ea1f
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jul 29 17:22:04 2021 -0700

    preferences: remove preferences window
    
    This is now part of EditorWindow and is no longer needed from the
    standpoint of a dedicated window.
    
    Related #79

 src/editor-application-actions.c       | 35 -------------
 src/editor-preferences-window.c        | 94 ----------------------------------
 src/editor-preferences-window.h        | 33 ------------
 src/editor-preferences-window.ui       | 65 -----------------------
 src/meson.build                        |  1 -
 src/org.gnome.TextEditor.gresource.xml |  1 -
 6 files changed, 229 deletions(-)
---
diff --git a/src/editor-application-actions.c b/src/editor-application-actions.c
index efd3231..a6a6fa1 100644
--- a/src/editor-application-actions.c
+++ b/src/editor-application-actions.c
@@ -27,7 +27,6 @@
 
 #include "editor-application-private.h"
 #include "editor-page.h"
-#include "editor-preferences-window.h"
 #include "editor-save-changes-dialog-private.h"
 #include "editor-session-private.h"
 #include "editor-window.h"
@@ -45,39 +44,6 @@ static const gchar *artists[] = {
   NULL
 };
 
-static void
-editor_application_actions_preferences_cb (GSimpleAction *action,
-                                           GVariant      *param,
-                                           gpointer       user_data)
-{
-  EditorApplication *self = user_data;
-  EditorPreferencesWindow *prefs;
-  EditorWindow *active = NULL;
-  GList *windows;
-
-  g_assert (EDITOR_IS_APPLICATION (self));
-
-  windows = gtk_application_get_windows (GTK_APPLICATION (self));
-
-  for (const GList *iter = windows; iter; iter = iter->next)
-    {
-      GtkWindow *window = iter->data;
-
-      if (active == NULL && EDITOR_IS_WINDOW (window))
-        active = EDITOR_WINDOW (window);
-
-      if (EDITOR_IS_PREFERENCES_WINDOW (window))
-        {
-          gtk_window_present (window);
-          return;
-        }
-    }
-
-  prefs = editor_preferences_window_new (self);
-  gtk_window_set_transient_for (GTK_WINDOW (prefs), GTK_WINDOW (active));
-  gtk_window_present (GTK_WINDOW (prefs));
-}
-
 static void
 editor_application_actions_new_window_cb (GSimpleAction *action,
                                           GVariant      *param,
@@ -233,7 +199,6 @@ _editor_application_actions_init (EditorApplication *self)
 {
   static const GActionEntry actions[] = {
     { "new-window", editor_application_actions_new_window_cb },
-    { "preferences", editor_application_actions_preferences_cb },
     { "about", editor_application_actions_about_cb },
     { "help", editor_application_actions_help_cb },
     { "quit", editor_application_actions_quit },
diff --git a/src/meson.build b/src/meson.build
index a11eab6..460c5b7 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -24,7 +24,6 @@ editor_sources = [
   'editor-preferences-radio.c',
   'editor-preferences-spin.c',
   'editor-preferences-switch.c',
-  'editor-preferences-window.c',
   'editor-print-operation.c',
   'editor-save-changes-dialog.c',
   'editor-search-bar.c',
diff --git a/src/org.gnome.TextEditor.gresource.xml b/src/org.gnome.TextEditor.gresource.xml
index 263cc9a..4c5240f 100644
--- a/src/org.gnome.TextEditor.gresource.xml
+++ b/src/org.gnome.TextEditor.gresource.xml
@@ -7,7 +7,6 @@
     <file preprocess="xml-stripblanks">editor-open-popover.ui</file>
     <file preprocess="xml-stripblanks">editor-page.ui</file>
     <file preprocess="xml-stripblanks">editor-position-label.ui</file>
-    <file preprocess="xml-stripblanks">editor-preferences-window.ui</file>
     <file preprocess="xml-stripblanks">editor-search-bar.ui</file>
     <file preprocess="xml-stripblanks">editor-sidebar-row.ui</file>
     <file preprocess="xml-stripblanks">editor-sidebar.ui</file>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]