Example #1
0
        private void SetupTrayIcon()
        {
//			Logger.Debug ("Creating TrayIcon");

            onPixBuf  = Utilities.GetIcon("giver-24", 24);
            offPixBuf = Utilities.GetIcon("giveroff-24", 24);

            tray_icon            = new Gtk.StatusIcon();
            tray_icon.Pixbuf     = offPixBuf;
            tray_icon.Activate  += delegate { TargetWindow.ShowWindow(locator); };
            tray_icon.PopupMenu += OnPopupMenu;
        }
Example #2
0
 private void OnShowTargets(object sender, EventArgs args)
 {
     TargetWindow.ShowWindow(locator);
 }
Example #3
0
        private bool InitializeIdle()
        {
            requestHandler = new RequestHandler();
            sendingHandler = new SendingHandler();
            sendingHandler.Start();

            sendingHandler.TransferStarted     += TransferStartedHandler;
            sendingHandler.FileTransferStarted += FileTransferStartedHandler;
            sendingHandler.TransferProgress    += TransferProgressHandler;
            sendingHandler.TransferEnded       += TransferEndedHandler;

            try {
                photoService = new Giver.PhotoService();
                photoService.PhotoResolved += OnPhotoResolved;
                photoService.Start();
            } catch (Exception e) {
                Logger.Fatal("Failed to start the Photo Service");
                throw e;
            }


            try {
                locator = new ServiceLocator();
            } catch (Exception e) {
                if (e.Message.CompareTo("Daemon not running") == 0)
                {
                    Logger.Fatal("The Avahi Daemon is not running... start it before running Giver");
                }
                else
                {
                    Logger.Debug("Error starting ServiceLocator: {0}", e.Message);
                }

                throw e;
            }
            try {
                service = new GiverService();
            } catch (Exception e) {
                if (e.Message.CompareTo("Daemon not running") == 0)
                {
                    Logger.Fatal("The Avahi Daemon is not running... start it before running Giver");
                }
                else
                {
                    Logger.Debug("Error starting GiverService: {0}", e.Message);
                }

                throw e;
            }

            locator.ServiceRemoved  += OnServicesChanged;
            locator.ServiceAdded    += OnServicesChanged;
            service.ClientConnected += OnClientConnected;

            //tray = new NotificationArea("RtcApplication");
            SetupTrayIcon();

            if (!quiet)
            {
                TargetWindow.ShowWindow(locator);
            }

            return(false);
        }