public SetupStepComPortManual()
        {
            FlowLayoutWidget printerComPortContainer = createComPortContainer();

            contentRow.AddChild(printerComPortContainer);

            //Construct buttons
            nextButton         = textImageButtonFactory.Generate("Done".Localize());
            nextButton.Click  += (s, e) => UiThread.RunOnIdle(Parent.Close);
            nextButton.Visible = false;

            connectButton        = textImageButtonFactory.Generate("Connect".Localize());
            connectButton.Click += ConnectButton_Click;

            refreshButton        = textImageButtonFactory.Generate("Refresh".Localize());
            refreshButton.Click += (s, e) => WizardWindow.ChangeToPage <SetupStepComPortManual>();

            //Add buttons to buttonContainer
            footerRow.AddChild(nextButton);
            footerRow.AddChild(connectButton);
            footerRow.AddChild(refreshButton);
            footerRow.AddChild(new HorizontalSpacer());
            footerRow.AddChild(cancelButton);

            PrinterConnectionAndCommunication.Instance.CommunicationStateChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents);
        }
Exemplo n.º 2
0
        public ShowAuthPanel()
        {
            TextWidget userLoginPromptLabel = new TextWidget("Would you like to sign in to access your cloud\nprinter profiles?")
            {
                PointSize = 12,
                TextColor = ActiveTheme.Instance.PrimaryTextColor,
            };

            contentRow.AddChild(userLoginPromptLabel);

            var nextButton = textImageButtonFactory.Generate("Skip");

            nextButton.Name   = "Connection Wizard Skip Sign In Button";
            nextButton.Click += (sender, e) =>
            {
                WizardWindow.ChangeToPage <SetupStepMakeModelName>();
            };

            var signInButton = textImageButtonFactory.Generate("Sign In");

            signInButton.Name   = "Sign In From Connection Wizard Button";
            signInButton.Click += (s, e) =>
            {
                WizardWindow.ShowAuthDialog?.Invoke();
                UiThread.RunOnIdle(WizardWindow.Close);
            };

            footerRow.AddChild(nextButton);
            footerRow.AddChild(new HorizontalSpacer());
            footerRow.AddChild(signInButton);
        }
Exemplo n.º 3
0
        public ShowAuthPanel()
        {
            WrappedTextWidget userLoginPromptLabel = new WrappedTextWidget("Sign in to access your cloud printer profiles.\n\nOnce signed in you will be able to access:".Localize())
            {
                TextColor = ActiveTheme.Instance.PrimaryTextColor,
            };

            contentRow.AddChild(userLoginPromptLabel);

            AddBulletPointAndDescription(contentRow,
                                         "Cloud Library".Localize(),
                                         "Save your designs to the cloud and access them from anywhere in the world. You can also share them any time with with anyone you want.".Localize());
            AddBulletPointAndDescription(contentRow,
                                         "Cloud Printer Profiles".Localize(),
                                         "Create your machine settings once, and have them available anywhere you want to print. All your changes appear on all your devices.".Localize());
            AddBulletPointAndDescription(contentRow,
                                         "Remote Monitoring".Localize(),
                                         "Check on your prints from anywhere. With cloud monitoring, you have access to your printer no matter where you go.".Localize());

            var skipButton = textImageButtonFactory.Generate("Skip".Localize());

            skipButton.Name   = "Connection Wizard Skip Sign In Button";
            skipButton.Click += (sender, e) =>
            {
                if (!ProfileManager.Instance.ActiveProfiles.Any())
                {
                    WizardWindow.ChangeToPage <SetupStepMakeModelName>();
                }
                else
                {
                    UiThread.RunOnIdle(WizardWindow.Close);
                }
            };
            var createAccountButton = textImageButtonFactory.Generate("Create Account".Localize());

            createAccountButton.Name   = "Create Account From Connection Wizard Button";
            createAccountButton.Margin = new Agg.BorderDouble(right: 5);
            createAccountButton.Click += (s, e) =>
            {
                WizardWindow.ChangeToAccountCreate();
                UiThread.RunOnIdle(WizardWindow.Close);
            };

            var signInButton = textImageButtonFactory.Generate("Sign In".Localize());

            signInButton.Name   = "Sign In From Connection Wizard Button";
            signInButton.Click += (s, e) =>
            {
                WizardWindow.ShowAuthDialog?.Invoke();
                UiThread.RunOnIdle(WizardWindow.Close);
            };

            footerRow.AddChild(skipButton);
            footerRow.AddChild(new HorizontalSpacer());
            footerRow.AddChild(createAccountButton);
            footerRow.AddChild(signInButton);
        }
Exemplo n.º 4
0
        public SetupStepComPortOne()
        {
            contentRow.AddChild(createPrinterConnectionMessageContainer());
            {
                //Construct buttons
                nextButton        = textImageButtonFactory.Generate("Continue".Localize());
                nextButton.Click += (s, e) => WizardWindow.ChangeToPage <SetupStepComPortTwo>();

                //Add buttons to buttonContainer
                footerRow.AddChild(nextButton);
                footerRow.AddChild(new HorizontalSpacer());
                footerRow.AddChild(cancelButton);
            }
        }
        public FlowLayoutWidget createPrinterConnectionMessageContainer()
        {
            FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.TopToBottom);

            container.VAnchor = VAnchor.ParentBottomTop;
            container.Margin  = new BorderDouble(5);
            BorderDouble elementMargin = new BorderDouble(top: 5);

            string     printerMessageOneText = "MatterControl will now attempt to auto-detect printer.".Localize();
            TextWidget printerMessageOne     = new TextWidget(printerMessageOneText, 0, 0, 10);

            printerMessageOne.Margin    = new BorderDouble(0, 10, 0, 5);
            printerMessageOne.TextColor = ActiveTheme.Instance.PrimaryTextColor;
            printerMessageOne.HAnchor   = HAnchor.ParentLeftRight;
            printerMessageOne.Margin    = elementMargin;

            string     disconnectMessage = string.Format("1.) {0} ({1}).", "Disconnect printer".Localize(), "if currently connected".Localize());
            TextWidget printerMessageTwo = new TextWidget(disconnectMessage, 0, 0, 12);

            printerMessageTwo.TextColor = ActiveTheme.Instance.PrimaryTextColor;
            printerMessageTwo.HAnchor   = HAnchor.ParentLeftRight;
            printerMessageTwo.Margin    = elementMargin;

            string     printerMessageThreeTxtBeg  = "Press".Localize();
            string     printerMessageThreeTxtEnd  = "Continue".Localize();
            string     printerMessageThreeTxtFull = string.Format("2.) {0} '{1}'.", printerMessageThreeTxtBeg, printerMessageThreeTxtEnd);
            TextWidget printerMessageThree        = new TextWidget(printerMessageThreeTxtFull, 0, 0, 12);

            printerMessageThree.TextColor = ActiveTheme.Instance.PrimaryTextColor;
            printerMessageThree.HAnchor   = HAnchor.ParentLeftRight;
            printerMessageThree.Margin    = elementMargin;

            string     printerMessageFourBeg  = "Power on and connect printer".Localize();
            string     printerMessageFourFull = string.Format("3.) {0}.", printerMessageFourBeg);
            TextWidget printerMessageFour     = new TextWidget(printerMessageFourFull, 0, 0, 12);

            printerMessageFour.TextColor = ActiveTheme.Instance.PrimaryTextColor;
            printerMessageFour.HAnchor   = HAnchor.ParentLeftRight;
            printerMessageFour.Margin    = elementMargin;

            string     printerMessageFiveTxtBeg  = "Press".Localize();
            string     printerMessageFiveTxtEnd  = "Connect".Localize();
            string     printerMessageFiveTxtFull = string.Format("4.) {0} '{1}'.", printerMessageFiveTxtBeg, printerMessageFiveTxtEnd);
            TextWidget printerMessageFive        = new TextWidget(printerMessageFiveTxtFull, 0, 0, 12);

            printerMessageFive.TextColor = ActiveTheme.Instance.PrimaryTextColor;
            printerMessageFive.HAnchor   = HAnchor.ParentLeftRight;
            printerMessageFive.Margin    = elementMargin;

            GuiWidget vSpacer = new GuiWidget();

            vSpacer.VAnchor = VAnchor.ParentBottomTop;

            Button manualLink = linkButtonFactory.Generate("Manual Configuration".Localize());

            manualLink.Margin = new BorderDouble(0, 5);
            manualLink.Click += (s, e) => WizardWindow.ChangeToPage <SetupStepComPortManual>();

            printerErrorMessage = new TextWidget("", 0, 0, 10);
            printerErrorMessage.AutoExpandBoundsToText = true;
            printerErrorMessage.TextColor = RGBA_Bytes.Red;
            printerErrorMessage.HAnchor   = HAnchor.ParentLeftRight;
            printerErrorMessage.Margin    = elementMargin;

            container.AddChild(printerMessageOne);
            container.AddChild(printerMessageTwo);
            container.AddChild(printerMessageThree);
            container.AddChild(printerMessageFour);
            container.AddChild(printerMessageFive);
            container.AddChild(printerErrorMessage);
            container.AddChild(vSpacer);
            container.AddChild(manualLink);

            container.HAnchor = HAnchor.ParentLeftRight;
            return(container);
        }
Exemplo n.º 6
0
        public FlowLayoutWidget createPrinterConnectionMessageContainer()
        {
            FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.TopToBottom);

            container.VAnchor = VAnchor.ParentBottomTop;
            container.Margin  = new BorderDouble(5);
            BorderDouble elementMargin = new BorderDouble(top: 5);

            TextWidget printerMessageOne = new TextWidget(LocalizedString.Get("MatterControl will now attempt to auto-detect printer."), 0, 0, 10);

            printerMessageOne.Margin    = new BorderDouble(0, 10, 0, 5);
            printerMessageOne.TextColor = ActiveTheme.Instance.PrimaryTextColor;
            printerMessageOne.HAnchor   = HAnchor.ParentLeftRight;
            printerMessageOne.Margin    = elementMargin;

            string     printerMessageTwoTxt     = LocalizedString.Get("Disconnect printer");
            string     printerMessageTwoTxtEnd  = LocalizedString.Get("if currently connected");
            string     printerMessageTwoTxtFull = string.Format("1.) {0} ({1}).", printerMessageTwoTxt, printerMessageTwoTxtEnd);
            TextWidget printerMessageTwo        = new TextWidget(printerMessageTwoTxtFull, 0, 0, 12);

            printerMessageTwo.TextColor = ActiveTheme.Instance.PrimaryTextColor;
            printerMessageTwo.HAnchor   = HAnchor.ParentLeftRight;
            printerMessageTwo.Margin    = elementMargin;

            string     printerMessageThreeTxt    = LocalizedString.Get("Press");
            string     printerMessageThreeTxtEnd = LocalizedString.Get("Continue");
            string     printerMessageThreeFull   = string.Format("2.) {0} '{1}'.", printerMessageThreeTxt, printerMessageThreeTxtEnd);
            TextWidget printerMessageThree       = new TextWidget(printerMessageThreeFull, 0, 0, 12);

            printerMessageThree.TextColor = ActiveTheme.Instance.PrimaryTextColor;
            printerMessageThree.HAnchor   = HAnchor.ParentLeftRight;
            printerMessageThree.Margin    = elementMargin;

            GuiWidget vSpacer = new GuiWidget();

            vSpacer.VAnchor = VAnchor.ParentBottomTop;

            string     setupManualConfigurationOrSkipConnectionText     = LocalizedString.Get(("You can also"));
            string     setupManualConfigurationOrSkipConnectionTextFull = String.Format("{0}:", setupManualConfigurationOrSkipConnectionText);
            TextWidget setupManualConfigurationOrSkipConnectionWidget   = new TextWidget(setupManualConfigurationOrSkipConnectionTextFull, 0, 0, 10);

            setupManualConfigurationOrSkipConnectionWidget.TextColor = ActiveTheme.Instance.PrimaryTextColor;
            setupManualConfigurationOrSkipConnectionWidget.HAnchor   = HAnchor.ParentLeftRight;
            setupManualConfigurationOrSkipConnectionWidget.Margin    = elementMargin;

            Button manualLink = linkButtonFactory.Generate(LocalizedString.Get("Manually Configure Connection"));

            manualLink.Margin = new BorderDouble(0, 5);
            manualLink.Click += (s, e) => WizardWindow.ChangeToPage <SetupStepComPortManual>();

            string     printerMessageFourText = LocalizedString.Get("or");
            TextWidget printerMessageFour     = new TextWidget(printerMessageFourText, 0, 0, 10);

            printerMessageFour.TextColor = ActiveTheme.Instance.PrimaryTextColor;
            printerMessageFour.HAnchor   = HAnchor.ParentLeftRight;
            printerMessageFour.Margin    = elementMargin;

            Button skipConnectionLink = linkButtonFactory.Generate(LocalizedString.Get("Skip Connection Setup"));

            skipConnectionLink.Margin = new BorderDouble(0, 8);
            skipConnectionLink.Click += SkipConnectionLink_Click;

            container.AddChild(printerMessageOne);
            container.AddChild(printerMessageTwo);
            container.AddChild(printerMessageThree);
            container.AddChild(vSpacer);
            container.AddChild(setupManualConfigurationOrSkipConnectionWidget);
            container.AddChild(manualLink);
            container.AddChild(printerMessageFour);
            container.AddChild(skipConnectionLink);

            container.HAnchor = HAnchor.ParentLeftRight;
            return(container);
        }
Exemplo n.º 7
0
        public SetupStepMakeModelName()
        {
            printerManufacturerSelector = new BoundDropList(string.Format("- {0} -", "Select Make".Localize()), maxHeight: 200)
            {
                HAnchor    = HAnchor.ParentLeftRight,
                Margin     = elementMargin,
                Name       = "Select Make",
                ListSource = OemSettings.Instance.AllOems,
                TabStop    = true
            };

            printerManufacturerSelector.SelectionChanged += ManufacturerDropList_SelectionChanged;

            printerMakeContainer = CreateSelectionContainer(
                "Make".Localize() + ":",
                "Select the printer manufacturer".Localize(),
                printerManufacturerSelector);

            if (printerManufacturerSelector.MenuItems.Count == 1)
            {
                activeMake = printerManufacturerSelector.SelectedValue;
            }

            printerModelSelector = new BoundDropList(string.Format("- {0} -", "Select Model".Localize()), maxHeight: 200)
            {
                Name    = "Select Model",
                HAnchor = HAnchor.ParentLeftRight,
                Margin  = elementMargin,
                TabStop = true
            };
            printerModelSelector.SelectionChanged += ModelDropList_SelectionChanged;

            if (printerModelSelector.MenuItems.Count == 1)
            {
                // SelectIfOnlyOneModel
                printerModelSelector.SelectedIndex = 0;
            }

            printerModelContainer = CreateSelectionContainer("Model".Localize() + ":", "Select the printer model".Localize(), printerModelSelector);

            //Add inputs to main container
            contentRow.AddChild(printerMakeContainer);
            contentRow.AddChild(printerModelContainer);
            contentRow.AddChild(createPrinterNameContainer());

            //Construct buttons
            nextButton        = textImageButtonFactory.Generate("Save & Continue".Localize());
            nextButton.Name   = "Save & Continue Button";
            nextButton.Click += async(s, e) =>
            {
                bool controlsValid = this.ValidateControls();
                if (controlsValid)
                {
                    bool profileCreated = await ProfileManager.CreateProfileAsync(activeMake, activeModel, activeName);

                    if (!profileCreated)
                    {
                        this.printerNameError.Text    = "Error creating profile".Localize();
                        this.printerNameError.Visible = true;
                        return;
                    }

                    LoadCalibrationPrints();

#if __ANDROID__
                    WizardWindow.ChangeToPage <AndroidConnectDevicePage>();
#else
                    if (OsInformation.OperatingSystem == OSType.Windows)
                    {
                        WizardWindow.ChangeToPage <SetupStepInstallDriver>();
                    }
                    else
                    {
                        WizardWindow.ChangeToPage <SetupStepComPortOne>();
                    }
#endif
                }
            };

            //Add buttons to buttonContainer
            footerRow.AddChild(nextButton);
            footerRow.AddChild(new HorizontalSpacer());
            footerRow.AddChild(cancelButton);

            usingDefaultName = true;

            SetElementVisibility();
        }
        public SetupStepMakeModelName()
        {
            printerManufacturerSelector = new BoundDropList(string.Format("- {0} -", "Select Make".Localize()), maxHeight: 200)
            {
                HAnchor    = HAnchor.ParentLeftRight,
                Margin     = elementMargin,
                Name       = "Select Make",
                ListSource = OemSettings.Instance.AllOems
            };

            printerManufacturerSelector.SelectionChanged += ManufacturerDropList_SelectionChanged;

            printerMakeContainer = CreateSelectionContainer(
                "Make".Localize() + ":",
                "Select the printer manufacturer".Localize(),
                printerManufacturerSelector);

            if (printerManufacturerSelector.MenuItems.Count == 1)
            {
                ActivePrinter.Make = printerManufacturerSelector.SelectedValue;
            }

            printerModelSelector = new BoundDropList(string.Format("- {0} -", "Select Model".Localize()), maxHeight: 200)
            {
                Name    = "Select Model",
                HAnchor = HAnchor.ParentLeftRight,
                Margin  = elementMargin,
            };
            printerModelSelector.SelectionChanged += ModelDropList_SelectionChanged;

            if (printerModelSelector.MenuItems.Count == 1)
            {
                // SelectIfOnlyOneModel
                printerModelSelector.SelectedIndex = 0;
            }

            printerModelContainer = CreateSelectionContainer("Model".Localize(), "Select the printer model".Localize(), printerModelSelector);

            //Add inputs to main container
            contentRow.AddChild(printerMakeContainer);
            contentRow.AddChild(printerModelContainer);
            contentRow.AddChild(createPrinterNameContainer());

            //Construct buttons
            nextButton        = textImageButtonFactory.Generate("Save & Continue".Localize());
            nextButton.Name   = "Save & Continue Button";
            nextButton.Click += (s, e) =>
            {
                bool canContinue = this.OnSave();
                if (canContinue)
                {
#if __ANDROID__
                    WizardWindow.ChangeToPage <AndroidConnectDevicePage>();
#else
                    WizardWindow.ChangeToPage <SetupStepInstallDriver>();
#endif
                }
            };

            //Add buttons to buttonContainer
            footerRow.AddChild(nextButton);
            footerRow.AddChild(new HorizontalSpacer());
            footerRow.AddChild(cancelButton);

            usingDefaultName = true;

            SetElementVisibility();
        }