[dia/zbrown/remove-non-integrated-ui] Remove layer dialog & defunct prefrences



commit c687574299061169d53e8d2b2a5f7b714eda5a03
Author: Zander Brown <zbrown gnome org>
Date:   Mon Jan 28 18:14:31 2019 +0000

    Remove layer dialog & defunct prefrences

 app/commands.c      |   8 ----
 app/commands.h      |   1 -
 app/diagram.c       |   6 ---
 app/display.c       |   2 +-
 app/layer_dialog.c  | 121 +---------------------------------------------------
 app/layer_dialog.h  |   2 -
 app/menus.c         |   1 -
 app/preferences.c   |  37 ----------------
 app/preferences.h   |   3 --
 data/display-ui.xml |   2 -
 data/popup-ui.xml   |   2 -
 11 files changed, 2 insertions(+), 183 deletions(-)
---
diff --git a/app/commands.c b/app/commands.c
index a5ad14fe..9be28cf0 100644
--- a/app/commands.c
+++ b/app/commands.c
@@ -1419,14 +1419,6 @@ dialogs_properties_callback (GtkAction *action)
   } 
 }
 
-void
-dialogs_layers_callback (GtkAction *action)
-{
-  layer_dialog_set_diagram(ddisplay_active_diagram());
-  layer_dialog_show();
-}
-
-
 void
 objects_align_h_callback (GtkAction *action)
 {
diff --git a/app/commands.h b/app/commands.h
index 077f8344..e23e5acc 100644
--- a/app/commands.h
+++ b/app/commands.h
@@ -89,7 +89,6 @@ void objects_align_v_callback           (GtkAction *action);
 void objects_align_connected_callback   (GtkAction *action);
 
 void dialogs_properties_callback (GtkAction *action);
-void dialogs_layers_callback     (GtkAction *action);
 
 /* from sheets.c */
 void sheets_dialog_show_callback(GtkAction *action);
diff --git a/app/diagram.c b/app/diagram.c
index bd138761..8439b81a 100644
--- a/app/diagram.c
+++ b/app/diagram.c
@@ -109,7 +109,6 @@ diagram_dispose (GObject *object)
     dia_diagram_remove(dia);
 
     open_diagrams = g_list_remove(open_diagrams, dia);
-    layer_dialog_update_diagram_list();
   }
 
   if (dia->undo)
@@ -252,9 +251,6 @@ diagram_init(Diagram *dia, const char *filename)
   if (!g_list_find(open_diagrams, dia))
     open_diagrams = g_list_prepend(open_diagrams, dia);
 
-  if (app_is_interactive())
-    layer_dialog_update_diagram_list();
-
   g_free(newfilename);
 
   g_signal_connect (G_OBJECT(dia), "object_add", G_CALLBACK(_object_add), dia);
@@ -1489,8 +1485,6 @@ diagram_update_for_filename(Diagram *dia)
 
   g_free(title);
 
-  layer_dialog_update_diagram_list();
-
   /* signal about the change */
   dia_diagram_change (dia, DIAGRAM_CHANGE_NAME, NULL);
 }
diff --git a/app/display.c b/app/display.c
index 629954d6..43c05213 100644
--- a/app/display.c
+++ b/app/display.c
@@ -147,7 +147,7 @@ initialize_display_widgets(DDisplay *ddisp)
     filename++;
   }
   create_display_shell(ddisp, prefs.new_view.width, prefs.new_view.height,
-                      filename, prefs.new_view.use_menu_bar);
+                      filename, TRUE);
 
   ddisplay_update_statusbar (ddisp);
 
diff --git a/app/layer_dialog.c b/app/layer_dialog.c
index 3f6eed55..02b4031e 100644
--- a/app/layer_dialog.c
+++ b/app/layer_dialog.c
@@ -266,14 +266,6 @@ layer_list_events (GtkWidget *widget,
   return FALSE;
 }
 
-static gboolean
-layer_dialog_delete(GtkWidget *widget, gpointer data)
-{
-  gtk_widget_hide(widget);
-  /* We're caching, so don't destroy */
-  return TRUE;
-}
-
 static void
 layer_view_hide_button_clicked (void * not_used)
 {
@@ -363,99 +355,6 @@ GtkWidget * create_layer_view_widget (void)
   return vbox;
 }
 
-void
-layer_dialog_create(void)
-{
-  GtkWidget *dialog;
-  GtkWidget *vbox;
-  GtkWidget *hbox;
-  GtkWidget *label;
-  GtkWidget *omenu;
-  GtkWidget *menu;
-  GtkWidget *list;
-  GtkWidget *separator;
-  GtkWidget *scrolled_win;
-  GtkWidget *button_box;
-  GtkWidget *button;
-
-  layer_dialog = g_new(struct LayerDialog, 1);
-
-  layer_dialog->diagram = NULL;
-  
-  layer_dialog->dialog = dialog = gtk_dialog_new ();
-  gtk_window_set_title (GTK_WINDOW (dialog), _("Layers"));
-  gtk_window_set_role (GTK_WINDOW (dialog), "layer_window");
-  gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
-
-  g_signal_connect (G_OBJECT (dialog), "delete_event",
-                    G_CALLBACK(layer_dialog_delete), NULL);
-  g_signal_connect (G_OBJECT (dialog), "destroy",
-                    G_CALLBACK(gtk_widget_destroyed), 
-                   &(layer_dialog->dialog));
-
-  vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
-
-  hbox = gtk_hbox_new(FALSE, 1);
-  
-  label = gtk_label_new(_("Diagram:"));
-  gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
-  gtk_widget_show (label);
-  
-  layer_dialog->diagram_omenu = omenu = gtk_option_menu_new();
-  gtk_box_pack_start(GTK_BOX(hbox), omenu, TRUE, TRUE, 2);
-  gtk_widget_show (omenu);
-
-  menu = gtk_menu_new();
-  gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu);
-
-  gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
-  gtk_widget_show (hbox);
-
-  separator = gtk_hseparator_new();
-  gtk_box_pack_start(GTK_BOX(vbox), separator, FALSE, FALSE, 2);
-  gtk_widget_show (separator);
-
-  scrolled_win = gtk_scrolled_window_new (NULL, NULL);
-  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
-                                 GTK_POLICY_AUTOMATIC, 
-                                 GTK_POLICY_AUTOMATIC);
-  gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 2);
-
-  layer_dialog->layer_list = list = gtk_list_new();
-
-  gtk_list_set_selection_mode (GTK_LIST (list), GTK_SELECTION_BROWSE);
-  gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_win), list);
-  gtk_container_set_focus_vadjustment (GTK_CONTAINER (list),
-                                      gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW 
(scrolled_win)));
-  gtk_widget_show (scrolled_win);
-  gtk_widget_show (list);
-
-  g_signal_connect (G_OBJECT (list), "event",
-                   G_CALLBACK (layer_list_events), NULL);
-
-  button_box = create_button_box(dialog, TRUE);
-  
-  gtk_box_pack_start (GTK_BOX (vbox), button_box, FALSE, FALSE, 2);
-  gtk_widget_show (button_box);
-
-  gtk_container_set_border_width(GTK_CONTAINER(
-                                gtk_dialog_get_action_area (GTK_DIALOG(dialog))),
-                                2);
-
-  button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
-  gtk_box_pack_start (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG(dialog))), 
-                     button, TRUE, TRUE, 0);
-  g_signal_connect_swapped(G_OBJECT (button), "clicked",
-                          G_CALLBACK(gtk_widget_hide),
-                          G_OBJECT(dialog));
-
-  gtk_widget_show (button);
-
-  persistence_register_window(GTK_WINDOW(dialog));
-
-  layer_dialog_update_diagram_list();
-}
-
 static void
 dia_layer_select_callback(GtkWidget *widget, gpointer data)
 {
@@ -674,24 +573,6 @@ layer_dialog_lower_callback(GtkWidget *widget, gpointer gdata)
   }
 }
 
-void
-layer_dialog_update_diagram_list(void)
-{
-  if (layer_dialog == NULL || layer_dialog->dialog == NULL) {
-    if (!dia_open_diagrams())
-      return; /* shortcut; maybe session end w/o this dialog */
-    else
-      layer_dialog_create();
-  }
-  g_assert(layer_dialog != NULL); /* must be valid now */
-}
-
-void
-layer_dialog_show()
-{
-  /* TODO: Remove */
-}
-
 /*
  * Used to avoid writing to possibly already deleted layer in
  * dia_layer_widget_connectable_toggled(). Must be called before
@@ -719,7 +600,7 @@ layer_dialog_set_diagram(Diagram *dia)
     active_layer = dia->data->active_layer;
 
   if (layer_dialog == NULL || layer_dialog->dialog == NULL) 
-    layer_dialog_create(); /* May have been destroyed */
+    create_layer_view_widget (); /* May have been destroyed */
   g_assert(layer_dialog != NULL); /* must be valid now */
 
   gtk_container_foreach (GTK_CONTAINER(layer_dialog->layer_list),
diff --git a/app/layer_dialog.h b/app/layer_dialog.h
index 8ebf2416..24f0b425 100644
--- a/app/layer_dialog.h
+++ b/app/layer_dialog.h
@@ -22,8 +22,6 @@
 #include "diagram.h"
 
 
-void layer_dialog_update_diagram_list(void);
-void layer_dialog_show(void);
 void layer_dialog_set_diagram(Diagram *dia);
 
 /* Integrated UI component */
diff --git a/app/menus.c b/app/menus.c
index 1236ada9..b03294d8 100644
--- a/app/menus.c
+++ b/app/menus.c
@@ -150,7 +150,6 @@ static const GtkActionEntry display_entries[] =
     { "LayerRename", DIA_STOCK_LAYER_RENAME, N_("Rename Layer\342\200\246"), NULL, NULL, G_CALLBACK 
(layers_rename_layer_callback) },
     { "ObjectsLayerAbove", DIA_STOCK_OBJECTS_LAYER_ABOVE, N_("Move Selection to Layer above"), NULL, NULL, 
G_CALLBACK (objects_move_up_layer) },
     { "ObjectsLayerBelow", DIA_STOCK_OBJECTS_LAYER_BELOW, N_("Move Selection to Layer below"), NULL, NULL, 
G_CALLBACK (objects_move_down_layer) },
-    { "DiagramLayers", DIA_STOCK_LAYERS, N_("_Layers\342\200\246"), FIRST_MODIFIER "L", NULL, G_CALLBACK 
(dialogs_layers_callback) },
   { "View", NULL, N_("_View"), NULL, NULL, NULL },
     { "ViewZoomin", GTK_STOCK_ZOOM_IN, NULL, FIRST_MODIFIER "plus", N_("Zoom in"), G_CALLBACK 
(view_zoom_in_callback) },
     { "ViewZoomout", GTK_STOCK_ZOOM_OUT, NULL, FIRST_MODIFIER "minus", N_("Zoom out"), G_CALLBACK 
(view_zoom_out_callback) },
diff --git a/app/preferences.c b/app/preferences.c
index c45cd38d..b85c3fda 100644
--- a/app/preferences.c
+++ b/app/preferences.c
@@ -77,7 +77,6 @@ typedef struct _DiaPrefData {
   const char *key;
 } DiaPrefData;
 
-static void update_floating_toolbox(DiaPrefData *pref, gpointer ptr);
 static void update_internal_prefs(DiaPrefData *pref, gpointer ptr);
 
 static int default_true = 1;
@@ -172,12 +171,6 @@ DiaPrefData prefs_data[] =
   { "recent_documents_list_size", PREF_UINT, PREF_OFFSET(recent_documents_list_size), 
     &default_recent_documents, 0, N_("Recent documents list size:") },
 
-  { "use_menu_bar", PREF_BOOLEAN, PREF_OFFSET(new_view.use_menu_bar), 
-    &default_true, UI_TAB, N_("Use menu bar") },
-
-  { "toolbox_on_top", PREF_BOOLEAN, PREF_OFFSET(toolbox_on_top),
-    &default_false, UI_TAB, N_("Keep tool box on top of diagram windows"),
-    NULL, FALSE, NULL, update_floating_toolbox},
   { "length_unit", PREF_CHOICE, PREF_OFFSET(length_unit),
     &default_length_unit, UI_TAB, N_("Length unit:"), NULL, FALSE,
     _get_units_name_list, update_internal_prefs },
@@ -751,33 +744,3 @@ update_internal_prefs(DiaPrefData *pref, gpointer ptr)
   if (prefs.fontsize_unit)
     prefs_set_fontsize_unit(prefs.fontsize_unit);
 }
-
-static void
-update_floating_toolbox(DiaPrefData *pref, gpointer ptr)
-{
-  g_return_if_fail (pref->key == NULL);
-
-  if (!app_is_interactive())
-    return;
-
-  if (prefs.toolbox_on_top) {
-    /* Go through all diagrams and set toolbox transient for all displays */
-    GList *diagrams;
-    for (diagrams = dia_open_diagrams(); diagrams != NULL; 
-        diagrams = g_list_next(diagrams)) {
-      Diagram *diagram = (Diagram *)diagrams->data;
-      GSList *displays;
-      for (displays = diagram->displays; displays != NULL; 
-          displays = g_slist_next(displays)) {
-       DDisplay *ddisp = (DDisplay *)displays->data;
-       gtk_window_set_transient_for(GTK_WINDOW(interface_get_toolbox_shell()),
-                                    GTK_WINDOW(ddisp->shell));
-      }
-    }
-  } else {
-    GtkWindow *shell = GTK_WINDOW(interface_get_toolbox_shell());
-    if (shell)
-      gtk_window_set_transient_for(shell, NULL);
-  }
-}
-
diff --git a/app/preferences.h b/app/preferences.h
index fd190f66..05a8a4cd 100644
--- a/app/preferences.h
+++ b/app/preferences.h
@@ -42,7 +42,6 @@ struct DiaPreferences {
     int width;
     int height;
     real zoom;
-    int use_menu_bar;
   } new_view;
 
   NewDiagramData new_diagram;
@@ -65,8 +64,6 @@ struct DiaPreferences {
   } pagebreak;
 
   int fixed_icon_size;
-
-  int toolbox_on_top;
   
   /* a dedicated filter name or NULL */
   struct {
diff --git a/data/display-ui.xml b/data/display-ui.xml
index 049de3be..91ad3561 100644
--- a/data/display-ui.xml
+++ b/data/display-ui.xml
@@ -77,8 +77,6 @@
                        <separator name="LayersSep1" />
                        <menuitem name="ObjectsLayerAbove" action="ObjectsLayerAbove" />
                        <menuitem name="ObjectsLayerBelow" action="ObjectsLayerBelow" />
-                       <separator name="LayersSep2" />
-                       <menuitem name="DiagramLayers" action="DiagramLayers" />
                </menu>
                <menu name="Objects" action="Objects">
                        <menuitem name="ObjectsSendtoback" action="ObjectsSendtoback" />
diff --git a/data/popup-ui.xml b/data/popup-ui.xml
index 4a4b297e..6823657b 100644
--- a/data/popup-ui.xml
+++ b/data/popup-ui.xml
@@ -77,8 +77,6 @@
                        <separator name="LayersSep1" />
                        <menuitem name="ObjectsLayerAbove" action="ObjectsLayerAbove" />
                        <menuitem name="ObjectsLayerBelow" action="ObjectsLayerBelow" />
-                       <separator name="LayersSep2" />
-                       <menuitem name="DiagramLayers" action="DiagramLayers" />
                </menu>
                <menu name="Objects" action="Objects">
                        <menuitem name="ObjectsSendtoback" action="ObjectsSendtoback" />


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