aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Loper <mloper@src.gnome.org>2000-03-23 00:35:58 +0800
committerMatthew Loper <mloper@src.gnome.org>2000-03-23 00:35:58 +0800
commitf286676ead838f371de0096b6bfd3c46748d84ec (patch)
tree895901d9c2203404c6e14c15d866eccc408d6212
parent44e1a62c0ca5aede11bb1a5c7551186d7618dadb (diff)
downloadgsoc2013-evolution-f286676ead838f371de0096b6bfd3c46748d84ec.tar
gsoc2013-evolution-f286676ead838f371de0096b6bfd3c46748d84ec.tar.gz
gsoc2013-evolution-f286676ead838f371de0096b6bfd3c46748d84ec.tar.bz2
gsoc2013-evolution-f286676ead838f371de0096b6bfd3c46748d84ec.tar.lz
gsoc2013-evolution-f286676ead838f371de0096b6bfd3c46748d84ec.tar.xz
gsoc2013-evolution-f286676ead838f371de0096b6bfd3c46748d84ec.tar.zst
gsoc2013-evolution-f286676ead838f371de0096b6bfd3c46748d84ec.zip
+ * shell/main.c (evolution_boot): gtk_signal_connect'ed "destroy"
+ to gtk_main_quit, so that the shell dies when you want it to. + + * shell/e-shell-view.c (get_view): Reorganized, and added + assertions. + (e_shell_view_set_view): Added assertions. + + * camel/camel-formatter.c (debug): Disabled some useless debug + messaging. svn path=/trunk/; revision=2141
-rw-r--r--ChangeLog9
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/camel-formatter.c6
-rw-r--r--shell/e-shell-view.c119
-rw-r--r--shell/main.c5
5 files changed, 81 insertions, 63 deletions
diff --git a/ChangeLog b/ChangeLog
index 70c504da5d..4803d8dba8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2000-03-22 Matt Loper <matt@helixcode.com>
+
+ * shell/main.c (evolution_boot): gtk_signal_connect'ed "destroy"
+ to gtk_main_quit, so that the shell dies when you want it to.
+
+ * shell/e-shell-view.c (get_view): Reorganized, and added
+ assertions.
+ (e_shell_view_set_view): Added assertions.
+
2000-03-21 Christopher James Lahey <clahey@helixcode.com>
* widgets/e-text/e-text.c: Changed gnome_canvas_item_grab_focus to
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 0217d22080..8214ed4a8b 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,8 @@
+2000-03-22 Matt Loper <matt@helixcode.com>
+
+ * camel-formatter.c (debug): Disabled some useless debug
+ messaging.
+
2000-03-21 Dan Winship <danw@helixcode.com>
* providers/pop3: some initial bits of the POP3 provider, to
diff --git a/camel/camel-formatter.c b/camel/camel-formatter.c
index b1caf9f6fc..c7fddbfa1e 100644
--- a/camel/camel-formatter.c
+++ b/camel/camel-formatter.c
@@ -102,6 +102,7 @@ struct _CamelFormatterPrivate {
static void
debug (const gchar *format, ...)
{
+#if 0
va_list args;
gchar *string;
@@ -115,6 +116,7 @@ debug (const gchar *format, ...)
fflush (stdout);
g_free (string);
+#endif
}
static void
@@ -152,7 +154,7 @@ void camel_formatter_wrapper_to_html (CamelFormatter* formatter,
data_wrapper->mime_type->type,
data_wrapper->mime_type->subtype);
- g_print ("camel_formatter_wrapper_to_html: entered\n");
+ debug ("camel_formatter_wrapper_to_html: entered\n");
g_assert (formatter && data_wrapper && stream_out);
/* give the root CamelDataWrapper and the stream to the formatter */
@@ -194,7 +196,7 @@ camel_formatter_mime_message_to_html (CamelFormatter* formatter,
CamelStream* header_stream,
CamelStream* body_stream)
{
- g_print ("camel_formatter_mime_message_to_html: entered\n");
+ debug ("camel_formatter_mime_message_to_html: entered\n");
g_assert (formatter != NULL);
g_assert (CAMEL_IS_FORMATTER (formatter));
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 9f41b4ec3b..398c67f377 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -85,24 +85,25 @@ static GtkWidget *
get_view (EShellView *eshell_view, EFolder *efolder, Bonobo_UIHandler uih)
{
GtkWidget *w = NULL;
- EFolderType e_folder_type;
- BonoboControlFrame *control_frame = NULL;
- BonoboObjectClient *server;
- EShell *shell_model;
Evolution_Shell corba_shell = CORBA_OBJECT_NIL;
CORBA_Environment ev;
+ EShell *shell_model = eshell_view->eshell;
+
+ /* This type could be E_FOLDER_MAIL, E_FOLDER_CONTACTS, etc */
+ EFolderType e_folder_type;
+ g_assert (efolder);
+ g_assert (eshell_view);
+
+ e_folder_type = e_folder_get_folder_type (efolder);
- shell_model = eshell_view->eshell;
if (shell_model)
- corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_model));
+ corba_shell = bonobo_object_corba_objref (
+ BONOBO_OBJECT (shell_model));
else
- g_warning ("The shell Bonobo object does not have an associated CORBA object\n");
+ g_warning ("The shell Bonobo object does not have "
+ "an associated CORBA object\n");
-
- /* get the folder type */
- e_folder_type = e_folder_get_folder_type (efolder);
-
/* initialize the corba environment */
CORBA_exception_init (&ev);
@@ -111,65 +112,57 @@ get_view (EShellView *eshell_view, EFolder *efolder, Bonobo_UIHandler uih)
switch (e_folder_type) {
case E_FOLDER_MAIL :
- {
- Evolution_ServiceRepository corba_sr;
-
- w = bonobo_widget_new_control ("control:evolution-mail",
- uih);
- server = bonobo_widget_get_server (BONOBO_WIDGET (w));
-
- corba_sr = (Evolution_ServiceRepository)
- bonobo_object_client_query_interface (server,
- "IDL:Evolution/ServiceRepository:1.0",
- NULL);
- if (corba_sr != CORBA_OBJECT_NIL) {
- Evolution_ServiceRepository_set_shell (corba_sr, corba_shell, &ev);
- } else {
- g_warning ("The bonobo component for the mail doesn't seem to implement the "
- "Evolution::ServiceRepository interface\n");
- }
- }
+ w = bonobo_widget_new_control ("control:evolution-mail", uih);
break;
case E_FOLDER_CONTACTS :
- {
-#if 0
- Evolution_ServiceRepository corba_sr;
-#endif
-
- w = bonobo_widget_new_control ("control:addressbook",
- uih);
-#if 0
- server = bonobo_widget_get_server (BONOBO_WIDGET (w));
-
- corba_sr = (Evolution_ServiceRepository)
- bonobo_object_client_query_interface (server,
- "IDL:Evolution/ServiceRepository:1.0",
- NULL);
- if (corba_sr != CORBA_OBJECT_NIL) {
- Evolution_ServiceRepository_set_shell (corba_sr, corba_shell, &ev);
- } else {
- g_warning ("The bonobo component for the mail doesn't seem to implement the "
- "Evolution::ServiceRepository interface\n");
- }
-#endif
- }
+ w = bonobo_widget_new_control ("control:addressbook", uih);
break;
-
+
+ case E_FOLDER_CALENDAR :
+ case E_FOLDER_TASKS :
+ case E_FOLDER_OTHER :
default :
- printf ("No bonobo component associated to %s\n",
+ printf ("%s: %s: No bonobo component associated with %s\n",
+ __FILE__,
+ __FUNCTION__,
e_folder_get_description (efolder));
+ return NULL;
}
-
- if (!control_frame)
- control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (w));
- bonobo_control_frame_set_autoactivate (control_frame, FALSE);
- bonobo_control_frame_control_activate (control_frame);
- if (w) gtk_widget_show (w);
+ if (w)
+ {
+ Evolution_ServiceRepository corba_sr;
+ BonoboObjectClient *server =
+ bonobo_widget_get_server (BONOBO_WIDGET (w));
+ BonoboControlFrame *control_frame =
+ bonobo_widget_get_control_frame (BONOBO_WIDGET (w));
+
+ bonobo_control_frame_set_autoactivate (control_frame, FALSE);
+ bonobo_control_frame_control_activate (control_frame);
+
+ /* Does this control have the "ServiceRepository" interface? */
+ corba_sr = (Evolution_ServiceRepository)
+ bonobo_object_client_query_interface (
+ server,
+ "IDL:Evolution/ServiceRepository:1.0",
+ NULL);
+
+ /* If it does, pass our shell interface to it */
+ if (corba_sr != CORBA_OBJECT_NIL) {
+ Evolution_ServiceRepository_set_shell (corba_sr,
+ corba_shell,
+ &ev);
+ } else {
+ g_warning ("The bonobo component for the mail doesn't "
+ "seem to implement the "
+ "Evolution::ServiceRepository interface\n");
+ }
+
+ gtk_widget_show (w);
+ }
return w;
-
}
@@ -181,6 +174,9 @@ e_shell_view_set_view (EShellView *eshell_view, EFolder *efolder)
GtkWidget *folder_view = g_hash_table_lookup (
eshell_view->priv->folder_views, efolder);
+ g_assert (eshell_view);
+ g_assert (efolder);
+
/* if we found a notebook page in our hash, that represents
this efolder, switch to it */
if (folder_view) {
@@ -221,6 +217,9 @@ e_shell_view_new (EShell *eshell, EFolder *efolder, gboolean show_shortcut_bar)
{
EShellView *eshell_view;
+ g_return_val_if_fail (eshell != NULL, NULL);
+ g_return_val_if_fail (efolder != NULL, NULL);
+
eshell_view = gtk_type_new (e_shell_view_get_type ());
eshell_view->priv = g_new (EShellViewPrivate, 1);
diff --git a/shell/main.c b/shell/main.c
index 1d6d8bed7c..1c93579d85 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -73,7 +73,10 @@ evolution_boot (void)
e_shell_view_new (eshell,
eshell->default_folders.inbox,
TRUE));
-
+ gtk_signal_connect (GTK_OBJECT (e_shell_view), "destroy",
+ GTK_SIGNAL_FUNC(gtk_main_quit),
+ NULL);
+
gtk_widget_show (GTK_WIDGET (e_shell_view));
}