[gnome-builder/wip/gtk4-port: 1536/1774] plugins/buildui: remove dead code




commit 40c3646aaaaf22a7bad1481ef963147118bc7a29
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jun 15 18:03:10 2022 -0700

    plugins/buildui: remove dead code
    
    We instead went ahead and did this in the preferences dialog, rather than
    from the runnables dialog, which wouldn't allow for global settings.

 src/plugins/buildui/gbp-buildui-runnables-dialog.c |  44 -----
 .../buildui/gbp-buildui-runnables-dialog.ui        | 219 ---------------------
 2 files changed, 263 deletions(-)
---
diff --git a/src/plugins/buildui/gbp-buildui-runnables-dialog.c 
b/src/plugins/buildui/gbp-buildui-runnables-dialog.c
index d73bcf3ff..d095cb654 100644
--- a/src/plugins/buildui/gbp-buildui-runnables-dialog.c
+++ b/src/plugins/buildui/gbp-buildui-runnables-dialog.c
@@ -156,45 +156,6 @@ gbp_buildui_runnables_dialog_list_commands_cb (GObject      *object,
   IDE_EXIT;
 }
 
-static void
-gbp_buildui_runnables_dialog_set_page (GbpBuilduiRunnablesDialog *self,
-                                       const char                *page)
-{
-  g_assert (GBP_IS_BUILDUI_RUNNABLES_DIALOG (self));
-  g_assert (page != NULL);
-
-  gtk_stack_set_visible_child_name (self->stack, page);
-}
-
-static void
-new_run_command_action (GtkWidget  *widget,
-                        const char *action_name,
-                        GVariant   *param)
-{
-  GbpBuilduiRunnablesDialog *self = (GbpBuilduiRunnablesDialog *)widget;
-  IdeWorkspace *workspace;
-
-  IDE_ENTRY;
-
-  g_assert (GBP_IS_BUILDUI_RUNNABLES_DIALOG (self));
-
-  workspace = ide_widget_get_workspace (GTK_WIDGET (self));
-  gtk_widget_activate_action (GTK_WIDGET (workspace),
-                              "workbench.configure-page",
-                              "s", "commands");
-  gtk_window_destroy (GTK_WINDOW (self));
-
-  IDE_EXIT;
-}
-
-static void
-list_run_command_action (GtkWidget  *widget,
-                         const char *action_name,
-                         GVariant   *param)
-{
-  gbp_buildui_runnables_dialog_set_page (GBP_BUILDUI_RUNNABLES_DIALOG (widget), "list");
-}
-
 static void
 gbp_buildui_runnables_dialog_set_context (GbpBuilduiRunnablesDialog *self,
                                           IdeContext                *context)
@@ -284,9 +245,6 @@ gbp_buildui_runnables_dialog_class_init (GbpBuilduiRunnablesDialogClass *klass)
 
   g_object_class_install_properties (object_class, N_PROPS, properties);
 
-  gtk_widget_class_install_action (widget_class, "run-command.new", NULL, new_run_command_action);
-  gtk_widget_class_install_action (widget_class, "run-command.list", NULL, list_run_command_action);
-
   gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Escape, 0, "window.close", NULL);
 
   gtk_widget_class_set_template_from_resource (widget_class, 
"/plugins/buildui/gbp-buildui-runnables-dialog.ui");
@@ -305,6 +263,4 @@ gbp_buildui_runnables_dialog_init (GbpBuilduiRunnablesDialog *self)
 #ifdef DEVELOPMENT_BUILD
   gtk_widget_add_css_class (GTK_WIDGET (self), "devel");
 #endif
-
-  gbp_buildui_runnables_dialog_set_page (self, "list");
 }
diff --git a/src/plugins/buildui/gbp-buildui-runnables-dialog.ui 
b/src/plugins/buildui/gbp-buildui-runnables-dialog.ui
index 81d148186..4c371c4f6 100644
--- a/src/plugins/buildui/gbp-buildui-runnables-dialog.ui
+++ b/src/plugins/buildui/gbp-buildui-runnables-dialog.ui
@@ -80,226 +80,7 @@
             </property>
           </object>
         </child>
-        <child>
-          <object class="GtkStackPage">
-            <property name="name">new</property>
-            <property name="child">
-              <object class="GtkScrolledWindow">
-                <property name="hscrollbar-policy">never</property>
-                <child>
-                  <object class="GtkBox">
-                    <property name="orientation">vertical</property>
-                    <child>
-                      <object class="AdwHeaderBar">
-                        <property name="show-start-title-buttons">false</property>
-                        <property name="show-end-title-buttons">false</property>
-                        <style>
-                          <class name="flat"/>
-                        </style>
-                        <child type="start">
-                          <object class="GtkButton">
-                            <property name="action-name">run-command.list</property>
-                            <property name="icon-name">go-previous-symbolic</property>
-                          </object>
-                        </child>
-                        <child type="title">
-                          <object class="AdwWindowTitle">
-                            <property name="title" translatable="yes">Create Run Command</property>
-                          </object>
-                        </child>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="AdwPreferencesPage">
-                        <child>
-                          <object class="AdwPreferencesGroup">
-                            <child>
-                              <object class="AdwEntryRow" id="name">
-                                <property name="title" translatable="yes">Name</property>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkLabel">
-                                <property name="margin-top">12</property>
-                                <property name="xalign">0</property>
-                                <property name="label" translatable="yes">The name will be used when 
displaying your custom command.</property>
-                                <style>
-                                  <class name="dim-label"/>
-                                  <class name="caption"/>
-                                </style>
-                              </object>
-                            </child>
-                          </object>
-                        </child>
-                        <child>
-                          <object class="AdwPreferencesGroup">
-                            <child>
-                              <object class="AdwComboRow" id="locality">
-                                <property name="title" translatable="yes">Locality</property>
-                                <property name="subtitle" translatable="yes">The locality determines where 
commands should be run.</property>
-                                <property name="model">localities</property>
-                                <property name="expression">
-                                  <lookup name="title" type="IdeEnumObject"/>
-                                </property>
-                                <!--signal name="notify::selected-item" handler="template_changed_cb" 
swapped="true" object="GbpCreateProjectWidget"/-->
-                                <property name="list-factory">
-                                  <object class="GtkBuilderListItemFactory">
-                                    <property name="bytes"><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
-  <template class="GtkListItem">
-    <property name="child">
-      <object class="GtkBox">
-        <property name="orientation">vertical</property>
-        <child>
-          <object class="GtkLabel">
-            <property name="xalign">0</property>
-            <property name="hexpand">true</property>
-            <binding name="label">
-              <lookup name="title" type="IdeEnumObject">
-                <lookup name="item">GtkListItem</lookup>
-              </lookup>
-            </binding>
-          </object>
-        </child>
-        <child>
-          <object class="GtkLabel">
-            <property name="xalign">0</property>
-            <property name="hexpand">true</property>
-            <property name="wrap">true</property>
-            <style>
-              <class name="caption"/>
-              <class name="dim-label"/>
-            </style>
-            <binding name="label">
-              <lookup name="description" type="IdeEnumObject">
-                <lookup name="item">GtkListItem</lookup>
-              </lookup>
-            </binding>
-          </object>
-        </child>
-      </object>
-    </property>
-  </template>
-</interface>
-]]>
-                                    </property>
-                                  </object>
-                                </property>
-                              </object>
-                            </child>
-                          </object>
-                        </child>
-                        <child>
-                          <object class="AdwPreferencesGroup">
-                            <child>
-                              <object class="AdwEntryRow" id="location">
-                                <property name="title" translatable="yes">Location</property>
-                                <property name="text">$BUILDDIR/</property>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkLabel">
-                                <property name="margin-top">12</property>
-                                <property name="xalign">0</property>
-                                <property name="wrap">true</property>
-                                <property name="use-markup">true</property>
-                                <property name="label" translatable="yes">The location is the path where the 
command should be run and may contain &lt;tt&gt;$BUILDDIR&lt;/tt&gt; or &lt;tt&gt;$SRCDIR&lt;/tt&gt; 
variables.</property>
-                                <style>
-                                  <class name="dim-label"/>
-                                  <class name="caption"/>
-                                </style>
-                              </object>
-                            </child>
-                          </object>
-                        </child>
-                        <child>
-                          <object class="AdwPreferencesGroup">
-                            <property name="title" translatable="yes">Environment Variables</property>
-                            <child type="header-suffix">
-                              <object class="GtkMenuButton">
-                                <style>
-                                  <class name="flat"/>
-                                </style>
-                                <property name="icon-name">list-add-symbolic</property>
-                                <property name="valign">center</property>
-                                <property name="direction">up</property>
-                                <property name="popover">
-                                  <object class="GtkPopover">
-                                    <child>
-                                      <object class="AdwPreferencesGroup">
-                                        <property name="margin-top">6</property>
-                                        <property name="margin-bottom">6</property>
-                                        <property name="margin-start">6</property>
-                                        <property name="margin-end">6</property>
-                                        <property name="title" translatable="yes">Add Variable</property>
-                                        <child>
-                                          <object class="AdwEntryRow" id="env_key">
-                                            <property name="title" translatable="yes">Name</property>
-                                          </object>
-                                        </child>
-                                        <child>
-                                          <object class="AdwEntryRow" id="env_value">
-                                            <property name="title" translatable="yes">Value</property>
-                                          </object>
-                                        </child>
-                                        <child>
-                                          <object class="GtkButton">
-                                            <style>
-                                              <class name="suggested-action"/>
-                                            </style>
-                                            <property name="margin-top">18</property>
-                                            <property name="label" translatable="yes">Add Variable</property>
-                                          </object>
-                                        </child>
-                                      </object>
-                                    </child>
-                                  </object>
-                                </property>
-                              </object>
-                            </child>
-                          </object>
-                        </child>
-                      </object>
-                    </child>
-                  </object>
-                </child>
-              </object>
-            </property>
-          </object>
-        </child>
       </object>
     </child>
   </template>
-  <object class="GListStore" id="localities">
-    <child>
-      <object class="IdeEnumObject">
-        <property name="title" translatable="yes">Default</property>
-        <property name="description" translatable="yes">The command will run as if you were running the 
application.</property>
-        <property name="nick">run</property>
-      </object>
-    </child>
-    <child>
-      <object class="IdeEnumObject">
-        <property name="title" translatable="yes">Build Container</property>
-        <property name="description" translatable="yes">The command will run from the projects build 
container which may not have display or network access.</property>
-        <property name="nick">build</property>
-      </object>
-    </child>
-    <child>
-      <object class="IdeEnumObject">
-        <property name="title" translatable="yes">Host System</property>
-        <property name="description" translatable="yes">The command will run on the host operating 
system.</property>
-        <property name="nick">host</property>
-      </object>
-    </child>
-    <child>
-      <object class="IdeEnumObject">
-        <!-- translators: this is referring to GNOME Builder the application -->
-        <property name="title" translatable="yes">GNOME Builder</property>
-        <property name="description" translatable="yes">The command will run as a subprocess of GNOME 
Builder.</property>
-        <property name="nick">app</property>
-      </object>
-    </child>
-  </object>
 </interface>


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