gnome-terminal r2817 - trunk/src



Author: chpe
Date: Thu May 29 19:57:03 2008
New Revision: 2817
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=2817&view=rev

Log:
=?utf-8?q?Bug=20343477=20=E2=80=93=20--role=20requires=20new=20window=20argument,=20unlike=20other=20options

=20Based=20on=20the=20patch=20by=20Mariano=20Su=C3=A1rez-Alvarez.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit


Modified:
   trunk/src/terminal.c

Modified: trunk/src/terminal.c
==============================================================================
--- trunk/src/terminal.c	(original)
+++ trunk/src/terminal.c	Thu May 29 19:57:03 2008
@@ -81,6 +81,7 @@
   gboolean default_window_menubar_forced;
   gboolean default_window_menubar_state;
   gboolean default_start_fullscreen;
+  char    *default_role;
   char    *default_geometry;
   char    *default_working_dir;
   char   **post_execute_args;
@@ -187,6 +188,12 @@
 {
   g_assert (iw->geometry == NULL);
 
+  if (results->default_role)
+    {
+      iw->role = results->default_role;
+      results->default_role = NULL;
+    }
+  
   if (results->default_geometry)
     {
       iw->geometry = results->default_geometry;
@@ -428,9 +435,9 @@
 
 static gboolean 
 option_role_callback (const gchar *option_name,
-                         const gchar *value,
-                         gpointer     data,
-                         GError     **error)
+                      const gchar *value,
+                      gpointer     data,
+                      GError     **error)
 {
   OptionParsingResults *results = data;
   InitialWindow *iw;
@@ -440,6 +447,14 @@
       iw = g_list_last (results->initial_windows)->data;
       iw->role = g_strdup (value);
     }
+  else if (!results->default_role)
+    results->default_role = g_strdup (value);
+  else
+    {
+      g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED,
+                   "%s", _("Two roles given for one window"));
+      return FALSE;
+    }
 
   return TRUE;
 }
@@ -610,7 +625,6 @@
   if (results->initial_windows == NULL)
     it = ensure_top_tab (results);
 
-
   if (results->execute)
     {         
       if (results->post_execute_args == NULL)
@@ -637,8 +651,8 @@
           iw = g_list_last (results->initial_windows)->data;
           iw->geometry = g_strdup (results->geometry);
         }
-      else
-          results->default_geometry = g_strdup (results->geometry);
+      else if (!results->default_geometry)
+        results->default_geometry = g_strdup (results->geometry);
     }
 
 
@@ -706,6 +720,7 @@
   results->startup_id = NULL;
   results->display_name = NULL;
   results->initial_windows = NULL;
+  results->default_role = NULL;
   results->default_geometry = NULL;
   results->geometry = NULL;
   results->zoom = NULL;
@@ -756,6 +771,7 @@
   g_list_foreach (results->initial_windows, (GFunc) initial_window_free, NULL);
   g_list_free (results->initial_windows);
 
+  g_free (results->default_role);
   g_free (results->default_geometry);
   g_free (results->default_working_dir);
 



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