diff options
author | Anders Carlsson <andersca@gnu.org> | 2002-04-17 12:29:11 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@src.gnome.org> | 2002-04-17 12:29:11 +0000 |
commit | ca22d6609bd3d26ba644d63fc350712643573eb9 (patch) | |
tree | 99d800cbe21b6ee9d68a2e872cd879170ee9e2eb | |
parent | ca90235fb87d1714fb57e6d27ecfa0eca33f4277 (diff) | |
download | nautilus-ca22d6609bd3d26ba644d63fc350712643573eb9.tar.gz |
Fixup padding so that the dialog looks more like the Nautilus 1.0 one.
2002-04-17 Anders Carlsson <andersca@gnu.org>
* libnautilus-private/nautilus-file-operations-progress.c:
(nautilus_file_operations_progress_init):
Fixup padding so that the dialog looks more like the
Nautilus 1.0 one.
* libnautilus-private/nautilus-icon-canvas-item.c:
(nautilus_icon_canvas_item_finalize):
Unref the layouts.
* libnautilus-private/nautilus-volume-monitor.c:
(load_file_system_table), (nautilus_volume_monitor_class_init),
(nautilus_volume_monitor_finalize), (get_mount_list),
(nautilus_file_system_type_free),
(load_additional_mount_list_info):
Free the file system table on ::finalize.
* src/file-manager/fm-list-model.c: (fm_list_model_finalize):
Free details on ::finalize.
-rw-r--r-- | ChangeLog | 21 | ||||
-rw-r--r-- | libnautilus-private/nautilus-file-operations-progress.c | 23 | ||||
-rw-r--r-- | libnautilus-private/nautilus-icon-canvas-item.c | 8 | ||||
-rw-r--r-- | libnautilus-private/nautilus-volume-monitor.c | 36 | ||||
-rw-r--r-- | src/file-manager/fm-list-model.c | 12 |
5 files changed, 77 insertions, 23 deletions
@@ -1,3 +1,24 @@ +2002-04-17 Anders Carlsson <andersca@gnu.org> + + * libnautilus-private/nautilus-file-operations-progress.c: + (nautilus_file_operations_progress_init): + Fixup padding so that the dialog looks more like the + Nautilus 1.0 one. + + * libnautilus-private/nautilus-icon-canvas-item.c: + (nautilus_icon_canvas_item_finalize): + Unref the layouts. + + * libnautilus-private/nautilus-volume-monitor.c: + (load_file_system_table), (nautilus_volume_monitor_class_init), + (nautilus_volume_monitor_finalize), (get_mount_list), + (nautilus_file_system_type_free), + (load_additional_mount_list_info): + Free the file system table on ::finalize. + + * src/file-manager/fm-list-model.c: (fm_list_model_finalize): + Free details on ::finalize. + 2002-04-17 Pablo Saratxaga <pablo@mandrakesoft.com> * configure.in,po/vi.po: Added Vietnamese po file diff --git a/libnautilus-private/nautilus-file-operations-progress.c b/libnautilus-private/nautilus-file-operations-progress.c index 471928ad3..08747a0b7 100644 --- a/libnautilus-private/nautilus-file-operations-progress.c +++ b/libnautilus-private/nautilus-file-operations-progress.c @@ -38,6 +38,7 @@ #include <gtk/gtkprogressbar.h> #include <gtk/gtkstock.h> #include <gtk/gtktable.h> +#include <gtk/gtkvbox.h> #include <libgnome/gnome-i18n.h> #include <libgnomevfs/gnome-vfs-utils.h> #include "nautilus-file-operations-progress-icons.h" @@ -49,6 +50,7 @@ #define PROGRESS_DIALOG_WIDTH 400 #define OUTER_BORDER 5 +#define VERTICAL_SPACING 8 #define HORIZONTAL_SPACING 3 #define MINIMUM_TIME_UP 1000 @@ -242,27 +244,23 @@ delete_event_callback (GtkWidget *widget, static void nautilus_file_operations_progress_init (NautilusFileOperationsProgress *progress) { - GtkBox *vbox; - GtkWidget *hbox; + GtkWidget *hbox, *vbox; GtkTable *titled_label_table; progress->details = g_new0 (NautilusFileOperationsProgressDetails, 1); - vbox = GTK_BOX (GTK_DIALOG (progress)->vbox); - - /* This is evil but makes the dialog look less cramped. */ + vbox = gtk_vbox_new (FALSE, VERTICAL_SPACING); gtk_container_set_border_width (GTK_CONTAINER (vbox), OUTER_BORDER); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (progress)->vbox), vbox, TRUE, TRUE, VERTICAL_SPACING); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (vbox, hbox, TRUE, TRUE, HORIZONTAL_SPACING); - gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, HORIZONTAL_SPACING); /* label- */ /* Files remaining to be copied: */ progress->details->progress_title_label = gtk_label_new (""); gtk_label_set_justify (GTK_LABEL (progress->details->progress_title_label), GTK_JUSTIFY_LEFT); gtk_box_pack_start (GTK_BOX (hbox), progress->details->progress_title_label, FALSE, FALSE, 0); - gtk_widget_show (progress->details->progress_title_label); eel_gtk_label_make_bold (GTK_LABEL (progress->details->progress_title_label)); @@ -271,19 +269,16 @@ nautilus_file_operations_progress_init (NautilusFileOperationsProgress *progress progress->details->progress_count_label = gtk_label_new (""); gtk_label_set_justify (GTK_LABEL (progress->details->progress_count_label), GTK_JUSTIFY_RIGHT); gtk_box_pack_end (GTK_BOX (hbox), progress->details->progress_count_label, FALSE, FALSE, 0); - gtk_widget_show (progress->details->progress_count_label); eel_gtk_label_make_bold (GTK_LABEL (progress->details->progress_count_label)); /* progress bar */ progress->details->progress_bar = gtk_progress_bar_new (); gtk_window_set_default_size (GTK_WINDOW (progress), PROGRESS_DIALOG_WIDTH, -1); - gtk_box_pack_start (vbox, progress->details->progress_bar, FALSE, TRUE, 0); - gtk_widget_show (progress->details->progress_bar); + gtk_box_pack_start (GTK_BOX (vbox), progress->details->progress_bar, FALSE, TRUE, 0); titled_label_table = GTK_TABLE (gtk_table_new (3, 2, FALSE)); gtk_table_set_row_spacings (titled_label_table, 4); gtk_table_set_col_spacings (titled_label_table, 4); - gtk_widget_show (GTK_WIDGET (titled_label_table)); create_titled_label (titled_label_table, 0, &progress->details->operation_name_label, @@ -295,13 +290,15 @@ nautilus_file_operations_progress_init (NautilusFileOperationsProgress *progress &progress->details->to_label, &progress->details->to_path_label); - gtk_box_pack_start (vbox, GTK_WIDGET (titled_label_table), FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (titled_label_table), FALSE, FALSE, 0); /* Set window icon */ gtk_window_set_icon (GTK_WINDOW (progress), empty_jar_pixbuf); /* Set progress jar position */ progress->details->progress_jar_position = gdk_pixbuf_get_height (empty_jar_pixbuf); + + gtk_widget_show_all (vbox); } static void diff --git a/libnautilus-private/nautilus-icon-canvas-item.c b/libnautilus-private/nautilus-icon-canvas-item.c index 7417ad491..e78c9c56b 100644 --- a/libnautilus-private/nautilus-icon-canvas-item.c +++ b/libnautilus-private/nautilus-icon-canvas-item.c @@ -229,6 +229,14 @@ nautilus_icon_canvas_item_finalize (GObject *object) if (details->rendered_pixbuf != NULL) { g_object_unref (details->rendered_pixbuf); } + + if (details->editable_text_layout != NULL) { + g_object_unref (details->editable_text_layout); + } + + if (details->additional_text_layout != NULL) { + g_object_unref (details->additional_text_layout); + } g_free (details); diff --git a/libnautilus-private/nautilus-volume-monitor.c b/libnautilus-private/nautilus-volume-monitor.c index 12e0977cc..8bb077595 100644 --- a/libnautilus-private/nautilus-volume-monitor.c +++ b/libnautilus-private/nautilus-volume-monitor.c @@ -195,7 +195,7 @@ static guint signals[LAST_SIGNAL]; static void nautilus_volume_monitor_init (NautilusVolumeMonitor *desktop_mounter); static void nautilus_volume_monitor_class_init (NautilusVolumeMonitorClass *klass); -static void nautilus_volume_monitor_destroy (GtkObject *object); +static void nautilus_volume_monitor_finalize (GObject *object); static char * get_iso9660_volume_name (NautilusVolume *volume, int volume_fd); static GHashTable * load_file_system_table (void); @@ -219,6 +219,7 @@ static GHashTable * create_readable_mount_point_name_table (void); static int get_cdrom_type (const char *vol_dev_path, int *fd); static void nautilus_volume_free (NautilusVolume *volume); +static void nautilus_file_system_type_free (NautilusFileSystemType *type); #ifdef HAVE_CDDA static gboolean locate_audio_cd (void); @@ -238,7 +239,9 @@ load_file_system_table (void) xmlChar *name, *default_volume_name, *trash; NautilusFileSystemType *type; - table = g_hash_table_new (g_str_hash, g_str_equal); + /* We don't provide a free_key func since the key is freed by the value_free func */ + table = g_hash_table_new_full (g_str_hash, g_str_equal, + NULL, (GDestroyNotify) nautilus_file_system_type_free); file_system_attributes_file = nautilus_get_data_file_path ("filesystem-attributes.xml"); if (file_system_attributes_file == NULL) { @@ -292,11 +295,11 @@ nautilus_volume_monitor_init (NautilusVolumeMonitor *monitor) static void nautilus_volume_monitor_class_init (NautilusVolumeMonitorClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; - object_class = GTK_OBJECT_CLASS (klass); + object_class = G_OBJECT_CLASS (klass); - object_class->destroy = nautilus_volume_monitor_destroy; + object_class->finalize = nautilus_volume_monitor_finalize; signals[VOLUME_MOUNTED] = g_signal_new ("volume_mounted", @@ -354,7 +357,7 @@ nautilus_volume_monitor_class_init (NautilusVolumeMonitorClass *klass) } static void -nautilus_volume_monitor_destroy (GtkObject *object) +nautilus_volume_monitor_finalize (GObject *object) { NautilusVolumeMonitor *monitor; @@ -370,12 +373,15 @@ nautilus_volume_monitor_destroy (GtkObject *object) /* Clean up readable names table */ g_hash_table_destroy (monitor->details->readable_mount_point_names); + /* Clean up file system table */ + g_hash_table_destroy (monitor->details->file_system_table); + /* Clean up details */ g_free (monitor->details); global_volume_monitor = NULL; - EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object)); + EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object)); } static void @@ -1088,7 +1094,7 @@ get_mount_list (NautilusVolumeMonitor *monitor) file_system_type_name = eel_string_list_nth (list, 2); volume = create_volume (device_path, mount_path); if (eel_string_list_get_length (list) >= 4 && - option_list_has_option (eel_string_list_nth (list, 3), MNTOPT_RO)) + option_list_has_option (eel_string_list_peek_nth (list, 3), MNTOPT_RO)) volume->is_read_only = TRUE; volumes = finish_creating_volume_and_prepend (monitor, volume, file_system_type_name, volumes); @@ -1703,6 +1709,15 @@ nautilus_volume_free (NautilusVolume *volume) g_free (volume); } +static void +nautilus_file_system_type_free (NautilusFileSystemType *type) +{ + g_print ("freeing: %s\n", type->name); + g_free (type->name); + g_free (type->default_volume_name); + g_free (type); +} + static char * get_iso9660_volume_name (NautilusVolume *volume, int fd) { @@ -1731,8 +1746,9 @@ load_additional_mount_list_info (GList *volume_list) /* These are set up by get_current_mount_list for Solaris. */ volume->is_removable = volume_is_removable (volume); #endif - - volume->volume_name = mount_volume_make_name (volume); + if (volume->volume_name == NULL) { + volume->volume_name = mount_volume_make_name (volume); + } } } diff --git a/src/file-manager/fm-list-model.c b/src/file-manager/fm-list-model.c index ea0ffa325..a297484e5 100644 --- a/src/file-manager/fm-list-model.c +++ b/src/file-manager/fm-list-model.c @@ -728,6 +728,18 @@ fm_list_model_get_sort_column_id_from_sort_type (NautilusFileSortType sort_type) } static void +fm_list_model_finalize (GObject *object) +{ + FMListModel *model; + + model = FM_LIST_MODEL (object); + + g_free (model->details); + + EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object)); +} + +static void fm_list_model_init (FMListModel *model) { model->details = g_new0 (FMListModelDetails, 1); |