dia r4378 - in trunk: . app data



Author: hans
Date: Mon Apr 13 14:31:38 2009
New Revision: 4378
URL: http://svn.gnome.org/viewvc/dia?rev=4378&view=rev

Log:
2009-04-13  Hans Breuer  <hans breuer org>

	* data/integrated-ui.xml app/menus.c : removed Layers/Layers... from
	the integrated UI menu and assigned <control>L also to ShowLayers
	(the two menu entries are never available together, so no conflict)
	Fixes bug #576879.

	* app/preferences.[ch] :removed "Integrated UI" option here ...
	(together with the annoying change-needs-restart message)
	* app/app_procs.c : ... and made it a start-up option, aka. command
	line switch. If the UI type some day can be switch at runtime the
	prefernce setting may be added again.



Modified:
   trunk/ChangeLog
   trunk/app/app_procs.c
   trunk/app/menus.c
   trunk/app/preferences.c
   trunk/data/integrated-ui.xml

Modified: trunk/app/app_procs.c
==============================================================================
--- trunk/app/app_procs.c	(original)
+++ trunk/app/app_procs.c	Mon Apr 13 14:31:38 2009
@@ -612,6 +612,7 @@
 {
   static gboolean nosplash = FALSE;
   static gboolean nonew = FALSE;
+  static gboolean use_integrated_ui = FALSE;
   static gboolean credits = FALSE;
   static gboolean version = FALSE;
   static gboolean verbose = FALSE;
@@ -660,6 +661,8 @@
      N_("Don't show the splash screen"), NULL },
     {"nonew", 'n', 0, G_OPTION_ARG_NONE, &nonew,
      N_("Don't create empty diagram"), NULL },
+    {"integrated", '\0', 0, G_OPTION_ARG_NONE, &use_integrated_ui,
+     N_("Start integrated user interface (diagrams in tabs)"), NULL },
     {"log-to-stderr", 'l', 0, G_OPTION_ARG_NONE, &log_to_stderr,
      N_("Send error messages to stderr instead of showing dialogs."), NULL },
     {"input-directory", 'I', 0, G_OPTION_ARG_STRING, NULL /* &input_directory */,
@@ -683,10 +686,10 @@
   options[1].description = export_format_string;
   options[2].arg_data = &size;
   options[3].arg_data = &show_layers;
-  g_assert(strcmp (options[7].long_name, "input-directory") == 0);
-  options[7].arg_data = &input_directory;
-  g_assert(strcmp (options[8].long_name, "output-directory") == 0);
-  options[8].arg_data = &output_directory;
+  g_assert(strcmp (options[8].long_name, "input-directory") == 0);
+  options[8].arg_data = &input_directory;
+  g_assert(strcmp (options[9].long_name, "output-directory") == 0);
+  options[9].arg_data = &output_directory;
 
   argv0 = (argc > 0) ? argv[0] : "(none)";
 
@@ -826,7 +829,7 @@
     active_tool = create_modify_tool();
 
     dia_log_message ("ui creation");
-    if (prefs.use_integrated_ui) {
+    if (use_integrated_ui) {
       create_integrated_ui();
     } else {
       create_toolbox();
@@ -861,7 +864,7 @@
 					 export_file_format, size, show_layers,
 					 input_directory, output_directory);
   if (dia_is_interactive && files == NULL && !nonew) {
-    if (prefs.use_integrated_ui)
+    if (use_integrated_ui)
     {
       GList * list;
     

Modified: trunk/app/menus.c
==============================================================================
--- trunk/app/menus.c	(original)
+++ trunk/app/menus.c	Mon Apr 13 14:31:38 2009
@@ -106,7 +106,7 @@
 {
     { VIEW_MAIN_TOOLBAR_ACTION,   NULL, N_("Show Toolbar"),   NULL, NULL, G_CALLBACK (view_main_toolbar_callback) },
     { VIEW_MAIN_STATUSBAR_ACTION, NULL, N_("Show Statusbar"), NULL, NULL, G_CALLBACK (view_main_statusbar_callback) },
-    { VIEW_LAYERS_ACTION,         NULL, N_("Show Layers"),    NULL, NULL, G_CALLBACK (view_layers_callback) }
+    { VIEW_LAYERS_ACTION,    NULL, N_("Show Layers"), "<control>L", NULL, G_CALLBACK (view_layers_callback) }
 };
 
 /* Actions for diagram window */

Modified: trunk/app/preferences.c
==============================================================================
--- trunk/app/preferences.c	(original)
+++ trunk/app/preferences.c	Mon Apr 13 14:31:38 2009
@@ -78,7 +78,6 @@
 
 static void update_floating_toolbox(DiaPrefData *pref, gpointer ptr);
 static void update_internal_prefs(DiaPrefData *pref, gpointer ptr);
-static void update_ui_type_prefs(DiaPrefData *pref, gpointer ptr);
 
 static int default_true = 1;
 static int default_false = 0;
@@ -187,10 +186,6 @@
     &default_fontsize_unit, UI_TAB, N_("Font-size unit:"), NULL, FALSE,
     _get_units_name_list, update_internal_prefs },
   
-  { "use_integrated_ui", PREF_BOOLEAN, PREF_OFFSET(use_integrated_ui),
-    &default_false, UI_TAB, N_("Integrated UI"), NULL, FALSE, NULL, update_ui_type_prefs },
-
-
   { NULL, PREF_NONE, 0, NULL, DIA_TAB, N_("New diagram:") },
   { "is_portrait", PREF_BOOLEAN, PREF_OFFSET(new_diagram.is_portrait), &default_true, DIA_TAB, N_("Portrait") },
   { "new_diagram_papertype", PREF_CHOICE, PREF_OFFSET(new_diagram.papertype),
@@ -332,7 +327,7 @@
       break;
     }
     /* set initial preferences, but dont talk about restarting */
-    if (prefs_data[i].update_function && prefs_data[i].update_function != update_ui_type_prefs)
+    if (prefs_data[i].update_function)
       (prefs_data[i].update_function)(&prefs_data[i], ptr);
   }
   update_internal_prefs(&prefs_data[i], NULL);
@@ -791,9 +786,3 @@
   }
 }
 
-static void 
-update_ui_type_prefs(DiaPrefData *pref, gpointer ptr)
-{
-  g_return_if_fail (pref->key == NULL);
-  message_notice(_("User Interface type settings change will take effect after restart"));  
-}

Modified: trunk/data/integrated-ui.xml
==============================================================================
--- trunk/data/integrated-ui.xml	(original)
+++ trunk/data/integrated-ui.xml	Mon Apr 13 14:31:38 2009
@@ -91,8 +91,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">



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