Fix writing empty hidden pref "statusbar_template" key so users can

find it (patch by Dimitar Zhekov, thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5096 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2010-07-08 11:35:32 +00:00
parent 63fadbda13
commit d05db879d1
3 changed files with 18 additions and 5 deletions

View File

@ -4726,8 +4726,10 @@ tab.</td>
</tr>
</tbody>
</table>
<p>statusbar_template default (where <tt class="docutils literal"><span class="pre">\t</span></tt> = tab):</p>
<p>By default, statusbar_template is empty. This tells Geany to use its
internal default, which is currently:</p>
<p><tt class="docutils literal"><span class="pre">line:</span> <span class="pre">%l</span> <span class="pre">/</span> <span class="pre">%L\t</span> <span class="pre">col:</span> <span class="pre">%c\t</span> <span class="pre">sel:</span> <span class="pre">%s\t</span> <span class="pre">%w</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="pre">%t</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="pre">%mmode:</span> <span class="pre">%M</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="pre">encoding:</span> <span class="pre">%e</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="pre">filetype:</span> <span class="pre">%f</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="pre">scope:</span> <span class="pre">%S</span></tt></p>
<p>Note that <tt class="docutils literal"><span class="pre">\t</span></tt> = tab.</p>
<table border="1" class="docutils">
<colgroup>
<col width="34%" />
@ -6135,7 +6137,7 @@ USE OR PERFORMANCE OF THIS SOFTWARE.</p>
<div class="footer">
<hr class="footer" />
<a class="reference" href="geany.txt">View document source</a>.
Generated on: 2010-07-06 14:14 UTC.
Generated on: 2010-07-08 11:31 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>

View File

@ -4065,10 +4065,13 @@ statusbar_template The status bar statistics line format. S
(Search in src/ui_utils.c for details).
================================ =========================================== ==================
statusbar_template default (where ``\t`` = tab):
By default, statusbar_template is empty. This tells Geany to use its
internal default, which is currently:
``line: %l / %L\t col: %c\t sel: %s\t %w %t %mmode: %M encoding: %e filetype: %f scope: %S``
Note that ``\t`` = tab.
================================ =========================================== ==================
Key Description Default
================================ =========================================== ==================

View File

@ -170,7 +170,7 @@ static void add_statusbar_statistics(GString *stats_str,
const gchar *expos; /* % expansion position */
const gchar sp[] = " ";
fmt = statusbar_template ? statusbar_template :
fmt = NZV(statusbar_template) ? statusbar_template :
/* Status bar statistics: col = column, sel = selection. */
_("line: %l / %L\t col: %c\t sel: %s\t %w %t %m"
"mode: %M encoding: %e filetype: %f scope: %S");
@ -2000,7 +2000,14 @@ static void on_load_settings(GObject *obj, GKeyFile *config)
g_assert(statusbar_template == NULL);
statusbar_template = utils_get_setting_string(config,
PACKAGE, "statusbar_template", NULL);
PACKAGE, "statusbar_template", "");
}
static void on_save_settings(GObject *obj, GKeyFile *config)
{
if (!g_key_file_has_key(config, PACKAGE, "statusbar_template", NULL))
g_key_file_set_string(config, PACKAGE, "statusbar_template", statusbar_template);
}
@ -2009,6 +2016,7 @@ void ui_init(void)
GtkWidget *item;
g_signal_connect(geany_object, "load-settings", G_CALLBACK(on_load_settings), NULL);
g_signal_connect(geany_object, "save-settings", G_CALLBACK(on_save_settings), NULL);
init_recent_files();