From d978ff67175c8e0b05b2a6732ec47aff2dbd21b8 Mon Sep 17 00:00:00 2001 From: Andreas Nilsson Date: Tue, 26 Oct 2010 17:09:15 +0200 Subject: Remove duplicate label in File System tab https://bugzilla.gnome.org/show_bug.cgi?id=597250 --- src/disks.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/disks.cpp b/src/disks.cpp index 172fc7a..c694c0a 100644 --- a/src/disks.cpp +++ b/src/disks.cpp @@ -288,7 +288,6 @@ GtkWidget * create_disk_view(ProcData *procdata) { GtkWidget *disk_box; - GtkWidget *label; GtkWidget *scrolled; GtkWidget *disk_tree; GtkListStore *model; @@ -310,9 +309,6 @@ create_disk_view(ProcData *procdata) gtk_container_set_border_width(GTK_CONTAINER(disk_box), 12); - label = make_title_label(_("File Systems")); - gtk_box_pack_start(GTK_BOX(disk_box), label, FALSE, FALSE, 0); - scrolled = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), GTK_POLICY_AUTOMATIC, -- cgit v1.2.1 From a43f2684570c10f3c5ee2f32b41065c9d2f2f14e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20K=C3=BChl?= Date: Wed, 26 Jan 2011 11:51:50 +0100 Subject: Replace old GDK drawing API Patch from Sergey Nizovtsev. See https://bugzilla.gnome.org/show_bug.cgi?id=627568 --- src/load-graph.cpp | 30 ++++++++++-------------------- src/load-graph.h | 1 - 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/src/load-graph.cpp b/src/load-graph.cpp index 79700d4..3cf8683 100644 --- a/src/load-graph.cpp +++ b/src/load-graph.cpp @@ -87,7 +87,7 @@ void draw_background(LoadGraph *g) { allocation.height, -1); cr = gdk_cairo_create (g->background); - + // set the background colour GtkStyle *style = gtk_widget_get_style (ProcData::get_instance()->notebook); gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_NORMAL]); @@ -95,13 +95,13 @@ void draw_background(LoadGraph *g) { /* draw frame */ cairo_translate (cr, FRAME_WIDTH, FRAME_WIDTH); - + /* Draw background rectangle */ cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); cairo_rectangle (cr, g->rmargin + g->indent, 0, g->draw_width - g->rmargin - g->indent, g->real_draw_height); cairo_fill(cr); - + cairo_set_line_width (cr, 1.0); cairo_set_dash (cr, dash, 2, 0); cairo_set_font_size (cr, g->fontsize); @@ -191,10 +191,6 @@ load_graph_configure (GtkWidget *widget, g->clear_background(); - if (g->gc == NULL) { - g->gc = gdk_gc_new (GDK_DRAWABLE (gtk_widget_get_window (widget))); - } - load_graph_draw (g); return TRUE; @@ -212,19 +208,14 @@ load_graph_expose (GtkWidget *widget, guint i, j; gdouble sample_width, x_offset; + window = gtk_widget_get_window (g->disp); + gtk_widget_get_allocation (g->disp, &allocation); + if (g->background == NULL) { draw_background(g); + gdk_window_set_back_pixmap (window, g->background, FALSE); } - window = gtk_widget_get_window (g->disp); - gtk_widget_get_allocation (g->disp, &allocation); - gdk_draw_drawable (window, - g->gc, - g->background, - 0, 0, 0, 0, - allocation.width, - allocation.height); - /* Number of pixels wide for one graph point */ sample_width = (float)(g->draw_width - g->rmargin - g->indent) / (float)LoadGraph::NUM_POINTS; /* General offset */ @@ -252,7 +243,7 @@ load_graph_expose (GtkWidget *widget, for (i = 1; i < LoadGraph::NUM_POINTS; ++i) { if (g->data[i][j] == -1.0f) continue; - cairo_curve_to (cr, + cairo_curve_to (cr, x_offset - ((i - 0.5f) * g->graph_delx), (1.0f - g->data[i-1][j]) * g->real_draw_height + 3.5f, x_offset - ((i - 0.5f) * g->graph_delx), @@ -619,7 +610,6 @@ LoadGraph::LoadGraph(guint type) graph_buffer_offset(0), main_widget(NULL), disp(NULL), - gc(NULL), background(NULL), timer_index(0), draw(FALSE), @@ -676,9 +666,9 @@ LoadGraph::LoadGraph(guint type) case LOAD_GRAPH_MEM: g->colors[0] = ProcData::get_instance()->config.mem_color; g->colors[1] = ProcData::get_instance()->config.swap_color; - g->mem_color_picker = gsm_color_button_new (&g->colors[0], + g->mem_color_picker = gsm_color_button_new (&g->colors[0], GSMCP_TYPE_PIE); - g->swap_color_picker = gsm_color_button_new (&g->colors[1], + g->swap_color_picker = gsm_color_button_new (&g->colors[1], GSMCP_TYPE_PIE); break; case LOAD_GRAPH_NET: diff --git a/src/load-graph.h b/src/load-graph.h index 6e7a599..9dd28bb 100644 --- a/src/load-graph.h +++ b/src/load-graph.h @@ -66,7 +66,6 @@ struct LoadGraph { GtkWidget *main_widget; GtkWidget *disp; - GdkGC *gc; GdkDrawable *background; guint timer_index; -- cgit v1.2.1 From ed0b5b561f7adada1e62041d29edd18612d42ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20K=C3=BChl?= Date: Wed, 26 Jan 2011 14:12:09 +0100 Subject: Replaced occurances of gtk_dialog_set_has_separator with g_object_set. --- src/lsof.cpp | 1 - src/memmaps.cpp | 1 - src/openfiles.cpp | 2 +- src/procdialogs.cpp | 4 ++-- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lsof.cpp b/src/lsof.cpp index 24f14a5..7773eff 100644 --- a/src/lsof.cpp +++ b/src/lsof.cpp @@ -312,7 +312,6 @@ void procman_lsof(ProcData *procdata) // G_CALLBACK(close_dialog), NULL); gtk_window_set_resizable(GTK_WINDOW(dialog), TRUE); gtk_window_set_default_size(GTK_WINDOW(dialog), 575, 400); - // gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); gtk_container_set_border_width(GTK_CONTAINER(dialog), 12); GtkWidget *mainbox = gtk_vbox_new(FALSE, 12); gtk_container_add(GTK_CONTAINER(dialog), mainbox); diff --git a/src/memmaps.cpp b/src/memmaps.cpp index 3ca8229..de32ce0 100644 --- a/src/memmaps.cpp +++ b/src/memmaps.cpp @@ -608,7 +608,6 @@ create_single_memmaps_dialog (GtkTreeModel *model, GtkTreePath *path, gtk_window_set_title(GTK_WINDOW(memmapsdialog), _("Memory Maps")); gtk_window_set_resizable(GTK_WINDOW(memmapsdialog), TRUE); gtk_window_set_default_size(GTK_WINDOW(memmapsdialog), 575, 400); - // gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); gtk_container_set_border_width(GTK_CONTAINER(memmapsdialog), 12); GtkWidget *mainbox = gtk_vbox_new(FALSE, 12); diff --git a/src/openfiles.cpp b/src/openfiles.cpp index 8b76858..de3e864 100644 --- a/src/openfiles.cpp +++ b/src/openfiles.cpp @@ -335,7 +335,7 @@ create_single_openfiles_dialog (GtkTreeModel *model, GtkTreePath *path, NULL); gtk_window_set_resizable (GTK_WINDOW (openfilesdialog), TRUE); gtk_window_set_default_size (GTK_WINDOW (openfilesdialog), 575, 400); - gtk_dialog_set_has_separator (GTK_DIALOG (openfilesdialog), FALSE); + g_object_set(G_OBJECT(openfilesdialog), "has-separator", FALSE, NULL); gtk_container_set_border_width (GTK_CONTAINER (openfilesdialog), 5); vbox = gtk_dialog_get_content_area (GTK_DIALOG (openfilesdialog)); diff --git a/src/procdialogs.cpp b/src/procdialogs.cpp index fef8b5f..2d0de35 100644 --- a/src/procdialogs.cpp +++ b/src/procdialogs.cpp @@ -178,7 +178,7 @@ procdialog_create_renice_dialog (ProcData *procdata) NULL); renice_dialog = dialog; gtk_window_set_resizable (GTK_WINDOW (renice_dialog), FALSE); - gtk_dialog_set_has_separator (GTK_DIALOG (renice_dialog), FALSE); + g_object_set (G_OBJECT (renice_dialog), "has-separator", FALSE, NULL); gtk_container_set_border_width (GTK_CONTAINER (renice_dialog), 5); button = gtk_button_new (); @@ -510,7 +510,7 @@ procdialog_create_preferences_dialog (ProcData *procdata) /* any function to set list height by contents/items inside it. */ gtk_window_set_default_size (GTK_WINDOW (dialog), 400, 420); gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); - gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); + g_object_set (G_OBJECT (dialog), "has-separator", FALSE, NULL); prefs_dialog = dialog; main_vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); -- cgit v1.2.1 From 0a2d8ddbcd904afbd80aace9de6732a7bea28399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20K=C3=BChl?= Date: Thu, 27 Jan 2011 15:20:45 +0100 Subject: Moved rsvg_init and rsvg_term into main to fix Bug #613752. --- src/gsm_color_button.c | 3 --- src/procman.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gsm_color_button.c b/src/gsm_color_button.c index ce72cc1..da82169 100644 --- a/src/gsm_color_button.c +++ b/src/gsm_color_button.c @@ -601,8 +601,6 @@ gsm_color_button_init (GSMColorButton * color_button) { color_button->priv = GSM_COLOR_BUTTON_GET_PRIVATE (color_button); - rsvg_init (); - color_button->priv->color.red = 0; color_button->priv->color.green = 0; color_button->priv->color.blue = 0; @@ -651,7 +649,6 @@ gsm_color_button_finalize (GObject * object) cairo_surface_destroy (color_button->priv->image_buffer); color_button->priv->image_buffer = NULL; - rsvg_term (); G_OBJECT_CLASS (gsm_color_button_parent_class)->finalize (object); } diff --git a/src/procman.cpp b/src/procman.cpp index 16640c3..9a4d543 100644 --- a/src/procman.cpp +++ b/src/procman.cpp @@ -728,6 +728,9 @@ main (int argc, char *argv[]) exit (0); } + /* initialize rsvg */ + rsvg_init (); + gtk_window_set_default_icon_name ("utilities-system-monitor"); g_set_application_name(_("System Monitor")); @@ -768,6 +771,10 @@ main (int argc, char *argv[]) glibtop_close (); + // This function should only be called just before program exit. + // See MATE bug #592100 for a discussion about this. + rsvg_term (); + return 0; } -- cgit v1.2.1 From bb04c1debe08a65ca834ad531b73fcc58b37eb2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=3D=3FUTF-8=3Fq=3FJavier=3D20Jard=3DC3=3DB3n=3F=3D?= Date: Thu, 30 Sep 2010 18:42:44 +0200 Subject: Replacing GtkNotebookPage with GtkWidget according to changes in GTK+ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Chris Kühl --- src/callbacks.cpp | 2 +- src/callbacks.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/callbacks.cpp b/src/callbacks.cpp index 3ad102e..0e1b399 100644 --- a/src/callbacks.cpp +++ b/src/callbacks.cpp @@ -324,7 +324,7 @@ cb_tree_popup_menu (GtkWidget *widget, gpointer data) void -cb_switch_page (GtkNotebook *nb, GtkNotebookPage *page, +cb_switch_page (GtkNotebook *nb, GtkWidget *page, gint num, gpointer data) { cb_change_current_page (nb, num, data); diff --git a/src/callbacks.h b/src/callbacks.h index 4c84793..6ce3e18 100644 --- a/src/callbacks.h +++ b/src/callbacks.h @@ -60,7 +60,7 @@ gboolean cb_tree_button_pressed (GtkWidget *widget, GdkEventButton *event, void cb_change_current_page (GtkNotebook *nb, gint num, gpointer data); -void cb_switch_page (GtkNotebook *nb, GtkNotebookPage *page, +void cb_switch_page (GtkNotebook *nb, GtkWidget *page, gint num, gpointer data); gint cb_update_disks (gpointer data); -- cgit v1.2.1 From 7b0f14e04533ae7cdb3689862e763f90c688dccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=3D=3FUTF-8=3Fq=3FChris=3D20K=3DC3=3DBChl=3F=3D?= Date: Thu, 27 Jan 2011 11:55:10 +0100 Subject: Removed use of deprecated mateconf_init. --- src/procman.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/procman.cpp b/src/procman.cpp index 9a4d543..bffb4af 100644 --- a/src/procman.cpp +++ b/src/procman.cpp @@ -734,8 +734,6 @@ main (int argc, char *argv[]) gtk_window_set_default_icon_name ("utilities-system-monitor"); g_set_application_name(_("System Monitor")); - mateconf_init (argc, argv, NULL); - client = mateconf_client_get_default (); mateconf_client_add_dir(client, "/apps/procman", MATECONF_CLIENT_PRELOAD_NONE, NULL); -- cgit v1.2.1