コード例 #1
0
        private void StartMainApplication()
        {
            WPFDoEvents.SetHourglassCursor();

            // Initialise the web browser
            try
            {
                splashscreen_window.UpdateMessage("Installing browser components");
                GeckoInstaller.CheckForInstall();
                splashscreen_window.UpdateMessage("Initialising browser components");
                GeckoManager.Initialise();
                GeckoManager.RegisterPDFInterceptor();
            }
            catch (Exception ex)
            {
                Logging.Error(ex, "Problem initialising GeckoFX.");
            }

            // Fire up Qiqqa!
            splashscreen_window.UpdateMessage("Starting background processes");
            StartDaemonSingletons();

            splashscreen_window.UpdateMessage("Launching Qiqqa!");
            FireStartUseFeature();
            MainWindow window = new MainWindow();

            window.Show();

            Hide();
        }
コード例 #2
0
        internal void RefreshSyncControl(SyncControlGridItemSet scgis_previous, SyncControl sync_control)
        {
            WPFDoEvents.SetHourglassCursor();

            SafeThreadPool.QueueUserWorkItem(o =>
            {
                //
                // Explicitly instruct the sync info collector to perform a swift scan, which DOES NOT include
                // collecting the precise size of every document in every Qiqqa library (which itself is a *significant*
                // file system load when you have any reasonably large libraries like I do.          [GHo]
                //
                // TODO: fetch and cache document filesizes in the background, so we can improve on the accuracy of
                // our numbers in a future call to this method.
                //
                GlobalSyncDetail global_sync_detail = GenerateGlobalSyncDetail(tally_library_storage_size: false);
                WPFDoEvents.InvokeInUIThread(() =>
                {
                    WPFDoEvents.ResetHourglassCursor();

                    SyncControlGridItemSet scgis = new SyncControlGridItemSet(scgis_previous.sync_request, global_sync_detail);
                    scgis.AutoTick();
                    sync_control.SetSyncParameters(scgis);
                });
            });
        }
コード例 #3
0
        public void RequestSync(SyncRequest sync_request)
        {
            bool user_wants_intervention = KeyboardTools.IsCTRLDown() || !ConfigurationManager.Instance.ConfigurationRecord.SyncTermsAccepted;

            WPFDoEvents.SetHourglassCursor();

            SafeThreadPool.QueueUserWorkItem(o =>
            {
                GlobalSyncDetail global_sync_detail = GenerateGlobalSyncDetail();
                WPFDoEvents.InvokeInUIThread(() =>
                {
                    WPFDoEvents.ResetHourglassCursor();

                    SyncControlGridItemSet scgis = new SyncControlGridItemSet(sync_request, global_sync_detail);
                    scgis.AutoTick();

                    if (scgis.CanRunWithoutIntervention() && !user_wants_intervention)
                    {
                        Sync(scgis);
                    }
                    else
                    {
                        SyncControl sync_control = new SyncControl();
                        sync_control.SetSyncParameters(scgis);
                        sync_control.Show();
                    }
                });
            });
        }
コード例 #4
0
        private void StartMainApplication()
        {
            WPFDoEvents.AssertThisCodeIsRunningInTheUIThread();
            WPFDoEvents.SetHourglassCursor();

            // Initialise the web browser
            try
            {
                StatusManager.Instance.UpdateStatus("AppStart", "Installing browser components");
                GeckoInstaller.CheckForInstall();
                StatusManager.Instance.UpdateStatus("AppStart", "Initialising browser components");
                GeckoManager.Initialise();
                GeckoManager.RegisterPDFInterceptor();
            }
            catch (Exception ex)
            {
                Logging.Error(ex, "Problem initialising GeckoFX.");
            }

            // Fire up Qiqqa!
            StatusManager.Instance.UpdateStatus("AppStart", "Starting background processes");
            SafeThreadPool.QueueUserWorkItem(o =>
            {
                StartDaemonSingletons();
            });

            StatusManager.Instance.UpdateStatus("AppStart", "Launching Qiqqa!");
            FireStartUseFeature();
            MainWindow window = new MainWindow();

            window.Show();

            Hide();
        }
コード例 #5
0
        public MainWindow()
        {
            MainWindowServiceDispatcher.Instance.MainWindow = this;

            //Theme.Initialize(); -- already done in StandardWindow base class

            InitializeComponent();

            Application.Current.SessionEnding += Current_SessionEnding;
            Application.Current.Exit          += Current_Exit;

            HourglassState = 2;
            WPFDoEvents.SetHourglassCursor();

            DataContext = ConfigurationManager.Instance.ConfigurationRecord_Bindable;

            // Set a DEV title if necessary
            Title = String.Format("Qiqqa v{0}", ClientVersion.CurrentBuild);
            if (WebsiteAccess.IsTestEnvironment)
            {
                Title = String.Format("Qiqqa v{0} (TEST ENVIRONMENT)", ClientVersion.CurrentBuild);
            }

            DockingManager.WindowIcon  = Icons.GetAppIconICO(Icons.Qiqqa);
            DockingManager.OwnerWindow = this;

            DockingManager.AddContent(TITLE_START_PAGE, TITLE_START_PAGE, Icons.GetAppIcon(Icons.ModuleStartPage), false, true, ObjStartPage);
            DockingManager.MakeActive(TITLE_START_PAGE);

            ObjStatusBar.Background     = ThemeColours.Background_Brush_Blue_LightToDark;
            ObjTabBackground.Background = ThemeColours.Background_Brush_Blue_VeryDark;

            SizeChanged += MainWindow_SizeChanged;
            KeyUp       += MainWindow_KeyUp;

            //Unloaded += MainWindow_Unloaded;
            Dispatcher.ShutdownStarted += Dispatcher_ShutdownStarted;
            Closing += MainWindow_Closing;
            Closed  += MainWindow_Closed;

            // We've looked for the LAST event that triggers dependably at the start of the application:
            //   ContentRendered
            // is the last one triggered of this bunch:
            //
            //this.Activated += MainWindow_Activated;
            ContentRendered += MainWindow_ContentRendered;
            //this.Initialized += MainWindow_Initialized;
            //this.LayoutUpdated += MainWindow_LayoutUpdated;
            //this.Loaded += MainWindow_Loaded;
            //this.ManipulationCompleted += MainWindow_ManipulationCompleted;
            //this.ManipulationStarting += MainWindow_ManipulationStarting;
            //this.SourceInitialized += MainWindow_SourceInitialized;
            //this.StateChanged += MainWindow_StateChanged;

            WebLibraryManager.Instance.WebLibrariesChanged += Instance_WebLibrariesChanged;
        }
コード例 #6
0
        internal void RefreshSyncControl(SyncControlGridItemSet scgis_previous, SyncControl sync_control)
        {
            WPFDoEvents.SetHourglassCursor();

            SafeThreadPool.QueueUserWorkItem(o =>
            {
                GlobalSyncDetail global_sync_detail = GenerateGlobalSyncDetail();
                WPFDoEvents.InvokeInUIThread(() =>
                {
                    WPFDoEvents.ResetHourglassCursor();

                    SyncControlGridItemSet scgis = new SyncControlGridItemSet(scgis_previous.sync_request, global_sync_detail);
                    scgis.AutoTick();
                    sync_control.SetSyncParameters(scgis);
                });
            });
        }
コード例 #7
0
        public void RequestSync(SyncRequest sync_request)
        {
            WPFDoEvents.AssertThisCodeIsRunningInTheUIThread();

            bool user_wants_intervention = KeyboardTools.IsCTRLDown() || !ConfigurationManager.Instance.ConfigurationRecord.SyncTermsAccepted;

            WPFDoEvents.SetHourglassCursor();

            SafeThreadPool.QueueUserWorkItem(o =>
            {
                //
                // Explicitly instruct the sync info collector to perform a swift scan, which DOES NOT include
                // collecting the precise size of every document in every Qiqqa library (which itself is a *significant*
                // file system load when you have any reasonably large libraries like I do.          [GHo]
                //
                // TODO: fetch and cache document filesizes in the background, so we can improve on the accuracy
                // of our numbers in a future call to this method.
                //
                GlobalSyncDetail global_sync_detail = GenerateGlobalSyncDetail(tally_library_storage_size: false);
                WPFDoEvents.InvokeInUIThread(() =>
                {
                    WPFDoEvents.ResetHourglassCursor();

                    SyncControlGridItemSet scgis = new SyncControlGridItemSet(sync_request, global_sync_detail);
                    scgis.AutoTick();

                    if (scgis.CanRunWithoutIntervention() && !user_wants_intervention)
                    {
                        Sync(scgis);
                    }
                    else
                    {
                        SyncControl sync_control = new SyncControl();
                        sync_control.SetSyncParameters(scgis);
                        sync_control.Show();
                    }
                });
            });
        }
コード例 #8
0
        public MainWindow()
        {
            MainWindowServiceDispatcher.Instance.MainWindow = this;

            Theme.Initialize();

            InitializeComponent();

            WPFDoEvents.SetHourglassCursor();

            DataContext = ConfigurationManager.Instance.ConfigurationRecord_Bindable;

            // Set a DEV title if necessary
            Title = String.Format("Qiqqa v{0}", ClientVersion.CurrentBuild);
            if (WebsiteAccess.IsTestEnvironment)
            {
                Title = String.Format("Qiqqa v{0} (TEST ENVIRONMENT)", ClientVersion.CurrentBuild);
            }

            // Check that we actually are fitting on the user's screen
            if (Left > SystemParameters.VirtualScreenWidth || Width > SystemParameters.FullPrimaryScreenWidth)
            {
                Left  = 0;
                Width = SystemParameters.FullPrimaryScreenWidth;
            }
            if (Top > SystemParameters.VirtualScreenHeight || Height > SystemParameters.FullPrimaryScreenHeight)
            {
                Top    = 0;
                Height = SystemParameters.FullPrimaryScreenHeight;
            }

            DockingManager.WindowIcon  = Icons.GetAppIconICO(Icons.Qiqqa);
            DockingManager.OwnerWindow = this;

            DockingManager.AddContent(TITLE_START_PAGE, TITLE_START_PAGE, Icons.GetAppIcon(Icons.ModuleStartPage), false, true, ObjStartPage);
            DockingManager.MakeActive(TITLE_START_PAGE);

            ObjStatusBar.Background     = ThemeColours.Background_Brush_Blue_LightToDark;
            ObjTabBackground.Background = ThemeColours.Background_Brush_Blue_VeryDark;

            SizeChanged += MainWindow_SizeChanged;
            KeyUp       += MainWindow_KeyUp;

            Closing += MainWindow_Closing;
            Closed  += MainWindow_Closed;

            // We've looked for the LAST event that triggers dependably at the start of the application:
            //   ContentRendered
            // is the last one triggered of this bunch:
            //
            //this.Activated += MainWindow_Activated;
            ContentRendered += MainWindow_ContentRendered;
            //this.Initialized += MainWindow_Initialized;
            //this.LayoutUpdated += MainWindow_LayoutUpdated;
            //this.Loaded += MainWindow_Loaded;
            //this.ManipulationCompleted += MainWindow_ManipulationCompleted;
            //this.ManipulationStarting += MainWindow_ManipulationStarting;
            //this.SourceInitialized += MainWindow_SourceInitialized;
            //this.StateChanged += MainWindow_StateChanged;

            // Put this in a background thread
            SafeThreadPool.QueueUserWorkItem(o => PostStartupWork());
        }
コード例 #9
0
        private void StartMainApplication()
        {
            WPFDoEvents.AssertThisCodeIsRunningInTheUIThread();

            // prevent invocation loop via close() call at the end of this function body:
            if (StandardWindowFactory.Has(nameof(MainWindow)))
            {
                return;
            }

            WPFDoEvents.SetHourglassCursor();

            ConfigurationManager.Instance.BaseDirectoryForQiqqaIsFixedFromNowOn = true;

            // Initialise the web browser
            try
            {
                StatusManager.Instance.UpdateStatus("AppStart", "Installing browser components");
                GeckoInstaller.CheckForInstall();
                StatusManager.Instance.UpdateStatus("AppStart", "Initialising browser components");
                GeckoManager.Initialise();
                GeckoManager.RegisterPDFInterceptor();
            }
            catch (Exception ex)
            {
                Logging.Error(ex, "Problem initialising GeckoFX.");
            }

            Logging.Info("Log the config+stats again now that we are sure to have loaded the working configuration:");
            ComputerStatistics.LogCommonStatistics(ConfigurationManager.GetCurrentConfigInfos());

            // Fire up Qiqqa!
            SafeThreadPool.QueueUserWorkItem(o =>
            {
                try
                {
                    // Perform any upgrade paths that we must
                    StatusManager.Instance.UpdateStatus("AppStart", "Upgrading old libraries");
                    UpgradeManager.RunUpgrades();

#if false
                    Thread.Sleep(15000);
#endif

                    StatusManager.Instance.UpdateStatus("AppStart", "Starting background processes");
                    WebLibraryManager.Instance.Kick();
                }
                catch (Exception ex)
                {
                    Logging.Error(ex, "Problem while starting up the Qiqqa core.");
                }
            });

            StatusManager.Instance.UpdateStatus("AppStart", "Launching Qiqqa!");
            FireStartUseFeature();

            StandardWindowFactory.Create(nameof(MainWindow), () =>
            {
                MainWindow window = new MainWindow();

                window.Show();

                return(window);
            });

            Hide();
            Close();
        }