Skip to content

Commit

Permalink
- Implementing font configuration for code and variables.
Browse files Browse the repository at this point in the history
SVN Rev: 2194
  • Loading branch information
derickr committed Dec 7, 2006
1 parent 2384560 commit 04f876a
Show file tree
Hide file tree
Showing 5 changed files with 322 additions and 16 deletions.
195 changes: 190 additions & 5 deletions gtkdbgp.glade
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -2744,6 +2745,190 @@
</packing>
</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>
Expand Down
15 changes: 13 additions & 2 deletions src/callbacks.c
Expand Up @@ -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];
Expand All @@ -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();
Expand All @@ -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);
Expand All @@ -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];
Expand All @@ -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();
Expand All @@ -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);

Expand Down

0 comments on commit 04f876a

Please sign in to comment.