Ejemplo n.º 1
0
		public new void Display (NotificationMessage m)
		{
			if (message != m) {
				if (message != null)
					Remove (message);

				Add (m);

				message = m;
				m.Area = this;
				m.ShowAll ();
			}

			this.Show ();
		}
Ejemplo n.º 2
0
		private void OnIndexingStatusEvent (IndexingStatus status)
		{
			if (status == IndexingStatus.Running) {
				NotificationMessage m = new NotificationMessage ();
				m.Icon = Gtk.Stock.DialogInfo;
				m.Title = Catalog.GetString ("Your data is being indexed");
				m.Message = Catalog.GetString ("The search service is in the process of indexing your data.  Search results may be incomplete until indexing has finished.");
				notification_area.Display (m);
			} else {
				notification_area.Hide ();
			}
		}
Ejemplo n.º 3
0
		private void OnStartDaemon ()
		{
			notification_area.Hide ();

			DaemonInformationRequest request = new DaemonInformationRequest (true, false, false, false);

			try {
				request.Send ();
			} catch (Beagle.ResponseMessageException) {
				// beagled is not running
				// Start beagled and once it is started, display the quicktips page
				Beagle.Search.Pages.StartDaemon.DoStartDaemon (delegate () {
										this.statusbar.Pop (0);
										this.statusbar.Push (0, Catalog.GetString ("Search service started"));
										});
				pages.CurrentPage = pages.PageNum (quicktips);
				return;
			} catch (Exception e) {
				Console.WriteLine ("Stopping the Beagle daemon failed: {0}", e.Message);
			}

			// beagled is running
			NotificationMessage m = new NotificationMessage ();
			m.Icon = Gtk.Stock.DialogError;
			m.Title = Catalog.GetString ("Starting service failed");
			m.Message = Catalog.GetString ("Service is already running!");
			notification_area.Display (m);
		}
Ejemplo n.º 4
0
		private void OnStopDaemon ()
		{
			notification_area.Hide ();

			ShutdownRequest request = new ShutdownRequest ();
			try {
				request.Send ();
			} catch (Beagle.ResponseMessageException) {
				// beagled is not running
				NotificationMessage m = new NotificationMessage ();
				m.Icon = Gtk.Stock.DialogError;
				m.Title = Catalog.GetString ("Stopping service failed");
				m.Message = Catalog.GetString ("Service was not running!");
				notification_area.Display (m);

				// show the start daemon if the user wants to start the daemom
				pages.CurrentPage = pages.PageNum (startdaemon);
				return;
			} catch (Exception e) {
				Console.WriteLine ("Stopping the Beagle daemon failed: {0}", e.Message);
			}

			// beagled was running and should be now stopped.
			// Show the start page. The start-daemon page feels as if the user-request failed.
			pages.CurrentPage = pages.PageNum (quicktips);
			this.statusbar.Pop (0);
			this.statusbar.Push (0, Catalog.GetString ("Search service stopped"));
		}
Ejemplo n.º 5
0
                private void OnUnknownHostFound (object sender, AvahiEventArgs args)
                {
			NotificationMessage m = new NotificationMessage ();
			m.Pixbuf = WidgetFu.LoadThemeIcon ("network-workgroup", 48);
			m.Title = Catalog.GetString ("There are computers near you running Beagle");
			m.Message = Catalog.GetString ("You can select to search other computers from the \"Search\" menu.");
			m.AddAction ("Configure", OnNetworkConfigure);

			notification_area.Display (m);
		}