public static void Create(IFuse fuse, IObservable <Unit> doneLoadingMainWindow, BehaviorSubject <bool> showSetupGuide)
        {
            var showSublimeNotification   = new BehaviorSubject <bool>(false);
            var dontCheckForSublimePlugin = UserSettings.Bool("DontCheckForSublimePlugin").AutoInvalidate();

            Application.Desktop.CreateSingletonWindow(
                isVisible: showSublimeNotification.CombineLatest(doneLoadingMainWindow, (show, _) => show),
                window: dialog => new Window
            {
                Title   = Observable.Return("No editor plugin detected"),
                Size    = Optional.Some(Property.Constant(Optional.Some(new Size <Points>(600, 270)))),
                Content = Control.Lazy(() => CreateContent(showSublimeNotification, showSetupGuide, dontCheckForSublimePlugin))
                          .WithBackground(Theme.PanelBackground),
                Background = Theme.PanelBackground,
                Foreground = Theme.DefaultText,
                Border     = Separator.MediumStroke,
            });

            dontCheckForSublimePlugin
            .Select(v => v.Or(false))
            .Where(v => !v)
            .Take(1)
            .SubscribeOn(TaskPoolScheduler.Default)
            .Subscribe(_ => Task.Run(() =>
            {
                if (new SublimePlugin(fuse.ModulesDir).Status == ComponentStatus.NotInstalled)
                {
                    showSublimeNotification.OnNext(true);
                }
            }));
        }
示例#2
0
        public static void Create(IFuse fuse, Subject <Unit> startedAndroidPreview)
        {
            var showNotification    = new BehaviorSubject <bool>(false);
            var dontCheckForAndroid = UserSettings.Bool("DontCheckForAndroid").AutoInvalidate();

            Application.Desktop.CreateSingletonWindow(
                isVisible: showNotification,
                window: dialog => new Window
            {
                Title   = Observable.Return("No Android tools detected"),
                Size    = Optional.Some(Property.Constant(Optional.Some(new Size <Points>(600, 270)))),
                Content = Control.Lazy(() => CreateContent(showNotification, dontCheckForAndroid))
                          .WithBackground(Theme.PanelBackground),
                Background = Theme.PanelBackground,
                Foreground = Theme.DefaultText,
                Border     = Separator.MediumStroke,
            });

            startedAndroidPreview
            .Take(1)
            .WithLatestFromBuffered(dontCheckForAndroid.Select(v => v.Or(false)), (_, v) => v)
            .Where(v => !v)
            .SubscribeOn(TaskPoolScheduler.Default)
            .Subscribe(_ =>
                       Task.Run(() =>
            {
                if (new AndroidInstaller().Status == ComponentStatus.NotInstalled)
                {
                    showNotification.OnNext(true);
                }
            }));
        }
示例#3
0
 static IControl Pane(string name, IEditorFactory editorFactory, Func <IEditorFactory, IControl> content)
 {
     return(Pane(name, editorFactory, content, lazy: false,
                 // Store expanded state as "Expand <name>" : "true", remove from settings when false
                 expanded: UserSettings
                 .Bool("Expand " + name)
                 .OrFalse()));
 }
示例#4
0
        public LogView(IObservable <string> mainLogStream, IObservable <IBinaryMessage> deviceMessages, ErrorView errorView)
        {
            var showLog = UserSettings.Bool("ShowLog").OrTrue();

            IsExpanded = showLog;

            var logChanged  = new Subject <Unit>();
            var logTab      = new LogViewTab("Log", CreateLogView(mainLogStream, deviceMessages, logChanged), logChanged.Select(_ => true));
            var problemsTab = new LogViewTab("Problems", errorView.Create(), errorView.NotifyUser);

            var activeTab = new BehaviorSubject <LogViewTab>(logTab);

            TabHeader  = LogViewHeader.CreateHeader(new[] { logTab, problemsTab }, activeTab, showLog);
            TabContent = activeTab
                         .Select(tab => tab.Content)
                         .Switch();
        }
示例#5
0
 internal Debug(IProject project)
 {
     _project = project;
     _alwaysShowDebugMenuSetting = UserSettings.Bool("AlwaysShowDebugMenu");
 }