Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
scope - use geany wrappers for some gtk+ functions
  • Loading branch information
zhekov committed Dec 28, 2012
1 parent 20223b5 commit 81f3142
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 26 deletions.
11 changes: 11 additions & 0 deletions scope/ChangeLog
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion scope/docs/codes.html
Expand Up @@ -132,7 +132,7 @@
<td class="tab">same as 02&lt;tid&gt;-stack-list-variables</td></tr>

<tr><td class="nowrap">04&lt;tid&gt;-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">&nbsp;</td><td class="tab">&nbsp;</td><td class="tab">&nbsp;</td></tr>
Expand Down
13 changes: 7 additions & 6 deletions scope/src/break.c
Expand Up @@ -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]);

Expand Down
4 changes: 1 addition & 3 deletions scope/src/conterm.c
Expand Up @@ -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;
Expand Down
13 changes: 7 additions & 6 deletions scope/src/inspect.c
Expand Up @@ -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 &&
Expand Down
8 changes: 4 additions & 4 deletions scope/src/parse.c
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions scope/src/program.c
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion scope/src/utils.c
Expand Up @@ -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))
{
Expand Down
6 changes: 3 additions & 3 deletions scope/src/watch.c
Expand Up @@ -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)
Expand Down

0 comments on commit 81f3142

Please sign in to comment.