Drop gtk2 support

This commit is contained in:
Andre Miranda
2020-06-11 20:37:05 -03:00
committed by Simon Steinbeiß
parent 05bd0b14bd
commit 04407bceee
13 changed files with 192 additions and 916 deletions

View File

@@ -73,16 +73,8 @@ XDT_CHECK_PACKAGE([CAIRO], [cairo], [1.5.0])
dnl *********************************** dnl ***********************************
dnl *** Check for optional packages *** dnl *** Check for optional packages ***
dnl *********************************** dnl ***********************************
XDT_CHECK_OPTIONAL_PACKAGE([GTK2], XDT_CHECK_OPTIONAL_PACKAGE([WNCK], [libwnck-3.0], [3.2], [wnck3], [building with libwnck3 for window icons/names], [yes])
[gtk+-2.0], [2.24.0], [gtk2],
[GTK+ 2 support], [no])
AM_CONDITIONAL([USE_GTK2], [test "x$GTK2_FOUND" = "xyes"])
if test "x$GTK2_FOUND" = "xyes"; then
XDT_CHECK_OPTIONAL_PACKAGE([WNCK], [libwnck-1.0], [2.0], [wnck], [building with libwnck for window icons/names], [yes])
XDT_CHECK_OPTIONAL_PACKAGE([GKSU], [libgksu2], [2.0], [gksu], [building with libgksu to run as root], [yes])
else
XDT_CHECK_OPTIONAL_PACKAGE([WNCK], [libwnck-3.0], [3.2], [wnck3], [building with libwnck3 for window icons/names], [yes])
fi
AM_CONDITIONAL([HAVE_WNCK], [test x"$WNCK_FOUND" = x"yes"]) AM_CONDITIONAL([HAVE_WNCK], [test x"$WNCK_FOUND" = x"yes"])
AM_CONDITIONAL([HAVE_GKSU], [test x"$GKSU_FOUND" = x"yes"]) AM_CONDITIONAL([HAVE_GKSU], [test x"$GKSU_FOUND" = x"yes"])
dnl *********************************** dnl ***********************************
@@ -167,11 +159,7 @@ echo
echo "* Gksu: ${GKSU_VERSION:-no}" echo "* Gksu: ${GKSU_VERSION:-no}"
echo "* Wnck: ${WNCK_VERSION:-no}" echo "* Wnck: ${WNCK_VERSION:-no}"
echo "* Cairo: ${CAIRO_VERSION}" echo "* Cairo: ${CAIRO_VERSION}"
if test "x$GTK2_FOUND" = "xyes" ; then
echo "* GTK+: ${GTK2_VERSION}"
else
echo "* GTK+: ${GTK3_VERSION}" echo "* GTK+: ${GTK3_VERSION}"
fi
echo "* Target OS: $target_os ($ac_os_implementation)" echo "* Target OS: $target_os ($ac_os_implementation)"
echo "* Debug: $enable_debug" echo "* Debug: $enable_debug"
echo echo

View File

@@ -7,10 +7,8 @@ src/process-statusbar.c
src/process-tree-view.c src/process-tree-view.c
src/process-window.c src/process-window.c
[type: gettext/glade]src/process-window.ui [type: gettext/glade]src/process-window.ui
[type: gettext/glade]src/process-window-gtk3.ui
src/settings.c src/settings.c
src/settings-dialog.c src/settings-dialog.c
[type: gettext/glade]src/settings-dialog.ui [type: gettext/glade]src/settings-dialog.ui
[type: gettext/glade]src/settings-dialog-gtk3.ui
src/settings-tool-button.c src/settings-tool-button.c
src/task-manager.c src/task-manager.c

View File

@@ -11,6 +11,8 @@ xfce4_taskmanager_CFLAGS = \
$(GKSU_CFLAGS) \ $(GKSU_CFLAGS) \
$(LIBX11_CFLAGS) \ $(LIBX11_CFLAGS) \
$(LIBXMU_CFLAGS) \ $(LIBXMU_CFLAGS) \
$(GTK3_CFLAGS) \
$(WNCK_CFLAGS) \
$(NULL) $(NULL)
xfce4_taskmanager_LDADD = \ xfce4_taskmanager_LDADD = \
@@ -18,11 +20,13 @@ xfce4_taskmanager_LDADD = \
$(GKSU_LIBS) \ $(GKSU_LIBS) \
$(LIBX11_LIBS) \ $(LIBX11_LIBS) \
$(LIBXMU_LIBS) \ $(LIBXMU_LIBS) \
$(GTK3_LIBS) \
$(WNCK_LIBS) \
$(NULL) $(NULL)
xfce4_taskmanager_SOURCES = \ xfce4_taskmanager_SOURCES = \
main.c \ main.c \
process-window_ui.h process-window-gtk3_ui.h \ process-window_ui.h \
process-window.c process-window.h \ process-window.c process-window.h \
process-monitor.c process-monitor.h \ process-monitor.c process-monitor.h \
process-tree-model.c process-tree-model.h \ process-tree-model.c process-tree-model.h \
@@ -30,20 +34,12 @@ xfce4_taskmanager_SOURCES = \
process-statusbar.c process-statusbar.h \ process-statusbar.c process-statusbar.h \
exec-tool-button.c exec-tool-button.h \ exec-tool-button.c exec-tool-button.h \
settings-tool-button.c settings-tool-button.h \ settings-tool-button.c settings-tool-button.h \
settings-dialog_ui.h settings-dialog-gtk3_ui.h \ settings-dialog_ui.h \
settings-dialog.c settings-dialog.h \ settings-dialog.c settings-dialog.h \
settings.c settings.h \ settings.c settings.h \
task-manager.c task-manager.h \ task-manager.c task-manager.h \
$(NULL) $(NULL)
if USE_GTK2
xfce4_taskmanager_LDADD += $(GTK2_LIBS) $(WNCK_LIBS)
xfce4_taskmanager_CFLAGS += $(GTK2_CFLAGS) $(WNCK_CFLAGS)
else
xfce4_taskmanager_LDADD += $(GTK3_LIBS) $(WNCK_LIBS)
xfce4_taskmanager_CFLAGS += $(GTK3_CFLAGS) $(WNCK_CFLAGS)
endif
if HAVE_WNCK if HAVE_WNCK
xfce4_taskmanager_SOURCES += app-manager.c app-manager.h xfce4_taskmanager_SOURCES += app-manager.c app-manager.h
endif endif
@@ -65,15 +61,11 @@ xfce4_taskmanager_SOURCES += task-manager-skel.c
endif endif
if MAINTAINER_MODE if MAINTAINER_MODE
BUILT_SOURCES = process-window_ui.h settings-dialog_ui.h process-window-gtk3_ui.h settings-dialog-gtk3_ui.h BUILT_SOURCES = process-window_ui.h settings-dialog_ui.h
process-window_ui.h: process-window.ui process-window_ui.h: process-window.ui
$(AM_V_GEN) xdt-csource --static --strip-comments --strip-content --name=process_window_ui $< >$@ $(AM_V_GEN) xdt-csource --static --strip-comments --strip-content --name=process_window_ui $< >$@
settings-dialog_ui.h: settings-dialog.ui settings-dialog_ui.h: settings-dialog.ui
$(AM_V_GEN) xdt-csource --static --strip-comments --strip-content --name=settings_dialog_ui $< >$@ $(AM_V_GEN) xdt-csource --static --strip-comments --strip-content --name=settings_dialog_ui $< >$@
process-window-gtk3_ui.h: process-window-gtk3.ui
$(AM_V_GEN) xdt-csource --static --strip-comments --strip-content --name=process_window_ui $< >$@
settings-dialog-gtk3_ui.h: settings-dialog-gtk3.ui
$(AM_V_GEN) xdt-csource --static --strip-comments --strip-content --name=settings_dialog_ui $< >$@
endif endif
EXTRA_DIST = process-window.ui settings-dialog.ui process-window-gtk3.ui settings-dialog-gtk3.ui EXTRA_DIST = process-window.ui settings-dialog.ui

View File

@@ -79,7 +79,6 @@ static void
execute_command (const gchar *command) execute_command (const gchar *command)
{ {
GError *error = NULL; GError *error = NULL;
#if GTK_CHECK_VERSION(3, 0, 0)
GdkScreen *screen; GdkScreen *screen;
GdkDisplay *display; GdkDisplay *display;
GdkAppLaunchContext *launch_context; GdkAppLaunchContext *launch_context;
@@ -95,9 +94,7 @@ execute_command (const gchar *command)
g_object_unref (launch_context); g_object_unref (launch_context);
} }
g_object_unref (app_info); g_object_unref (app_info);
#else
gdk_spawn_command_line_on_screen (gdk_screen_get_default (), command, &error);
#endif
if (error != NULL) if (error != NULL)
{ {
GtkWidget *dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, GtkWidget *dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,

View File

@@ -126,7 +126,6 @@ init_timeout (void)
if (gtk_status_icon_get_visible (status_icon)) if (gtk_status_icon_get_visible (status_icon))
{ {
#if GTK_CHECK_VERSION (2,16,0)
g_snprintf (tooltip, sizeof(tooltip), g_snprintf (tooltip, sizeof(tooltip),
_("<b>Processes:</b> %u\n" _("<b>Processes:</b> %u\n"
"<b>CPU:</b> %.0f%%\n" "<b>CPU:</b> %.0f%%\n"
@@ -134,15 +133,6 @@ init_timeout (void)
"<b>Swap:</b> %s"), "<b>Swap:</b> %s"),
num_processes, cpu, memory_info, swap_info); num_processes, cpu, memory_info, swap_info);
gtk_status_icon_set_tooltip_markup (GTK_STATUS_ICON (status_icon), tooltip); gtk_status_icon_set_tooltip_markup (GTK_STATUS_ICON (status_icon), tooltip);
#else
g_snprintf (tooltip, sizeof(tooltip),
_("Processes: %u\n"
"CPU: %.0f%%\n"
"Memory: %s\n"
"Swap: %s"),
num_processes, cpu, memory_info, swap_info);
gtk_status_icon_set_tooltip (GTK_STATUS_ICON (status_icon), tooltip);
#endif
} }
xtm_task_manager_update_model (task_manager); xtm_task_manager_update_model (task_manager);

View File

@@ -41,12 +41,8 @@ G_DEFINE_TYPE (XtmProcessMonitor, xtm_process_monitor, GTK_TYPE_DRAWING_AREA)
static void xtm_process_monitor_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void xtm_process_monitor_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
static void xtm_process_monitor_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); static void xtm_process_monitor_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
#if GTK_CHECK_VERSION(3, 0, 0)
static gboolean xtm_process_monitor_draw (GtkWidget *widget, cairo_t *cr); static gboolean xtm_process_monitor_draw (GtkWidget *widget, cairo_t *cr);
#else static void xtm_process_monitor_paint (XtmProcessMonitor *monitor, cairo_t *cr);
static gboolean xtm_process_monitor_expose (GtkWidget *widget, GdkEventExpose *event);
#endif
static void xtm_process_monitor_paint (XtmProcessMonitor *monitor, cairo_t *cr);
@@ -58,11 +54,8 @@ xtm_process_monitor_class_init (XtmProcessMonitorClass *klass)
xtm_process_monitor_parent_class = g_type_class_peek_parent (klass); xtm_process_monitor_parent_class = g_type_class_peek_parent (klass);
class->get_property = xtm_process_monitor_get_property; class->get_property = xtm_process_monitor_get_property;
class->set_property = xtm_process_monitor_set_property; class->set_property = xtm_process_monitor_set_property;
#if GTK_CHECK_VERSION(3, 0, 0)
widget_class->draw = xtm_process_monitor_draw; widget_class->draw = xtm_process_monitor_draw;
#else
widget_class->expose_event = xtm_process_monitor_expose;
#endif
g_object_class_install_property (class, PROP_STEP_SIZE, g_object_class_install_property (class, PROP_STEP_SIZE,
g_param_spec_float ("step-size", "StepSize", "Step size", 0.1f, G_MAXFLOAT, 1, G_PARAM_CONSTRUCT|G_PARAM_READWRITE)); g_param_spec_float ("step-size", "StepSize", "Step size", 0.1f, G_MAXFLOAT, 1, G_PARAM_CONSTRUCT|G_PARAM_READWRITE));
g_object_class_install_property (class, PROP_TYPE, g_object_class_install_property (class, PROP_TYPE,
@@ -115,7 +108,6 @@ xtm_process_monitor_set_property (GObject *object, guint property_id, const GVal
} }
} }
#if GTK_CHECK_VERSION(3, 0, 0)
static gboolean static gboolean
xtm_process_monitor_draw (GtkWidget *widget, cairo_t *cr) xtm_process_monitor_draw (GtkWidget *widget, cairo_t *cr)
{ {
@@ -129,24 +121,6 @@ xtm_process_monitor_draw (GtkWidget *widget, cairo_t *cr)
xtm_process_monitor_paint (monitor, cr); xtm_process_monitor_paint (monitor, cr);
return FALSE; return FALSE;
} }
#else
static gboolean
xtm_process_monitor_expose (GtkWidget *widget, GdkEventExpose *event __unused)
{
XtmProcessMonitor *monitor = XTM_PROCESS_MONITOR (widget);
guint minimum_history_length;
cairo_t *cr;
minimum_history_length = (guint)(widget->allocation.width / monitor->step_size);
if (monitor->history->len < minimum_history_length)
g_array_set_size (monitor->history, minimum_history_length + 1);
cr = gdk_cairo_create (gtk_widget_get_window(GTK_WIDGET(monitor)));
xtm_process_monitor_paint (monitor, cr);
cairo_destroy (cr);
return FALSE;
}
#endif
static cairo_surface_t * static cairo_surface_t *
xtm_process_monitor_graph_surface_create (XtmProcessMonitor *monitor, gint width, gint height) xtm_process_monitor_graph_surface_create (XtmProcessMonitor *monitor, gint width, gint height)
@@ -218,13 +192,9 @@ xtm_process_monitor_paint (XtmProcessMonitor *monitor, cairo_t *cr)
gint width, height; gint width, height;
static const double dashed[] = {1.5}; static const double dashed[] = {1.5};
gint i; gint i;
#if GTK_CHECK_VERSION(3, 0, 0)
width = gtk_widget_get_allocated_width(GTK_WIDGET(monitor)); width = gtk_widget_get_allocated_width(GTK_WIDGET(monitor));
height = gtk_widget_get_allocated_height(GTK_WIDGET(monitor)); height = gtk_widget_get_allocated_height(GTK_WIDGET(monitor));
#else
width = GTK_WIDGET (monitor)->allocation.width;
height = GTK_WIDGET (monitor)->allocation.height;
#endif
/* Don't draw anything if the graph is too small */ /* Don't draw anything if the graph is too small */
if (height < 3) if (height < 3)
return; return;

View File

@@ -81,15 +81,9 @@ xtm_process_statusbar_init (XtmProcessStatusbar *statusbar)
GtkWidget *hbox, *hbox_cpu, *hbox_mem; GtkWidget *hbox, *hbox_cpu, *hbox_mem;
statusbar->settings = xtm_settings_get_default (); statusbar->settings = xtm_settings_get_default ();
#if GTK_CHECK_VERSION(3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 16); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 16);
hbox_cpu = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 16); hbox_cpu = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 16);
hbox_mem = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 16); hbox_mem = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 16);
#else
hbox = gtk_hbox_new (FALSE, 16);
hbox_cpu = gtk_hbox_new (FALSE, 16);
hbox_mem = gtk_hbox_new (FALSE, 16);
#endif
statusbar->label_cpu = gtk_label_new (NULL); statusbar->label_cpu = gtk_label_new (NULL);
gtk_box_pack_start (GTK_BOX (hbox_cpu), statusbar->label_cpu, TRUE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox_cpu), statusbar->label_cpu, TRUE, FALSE, 0);
@@ -133,11 +127,7 @@ xtm_process_statusbar_set_property (GObject *object, guint property_id, const GV
XtmProcessStatusbar *statusbar = XTM_PROCESS_STATUSBAR (object); XtmProcessStatusbar *statusbar = XTM_PROCESS_STATUSBAR (object);
gchar *text; gchar *text;
gchar *float_value; gchar *float_value;
#if GTK_CHECK_VERSION(3, 0, 0)
GdkRGBA color; GdkRGBA color;
#else
GdkColor color;
#endif
switch (property_id) switch (property_id)
{ {
@@ -146,13 +136,8 @@ xtm_process_statusbar_set_property (GObject *object, guint property_id, const GV
float_value = rounded_float_value (statusbar->cpu, statusbar->settings); float_value = rounded_float_value (statusbar->cpu, statusbar->settings);
text = g_strdup_printf (_("CPU: %s%%"), float_value); text = g_strdup_printf (_("CPU: %s%%"), float_value);
gtk_label_set_text (GTK_LABEL (statusbar->label_cpu), text); gtk_label_set_text (GTK_LABEL (statusbar->label_cpu), text);
#if GTK_CHECK_VERSION(3, 0, 0)
gdk_rgba_parse (&color, "#ff6e00"); gdk_rgba_parse (&color, "#ff6e00");
gtk_widget_override_color (statusbar->label_cpu, GTK_STATE_NORMAL, &color); gtk_widget_override_color (statusbar->label_cpu, GTK_STATE_NORMAL, &color);
#else
gdk_color_parse ("#ff6e00", &color);
gtk_widget_modify_fg (statusbar->label_cpu, GTK_STATE_NORMAL, &color);
#endif
g_free (float_value); g_free (float_value);
g_free (text); g_free (text);
break; break;
@@ -161,13 +146,8 @@ xtm_process_statusbar_set_property (GObject *object, guint property_id, const GV
g_strlcpy(statusbar->memory, g_value_get_string (value), sizeof(statusbar->memory)); g_strlcpy(statusbar->memory, g_value_get_string (value), sizeof(statusbar->memory));
text = g_strdup_printf (_("Memory: %s"), statusbar->memory); text = g_strdup_printf (_("Memory: %s"), statusbar->memory);
gtk_label_set_text (GTK_LABEL (statusbar->label_memory), text); gtk_label_set_text (GTK_LABEL (statusbar->label_memory), text);
#if GTK_CHECK_VERSION(3, 0, 0)
gdk_rgba_parse (&color, "#ab1852"); gdk_rgba_parse (&color, "#ab1852");
gtk_widget_override_color (statusbar->label_memory, GTK_STATE_NORMAL, &color); gtk_widget_override_color (statusbar->label_memory, GTK_STATE_NORMAL, &color);
#else
gdk_color_parse ("#ab1852", &color);
gtk_widget_modify_fg (statusbar->label_memory, GTK_STATE_NORMAL, &color);
#endif
g_free (text); g_free (text);
break; break;

View File

@@ -1,282 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkWindow" id="process-window">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Task Manager</property>
<property name="default_width">490</property>
<property name="default_height">465</property>
<property name="icon_name">org.xfce.taskmanager</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkBox" id="process-vbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkToolbar" id="process-toolbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show_arrow">False</property>
<property name="icon_size">1</property>
<child>
<object class="GtkToolButton" id="toolbutton-about">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-about</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolItem" id="filter-toolitem">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">2</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="xscale">0.5</property>
<child>
<object class="GtkEntry" id="filter-entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">•</property>
<property name="primary_icon_stock">gtk-find</property>
<property name="secondary_icon_stock">gtk-clear</property>
<property name="secondary_icon_sensitive">False</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="homogeneous">False</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="root-warning-box">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkEventBox" id="root-warning-ebox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="root-warning-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xpad">6</property>
<property name="ypad">3</property>
<property name="label" translatable="yes">Warning, you are using the root account, you may harm your system.</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="root-warning-separator">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkPaned" id="mainview-vpaned">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="orientation">vertical</property>
<property name="position">100</property>
<property name="position_set">True</property>
<child>
<object class="GtkBox" id="graph-vbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="graph-hbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkFrame" id="graph-cpu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">False</property>
<property name="border_width">2</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<placeholder/>
</child>
<child type="label_item">
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="graph-mem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">False</property>
<property name="border_width">2</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<placeholder/>
</child>
<child type="label_item">
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="resize">False</property>
<property name="shrink">False</property>
</packing>
</child>
<child>
<object class="GtkBox" id="mainview-vbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="legend">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="margin_right">6</property>
<property name="margin_bottom">6</property>
<property name="spacing">18</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;span foreground='#000000' background='#aed581'&gt; &lt;/span&gt; Starting task</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;span foreground='#000000' background='#fff176'&gt; &lt;/span&gt; Changing task</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;span foreground='#000000' background='#e57373'&gt; &lt;/span&gt; Terminating task</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="resize">True</property>
<property name="shrink">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</object>
</interface>

View File

@@ -31,11 +31,7 @@
#include "settings.h" #include "settings.h"
#include "task-manager.h" #include "task-manager.h"
#include "process-window.h" #include "process-window.h"
#if GTK_CHECK_VERSION(3, 0, 0)
#include "process-window-gtk3_ui.h"
#else
#include "process-window_ui.h" #include "process-window_ui.h"
#endif
#include "process-monitor.h" #include "process-monitor.h"
#include "process-tree-view.h" #include "process-tree-view.h"
#include "process-statusbar.h" #include "process-statusbar.h"
@@ -309,7 +305,6 @@ xtm_process_window_init (XtmProcessWindow *window)
if (geteuid () == 0) if (geteuid () == 0)
{ {
#if GTK_CHECK_VERSION(3, 0, 0)
GtkCssProvider *css_provider; GtkCssProvider *css_provider;
css_provider = gtk_css_provider_new (); css_provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (css_provider, gtk_css_provider_load_from_data (css_provider,
@@ -318,11 +313,6 @@ xtm_process_window_init (XtmProcessWindow *window)
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), GTK_STYLE_PROVIDER (css_provider), gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), GTK_STYLE_PROVIDER (css_provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref (css_provider); g_object_unref (css_provider);
#else
gtk_rc_parse_string ("style\"root-warning-style\"{bg[NORMAL]=\"#e53935\"\nfg[NORMAL]=\"#ffffff\"}\n"
"widget\"GtkWindow.*.root-warning\"style\"root-warning-style\"\n"
"widget\"GtkWindow.*.root-warning.GtkLabel\"style\"root-warning-style\"");
#endif
gtk_widget_set_name (GTK_WIDGET (gtk_builder_get_object (window->builder, "root-warning-ebox")), "root-warning"); gtk_widget_set_name (GTK_WIDGET (gtk_builder_get_object (window->builder, "root-warning-ebox")), "root-warning");
gtk_widget_show_all (GTK_WIDGET (gtk_builder_get_object (window->builder, "root-warning-box"))); gtk_widget_show_all (GTK_WIDGET (gtk_builder_get_object (window->builder, "root-warning-box")));
} }
@@ -466,7 +456,6 @@ monitor_update_step_size (XtmProcessWindow *window)
g_object_set (window->mem_monitor, "step-size", refresh_rate / 1000.0, NULL); g_object_set (window->mem_monitor, "step-size", refresh_rate / 1000.0, NULL);
} }
#if !GTK_CHECK_VERSION(2,18,0)
static void static void
url_hook_about_dialog (GtkAboutDialog *dialog, const gchar *uri, gpointer user_data) url_hook_about_dialog (GtkAboutDialog *dialog, const gchar *uri, gpointer user_data)
{ {
@@ -479,7 +468,6 @@ url_hook_about_dialog (GtkAboutDialog *dialog, const gchar *uri, gpointer user_d
} }
g_free (command); g_free (command);
} }
#endif
static void static void
show_about_dialog (XtmProcessWindow *window) show_about_dialog (XtmProcessWindow *window)
@@ -515,17 +503,11 @@ show_about_dialog (XtmProcessWindow *window)
"the Free Software Foundation; either version 2 of the License, or\n" "the Free Software Foundation; either version 2 of the License, or\n"
"(at your option) any later version.\n"; "(at your option) any later version.\n";
#if !GTK_CHECK_VERSION(2,18,0)
gtk_about_dialog_set_url_hook (url_hook_about_dialog, NULL, NULL);
#endif
gtk_show_about_dialog (GTK_WINDOW (window->window), gtk_show_about_dialog (GTK_WINDOW (window->window),
"program-name", _("Task Manager"), "program-name", _("Task Manager"),
"version", PACKAGE_VERSION, "version", PACKAGE_VERSION,
"copyright", "Copyright \302\251 2005-2019 The Xfce development team", "copyright", "Copyright \302\251 2005-2019 The Xfce development team",
"logo-icon-name", "org.xfce.taskmanager", "logo-icon-name", "org.xfce.taskmanager",
#if !GTK_CHECK_VERSION(3, 0, 0)
"icon-name", GTK_STOCK_ABOUT,
#endif
"comments", _("Easy to use task manager"), "comments", _("Easy to use task manager"),
"license", license, "license", license,
"authors", authors, "authors", authors,

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <requires lib="gtk+" version="3.0"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkWindow" id="process-window"> <object class="GtkWindow" id="process-window">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="title" translatable="yes">Task Manager</property> <property name="title" translatable="yes">Task Manager</property>
@@ -9,9 +9,13 @@
<property name="default_height">465</property> <property name="default_height">465</property>
<property name="icon_name">org.xfce.taskmanager</property> <property name="icon_name">org.xfce.taskmanager</property>
<child> <child>
<object class="GtkVBox" id="process-vbox"> <placeholder/>
</child>
<child>
<object class="GtkBox" id="process-vbox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child> <child>
<object class="GtkToolbar" id="process-toolbar"> <object class="GtkToolbar" id="process-toolbar">
<property name="visible">True</property> <property name="visible">True</property>
@@ -22,7 +26,6 @@
<object class="GtkToolButton" id="toolbutton-about"> <object class="GtkToolButton" id="toolbutton-about">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="stock_id">gtk-about</property> <property name="stock_id">gtk-about</property>
</object> </object>
@@ -33,10 +36,10 @@
</child> </child>
<child> <child>
<object class="GtkToolItem" id="filter-toolitem"> <object class="GtkToolItem" id="filter-toolitem">
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">2</property> <property name="border_width">2</property>
<property name="use_action_appearance">False</property>
<child> <child>
<object class="GtkAlignment" id="alignment1"> <object class="GtkAlignment" id="alignment1">
<property name="visible">True</property> <property name="visible">True</property>
@@ -48,12 +51,8 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">•</property> <property name="invisible_char">•</property>
<property name="invisible_char_set">True</property>
<property name="primary_icon_stock">gtk-find</property> <property name="primary_icon_stock">gtk-find</property>
<property name="secondary_icon_stock">gtk-clear</property> <property name="secondary_icon_stock">gtk-clear</property>
<property name="primary_icon_activatable">True</property>
<property name="secondary_icon_activatable">True</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">False</property> <property name="secondary_icon_sensitive">False</property>
</object> </object>
</child> </child>
@@ -62,6 +61,7 @@
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="homogeneous">False</property>
</packing> </packing>
</child> </child>
</object> </object>
@@ -72,8 +72,9 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkVBox" id="root-warning-box"> <object class="GtkBox" id="root-warning-box">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child> <child>
<object class="GtkEventBox" id="root-warning-ebox"> <object class="GtkEventBox" id="root-warning-ebox">
<property name="visible">True</property> <property name="visible">True</property>
@@ -95,7 +96,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkHSeparator" id="root-warning-separator"> <object class="GtkSeparator" id="root-warning-separator">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
</object> </object>
@@ -113,28 +114,36 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkVPaned" id="mainview-vpaned"> <object class="GtkPaned" id="mainview-vpaned">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="orientation">vertical</property>
<property name="position">100</property> <property name="position">100</property>
<property name="position_set">True</property> <property name="position_set">True</property>
<child> <child>
<object class="GtkVBox" id="graph-vbox"> <object class="GtkBox" id="graph-vbox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child> <child>
<object class="GtkHBox" id="graph-hbox"> <object class="GtkBox" id="graph-hbox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
<object class="GtkToolItem" id="graph-cpu"> <object class="GtkFrame" id="graph-cpu">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">False</property>
<property name="border_width">2</property> <property name="border_width">2</property>
<property name="use_action_appearance">False</property> <property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child> <child>
<placeholder/> <placeholder/>
</child> </child>
<child type="label_item">
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
@@ -143,14 +152,20 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkToolItem" id="graph-mem"> <object class="GtkFrame" id="graph-mem">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">False</property>
<property name="border_width">2</property> <property name="border_width">2</property>
<property name="use_action_appearance">False</property> <property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child> <child>
<placeholder/> <placeholder/>
</child> </child>
<child type="label_item">
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
@@ -162,7 +177,7 @@
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">-1</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -175,16 +190,15 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkVBox" id="mainview-vbox"> <object class="GtkBox" id="mainview-vbox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<object class="GtkScrolledWindow" id="scrolledwindow"> <object class="GtkScrolledWindow" id="scrolledwindow">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<child> <child>
<placeholder/> <placeholder/>
</child> </child>
@@ -195,6 +209,60 @@
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkBox" id="legend">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="margin_right">6</property>
<property name="margin_bottom">6</property>
<property name="spacing">18</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;span foreground='#000000' background='#aed581'&gt; &lt;/span&gt; Starting task</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;span foreground='#000000' background='#fff176'&gt; &lt;/span&gt; Changing task</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;span foreground='#000000' background='#e57373'&gt; &lt;/span&gt; Terminating task</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="resize">True</property> <property name="resize">True</property>

View File

@@ -1,438 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkDialog" id="settings-dialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Settings for Task Manager</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="destroy_with_parent">True</property>
<property name="icon_name">gtk-preferences</property>
<property name="type_hint">normal</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button-close">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkNotebook" id="notebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="show_tabs">False</property>
<child>
<object class="GtkBox" id="hbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<child>
<object class="GtkBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkFrame" id="frame-interface">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment-interface">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox" id="vbox-interface">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkCheckButton" id="button-show-application-icons">
<property name="label" translatable="yes">Show application icons</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="button-full-command-line">
<property name="label" translatable="yes">Show full command lines</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="button-more-precision">
<property name="label" translatable="yes">Show values with more precision</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="button-process-tree">
<property name="label" translatable="yes">Show processes as tree</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkBox" id="hbox-toolbar-style">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="label-toolbar-style">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Toolbar style:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">6</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label-interface">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Interface style&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame-misc">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment-misc">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox" id="vbox-misc">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkCheckButton" id="button-prompt-terminate-task">
<property name="label" translatable="yes">Prompt for terminating tasks</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="button-show-status-icon">
<property name="label" translatable="yes">Hide into the notification area</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label-misc">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Miscellaneous&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="vseparator1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">6</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="vbox2">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkFrame" id="frame-information">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment-information">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox" id="vbox-information">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox" id="hbox-refresh-rate">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="label-refresh-rate">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Refresh rate:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox-refresh-rate">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label-columns">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Columns:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment-columns">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow-columns">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTreeView" id="treeview-columns">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label-information">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Information&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<child type="tab">
<object class="GtkLabel" id="label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Settings</property>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="0">button-close</action-widget>
</action-widgets>
</object>
</interface>

View File

@@ -17,11 +17,7 @@
#include "settings.h" #include "settings.h"
#include "settings-dialog.h" #include "settings-dialog.h"
#if GTK_CHECK_VERSION(3, 0, 0)
#include "settings-dialog-gtk3_ui.h"
#else
#include "settings-dialog_ui.h" #include "settings-dialog_ui.h"
#endif
@@ -121,21 +117,13 @@ xtm_settings_dialog_init (XtmSettingsDialog *dialog)
XtmToolbarStyle toolbar_style; XtmToolbarStyle toolbar_style;
box = GTK_WIDGET (gtk_builder_get_object (builder, "hbox-toolbar-style")); box = GTK_WIDGET (gtk_builder_get_object (builder, "hbox-toolbar-style"));
#if GTK_CHECK_VERSION(2, 24, 1)
combobox = gtk_combo_box_text_new (); combobox = gtk_combo_box_text_new ();
#else
combobox = gtk_combo_box_new_text ();
#endif
gtk_box_pack_start (GTK_BOX (box), combobox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box), combobox, FALSE, FALSE, 0);
gtk_widget_show (combobox); gtk_widget_show (combobox);
klass = g_type_class_ref (XTM_TYPE_TOOLBAR_STYLE); klass = g_type_class_ref (XTM_TYPE_TOOLBAR_STYLE);
for (n = 0; n < klass->n_values; ++n) for (n = 0; n < klass->n_values; ++n)
#if GTK_CHECK_VERSION(2, 24, 1)
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _(klass->values[n].value_nick)); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _(klass->values[n].value_nick));
#else
gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _(klass->values[n].value_nick));
#endif
g_type_class_unref (klass); g_type_class_unref (klass);
g_object_get (dialog->settings, "toolbar-style", &toolbar_style, NULL); g_object_get (dialog->settings, "toolbar-style", &toolbar_style, NULL);
@@ -172,9 +160,6 @@ xtm_settings_dialog_show (GtkWidget *widget)
g_return_if_fail (GTK_IS_WIDGET (XTM_SETTINGS_DIALOG (widget)->window)); g_return_if_fail (GTK_IS_WIDGET (XTM_SETTINGS_DIALOG (widget)->window));
gtk_widget_show (XTM_SETTINGS_DIALOG (widget)->window); gtk_widget_show (XTM_SETTINGS_DIALOG (widget)->window);
gtk_window_present (GTK_WINDOW (XTM_SETTINGS_DIALOG (widget)->window)); gtk_window_present (GTK_WINDOW (XTM_SETTINGS_DIALOG (widget)->window));
#if !GTK_CHECK_VERSION(3, 0, 0)
GTK_WIDGET_SET_FLAGS (widget, GTK_VISIBLE);
#endif
} }
static void static void
@@ -187,9 +172,6 @@ xtm_settings_dialog_hide (GtkWidget *widget)
gtk_window_get_position (GTK_WINDOW (XTM_SETTINGS_DIALOG (widget)->window), &winx, &winy); gtk_window_get_position (GTK_WINDOW (XTM_SETTINGS_DIALOG (widget)->window), &winx, &winy);
gtk_widget_hide (XTM_SETTINGS_DIALOG (widget)->window); gtk_widget_hide (XTM_SETTINGS_DIALOG (widget)->window);
gtk_window_move (GTK_WINDOW (XTM_SETTINGS_DIALOG (widget)->window), winx, winy); gtk_window_move (GTK_WINDOW (XTM_SETTINGS_DIALOG (widget)->window), winx, winy);
#if !GTK_CHECK_VERSION(3, 0, 0)
GTK_WIDGET_UNSET_FLAGS (widget, (guint)GTK_VISIBLE);
#endif
} }
void void

View File

@@ -1,8 +1,9 @@
<?xml version="1.0"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <requires lib="gtk+" version="3.0"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="settings-dialog"> <object class="GtkDialog" id="settings-dialog">
<property name="can_focus">False</property>
<property name="border_width">5</property> <property name="border_width">5</property>
<property name="title" translatable="yes">Settings for Task Manager</property> <property name="title" translatable="yes">Settings for Task Manager</property>
<property name="resizable">False</property> <property name="resizable">False</property>
@@ -10,39 +11,71 @@
<property name="destroy_with_parent">True</property> <property name="destroy_with_parent">True</property>
<property name="icon_name">gtk-preferences</property> <property name="icon_name">gtk-preferences</property>
<property name="type_hint">normal</property> <property name="type_hint">normal</property>
<property name="has_separator">False</property>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox"> <object class="GtkBox" id="dialog-vbox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">2</property> <property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button-close">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkNotebook" id="notebook"> <object class="GtkNotebook" id="notebook">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="show_tabs">False</property> <property name="show_tabs">False</property>
<child> <child>
<object class="GtkHBox" id="hbox"> <object class="GtkBox" id="hbox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<child> <child>
<object class="GtkVBox" id="vbox1"> <object class="GtkBox" id="vbox1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<object class="GtkFrame" id="frame-interface"> <object class="GtkFrame" id="frame-interface">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property> <property name="label_xalign">0</property>
<property name="shadow_type">none</property> <property name="shadow_type">none</property>
<child> <child>
<object class="GtkAlignment" id="alignment-interface"> <object class="GtkAlignment" id="alignment-interface">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property> <property name="top_padding">6</property>
<property name="left_padding">12</property> <property name="left_padding">12</property>
<child> <child>
<object class="GtkVBox" id="vbox-interface"> <object class="GtkBox" id="vbox-interface">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
@@ -51,9 +84,12 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
@@ -63,6 +99,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</object> </object>
<packing> <packing>
@@ -77,6 +114,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</object> </object>
<packing> <packing>
@@ -91,6 +129,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</object> </object>
<packing> <packing>
@@ -100,12 +139,14 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkHBox" id="hbox-toolbar-style"> <object class="GtkBox" id="hbox-toolbar-style">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<object class="GtkLabel" id="label-toolbar-style"> <object class="GtkLabel" id="label-toolbar-style">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Toolbar style:</property> <property name="label" translatable="yes">Toolbar style:</property>
</object> </object>
<packing> <packing>
@@ -131,6 +172,7 @@
<child type="label"> <child type="label">
<object class="GtkLabel" id="label-interface"> <object class="GtkLabel" id="label-interface">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Interface style&lt;/b&gt;</property> <property name="label" translatable="yes">&lt;b&gt;Interface style&lt;/b&gt;</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
</object> </object>
@@ -145,16 +187,19 @@
<child> <child>
<object class="GtkFrame" id="frame-misc"> <object class="GtkFrame" id="frame-misc">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property> <property name="label_xalign">0</property>
<property name="shadow_type">none</property> <property name="shadow_type">none</property>
<child> <child>
<object class="GtkAlignment" id="alignment-misc"> <object class="GtkAlignment" id="alignment-misc">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property> <property name="top_padding">6</property>
<property name="left_padding">12</property> <property name="left_padding">12</property>
<child> <child>
<object class="GtkVBox" id="vbox-misc"> <object class="GtkBox" id="vbox-misc">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
@@ -163,6 +208,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</object> </object>
<packing> <packing>
@@ -177,6 +223,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</object> </object>
<packing> <packing>
@@ -192,6 +239,7 @@
<child type="label"> <child type="label">
<object class="GtkLabel" id="label-misc"> <object class="GtkLabel" id="label-misc">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Miscellaneous&lt;/b&gt;</property> <property name="label" translatable="yes">&lt;b&gt;Miscellaneous&lt;/b&gt;</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
</object> </object>
@@ -205,46 +253,56 @@
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkVSeparator" id="vseparator1"> <object class="GtkSeparator" id="vseparator1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">6</property> <property name="padding">6</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkVBox" id="vbox2"> <object class="GtkBox" id="vbox2">
<property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<object class="GtkFrame" id="frame-information"> <object class="GtkFrame" id="frame-information">
<property name="visible">True</property> <property name="visible">True</property>
<property name="sensitive">False</property> <property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property> <property name="label_xalign">0</property>
<property name="shadow_type">none</property> <property name="shadow_type">none</property>
<child> <child>
<object class="GtkAlignment" id="alignment-information"> <object class="GtkAlignment" id="alignment-information">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property> <property name="top_padding">6</property>
<property name="left_padding">12</property> <property name="left_padding">12</property>
<child> <child>
<object class="GtkVBox" id="vbox-information"> <object class="GtkBox" id="vbox-information">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<object class="GtkHBox" id="hbox-refresh-rate"> <object class="GtkBox" id="hbox-refresh-rate">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<object class="GtkLabel" id="label-refresh-rate"> <object class="GtkLabel" id="label-refresh-rate">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Refresh rate:</property> <property name="label" translatable="yes">Refresh rate:</property>
</object> </object>
<packing> <packing>
@@ -256,6 +314,7 @@
<child> <child>
<object class="GtkComboBox" id="combobox-refresh-rate"> <object class="GtkComboBox" id="combobox-refresh-rate">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@@ -273,6 +332,7 @@
<child> <child>
<object class="GtkLabel" id="label-columns"> <object class="GtkLabel" id="label-columns">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="label" translatable="yes">Columns:</property> <property name="label" translatable="yes">Columns:</property>
</object> </object>
@@ -285,6 +345,7 @@
<child> <child>
<object class="GtkAlignment" id="alignment-columns"> <object class="GtkAlignment" id="alignment-columns">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property> <property name="left_padding">12</property>
<child> <child>
<object class="GtkScrolledWindow" id="scrolledwindow-columns"> <object class="GtkScrolledWindow" id="scrolledwindow-columns">
@@ -297,12 +358,17 @@
<object class="GtkTreeView" id="treeview-columns"> <object class="GtkTreeView" id="treeview-columns">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>
</object> </object>
</child> </child>
</object> </object>
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
@@ -313,17 +379,22 @@
<child type="label"> <child type="label">
<object class="GtkLabel" id="label-information"> <object class="GtkLabel" id="label-information">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Information&lt;/b&gt;</property> <property name="label" translatable="yes">&lt;b&gt;Information&lt;/b&gt;</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
</object> </object>
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
@@ -332,6 +403,7 @@
<child type="tab"> <child type="tab">
<object class="GtkLabel" id="label"> <object class="GtkLabel" id="label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Settings</property> <property name="label" translatable="yes">Settings</property>
</object> </object>
<packing> <packing>
@@ -351,33 +423,10 @@
<placeholder/> <placeholder/>
</child> </child>
</object> </object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button-close">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="pack_type">end</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</object> </object>