Inheritance: System.Windows.Forms.Form
Example #1
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 ();
        }
Example #2
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 ();
            }
        }
Example #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();
        }
Example #4
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);

                StatusIcon = new SparkleStatusIcon();
                Bubbles    = new SparkleBubbles();

                if (Program.Controller.FirstRun)
                {
                    Setup = new SparkleSetup();
                    Setup.Controller.ShowSetupPage();
                }
            }
        }
Example #5
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();
            }
        }
Example #6
0
        public SparkleUI()
        {
            Application.Init();

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

            Program.Controller.UIHasLoaded();
        }
Example #7
0
        public SparkleUI()
        {
            Application.Init ();

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

            Program.Controller.UIHasLoaded ();
        }
Example #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 SparkleEventLog ();
            About      = new SparkleAbout ();
            Bubbles    = new SparkleBubbles ();
            StatusIcon = new SparkleStatusIcon ();

            Program.Controller.UIHasLoaded ();
        }
Example #9
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();
        }
Example #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 ();
        }
Example #11
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();
        }
Example #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 ();
        }
Example #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();
        }
Example #14
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);
        }
Example #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 ();
            }
        }
Example #16
0
        public SparkleUI()
        {
            // Initialize the application
            Application.Init ();

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

            // Create the statusicon
            StatusIcon = new SparkleStatusIcon ();

            if (SparkleShare.Controller.FirstRun) {
                Setup = new SparkleSetup ();
                Setup.Controller.ShowSetupPage ();
            }

            SparkleShare.Controller.OnQuitWhileSyncing += delegate {
                // TODO: Pop up a warning when quitting whilst syncing
            };
        }
Example #17
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();
            }
        }
Example #18
0
        public SparkleUI()
        {
            // Initialize the application
            Application.Init();

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

            StatusIcon = new SparkleStatusIcon();
            Bubbles    = new SparkleBubbles();

            if (Program.Controller.FirstRun)
            {
                Setup = new SparkleSetup();
                Setup.Controller.ShowSetupPage();
            }

            Program.Controller.OnQuitWhileSyncing += delegate {
                // TODO: Pop up a warning when quitting whilst syncing
            };
        }
Example #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 ();
            }
        }
Example #20
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();
            }
        }
Example #21
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);

                StatusIcon = new SparkleStatusIcon ();
                Bubbles = new SparkleBubbles ();

                if (Program.Controller.FirstRun) {
                    Setup = new SparkleSetup ();
                    Setup.Controller.ShowSetupPage ();
                }
            }
        }
Example #22
0
        public SparkleUI()
        {
            string content_path = Directory.GetParent (
                System.AppDomain.CurrentDomain.BaseDirectory).ToString ();

            string app_path     = Directory.GetParent (content_path).ToString ();
            string growl_path   = Path.Combine (app_path, "Frameworks", "Growl.framework", "Growl");

            // Needed for Growl
            Dlfcn.dlopen (growl_path, 0);
            NSApplication.Init ();

            // Use translations
            Catalog.Init ("sparkleshare",
                Path.Combine (NSBundle.MainBundle.ResourcePath, "Translations"));

            using (NSAutoreleasePool pool = new NSAutoreleasePool ()) {

                // Needed for Growl
                GrowlApplicationBridge.WeakDelegate = this;

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

                if (!Program.Controller.BackendIsPresent) {
                    this.alert = new SparkleAlert ();
                    this.alert.RunModal ();
                    return;
                }

                SetFolderIcon ();

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

                StatusIcon = new SparkleStatusIcon ();
                Bubbles = new SparkleBubbles ();

                if (Program.Controller.FirstRun) {
                    Setup = new SparkleSetup ();
                    Setup.Controller.ShowSetupPage ();
                }
            }
        }