[Monodevelop-patches-list] r2661 - in trunk/MonoDevelop/Core/src/MonoDevelop.Startup: . Dialogs
Lluis Sanchez <lluis@ximian.com>
lluis at mono-cvs.ximian.com
Mon Jul 18 07:05:45 EDT 2005
Author: lluis
Date: 2005-07-18 07:05:38 -0400 (Mon, 18 Jul 2005)
New Revision: 2661
Added:
trunk/MonoDevelop/Core/src/MonoDevelop.Startup/Dialogs/AddinLoadErrorDialog.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Startup/MonoDevelop.Startup.glade
Modified:
trunk/MonoDevelop/Core/src/MonoDevelop.Startup/ChangeLog
trunk/MonoDevelop/Core/src/MonoDevelop.Startup/Makefile.am
trunk/MonoDevelop/Core/src/MonoDevelop.Startup/MonoDevelopMain.cs
Log:
2005-07-18 Lluis Sanchez Gual <lluis at novell.com>
* MonoDevelopMain.cs: Show an error dialog if there is some error
while initializing the addins.
* Dialog/AggregatedProgressMonitor.cs: New dialog for showing addin
load errors.
* Makefile.am: Added glade file.
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Startup/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Startup/ChangeLog 2005-07-18 11:05:17 UTC (rev 2660)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Startup/ChangeLog 2005-07-18 11:05:38 UTC (rev 2661)
@@ -1,3 +1,11 @@
+2005-07-18 Lluis Sanchez Gual <lluis at novell.com>
+
+ * MonoDevelopMain.cs: Show an error dialog if there is some error
+ while initializing the addins.
+ * Dialog/AggregatedProgressMonitor.cs: New dialog for showing addin
+ load errors.
+ * Makefile.am: Added glade file.
+
2005-06-28 Raja R Harinath <rharinath at novell.com>
* Makefile.am (FILES): Move AssemblyInfo.cs ...
Added: trunk/MonoDevelop/Core/src/MonoDevelop.Startup/Dialogs/AddinLoadErrorDialog.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Startup/Dialogs/AddinLoadErrorDialog.cs 2005-07-18 11:05:17 UTC (rev 2660)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Startup/Dialogs/AddinLoadErrorDialog.cs 2005-07-18 11:05:38 UTC (rev 2661)
@@ -0,0 +1,70 @@
+//
+// AddinLoadErrorDialog.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using Mono.GetOptions;
+using Gtk;
+using Glade;
+using System.Reflection;
+
+using MonoDevelop.Core.AddIns;
+
+namespace MonoDevelop
+{
+ public class AddinLoadErrorDialog
+ {
+ [Glade.Widget] Dialog addinLoadErrorDialog;
+ [Glade.Widget] Gtk.TreeView errorTree;
+
+ public AddinLoadErrorDialog (AddinError[] errors)
+ {
+ XML glade = new XML (null, "MonoDevelop.Startup.glade", "addinLoadErrorDialog", null);
+ glade.Autoconnect (this);
+
+ TreeStore store = new TreeStore (typeof(string));
+ errorTree.AppendColumn ("Addin", new CellRendererText (), "text", 0);
+ errorTree.Model = store;
+
+ foreach (AddinError err in errors) {
+ TreeIter it = store.AppendValues (Path.GetFileNameWithoutExtension (err.AddinFile));
+ store.AppendValues (it, "Full path: " + err.AddinFile);
+ store.AppendValues (it, err.Exception.ToString ());
+ }
+ }
+
+ public bool Run ()
+ {
+ addinLoadErrorDialog.ShowAll ();
+ bool res = (((ResponseType)addinLoadErrorDialog.Run ()) == ResponseType.Yes);
+ addinLoadErrorDialog.Destroy ();
+ return res;
+ }
+ }
+}
+
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Startup/Makefile.am
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Startup/Makefile.am 2005-07-18 11:05:17 UTC (rev 2660)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Startup/Makefile.am 2005-07-18 11:05:38 UTC (rev 2661)
@@ -5,6 +5,7 @@
FILES= \
MonoDevelopMain.cs \
MonoDevelopOptions.cs \
+Dialogs/AddinLoadErrorDialog.cs \
Dialogs/AddInTreeSettingsHandler.cs
GENERATED_FILES = \
@@ -19,10 +20,13 @@
/r:Mono.Posix.dll \
/r:Mono.GetOptions.dll \
$(GTK_SHARP_LIBS) \
+ $(GLADE_SHARP_LIBS) \
$(GNOME_SHARP_LIBS)
+RES = -resource:$(srcdir)/MonoDevelop.Startup.glade
+
$(ASSEMBLY): $(build_sources)
- $(CSC) $(CSC_FLAGS) -out:$@ $(REFS) $(build_sources) $(SPLASH)
+ $(CSC) $(CSC_FLAGS) $(RES) -out:$@ $(REFS) $(build_sources) $(SPLASH)
$(ASSEMBLY).config: $(ASSEMBLY) $(srcdir)/app.config
cp $(srcdir)/app.config $(ASSEMBLY).config
Added: trunk/MonoDevelop/Core/src/MonoDevelop.Startup/MonoDevelop.Startup.glade
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Startup/MonoDevelop.Startup.glade 2005-07-18 11:05:17 UTC (rev 2660)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Startup/MonoDevelop.Startup.glade 2005-07-18 11:05:38 UTC (rev 2661)
@@ -0,0 +1,184 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkDialog" id="addinLoadErrorDialog">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">MonoDevelop</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="default_height">350</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="has_separator">True</property>
+
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+ <child>
+ <widget class="GtkButton" id="cancelbutton1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-no</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-9</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="okbutton1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-yes</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-8</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="border_width">12</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="stock">gtk-dialog-error</property>
+ <property name="icon_size">6</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0</property>
+ <property name="xpad">6</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox4">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">The following addins could not be started:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
+ <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+ <child>
+ <widget class="GtkTreeView" id="errorTree">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="rules_hint">False</property>
+ <property name="reorderable">False</property>
+ <property name="enable_search">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label5">
+ <property name="width_request">479</property>
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">You can start MonoDevelop without these addins, but the functionality they provide will be missing. Do you wish to continue?</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">True</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+</glade-interface>
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Startup/MonoDevelopMain.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Startup/MonoDevelopMain.cs 2005-07-18 11:05:17 UTC (rev 2660)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Startup/MonoDevelopMain.cs 2005-07-18 11:05:38 UTC (rev 2661)
@@ -120,6 +120,16 @@
SetSplashInfo(0.4, "Initializing Resource Service ...");
ServiceManager.AddService(new ResourceService());
SetSplashInfo(0.6, "Initializing Addin Services ...");
+
+ AddinError[] errors = AddInTreeSingleton.InitializeAddins ();
+ if (errors != null && errors.Length > 0) {
+ SplashScreenForm.SplashScreen.Hide ();
+ AddinLoadErrorDialog dlg = new AddinLoadErrorDialog (errors);
+ if (!dlg.Run ())
+ return 1;
+ SplashScreenForm.SplashScreen.Show ();
+ RunMainLoop ();
+ }
ServiceManager.InitializeServicesSubsystem("/Workspace/Services");
SetSplashInfo(0.8, "Initializing Autostart Addins ...");
More information about the Monodevelop-patches-list
mailing list