- Switch from deprecated GtkCombo to GtkComboBox (new since GTK+ 2.4)

This commit is contained in:
Stefan Gehn 2008-09-30 16:50:17 +00:00
parent 2ac45ba0de
commit 2119506e02
4 changed files with 120 additions and 132 deletions

View File

@ -22,35 +22,23 @@
#include "gkrellm.h"
#include "gkrellm-private.h"
#ifdef WIN32
#if defined(WIN32)
#define DEFAULT_CLOCK_FORMAT \
"%#I:%M <span foreground=\"$A\"><small>%S</small></span>"
#define ALT1_CLOCK_FORMAT \
"%#I:%M <span foreground=\"$A\"><small>%p</small></span>"
#define ALT2_CLOCK_FORMAT \
"%#H:%M <span foreground=\"$A\"><small>%S</small></span>"
#define DEFAULT_CAL_FORMAT \
"%a <span foreground=\"$A\"><big><big>%#d</big></big></span> %b"
#define ALT1_CAL_FORMAT \
"<big>%a %b <span foreground=\"$A\">%#d</span></big>"
#define ALT2_CAL_FORMAT \
"%a <span foreground=\"cyan2\"><span font_desc=\"16.5\"><i>%#d</i></span></span> %b"
#define DEFAULT_CLOCK_FORMAT "%#I:%M <span foreground=\"$A\"><small>%S</small></span>"
#define ALT1_CLOCK_FORMAT "%#I:%M <span foreground=\"$A\"><small>%p</small></span>"
#define ALT2_CLOCK_FORMAT "%#H:%M <span foreground=\"$A\"><small>%S</small></span>"
#define DEFAULT_CAL_FORMAT "%a <span foreground=\"$A\"><big><big>%#d</big></big></span> %b"
#define ALT1_CAL_FORMAT "<big>%a %b <span foreground=\"$A\">%#d</span></big>"
#define ALT2_CAL_FORMAT "%a <span foreground=\"cyan2\"><span font_desc=\"16.5\"><i>%#d</i></span></span> %b"
#else
#define DEFAULT_CLOCK_FORMAT \
"%l:%M <span foreground=\"$A\"><small>%S</small></span>"
#define ALT1_CLOCK_FORMAT \
"%l:%M <span foreground=\"$A\"><small>%p</small></span>"
#define ALT2_CLOCK_FORMAT \
"%k:%M <span foreground=\"$A\"><small>%S</small></span>"
#define DEFAULT_CAL_FORMAT \
"%a <span foreground=\"$A\"><big><big>%e</big></big></span> %b"
#define ALT1_CAL_FORMAT \
"<big>%a %b <span foreground=\"$A\">%e</span></big>"
#define ALT2_CAL_FORMAT \
"%a <span foreground=\"cyan2\"><span font_desc=\"16.5\"><i>%e</i></span></span> %b"
#define DEFAULT_CLOCK_FORMAT "%l:%M <span foreground=\"$A\"><small>%S</small></span>"
#define ALT1_CLOCK_FORMAT "%l:%M <span foreground=\"$A\"><small>%p</small></span>"
#define ALT2_CLOCK_FORMAT "%k:%M <span foreground=\"$A\"><small>%S</small></span>"
#define DEFAULT_CAL_FORMAT "%a <span foreground=\"$A\"><big><big>%e</big></big></span> %b"
#define ALT1_CAL_FORMAT "<big>%a %b <span foreground=\"$A\">%e</span></big>"
#define ALT2_CAL_FORMAT "%a <span foreground=\"cyan2\"><span font_desc=\"16.5\"><i>%e</i></span></span> %b"
#endif
@ -120,9 +108,9 @@ chime_func(gpointer data)
ChimeData *chime = (ChimeData *)data;
gint counter;
if (strlen(chime->command))
if (strlen(chime->command))
{
if (chime->count > 12)
if (chime->count > 12)
chime->count -= 12;
for (counter = 0; counter < chime -> count; counter ++)
@ -328,7 +316,7 @@ draw_cal(void)
gkrellm_draw_decal_markup(pcal, d_cal, cal_string);
gkrellm_decal_text_set_offset(d_cal, (d_cal->w - w) / 2, 0);
gkrellm_draw_panel_layers(pcal);
g_free(cal_string);
}
@ -471,7 +459,7 @@ update_clock(void)
draw_cal();
if (ptm->tm_hour != hour_prev && hour_prev != -1)
{
if (!chime_block && hour_chime_command && *hour_chime_command)
if (!chime_block && hour_chime_command && *hour_chime_command)
{
chime = g_new0(ChimeData, 1);
chime -> command = strdup(hour_chime_command);
@ -483,7 +471,7 @@ update_clock(void)
{
if ( !chime_block && (ptm->tm_min % 15) == 0
&& quarter_chime_command && *quarter_chime_command
)
)
{
chime = g_new0(ChimeData, 1);
chime -> command = strdup(quarter_chime_command);
@ -572,8 +560,8 @@ static GtkWidget *cal_launch_entry,
*cal_enable_button,
*loop_chime_button;
static GtkWidget *cal_format_combo,
*clock_format_combo;
static GtkWidget *cal_format_combo_box,
*clock_format_combo_box;
static void
@ -626,10 +614,10 @@ static void
cal_format_cb(GtkWidget *widget, gpointer data)
{
gchar *s, *check;
GtkWidget *entry;
s = gtk_combo_box_get_active_text(GTK_COMBO_BOX(cal_format_combo));
if (s == NULL)
return;
entry = gtk_bin_get_child(GTK_BIN(cal_format_combo_box));
s = gkrellm_gtk_entry_get_text(&entry);
check = strftime_format(s, cal_alt_color_string);
@ -653,8 +641,10 @@ static void
clock_format_cb(GtkWidget *widget, gpointer data)
{
gchar *s, *check;
GtkWidget *entry;
s = gtk_combo_box_get_active_text(GTK_COMBO_BOX(clock_format_combo));
entry = gtk_bin_get_child(GTK_BIN(clock_format_combo_box));
s = gkrellm_gtk_entry_get_text(&entry);
check = strftime_format(s, clock_alt_color_string);
@ -717,14 +707,14 @@ create_clock_tab(GtkWidget *tab_vbox)
gtk_box_pack_start(GTK_BOX(vbox1), hbox, FALSE, FALSE, 6);
label = gtk_label_new(_("Display format string:"));
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
cal_format_combo = gtk_combo_box_entry_new_text();
gtk_box_pack_start(GTK_BOX(vbox1), cal_format_combo, TRUE, TRUE, 0);
gtk_combo_box_append_text(GTK_COMBO_BOX(cal_format_combo), cal_format);
gtk_combo_box_append_text(GTK_COMBO_BOX(cal_format_combo), DEFAULT_CAL_FORMAT);
gtk_combo_box_append_text(GTK_COMBO_BOX(cal_format_combo), ALT1_CAL_FORMAT);
gtk_combo_box_append_text(GTK_COMBO_BOX(cal_format_combo), ALT2_CAL_FORMAT);
gtk_combo_box_set_active(GTK_COMBO_BOX(cal_format_combo), 0);
g_signal_connect(G_OBJECT(GTK_COMBO_BOX(cal_format_combo)), "changed",
cal_format_combo_box = gtk_combo_box_entry_new_text();
gtk_box_pack_start(GTK_BOX(vbox1), cal_format_combo_box, TRUE, TRUE, 0);
gtk_combo_box_append_text(GTK_COMBO_BOX(cal_format_combo_box), cal_format);
gtk_combo_box_append_text(GTK_COMBO_BOX(cal_format_combo_box), DEFAULT_CAL_FORMAT);
gtk_combo_box_append_text(GTK_COMBO_BOX(cal_format_combo_box), ALT1_CAL_FORMAT);
gtk_combo_box_append_text(GTK_COMBO_BOX(cal_format_combo_box), ALT2_CAL_FORMAT);
gtk_combo_box_set_active(GTK_COMBO_BOX(cal_format_combo_box), 0);
g_signal_connect(G_OBJECT(GTK_COMBO_BOX(cal_format_combo_box)), "changed",
G_CALLBACK(cal_format_cb), NULL);
vbox1 = gkrellm_gtk_category_vbox(vbox, _("Clock"), 4, 0, TRUE);
@ -736,14 +726,14 @@ create_clock_tab(GtkWidget *tab_vbox)
gtk_box_pack_start(GTK_BOX(vbox1), hbox, FALSE, FALSE, 6);
label = gtk_label_new(_("Display format string:"));
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
clock_format_combo = gtk_combo_box_entry_new_text();
gtk_box_pack_start(GTK_BOX(vbox1), clock_format_combo, TRUE, TRUE, 0);
gtk_combo_box_append_text(GTK_COMBO_BOX(clock_format_combo), clock_format);
gtk_combo_box_append_text(GTK_COMBO_BOX(clock_format_combo), DEFAULT_CLOCK_FORMAT);
gtk_combo_box_append_text(GTK_COMBO_BOX(clock_format_combo), ALT1_CLOCK_FORMAT);
gtk_combo_box_append_text(GTK_COMBO_BOX(clock_format_combo), ALT2_CLOCK_FORMAT);
gtk_combo_box_set_active(GTK_COMBO_BOX(clock_format_combo), 0);
g_signal_connect(G_OBJECT(GTK_COMBO_BOX(clock_format_combo)), "changed",
clock_format_combo_box = gtk_combo_box_entry_new_text();
gtk_box_pack_start(GTK_BOX(vbox1), clock_format_combo_box, TRUE, TRUE, 0);
gtk_combo_box_append_text(GTK_COMBO_BOX(clock_format_combo_box), clock_format);
gtk_combo_box_append_text(GTK_COMBO_BOX(clock_format_combo_box), DEFAULT_CLOCK_FORMAT);
gtk_combo_box_append_text(GTK_COMBO_BOX(clock_format_combo_box), ALT1_CLOCK_FORMAT);
gtk_combo_box_append_text(GTK_COMBO_BOX(clock_format_combo_box), ALT2_CLOCK_FORMAT);
gtk_combo_box_set_active(GTK_COMBO_BOX(clock_format_combo_box), 0);
g_signal_connect(G_OBJECT(GTK_COMBO_BOX(clock_format_combo_box)), "changed",
G_CALLBACK(clock_format_cb), NULL);
/* -- Setup tab */
@ -791,7 +781,7 @@ create_clock_tab(GtkWidget *tab_vbox)
G_CALLBACK(cb_launch_entry), GINT_TO_POINTER(1));
g_signal_connect(G_OBJECT(cal_tooltip_entry), "changed",
G_CALLBACK(cb_launch_entry), GINT_TO_POINTER(1));
gkrellm_gtk_config_launcher(table, 1, &clock_launch_entry,
&clock_tooltip_entry, _("Clock"), &clock_launch);
g_signal_connect(G_OBJECT(clock_launch_entry), "changed",

View File

@ -24,7 +24,9 @@
#include "gkrellm-sysdeps.h"
#define DEFAULT_DATA_FORMAT ("$t - $f free")
#define DEFAULT_DATA_FORMAT (_("$t - $f free"))
#define ALT1_DATA_FORMAT (_("$t - $u used"))
#define ALT2_DATA_FORMAT (_("$t - $U"))
/* Values for force_fs_check */
@ -1339,7 +1341,7 @@ static gboolean
fstab_user_permission(Mount *m)
{
struct stat my_stat;
stat(m->device, &my_stat);
if ( strstr(m->options, "user")
|| (strstr(m->options, "owner") && my_stat.st_uid == uid)
@ -1362,7 +1364,7 @@ fix_fstab_mountable_changed(FSmon *fs)
{
fs->fstab_mounting = FALSE;
return TRUE;
}
}
return FALSE;
}
@ -1495,7 +1497,7 @@ static GtkTreeSelection *selection;
static GtkWidget
*label_entry,
*dir_combo,
*dir_combo_box,
*mount_entry,
*umount_entry,
*mounting_button,
@ -1508,7 +1510,7 @@ static GtkWidget
static GtkWidget *alert_button;
static GtkWidget *data_format_combo;
static GtkWidget *data_format_combo_box;
static gboolean (*original_row_drop_possible)();
@ -1666,14 +1668,17 @@ cb_alert_config(GkrellmAlert *ap, FSmon *fs)
| fstab entries and accordingly set sensitivity of the mounting_button.
*/
static void
cb_combo_changed(GtkWidget *widget)
cb_combo_changed(GtkComboBox *widget, gpointer user_data)
{
Mount *m;
gchar *s;
GtkWidget *entry;
if (!mounting_supported || _GK.client_mode)
return;
s = gkrellm_gtk_entry_get_text(&(GTK_COMBO(dir_combo)->entry));
entry = gtk_bin_get_child(GTK_BIN(dir_combo_box));
s = gkrellm_gtk_entry_get_text(&entry);
m = in_fstab_list(s);
if (m && (fstab_user_permission(m) || uid == 0))
{
@ -1765,7 +1770,7 @@ static void
reset_entries(gboolean level0)
{
gtk_entry_set_text(GTK_ENTRY(label_entry), "");
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(dir_combo)->entry), "");
gtk_combo_box_set_active(GTK_COMBO_BOX(dir_combo_box), -1);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(secondary_button), level0);
if (mounting_button)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mounting_button),FALSE);
@ -1857,8 +1862,8 @@ cb_tree_selection_changed(GtkTreeSelection *selection, gpointer data)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(secondary_button),
secondary);
gtk_entry_set_text(GTK_ENTRY(label_entry), fs->label);
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(dir_combo)->entry),
fs->mount.directory);
gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(dir_combo_box))),
fs->mount.directory);
if (show_button)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(show_button),
fs->show_if_mounted);
@ -1980,8 +1985,9 @@ add_cb(GtkWidget *widget)
label = gkrellm_gtk_entry_get_text(&label_entry);
gkrellm_locale_dup_string(&fs->label, label, &fs->label_shadow);
fs->mount.directory =
g_strdup(gkrellm_gtk_entry_get_text(&(GTK_COMBO(dir_combo)->entry)));
fs->mount.directory = gtk_combo_box_get_active_text(
GTK_COMBO_BOX(dir_combo_box));
if (show_button)
fs->show_if_mounted = GTK_TOGGLE_BUTTON(show_button)->active;
if (mounting_button)
@ -2102,8 +2108,10 @@ cb_data_format(GtkWidget *widget, gpointer data)
GkrellmDecal *d;
gchar *s, buf[256];
gint h_data, h_label;
GtkWidget *entry;
s = gkrellm_gtk_entry_get_text(&(GTK_COMBO(data_format_combo)->entry));
entry = gtk_bin_get_child(GTK_BIN(data_format_combo_box));
s = gkrellm_gtk_entry_get_text(&entry);
/* In case Pango markup tags, don't accept line unless valid markup.
| Ie, markup like <span ...> xxx </span> or <b> xxx </b>
@ -2243,7 +2251,7 @@ create_fs_panels_page(GtkWidget *vbox)
GtkWidget *scrolled;
GtkTreeModel *model;
GtkCellRenderer *renderer;
GList *list, *combo_list;
GList *list;
hbox = gtk_hbox_new(FALSE, 0);
@ -2268,18 +2276,16 @@ create_fs_panels_page(GtkWidget *vbox)
#endif
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2,
GTK_SHRINK, GTK_SHRINK, 2, 1);
dir_combo = gtk_combo_new();
gtk_table_attach_defaults(GTK_TABLE(table), dir_combo, 1, 2, 1, 2);
combo_list = NULL;
dir_combo_box = gtk_combo_box_entry_new_text();
gtk_table_attach_defaults(GTK_TABLE(table), dir_combo_box, 1, 2, 1, 2);
for (list = fstab_list; list; list = list->next)
combo_list = g_list_append(combo_list,
((Mount *)list->data)->directory);
gtk_combo_set_popdown_strings( GTK_COMBO(dir_combo), combo_list);
gtk_combo_set_case_sensitive(GTK_COMBO(dir_combo), TRUE);
g_list_free(combo_list);
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(dir_combo)->entry), "");
g_signal_connect(G_OBJECT(GTK_COMBO(dir_combo)->entry),
"changed", GTK_SIGNAL_FUNC (cb_combo_changed), NULL);
{
gtk_combo_box_append_text(GTK_COMBO_BOX(dir_combo_box),
((Mount *)list->data)->directory);
}
gtk_combo_box_set_active(GTK_COMBO_BOX(dir_combo_box), -1);
g_signal_connect(G_OBJECT(GTK_COMBO_BOX(dir_combo_box)),
"changed", G_CALLBACK(cb_combo_changed), NULL);
vbox1 = gtk_vbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), vbox1, FALSE, FALSE, 0);
@ -2489,7 +2495,6 @@ fs_tab_create(GtkWidget *tab_vbox)
GtkWidget *tabs;
GtkWidget *vbox, *vbox1;
GtkWidget *text;
GList *list;
gint i;
row_reference = NULL;
@ -2543,19 +2548,14 @@ fs_tab_create(GtkWidget *tab_vbox)
vbox1 = gkrellm_gtk_category_vbox(vbox,
_("Format String for Panel Labels"),
4, 0, TRUE);
data_format_combo = gtk_combo_new();
gtk_box_pack_start(GTK_BOX(vbox1), data_format_combo, FALSE, FALSE, 2);
list = NULL;
list = g_list_append(list, data_format);
list = g_list_append(list, DEFAULT_DATA_FORMAT);
list = g_list_append(list, _("$t - $u used"));
list = g_list_append(list, _("$t - $U"));
gtk_combo_set_popdown_strings(GTK_COMBO(data_format_combo), list);
gtk_combo_set_case_sensitive(GTK_COMBO(data_format_combo), TRUE);
g_list_free(list);
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(data_format_combo)->entry),
data_format);
g_signal_connect(G_OBJECT(GTK_COMBO(data_format_combo)->entry), "changed",
data_format_combo_box = gtk_combo_box_entry_new_text();
gtk_box_pack_start(GTK_BOX(vbox1), data_format_combo_box, FALSE, FALSE, 2);
gtk_combo_box_append_text(GTK_COMBO_BOX(data_format_combo_box), data_format);
gtk_combo_box_append_text(GTK_COMBO_BOX(data_format_combo_box), DEFAULT_DATA_FORMAT);
gtk_combo_box_append_text(GTK_COMBO_BOX(data_format_combo_box), ALT1_DATA_FORMAT);
gtk_combo_box_append_text(GTK_COMBO_BOX(data_format_combo_box), ALT2_DATA_FORMAT);
gtk_combo_box_set_active(GTK_COMBO_BOX(data_format_combo_box), 0);
g_signal_connect(G_OBJECT(GTK_COMBO_BOX(data_format_combo_box)), "changed",
G_CALLBACK(cb_data_format), NULL);
/* --Info tab */

View File

@ -18,7 +18,7 @@
| You should have received a copy of the GNU General Public License
| along with this program. If not, see http://www.gnu.org/licenses/
*/
#include "gkrellm.h"
#include "gkrellm-private.h"
#include "gkrellm-sysdeps.h"
@ -325,7 +325,7 @@ format_chart_text(InetMon *in, gchar *src_string, gchar *buf, gint size)
size -= len;
buf += len;
}
*buf = '\0';
*buf = '\0';
}
static void
@ -1409,7 +1409,7 @@ static GtkWidget *launch_vbox;
static GtkWidget *data0_range_button,
*data1_range_button;
static GtkWidget *text_format_combo;
static GtkWidget *text_format_combo_box;
static void
@ -1704,7 +1704,7 @@ cb_enter(GtkWidget *widget, gpointer data)
in->port1_0 = atoi(gkrellm_gtk_entry_get_text(&port1_0_entry));
in->port1_1 = atoi(gkrellm_gtk_entry_get_text(&port1_1_entry));
}
/* Validate the values
*/
if ( (!*(in->label0) && !*(in->label1))
@ -1757,8 +1757,10 @@ cb_text_format(GtkWidget *widget, gpointer data)
{
GList *list;
gchar *s;
GtkWidget *entry;
s = gkrellm_gtk_entry_get_text(&(GTK_COMBO(text_format_combo)->entry));
entry = gtk_bin_get_child(GTK_BIN(text_format_combo_box));
s = gkrellm_gtk_entry_get_text(&entry);
gkrellm_locale_dup_string(&text_format, s, &text_format_locale);
for (list = inet_mon_list; list; list = list->next)
draw_inet_chart((InetMon *) list->data);
@ -1828,7 +1830,7 @@ create_inet_tab(GtkWidget *tab_vbox)
GList *list;
InetMon *in;
gint i;
row_reference = NULL;
tabs = gtk_notebook_new();
@ -2005,21 +2007,19 @@ create_inet_tab(GtkWidget *tab_vbox)
vbox1 = gkrellm_gtk_category_vbox(vbox,
_("Format String for Chart Labels"),
4, 0, TRUE);
text_format_combo = gtk_combo_new();
gtk_box_pack_start(GTK_BOX(vbox1), text_format_combo, FALSE, FALSE, 2);
list = NULL;
list = g_list_append(list, text_format);
list = g_list_append(list, DEFAULT_TEXT_FORMAT);
list = g_list_append(list,
"\\r\\f $M\\t$a\\f $l\\N$A\\f $L");
list = g_list_append(list,
"\\r\\f $M\\D1$a\\f $l\\D2$A\\f $L");
gtk_combo_set_popdown_strings(GTK_COMBO(text_format_combo), list);
gtk_combo_set_case_sensitive(GTK_COMBO(text_format_combo), TRUE);
g_list_free(list);
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(text_format_combo)->entry),
text_format_combo_box = gtk_combo_box_entry_new_text();
gtk_box_pack_start(GTK_BOX(vbox1), text_format_combo_box, FALSE, FALSE, 2);
gtk_combo_box_append_text(GTK_COMBO_BOX(text_format_combo_box),
text_format);
g_signal_connect(G_OBJECT(GTK_COMBO(text_format_combo)->entry), "changed",
gtk_combo_box_append_text(GTK_COMBO_BOX(text_format_combo_box),
DEFAULT_TEXT_FORMAT);
gtk_combo_box_append_text(GTK_COMBO_BOX(text_format_combo_box),
"\\r\\f $M\\t$a\\f $l\\N$A\\f $L");
gtk_combo_box_append_text(GTK_COMBO_BOX(text_format_combo_box),
"\\r\\f $M\\D1$a\\f $l\\D2$A\\f $L");
gtk_combo_box_set_active(GTK_COMBO_BOX(text_format_combo_box), 0);
g_signal_connect(G_OBJECT(GTK_COMBO_BOX(text_format_combo_box)), "changed",
G_CALLBACK(cb_text_format), NULL);
vbox1 = gkrellm_gtk_category_vbox(vbox,

View File

@ -161,7 +161,7 @@ format_proc_data(ProcMon *p, gchar *src_string, gchar *buf, gint size)
size -= len;
buf += len;
}
*buf = '\0';
*buf = '\0';
}
static void
@ -612,7 +612,7 @@ cb_alert_trigger(GkrellmAlert *alert, gpointer data)
GkrellmAlertdecal *ad;
GkrellmDecal *ds, *df;
gint x, w;
p = proc.chart->panel;
alert->panel = p;
ds = proc.sensor_decal;
@ -756,7 +756,7 @@ load_proc_config(gchar *arg)
static GtkWidget *proc_launch_entry,
*proc_tooltip_entry;
static GtkWidget *text_format_combo;
static GtkWidget *text_format_combo_box;
static GtkWidget *load_alert_button,
*users_alert_button,
@ -773,7 +773,7 @@ fix_panel(void)
if ((result = adjust_sensors_display(FALSE)) && proc_launch.button)
{
gkrellm_destroy_button(proc_launch.button);
proc_launch.button =
proc_launch.button =
gkrellm_put_label_in_panel_button(proc.chart->panel,
gkrellm_launch_button_cb, &proc_launch, proc_launch.pad);
}
@ -802,9 +802,11 @@ cb_sensor_separate(GtkWidget *button, gpointer data)
static void
cb_text_format(GtkWidget *widget, gpointer data)
{
gchar *s;
gchar *s;
GtkWidget *entry;
s = gkrellm_gtk_entry_get_text(&(GTK_COMBO(text_format_combo)->entry));
entry = gtk_bin_get_child(GTK_BIN(text_format_combo_box));
s = gkrellm_gtk_entry_get_text(&entry);
gkrellm_locale_dup_string(&text_format, s, &text_format_locale);
new_text_format = TRUE;
refresh_proc_chart(proc.chart);
@ -894,7 +896,6 @@ static void
create_proc_tab(GtkWidget *tab_vbox)
{
GtkWidget *tabs, *table, *vbox, *vbox1, *hbox, *text, *label;
GList *list;
gint i;
tabs = gtk_notebook_new();
@ -947,20 +948,17 @@ create_proc_tab(GtkWidget *tab_vbox)
vbox1 = gkrellm_gtk_category_vbox(vbox,
_("Format String for Chart Labels"),
4, 0, TRUE);
text_format_combo = gtk_combo_new();
gtk_widget_set_size_request (GTK_WIDGET(text_format_combo), 350, -1);
gtk_box_pack_start(GTK_BOX(vbox1), text_format_combo, FALSE, FALSE, 2);
list = NULL;
list = g_list_append(list, text_format);
list = g_list_append(list, _(DEFAULT_TEXT_FORMAT));
list = g_list_append(list,
text_format_combo_box = gtk_combo_box_entry_new_text();
gtk_widget_set_size_request (GTK_WIDGET(text_format_combo_box), 350, -1);
gtk_box_pack_start(GTK_BOX(vbox1), text_format_combo_box, FALSE, FALSE, 2);
gtk_combo_box_append_text(GTK_COMBO_BOX(text_format_combo_box), text_format);
gtk_combo_box_append_text(GTK_COMBO_BOX(text_format_combo_box),
_(DEFAULT_TEXT_FORMAT));
gtk_combo_box_append_text(GTK_COMBO_BOX(text_format_combo_box),
_("\\f$L\\r\\f$F \\w88\\b\\p\\a$p\\f procs\\n\\e$u\\f users"));
gtk_combo_set_popdown_strings(GTK_COMBO(text_format_combo), list);
gtk_combo_set_case_sensitive(GTK_COMBO(text_format_combo), TRUE);
g_list_free(list);
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(text_format_combo)->entry),
text_format);
g_signal_connect(G_OBJECT(GTK_COMBO(text_format_combo)->entry), "changed",
gtk_combo_box_set_active(GTK_COMBO_BOX(text_format_combo_box), 0);
g_signal_connect(G_OBJECT(GTK_COMBO_BOX(text_format_combo_box)), "changed",
G_CALLBACK(cb_text_format), NULL);
vbox1 = gkrellm_gtk_category_vbox(vbox,