diff options
author | Darin Adler <darin@src.gnome.org> | 2000-04-21 20:59:02 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2000-04-21 20:59:02 +0000 |
commit | ef2dc9effc8a9f51fa22b10200e651ba67f17d55 (patch) | |
tree | 2aa244cf80fee44f688b15af5797b30ba302d7e0 /components | |
parent | e04de292ad06d41940d837bcc95f33aa6e150c97 (diff) | |
download | nautilus-ef2dc9effc8a9f51fa22b10200e651ba67f17d55.tar.gz |
Fixed a typo that was causing the history view to fail.
* components/history/ntl-history-view.c
(hyperbola_navigation_history_notify_location_change):
Fixed a typo that was causing the history view to fail.
* components/music/nautilus-music-view.c
(nautilus_music_view_initialize_class),
(nautilus_music_view_initialize), (setup_title_font),
(nautilus_music_view_realize):
Changed to use new nautilus_gtk_widget_set_font_by_name
and got rid of the old realize hack.
* components/rpmview/nautilus-rpm-view.c
(nautilus_rpm_view_initialize):
Added a FIXME about how it's bad to hard-wire a font.
* components/services/startup/nautilus-service-startup-view.c
(setup_title_font), (setup_form_title),
(nautilus_service_startup_view_initialize),
(nautilus_service_startup_view_realize),
(nautilus_service_startup_view_load_uri):
Changed to use new nautilus_gtk_widget_set_font_by_name
and got rid of the old realize hack.
* libnautilus-extensions/nautilus-gtk-extensions.h:
* libnautilus-extensions/nautilus-gtk-extensions.c
(nautilus_gtk_style_set_font): Made public.
(nautilus_gtk_widget_set_font): Added comments and checks on
the parameters.
* libnautilus-extensions/nautilus-icon-container.c (relayout),
(idle_handler), (nautilus_icon_container_move_icon),
(world_width_changed), (end_stretching), (button_release_event),
(handle_icon_button_press), (nautilus_icon_container_add_auto),
(nautilus_icon_container_remove),
(nautilus_icon_container_set_auto_layout):
Some tweaks for auto-layout mode. Made it work better with
stretching by not laying out the currently-stretched icon,
simplified the code a bit, and made it relayout when an icon
is removed.
* src/file-manager/fm-directory-view.c (compute_menu_item_info),
(fm_directory_view_real_merge_menus):
Got rid of the "..." from "Delete...". On Macintosh, at least,
the "..." is only used when the dialog is something that adds
parameters to the command, not when it's just a confirmation.
* src/nautilus-index-title.c (update_font),
(nautilus_index_title_update_label),
(nautilus_index_title_update_info):
Changed to use new nautilus_gtk_widget_set_font and
nautilus_gtk_widget_set_font_by_name.
* src/ntl-index-panel.c (nautilus_index_panel_remove_meta_view):
Made the index panel do *slightly* better when a meta view
fails to load.
* components/help/hyperbola-main.c (main):
Fixed a warning.
Diffstat (limited to 'components')
-rw-r--r-- | components/help/hyperbola-main.c | 4 | ||||
-rw-r--r-- | components/history/nautilus-history-view.c | 2 | ||||
-rw-r--r-- | components/history/ntl-history-view.c | 2 | ||||
-rw-r--r-- | components/music/nautilus-music-view.c | 33 | ||||
-rw-r--r-- | components/rpmview/nautilus-rpm-view.c | 1 | ||||
-rw-r--r-- | components/services/startup/nautilus-service-startup-view.c | 109 |
6 files changed, 50 insertions, 101 deletions
diff --git a/components/help/hyperbola-main.c b/components/help/hyperbola-main.c index 8ae270ba9..31359258f 100644 --- a/components/help/hyperbola-main.c +++ b/components/help/hyperbola-main.c @@ -44,11 +44,11 @@ make_obj(BonoboGenericFactory *Factory, const char *goad_id, void *closure) return retval; } -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { BonoboGenericFactory *factory; CORBA_ORB orb; - CORBA_Environment ev; gnome_init_with_popt_table("hyperbola", VERSION, argc, argv, diff --git a/components/history/nautilus-history-view.c b/components/history/nautilus-history-view.c index 4f7dbe041..60b5cbe00 100644 --- a/components/history/nautilus-history-view.c +++ b/components/history/nautilus-history-view.c @@ -119,7 +119,7 @@ hyperbola_navigation_history_notify_location_change (NautilusViewFrame *view, * keeping a parallel mechanism here. That will get us the right * short name for different locations. */ - gnome_vfs_uri_new (loci->requested_uri); + vfs_uri = gnome_vfs_uri_new (loci->requested_uri); if (vfs_uri == NULL) { short_name = g_strdup (loci->requested_uri); } else { diff --git a/components/history/ntl-history-view.c b/components/history/ntl-history-view.c index 4f7dbe041..60b5cbe00 100644 --- a/components/history/ntl-history-view.c +++ b/components/history/ntl-history-view.c @@ -119,7 +119,7 @@ hyperbola_navigation_history_notify_location_change (NautilusViewFrame *view, * keeping a parallel mechanism here. That will get us the right * short name for different locations. */ - gnome_vfs_uri_new (loci->requested_uri); + vfs_uri = gnome_vfs_uri_new (loci->requested_uri); if (vfs_uri == NULL) { short_name = g_strdup (loci->requested_uri); } else { diff --git a/components/music/nautilus-music-view.c b/components/music/nautilus-music-view.c index 50ace4f01..c6f65a034 100644 --- a/components/music/nautilus-music-view.c +++ b/components/music/nautilus-music-view.c @@ -37,6 +37,7 @@ #include <libnautilus-extensions/nautilus-file.h> #include <libnautilus-extensions/nautilus-file-utilities.h> #include <libnautilus-extensions/nautilus-glib-extensions.h> +#include <libnautilus-extensions/nautilus-gtk-extensions.h> #include <libnautilus-extensions/nautilus-gtk-macros.h> #include <libnautilus-extensions/nautilus-metadata.h> #include <libnautilus-extensions/nautilus-string.h> @@ -91,8 +92,6 @@ static void nautilus_music_view_drag_data_received (GtkWidget static void nautilus_music_view_initialize_class (NautilusMusicViewClass *klass); static void nautilus_music_view_initialize (NautilusMusicView *view); static void nautilus_music_view_destroy (GtkObject *object); -static void nautilus_music_view_realize (GtkWidget *widget); -static void setup_title_font (NautilusMusicView *music_view); static void music_view_notify_location_change_callback (NautilusContentViewFrame *view, Nautilus_NavigationInfo *navinfo, NautilusMusicView *music_view); @@ -113,7 +112,6 @@ nautilus_music_view_initialize_class (NautilusMusicViewClass *klass) widget_class = GTK_WIDGET_CLASS (klass); object_class->destroy = nautilus_music_view_destroy; - widget_class->realize = nautilus_music_view_realize; widget_class->drag_data_received = nautilus_music_view_drag_data_received; } @@ -144,6 +142,9 @@ nautilus_music_view_initialize (NautilusMusicView *music_view) /* allocate a widget for the album title */ music_view->details->album_title = gtk_label_new ("Album Title"); + /* FIXME: don't use hardwired font like this */ + nautilus_gtk_widget_set_font_by_name (music_view->details->album_title, + "-*-helvetica-medium-r-normal-*-18-*-*-*-*-*-*-*"); ; gtk_box_pack_start (GTK_BOX (music_view->details->album_container), music_view->details->album_title, 0, 0, 0); gtk_widget_show (music_view->details->album_title); @@ -231,32 +232,6 @@ nautilus_music_view_get_view_frame (NautilusMusicView *music_view) return music_view->details->view_frame; } -/* utility routine to set up the font for the album title, called after we're realized */ -static void -setup_title_font(NautilusMusicView *music_view) -{ - GtkStyle *temp_style; - - temp_style = gtk_style_new(); - - gtk_widget_realize (music_view->details->album_title); - temp_style->font = gdk_font_load ("-*-helvetica-medium-r-normal-*-18-*-*-*-*-*-*-*"); ; - gtk_widget_set_style (music_view->details->album_title, - gtk_style_attach (temp_style, music_view->details->album_title->window)); -} - -/* set up fonts, colors, etc after we're realized */ -void -nautilus_music_view_realize (GtkWidget *widget) -{ - NautilusMusicView *music_view; - - NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, realize, (widget)); - - music_view = NAUTILUS_MUSIC_VIEW (widget); - setup_title_font (music_view); -} - /* here are some utility routines for reading ID3 tags from mp3 files */ /* initialize a songinfo structure */ diff --git a/components/rpmview/nautilus-rpm-view.c b/components/rpmview/nautilus-rpm-view.c index e7f3f2411..41ea6bc63 100644 --- a/components/rpmview/nautilus-rpm-view.c +++ b/components/rpmview/nautilus-rpm-view.c @@ -176,6 +176,7 @@ nautilus_rpm_view_initialize (NautilusRPMView *rpm_view) /* allocate the name field */ rpm_view->details->package_title = gtk_label_new ("Package Title"); + /* FIXME: don't use hardwired font like this */ nautilus_gtk_widget_set_font_by_name (rpm_view->details->package_title, "-*-helvetica-medium-r-normal-*-18-*-*-*-*-*-*-*"); gtk_box_pack_start (GTK_BOX (temp_title_box), rpm_view->details->package_title, 0, 0, 0); diff --git a/components/services/startup/nautilus-service-startup-view.c b/components/services/startup/nautilus-service-startup-view.c index ae940b628..dbc776bd0 100644 --- a/components/services/startup/nautilus-service-startup-view.c +++ b/components/services/startup/nautilus-service-startup-view.c @@ -1,4 +1,5 @@ /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ + /* * Copyright (C) 2000 Eazel, Inc * @@ -35,6 +36,7 @@ #include <gnome-xml/tree.h> #include <libgnomevfs/gnome-vfs-utils.h> #include <libnautilus-extensions/nautilus-background.h> +#include <libnautilus-extensions/nautilus-gtk-extensions.h> #include <libnautilus-extensions/nautilus-gtk-macros.h> #include <libnautilus-extensions/nautilus-glib-extensions.h> #include <libnautilus-extensions/nautilus-global-preferences.h> @@ -44,8 +46,8 @@ #include <stdio.h> struct _NautilusServicesContentViewDetails { - gchar *uri; - gchar *auth_token; + char *uri; + char *auth_token; NautilusContentViewFrame *view_frame; GtkWidget *form; @@ -65,7 +67,6 @@ struct _NautilusServicesContentViewDetails { static void nautilus_service_startup_view_initialize_class (NautilusServicesContentViewClass *klass); static void nautilus_service_startup_view_initialize (NautilusServicesContentView *view); static void nautilus_service_startup_view_destroy (GtkObject *object); -static void nautilus_service_startup_view_realize (GtkWidget *widget); NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusServicesContentView, nautilus_service_startup_view, GTK_TYPE_EVENT_BOX) @@ -78,7 +79,7 @@ static gboolean is_location(char *document_str, const char *place_str); /* utility routine to go to another uri */ static void -go_to_uri(NautilusServicesContentView* view, gchar *uri) +go_to_uri(NautilusServicesContentView* view, char *uri) { Nautilus_NavigationRequestInfo nri; memset(&nri, 0, sizeof(nri)); @@ -92,7 +93,7 @@ config_button_cb (GtkWidget *button, char *data) { xmlDocPtr packages_file = create_configuration_metafile(); if (packages_file != NULL) { - gchar *temp_str = g_strdup_printf("%s/configuration.xml", g_get_home_dir()); + char *temp_str = g_strdup_printf("%s/configuration.xml", g_get_home_dir()); xmlSaveFile(temp_str, packages_file); xmlFreeDoc(packages_file); g_free(temp_str); @@ -103,9 +104,9 @@ config_button_cb (GtkWidget *button, char *data) static void entry_changed_cb (GtkWidget *entry, NautilusServicesContentView *view) { - gchar *email = gtk_entry_get_text(GTK_ENTRY(view->details->account_name)); - gchar *password = gtk_entry_get_text(GTK_ENTRY(view->details->account_password)); - gchar *confirm = gtk_entry_get_text(GTK_ENTRY(view->details->confirm_password)); + char *email = gtk_entry_get_text(GTK_ENTRY(view->details->account_name)); + char *password = gtk_entry_get_text(GTK_ENTRY(view->details->account_password)); + char *confirm = gtk_entry_get_text(GTK_ENTRY(view->details->confirm_password)); gboolean button_enabled = email && strlen(email) && password && strlen(password) && confirm && strlen(confirm); gtk_widget_set_sensitive(view->details->register_button, button_enabled); @@ -115,10 +116,10 @@ entry_changed_cb (GtkWidget *entry, NautilusServicesContentView *view) it will optionally work asynchronously. Return NULL if we get an error */ static ghttp_request * -make_http_post_request(gchar *uri, gchar *post_body, gchar *auth_token) +make_http_post_request(char *uri, char *post_body, char *auth_token) { ghttp_request *request = NULL; - gchar *proxy = g_getenv("http_proxy"); + char *proxy = g_getenv("http_proxy"); request = ghttp_request_new(); @@ -165,7 +166,7 @@ make_http_post_request(gchar *uri, gchar *post_body, gchar *auth_token) /* utility to force updating to happen */ static void -update_now() +update_now (void) { while (gtk_events_pending()) gtk_main_iteration(); @@ -173,7 +174,7 @@ update_now() /* utility routine to show an error message */ static void -show_feedback(NautilusServicesContentView *view, gchar* error_message) +show_feedback(NautilusServicesContentView *view, char* error_message) { gtk_label_set_text(GTK_LABEL(view->details->feedback_text), error_message); gtk_widget_show(view->details->feedback_text); @@ -189,9 +190,9 @@ static void gather_config_button_cb (GtkWidget *button, NautilusServicesContentView *view) { FILE* config_file; - gchar buffer[256], host_name[512]; - gchar *config_file_name, *config_string, *uri, *response_str, *cookie_str; - gchar *encoded_token, *encoded_host_name; + char buffer[256], host_name[512]; + char *config_file_name, *config_string, *uri, *response_str, *cookie_str; + char *encoded_token, *encoded_host_name; GString* config_data; xmlDocPtr config_doc; ghttp_request *request; @@ -271,11 +272,11 @@ static void register_button_cb (GtkWidget *button, NautilusServicesContentView *view) { ghttp_request *request; - gchar *response_str, *body, *uri; - gchar *encoded_email, *encoded_password; - gchar *email = gtk_entry_get_text(GTK_ENTRY(view->details->account_name)); - gchar *password = gtk_entry_get_text(GTK_ENTRY(view->details->account_password)); - gchar *confirm = gtk_entry_get_text(GTK_ENTRY(view->details->confirm_password)); + char *response_str, *body, *uri; + char *encoded_email, *encoded_password; + char *email = gtk_entry_get_text(GTK_ENTRY(view->details->account_name)); + char *password = gtk_entry_get_text(GTK_ENTRY(view->details->account_password)); + char *confirm = gtk_entry_get_text(GTK_ENTRY(view->details->confirm_password)); gboolean registered_ok = FALSE; /* see if the email address is valid; if not, display an error */ @@ -325,17 +326,17 @@ register_button_cb (GtkWidget *button, NautilusServicesContentView *view) } else { /* check for a cookie that indicates success */ - const gchar* cookie = ghttp_get_header(request, "Set-Cookie"); + const char* cookie = ghttp_get_header(request, "Set-Cookie"); /* we found the cookie, so save it in the services file */ - gchar* token_start = strstr(cookie, "token="); + char* token_start = strstr(cookie, "token="); if (token_start) { - gchar *temp_str = strdup(token_start + strlen("token=")); - gchar *token_end = strchr(temp_str, ';'); + char *temp_str = strdup(token_start + strlen("token=")); + char *token_end = strchr(temp_str, ';'); if (token_end) { xmlDoc *service_doc; xmlNode *service_node; - gchar *temp_filename; + char *temp_filename; *token_end = '\0'; @@ -371,9 +372,9 @@ register_button_cb (GtkWidget *button, NautilusServicesContentView *view) go_to_uri(view, "eazel:config?signup"); } -/* FIXME: this routine should be someone else, and should take user preferences into account */ -static gchar* -get_home_uri() +/* FIXME: this routine should be somewhere else, and should take user preferences into account */ +static char* +get_home_uri (void) { return g_strdup_printf("file://%s", g_get_home_dir ()); } @@ -382,7 +383,7 @@ get_home_uri() static void register_later_cb (GtkWidget *button, NautilusServicesContentView *view) { - gchar* home_path = get_home_uri(); + char* home_path = get_home_uri(); go_to_uri(view, home_path); g_free(home_path); } @@ -424,27 +425,12 @@ static void setup_test_form(NautilusServicesContentView *view) gtk_widget_show (config_button); } -/* utility routine to set up the font for the title, called after we're realized */ -static void -setup_title_font(NautilusServicesContentView *view) -{ - GtkStyle *temp_style; - - if (view->details->form_title->window == NULL) - return; - temp_style = gtk_style_new(); - - temp_style->font = gdk_font_load ("-*-helvetica-medium-r-normal-*-18-*-*-*-*-*-*-*"); ; - gtk_widget_set_style (view->details->form_title, - gtk_style_attach (temp_style, view->details->form_title->window)); -} - /* shared utility to allocate a title for a form */ -static void setup_form_title(NautilusServicesContentView *view, const gchar* title_text) +static void setup_form_title(NautilusServicesContentView *view, const char* title_text) { GtkWidget *temp_widget; - gchar *file_name; + char *file_name; GtkWidget *temp_container = gtk_hbox_new(FALSE, 0); gtk_box_pack_start (GTK_BOX(view->details->form), temp_container, 0, 0, 4); @@ -457,7 +443,10 @@ static void setup_form_title(NautilusServicesContentView *view, const gchar* tit g_free (file_name); view->details->form_title = gtk_label_new (title_text); - gtk_box_pack_start(GTK_BOX(temp_container), view->details->form_title, 0, 0, 8); + /* FIXME: don't use hardwired font like this */ + nautilus_gtk_widget_set_font_by_name (view->details->form_title, + "-*-helvetica-medium-r-normal-*-18-*-*-*-*-*-*-*"); ; + gtk_box_pack_start (GTK_BOX (temp_container), view->details->form_title, 0, 0, 8); gtk_widget_show (view->details->form_title); } @@ -465,7 +454,7 @@ static void setup_form_title(NautilusServicesContentView *view, const gchar* tit static void setup_signup_form(NautilusServicesContentView *view) { - gchar *message, *file_name; + char *message, *file_name; GtkTable *table; GtkWidget *temp_widget; GtkWidget *temp_box, *config_button, *config_label; @@ -579,7 +568,7 @@ static void setup_signup_form(NautilusServicesContentView *view) static void setup_config_form(NautilusServicesContentView *view) { - gchar *message, *file_name; + char *message, *file_name; GtkWidget *temp_widget; GtkWidget *temp_box, *config_button, *config_label; @@ -661,7 +650,7 @@ static void setup_config_form(NautilusServicesContentView *view) static void setup_overview_form(NautilusServicesContentView *view) { - gchar *message; + char *message; GtkWidget *temp_widget; /* allocate a vbox as the container */ @@ -723,7 +712,6 @@ nautilus_service_startup_view_initialize_class (NautilusServicesContentViewClass parent_class = gtk_type_class (gtk_event_box_get_type ()); object_class->destroy = nautilus_service_startup_view_destroy; - widget_class->realize = nautilus_service_startup_view_realize; } static void @@ -763,19 +751,6 @@ nautilus_service_startup_view_destroy (GtkObject *object) NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object)); } -/* set up fonts, colors, etc after we're realized */ -void -nautilus_service_startup_view_realize(GtkWidget *widget) -{ - NautilusServicesContentView *view; - - NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, realize, (widget)); - - view = NAUTILUS_SERVICE_STARTUP_VIEW (widget); - setup_title_font (view); -} - - /* Component embedding support */ NautilusContentViewFrame * nautilus_service_startup_view_get_view_frame (NautilusServicesContentView *view) @@ -792,9 +767,9 @@ static gboolean is_location(char *document_str, const char *place_str) /* URI handling */ void nautilus_service_startup_view_load_uri (NautilusServicesContentView *view, - const gchar *uri) + const char *uri) { - gchar *document_name; + char *document_name; /* dispose of the old uri and copy the new one */ g_free (view->details->uri); @@ -820,8 +795,6 @@ nautilus_service_startup_view_load_uri (NautilusServicesContentView *view, setup_summary_form(view); else setup_test_form(view); /* eventually, this should be setup_bad_location_form */ - - setup_title_font(view); } static void |