SF.net SVN: geany:[2796] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Mon Jul 21 14:28:46 UTC 2008


Revision: 2796
          http://geany.svn.sourceforge.net/geany/?rev=2796&view=rev
Author:   ntrel
Date:     2008-07-21 14:28:46 +0000 (Mon, 21 Jul 2008)

Log Message:
-----------
Add new Files pref 'Allow new documents from the command-line'.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/geany.glade
    trunk/src/document.h
    trunk/src/interface.c
    trunk/src/keyfile.c
    trunk/src/main.c
    trunk/src/prefs.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-07-21 14:12:15 UTC (rev 2795)
+++ trunk/ChangeLog	2008-07-21 14:28:46 UTC (rev 2796)
@@ -3,6 +3,9 @@
  * src/main.c, src/socket.c, src/main.h:
    Fix filename encoding for new files at startup from the command-line.
    Make socket open command support filename:line:column syntax.
+ * src/interface.c, src/prefs.c, src/keyfile.c, src/document.h,
+   src/main.c, geany.glade:
+   Add new Files pref 'Allow new documents from the command-line'.
 
 
 2008-07-20  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>

Modified: trunk/geany.glade
===================================================================
--- trunk/geany.glade	2008-07-21 14:12:15 UTC (rev 2795)
+++ trunk/geany.glade	2008-07-21 14:28:46 UTC (rev 2796)
@@ -6697,183 +6697,216 @@
 			  <property name="spacing">3</property>
 
 			  <child>
-			    <widget class="GtkTable" id="table5">
+			    <widget class="GtkVBox" id="vbox38">
 			      <property name="visible">True</property>
-			      <property name="n_rows">4</property>
-			      <property name="n_columns">2</property>
 			      <property name="homogeneous">False</property>
-			      <property name="row_spacing">3</property>
-			      <property name="column_spacing">0</property>
+			      <property name="spacing">0</property>
 
 			      <child>
-				<widget class="GtkEventBox" id="eventbox1">
+				<widget class="GtkCheckButton" id="check_cmdline_new_files">
 				  <property name="visible">True</property>
-				  <property name="tooltip" translatable="yes">Sets the default encoding for newly created files.</property>
-				  <property name="visible_window">True</property>
-				  <property name="above_child">False</property>
-
-				  <child>
-				    <widget class="GtkComboBox" id="combo_new_encoding">
-				      <property name="visible">True</property>
-				      <property name="add_tearoffs">False</property>
-				      <property name="focus_on_click">True</property>
-				    </widget>
-				  </child>
+				  <property name="tooltip" translatable="yes">Start a new file for each command-line filename that doesn't exist</property>
+				  <property name="can_focus">True</property>
+				  <property name="label" translatable="yes">Allow new documents from the command-line</property>
+				  <property name="use_underline">True</property>
+				  <property name="relief">GTK_RELIEF_NORMAL</property>
+				  <property name="focus_on_click">True</property>
+				  <property name="active">False</property>
+				  <property name="inconsistent">False</property>
+				  <property name="draw_indicator">True</property>
 				</widget>
 				<packing>
-				  <property name="left_attach">1</property>
-				  <property name="right_attach">2</property>
-				  <property name="top_attach">0</property>
-				  <property name="bottom_attach">1</property>
-				  <property name="x_options">fill</property>
-				  <property name="y_options">fill</property>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
 				</packing>
 			      </child>
 
 			      <child>
-				<widget class="GtkLabel" id="label153">
+				<widget class="GtkTable" id="table5">
 				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Default encoding (new files):</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="left_attach">0</property>
-				  <property name="right_attach">1</property>
-				  <property name="top_attach">0</property>
-				  <property name="bottom_attach">1</property>
-				  <property name="x_options">fill</property>
-				  <property name="y_options"></property>
-				</packing>
-			      </child>
+				  <property name="n_rows">4</property>
+				  <property name="n_columns">2</property>
+				  <property name="homogeneous">False</property>
+				  <property name="row_spacing">3</property>
+				  <property name="column_spacing">0</property>
 
-			      <child>
-				<widget class="GtkLabel" id="label_open_encoding">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Default encoding (existing files):</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="left_attach">0</property>
-				  <property name="right_attach">1</property>
-				  <property name="top_attach">2</property>
-				  <property name="bottom_attach">3</property>
-				  <property name="x_options">fill</property>
-				  <property name="y_options"></property>
-				</packing>
-			      </child>
+				  <child>
+				    <widget class="GtkEventBox" id="eventbox1">
+				      <property name="visible">True</property>
+				      <property name="tooltip" translatable="yes">Sets the default encoding for newly created files.</property>
+				      <property name="visible_window">True</property>
+				      <property name="above_child">False</property>
 
-			      <child>
-				<widget class="GtkEventBox" id="eventbox3">
-				  <property name="visible">True</property>
-				  <property name="tooltip" translatable="yes">Sets the default encoding for opening existing files.</property>
-				  <property name="visible_window">True</property>
-				  <property name="above_child">False</property>
+				      <child>
+					<widget class="GtkComboBox" id="combo_new_encoding">
+					  <property name="visible">True</property>
+					  <property name="add_tearoffs">False</property>
+					  <property name="focus_on_click">True</property>
+					</widget>
+				      </child>
+				    </widget>
+				    <packing>
+				      <property name="left_attach">1</property>
+				      <property name="right_attach">2</property>
+				      <property name="top_attach">0</property>
+				      <property name="bottom_attach">1</property>
+				      <property name="x_options">fill</property>
+				      <property name="y_options">fill</property>
+				    </packing>
+				  </child>
 
 				  <child>
-				    <widget class="GtkComboBox" id="combo_open_encoding">
+				    <widget class="GtkLabel" id="label153">
 				      <property name="visible">True</property>
-				      <property name="add_tearoffs">False</property>
-				      <property name="focus_on_click">True</property>
+				      <property name="label" translatable="yes">Default encoding (new files):</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="left_attach">0</property>
+				      <property name="right_attach">1</property>
+				      <property name="top_attach">0</property>
+				      <property name="bottom_attach">1</property>
+				      <property name="x_options">fill</property>
+				      <property name="y_options"></property>
+				    </packing>
 				  </child>
-				</widget>
-				<packing>
-				  <property name="left_attach">1</property>
-				  <property name="right_attach">2</property>
-				  <property name="top_attach">2</property>
-				  <property name="bottom_attach">3</property>
-				  <property name="x_options">fill</property>
-				  <property name="y_options">fill</property>
-				</packing>
-			      </child>
 
-			      <child>
-				<widget class="GtkCheckButton" id="check_open_encoding">
-				  <property name="visible">True</property>
-				  <property name="tooltip" translatable="yes">This option disables the automatic detection of the file encoding when opening files and opens the file with the specified encoding (usually not needed).</property>
-				  <property name="can_focus">True</property>
-				  <property name="label" translatable="yes">Use fixed encoding when opening files</property>
-				  <property name="use_underline">True</property>
-				  <property name="relief">GTK_RELIEF_NORMAL</property>
-				  <property name="focus_on_click">False</property>
-				  <property name="active">False</property>
-				  <property name="inconsistent">False</property>
-				  <property name="draw_indicator">True</property>
-				</widget>
-				<packing>
-				  <property name="left_attach">0</property>
-				  <property name="right_attach">2</property>
-				  <property name="top_attach">1</property>
-				  <property name="bottom_attach">2</property>
-				  <property name="y_options"></property>
-				</packing>
-			      </child>
+				  <child>
+				    <widget class="GtkLabel" id="label_open_encoding">
+				      <property name="visible">True</property>
+				      <property name="label" translatable="yes">Default encoding (existing files):</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="left_attach">0</property>
+				      <property name="right_attach">1</property>
+				      <property name="top_attach">2</property>
+				      <property name="bottom_attach">3</property>
+				      <property name="x_options">fill</property>
+				      <property name="y_options"></property>
+				    </packing>
+				  </child>
 
-			      <child>
-				<widget class="GtkLabel" id="label210">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Default end of line characters:</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="left_attach">0</property>
-				  <property name="right_attach">1</property>
-				  <property name="top_attach">3</property>
-				  <property name="bottom_attach">4</property>
-				  <property name="x_options">fill</property>
-				  <property name="y_options"></property>
-				</packing>
-			      </child>
+				  <child>
+				    <widget class="GtkEventBox" id="eventbox3">
+				      <property name="visible">True</property>
+				      <property name="tooltip" translatable="yes">Sets the default encoding for opening existing files.</property>
+				      <property name="visible_window">True</property>
+				      <property name="above_child">False</property>
 
-			      <child>
-				<widget class="GtkComboBox" id="combo_eol">
-				  <property name="visible">True</property>
-				  <property name="add_tearoffs">False</property>
-				  <property name="focus_on_click">True</property>
+				      <child>
+					<widget class="GtkComboBox" id="combo_open_encoding">
+					  <property name="visible">True</property>
+					  <property name="add_tearoffs">False</property>
+					  <property name="focus_on_click">True</property>
+					</widget>
+				      </child>
+				    </widget>
+				    <packing>
+				      <property name="left_attach">1</property>
+				      <property name="right_attach">2</property>
+				      <property name="top_attach">2</property>
+				      <property name="bottom_attach">3</property>
+				      <property name="x_options">fill</property>
+				      <property name="y_options">fill</property>
+				    </packing>
+				  </child>
+
+				  <child>
+				    <widget class="GtkCheckButton" id="check_open_encoding">
+				      <property name="visible">True</property>
+				      <property name="tooltip" translatable="yes">This option disables the automatic detection of the file encoding when opening files and opens the file with the specified encoding (usually not needed).</property>
+				      <property name="can_focus">True</property>
+				      <property name="label" translatable="yes">Use fixed encoding when opening files</property>
+				      <property name="use_underline">True</property>
+				      <property name="relief">GTK_RELIEF_NORMAL</property>
+				      <property name="focus_on_click">False</property>
+				      <property name="active">False</property>
+				      <property name="inconsistent">False</property>
+				      <property name="draw_indicator">True</property>
+				    </widget>
+				    <packing>
+				      <property name="left_attach">0</property>
+				      <property name="right_attach">2</property>
+				      <property name="top_attach">1</property>
+				      <property name="bottom_attach">2</property>
+				      <property name="y_options"></property>
+				    </packing>
+				  </child>
+
+				  <child>
+				    <widget class="GtkLabel" id="label210">
+				      <property name="visible">True</property>
+				      <property name="label" translatable="yes">Default end of line characters:</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="left_attach">0</property>
+				      <property name="right_attach">1</property>
+				      <property name="top_attach">3</property>
+				      <property name="bottom_attach">4</property>
+				      <property name="x_options">fill</property>
+				      <property name="y_options"></property>
+				    </packing>
+				  </child>
+
+				  <child>
+				    <widget class="GtkComboBox" id="combo_eol">
+				      <property name="visible">True</property>
+				      <property name="add_tearoffs">False</property>
+				      <property name="focus_on_click">True</property>
+				    </widget>
+				    <packing>
+				      <property name="left_attach">1</property>
+				      <property name="right_attach">2</property>
+				      <property name="top_attach">3</property>
+				      <property name="bottom_attach">4</property>
+				      <property name="x_options">fill</property>
+				      <property name="y_options">fill</property>
+				    </packing>
+				  </child>
 				</widget>
 				<packing>
-				  <property name="left_attach">1</property>
-				  <property name="right_attach">2</property>
-				  <property name="top_attach">3</property>
-				  <property name="bottom_attach">4</property>
-				  <property name="x_options">fill</property>
-				  <property name="y_options">fill</property>
+				  <property name="padding">0</property>
+				  <property name="expand">True</property>
+				  <property name="fill">True</property>
 				</packing>
 			      </child>
 			    </widget>
@@ -7054,113 +7087,126 @@
 		      <property name="right_padding">0</property>
 
 		      <child>
-			<widget class="GtkTable" id="table10">
+			<widget class="GtkVBox" id="vbox37">
 			  <property name="visible">True</property>
-			  <property name="n_rows">2</property>
-			  <property name="n_columns">2</property>
 			  <property name="homogeneous">False</property>
-			  <property name="row_spacing">3</property>
-			  <property name="column_spacing">24</property>
+			  <property name="spacing">0</property>
 
 			  <child>
-			    <widget class="GtkLabel" id="label147">
+			    <widget class="GtkTable" id="table10">
 			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Recent files list length:</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">7</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="left_attach">0</property>
-			      <property name="right_attach">1</property>
-			      <property name="top_attach">0</property>
-			      <property name="bottom_attach">1</property>
-			      <property name="x_options">fill</property>
-			      <property name="y_options"></property>
-			    </packing>
-			  </child>
+			      <property name="n_rows">2</property>
+			      <property name="n_columns">2</property>
+			      <property name="homogeneous">False</property>
+			      <property name="row_spacing">3</property>
+			      <property name="column_spacing">24</property>
 
-			  <child>
-			    <widget class="GtkSpinButton" id="spin_mru">
-			      <property name="visible">True</property>
-			      <property name="tooltip" translatable="yes">Specifies the number of files which are stored in the Recent files list.</property>
-			      <property name="can_focus">True</property>
-			      <property name="climb_rate">1</property>
-			      <property name="digits">0</property>
-			      <property name="numeric">True</property>
-			      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
-			      <property name="snap_to_ticks">False</property>
-			      <property name="wrap">True</property>
-			      <property name="adjustment">4 1 50 1 10 10</property>
-			    </widget>
-			    <packing>
-			      <property name="left_attach">1</property>
-			      <property name="right_attach">2</property>
-			      <property name="top_attach">0</property>
-			      <property name="bottom_attach">1</property>
-			      <property name="x_options">fill</property>
-			      <property name="y_options"></property>
-			    </packing>
-			  </child>
+			      <child>
+				<widget class="GtkLabel" id="label147">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">Recent files list length:</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">7</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="left_attach">0</property>
+				  <property name="right_attach">1</property>
+				  <property name="top_attach">0</property>
+				  <property name="bottom_attach">1</property>
+				  <property name="x_options">fill</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
 
-			  <child>
-			    <widget class="GtkLabel" id="label208">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Disk check timeout:</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="left_attach">0</property>
-			      <property name="right_attach">1</property>
-			      <property name="top_attach">1</property>
-			      <property name="bottom_attach">2</property>
-			      <property name="x_options">fill</property>
-			      <property name="y_options"></property>
-			    </packing>
-			  </child>
+			      <child>
+				<widget class="GtkSpinButton" id="spin_mru">
+				  <property name="visible">True</property>
+				  <property name="tooltip" translatable="yes">Specifies the number of files which are stored in the Recent files list.</property>
+				  <property name="can_focus">True</property>
+				  <property name="climb_rate">1</property>
+				  <property name="digits">0</property>
+				  <property name="numeric">True</property>
+				  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+				  <property name="snap_to_ticks">False</property>
+				  <property name="wrap">True</property>
+				  <property name="adjustment">4 1 50 1 10 10</property>
+				</widget>
+				<packing>
+				  <property name="left_attach">1</property>
+				  <property name="right_attach">2</property>
+				  <property name="top_attach">0</property>
+				  <property name="bottom_attach">1</property>
+				  <property name="x_options">fill</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
 
-			  <child>
-			    <widget class="GtkSpinButton" id="spin_disk_check">
-			      <property name="visible">True</property>
-			      <property name="tooltip" translatable="yes">How often to check for changes to document files on disk, in seconds. Zero disables checking.</property>
-			      <property name="can_focus">True</property>
-			      <property name="climb_rate">1</property>
-			      <property name="digits">0</property>
-			      <property name="numeric">True</property>
-			      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
-			      <property name="snap_to_ticks">False</property>
-			      <property name="wrap">True</property>
-			      <property name="adjustment">30 0 10000 1 10 10</property>
+			      <child>
+				<widget class="GtkLabel" id="label208">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">Disk check timeout:</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="left_attach">0</property>
+				  <property name="right_attach">1</property>
+				  <property name="top_attach">1</property>
+				  <property name="bottom_attach">2</property>
+				  <property name="x_options">fill</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkSpinButton" id="spin_disk_check">
+				  <property name="visible">True</property>
+				  <property name="tooltip" translatable="yes">How often to check for changes to document files on disk, in seconds. Zero disables checking.</property>
+				  <property name="can_focus">True</property>
+				  <property name="climb_rate">1</property>
+				  <property name="digits">0</property>
+				  <property name="numeric">True</property>
+				  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+				  <property name="snap_to_ticks">False</property>
+				  <property name="wrap">True</property>
+				  <property name="adjustment">30 0 10000 1 10 10</property>
+				</widget>
+				<packing>
+				  <property name="left_attach">1</property>
+				  <property name="right_attach">2</property>
+				  <property name="top_attach">1</property>
+				  <property name="bottom_attach">2</property>
+				  <property name="x_options">fill</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
 			    </widget>
 			    <packing>
-			      <property name="left_attach">1</property>
-			      <property name="right_attach">2</property>
-			      <property name="top_attach">1</property>
-			      <property name="bottom_attach">2</property>
-			      <property name="x_options">fill</property>
-			      <property name="y_options"></property>
+			      <property name="padding">0</property>
+			      <property name="expand">True</property>
+			      <property name="fill">True</property>
 			    </packing>
 			  </child>
 			</widget>

Modified: trunk/src/document.h
===================================================================
--- trunk/src/document.h	2008-07-21 14:12:15 UTC (rev 2795)
+++ trunk/src/document.h	2008-07-21 14:28:46 UTC (rev 2796)
@@ -55,6 +55,7 @@
 	guint			mru_length;
 	gint			default_eol_character;
 	gint			disk_check_timeout;
+	gboolean		cmdline_new_files;	/* New file if command-line filename doesn't exist */
 }
 GeanyFilePrefs;
 

Modified: trunk/src/interface.c
===================================================================
--- trunk/src/interface.c	2008-07-21 14:12:15 UTC (rev 2795)
+++ trunk/src/interface.c	2008-07-21 14:28:46 UTC (rev 2796)
@@ -2766,6 +2766,8 @@
   GtkWidget *frame6;
   GtkWidget *alignment7;
   GtkWidget *vbox8;
+  GtkWidget *vbox38;
+  GtkWidget *check_cmdline_new_files;
   GtkWidget *table5;
   GtkWidget *eventbox1;
   GtkWidget *combo_new_encoding;
@@ -2786,6 +2788,7 @@
   GtkWidget *label19;
   GtkWidget *frame17;
   GtkWidget *alignment20;
+  GtkWidget *vbox37;
   GtkWidget *table10;
   GtkWidget *label147;
   GtkObject *spin_mru_adj;
@@ -4005,9 +4008,18 @@
   gtk_widget_show (vbox8);
   gtk_container_add (GTK_CONTAINER (alignment7), vbox8);
 
+  vbox38 = gtk_vbox_new (FALSE, 0);
+  gtk_widget_show (vbox38);
+  gtk_box_pack_start (GTK_BOX (vbox8), vbox38, FALSE, TRUE, 0);
+
+  check_cmdline_new_files = gtk_check_button_new_with_mnemonic (_("Allow new documents from the command-line"));
+  gtk_widget_show (check_cmdline_new_files);
+  gtk_box_pack_start (GTK_BOX (vbox38), check_cmdline_new_files, FALSE, FALSE, 0);
+  gtk_tooltips_set_tip (tooltips, check_cmdline_new_files, _("Start a new file for each command-line filename that doesn't exist"), NULL);
+
   table5 = gtk_table_new (4, 2, FALSE);
   gtk_widget_show (table5);
-  gtk_box_pack_start (GTK_BOX (vbox8), table5, FALSE, TRUE, 0);
+  gtk_box_pack_start (GTK_BOX (vbox38), table5, TRUE, TRUE, 0);
   gtk_table_set_row_spacings (GTK_TABLE (table5), 3);
 
   eventbox1 = gtk_event_box_new ();
@@ -4122,9 +4134,13 @@
   gtk_container_add (GTK_CONTAINER (frame17), alignment20);
   gtk_alignment_set_padding (GTK_ALIGNMENT (alignment20), 0, 0, 12, 0);
 
+  vbox37 = gtk_vbox_new (FALSE, 0);
+  gtk_widget_show (vbox37);
+  gtk_container_add (GTK_CONTAINER (alignment20), vbox37);
+
   table10 = gtk_table_new (2, 2, FALSE);
   gtk_widget_show (table10);
-  gtk_container_add (GTK_CONTAINER (alignment20), table10);
+  gtk_box_pack_start (GTK_BOX (vbox37), table10, TRUE, TRUE, 0);
   gtk_table_set_row_spacings (GTK_TABLE (table10), 3);
   gtk_table_set_col_spacings (GTK_TABLE (table10), 24);
 
@@ -4913,6 +4929,8 @@
   GLADE_HOOKUP_OBJECT (prefs_dialog, frame6, "frame6");
   GLADE_HOOKUP_OBJECT (prefs_dialog, alignment7, "alignment7");
   GLADE_HOOKUP_OBJECT (prefs_dialog, vbox8, "vbox8");
+  GLADE_HOOKUP_OBJECT (prefs_dialog, vbox38, "vbox38");
+  GLADE_HOOKUP_OBJECT (prefs_dialog, check_cmdline_new_files, "check_cmdline_new_files");
   GLADE_HOOKUP_OBJECT (prefs_dialog, table5, "table5");
   GLADE_HOOKUP_OBJECT (prefs_dialog, eventbox1, "eventbox1");
   GLADE_HOOKUP_OBJECT (prefs_dialog, combo_new_encoding, "combo_new_encoding");
@@ -4933,6 +4951,7 @@
   GLADE_HOOKUP_OBJECT (prefs_dialog, label19, "label19");
   GLADE_HOOKUP_OBJECT (prefs_dialog, frame17, "frame17");
   GLADE_HOOKUP_OBJECT (prefs_dialog, alignment20, "alignment20");
+  GLADE_HOOKUP_OBJECT (prefs_dialog, vbox37, "vbox37");
   GLADE_HOOKUP_OBJECT (prefs_dialog, table10, "table10");
   GLADE_HOOKUP_OBJECT (prefs_dialog, label147, "label147");
   GLADE_HOOKUP_OBJECT (prefs_dialog, spin_mru, "spin_mru");

Modified: trunk/src/keyfile.c
===================================================================
--- trunk/src/keyfile.c	2008-07-21 14:12:15 UTC (rev 2795)
+++ trunk/src/keyfile.c	2008-07-21 14:28:46 UTC (rev 2796)
@@ -101,6 +101,8 @@
 
 static SettingEntry bool_prefs[] =
 {
+	{PACKAGE, "cmdline_new_files", &file_prefs.cmdline_new_files, GINT_TO_POINTER(TRUE)},
+
 	{PACKAGE, "pref_main_suppress_search_dialogs", &search_prefs.suppress_dialogs, GINT_TO_POINTER(FALSE)},
 	{PACKAGE, "pref_main_search_use_current_word", &search_prefs.use_current_word, GINT_TO_POINTER(TRUE)},
 	{"search", "pref_search_current_file_dir", &search_prefs.use_current_file_dir, GINT_TO_POINTER(TRUE)},

Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c	2008-07-21 14:12:15 UTC (rev 2795)
+++ trunk/src/main.c	2008-07-21 14:28:46 UTC (rev 2796)
@@ -657,7 +657,7 @@
 			ui_add_recent_file(doc->file_name);
 		return TRUE;
 	}
-	else
+	else if (file_prefs.cmdline_new_files)
 	{	/* create new file with the given filename */
 		gchar *utf8_filename = utils_get_utf8_from_locale(locale_filename);
 

Modified: trunk/src/prefs.c
===================================================================
--- trunk/src/prefs.c	2008-07-21 14:12:15 UTC (rev 2795)
+++ trunk/src/prefs.c	2008-07-21 14:28:46 UTC (rev 2796)
@@ -99,6 +99,8 @@
 
 static PrefEntry toggle_prefs[] =
 {
+	{"check_cmdline_new_files", &file_prefs.cmdline_new_files},
+
 	{"check_ask_suppress_search_dialogs", &search_prefs.suppress_dialogs},
 	{"check_search_use_current_word", &search_prefs.use_current_word},
 	{"check_fif_current_dir", &search_prefs.use_current_file_dir},


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list