diff options
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 11 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-component.c | 3 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-view.c | 6 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 18 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-quick-add.c | 5 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.c | 6 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-contact-display.c | 35 | ||||
-rw-r--r-- | addressbook/gui/widgets/gal-view-minicard.c | 12 |
8 files changed, 51 insertions, 45 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index ab9a377ec3..cee8de1cf0 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,14 @@ +2007-03-27 Matthew Barnes <mbarnes@redhat.com> + + * gui/contact-editor/e-contact-editor.c: + * gui/contact-editor/e-contact-quick-add.c: + * gui/component/addressbook-component.c: + * gui/component/addressbook-view.c: + * gui/widgets/eab-contact-display.c: + * gui/widgets/gal-view-minicard.c: + * gui/widgets/e-addressbook-view.c: + Don't mix declarations and code (#405495). + 2007-03-20 Matthew Barnes <mbarnes@redhat.com> ** Fixes part of bug #419524 diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c index 1c9262365f..af65240d83 100644 --- a/addressbook/gui/component/addressbook-component.c +++ b/addressbook/gui/component/addressbook-component.c @@ -193,12 +193,11 @@ impl_createView (PortableServer_Servant servant, AddressbookComponent *addressbook_component = ADDRESSBOOK_COMPONENT (bonobo_object_from_servant (servant)); AddressbookComponentPrivate *priv = addressbook_component->priv; AddressbookView *view = addressbook_view_new (); + EComponentView *component_view; g_object_weak_ref (G_OBJECT (view), view_destroyed_cb, addressbook_component); priv->views = g_list_append (priv->views, view); - EComponentView *component_view; - component_view = e_component_view_new_controls (parent, "contacts", bonobo_control_new (addressbook_view_peek_sidebar (view)), addressbook_view_peek_folder_view (view), diff --git a/addressbook/gui/component/addressbook-view.c b/addressbook/gui/component/addressbook-view.c index 37cc297f6c..7defe5e42b 100644 --- a/addressbook/gui/component/addressbook-view.c +++ b/addressbook/gui/component/addressbook-view.c @@ -1169,6 +1169,8 @@ selector_tree_drag_data_received (GtkWidget *widget, EBook *source_book, *target_book; MergeContext *merge_context; GList *contactlist; + AddressbookView *view; + EABView *v; if (!gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget), x, y, &path, &pos)) @@ -1193,8 +1195,8 @@ selector_tree_drag_data_received (GtkWidget *widget, eab_book_and_contact_list_from_string (data->data, &source_book, &contactlist); - AddressbookView *view = (AddressbookView *) user_data; - EABView *v = get_current_view (view); + view = (AddressbookView *) user_data; + v = get_current_view (view); g_object_get (v->model, "book",&source_book, NULL); /* Set up merge context */ diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 8dab79c465..1f857e593a 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -606,12 +606,9 @@ sensitize_ok (EContactEditor *ce) { GtkWidget *widget; gboolean allow_save; - GtkWidget *entry_fullname; - GtkWidget *entry_file_as; - GtkWidget *company_name; - entry_fullname = glade_xml_get_widget (ce->gui, "entry-fullname" ); - entry_file_as = glade_xml_get_widget (ce->gui, "entry-file-as"); - company_name = glade_xml_get_widget (ce->gui, "entry-company"); + GtkWidget *entry_fullname = glade_xml_get_widget (ce->gui, "entry-fullname" ); + GtkWidget *entry_file_as = glade_xml_get_widget (ce->gui, "entry-file-as"); + GtkWidget *company_name = glade_xml_get_widget (ce->gui, "entry-company"); const char *name_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_fullname)); const char *file_as_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_file_as)); const char *company_name_string = gtk_entry_get_text (GTK_ENTRY (company_name)); @@ -3003,12 +3000,9 @@ save_contact (EContactEditor *ce, gboolean should_close) return; } - GtkWidget *entry_fullname; - GtkWidget *entry_file_as; - GtkWidget *company_name; - entry_fullname = glade_xml_get_widget (ce->gui, "entry-fullname" ); - entry_file_as = glade_xml_get_widget (ce->gui, "entry-file-as"); - company_name = glade_xml_get_widget (ce->gui, "entry-company"); + GtkWidget *entry_fullname = glade_xml_get_widget (ce->gui, "entry-fullname" ); + GtkWidget *entry_file_as = glade_xml_get_widget (ce->gui, "entry-file-as"); + GtkWidget *company_name = glade_xml_get_widget (ce->gui, "entry-company"); const char *name_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_fullname)); const char *file_as_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_file_as)); const char *company_name_string = gtk_entry_get_text (GTK_ENTRY (company_name)); diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index 549b8ecb83..ea3e7b6f35 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -279,6 +279,8 @@ source_selected (GtkWidget *source_option_menu, ESource *source, QuickAdd *qa) static GtkWidget * build_quick_add_dialog (QuickAdd *qa) { + ESourceList *source_list; + GConfClient *gconf_client; GtkWidget *dialog; GtkWidget *label; GtkTable *table; @@ -312,9 +314,6 @@ build_quick_add_dialog (QuickAdd *qa) if (qa->email) gtk_entry_set_text (GTK_ENTRY (qa->email_entry), qa->email); - ESourceList *source_list; - GConfClient *gconf_client; - gconf_client = gconf_client_get_default (); source_list = e_source_list_new_for_gconf (gconf_client, "/apps/evolution/addressbook/sources"); qa->option_menu = e_source_option_menu_new (source_list); diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index c011f385d3..5410bef787 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -1844,12 +1844,13 @@ eab_view_print(EABView *view, int preview) char *query; EBook *book; GtkWidget *print; + GList *list; g_object_get (view->model, "query", &query, "book", &book, NULL); - GList *list = get_selected_contacts (view); + list = get_selected_contacts (view); print = e_contact_print_dialog_new (book, query, list); if (!preview) @@ -1902,13 +1903,14 @@ eab_view_print_preview(EABView *view) char *query; EBook *book; GtkWidget *dialog; + GList *list; g_object_get (view->model, "query", &query, "book", &book, NULL); - GList *list = get_selected_contacts (view); + list = get_selected_contacts (view); if (list != NULL) dialog = e_contact_print_contact_list_dialog_new (list); else diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c index 6962962b0d..ddade470a2 100644 --- a/addressbook/gui/widgets/eab-contact-display.c +++ b/addressbook/gui/widgets/eab-contact-display.c @@ -95,11 +95,10 @@ eab_uri_popup_email_address_copy(EPopup *ep, EPopupItem *item, void *data) EABContactDisplay *display = data; struct _EABContactDisplayPrivate *p = display->priv; EABPopupTargetURI *t = (EABPopupTargetURI *)ep->target; - const char *url; + const char *url = t->uri; char *html=NULL; int i=0; GList *email_list, *l; - url = t->uri; int email_num = atoi (url + strlen ("internal-mailto:")); email_list = e_contact_get (p->contact, E_CONTACT_EMAIL); @@ -134,11 +133,10 @@ static void eab_uri_popup_address_send(EPopup *ep, EPopupItem *item, void *data) { EABPopupTargetURI *t = (EABPopupTargetURI *)ep->target; - const char *url; + const char *url = t->uri; EABContactDisplay *display = data; struct _EABContactDisplayPrivate *p = display->priv; - url = t->uri; int mail_num = atoi (url + strlen ("internal-mailto:")); if (mail_num == -1) @@ -199,22 +197,19 @@ eab_uri_popup_event(EABContactDisplay *display, GdkEvent *event, const char *uri EABPopup *emp; EABPopupTargetURI *t ; GtkMenu *menu; - - - emp = eab_popup_new("org.gnome.evolution.addressbook.contactdisplay.popup"); - - GSList *menus = NULL; - int i; + GSList *menus = NULL; + int i; - t = eab_popup_target_new_uri(emp, uri); - t->target.widget = (GtkWidget *)display; + emp = eab_popup_new("org.gnome.evolution.addressbook.contactdisplay.popup"); - for (i=0;i<sizeof(eab_uri_popups)/sizeof(eab_uri_popups[0]);i++) { - eab_uri_popups[i].user_data = g_strdup(t->uri); - menus = g_slist_prepend(menus, &eab_uri_popups[i]); - } - e_popup_add_items((EPopup *)emp, menus, NULL, eab_uri_popup_free, display); - + t = eab_popup_target_new_uri(emp, uri); + t->target.widget = (GtkWidget *)display; + + for (i=0;i<sizeof(eab_uri_popups)/sizeof(eab_uri_popups[0]);i++) { + eab_uri_popups[i].user_data = g_strdup(t->uri); + menus = g_slist_prepend(menus, &eab_uri_popups[i]); + } + e_popup_add_items((EPopup *)emp, menus, NULL, eab_uri_popup_free, display); menu = e_popup_create_menu_once((EPopup *)emp,(EPopupTarget*)t, 0); @@ -867,9 +862,9 @@ eab_contact_display_new (void) { EABContactDisplay *display; - display = g_object_new (EAB_TYPE_CONTACT_DISPLAY, NULL); - struct _EABContactDisplayPrivate *p; + + display = g_object_new (EAB_TYPE_CONTACT_DISPLAY, NULL); p=display->priv = g_new0 (EABContactDisplayPrivate, 1); gtk_html_set_default_content_type (GTK_HTML (display), "text/html; charset=utf-8"); diff --git a/addressbook/gui/widgets/gal-view-minicard.c b/addressbook/gui/widgets/gal-view-minicard.c index 7111cc0cb8..6239ead080 100644 --- a/addressbook/gui/widgets/gal-view-minicard.c +++ b/addressbook/gui/widgets/gal-view-minicard.c @@ -188,24 +188,28 @@ static void column_width_changed (EMinicardViewWidget *w, double width, EABView *address_view) { GalViewMinicard *view = GAL_VIEW_MINICARD (gal_view_instance_get_current_view (address_view->view_instance)); + GtkScrolledWindow *scrolled_window; + GtkAdjustment *adj; + GtkAdjustment *adj_new; + d(g_print("%s: Old width = %f, New width = %f\n", G_GNUC_FUNCTION, view->column_width, width)); if (view->column_width != width) { view->column_width = width; gal_view_changed(GAL_VIEW(view)); } - GtkScrolledWindow * scrolled_window = GTK_SCROLLED_WINDOW(address_view->widget); - GtkAdjustment *adj = gtk_scrolled_window_get_hadjustment (scrolled_window); - GtkAdjustment *adj_new = gtk_adjustment_new(adj->value, adj->lower, adj->upper, adj->page_size, adj->page_increment,adj->page_size); + scrolled_window = GTK_SCROLLED_WINDOW(address_view->widget); + adj = gtk_scrolled_window_get_hadjustment (scrolled_window); + adj_new = gtk_adjustment_new(adj->value, adj->lower, adj->upper, adj->page_size, adj->page_increment,adj->page_size); gtk_scrolled_window_set_hadjustment(scrolled_window, adj_new); } void gal_view_minicard_attach (GalViewMinicard *view, EABView *address_view) { + EMinicardViewWidget *emvw = E_MINICARD_VIEW_WIDGET (address_view->object); gal_view_minicard_detach (view); - EMinicardViewWidget *emvw = E_MINICARD_VIEW_WIDGET (address_view->object); view->emvw = emvw; g_object_ref (view->emvw); |