Skip to content
Browse files

- Implementing font configuration for code and variables.

SVN Rev: 2194
  • Loading branch information...
1 parent 2384560 commit 04f876a82a9c41097cc6c61343ac84063ac088a1 @derickr committed Dec 7, 2006
Showing with 322 additions and 16 deletions.
  1. +190 −5 gtkdbgp.glade
  2. +13 −2 src/callbacks.c
  3. +98 −5 src/interface.c
  4. +13 −2 src/main.c
  5. +8 −2 src/server.c
View
195 gtkdbgp.glade
@@ -2281,7 +2281,7 @@
<child>
<widget class="GtkLabel" id="label19">
- <property name="width_request">150</property>
+ <property name="width_request">160</property>
<property name="visible">True</property>
<property name="label" translatable="yes">_Port:</property>
<property name="use_underline">True</property>
@@ -2313,7 +2313,7 @@
<child>
<widget class="GtkEntry" id="port">
- <property name="width_request">160</property>
+ <property name="width_request">140</property>
<property name="visible">True</property>
<property name="tooltip" translatable="yes">This is the port on which the DBGP client listens. The default value is 9000.</property>
<property name="can_focus">True</property>
@@ -2415,7 +2415,7 @@
<child>
<widget class="GtkLabel" id="label20">
- <property name="width_request">150</property>
+ <property name="width_request">160</property>
<property name="visible">True</property>
<property name="label" translatable="yes">Maximum c_hildren:</property>
<property name="use_underline">True</property>
@@ -2509,6 +2509,7 @@
<child>
<widget class="GtkEntry" id="max_string_length">
+ <property name="width_request">140</property>
<property name="visible">True</property>
<property name="tooltip" translatable="yes">The number of bytes that will be returns for a string while fetching variable contents.</property>
<property name="can_focus">True</property>
@@ -2532,7 +2533,7 @@
<child>
<widget class="GtkSpinButton" id="max_children">
- <property name="width_request">160</property>
+ <property name="width_request">140</property>
<property name="visible">True</property>
<property name="tooltip" translatable="yes">The maximum number of children to be returned in a single request for variable warnings.</property>
<property name="can_focus">True</property>
@@ -2556,7 +2557,7 @@
<child>
<widget class="GtkSpinButton" id="max_depth">
- <property name="width_request">160</property>
+ <property name="width_request">140</property>
<property name="visible">True</property>
<property name="tooltip" translatable="yes">The number of levels deep that will be returned for variable contents.</property>
<property name="can_focus">True</property>
@@ -2745,6 +2746,190 @@
</child>
<child>
+ <widget class="GtkAlignment" id="alignment33">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">5</property>
+ <property name="bottom_padding">5</property>
+ <property name="left_padding">5</property>
+ <property name="right_padding">5</property>
+
+ <child>
+ <widget class="GtkFrame" id="frame8">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">0.5</property>
+ <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment34">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">4</property>
+ <property name="bottom_padding">4</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkTable" id="table9">
+ <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">0</property>
+ <property name="column_spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="label62">
+ <property name="width_request">150</property>
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Font for code display:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_RIGHT</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="mnemonic_widget">max_depth</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_START</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_padding">4</property>
+ <property name="y_padding">4</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label63">
+ <property name="width_request">160</property>
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Font for variable display:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_RIGHT</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="mnemonic_widget">max_string_length</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_START</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_padding">4</property>
+ <property name="y_padding">4</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkFontButton" id="font_code_button">
+ <property name="width_request">140</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="show_style">True</property>
+ <property name="show_size">True</property>
+ <property name="use_font">False</property>
+ <property name="use_size">False</property>
+ <property name="focus_on_click">True</property>
+ <signal name="font_set" handler="on_font_code_button_font_set" last_modification_time="Wed, 06 Dec 2006 00:41:14 GMT"/>
+ </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="GtkFontButton" id="font_var_button">
+ <property name="width_request">140</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="show_style">True</property>
+ <property name="show_size">True</property>
+ <property name="use_font">False</property>
+ <property name="use_size">False</property>
+ <property name="focus_on_click">True</property>
+ <signal name="font_set" handler="on_font_var_button_font_set" last_modification_time="Wed, 06 Dec 2006 00:41:08 GMT"/>
+ </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>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label61">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Appearance&lt;/b&gt;</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</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="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
<widget class="GtkAlignment" id="alignment3">
<property name="height_request">40</property>
<property name="visible">True</property>
View
15 src/callbacks.c
@@ -153,7 +153,7 @@ void
on_preferences_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
- GtkWidget *PortWidget, *MaxDepth, *MaxStringLength, *MaxChildren, *PHPErrorBreak;
+ GtkWidget *PortWidget, *MaxDepth, *MaxStringLength, *MaxChildren, *PHPErrorBreak, *FontCode, *FontVar;
int port, max_string_length;
GConfEngine *conf;
char small_buffer[32];
@@ -164,6 +164,8 @@ on_preferences_activate (GtkMenuItem *menuitem,
MaxStringLength = lookup_widget(GTK_WIDGET(DebuggerSettingsWindow), "max_string_length");
MaxChildren = lookup_widget(GTK_WIDGET(DebuggerSettingsWindow), "max_children");
PHPErrorBreak = lookup_widget(GTK_WIDGET(DebuggerSettingsWindow), "break_on_warning");
+ FontCode = lookup_widget(GTK_WIDGET(DebuggerSettingsWindow), "font_code_button");
+ FontVar = lookup_widget(GTK_WIDGET(DebuggerSettingsWindow), "font_var_button");
/* Let's load the settings! */
conf = gconf_engine_get_default();
@@ -180,6 +182,11 @@ on_preferences_activate (GtkMenuItem *menuitem,
gtk_spin_button_set_value(GTK_SPIN_BUTTON(MaxDepth), gconf_engine_get_int(conf, "/apps/gtkdbgp/max_depth", NULL));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(PHPErrorBreak), gconf_engine_get_bool(conf, "/apps/gtkdbgp/break_on_warning", NULL));
+ gtk_font_button_set_font_name(GTK_FONT_BUTTON(FontCode), gconf_engine_get_string(conf, "/apps/gtkdbgp/font/code", NULL));
+ gtk_font_button_set_font_name(GTK_FONT_BUTTON(FontVar), gconf_engine_get_string(conf, "/apps/gtkdbgp/font/var", NULL));
+
+ /* Fontz */
+
gconf_engine_unref(conf);
gtk_widget_show(DebuggerSettingsWindow);
@@ -198,7 +205,7 @@ void
on_ok_clicked (GtkButton *button,
gpointer user_data)
{
- GtkWidget *PortWidget, *MaxDepth, *MaxStringLength, *MaxChildren, *PHPErrorBreak;
+ GtkWidget *PortWidget, *MaxDepth, *MaxStringLength, *MaxChildren, *PHPErrorBreak, *FontCode, *FontVar;
int port, max_string_length;
GConfEngine *conf;
char small_buffer[32];
@@ -211,6 +218,8 @@ on_ok_clicked (GtkButton *button,
MaxStringLength = lookup_widget(GTK_WIDGET(DebuggerSettingsWindow), "max_string_length");
MaxChildren = lookup_widget(GTK_WIDGET(DebuggerSettingsWindow), "max_children");
PHPErrorBreak = lookup_widget(GTK_WIDGET(DebuggerSettingsWindow), "break_on_warning");
+ FontCode = lookup_widget(GTK_WIDGET(DebuggerSettingsWindow), "font_code_button");
+ FontVar = lookup_widget(GTK_WIDGET(DebuggerSettingsWindow), "font_var_button");
/* Let's save the settings! */
conf = gconf_engine_get_default();
@@ -220,6 +229,8 @@ on_ok_clicked (GtkButton *button,
gconf_engine_set_int(conf, "/apps/gtkdbgp/max_children", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(MaxChildren)), NULL);
gconf_engine_set_int(conf, "/apps/gtkdbgp/max_depth", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(MaxDepth)), NULL);
gconf_engine_set_bool(conf, "/apps/gtkdbgp/break_on_warning", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(PHPErrorBreak)), NULL);
+ gconf_engine_set_string(conf, "/apps/gtkdbgp/font/code", gtk_font_button_get_font_name(GTK_FONT_BUTTON(FontCode)), NULL);
+ gconf_engine_set_string(conf, "/apps/gtkdbgp/font/var", gtk_font_button_get_font_name(GTK_FONT_BUTTON(FontVar)), NULL);
gconf_engine_unref(conf);
View
103 src/interface.c
@@ -1363,6 +1363,15 @@ create_DebuggerSettingsWindow (void)
GtkWidget *table3;
GtkWidget *break_on_warning;
GtkWidget *label18;
+ GtkWidget *alignment33;
+ GtkWidget *frame8;
+ GtkWidget *alignment34;
+ GtkWidget *table9;
+ GtkWidget *label62;
+ GtkWidget *label63;
+ GtkWidget *font_code_button;
+ GtkWidget *font_var_button;
+ GtkWidget *label61;
GtkWidget *alignment3;
GtkWidget *hbox2;
GtkWidget *revert;
@@ -1420,7 +1429,7 @@ create_DebuggerSettingsWindow (void)
gtk_table_attach (GTK_TABLE (table1), label19, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 4, 4);
- gtk_widget_set_size_request (label19, 150, -1);
+ gtk_widget_set_size_request (label19, 160, -1);
gtk_label_set_justify (GTK_LABEL (label19), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment (GTK_MISC (label19), 0, 0.5);
gtk_label_set_ellipsize (GTK_LABEL (label19), PANGO_ELLIPSIZE_START);
@@ -1431,7 +1440,7 @@ create_DebuggerSettingsWindow (void)
gtk_table_attach (GTK_TABLE (table1), port, 1, 3, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
- gtk_widget_set_size_request (port, 160, -1);
+ gtk_widget_set_size_request (port, 140, -1);
gtk_tooltips_set_tip (tooltips, port, "This is the port on which the DBGP client listens. The default value is 9000.", NULL);
gtk_widget_add_accelerator (port, "activate", accel_group,
GDK_P, (GdkModifierType) GDK_MOD1_MASK,
@@ -1473,7 +1482,7 @@ create_DebuggerSettingsWindow (void)
gtk_table_attach (GTK_TABLE (table2), label20, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 4, 4);
- gtk_widget_set_size_request (label20, 150, -1);
+ gtk_widget_set_size_request (label20, 160, -1);
gtk_label_set_justify (GTK_LABEL (label20), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment (GTK_MISC (label20), 0, 0.5);
gtk_label_set_ellipsize (GTK_LABEL (label20), PANGO_ELLIPSIZE_START);
@@ -1504,6 +1513,7 @@ create_DebuggerSettingsWindow (void)
gtk_table_attach (GTK_TABLE (table2), max_string_length, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
+ gtk_widget_set_size_request (max_string_length, 140, -1);
gtk_tooltips_set_tip (tooltips, max_string_length, "The number of bytes that will be returns for a string while fetching variable contents.", NULL);
gtk_widget_add_accelerator (max_string_length, "activate", accel_group,
GDK_S, (GdkModifierType) GDK_MOD1_MASK,
@@ -1516,7 +1526,7 @@ create_DebuggerSettingsWindow (void)
gtk_table_attach (GTK_TABLE (table2), max_children, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
- gtk_widget_set_size_request (max_children, 160, -1);
+ gtk_widget_set_size_request (max_children, 140, -1);
gtk_tooltips_set_tip (tooltips, max_children, "The maximum number of children to be returned in a single request for variable warnings.", NULL);
gtk_widget_add_accelerator (max_children, "activate", accel_group,
GDK_H, (GdkModifierType) GDK_MOD1_MASK,
@@ -1530,7 +1540,7 @@ create_DebuggerSettingsWindow (void)
gtk_table_attach (GTK_TABLE (table2), max_depth, 1, 2, 2, 3,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
- gtk_widget_set_size_request (max_depth, 160, -1);
+ gtk_widget_set_size_request (max_depth, 140, -1);
gtk_tooltips_set_tip (tooltips, max_depth, "The number of levels deep that will be returned for variable contents.", NULL);
gtk_widget_add_accelerator (max_depth, "activate", accel_group,
GDK_D, (GdkModifierType) GDK_MOD1_MASK,
@@ -1590,6 +1600,72 @@ create_DebuggerSettingsWindow (void)
gtk_frame_set_label_widget (GTK_FRAME (frame3), label18);
gtk_label_set_use_markup (GTK_LABEL (label18), TRUE);
+ alignment33 = gtk_alignment_new (0.5, 0.5, 1, 1);
+ gtk_widget_set_name (alignment33, "alignment33");
+ gtk_widget_show (alignment33);
+ gtk_box_pack_start (GTK_BOX (vbox4), alignment33, TRUE, TRUE, 0);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (alignment33), 5, 5, 5, 5);
+
+ frame8 = gtk_frame_new (NULL);
+ gtk_widget_set_name (frame8, "frame8");
+ gtk_widget_show (frame8);
+ gtk_container_add (GTK_CONTAINER (alignment33), frame8);
+
+ alignment34 = gtk_alignment_new (0.5, 0.5, 1, 1);
+ gtk_widget_set_name (alignment34, "alignment34");
+ gtk_widget_show (alignment34);
+ gtk_container_add (GTK_CONTAINER (frame8), alignment34);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (alignment34), 4, 4, 12, 0);
+
+ table9 = gtk_table_new (2, 2, FALSE);
+ gtk_widget_set_name (table9, "table9");
+ gtk_widget_show (table9);
+ gtk_container_add (GTK_CONTAINER (alignment34), table9);
+
+ label62 = gtk_label_new_with_mnemonic ("Font for code display:");
+ gtk_widget_set_name (label62, "label62");
+ gtk_widget_show (label62);
+ gtk_table_attach (GTK_TABLE (table9), label62, 0, 1, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 4, 4);
+ gtk_widget_set_size_request (label62, 150, -1);
+ gtk_label_set_justify (GTK_LABEL (label62), GTK_JUSTIFY_RIGHT);
+ gtk_misc_set_alignment (GTK_MISC (label62), 0, 0.5);
+ gtk_label_set_ellipsize (GTK_LABEL (label62), PANGO_ELLIPSIZE_START);
+
+ label63 = gtk_label_new_with_mnemonic ("Font for variable display:");
+ gtk_widget_set_name (label63, "label63");
+ gtk_widget_show (label63);
+ gtk_table_attach (GTK_TABLE (table9), label63, 0, 1, 1, 2,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 4, 4);
+ gtk_widget_set_size_request (label63, 160, -1);
+ gtk_label_set_justify (GTK_LABEL (label63), GTK_JUSTIFY_RIGHT);
+ gtk_misc_set_alignment (GTK_MISC (label63), 0, 0.5);
+ gtk_label_set_ellipsize (GTK_LABEL (label63), PANGO_ELLIPSIZE_START);
+
+ font_code_button = gtk_font_button_new ();
+ gtk_widget_set_name (font_code_button, "font_code_button");
+ gtk_widget_show (font_code_button);
+ gtk_table_attach (GTK_TABLE (table9), font_code_button, 1, 2, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_widget_set_size_request (font_code_button, 140, -1);
+
+ font_var_button = gtk_font_button_new ();
+ gtk_widget_set_name (font_var_button, "font_var_button");
+ gtk_widget_show (font_var_button);
+ gtk_table_attach (GTK_TABLE (table9), font_var_button, 1, 2, 1, 2,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_widget_set_size_request (font_var_button, 140, -1);
+
+ label61 = gtk_label_new ("<b>Appearance</b>");
+ gtk_widget_set_name (label61, "label61");
+ gtk_widget_show (label61);
+ gtk_frame_set_label_widget (GTK_FRAME (frame8), label61);
+ gtk_label_set_use_markup (GTK_LABEL (label61), TRUE);
+
alignment3 = gtk_alignment_new (0, 0.5, 1, 1);
gtk_widget_set_name (alignment3, "alignment3");
gtk_widget_show (alignment3);
@@ -1645,6 +1721,12 @@ create_DebuggerSettingsWindow (void)
GTK_WIDGET_SET_FLAGS (ok, GTK_CAN_DEFAULT);
gtk_button_set_relief (GTK_BUTTON (ok), GTK_RELIEF_NONE);
+ g_signal_connect ((gpointer) font_code_button, "font_set",
+ G_CALLBACK (on_font_code_button_font_set),
+ NULL);
+ g_signal_connect ((gpointer) font_var_button, "font_set",
+ G_CALLBACK (on_font_var_button_font_set),
+ NULL);
g_signal_connect ((gpointer) revert, "clicked",
G_CALLBACK (on_revert_clicked),
NULL);
@@ -1659,6 +1741,8 @@ create_DebuggerSettingsWindow (void)
gtk_label_set_mnemonic_widget (GTK_LABEL (label20), max_children);
gtk_label_set_mnemonic_widget (GTK_LABEL (label21), max_string_length);
gtk_label_set_mnemonic_widget (GTK_LABEL (label22), max_depth);
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label62), max_depth);
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label63), max_string_length);
/* Store pointers to all widgets, for use by lookup_widget(). */
GLADE_HOOKUP_OBJECT_NO_REF (DebuggerSettingsWindow, DebuggerSettingsWindow, "DebuggerSettingsWindow");
@@ -1688,6 +1772,15 @@ create_DebuggerSettingsWindow (void)
GLADE_HOOKUP_OBJECT (DebuggerSettingsWindow, table3, "table3");
GLADE_HOOKUP_OBJECT (DebuggerSettingsWindow, break_on_warning, "break_on_warning");
GLADE_HOOKUP_OBJECT (DebuggerSettingsWindow, label18, "label18");
+ GLADE_HOOKUP_OBJECT (DebuggerSettingsWindow, alignment33, "alignment33");
+ GLADE_HOOKUP_OBJECT (DebuggerSettingsWindow, frame8, "frame8");
+ GLADE_HOOKUP_OBJECT (DebuggerSettingsWindow, alignment34, "alignment34");
+ GLADE_HOOKUP_OBJECT (DebuggerSettingsWindow, table9, "table9");
+ GLADE_HOOKUP_OBJECT (DebuggerSettingsWindow, label62, "label62");
+ GLADE_HOOKUP_OBJECT (DebuggerSettingsWindow, label63, "label63");
+ GLADE_HOOKUP_OBJECT (DebuggerSettingsWindow, font_code_button, "font_code_button");
+ GLADE_HOOKUP_OBJECT (DebuggerSettingsWindow, font_var_button, "font_var_button");
+ GLADE_HOOKUP_OBJECT (DebuggerSettingsWindow, label61, "label61");
GLADE_HOOKUP_OBJECT (DebuggerSettingsWindow, alignment3, "alignment3");
GLADE_HOOKUP_OBJECT (DebuggerSettingsWindow, hbox2, "hbox2");
GLADE_HOOKUP_OBJECT (DebuggerSettingsWindow, revert, "revert");
View
15 src/main.c
@@ -29,6 +29,7 @@ int main (int argc, char *argv[])
GConfEngine *conf;
int port, max_children, max_depth, max_string_length;
gboolean break_on_warning;
+ gchar *code_font, *var_font;
/* Make default settings */
conf = gconf_engine_get_default();
@@ -52,6 +53,16 @@ int main (int argc, char *argv[])
max_string_length = 512;
gconf_engine_set_int(conf, "/apps/gtkdbgp/max_string_length", max_string_length, NULL);
}
+ code_font = gconf_engine_get_string(conf, "/apps/gtkdbgp/font/code", NULL);
+ if (!code_font) {
+ code_font = "Monospace 9";
+ gconf_engine_set_string(conf, "/apps/gtkdbgp/font/code", code_font, NULL);
+ }
+ var_font = gconf_engine_get_string(conf, "/apps/gtkdbgp/font/var", NULL);
+ if (!var_font) {
+ var_font = "Sans 8";
+ gconf_engine_set_string(conf, "/apps/gtkdbgp/font/var", var_font, NULL);
+ }
break_on_warning = gconf_engine_get_bool(conf, "/apps/gtkdbgp/break_on_warning", NULL);
gconf_engine_set_bool(conf, "/apps/gtkdbgp/break_on_warning", break_on_warning, NULL);
gconf_engine_unref(conf);
@@ -71,9 +82,9 @@ int main (int argc, char *argv[])
/* Create two renders */
r1 = gtk_cell_renderer_text_new();
- g_object_set(r1, "font-desc", pango_font_description_from_string ("sans 8"), "xalign", 0.99999, NULL);
+ g_object_set(r1, "font-desc", pango_font_description_from_string (var_font), "xalign", 0.99999, NULL);
r2 = gtk_cell_renderer_text_new();
- g_object_set(r2, "font-desc", pango_font_description_from_string ("sans 8"), NULL);
+ g_object_set(r2, "font-desc", pango_font_description_from_string (var_font), NULL);
/* Setup the stack view store */
store = gtk_list_store_new(STACK_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
View
10 src/server.c
@@ -415,7 +415,7 @@ static void add_property(GtkTreeStore *store, GtkTreeIter *parent_iter, xdebug_x
children_attr = xdebug_xml_fetch_attribute(property, "children");
numchildren_attr = xdebug_xml_fetch_attribute(property, "numchildren");
- if (children_attr && children_attr->value && strcmp(children_attr->value, "1") == 0) {
+ if (children_attr && numchildren_attr && children_attr->value && strcmp(children_attr->value, "1") == 0) {
pages = strtol(numchildren_attr->value, NULL, 10);
pages = (pages + max_children - 1) / max_children;
gtk_tree_model_get(store, parent_iter, VARVIEW_PAGES_FETCHED, &fetch_page, -1);
@@ -801,12 +801,18 @@ void add_source_file(gchar* filename, gchar *source)
gchar *unencoded, *sanitized_label;
xdebug_arg *lines;
dbgp_code_page *page;
+ GConfEngine *conf;
+ gchar *code_font;
if (xdebug_hash_find(code_tabs_hash, filename, strlen(filename), (void*) &page))
{
return;
}
+ /* Fetch the font */
+ conf = gconf_engine_get_default();
+ code_font = gconf_engine_get_string(conf, "/apps/gtkdbgp/font/code", NULL);
+
/* Setup the store */
store = gtk_list_store_new (SOURCE_N_COLUMNS, G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
@@ -867,7 +873,7 @@ void add_source_file(gchar* filename, gchar *source)
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview3), -1, "#", r3, "text", SOURCE_LINENO_COLUMN, NULL);
r4 = gtk_cell_renderer_text_new();
- g_object_set(r4, "font-desc", pango_font_description_from_string ("Monospace 8"), NULL);
+ g_object_set(r4, "font-desc", pango_font_description_from_string (code_font), NULL);
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview3), -1, "Code", r4, "text", SOURCE_LINE_COLUMN, NULL);
gtk_tree_view_set_model(GTK_TREE_VIEW(treeview3), GTK_TREE_MODEL(store));

0 comments on commit 04f876a

Please sign in to comment.
Something went wrong with that request. Please try again.