Пример #1
0
        private void ApplicationActivatedDelegate(object sender, EventArgs args)
        {
            if (this.application.Windows.Length > 0)
            {
                bool has_visible_windows = false;

                foreach (Window window in this.application.Windows)
                {
                    if (window.Visible)
                    {
                        window.Present();
                        has_visible_windows = true;
                    }
                }

                if (!has_visible_windows)
                {
                    Program.Controller.HandleReopen();
                }
            }
            else
            {
                Setup      = new SparkleSetup();
                EventLog   = new SparkleEventLog();
                About      = new SparkleAbout();
                Bubbles    = new SparkleBubbles();
                StatusIcon = new SparkleStatusIcon();

                Setup.Application    = this.application;
                EventLog.Application = this.application;
                About.Application    = this.application;

                Program.Controller.UIHasLoaded();
            }
        }
Пример #2
0
        public SparkleUI ()
        {
            if (Environment.OSVersion.Version.Major < 14)
                FontName = "Lucida Grande";

            Program.Controller.Invoke (() => {
                if (Environment.OSVersion.Version.Major >= 14) {
                    NSWorkspace.SharedWorkspace.SetIconforFile (
                        NSImage.ImageNamed ("sparkleshare-folder-yosemite.icns"),
                        Program.Controller.FoldersPath, 0);

                } else {
                    NSWorkspace.SharedWorkspace.SetIconforFile (
                        NSImage.ImageNamed ("sparkleshare-folder.icns"),
                        Program.Controller.FoldersPath, 0);
                }

                NSApplication.SharedApplication.ApplicationIconImage = NSImage.ImageNamed ("sparkleshare-app.icns");
    
                Setup      = new SparkleSetup ();
                EventLog   = new SparkleEventLog ();
                About      = new SparkleAbout ();
                Note       = new SparkleNote ();
                Bubbles    = new SparkleBubbles ();
                StatusIcon = new SparkleStatusIcon ();
            });

            Program.Controller.UIHasLoaded ();
        }
Пример #3
0
        public SparkleUI()
        {
            if (Environment.OSVersion.Version.Major < 14)
            {
                FontName = "Lucida Grande";
            }

            Program.Controller.Invoke(() => {
                if (Environment.OSVersion.Version.Major >= 14)
                {
                    NSWorkspace.SharedWorkspace.SetIconforFile(
                        NSImage.ImageNamed("sparkleshare-folder-yosemite.icns"),
                        Program.Controller.FoldersPath, 0);
                }
                else
                {
                    NSWorkspace.SharedWorkspace.SetIconforFile(
                        NSImage.ImageNamed("sparkleshare-folder.icns"),
                        Program.Controller.FoldersPath, 0);
                }

                NSApplication.SharedApplication.ApplicationIconImage = NSImage.ImageNamed("sparkleshare-app.icns");

                Setup      = new SparkleSetup();
                EventLog   = new SparkleEventLog();
                About      = new SparkleAbout();
                Note       = new SparkleNote();
                Bubbles    = new SparkleBubbles();
                StatusIcon = new SparkleStatusIcon();
            });

            Program.Controller.UIHasLoaded();
        }
Пример #4
0
        private void ApplicationActivatedDelegate (object sender, EventArgs args)
        {
            if (this.application.Windows.Length > 0) {
                bool has_visible_windows = false;

                foreach (Window window in this.application.Windows) {
                    if (window.Visible) {
                        window.Present ();
                        has_visible_windows = true;
                    }
                }

                if (!has_visible_windows)
                    Program.Controller.HandleReopen ();

            } else {
                Setup      = new SparkleSetup ();
                EventLog   = new SparkleEventLog ();
                About      = new SparkleAbout ();
                Bubbles    = new SparkleBubbles ();
                StatusIcon = new SparkleStatusIcon ();

                Setup.Application    = this.application;
                EventLog.Application = this.application;
                About.Application    = this.application;

                Program.Controller.UIHasLoaded ();
            }
        }
Пример #5
0
        public SparkleUI()
        {
            Application.Init ();

            Setup      = new SparkleSetup ();
            EventLog   = new SparkleEventLog ();
            About      = new SparkleAbout ();
            Bubbles    = new SparkleBubbles ();
            StatusIcon = new SparkleStatusIcon ();

            Program.Controller.UIHasLoaded ();
        }
Пример #6
0
        public SparkleUI()
        {
            Application.Init();

            Setup      = new SparkleSetup();
            EventLog   = new SparkleEventLog();
            About      = new SparkleAbout();
            Bubbles    = new SparkleBubbles();
            StatusIcon = new SparkleStatusIcon();

            Program.Controller.UIHasLoaded();
        }
Пример #7
0
        public SparkleUI()
        {
            // FIXME: The second time windows are shown, the windows
            // don't have the smooth ease in animation, but appear abruptly.
            // The ease out animation always seems to work
            Setup      = new SparkleSetup ();
            EventLog   = new SparkleEventLog ();
            About      = new SparkleAbout ();
            Bubbles    = new SparkleBubbles ();
            StatusIcon = new SparkleStatusIcon ();

            Program.Controller.UIHasLoaded ();
        }
Пример #8
0
        public SparkleUI()
        {
            // FIXME: The second time windows are shown, the windows
            // don't have the smooth ease in animation, but appear abruptly.
            // The ease out animation always seems to work
            Setup      = new SparkleSetup();
            EventLog   = new SparkleEventLogWindow();
            About      = new SparkleAbout();
            Bubbles    = new SparkleBubbles();
            StatusIcon = new SparkleStatusIcon();

            Program.Controller.UIHasLoaded();
        }
Пример #9
0
        public SparkleUI()
        {
            Application.Init();

            // Use translations
            Catalog.Init(Defines.GETTEXT_PACKAGE, Defines.LOCALE_DIR);

            Setup      = new SparkleSetup();
            EventLog   = new SparkleEventLog();
            About      = new SparkleAbout();
            Bubbles    = new SparkleBubbles();
            StatusIcon = new SparkleStatusIcon();

            Program.Controller.UIHasLoaded();
        }
Пример #10
0
        public SparkleUI()
        {
            Application.Init ();

            // Use translations
            Catalog.Init (Defines.GETTEXT_PACKAGE, Defines.LOCALE_DIR);

            Setup      = new SparkleSetup ();
            EventLog   = new SparkleEventLog ();
            About      = new SparkleAbout ();
            Bubbles    = new SparkleBubbles ();
            StatusIcon = new SparkleStatusIcon ();

            Program.Controller.UIHasLoaded ();
        }
Пример #11
0
        public SparkleUI()
        {
            // Initialize the application
            Application.Init ();

            // Use translations
            Catalog.Init (Defines.GETTEXT_PACKAGE, Defines.LOCALE_DIR);

            Setup      = new SparkleSetup ();
            EventLog   = new SparkleEventLog ();
            About      = new SparkleAbout ();
            Bubbles    = new SparkleBubbles ();
            StatusIcon = new SparkleStatusIcon ();

            if (Program.Controller.FirstRun)
                Program.Controller.ShowSetupWindow (PageType.Setup);
        }
Пример #12
0
        public SparkleUI()
        {
            Program.Controller.Invoke(() => {
                NSWorkspace.SharedWorkspace.SetIconforFile(
                    NSImage.ImageNamed("sparkleshare-folder.icns"), Program.Controller.FoldersPath, 0);

                NSApplication.SharedApplication.ApplicationIconImage = NSImage.ImageNamed("sparkleshare-app.icns");

                Setup      = new SparkleSetup();
                EventLog   = new SparkleEventLog();
                About      = new SparkleAbout();
                Bubbles    = new SparkleBubbles();
                StatusIcon = new SparkleStatusIcon();
            });

            Program.Controller.UIHasLoaded();
        }
Пример #13
0
        public SparkleUI ()
        {
            Program.Controller.Invoke (() => {
                NSWorkspace.SharedWorkspace.SetIconforFile (
                    NSImage.ImageNamed ("sparkleshare-folder.icns"), Program.Controller.FoldersPath, 0);

                NSApplication.SharedApplication.ApplicationIconImage = NSImage.ImageNamed ("sparkleshare-app.icns");
    
                Setup      = new SparkleSetup ();
                EventLog   = new SparkleEventLog ();
                About      = new SparkleAbout ();
                Bubbles    = new SparkleBubbles ();
                StatusIcon = new SparkleStatusIcon ();
            });

            Program.Controller.UIHasLoaded ();
        }
Пример #14
0
        public SparkleUI()
        {
            using (var a = new NSAutoreleasePool())
            {
                GrowlApplicationBridge.WeakDelegate = this;
                GrowlApplicationBridge.Delegate     = new SparkleGrowlDelegate();

                NSApplication.SharedApplication.ApplicationIconImage = NSImage.ImageNamed("sparkleshare-app.icns");

                SetFolderIcon();

                Setup      = new SparkleSetup();
                EventLog   = new SparkleEventLog();
                About      = new SparkleAbout();
                Bubbles    = new SparkleBubbles();
                StatusIcon = new SparkleStatusIcon();

                Program.Controller.UIHasLoaded();
            }
        }
Пример #15
0
        public SparkleUI()
        {
            using (var a = new NSAutoreleasePool ())
            {
                GrowlApplicationBridge.WeakDelegate = this;
                GrowlApplicationBridge.Delegate     = new SparkleGrowlDelegate ();

                NSApplication.SharedApplication.ApplicationIconImage = NSImage.ImageNamed ("sparkleshare-app.icns");

                SetFolderIcon ();

                Setup      = new SparkleSetup ();
                EventLog   = new SparkleEventLog ();
                About      = new SparkleAbout ();
                Bubbles    = new SparkleBubbles ();
                StatusIcon = new SparkleStatusIcon ();

                Program.Controller.UIHasLoaded ();
            }
        }
Пример #16
0
        public SparkleUI()
        {
            using (var a = new NSAutoreleasePool())
            {
                Catalog.Init("sparkleshare",
                             Path.Combine(NSBundle.MainBundle.ResourcePath, "Translations"));

                GrowlApplicationBridge.WeakDelegate = this;
                GrowlApplicationBridge.Delegate     = new SparkleGrowlDelegate();

                NSApplication.SharedApplication.ApplicationIconImage =
                    NSImage.ImageNamed("sparkleshare.icns");

                SetFolderIcon();

                Setup      = new SparkleSetup();
                EventLog   = new SparkleEventLog();
                About      = new SparkleAbout();
                Bubbles    = new SparkleBubbles();
                StatusIcon = new SparkleStatusIcon();

                Program.Controller.UIHasLoaded();
            }
        }
Пример #17
0
        // Creates the menu that is popped up when the
        // user clicks the status icon
        public void CreateMenu()
        {
            Menu = new Menu ();

                // The menu item showing the status and size of the SparkleShare folder
                MenuItem status_menu_item = new MenuItem (StateText) {
                    Sensitive = false
                };

            Menu.Add (status_menu_item);
            Menu.Add (new SeparatorMenuItem ());

                ImageMenuItem folder_item = new SparkleMenuItem ("SparkleShare"){
                    Image = new Image (SparkleUIHelpers.GetIcon ("folder-sparkleshare", 16))
                };

                folder_item.Activated += delegate {
                    SparkleShare.Controller.OpenSparkleShareFolder ();
                };

            Menu.Add (folder_item);

                if (SparkleShare.Controller.Folders.Count > 0) {

                    // Creates a menu item for each repository with a link to their logs
                    foreach (string folder_name in SparkleShare.Controller.Folders) {

                        Gdk.Pixbuf folder_icon;

                        if (SparkleShare.Controller.UnsyncedFolders.Contains (folder_name)) {
                            folder_icon = IconTheme.Default.LoadIcon ("dialog-error", 16,
                                IconLookupFlags.GenericFallback);

                        } else {
                            folder_icon = IconTheme.Default.LoadIcon ("folder", 16,
                                IconLookupFlags.GenericFallback);
                        }

                        ImageMenuItem subfolder_item = new SparkleMenuItem (folder_name) {
                            Image = new Image (folder_icon)
                        };

                        subfolder_item.Activated += OpenFolderDelegate (folder_name);
                        Menu.Add (subfolder_item);
                    }

                } else {
                    MenuItem no_folders_item = new MenuItem (_("No Remote Folders Yet")) {
                        Sensitive   = false
                    };

                    Menu.Add (no_folders_item);
                }

                // Opens the wizard to add a new remote folder
                MenuItem sync_item = new MenuItem (_("Add Remote Folder…"));

                if (SparkleShare.Controller.FirstRun)
                    sync_item.Sensitive = false;

                sync_item.Activated += delegate {
                    Application.Invoke (delegate {

                        if (SparkleUI.Intro == null) {
                            SparkleUI.Intro = new SparkleIntro ();
                            SparkleUI.Intro.ShowServerForm (true);
                        }

                        if (!SparkleUI.Intro.Visible)
                            SparkleUI.Intro.ShowServerForm (true);

                        SparkleUI.Intro.ShowAll ();
                        SparkleUI.Intro.Present ();
                    });
                };

            Menu.Add (sync_item);
            Menu.Add (new SeparatorMenuItem ());

            MenuItem recent_events_item = new MenuItem (_("Show Recent Events"));

                if (SparkleShare.Controller.Folders.Count < 1)
                    recent_events_item.Sensitive = false;

                recent_events_item.Activated += delegate {
                    Application.Invoke (delegate {
                        if (SparkleUI.EventLog == null)
                            SparkleUI.EventLog = new SparkleEventLog ();

                        SparkleUI.EventLog.ShowAll ();
                        SparkleUI.EventLog.Present ();
                    });
                };

            Menu.Add (recent_events_item);

            MenuItem notify_item;

                if (SparkleShare.Controller.NotificationsEnabled)
                    notify_item = new MenuItem (_("Turn Notifications Off"));
                else
                    notify_item = new MenuItem (_("Turn Notifications On"));

                notify_item.Activated += delegate {
                    SparkleShare.Controller.ToggleNotifications ();
                    CreateMenu ();
                };

            Menu.Add (notify_item);
            Menu.Add (new SeparatorMenuItem ());

                // A menu item that takes the user to http://www.sparkleshare.org/
                MenuItem about_item = new MenuItem (_("About SparkleShare"));

                about_item.Activated += delegate {
                    SparkleAbout about = new SparkleAbout ();
                    about.ShowAll ();
                };

            Menu.Add (about_item);
            Menu.Add (new SeparatorMenuItem ());

                // A menu item that quits the application
                MenuItem quit_item = new MenuItem (_("Quit"));

                quit_item.Activated += delegate {
                    SparkleShare.Controller.Quit ();
                };

            Menu.Add (quit_item);
            Menu.ShowAll ();
        }
Пример #18
0
        // Creates the menu that is popped up when the
        // user clicks the status icon
        public void CreateMenu()
        {
            Menu = new Menu();

            // The menu item showing the status and size of the SparkleShare folder
            MenuItem status_menu_item = new MenuItem(StateText)
            {
                Sensitive = false
            };

            Menu.Add(status_menu_item);
            Menu.Add(new SeparatorMenuItem());

            ImageMenuItem folder_item = new SparkleMenuItem("SparkleShare")
            {
                Image = new Image(SparkleUIHelpers.GetIcon("folder-sparkleshare", 16))
            };

            folder_item.Activated += delegate {
                SparkleShare.Controller.OpenSparkleShareFolder();
            };

            Menu.Add(folder_item);

            if (SparkleShare.Controller.Folders.Count > 0)
            {
                // Creates a menu item for each repository with a link to their logs
                foreach (string path in SparkleShare.Controller.Folders)
                {
                    Gdk.Pixbuf folder_icon = IconTheme.Default.LoadIcon("folder", 16,
                                                                        IconLookupFlags.GenericFallback);

                    ImageMenuItem subfolder_item = new SparkleMenuItem(Path.GetFileName(path))
                    {
                        Image = new Image(folder_icon)
                    };

//						if (repo.HasUnsyncedChanges)
//							folder_action.IconName = "dialog-error";

                    subfolder_item.Activated += OpenEventLogDelegate(path);

                    Menu.Add(subfolder_item);
                }
            }
            else
            {
                MenuItem no_folders_item = new MenuItem(_("No Remote Folders Yet"))
                {
                    Sensitive = false
                };

                Menu.Add(no_folders_item);
            }

            // Opens the wizard to add a new remote folder
            MenuItem sync_item = new MenuItem(_("Add Remote Folder…"));

            if (SparkleShare.Controller.FirstRun)
            {
                sync_item.Sensitive = false;
            }

            sync_item.Activated += delegate {
                Application.Invoke(delegate {
                    if (SparkleUI.Intro == null)
                    {
                        SparkleUI.Intro = new SparkleIntro();
                        SparkleUI.Intro.ShowServerForm(true);
                    }

                    if (!SparkleUI.Intro.Visible)
                    {
                        SparkleUI.Intro.ShowServerForm(true);
                    }

                    SparkleUI.Intro.ShowAll();
                    SparkleUI.Intro.Present();
                });
            };

            Menu.Add(sync_item);
            Menu.Add(new SeparatorMenuItem());

            MenuItem notify_item;

            if (SparkleShare.Controller.NotificationsEnabled)
            {
                notify_item = new MenuItem(_("Turn Notifications Off"));
            }
            else
            {
                notify_item = new MenuItem(_("Turn Notifications On"));
            }

            notify_item.Activated += delegate {
                SparkleShare.Controller.ToggleNotifications();
                CreateMenu();
            };

            Menu.Add(notify_item);
            Menu.Add(new SeparatorMenuItem());

            // A menu item that takes the user to http://www.sparkleshare.org/
            MenuItem about_item = new MenuItem(_("About SparkleShare"));

            about_item.Activated += delegate {
                SparkleAbout about = new SparkleAbout();
                about.ShowAll();
            };

            Menu.Add(about_item);
            Menu.Add(new SeparatorMenuItem());

            // A menu item that quits the application
            MenuItem quit_item = new MenuItem(_("Quit"));

            quit_item.Activated += delegate {
                SparkleShare.Controller.Quit();
            };

            Menu.Add(quit_item);

            Menu.ShowAll();
        }
Пример #19
0
        public SparkleUI()
        {
            using (var a = new NSAutoreleasePool ())
            {
                Catalog.Init ("sparkleshare", Path.Combine (NSBundle.MainBundle.ResourcePath, "Translations"));

                GrowlApplicationBridge.WeakDelegate = this;
                GrowlApplicationBridge.Delegate     = new SparkleGrowlDelegate ();

                NSApplication.SharedApplication.ApplicationIconImage = NSImage.ImageNamed ("sparkleshare-app.icns");

                SetFolderIcon ();

                Setup      = new SparkleSetup ();
                EventLog   = new SparkleEventLog ();
                About      = new SparkleAbout ();
                Bubbles    = new SparkleBubbles ();
                StatusIcon = new SparkleStatusIcon ();

                Program.Controller.UIHasLoaded ();
            }
        }
Пример #20
0
        public SparkleUI()
        {
            // Use translations
            Catalog.Init ("sparkleshare",
                Path.Combine (NSBundle.MainBundle.ResourcePath, "Translations"));

            using (NSAutoreleasePool pool = new NSAutoreleasePool ()) {

                // Needed for Growl
                GrowlApplicationBridge.WeakDelegate = this;
                GrowlApplicationBridge.Delegate = new SparkleGrowlDelegate ();

                NSApplication.SharedApplication.ApplicationIconImage
                    = NSImage.ImageNamed ("sparkleshare.icns");

                SetFolderIcon ();

                Font = NSFontManager.SharedFontManager.FontWithFamily
                    ("Lucida Grande", NSFontTraitMask.Condensed, 0, 13);

                BoldFont = NSFontManager.SharedFontManager.FontWithFamily
                    ("Lucida Grande", NSFontTraitMask.Bold, 0, 13);

                Setup      = new SparkleSetup ();
                EventLog   = new SparkleEventLog ();
                About      = new SparkleAbout ();
                Bubbles    = new SparkleBubbles ();
                StatusIcon = new SparkleStatusIcon ();

                if (Program.Controller.FirstRun)
                    Program.Controller.ShowSetupWindow (PageType.Setup);
            }
        }