aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shell/ChangeLog16
-rw-r--r--shell/e-shell.c12
-rw-r--r--shell/e-shell.h2
-rw-r--r--shell/main.c91
4 files changed, 121 insertions, 0 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index f1770d76a5..755c523d0e 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,21 @@
2002-05-22 Ettore Perazzoli <ettore@ximian.com>
+ * main.c (view_map_callback): New callback for when the first
+ created view in the shell gets mapped.
+ (new_view_created_callback): New callback for when the first view
+ of the shell gets created.
+ (show_development_warning): New function to display a warning
+ about the fact that Evolution is unstable.
+ (idle_cb): Call show_development_warning() here unless the
+ EVOLVE_ME_HARDER environment variable is set.
+
+ * e-shell.c (class_init): Add the "new_view_created" signal here.
+ (create_view): Emit the signal here.
+
+ * e-shell.h: New signal "new_view_created".
+
+2002-05-22 Ettore Perazzoli <ettore@ximian.com>
+
* e-shell-user-creatable-items-handler.c: New member
default_menu_item in EShellUserCreatableItemsHandlerPrivate.
(ensure_menu_items): Set ->default_menu_item.
diff --git a/shell/e-shell.c b/shell/e-shell.c
index f2f41baa32..d16b449647 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -150,6 +150,7 @@ struct _EShellPrivate {
enum {
NO_VIEWS_LEFT,
LINE_STATUS_CHANGED,
+ NEW_VIEW_CREATED,
LAST_SIGNAL
};
@@ -1027,6 +1028,8 @@ create_view (EShell *shell,
e_shell_view_show_shortcut_bar (view, e_shell_view_shortcut_bar_shown (template_view));
}
+ gtk_signal_emit (GTK_OBJECT (shell), signals[NEW_VIEW_CREATED], view);
+
return view;
}
@@ -1142,6 +1145,15 @@ class_init (EShellClass *klass)
GTK_TYPE_NONE, 1,
GTK_TYPE_ENUM);
+ signals[NEW_VIEW_CREATED] =
+ gtk_signal_new ("new_view_created",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EShellClass, new_view_created),
+ gtk_marshal_NONE__POINTER,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_POINTER);
+
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
epv = & klass->epv;
diff --git a/shell/e-shell.h b/shell/e-shell.h
index 119cb87b14..84ce5da551 100644
--- a/shell/e-shell.h
+++ b/shell/e-shell.h
@@ -80,6 +80,8 @@ struct _EShellClass {
void (* no_views_left) (EShell *shell);
void (* line_status_changed) (EShell *shell, EShellLineStatus status);
+ void (* new_view_created) (EShell *shell, EShellView *view);
+
};
diff --git a/shell/main.c b/shell/main.c
index efb0294b6f..3c9802c4e5 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -179,6 +179,92 @@ destroy_cb (GtkObject *object, gpointer data)
}
+/* Warning dialog to scare people off a little bit. */
+
+static void
+warning_dialog_clicked_callback (GnomeDialog *dialog,
+ int button_number,
+ void *data)
+{
+ gtk_widget_destroy (GTK_WIDGET (dialog));
+}
+
+static void
+show_development_warning (GtkWindow *parent)
+{
+ GtkWidget *label, *warning_dialog;
+
+ warning_dialog = gnome_dialog_new ("Ximian Evolution " VERSION, GNOME_STOCK_BUTTON_OK, NULL);
+ gtk_window_set_transient_for (GTK_WINDOW (warning_dialog), parent);
+
+ label = gtk_label_new (
+ /* xgettext:no-c-format */
+ _("Hi. Thanks for taking the time to download this preview release\n"
+ "of the Ximian Evolution groupware suite.\n"
+ "\n"
+ "This version of Ximian Evolution is not yet complete. It's getting close,\n"
+ "but some features are either unfinished or don't work properly.\n"
+ "\n"
+ "If you want a stable version of Evolution, we urge you to uninstall,\n"
+ "this version, and install a 1.0.x version instead (1.0.5 recommended).\n"
+ "\n"
+ "If you find bugs, please report them to us at bugzilla.ximian.com.\n"
+ "This product comes with no warranty and is not intended for\n"
+ "individuals prone to violent fits of anger.\n"
+ "\n"
+ "We hope that you enjoy the results of our hard work, and we\n"
+ "eagerly await your contributions!\n"
+ ));
+ gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+ gtk_widget_show (label);
+
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (warning_dialog)->vbox),
+ label, TRUE, TRUE, 4);
+
+ label = gtk_label_new (
+ _(
+ "Thanks\n"
+ "The Ximian Evolution Team\n"
+ ));
+ gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT);
+ gtk_misc_set_alignment(GTK_MISC(label), 1, .5);
+ gtk_widget_show (label);
+
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (warning_dialog)->vbox),
+ label, TRUE, TRUE, 0);
+
+ gtk_widget_show (warning_dialog);
+ gtk_signal_connect (GTK_OBJECT (warning_dialog), "clicked",
+ GTK_SIGNAL_FUNC (warning_dialog_clicked_callback), NULL);
+}
+
+/* The following signal handlers are used to display the development warning as
+ soon as the first view is created. */
+
+static void
+view_map_callback (GtkWidget *widget,
+ void *data)
+{
+ gtk_signal_disconnect_by_func (GTK_OBJECT (widget),
+ GTK_SIGNAL_FUNC (view_map_callback),
+ data);
+
+ show_development_warning (GTK_WINDOW (widget));
+}
+
+static void
+new_view_created_callback (EShell *shell,
+ EShellView *view,
+ void *data)
+{
+ gtk_signal_disconnect_by_func (GTK_OBJECT (shell),
+ GTK_SIGNAL_FUNC (new_view_created_callback),
+ data);
+
+ gtk_signal_connect (GTK_OBJECT (view), "map", view_map_callback, NULL);
+}
+
+
/* This is for doing stuff that requires the GTK+ loop to be running already. */
static gint
@@ -216,6 +302,11 @@ idle_cb (void *data)
GTK_SIGNAL_FUNC (no_views_left_cb), NULL);
gtk_signal_connect (GTK_OBJECT (shell), "destroy",
GTK_SIGNAL_FUNC (destroy_cb), NULL);
+
+ if (!getenv ("EVOLVE_ME_HARDER"))
+ gtk_signal_connect (GTK_OBJECT (shell), "new_view_created",
+ GTK_SIGNAL_FUNC (new_view_created_callback), NULL);
+
corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell));
corba_shell = CORBA_Object_duplicate (corba_shell, &ev);
break;