summaryrefslogtreecommitdiff
path: root/src/procdialogs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/procdialogs.cpp')
-rw-r--r--src/procdialogs.cpp70
1 files changed, 29 insertions, 41 deletions
diff --git a/src/procdialogs.cpp b/src/procdialogs.cpp
index 2ee21b5..66b1f6e 100644
--- a/src/procdialogs.cpp
+++ b/src/procdialogs.cpp
@@ -37,10 +37,6 @@
#include "procman_gksu.h"
#include "cgroups.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y)
-#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
-#endif
static GtkWidget *renice_dialog = NULL;
static GtkWidget *prefs_dialog = NULL;
@@ -158,11 +154,7 @@ procdialog_create_renice_dialog (ProcData *procdata)
GtkWidget *label;
GtkWidget *priority_label;
GtkWidget *table;
-#if GTK_CHECK_VERSION(3,0,0)
GtkAdjustment *renice_adj;
-#else
- GtkObject *renice_adj;
-#endif
GtkWidget *hscale;
GtkWidget *button;
GtkWidget *icon;
@@ -201,7 +193,7 @@ procdialog_create_renice_dialog (ProcData *procdata)
gtk_box_set_spacing (GTK_BOX (dialog_vbox), 2);
gtk_container_set_border_width (GTK_CONTAINER (dialog_vbox), 5);
- vbox = gtk_vbox_new (FALSE, 12);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_box_pack_start (GTK_BOX (dialog_vbox), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
@@ -216,11 +208,7 @@ procdialog_create_renice_dialog (ProcData *procdata)
renice_adj = gtk_adjustment_new (info->nice, RENICE_VAL_MIN, RENICE_VAL_MAX, 1, 1, 0);
new_nice_value = 0;
-#if GTK_CHECK_VERSION (3, 0, 0)
hscale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, renice_adj);
-#else
- hscale = gtk_hscale_new (GTK_ADJUSTMENT (renice_adj));
-#endif
gtk_label_set_mnemonic_widget (GTK_LABEL (label), hscale);
gtk_scale_set_digits (GTK_SCALE (hscale), 0);
gtk_table_attach (GTK_TABLE (table), hscale, 1, 2, 0, 1,
@@ -414,7 +402,7 @@ create_field_page(GtkWidget *tree, const char* text)
GtkTreeViewColumn *column;
GtkCellRenderer *cell;
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
label = gtk_label_new_with_mnemonic (text);
#if GTK_CHECK_VERSION (3, 14, 0)
@@ -553,13 +541,13 @@ procdialog_create_preferences_dialog (ProcData *procdata)
gtk_container_set_border_width (GTK_CONTAINER (notebook), 5);
gtk_box_pack_start (GTK_BOX (main_vbox), notebook, TRUE, TRUE, 0);
- proc_box = gtk_vbox_new (FALSE, 18);
+ proc_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 18);
gtk_container_set_border_width (GTK_CONTAINER (proc_box), 12);
tab_label = gtk_label_new (_("Processes"));
gtk_widget_show (tab_label);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), proc_box, tab_label);
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (proc_box), vbox, FALSE, FALSE, 0);
tmp = g_strdup_printf ("<b>%s</b>", _("Behavior"));
@@ -573,16 +561,16 @@ procdialog_create_preferences_dialog (ProcData *procdata)
g_free (tmp);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
label = gtk_label_new (" ");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- vbox2 = gtk_vbox_new (FALSE, 6);
+ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
- hbox2 = gtk_hbox_new (FALSE, 12);
+ hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
label = gtk_label_new_with_mnemonic (_("_Update interval in seconds:"));
@@ -593,7 +581,7 @@ procdialog_create_preferences_dialog (ProcData *procdata)
#endif
gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0);
- hbox3 = gtk_hbox_new (FALSE, 6);
+ hbox3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (hbox2), hbox3, TRUE, TRUE, 0);
update = (gfloat) procdata->config.update_interval;
@@ -611,7 +599,7 @@ procdialog_create_preferences_dialog (ProcData *procdata)
gtk_label_set_mnemonic_widget (GTK_LABEL (label), spin_button);
- hbox2 = gtk_hbox_new(FALSE, 6);
+ hbox2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start(GTK_BOX(vbox2), hbox2, FALSE, FALSE, 0);
smooth_button = gtk_check_button_new_with_mnemonic(_("Enable _smooth refresh"));
@@ -624,7 +612,7 @@ procdialog_create_preferences_dialog (ProcData *procdata)
- hbox2 = gtk_hbox_new (FALSE, 6);
+ hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
check_button = gtk_check_button_new_with_mnemonic (_("Alert before ending or _killing processes"));
@@ -637,7 +625,7 @@ procdialog_create_preferences_dialog (ProcData *procdata)
- hbox2 = gtk_hbox_new(FALSE, 6);
+ hbox2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start(GTK_BOX(vbox2), hbox2, FALSE, FALSE, 0);
GtkWidget *solaris_button = gtk_check_button_new_with_mnemonic(_("Divide CPU usage by CPU count"));
@@ -652,10 +640,10 @@ procdialog_create_preferences_dialog (ProcData *procdata)
- hbox2 = gtk_hbox_new (FALSE, 6);
+ hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (proc_box), vbox, TRUE, TRUE, 0);
tmp = g_strdup_printf ("<b>%s</b>", _("Information Fields"));
@@ -669,7 +657,7 @@ procdialog_create_preferences_dialog (ProcData *procdata)
g_free (tmp);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
label = gtk_label_new (" ");
@@ -678,13 +666,13 @@ procdialog_create_preferences_dialog (ProcData *procdata)
vbox2 = create_field_page (procdata->tree, _("Process i_nformation shown in list:"));
gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
- sys_box = gtk_vbox_new (FALSE, 12);
+ sys_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (sys_box), 12);
tab_label = gtk_label_new (_("Resources"));
gtk_widget_show (tab_label);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), sys_box, tab_label);
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (sys_box), vbox, FALSE, FALSE, 0);
tmp = g_strdup_printf ("<b>%s</b>", _("Graphs"));
@@ -698,16 +686,16 @@ procdialog_create_preferences_dialog (ProcData *procdata)
g_free (tmp);
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, FALSE, 0);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
label = gtk_label_new (" ");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- vbox2 = gtk_vbox_new (FALSE, 6);
+ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
- hbox2 = gtk_hbox_new (FALSE, 12);
+ hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
label = gtk_label_new_with_mnemonic (_("_Update interval in seconds:"));
@@ -719,7 +707,7 @@ procdialog_create_preferences_dialog (ProcData *procdata)
gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0);
gtk_size_group_add_widget (size, label);
- hbox3 = gtk_hbox_new (FALSE, 6);
+ hbox3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (hbox2), hbox3, TRUE, TRUE, 0);
update = (gfloat) procdata->config.graph_update_interval;
@@ -745,13 +733,13 @@ procdialog_create_preferences_dialog (ProcData *procdata)
- hbox2 = gtk_hbox_new (FALSE, 12);
+ hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (vbox2), hbox2, TRUE, TRUE, 0);
/*
* Devices
*/
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
tab_label = gtk_label_new (_("File Systems"));
gtk_widget_show (tab_label);
@@ -768,16 +756,16 @@ procdialog_create_preferences_dialog (ProcData *procdata)
g_free (tmp);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
label = gtk_label_new (" ");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- vbox2 = gtk_vbox_new (FALSE, 6);
+ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
- hbox2 = gtk_hbox_new (FALSE, 12);
+ hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
label = gtk_label_new_with_mnemonic (_("_Update interval in seconds:"));
@@ -788,7 +776,7 @@ procdialog_create_preferences_dialog (ProcData *procdata)
#endif
gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0);
- hbox3 = gtk_hbox_new (FALSE, 6);
+ hbox3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (hbox2), hbox3, TRUE, TRUE, 0);
update = (gfloat) procdata->config.disks_update_interval;
@@ -802,7 +790,7 @@ procdialog_create_preferences_dialog (ProcData *procdata)
&disks_interval_updater);
- hbox2 = gtk_hbox_new (FALSE, 6);
+ hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
check_button = gtk_check_button_new_with_mnemonic (_("Show _all file systems"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button),
@@ -812,7 +800,7 @@ procdialog_create_preferences_dialog (ProcData *procdata)
gtk_box_pack_start (GTK_BOX (hbox2), check_button, FALSE, FALSE, 0);
- vbox2 = gtk_vbox_new (FALSE, 6);
+ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0);
label = gtk_label_new (" ");
@@ -829,7 +817,7 @@ procdialog_create_preferences_dialog (ProcData *procdata)
g_free (tmp);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
label = gtk_label_new (" ");