gedit-2.20.4.orig/dataだけに発見: gedit.desktop.in
diff -ru gedit-2.20.4.orig/gedit/dialogs/gedit-preferences-dialog.c gedit-2.20.4/gedit/dialogs/gedit-preferences-dialog.c
--- gedit-2.20.4.orig/gedit/dialogs/gedit-preferences-dialog.c	2007-11-05 02:30:39.000000000 +0900
+++ gedit-2.20.4/gedit/dialogs/gedit-preferences-dialog.c	2008-03-30 15:41:35.000000000 +0900
@@ -109,6 +109,11 @@
 	GtkWidget	*auto_save_spinbutton;
 	GtkWidget	*autosave_hbox;
 	
+	/* File Open */
+	GtkWidget	*open_tab_radiobutton;
+	GtkWidget	*open_window_radiobutton;
+	GtkWidget	*open_window_ext_radiobutton;
+
 	/* Line numbers */
 	GtkWidget	*display_line_numbers_checkbutton;
 
@@ -241,6 +246,29 @@
 }
 
 static void
+open_window_radiobutton_toggled (GtkToggleButton	        *button,
+				 GeditPreferencesDialog *dlg)
+{
+	gint pref;
+
+	gedit_debug (DEBUG_PREFS);
+
+	g_return_if_fail (button == GTK_TOGGLE_BUTTON (dlg->priv->open_tab_radiobutton)
+		       || button == GTK_TOGGLE_BUTTON (dlg->priv->open_window_radiobutton)
+		       || button == GTK_TOGGLE_BUTTON (dlg->priv->open_window_ext_radiobutton));
+
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dlg->priv->open_tab_radiobutton)))
+		pref = GEDIT_OPEN_IN_NEW_TAB;
+	else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (
+							dlg->priv->open_window_radiobutton)))
+		pref = GEDIT_OPEN_IN_NEW_WINDOW;
+	else
+		pref = GEDIT_OPEN_IN_NEW_WINDOW_EXT_ONLY;
+
+	gedit_prefs_manager_set_open_in_new_window (pref);
+}
+
+static void
 setup_editor_page (GeditPreferencesDialog *dlg)
 {
 	gboolean auto_save;
@@ -257,6 +285,15 @@
 				      gedit_prefs_manager_get_auto_indent ());
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->backup_copy_checkbutton),
 				      gedit_prefs_manager_get_create_backup_copy ());
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->open_tab_radiobutton),
+				      gedit_prefs_manager_get_open_in_new_window() ==
+					GEDIT_OPEN_IN_NEW_TAB);
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->open_window_radiobutton),
+				      gedit_prefs_manager_get_open_in_new_window() ==
+					GEDIT_OPEN_IN_NEW_WINDOW);
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->open_window_ext_radiobutton),
+				      gedit_prefs_manager_get_open_in_new_window() ==
+					GEDIT_OPEN_IN_NEW_WINDOW_EXT_ONLY);
 
 	auto_save = gedit_prefs_manager_get_auto_save ();
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->auto_save_checkbutton),
@@ -283,6 +320,12 @@
 	gtk_widget_set_sensitive (dlg->priv->auto_save_spinbutton, 
 			          auto_save &&
 				  gedit_prefs_manager_auto_save_interval_can_set ());
+	gtk_widget_set_sensitive (dlg->priv->open_tab_radiobutton,
+				  gedit_prefs_manager_open_in_new_window_can_set ());
+	gtk_widget_set_sensitive (dlg->priv->open_window_radiobutton,
+				  gedit_prefs_manager_open_in_new_window_can_set ());
+	gtk_widget_set_sensitive (dlg->priv->open_window_ext_radiobutton,
+				  gedit_prefs_manager_open_in_new_window_can_set ());
 
 	/* Connect signal */
 	g_signal_connect (dlg->priv->tabs_width_spinbutton,
@@ -309,6 +352,18 @@
 			  "value_changed",
 			  G_CALLBACK (auto_save_spinbutton_value_changed),
 			  dlg);
+	g_signal_connect (dlg->priv->open_tab_radiobutton,
+			  "toggled",
+			  G_CALLBACK (open_window_radiobutton_toggled),
+			  dlg);
+	g_signal_connect (dlg->priv->open_window_radiobutton,
+			  "toggled",
+			  G_CALLBACK (open_window_radiobutton_toggled),
+			  dlg);
+	g_signal_connect (dlg->priv->open_window_ext_radiobutton,
+			  "toggled",
+			  G_CALLBACK (open_window_radiobutton_toggled),
+			  dlg);
 }
 
 static void
@@ -1117,6 +1172,10 @@
 		"auto_save_checkbutton", &dlg->priv->auto_save_checkbutton,
 		"auto_save_spinbutton", &dlg->priv->auto_save_spinbutton,
 
+		"open_tab_radiobutton", &dlg->priv->open_tab_radiobutton,
+		"open_window_radiobutton", &dlg->priv->open_window_radiobutton,
+		"open_window_ext_radiobutton", &dlg->priv->open_window_ext_radiobutton,
+
 		"default_font_checkbutton", &dlg->priv->default_font_checkbutton,
 		"font_button", &dlg->priv->font_button,
 		"font_hbox", &dlg->priv->font_hbox,
gedit-2.20.4/gedit/dialogsだけに発見: gedit-preferences-dialog.c~
diff -ru gedit-2.20.4.orig/gedit/dialogs/gedit-preferences-dialog.glade gedit-2.20.4/gedit/dialogs/gedit-preferences-dialog.glade
--- gedit-2.20.4.orig/gedit/dialogs/gedit-preferences-dialog.glade	2007-11-05 02:30:39.000000000 +0900
+++ gedit-2.20.4/gedit/dialogs/gedit-preferences-dialog.glade	2008-03-30 15:14:41.000000000 +0900
@@ -1180,6 +1180,230 @@
 		  <property name="fill">False</property>
 		</packing>
 	      </child>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox3">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">6</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label4">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">&lt;b&gt;File Open&lt;/b&gt;</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">True</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox3">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkLabel" id="label8">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">    </property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkVBox" id="vbox5">
+			  <property name="visible">True</property>
+			  <property name="homogeneous">False</property>
+			  <property name="spacing">6</property>
+
+			  <child>
+			    <widget class="GtkLabel" id="label15">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Open documents:</property>
+			      <property name="use_underline">False</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0</property>
+			      <property name="yalign">0.5</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">0</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">False</property>
+			      <property name="angle">0</property>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkHBox" id="hbox5">
+			      <property name="visible">True</property>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">0</property>
+
+			      <child>
+				<widget class="GtkLabel" id="label13">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">    </property>
+				  <property name="use_underline">False</property>
+				  <property name="use_markup">False</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">False</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0.5</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">-1</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkVBox" id="vbox7">
+				  <property name="visible">True</property>
+				  <property name="homogeneous">False</property>
+				  <property name="spacing">6</property>
+
+				  <child>
+				    <widget class="GtkRadioButton" id="open_tab_radiobutton">
+				      <property name="visible">True</property>
+				      <property name="can_focus">True</property>
+				      <property name="label" translatable="yes">In a new tab</property>
+				      <property name="use_underline">True</property>
+				      <property name="relief">GTK_RELIEF_NORMAL</property>
+				      <property name="focus_on_click">True</property>
+				      <property name="active">True</property>
+				      <property name="inconsistent">False</property>
+				      <property name="draw_indicator">True</property>
+				    </widget>
+				    <packing>
+				      <property name="padding">0</property>
+				      <property name="expand">True</property>
+				      <property name="fill">True</property>
+				    </packing>
+				  </child>
+
+				  <child>
+				    <widget class="GtkRadioButton" id="open_window_radiobutton">
+				      <property name="visible">True</property>
+				      <property name="can_focus">True</property>
+				      <property name="label" translatable="yes">In a new window</property>
+				      <property name="use_underline">True</property>
+				      <property name="relief">GTK_RELIEF_NORMAL</property>
+				      <property name="focus_on_click">True</property>
+				      <property name="active">True</property>
+				      <property name="inconsistent">False</property>
+				      <property name="draw_indicator">True</property>
+				      <property name="group">open_tab_radiobutton</property>
+				    </widget>
+				    <packing>
+				      <property name="padding">0</property>
+				      <property name="expand">True</property>
+				      <property name="fill">True</property>
+				    </packing>
+				  </child>
+
+				  <child>
+				    <widget class="GtkRadioButton" id="open_window_ext_radiobutton">
+				      <property name="visible">True</property>
+				      <property name="can_focus">True</property>
+				      <property name="label" translatable="yes">In a new tab only when opened from gedit</property>
+				      <property name="use_underline">True</property>
+				      <property name="relief">GTK_RELIEF_NORMAL</property>
+				      <property name="focus_on_click">True</property>
+				      <property name="active">True</property>
+				      <property name="inconsistent">False</property>
+				      <property name="draw_indicator">True</property>
+				      <property name="group">open_tab_radiobutton</property>
+				    </widget>
+				    <packing>
+				      <property name="padding">0</property>
+				      <property name="expand">True</property>
+				      <property name="fill">True</property>
+				    </packing>
+				  </child>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
+			    </packing>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">True</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
 	    </widget>
 	    <packing>
 	      <property name="tab_expand">False</property>
gedit-2.20.4/gedit/dialogsだけに発見: gedit-preferences-dialog.glade.bak
gedit-2.20.4/gedit/dialogsだけに発見: gedit-preferences-dialog.gladep
diff -ru gedit-2.20.4.orig/gedit/gedit-commands-file.c gedit-2.20.4/gedit/gedit-commands-file.c
--- gedit-2.20.4.orig/gedit/gedit-commands-file.c	2007-11-05 02:30:44.000000000 +0900
+++ gedit-2.20.4/gedit/gedit-commands-file.c	2008-03-30 15:42:29.000000000 +0900
@@ -235,9 +235,20 @@
 
 	while (uris_to_load != NULL)
 	{
+		GeditWindow *dest_win = window;
+
 		g_return_val_if_fail (uris_to_load->data != NULL, 0);
-		
-		tab = gedit_window_create_tab_from_uri (window,
+
+		if (gedit_prefs_manager_get_open_in_new_window() == GEDIT_OPEN_IN_NEW_WINDOW
+		    && gedit_window_get_num_tabs(window) > 0)
+		{
+			dest_win = gedit_app_create_window (gedit_app_get_default (),
+						gtk_widget_get_screen (GTK_WIDGET (window)));
+			gtk_widget_realize (GTK_WIDGET (dest_win));
+			gtk_window_present (GTK_WINDOW (dest_win));
+		}
+
+		tab = gedit_window_create_tab_from_uri (dest_win,
 							(const gchar *)uris_to_load->data,
 							encoding,
 							line_pos,
gedit-2.20.4/geditだけに発見: gedit-commands-file.c~
diff -ru gedit-2.20.4.orig/gedit/gedit-prefs-manager.c gedit-2.20.4/gedit/gedit-prefs-manager.c
--- gedit-2.20.4.orig/gedit/gedit-prefs-manager.c	2007-11-05 02:30:44.000000000 +0900
+++ gedit-2.20.4/gedit/gedit-prefs-manager.c	2008-03-30 15:35:51.000000000 +0900
@@ -1160,6 +1160,11 @@
 					     GPM_DEFAULT_RESTORE_CURSOR_POSITION);
 }
 
+/* Open in new window */
+DEFINE_INT_PREF (open_in_new_window,
+		GPM_OPEN_IN_NEW_WINDOW_ENABLE,
+		GPM_DEFAULT_OPEN_IN_NEW_WINDOW)
+
 /* Global Lockdown */
 GeditLockdownMask
 gedit_prefs_manager_get_lockdown (void)
gedit-2.20.4/geditだけに発見: gedit-prefs-manager.c~
diff -ru gedit-2.20.4.orig/gedit/gedit-prefs-manager.h gedit-2.20.4/gedit/gedit-prefs-manager.h
--- gedit-2.20.4.orig/gedit/gedit-prefs-manager.h	2007-11-05 02:30:43.000000000 +0900
+++ gedit-2.20.4/gedit/gedit-prefs-manager.h	2008-03-30 15:38:00.000000000 +0900
@@ -134,6 +134,10 @@
 /* White list of writable gnome-vfs methods */
 #define GPM_WRITABLE_VFS_SCHEMES 	GPM_SAVE_DIR "/writable_vfs_schemes"
 
+/* Open in new window */
+#define GPM_OPEN_IN_NEW_WINDOW_DIR	GPM_PREFS_DIR "/ui/open_in_new_window"
+#define GPM_OPEN_IN_NEW_WINDOW_ENABLE	GPM_OPEN_IN_NEW_WINDOW_DIR "/enable"
+
 /* Global Lockdown keys */
 #define GPM_LOCKDOWN_DIR		"/desktop/gnome/lockdown"
 #define GPM_LOCKDOWN_COMMAND_LINE	GPM_LOCKDOWN_DIR "/disable_command_line"
@@ -202,6 +206,8 @@
 
 #define GPM_DEFAULT_SEARCH_HIGHLIGHTING_ENABLE 1 /* TRUE */
 
+#define GPM_DEFAULT_OPEN_IN_NEW_WINDOW 0 /* FALSE */
+
 #define GPM_DEFAULT_SOURCE_STYLE_SCHEME "classic"
 
 typedef enum {
@@ -211,6 +217,12 @@
 	GEDIT_TOOLBAR_ICONS_BOTH_HORIZ
 } GeditToolbarSetting;
 
+typedef enum {
+	GEDIT_OPEN_IN_NEW_TAB = 0,
+	GEDIT_OPEN_IN_NEW_WINDOW = 1,
+	GEDIT_OPEN_IN_NEW_WINDOW_EXT_ONLY = 2
+} GeditOpenInSetting;
+
 /** LIFE CYCLE MANAGEMENT FUNCTIONS **/
 
 gboolean		 gedit_prefs_manager_init (void);
@@ -404,6 +416,11 @@
 void			 gedit_prefs_manager_set_source_style_scheme	(const gchar *scheme);
 gboolean		 gedit_prefs_manager_source_style_scheme_can_set(void);
 
+/* Open in new window */
+gint			 gedit_prefs_manager_get_open_in_new_window	(void);
+void			 gedit_prefs_manager_set_open_in_new_window	(gint onw);
+gint			 gedit_prefs_manager_open_in_new_window_can_set	(void);
+
 /* Global lockdown */
 GeditLockdownMask	 gedit_prefs_manager_get_lockdown			(void);
 
gedit-2.20.4/geditだけに発見: gedit-prefs-manager.h~
diff -ru gedit-2.20.4.orig/gedit/gedit-window.c gedit-2.20.4/gedit/gedit-window.c
--- gedit-2.20.4.orig/gedit/gedit-window.c	2007-11-05 02:30:35.000000000 +0900
+++ gedit-2.20.4/gedit/gedit-window.c	2008-03-30 15:37:13.000000000 +0900
@@ -3432,6 +3432,14 @@
 				       page_num);
 }
 
+gint
+gedit_window_get_num_tabs (GeditWindow *window)
+{
+	g_return_val_if_fail (GEDIT_IS_WINDOW (window), 0);
+
+	return window->priv->num_tabs;
+}
+
 GtkWindowGroup *
 gedit_window_get_group (GeditWindow *window)
 {
gedit-2.20.4/geditだけに発見: gedit-window.c~
diff -ru gedit-2.20.4.orig/gedit/gedit-window.h gedit-2.20.4/gedit/gedit-window.h
--- gedit-2.20.4.orig/gedit/gedit-window.h	2007-11-05 02:30:38.000000000 +0900
+++ gedit-2.20.4/gedit/gedit-window.h	2008-03-30 14:46:48.000000000 +0900
@@ -123,6 +123,8 @@
 void		 gedit_window_set_active_tab		(GeditWindow         *window,
 							 GeditTab            *tab);
 
+gint		 gedit_window_get_num_tabs		(GeditWindow         *window);
+
 /* Helper functions */
 GeditView	*gedit_window_get_active_view		(GeditWindow         *window);
 GeditDocument	*gedit_window_get_active_document	(GeditWindow         *window);
gedit-2.20.4/geditだけに発見: gedit-window.h~
diff -ru gedit-2.20.4.orig/gedit/gedit.c gedit-2.20.4/gedit/gedit.c
--- gedit-2.20.4.orig/gedit/gedit.c	2007-11-05 02:30:38.000000000 +0900
+++ gedit-2.20.4/gedit/gedit.c	2008-03-30 15:37:31.000000000 +0900
@@ -280,7 +280,8 @@
 
 	app = gedit_app_get_default ();
 
-	if (new_window_option)
+	if (new_window_option
+	 || gedit_prefs_manager_get_open_in_new_window() != GEDIT_OPEN_IN_NEW_TAB)
 	{
 		window = gedit_app_create_window (app, screen);
 	}
