コード例 #1
0
		public AddinLoadErrorDialog (AddinError[] errors, bool warning)
		{
			Build ();
			Title = BrandingService.ApplicationName;
			
			TreeStore store = new TreeStore (typeof(string));
			errorTree.AppendColumn ("Addin", new CellRendererText (), "text", 0);
			errorTree.Model = store;
			
			bool fatal = false;
			
			foreach (AddinError err in errors) {
				string msg = err.Message;
				if (string.IsNullOrEmpty (msg) && err.Exception != null)
					msg = err.Exception.Message;
				string name = System.IO.Path.GetFileNameWithoutExtension (err.AddinFile);
				if (err.Fatal) name += " (Fatal error)";
				TreeIter it = store.AppendValues (name);
				store.AppendValues (it, "Full Path: " + err.AddinFile);
				store.AppendValues (it, "Error: " + msg);
				if (err.Exception != null) {
					it = store.AppendValues (it, "Exception: " + err.Exception.GetType () + ": " + err.Exception.Message);
					store.AppendValues (it, err.Exception.StackTrace.ToString ());
				}
				if (err.Fatal) fatal = true;
			}

			if (fatal) {
				noButton.Hide ();
				yesButton.Hide ();
				closeButton.Show ();
				messageLabel.Text = GettextCatalog.GetString (
					"{0} cannot start because a fatal error has been detected.",
					BrandingService.ApplicationName
				);
			} else if (warning) {
				noButton.Hide ();
				yesButton.Hide ();
				closeButton.Show ();
				messageLabel.Text = GettextCatalog.GetString (
					"{0} can run without these add-ins, but the functionality they provide will be missing.",
					BrandingService.ApplicationName
				);
			} else {
				messageLabel.Text = GettextCatalog.GetString (
					"You can start {0} without these add-ins, but the functionality they " +
					"provide will be missing. Do you wish to continue?",
					BrandingService.ApplicationName
				);
			}
		}
コード例 #2
0
		public AddinLoadErrorDialog (AddinError[] errors, bool warning)
		{
			Build ();
			
			TreeStore store = new TreeStore (typeof(string));
			errorTree.AppendColumn ("Addin", new CellRendererText (), "text", 0);
			errorTree.Model = store;
			
			bool fatal = false;
			
			foreach (AddinError err in errors) {
				string msg = err.Message;
				if (string.IsNullOrEmpty (msg) && err.Exception != null)
					msg = err.Exception.Message;
				string name = System.IO.Path.GetFileNameWithoutExtension (err.AddinFile);
				if (err.Fatal) name += " (Fatal error)";
				TreeIter it = store.AppendValues (name);
				store.AppendValues (it, "Full Path: " + err.AddinFile);
				store.AppendValues (it, "Error: " + msg);
				if (err.Exception != null) {
					it = store.AppendValues (it, "Exception: " + err.Exception.GetType () + ": " + err.Exception.Message);
					store.AppendValues (it, err.Exception.StackTrace.ToString ());
				}
				if (err.Fatal) fatal = true;
			}
			
			if (fatal) {
				noButton.Hide ();
				yesButton.Hide ();
				labelContinue.Hide ();
				closeButton.Show ();
				labelFatal.Show ();
			} else if (warning) {
				noButton.Hide ();
				yesButton.Hide ();
				labelContinue.Hide ();
				labelWarning.Show ();
				closeButton.Show ();
			}
		}