Commit a238fef0 authored by Darin Adler's avatar Darin Adler

Roll double-free bug fix from the branch.

	* libnautilus-private/nautilus-directory-async.c:
	(top_left_read_callback): Roll double-free bug fix from the branch.

	* TODO: Some small updates.

	* components/hardware/nautilus-hardware-view.c:
	* data/browser.xml:
	* icons/crux_eggplant/crux_eggplant.xml:
	* icons/crux_teal/crux_teal.xml:
	* icons/default.xml:
	* icons/gnome/gnome.xml:
	* icons/sierra/sierra.xml:
	* icons/tahoe/tahoe.xml:
	* libnautilus-private/nautilus-directory-background.c:
	(nautilus_file_background_write_desktop_settings):
	* libnautilus-private/nautilus-icon-container.c:
	(start_rubberbanding):
	* libnautilus-private/nautilus-icon-text-item.c:
	(fetch_themed_color):
	* src/nautilus-property-browser.c: (add_color_to_browser):
	* src/nautilus-sidebar-tabs.c: (setup_light_text),
	(setup_dark_text), (nautilus_sidebar_tabs_init),
	(nautilus_sidebar_tabs_receive_dropped_color):
	* src/nautilus-sidebar-title.c:
	(nautilus_sidebar_title_select_text_color):
	* src/nautilus-sidebar.c: (receive_dropped_color):
	Changed all rgb:RRRR/GGGG/BBBB to #RRGGBB. We still probably have
	to handle the old format just for old data files.

	* libnautilus-private/.cvsignore:
	nautilus-marshal-guts.h -> nautilus-marshal.h

	* src/file-manager/fm-directory-view.c:
	(update_directory_in_scripts_menu): Add filter so that we don't
	see invisible or backup files in the scripts menu. In the old
	days, gnome-vfs supplied the filtering.

	* src/nautilus-about.c: (nautilus_about_finalize),
	(nautilus_about_instance_init), (nautilus_about_hide),
	(nautilus_about_hide_on_response),
	(nautilus_about_hide_on_delete), (nautilus_about_class_init):
	Get rid of double-destroy problem with about, and fix OK button.

	* src/nautilus-bookmarks-window.c:
	(nautilus_bookmarks_window_response_callback): Fix Done button.
	(create_bookmarks_window): Hook up response callback.
	(on_window_delete_event), (handle_close_accelerator): Get rid of
	save_geometry_and_hide, since hide already does that.

	* src/nautilus-main.c: (main): Add some missing domains for better
	debugging. We should figure out a way to do this without a list of
	domains.
parent 36759c33
2001-11-30 Darin Adler <darin@bentspoon.com>
* libnautilus-private/nautilus-directory-async.c:
(top_left_read_callback): Roll double-free bug fix from the branch.
* TODO: Some small updates.
* components/hardware/nautilus-hardware-view.c:
* data/browser.xml:
* icons/crux_eggplant/crux_eggplant.xml:
* icons/crux_teal/crux_teal.xml:
* icons/default.xml:
* icons/gnome/gnome.xml:
* icons/sierra/sierra.xml:
* icons/tahoe/tahoe.xml:
* libnautilus-private/nautilus-directory-background.c:
(nautilus_file_background_write_desktop_settings):
* libnautilus-private/nautilus-icon-container.c:
(start_rubberbanding):
* libnautilus-private/nautilus-icon-text-item.c:
(fetch_themed_color):
* src/nautilus-property-browser.c: (add_color_to_browser):
* src/nautilus-sidebar-tabs.c: (setup_light_text),
(setup_dark_text), (nautilus_sidebar_tabs_init),
(nautilus_sidebar_tabs_receive_dropped_color):
* src/nautilus-sidebar-title.c:
(nautilus_sidebar_title_select_text_color):
* src/nautilus-sidebar.c: (receive_dropped_color):
Changed all rgb:RRRR/GGGG/BBBB to #RRGGBB. We still probably have
to handle the old format just for old data files.
* libnautilus-private/.cvsignore:
nautilus-marshal-guts.h -> nautilus-marshal.h
* src/file-manager/fm-directory-view.c:
(update_directory_in_scripts_menu): Add filter so that we don't
see invisible or backup files in the scripts menu. In the old
days, gnome-vfs supplied the filtering.
* src/nautilus-about.c: (nautilus_about_finalize),
(nautilus_about_instance_init), (nautilus_about_hide),
(nautilus_about_hide_on_response),
(nautilus_about_hide_on_delete), (nautilus_about_class_init):
Get rid of double-destroy problem with about, and fix OK button.
* src/nautilus-bookmarks-window.c:
(nautilus_bookmarks_window_response_callback): Fix Done button.
(create_bookmarks_window): Hook up response callback.
(on_window_delete_event), (handle_close_accelerator): Get rid of
save_geometry_and_hide, since hide already does that.
* src/nautilus-main.c: (main): Add some missing domains for better
debugging. We should figure out a way to do this without a list of
domains.
2001-11-27 Seth Nickell <snickell@stanford.edu>
* nautilus-help.desktop.in:
......@@ -192,6 +247,7 @@ Tue Nov 20 21:45:43 2001 Owen Taylor <otaylor@redhat.com>
CORBA_OBJECT_NIL return from get_control_frame.
2001-11-12 Thomas Canty <tommydal@optushome.com.au>
* configure.in: Initialise the gnome-vfs-module package,
which is required for the help component
......@@ -223,7 +279,6 @@ Tue Nov 20 21:45:43 2001 Owen Taylor <otaylor@redhat.com>
* src/nautilus-window-toolbars.c:
Re-enable the throbber.
2001-11-10 Benedikt Roth <Benedikt.Roth@gmx.net>
......
For tasks outside the porting effort, we track them as bugs in
http://bugzilla.gnome.org.
Porting tasks. Some are necessary and some are just cleanup.
- Get EelLabel working and switch back to it on the sidebar.
- Get rid of all the direct freetype use and switch to using
Pango instead.
- Make closing a window work (Bonobo fix needed).
- Get embedded controls working (back and forward buttons and throbber).
- Get list view working.
- Visit all the destroy and move things into finalize or dispose
and make them callable twice as appropriate.
- Change things that use destroy handlers to use weak references
instead.
- Figure out why we get NULL font problems in Pango when the progress
dialog comes up.
- Get EelLabel working and switch back to it on the sidebar.
- Get rid of all the direct freetype use and switch to using
Pango instead.
......@@ -97,7 +97,7 @@ static int update_uptime_text (gpointer callback_data);
EEL_CLASS_BOILERPLATE (NautilusHardwareView, nautilus_hardware_view, GTK_TYPE_EVENT_BOX)
#define HARDWARE_DEFAULT_BACKGROUND_COLOR "rgb:DDDD/DDDD/BBBB"
#define HARDWARE_DEFAULT_BACKGROUND_COLOR "#DDDDBB"
static void
nautilus_hardware_view_class_init (NautilusHardwareViewClass *klass)
......
......@@ -35,36 +35,36 @@
</category>
<category name="colors" _display_name="Colors" image="colors.png" columns="5" mode="inline" type="application/x-color" _description="Drag a color to an object to change it to that color">
<color _name="Mango">rgb:E0E0/D6D6/5656</color>
<color _name="Orange">rgb:D2D2/ABAB/5050</color>
<color _name="Tangerine">rgb:C6C6/8686/4B4B</color>
<color _name="Grapefruit">rgb:BBBB/6262/4747</color>
<color _name="Ruby">rgb:ADAD/3838/4141</color>
<color _name="Pale Blue">rgb:5B5B/A7A7/CFCF</color>
<color _name="Sky">rgb:3939/7878/A7A7</color>
<color _name="Danube">rgb:1818/4A4A/7FF</color>
<color _name="Indigo">rgb:3E3E/4949/8585</color>
<color _name="Violet">rgb:6565/4949/8C8C</color>
<color _name="Sea Foam">rgb:CCCC/FFFF/CCCC</color>
<color _name="Leaf">rgb:6666/CCCC/6666</color>
<color _name="Deep Teal">rgb:4545/7272/6363</color>
<color _name="Dark Cork">rgb:6363/6565/4A4A</color>
<color _name="Mud">rgb:8080/5959/3232</color>
<color _name="Fire Engine">rgb:E5E5/3B3B/1A1A</color>
<color _name="Envy">rgb:2C2C/8282/1E1E</color>
<color _name="Azul">rgb:1818/2222/CACA</color>
<color _name="Lemon">rgb:F6F6/E1E1/1818</color>
<color _name="Bubble Gum">rgb:D0D0/5050/A4A4</color>
<color _name="White">rgb:FFFF/FFFF/FFFF</color>
<color _name="Apparition">rgb:E5E5/E5E5/E5E5</color>
<color _name="Silver">rgb:C9C9/C9C9/C9C9</color>
<color _name="Concrete">rgb:AFAF/AFAF/AFAF</color>
<color _name="Shale">rgb:7474/7474/7474</color>
<color _name="Granite">rgb:6F6F/6F6F/6F6F</color>
<color _name="Eclipse">rgb:5252/5252/5252</color>
<color _name="Charcoal">rgb:3232/3232/3232</color>
<color _name="Onyx">rgb:2222/2222/2222</color>
<color _name="Black">rgb:0000/0000/0000</color>
<color _name="Mango">#E0D656</color>
<color _name="Orange">#D2AB50</color>
<color _name="Tangerine">#C6864B</color>
<color _name="Grapefruit">#BB6247</color>
<color _name="Ruby">#AD3841</color>
<color _name="Pale Blue">#5BA7CF</color>
<color _name="Sky">#3978A7</color>
<color _name="Danube">#184AFF</color>
<color _name="Indigo">#3E4985</color>
<color _name="Violet">#65498C</color>
<color _name="Sea Foam">#CCFFCC</color>
<color _name="Leaf">#66CC66</color>
<color _name="Deep Teal">#457263</color>
<color _name="Dark Cork">#63654A</color>
<color _name="Mud">#805932</color>
<color _name="Fire Engine">#E53B1A</color>
<color _name="Envy">#2C821E</color>
<color _name="Azul">#1822CA</color>
<color _name="Lemon">#F6E118</color>
<color _name="Bubble Gum">#D050A4</color>
<color _name="White">#FFFFFF</color>
<color _name="Apparition">#E5E5E5</color>
<color _name="Silver">#C9C9C9</color>
<color _name="Concrete">#AFAFAF</color>
<color _name="Shale">#747474</color>
<color _name="Granite">#6F6F6F</color>
<color _name="Eclipse">#525252</color>
<color _name="Charcoal">#323232</color>
<color _name="Onyx">#222222</color>
<color _name="Black">#000000</color>
</category>
<category name="emblems" _display_name="Emblems" image="emblems.png" columns="6" mode="directory" path="nautilus/emblems" type="property/keyword" _description="Drag an emblem to an object to add it to the object">
......
......@@ -4,14 +4,14 @@
dark_info_color="0x777777"
light_info_color="0xAAAAAA"
selection_box_color_rgba="0x71577440"
selection_box_color="rgb:7171/5757/7474"
background_color="rgb:F0F0/F0F0/F0F0"/>
selection_box_color="#715774"
background_color="#F0F0F0"/>
<sidebar sidebar_background_color="rgb:8888/6F6F/8D8D-rgb:2525/0C0C/2A2A%90-rgb:0000/0000/0000:h"
<sidebar sidebar_background_color="#886F8D-#250C2A%90-#000000:h"
sidebar_background_tile_image="patterns/.striated.png"
tab_piece_images="sidebar_tab_pieces" combine="true"
left_offset="0" shadow_offset="1" text_h_offset="-4"
label_color="rgb:FFFF/FFFF/FFFF"
label_color="#FFFFFF"
tab_font="-*-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*" />
<desktop background_tile_image="./backgrounds/background_pattern.png"/>
......
......@@ -3,13 +3,13 @@
<directory background_tile_image="./backgrounds/window_pattern.png" dark_info_color="0x777777"
light_info_color="0xAAAAAA"
selection_box_color_rgba="0x497B7E40"
selection_box_color="rgb:4949/7B7B/7E7E"
background_color="rgb:F0F0/F0F0/F0F0"/>
selection_box_color="#497B7E"
background_color="#F0F0F0"/>
<sidebar sidebar_background_color="rgb:6666/9999/9999-rgb:0000/3333/3333%90-rgb:0000/0000/0000:h"
<sidebar sidebar_background_color="#669999-#003333%90-#000000:h"
sidebar_background_tile_image="patterns/.striated.png"
tab_piece_images="sidebar_tab_pieces" combine="true"
left_offset="0" shadow_offset="1" text_h_offset="-4" label_color="rgb:FFFF/FFFF/FFFF"
left_offset="0" shadow_offset="1" text_h_offset="-4" label_color="#FFFFFF"
tab_font="-*-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*" />
<desktop background_tile_image="./backgrounds/background_pattern.png" />
......
......@@ -3,20 +3,20 @@
<theme _name="Default" _description="This is the default theme for Nautilus.">
<sidebar sidebar_background_tile_image="./side_bar_image.png"
sidebar_background_color="rgb:4747/4A4A/7C7C-rgb:2222/2323/3A3A:h"
sidebar_background_color="#474A7C-#22233A:h"
tab_piece_images="sidebar_tab_pieces" combine="true"
left_offset="0" shadow_offset="1" text_h_offset="-4" label_color="rgb:FFFF/FFFF/FFFF"
left_offset="0" shadow_offset="1" text_h_offset="-4" label_color="#FFFFFF"
tab_font="-*-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*" />
<desktop background_tile_image="patterns/brushed_metal.png" background_color="rgb:F0F0/F0F0/F0F0"/>
<desktop background_tile_image="patterns/brushed_metal.png" background_color="#F0F0F0"/>
<directory background_color="rgb:F0F0/F0F0/F0F0"
<directory background_color="#F0F0F0"
selection_box_color_rgba="0x727D974C"
selection_box_color="rgb:7222/7DDD/9777"/>
selection_box_color="#727D97"/>
<icon highlight_background_color="rgb:0000/0000/0000"
highlight_text_color="rgb:FFFF/FFFF/FFFF"
text_fill_color="rgb:FFFF/FFFF/FFFF"/>
<icon highlight_background_color="#000000"
highlight_text_color="#FFFFFF"
text_fill_color="#FFFFFF"/>
<thumbnails frame_offsets="3,3,6,6"/>
......
......@@ -3,21 +3,21 @@
<directory background_tile_image="patterns/gnome.jpg"
selection_box_color_rgba="0x00441140"
selection_box_color="rgb:8d00/8100/7300"/>
selection_box_color="#8d8173"/>
<sidebar sidebar_background_color="rgb:8d00/8100/7300-rgb:3f00/3700/2e00%80-rgb:0000/0000/0000:h"
<sidebar sidebar_background_color="#8d8173-#3f372e%80-#000000:h"
sidebar_background_tile_image="patterns/.striated.png"
tab_piece_images="sidebar_tab_pieces" combine="true"
left_offset="0" shadow_offset="1" text_h_offset="-4"
label_color="rgb:FFFF/FFFF/FFFF"
label_color="#FFFFFF"
tab_font="-*-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*" />
<desktop background_tile_image="patterns/dark-gnome.jpg"
background_color="rgb:F400/F200/e800"/>
background_color="#:F400/F200/e800"/>
<icon highlight_background_color="rgb:0000/0000/0000"
highlight_text_color="rgb:FFFF/FFFF/FFFF"
text_fill_color="rgb:FFFF/FFFF/FFFF"/>
<icon highlight_background_color="#000000"
highlight_text_color="#FFFFFF"
text_fill_color="#FFFFFF"/>
<thumbnails frame_offsets="3,3,6,6"/>
<toolbar icon_theme="standard"/>
......
<?xml version="1.0"?>
<theme _name="Sierra" _description="Uses manila folders and gray-green backgrounds.">
<sidebar sidebar_background_tile_image="./green_weave.png" sidebar_background_color="rgb:FFFF/FFFF/FFFF" tab_piece_images="none"/>
<directory background_tile_image="./villanova_green.png" background_color="rgb:FFFF/FFFF/FFFF" selection_box_color_rgba="0x70818359" selection_box_color="rgb:7000/8111/8333"/>
<desktop background_tile_image="./Sierra_desktop.png" background_color="rgb:FFFF/FFFF/FFFF"/>
<sidebar sidebar_background_tile_image="./green_weave.png" sidebar_background_color="#FFFFFF" tab_piece_images="none"/>
<directory background_tile_image="./villanova_green.png" background_color="#FFFFFF" selection_box_color_rgba="0x70818359" selection_box_color="#708183"/>
<desktop background_tile_image="./Sierra_desktop.png" background_color="#FFFFFF"/>
<zoom_control number_v_offset="-6" digit_width="6"/>
</theme>
<?xml version="1.0"?>
<theme _name="Tahoe" _description="This theme uses photo-realistic folders.">
<sidebar sidebar_background_tile_image="./bluewall.png" sidebar_background_color="rgb:FFFF/FFFF/FFFF" title_color="rgb:0000/0000/0000" title_shadow_color="rgb:BBBB/BBBB/BBBB" title_info_color="rgb:0000/0000/0000"/>
<directory background_tile_image="./blueridge.png" background_color="rgb:FFFF/FFFF/FFFF"/>
<desktop background_tile_image="patterns/fleur_de_lis.png" background_color="rgb:FFFF/FFFF/FFFF"/>
<sidebar sidebar_background_tile_image="./bluewall.png" sidebar_background_color="#FFFFFF" title_color="#000000" title_shadow_color="#BBBBBB" title_info_color="#000000"/>
<directory background_tile_image="./blueridge.png" background_color="#FFFFFF"/>
<desktop background_tile_image="patterns/fleur_de_lis.png" background_color="#FFFFFF"/>
<zoom_control number_v_offset="-6" digit_width="6"/>
</theme>
......@@ -10,4 +10,4 @@ nautilus-metafile-server-stubs.c
nautilus-metafile-server.h
nautilus_metafile_server_idl_stamp
nautilus-marshal-guts.c
nautilus-marshal-guts.h
nautilus-marshal.h
......@@ -2456,23 +2456,22 @@ top_left_read_callback (GnomeVFSResult result,
gpointer callback_data)
{
NautilusDirectory *directory;
NautilusFile *changed_file;
NautilusFileDetails *file_details;
directory = NAUTILUS_DIRECTORY (callback_data);
directory->details->top_left_read_state->handle = NULL;
directory->details->top_left_read_state->file->details->top_left_text_is_up_to_date = TRUE;
changed_file = NULL;
file_details = directory->details->top_left_read_state->file->details;
file_details->top_left_text_is_up_to_date = TRUE;
g_free (file_details->top_left_text);
if (result == GNOME_VFS_OK) {
g_free (directory->details->top_left_read_state->file->details->top_left_text);
directory->details->top_left_read_state->file->details->top_left_text =
nautilus_extract_top_left_text (file_contents, bytes_read);
directory->details->top_left_read_state->file->details->got_top_left_text = TRUE;
file_details->top_left_text = nautilus_extract_top_left_text (file_contents, bytes_read);
file_details->got_top_left_text = TRUE;
} else {
g_free (directory->details->top_left_read_state->file->details->top_left_text);
directory->details->top_left_read_state->file->details->got_top_left_text = FALSE;
file_details->top_left_text = NULL;
file_details->got_top_left_text = FALSE;
}
g_free (file_contents);
......
......@@ -397,8 +397,8 @@ nautilus_file_background_write_desktop_settings (char *color, char *image, EelBa
/* We set it to white here because that's how backgrounds with a NULL color
* are drawn by Nautilus - due to usage of eel_gdk_color_parse_with_white_default.
*/
gnome_config_set_string ("/Background/Default/color1", "rgb:FFFF/FFFF/FFFF");
gnome_config_set_string ("/Background/Default/color2", "rgb:FFFF/FFFF/FFFF");
gnome_config_set_string ("/Background/Default/color1", "#FFFFFF");
gnome_config_set_string ("/Background/Default/color2", "#FFFFFF");
gnome_config_set_string ("/Background/Default/simple", "solid");
gnome_config_set_string ("/Background/Default/gradient", "vertical");
}
......
......@@ -1580,7 +1580,7 @@ start_rubberbanding (NautilusIconContainer *container,
} else {
fill_color_str = nautilus_theme_get_theme_data ("directory", "selection_box_color");
if (fill_color_str == NULL) {
fill_color_str = g_strdup ("rgb:7777/BBBB/DDDD");
fill_color_str = g_strdup ("#77BBDD");
}
band_info->selection_rectangle = gnome_canvas_item_new
......
......@@ -433,7 +433,7 @@ fetch_themed_color (const char *property_name, GdkColor *color)
color_string = nautilus_theme_get_theme_data ("icon", property_name);
if (color_string == NULL) {
color_string = g_strdup ("rgb:FFFF/FFFF/FFFF");
color_string = g_strdup ("#FFFFFF");
}
gdk_color_parse (color_string, color);
g_free (color_string);
......
......@@ -3780,7 +3780,8 @@ update_directory_in_scripts_menu (FMDirectoryView *view, NautilusDirectory *dire
g_free (directory_uri);
file_list = nautilus_file_list_sort_by_display_name
(nautilus_directory_get_file_list (directory));
(nautilus_file_list_filter_hidden_and_backup
(nautilus_directory_get_file_list (directory), FALSE, FALSE));
any_scripts = FALSE;
i = 0;
......
......@@ -28,42 +28,38 @@
#include <config.h>
#include "nautilus-about.h"
#include <math.h>
#include <gnome.h>
#include <gdk/gdk.h>
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-scalable-font.h>
#include <eel/eel-string.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkdrawingarea.h>
#include <gtk/gtkframe.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkmenu.h>
#include <gtk/gtkmenuitem.h>
#include <gtk/gtkstock.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-macros.h>
#include <libgnome/gnome-util.h>
#include <libgnomeui/gnome-pixmap.h>
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <libnautilus-private/nautilus-file-utilities.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-icon-factory.h>
#include <libnautilus-private/nautilus-file-utilities.h>
#include <eel/eel-scalable-font.h>
#include <eel/eel-string.h>
#include <libnautilus-private/nautilus-theme.h>
#include <math.h>
#include <time.h>
struct NautilusAboutDetails {
GtkWidget *drawing_area;
GdkPixbuf *background_pixbuf;
int last_update_time;
int timer_task;
guint timer_task;
char **authors;
int *order_array;
};
static gboolean nautilus_about_close (NautilusAbout *about,
gpointer *unused);
static void nautilus_about_class_init (NautilusAboutClass *klass);
static void nautilus_about_init (NautilusAbout *about);
static void nautilus_about_destroy (GtkObject *object);
static void nautilus_about_repaint (GtkWidget *drawing_area,
GdkEventExpose *event,
NautilusAbout *about);
......@@ -87,21 +83,13 @@ static int update_authors_if_necessary (gpointer callback_d
/* delay between randomizing, in seconds */
#define UPDATE_TIME_INTERVAL 8
/* gtk class definition boilerplate */
EEL_CLASS_BOILERPLATE (NautilusAbout,
nautilus_about,
GTK_TYPE_DIALOG)
static void
nautilus_about_class_init (NautilusAboutClass *about_class)
{
GtkObjectClass *object_class = GTK_OBJECT_CLASS (about_class);
object_class->destroy = nautilus_about_destroy;
}
GNOME_CLASS_BOILERPLATE (NautilusAbout,
nautilus_about,
GtkDialog,
GTK_TYPE_DIALOG)
static void
nautilus_about_destroy (GtkObject *object)
nautilus_about_finalize (GObject *object)
{
NautilusAbout *about;
......@@ -120,13 +108,13 @@ nautilus_about_destroy (GtkObject *object)
g_free (about->details);
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
GNOME_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
/* initialize the about */
static void
nautilus_about_init (NautilusAbout *about)
nautilus_about_instance_init (NautilusAbout *about)
{
char *background_path;
GtkWidget *frame;
......@@ -162,7 +150,7 @@ nautilus_about_init (NautilusAbout *about)
gtk_widget_set_events (about->details->drawing_area, GDK_EXPOSURE_MASK);
g_signal_connect (about->details->drawing_area, "expose_event",
G_CALLBACK (nautilus_about_repaint), about);
G_CALLBACK (nautilus_about_repaint), about);
gtk_widget_show (about->details->drawing_area);
gtk_container_add (GTK_CONTAINER (frame), about->details->drawing_area);
......@@ -170,15 +158,9 @@ nautilus_about_init (NautilusAbout *about)
/* set up the timer task */
about->details->timer_task = gtk_timeout_add (2000, update_authors_if_necessary, about);
/* configure the dialog */
/* configure the dialog */
gtk_dialog_add_button (GTK_DIALOG (about),
GTK_STOCK_OK, GTK_RESPONSE_OK);
gtk_signal_connect
(GTK_OBJECT (about),
"close",
G_CALLBACK (nautilus_about_close),
NULL);
}
/* allocate a new about dialog */
......@@ -442,22 +424,24 @@ nautilus_about_update_authors (NautilusAbout *about)
if (about->details->timer_task == 0) {
about->details->timer_task = gtk_timeout_add
(2000, update_authors_if_necessary, about);
}
}
/* schedule a redraw for the about box */
gtk_widget_queue_draw (GTK_WIDGET (about));
}
/* handle the dialog closing by killing the timer task */
static gboolean
nautilus_about_close (NautilusAbout *about, gpointer *unused)
static void
nautilus_about_hide (GtkWidget *widget)
{
NautilusAbout *about;
about = NAUTILUS_ABOUT (widget);
if (about->details->timer_task != 0) {
gtk_timeout_remove (about->details->timer_task);
about->details->timer_task = 0;
}
return FALSE;
}
GNOME_CALL_PARENT (GTK_WIDGET_CLASS, hide, (widget));
}
static int
......@@ -476,3 +460,24 @@ update_authors_if_necessary (gpointer callback_data)
}
return TRUE;
}
static void
nautilus_about_hide_on_response (GtkDialog *dialog, int response_id)
{
gtk_widget_hide (GTK_WIDGET (dialog));
}
static gboolean
nautilus_about_hide_on_delete (GtkWidget *widget, GdkEventAny *event)
{
return gtk_widget_hide_on_delete (widget);
}
static void
nautilus_about_class_init (NautilusAboutClass *class)
{
G_OBJECT_CLASS (class)->finalize = nautilus_about_finalize;
GTK_WIDGET_CLASS (class)->delete_event = nautilus_about_hide_on_delete;
GTK_WIDGET_CLASS (class)->hide = nautilus_about_hide;
GTK_DIALOG_CLASS (class)->response = nautilus_about_hide_on_response;
}
......@@ -39,49 +39,50 @@
* more than one bookmark-editing window, these would be struct or
* class fields.
*/
static int bookmark_list_changed_signalID;
static int bookmark_list_changed_signal_id;
static NautilusBookmarkList *bookmarks = NULL;
static GtkWidget *bookmark_list_widget = NULL; /* awkward name to distinguish from NautilusBookmarkList */
static GtkWidget *name_field = NULL;
static int name_field_changed_signalID;
static int name_field_changed_signal_id;
static GtkWidget *remove_button = NULL;
static gboolean text_changed = FALSE;
static GtkWidget *uri_field = NULL;
static int uri_field_changed_signalID;
static int uri_field_changed_signal_id;
/* forward declarations */
static NautilusBookmark *get_selected_bookmark (void);
static guint get_selected_row (void);
static gboolean get_selection_exists (void);
static void name_or_uri_field_activate (NautilusEntry *entry);
static void nautilus_bookmarks_window_restore_geometry
(GtkWidget *window);
static void on_bookmark_list_changed (NautilusBookmarkList *,
gpointer user_data);
static void on_name_field_changed (GtkEditable *, gpointer user_data);
static void on_remove_button_clicked (GtkButton *, gpointer user_data);
static void on_row_move (GtkCList *,
int old_row,
int new_row,
gpointer user_data);
static void on_select_row (GtkCList *,
int row,
int column,
GdkEventButton *,
gpointer user_data);
static gboolean on_text_field_focus_out_event (GtkWidget *,
GdkEventFocus *,
gpointer user_data);
static void on_uri_field_changed (GtkEditable *, gpointer user_data);
static gboolean on_window_delete_event (GtkWidget *,
GdkEvent *,
gpointer user_data);
static void on_window_hide_event (GtkWidget *,
gpointer user_data);
static void on_window_destroy_event (GtkWidget *,
gpointer user_data);
static void repopulate (void);
static void set_up_close_accelerator (GtkWidget *window);
static guint get_selected_row (void);
static gboolean get_selection_exists (void);
static void name_or_uri_field_activate (NautilusEntry *entry);
static void nautilus_bookmarks_window_restore_geometry (GtkWidget *window);
static void on_bookmark_list_changed (NautilusBookmarkList *list,
gpointer user_data);
static void on_name_field_changed (GtkEditable *editable,
gpointer user_data);
static void on_remove_button_clicked (GtkButton *button,
gpointer user_data);
static void on_row_move (GtkCList *clist,
int old_row,
int new_row,
gpointer user_data);
static void on_select_row (GtkCList *clist,
int row,
int column,
GdkEventButton *event,
gpointer user_data);
static gboolean on_text_field_focus_out_event (GtkWidget *widget,
GdkEventFocus *event,
gpointer user_data);
static void on_uri_field_changed (GtkEditable *editable,
gpointer user_data);
static gboolean on_window_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
static void on_window_hide_event (GtkWidget *widget,
gpointer user_data);
static void on_window_destroy_event (GtkWidget *widget,
gpointer user_data);
static void repopulate (void);
static void set_up_close_accelerator (GtkWidget *window);
#define BOOKMARK_LIST_COLUMN_ICON 0
#define BOOKMARK_LIST_COLUMN_NAME 1
......@@ -97,6 +98,14 @@ static void set_up_close_accelerator (GtkWidget *window);
#define BOOKMARKS_WINDOW_INITIAL_WIDTH 500
#define BOOKMARKS_WINDOW_INITIAL_HEIGHT 200
static void
nautilus_bookmarks_window_response_callback (GtkDialog *dialog,
int response_id,
gpointer callback_data)
{
gtk_widget_hide (GTK_WIDGET (dialog));
}
/**
* create_bookmarks_window:
*
......@@ -193,71 +202,60 @@ create_bookmarks_window (NautilusBookmarkList *list, GObject *undo_manager_sourc
gtk_widget_show (remove_button);
gtk_box_pack_start (GTK_BOX (hbox2), remove_button, TRUE, FALSE, 0);
bookmark_list_changed_signalID =
gtk_signal_connect (GTK_OBJECT(bookmarks), "contents_changed",
G_CALLBACK(on_bookmark_list_changed),
NULL);
bookmark_list_changed_signal_id =
g_signal_connect (bookmarks, "contents_changed",
G_CALLBACK (on_bookmark_list_changed), NULL);
gtk_signal_connect (GTK_OBJECT(bookmark_list_widget), "row_move",
G_CALLBACK(on_row_move),
NULL);
gtk_signal_connect (GTK_OBJECT(bookmark_list_widget), "select_row",
G_CALLBACK(on_select_row),
NULL);
g_signal_connect (bookmark_list_widget, "row_move",
G_CALLBACK (on_row_move), NULL);
g_signal_connect (bookmark_list_widget, "select_row",
G_CALLBACK (on_select_row), NULL);
g_signal_connect (window, "delete_event",
G_CALLBACK (on_window_delete_event),
NULL);
G_CALLBACK (on_window_delete_event), NULL);
g_signal_connect (window, "hide",
G_CALLBACK (on_window_hide_event),
NULL);
G_CALLBACK (on_window_hide_event), NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (on_window_destroy_event),
NULL);
G_CALLBACK (on_window_destroy_event), NULL);
name_field_changed_signalID =
g_signal_connect (window, "response",
G_CALLBACK (nautilus_bookmarks_window_response_callback), NULL);
name_field_changed_signal_id =
g_signal_connect (name_field, "changed",
G_CALLBACK (on_name_field_changed),
NULL);
G_CALLBACK (on_name_field_changed),
NULL);
g_signal_connect (name_field, "focus_out_event",
G_CALLBACK (on_text_field_focus_out_event),
NULL);
G_CALLBACK (on_text_field_focus_out_event), NULL);
g_signal_connect (name_field, "activate",
G_CALLBACK (name_or_uri_field_activate),
NULL);
G_CALLBACK (name_or_uri_field_activate), NULL);
uri_field_changed_signalID =
uri_field_changed_signal_id =
g_signal_connect (uri_field, "changed",
G_CALLBACK (on_uri_field_changed),
NULL);
G_CALLBACK (on_uri_field_changed), NULL);
g_signal_connect (uri_field, "focus_out_event",
G_CALLBACK (on_text_field_focus_out_event),