|
From: <pa...@us...> - 2008-08-03 15:49:28
|
Revision: 539
http://osmo-pim.svn.sourceforge.net/osmo-pim/?rev=539&view=rev
Author: pasp
Date: 2008-08-03 15:49:38 +0000 (Sun, 03 Aug 2008)
Log Message:
-----------
* Added hidden option to change text separator
Modified Paths:
--------------
trunk/src/notes.c
trunk/src/options_prefs.c
trunk/src/options_prefs.h
Modified: trunk/src/notes.c
===================================================================
--- trunk/src/notes.c 2008-07-31 17:34:11 UTC (rev 538)
+++ trunk/src/notes.c 2008-08-03 15:49:38 UTC (rev 539)
@@ -341,7 +341,9 @@
GUI *appGUI = (GUI *)data;
- chars = (appGUI->nte->editor_textview)->allocation.width / gui_get_char_width (appGUI->nte->fd_notes_font, "=");
+ tmpbuf[0] = config.text_separator;
+ tmpbuf[1] = 0;
+ chars = (appGUI->nte->editor_textview)->allocation.width / gui_get_char_width (appGUI->nte->fd_notes_font, tmpbuf);
if (chars > BUFFER_SIZE) {
chars = BUFFER_SIZE - 2; /* \n + null */
@@ -349,7 +351,7 @@
i = 0;
tmpbuf[i++] = '\n';
- while (i < chars) tmpbuf[i++] = '=';
+ while (i < chars) tmpbuf[i++] = config.text_separator;
tmpbuf[i++] = '\n';
tmpbuf[i] = '\0';
Modified: trunk/src/options_prefs.c
===================================================================
--- trunk/src/options_prefs.c 2008-07-31 17:34:11 UTC (rev 538)
+++ trunk/src/options_prefs.c 2008-08-03 15:49:38 UTC (rev 539)
@@ -221,6 +221,7 @@
config.notes_comp_ratio = 3; /* BEST */
config.notes_sorting_order = GTK_SORT_ASCENDING;
config.notes_sorting_mode = 0;
+ config.text_separator = '=';
g_strlcpy (config.notes_editor_font, "Sans 11", MAXFONTNAME);
}
@@ -1252,6 +1253,13 @@
xmlFree(key);
}
+ if ((!xmlStrcmp(notes_node->name, (const xmlChar *) "text_separator"))) {
+ key = xmlNodeListGetString(doc, notes_node->xmlChildrenNode, 1);
+ if (key != NULL)
+ config.text_separator = key[0];
+ xmlFree(key);
+ }
+
if ((!xmlStrcmp(notes_node->name, (const xmlChar *)"editor_font"))) {
key = xmlNodeListGetString(doc, notes_node->xmlChildrenNode, 1);
if (key != NULL)
@@ -1591,6 +1599,8 @@
xmlNewTextChild(notes_node, NULL, (const xmlChar *) "sorting_order", (xmlChar *) tmpbuf);
snprintf(tmpbuf, 32, "%d", config.notes_sorting_mode);
xmlNewTextChild(notes_node, NULL, (const xmlChar *) "sorting_mode", (xmlChar *) tmpbuf);
+ snprintf(tmpbuf, 32, "%c", config.text_separator);
+ xmlNewTextChild(notes_node, NULL, (const xmlChar *) "text_separator", (xmlChar *) tmpbuf);
snprintf(tmpbuf, MAXFONTNAME, "%s", config.notes_editor_font);
xmlNewTextChild(notes_node, NULL, (const xmlChar *) "editor_font", (xmlChar *) tmpbuf);
Modified: trunk/src/options_prefs.h
===================================================================
--- trunk/src/options_prefs.h 2008-07-31 17:34:11 UTC (rev 538)
+++ trunk/src/options_prefs.h 2008-08-03 15:49:38 UTC (rev 539)
@@ -178,6 +178,7 @@
gint notes_comp_ratio;
gint notes_sorting_order;
gint notes_sorting_mode;
+ gchar text_separator;
gchar notes_editor_font[MAXFONTNAME];
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|