Branch: refs/heads/master Author: Dimitar Zhekov dimitar.zhekov@gmail.com Committer: Dimitar Zhekov dimitar.zhekov@gmail.com Date: Fri, 28 Dec 2012 19:09:29 UTC Commit: 81f31425d3fc08170507a84fe45b54943f0357f3 https://github.com/geany/geany-plugins/commit/81f31425d3fc08170507a84fe45b54...
Log Message: ----------- scope - use geany wrappers for some gtk+ functions
Modified Paths: -------------- scope/ChangeLog scope/docs/codes.html scope/src/break.c scope/src/conterm.c scope/src/inspect.c scope/src/parse.c scope/src/program.c scope/src/utils.c scope/src/watch.c
Modified: scope/ChangeLog 11 files changed, 11 insertions(+), 0 deletions(-) =================================================================== @@ -1,3 +1,14 @@ +2012-12-28 Dimitar Zhekov dimitar.zhekov@gmail.com + + * src/break.c, src/inspect.c, src/parse.c, src/program.c, + src/watch.c: + g_key_file_get_*() -> utils_get_setting_*(), provide reasonable + defaults for some settings on load error. + + * src/conterm.c: + gtk_widget_modify_font() -> ui_widget_modify_font_from_string(). + + 2012-12-27 Dimitar Zhekov dimitar.zhekov@gmail.com
* data/scope.glade, docs/codes.html, docs/scope.html, src/parse.c,
Modified: scope/docs/codes.html 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -132,7 +132,7 @@ <td class="tab">same as 02<tid>-stack-list-variables</td></tr>
<tr><td class="nowrap">04<tid>-stack-info-frame</td> - <td class="tab">at stopped thread without frame</td> + <td class="tab">at stopped thread without address</td> <td class="tab">fill the thread columns</td></tr>
<tr><td class="nowrap"> </td><td class="tab"> </td><td class="tab"> </td></tr>
Modified: scope/src/break.c 13 files changed, 7 insertions(+), 6 deletions(-) =================================================================== @@ -986,12 +986,13 @@ static gboolean break_load(GKeyFile *config, const char *section) char *strings[STRING_COUNT]; gboolean valid = FALSE;
- line = g_key_file_get_integer(config, section, "line", NULL); - type = g_key_file_get_integer(config, section, "type", NULL); - enabled = g_key_file_get_boolean(config, section, "enabled", NULL); - pending = g_key_file_get_boolean(config, section, "pending", NULL); - run_apply = g_key_file_get_boolean(config, section, "run_apply", NULL); - temporary = g_key_file_get_boolean(config, section, "temporary", NULL); + line = utils_get_setting_integer(config, section, "line", 0); + type = utils_get_setting_integer(config, section, "type", 0); + enabled = utils_get_setting_boolean(config, section, "enabled", TRUE); + pending = utils_get_setting_boolean(config, section, "pending", FALSE); + run_apply = utils_get_setting_boolean(config, section, "run_apply", + strchr(BP_BORTS, type) != NULL); + temporary = utils_get_setting_boolean(config, section, "temporary", FALSE); for (i = 0; i < STRING_COUNT; i++) strings[i] = utils_key_file_get_string(config, section, string_names[i]);
Modified: scope/src/conterm.c 4 files changed, 1 insertions(+), 3 deletions(-) =================================================================== @@ -485,14 +485,12 @@ void conterm_init(void) { static const char *const colors[NFD] = { "#00C0C0", "#C0C0C0", "#C00000", "#C0C0C0", "#C000C0" }; - PangoFontDescription *font_desc = pango_font_description_from_string(pref_vte_font); guint i;
console = get_widget("debug_console"); gtk_widget_modify_base(console, GTK_STATE_NORMAL, &pref_vte_colour_back); gtk_widget_modify_cursor(console, &pref_vte_colour_fore, &pref_vte_colour_back); - gtk_widget_modify_font(console, font_desc); - pango_font_description_free(font_desc); + ui_widget_modify_font_from_string(console, pref_vte_font);
debug_context = GTK_TEXT_VIEW(console); dc_output = context_output;
Modified: scope/src/inspect.c 13 files changed, 7 insertions(+), 6 deletions(-) =================================================================== @@ -701,13 +701,14 @@ static gboolean inspect_load(GKeyFile *config, const char *section) { char *name = utils_key_file_get_string(config, section, "name"); gchar *expr = utils_key_file_get_string(config, section, "expr"); - gint hb_mode = g_key_file_get_integer(config, section, "hbit", NULL); + gint hb_mode = utils_get_setting_integer(config, section, "hbit", HB_DEFAULT); char *frame = utils_key_file_get_string(config, section, "frame"); - gboolean run_apply = g_key_file_get_boolean(config, section, "run_apply", NULL); - gint start = g_key_file_get_integer(config, section, "start", NULL); - gint count = g_key_file_get_integer(config, section, "count", NULL); - gboolean expand = g_key_file_get_boolean(config, section, "expand", NULL); - gint format = g_key_file_get_integer(config, section, "format", NULL); + gboolean run_apply = utils_get_setting_boolean(config, section, "run_apply", FALSE); + gint start = utils_get_setting_integer(config, section, "start", 0); + gint count = utils_get_setting_integer(config, section, "count", option_inspect_count); + gboolean expand = utils_get_setting_boolean(config, section, "expand", + option_inspect_expand); + gint format = utils_get_setting_integer(config, section, "format", FORMAT_NATURAL); gboolean valid = FALSE;
if (name && inspect_name_valid(name) && expr && (unsigned) hb_mode < HB_COUNT &&
Modified: scope/src/parse.c 8 files changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -484,9 +484,9 @@ static void parse_mode_free(ParseMode *pm) static gboolean parse_mode_load(GKeyFile *config, const char *section) { char *name = utils_key_file_get_string(config, section, "name"); - gint hb_mode = g_key_file_get_integer(config, section, "hbit", NULL); - gint mr_mode = g_key_file_get_integer(config, section, "member", NULL); - gboolean entry = g_key_file_get_boolean(config, section, "entry", NULL); + gint hb_mode = utils_get_setting_integer(config, section, "hbit", HB_DEFAULT); + gint mr_mode = utils_get_setting_integer(config, section, "member", MR_DEFAULT); + gboolean entry = utils_get_setting_boolean(config, section, "entry", TRUE);
if (name && (unsigned) hb_mode < HB_COUNT && (unsigned) mr_mode < MR_MODIFY) { @@ -559,7 +559,7 @@ void parse_mode_update(const char *name, gint mode, gint value) } }
- if (pm->hb_mode == HB_DEFAULT && pm->mr_mode == MR_DEFAULT && pm->entry == TRUE) + if (pm->hb_mode == HB_DEFAULT && pm->mr_mode == MR_DEFAULT && pm->entry) array_remove(parse_modes, pm); }
Modified: scope/src/program.c 4 files changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -60,8 +60,8 @@ static void recent_program_free(RecentProgram *program)
static gboolean recent_program_load(GKeyFile *config, const char *section) { - gchar *name = g_key_file_get_string(config, section, "name", NULL); - gint id = g_key_file_get_integer(config, section, "id", NULL); + gchar *name = utils_get_setting_string(config, section, "name", NULL); + gint id = utils_get_setting_integer(config, section, "id", 0);
if (name && *name && id > 0 && (recent_bitmap & (1 << id)) == 0 && recent_programs->len < RECENT_COUNT)
Modified: scope/src/utils.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -534,7 +534,7 @@ gboolean utils_key_file_write_to_file(GKeyFile *config, const char *configfile)
gchar *utils_key_file_get_string(GKeyFile *config, const char *section, const char *key) { - gchar *string = g_key_file_get_string(config, section, key, NULL); + gchar *string = utils_get_setting_string(config, section, key, NULL);
if (!validate_column(string, TRUE)) {
Modified: scope/src/watch.c 6 files changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -236,9 +236,9 @@ void watches_delete_all(void) static gboolean watch_load(GKeyFile *config, const char *section) { gchar *expr = utils_key_file_get_string(config, section, "expr"); - gint hb_mode = g_key_file_get_integer(config, section, "hbit", NULL); - gint mr_mode = g_key_file_get_integer(config, section, "member", NULL); - gboolean enabled = g_key_file_get_boolean(config, section, "enabled", NULL); + gint hb_mode = utils_get_setting_integer(config, section, "hbit", HB_DEFAULT); + gint mr_mode = utils_get_setting_integer(config, section, "member", MR_DEFAULT); + gboolean enabled = utils_get_setting_boolean(config, section, "enabled", TRUE); gboolean valid = FALSE;
if (expr && (unsigned) hb_mode < HB_COUNT && (unsigned) mr_mode < MR_MODIFY)
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).