diff options
author | Lauris Kaplinski <lauris@src.gnome.org> | 2002-02-04 17:48:43 +0000 |
---|---|---|
committer | Lauris Kaplinski <lauris@src.gnome.org> | 2002-02-04 17:48:43 +0000 |
commit | 35e192827a01e0d14427faec515f257854d9c3f5 (patch) | |
tree | 92cf6242a7b933a1665ac13ef66afd7d0fabfa23 /capplets | |
parent | 679900bb5fcf1fab071ba96c81e6247cf5d87d23 (diff) | |
download | gnome-control-center-35e192827a01e0d14427faec515f257854d9c3f5.tar.gz |
Lot of little fixes to make it to compile without most of the deprecated stuff
Diffstat (limited to 'capplets')
-rw-r--r-- | capplets/background/ChangeLog | 11 | ||||
-rw-r--r-- | capplets/background/background-properties-capplet.c | 39 | ||||
-rw-r--r-- | capplets/default-applications/ChangeLog | 5 | ||||
-rw-r--r-- | capplets/default-applications/gnome-default-applications-properties.c | 9 | ||||
-rw-r--r-- | capplets/file-types/ChangeLog | 14 | ||||
-rw-r--r-- | capplets/file-types/mime-category-edit-dialog.c | 5 | ||||
-rw-r--r-- | capplets/file-types/mime-edit-dialog.c | 31 | ||||
-rw-r--r-- | capplets/file-types/mime-type-info.c | 3 | ||||
-rw-r--r-- | capplets/file-types/service-edit-dialog.c | 31 | ||||
-rw-r--r-- | capplets/file-types/service-info.c | 1 | ||||
-rw-r--r-- | capplets/mouse/ChangeLog | 6 | ||||
-rw-r--r-- | capplets/mouse/gnome-mouse-properties.c | 7 | ||||
-rw-r--r-- | capplets/sound/ChangeLog | 7 | ||||
-rw-r--r-- | capplets/sound/sound-properties-capplet.c | 11 | ||||
-rw-r--r-- | capplets/theme-switcher/ChangeLog | 10 | ||||
-rw-r--r-- | capplets/theme-switcher/control/control.c | 15 | ||||
-rw-r--r-- | capplets/theme-switcher/main.c | 12 | ||||
-rw-r--r-- | capplets/ui-properties/ChangeLog | 4 | ||||
-rw-r--r-- | capplets/ui-properties/gnome-ui-properties.c | 2 |
19 files changed, 151 insertions, 72 deletions
diff --git a/capplets/background/ChangeLog b/capplets/background/ChangeLog index b9d03e775..148692636 100644 --- a/capplets/background/ChangeLog +++ b/capplets/background/ChangeLog @@ -1,3 +1,14 @@ +2002-02-04 Lauris Kaplinski <lauris@ximian.com> + + * background-properties-capplet.c (setup_color_widgets): Kill warning + (set_background_image_preview): Use g_file_test, use g_object_unref + instead of gdk_pixbuf_unref + (image_filename_clicked): Use g_signal_connect + (dialog_button_clicked_cb): Use GtkDialog instead of GnomeDialog + (realize_2_cb): Comment out to kill warning + (realize_cb): Ditto + (real_realize_cb): Ditto + 2002-01-13 Seth Nickell <snickell@stanford.edu> reviewed by: <delete if not using a buddy> diff --git a/capplets/background/background-properties-capplet.c b/capplets/background/background-properties-capplet.c index 9e77cdf7e..e595de1db 100644 --- a/capplets/background/background-properties-capplet.c +++ b/capplets/background/background-properties-capplet.c @@ -25,6 +25,7 @@ #include <config.h> +#include <string.h> #include <gnome.h> #include <gconf/gconf-client.h> #include <glade/glade.h> @@ -324,6 +325,7 @@ get_legacy_settings (void) * making it feel more natural to the user. */ +#if 0 static gboolean real_realize_cb (BGPreferences *prefs) { @@ -345,19 +347,24 @@ real_realize_cb (BGPreferences *prefs) return FALSE; } +#endif +#if 0 static gboolean realize_2_cb (BGPreferences *prefs) { gtk_idle_add ((GtkFunction) real_realize_cb, prefs); return FALSE; } +#endif +#if 0 static void realize_cb (GtkWidget *widget, BGPreferences *prefs) { gtk_timeout_add (100, (GtkFunction) realize_2_cb, prefs); } +#endif static void setup_color_widgets (int orientation) @@ -384,6 +391,7 @@ setup_color_widgets (int orientation) color2_string = "Bottom Color"; break; default: + break; } @@ -440,7 +448,7 @@ set_background_image_preview (const char *filename) g_assert (background_image_label != NULL); g_assert (background_image_preview != NULL); - if ((filename == NULL) || (!g_file_exists (filename))) { + if ((filename == NULL) || (!g_file_test (filename, G_FILE_TEST_EXISTS))) { gtk_label_set_text (GTK_LABEL (background_image_label), "No Picture"); gtk_image_set_from_stock (GTK_IMAGE (background_image_preview), GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_DIALOG); @@ -506,8 +514,8 @@ set_background_image_preview (const char *filename) scaled_pixbuf = gdk_pixbuf_scale_simple (pixbuf, width, height, GDK_INTERP_BILINEAR); gtk_image_set_from_pixbuf (GTK_IMAGE (background_image_preview), scaled_pixbuf); - gdk_pixbuf_unref (scaled_pixbuf); - gdk_pixbuf_unref (pixbuf); + g_object_unref (G_OBJECT (scaled_pixbuf)); + g_object_unref (G_OBJECT (pixbuf)); length = strlen (filename); @@ -551,17 +559,16 @@ image_filename_clicked (GtkButton *button, gpointer user_data) gtk_file_selection_set_filename (GTK_FILE_SELECTION(file_selector), old_filename); } - gtk_signal_connect (GTK_OBJECT (file_selector), "destroy", - GTK_SIGNAL_FUNC(gtk_widget_destroyed), - &file_selector); + g_signal_connect (G_OBJECT (file_selector), "destroy", + (GCallback) gtk_widget_destroyed, + &file_selector); - gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (file_selector)->ok_button), - "clicked", GTK_SIGNAL_FUNC (file_selector_cb), file_selector); + g_signal_connect (G_OBJECT (GTK_FILE_SELECTION (file_selector)->ok_button), + "clicked", (GCallback ) file_selector_cb, file_selector); - gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (file_selector)->cancel_button), - "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), - GTK_OBJECT (file_selector)); + g_signal_connect_swapped (G_OBJECT (GTK_FILE_SELECTION (file_selector)->cancel_button), + "clicked", (GCallback ) gtk_widget_destroy, file_selector); /* Display that dialog */ @@ -674,9 +681,9 @@ create_dialog (BGApplier **bg_appliers) toggle_array[BACKGROUND_TYPE_STRETCHED] = glade_xml_get_widget (dialog, "stretched_toggle"); for (i = 0; i < NUMBER_BACKGROUND_TYPES; i++) { - gtk_signal_connect (GTK_OBJECT (toggle_array[i]), - "clicked", GTK_SIGNAL_FUNC (background_type_toggled), - toggle_array); + g_signal_connect (G_OBJECT (toggle_array[i]), + "clicked", (GCallback) background_type_toggled, + toggle_array); } border_shading_label = glade_xml_get_widget (dialog, "border_shading_label"); @@ -727,7 +734,7 @@ create_dialog (BGApplier **bg_appliers) gtk_box_pack_end (GTK_BOX (widget), bg_applier_get_preview_widget (bg_appliers [BACKGROUND_TYPE_STRETCHED]), TRUE, TRUE, 0); widget = glade_xml_get_widget (dialog, "background_image_button"); - gtk_signal_connect (GTK_OBJECT(widget), "clicked", GTK_SIGNAL_FUNC (image_filename_clicked), NULL); + g_signal_connect (G_OBJECT (widget), "clicked", (GCallback) image_filename_clicked, NULL); background_image_preview = glade_xml_get_widget (dialog, "background_image_preview"); @@ -747,7 +754,7 @@ idle_draw (gpointer data) } static void -dialog_button_clicked_cb (GnomeDialog *dialog, gint response_id, GConfChangeSet *changeset) +dialog_button_clicked_cb (GtkDialog *dialog, gint response_id, GConfChangeSet *changeset) { switch (response_id) { case GTK_RESPONSE_CLOSE: diff --git a/capplets/default-applications/ChangeLog b/capplets/default-applications/ChangeLog index 7975cbb53..e73f7b960 100644 --- a/capplets/default-applications/ChangeLog +++ b/capplets/default-applications/ChangeLog @@ -1,3 +1,8 @@ +2002-02-04 Lauris Kaplinski <lauris@ximian.com> + + * gnome-default-applications-properties.c (initialize_default_applications): + Use glib methods instead of deprecated libgnome ones + 2002-01-19 Seth Nickell <snickell@stanford.edu> * Makefile.am: diff --git a/capplets/default-applications/gnome-default-applications-properties.c b/capplets/default-applications/gnome-default-applications-properties.c index 7696a4595..9f53d0102 100644 --- a/capplets/default-applications/gnome-default-applications-properties.c +++ b/capplets/default-applications/gnome-default-applications-properties.c @@ -27,6 +27,7 @@ # include <config.h> #endif +#include <string.h> #include <gnome.h> #include <gconf/gconf-client.h> #include <glade/glade.h> @@ -75,19 +76,19 @@ initialize_default_applications (void) gint i; for (i = 0; i < G_N_ELEMENTS (possible_editors); i++ ) { - if (gnome_is_program_in_path (possible_editors[i].executable_name)) + if (g_find_program_in_path (possible_editors[i].executable_name)) possible_editors[i].in_path = TRUE; } for (i = 0; i < G_N_ELEMENTS (possible_browsers); i++ ) { - if (gnome_is_program_in_path (possible_browsers[i].executable_name)) + if (g_find_program_in_path (possible_browsers[i].executable_name)) possible_browsers[i].in_path = TRUE; } for (i = 0; i < G_N_ELEMENTS (possible_help_viewers); i++ ) { - if (gnome_is_program_in_path (possible_help_viewers[i].executable_name)) + if (g_find_program_in_path (possible_help_viewers[i].executable_name)) possible_help_viewers[i].in_path = TRUE; } for (i = 0; i < G_N_ELEMENTS (possible_terminals); i++ ) { - if (gnome_is_program_in_path (possible_terminals[i].exec)) + if (g_find_program_in_path (possible_terminals[i].exec)) possible_terminals[i].in_path = TRUE; } } diff --git a/capplets/file-types/ChangeLog b/capplets/file-types/ChangeLog index 08427452b..5e7b9321c 100644 --- a/capplets/file-types/ChangeLog +++ b/capplets/file-types/ChangeLog @@ -1,3 +1,17 @@ +2002-02-04 Lauris Kaplinski <lauris@ximian.com> + + * service-edit-dialog.c (setup_add_dialog): Use gtk_menu_shell_append + (validate_data): Use gtk_message_dialog methods + + * mime-category-edit-dialog.c (populate_application_list): Use + gtk_menu_shell_append + + * mime-edit-dialog.c (setup_add_dialog): Use gtk_menu_shell_append + (validate_data): Use gtk_message_dialog methods + + * mime-type-info.c: #include <string.h>, kill warning + (mime_type_info_get_icon_path): Use g_file_test + 2002-01-29 Bradford Hovinen <hovinen@ximian.com> * file-types-capplet.c (create_dialog): Pack the icon and diff --git a/capplets/file-types/mime-category-edit-dialog.c b/capplets/file-types/mime-category-edit-dialog.c index 1796a76a8..c01a04f8b 100644 --- a/capplets/file-types/mime-category-edit-dialog.c +++ b/capplets/file-types/mime-category-edit-dialog.c @@ -25,6 +25,7 @@ # include "config.h" #endif +#include <string.h> #include <glade/glade.h> #include <libgnomevfs/gnome-vfs-application-registry.h> #include <libgnomevfs/gnome-vfs-mime-handlers.h> @@ -332,14 +333,14 @@ populate_application_list (MimeCategoryEditDialog *dialog) "app", app, (GDestroyNotify) gnome_vfs_mime_application_free); - gtk_menu_append (menu, menu_item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); gtk_widget_show (menu_item); } dialog->p->default_action_active = !(i == 0); dialog->p->custom_action = (found_idx < 0); - gtk_menu_append (menu, gtk_menu_item_new_with_label (_("Custom"))); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), gtk_menu_item_new_with_label (_("Custom"))); if (found_idx < 0) { found_idx = i; diff --git a/capplets/file-types/mime-edit-dialog.c b/capplets/file-types/mime-edit-dialog.c index 091f63c8c..481d5538c 100644 --- a/capplets/file-types/mime-edit-dialog.c +++ b/capplets/file-types/mime-edit-dialog.c @@ -25,6 +25,7 @@ # include "config.h" #endif +#include <string.h> #include <glade/glade.h> #include <libgnomevfs/gnome-vfs-mime-handlers.h> #include <libgnomevfs/gnome-vfs-application-registry.h> @@ -385,12 +386,12 @@ setup_add_dialog (MimeEditDialog *dialog) item = gtk_menu_item_new_with_label (_("None")); menu = gtk_menu_new (); - gtk_menu_append (GTK_MENU (menu), item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_option_menu_set_menu (GTK_OPTION_MENU (WID ("component_select")), menu); item = gtk_menu_item_new_with_label (_("Custom")); menu = gtk_menu_new (); - gtk_menu_append (GTK_MENU (menu), item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_option_menu_set_menu (GTK_OPTION_MENU (WID ("default_action_select")), menu); gtk_widget_set_sensitive (WID ("component_box"), FALSE); @@ -432,14 +433,14 @@ populate_component_list (MimeEditDialog *dialog) g_object_set_data (G_OBJECT (menu_item), "component", info); - gtk_menu_append (menu, menu_item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); gtk_widget_show (menu_item); } dialog->p->component_active = !(i == 0); menu_item = gtk_menu_item_new_with_label (_("None")); - gtk_menu_append (menu, menu_item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); gtk_widget_show (menu_item); if (found_idx < 0) @@ -481,14 +482,14 @@ populate_application_list (MimeEditDialog *dialog) "app", app, (GDestroyNotify) gnome_vfs_mime_application_free); - gtk_menu_append (menu, menu_item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); gtk_widget_show (menu_item); } dialog->p->default_action_active = !(i == 0); dialog->p->custom_action = (found_idx < 0); - gtk_menu_append (menu, gtk_menu_item_new_with_label (_("Custom"))); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), gtk_menu_item_new_with_label (_("Custom"))); if (found_idx < 0) { found_idx = i; @@ -666,19 +667,21 @@ validate_data (MimeEditDialog *dialog) if (tmp != NULL && *tmp != '\0') { if (strchr (tmp, ' ') || !strchr (tmp, '/')) { - err_dialog = gnome_error_dialog_parented - (_("Invalid MIME type. Please enter a valid MIME type, or " - "leave the field blank to have one generated for you."), - GTK_WINDOW (dialog->p->dialog_win)); + err_dialog = gtk_message_dialog_new (GTK_WINDOW (dialog->p->dialog_win), + 0, GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("Invalid MIME type. Please enter a valid MIME type, or " + "leave the field blank to have one generated for you.")); gtk_window_set_modal (GTK_WINDOW (err_dialog), TRUE); return FALSE; } else if (dialog->p->is_add && (gnome_vfs_mime_type_is_known (tmp) || get_mime_type_info (tmp) != NULL)) { - err_dialog = gnome_error_dialog_parented - (_("There already exists a MIME type of that name."), - GTK_WINDOW (dialog->p->dialog_win)); + err_dialog = gtk_message_dialog_new (GTK_WINDOW (dialog->p->dialog_win), + 0, GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("There already exists a MIME type of that name.")); gtk_window_set_modal (GTK_WINDOW (err_dialog), TRUE); @@ -752,7 +755,7 @@ choose_cat_cb (MimeEditDialog *dialog) GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL); - gtk_widget_set_usize (dialog_win, 300, 300); + gtk_widget_set_size_request (dialog_win, 300, 300); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); diff --git a/capplets/file-types/mime-type-info.c b/capplets/file-types/mime-type-info.c index 35fb438b8..32e7ff993 100644 --- a/capplets/file-types/mime-type-info.c +++ b/capplets/file-types/mime-type-info.c @@ -29,6 +29,7 @@ # include "config.h" #endif +#include <string.h> #include <bonobo.h> #include <libgnomevfs/gnome-vfs-application-registry.h> #include <libgnomevfs/gnome-vfs-utils.h> @@ -141,7 +142,7 @@ mime_type_info_get_icon_path (MimeTypeInfo *info) if (info->icon_name == NULL) info->icon_name = g_strdup (gnome_vfs_mime_get_icon (info->mime_type)); - if (g_file_exists (info->icon_name)) { + if (g_file_test (info->icon_name, G_FILE_TEST_EXISTS)) { info->icon_path = g_strdup (info->icon_name); return info->icon_path; } diff --git a/capplets/file-types/service-edit-dialog.c b/capplets/file-types/service-edit-dialog.c index 660e53467..14b2c6564 100644 --- a/capplets/file-types/service-edit-dialog.c +++ b/capplets/file-types/service-edit-dialog.c @@ -25,6 +25,7 @@ # include "config.h" #endif +#include <string.h> #include <glade/glade.h> #include <gconf/gconf-client.h> #include <libgnomevfs/gnome-vfs-method.h> @@ -349,7 +350,7 @@ setup_add_dialog (ServiceEditDialog *dialog) item = gtk_menu_item_new_with_label (_("Custom")); menu = gtk_menu_new (); - gtk_menu_append (GTK_MENU (menu), item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_option_menu_set_menu (GTK_OPTION_MENU (WID ("program_select")), menu); gtk_widget_set_sensitive (WID ("program_select"), FALSE); @@ -387,7 +388,7 @@ populate_app_list (ServiceEditDialog *dialog) item = gtk_menu_item_new_with_label (app->name); g_object_set_data_full (G_OBJECT (item), "app", app, (GDestroyNotify) gnome_vfs_mime_application_free); gtk_widget_show (item); - gtk_menu_append (menu, item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); service_apps = service_apps->next; i++; @@ -395,7 +396,7 @@ populate_app_list (ServiceEditDialog *dialog) item = gtk_menu_item_new_with_label (_("Custom")); gtk_widget_show (item); - gtk_menu_append (menu, item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); if (found_idx < 0) { if (dialog->p->info->app != NULL) { @@ -477,14 +478,15 @@ validate_data (ServiceEditDialog *dialog) { const gchar *tmp, *tmp1; gchar *dir; - GtkWidget *err_dialog; + GtkWidget *err_dialog = NULL; tmp = gtk_entry_get_text (GTK_ENTRY (WID ("protocol_entry"))); if (tmp == NULL || *tmp == '\0') { - err_dialog = gnome_error_dialog_parented - (_("Please enter a protocol name."), - GTK_WINDOW (dialog->p->dialog_win)); + err_dialog = gtk_message_dialog_new (GTK_WINDOW (dialog->p->dialog_win), + 0, GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("Please enter a protocol name.")); gtk_window_set_modal (GTK_WINDOW (err_dialog), TRUE); @@ -493,9 +495,11 @@ validate_data (ServiceEditDialog *dialog) for (tmp1 = tmp; *tmp1 != '\0' && isalnum (*tmp1); tmp1++); if (*tmp1 != '\0') { - err_dialog = gnome_error_dialog_parented - (_("Invalid protocol name. Please enter a protocol name without any spaces or punctuation."), - GTK_WINDOW (dialog->p->dialog_win)); + err_dialog = + gtk_message_dialog_new (GTK_WINDOW (dialog->p->dialog_win), + 0, GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("Invalid protocol name. Please enter a protocol name without any spaces or punctuation.")); gtk_window_set_modal (GTK_WINDOW (err_dialog), TRUE); @@ -505,9 +509,10 @@ validate_data (ServiceEditDialog *dialog) if (dialog->p->is_add) { dir = g_strconcat ("/desktop/gnome/url-handlers/", tmp, NULL); if (get_service_info (tmp) || gconf_client_dir_exists (gconf_client_get_default (), dir, NULL)) { - err_dialog = gnome_error_dialog_parented - (_("There is already a protocol by that name."), - GTK_WINDOW (dialog->p->dialog_win)); + gtk_message_dialog_new (GTK_WINDOW (dialog->p->dialog_win), + 0, GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("There is already a protocol by that name.")); gtk_window_set_modal (GTK_WINDOW (err_dialog), TRUE); diff --git a/capplets/file-types/service-info.c b/capplets/file-types/service-info.c index 2f3cf4c18..a8a680bd3 100644 --- a/capplets/file-types/service-info.c +++ b/capplets/file-types/service-info.c @@ -26,6 +26,7 @@ # include "config.h" #endif +#include <string.h> #include <gconf/gconf-client.h> #include <libgnomevfs/gnome-vfs-application-registry.h> diff --git a/capplets/mouse/ChangeLog b/capplets/mouse/ChangeLog index d0219fd1a..af06b99a3 100644 --- a/capplets/mouse/ChangeLog +++ b/capplets/mouse/ChangeLog @@ -1,3 +1,9 @@ +2002-02-04 Lauris Kaplinski <lauris@ximian.com> + + * gnome-mouse-properties.c (drawing_area_expose_event): Kill warning + (dialog_button_clicked_cb): Use G_TYPE_STRING + (dialog_button_clicked_cb): Use GtkDialog + Tue Jan 8 15:47:24 2002 Jonathan Blandford <jrb@redhat.com> * .cvsignore: New ignores. diff --git a/capplets/mouse/gnome-mouse-properties.c b/capplets/mouse/gnome-mouse-properties.c index 7aff0ce45..1e306c760 100644 --- a/capplets/mouse/gnome-mouse-properties.c +++ b/capplets/mouse/gnome-mouse-properties.c @@ -225,8 +225,7 @@ drawing_area_expose_event (GtkWidget *widget, GConfChangeSet *changeset) { static gboolean first_time = TRUE; - - GdkPixbuf *pixbuf; + GdkPixbuf *pixbuf = NULL; if (first_time) { gdk_window_set_events (widget->window, gdk_window_get_events (widget->window) | GDK_BUTTON_PRESS_MASK); @@ -348,7 +347,7 @@ setup_dialog (GladeXML *dialog, GConfChangeSet *changeset) /* Cursors page */ tree_view = WID ("cursor_tree"); - model = (GtkTreeModel *) gtk_list_store_new (N_COLUMNS, GDK_TYPE_PIXBUF, GTK_TYPE_STRING); + model = (GtkTreeModel *) gtk_list_store_new (N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING); gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), model); column = gtk_tree_view_column_new (); renderer = gtk_cell_renderer_pixbuf_new (); @@ -447,7 +446,7 @@ create_dialog (void) /* Callback issued when a button is clicked on the dialog */ static void -dialog_button_clicked_cb (GnomeDialog *dialog, gint response_id, GConfChangeSet *changeset) +dialog_button_clicked_cb (GtkDialog *dialog, gint response_id, GConfChangeSet *changeset) { switch (response_id) { case GTK_RESPONSE_APPLY: diff --git a/capplets/sound/ChangeLog b/capplets/sound/ChangeLog index 701760cd7..07af5484e 100644 --- a/capplets/sound/ChangeLog +++ b/capplets/sound/ChangeLog @@ -1,3 +1,10 @@ +2002-02-04 Lauris Kaplinski <lauris@ximian.com> + + * sound-properties-capplet.c (create_dialog): Use g_object_set_data, + use g_signal_connect + (dialog_button_clicked_cb): GtkDialog instead of GnomeDialog + (create_dialog): Use gtk_widget_set_size_request + 2002-01-27 Seth Nickell <snickell@stanford.edu> * sound.desktop.in: diff --git a/capplets/sound/sound-properties-capplet.c b/capplets/sound/sound-properties-capplet.c index a5887d384..dcd26a26a 100644 --- a/capplets/sound/sound-properties-capplet.c +++ b/capplets/sound/sound-properties-capplet.c @@ -57,7 +57,7 @@ create_dialog (void) data = glade_xml_new (GNOMECC_DATA_DIR "/interfaces/sound-properties.glade", "prefs_widget", NULL); widget = glade_xml_get_widget (data, "prefs_widget"); - gtk_object_set_data (GTK_OBJECT (widget), "glade-data", data); + g_object_set_data (G_OBJECT (widget), "glade-data", data); props = sound_properties_new (); sound_properties_add_defaults (props, NULL); @@ -65,11 +65,10 @@ create_dialog (void) gtk_box_pack_start (GTK_BOX (box), sound_view_new (props), TRUE, TRUE, 0); - gtk_signal_connect_object (GTK_OBJECT (widget), "destroy", - GTK_SIGNAL_FUNC (gtk_object_destroy), - GTK_OBJECT (props)); + g_signal_connect_swapped (G_OBJECT (widget), "destroy", + (GCallback) gtk_object_destroy, props); - gtk_widget_set_usize (widget, -1, 250); + gtk_widget_set_size_request (widget, -1, 250); return data; } @@ -112,7 +111,7 @@ get_legacy_settings (void) } static void -dialog_button_clicked_cb (GnomeDialog *dialog, gint response_id, GConfChangeSet *changeset) +dialog_button_clicked_cb (GtkDialog *dialog, gint response_id, GConfChangeSet *changeset) { switch (response_id) { case GTK_RESPONSE_APPLY: diff --git a/capplets/theme-switcher/ChangeLog b/capplets/theme-switcher/ChangeLog index 275676e32..f54561f26 100644 --- a/capplets/theme-switcher/ChangeLog +++ b/capplets/theme-switcher/ChangeLog @@ -1,3 +1,13 @@ +2002-02-04 Lauris Kaplinski <lauris@ximian.com> + + * main.c (themes_list_refresh): Use g_path_get_basename + (get_selected_theme_name): Ditto + (install_cb): Use g_signal_connect + + * control/control.c (create_form): Use gtk_menu_shell_append + (create_form): Use gtk_radio_button_get_group, + set entry max length explicitly + 2002-01-28 Richard Hestilow <hestilow@ximian.com> * main.c: Include gconf-client.h, add trailing NULLs to all diff --git a/capplets/theme-switcher/control/control.c b/capplets/theme-switcher/control/control.c index a6262f340..f1a31753f 100644 --- a/capplets/theme-switcher/control/control.c +++ b/capplets/theme-switcher/control/control.c @@ -48,9 +48,10 @@ create_form (void) hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); gtk_table_attach (GTK_TABLE (table), hbox, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, 0, GNOME_PAD_SMALL, 0); - widget = gtk_entry_new_with_max_length (50); + widget = gtk_entry_new (); + gtk_entry_set_max_length (GTK_ENTRY (widget), 50); gtk_entry_set_text (GTK_ENTRY (widget), _("Sample Text Entry Field")); - gtk_widget_set_usize (widget, 70, -1); + gtk_widget_set_size_request (widget, 70, -1); hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), widget, TRUE, TRUE, 0); gtk_table_attach (GTK_TABLE (table), hbox, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, 0, GNOME_PAD_SMALL, GNOME_PAD_SMALL); @@ -61,26 +62,26 @@ create_form (void) gtk_table_attach (GTK_TABLE (table), menubar, 1, 2, 2, 3, 0, 0, GNOME_PAD_SMALL, GNOME_PAD_SMALL); widget = gtk_menu_item_new_with_label(_("Submenu")); - gtk_menu_bar_append(GTK_MENU_BAR(menubar), widget); + gtk_menu_shell_append (GTK_MENU_SHELL (menubar), widget); menu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(widget), menu); widget = gtk_menu_item_new_with_label(_("Item 1")); - gtk_menu_append(GTK_MENU(menu), widget); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), widget); widget = gtk_menu_item_new_with_label(_("Another item")); - gtk_menu_append(GTK_MENU(menu), widget); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), widget); widget = gtk_radio_button_new_with_label (NULL, _("Radio Button 1")); hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); - group = gtk_radio_button_group (GTK_RADIO_BUTTON (widget)); + group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (widget)); gtk_table_attach (GTK_TABLE (table), hbox, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, 0, 0, 0); widget = gtk_radio_button_new_with_label (group, _("Radio Button 2")); hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); - group = gtk_radio_button_group (GTK_RADIO_BUTTON (widget)); + group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (widget)); gtk_table_attach (GTK_TABLE (table), hbox, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, 0, 0, 0); /* column three */ diff --git a/capplets/theme-switcher/main.c b/capplets/theme-switcher/main.c index b52ea3653..92dc746ca 100644 --- a/capplets/theme-switcher/main.c +++ b/capplets/theme-switcher/main.c @@ -82,8 +82,11 @@ themes_list_refresh (void) for (i = 0; themes[i] != NULL; i++) { GtkTreeIter iter; + gchar *basename; + basename = g_path_get_basename (themes[i]); gtk_list_store_append (model, &iter); - gtk_list_store_set (model, &iter, 0, g_basename (themes[i]), -1); + gtk_list_store_set (model, &iter, 0, basename, -1); + g_free (basename); } } @@ -111,7 +114,7 @@ static gchar* get_selected_theme (void) } -static const gchar* get_selected_theme_name (void) +static gchar* get_selected_theme_name (void) { int index = -1; GtkTreeView *view = GTK_TREE_VIEW (glade_xml_get_widget (xml, "tree1")); @@ -121,7 +124,7 @@ static const gchar* get_selected_theme_name (void) if (index == -1) return NULL; - return g_basename (themes[index]); + return g_path_get_basename (themes[index]); } static void @@ -131,6 +134,7 @@ apply_cb (void) if (name) { gconf_client_set_string (gconf_client_get_default (), "/desktop/gnome/interface/gtk_theme", name, NULL); + g_free (name); } } @@ -208,7 +212,7 @@ install_cb (GtkButton *b, gpointer data) { GtkFileSelection *sel = GTK_FILE_SELECTION (gtk_file_selection_new (_("Select a theme to install"))); g_signal_connect (G_OBJECT (sel->ok_button), "clicked", (GCallback) fsel_ok_cb, sel); - gtk_signal_connect_object (GTK_OBJECT (sel->cancel_button), "clicked", (GCallback) gtk_widget_destroy, G_OBJECT (sel)); + g_signal_connect_swapped (G_OBJECT (sel->cancel_button), "clicked", (GCallback) gtk_widget_destroy, sel); gtk_widget_show_all (GTK_WIDGET (sel)); } diff --git a/capplets/ui-properties/ChangeLog b/capplets/ui-properties/ChangeLog index 4d1594ac6..3bba082ba 100644 --- a/capplets/ui-properties/ChangeLog +++ b/capplets/ui-properties/ChangeLog @@ -1,3 +1,7 @@ +2002-02-04 Lauris Kaplinski <lauris@ximian.com> + + * gnome-ui-properties.c (dialog_button_clicked_cb): Use GtkDialog + 2002-02-01 Seth Nickell <snickell@stanford.edu> * behavior-capplet.png: diff --git a/capplets/ui-properties/gnome-ui-properties.c b/capplets/ui-properties/gnome-ui-properties.c index 1f45bd854..4344b58ff 100644 --- a/capplets/ui-properties/gnome-ui-properties.c +++ b/capplets/ui-properties/gnome-ui-properties.c @@ -66,7 +66,7 @@ toolbar_to_widget (GConfValue *value) static void -dialog_button_clicked_cb (GnomeDialog *dialog, gint response_id, GConfChangeSet *changeset) +dialog_button_clicked_cb (GtkDialog *dialog, gint response_id, GConfChangeSet *changeset) { switch (response_id) { |