protected override void CreateBody() { CreateBody(Translator.GetString("Choose your users")); WrapLabel footer = new WrapLabel { Markup = string.Format(Translator.GetString( "Users are the people logging into this system. By adding separate logins you can track the activity of the individuals and restrict their access. To create your users quickly use the form bellow. To edit your users later go to:{0}{1}{0}{0}To edit the user permissions that each user has go to:{0}{2}"), Environment.NewLine, new PangoStyle { Italic = true, Bold = true, Text = Translator.GetString("Edit->Users...") }, new PangoStyle { Italic = true, Bold = true, Text = Translator.GetString("Edit->Administration->Permissions...") }) }; footer.Show(); vboBody.PackStart(footer, false, true, 0); tbl = new Table(1, 1, false) { RowSpacing = 4, ColumnSpacing = 4 }; Alignment alignment = new Alignment(.5f, .5f, 1f, 1f) { TopPadding = 20 }; alignment.Add(tbl); alignment.ShowAll(); vboBody.PackStart(alignment, true, true, 0); RefreshUsersTable(); }
protected override void CreateBody() { CreateBody(Translator.GetString("Add your peripheral devices")); XML form = FormHelper.LoadGladeXML("SetupAssistant.StepAddDevices.glade", "tblRoot"); form.Autoconnect(this); chkReceiptPrinter.Label = Translator.GetString("I have a cash receipt printer"); chkKitchenPrinter.Label = Translator.GetString("I have a kitchen printer"); chkExtDisplay.Label = Translator.GetString("I have an external display connected to this computer"); chkScale.Label = Translator.GetString("I have an electronic scale connected to this computer"); chkCardReader.Label = Translator.GetString("I have a card reader connected to the serial port"); vboBody.PackStart(tblRoot, true, true, 6); chkReceiptPrinter.Toggled += chkReceiptPrinter_Toggled; chkKitchenPrinter.Toggled += chkKitchenPrinter_Toggled; chkExtDisplay.Toggled += chkExtDisplay_Toggled; chkScale.Toggled += chkScale_Toggled; chkCardReader.Toggled += chkCardReader_Toggled; try { initializing = true; RefreshDevcesTable(algReceiptPrinter, DeviceType.CashReceiptPrinter, chkReceiptPrinter); RefreshDevcesTable(algKitchenPrinter, DeviceType.KitchenPrinter, chkKitchenPrinter); RefreshDevcesTable(algExtDisplay, DeviceType.ExternalDisplay, chkExtDisplay); RefreshDevcesTable(algScale, DeviceType.ElectronicScale, chkScale); RefreshDevcesTable(algCardReader, DeviceType.CardReader, chkCardReader); } finally { initializing = false; } WrapLabel footer = new WrapLabel { Markup = string.Format(Translator.GetString("To change the device settings later go to:{0}{1}"), Environment.NewLine, new PangoStyle { Italic = true, Bold = true, Text = Translator.GetString("Edit->Devices...") }) }; footer.Show(); vboBody.PackStart(footer, true, true, 4); }
protected override void CreateBody() { CreateBody(Translator.GetString("Welcome to the database assistant")); wlbBody = new WrapLabel { Markup = new PangoStyle { Size = PangoStyle.TextSize.Large, Text = Translator.GetString("This assistant will help you setup your new database so you can start working right away. If you don't need help from the assistant, you can press \"Finish\" at any time and complete the setup of your entities yourself.") } }; wlbBody.Show(); vboBody.PackStart(wlbBody, true, true, 0); }
protected override void CreateBody() { CreateBody(string.Format(Translator.GetString("Welcome to the {0} setup assistant"), DataHelper.ProductName)); WrapLabel message = new WrapLabel { Markup = new PangoStyle { Size = PangoStyle.TextSize.Large, Text = string.Format(Translator.GetString("This assistant will help you setup {0} so you can start working right away. If you don't need help from this assistant, you can press \"Finish\" at any time and complete the setup of {0} yourself."), DataHelper.ProductName) } }; message.Show(); vboBody.PackStart(message, true, true, 10); }
private void InitializeEntries() { KeyValuePair <CreateDatabaseType, string> [] samples = new [] { new KeyValuePair <CreateDatabaseType, string> (CreateDatabaseType.SampleRestaurant, Translator.GetString("Restaurant")), new KeyValuePair <CreateDatabaseType, string> (CreateDatabaseType.SampleStore, Translator.GetString("Store")) }; lblDescription = new WrapLabel(); lblDescription.Show(); algSampleDescription.Add(lblDescription); cboSampleType.Load(samples, "Key", "Value"); cboSampleType.Changed += cboSampleType_Changed; cboSampleType_Changed(null, EventArgs.Empty); rbtSampleDb.Toggled += rbtSampleDb_Toggled; rbtSampleDb_Toggled(null, EventArgs.Empty); foreach (TypeExtensionNode node in AddinManager.GetExtensionNodes("/Warehouse/Presentation/DatabaseCreator")) { IDatabaseCreator creator = (IDatabaseCreator)node.CreateInstance(); RadioButton rbtn = new RadioButton(rbtBlankDb) { Label = creator.Type }; rbtn.Toggled += (sender, args) => { if (rbtn.Active) { lblDescription.Text = creator.Description; } }; rbtn.Show(); vbxAdditionalTypes.PackStart(rbtn, false, true, 0); customCreators.Add(new KeyValuePair <RadioButton, IDatabaseCreator> (rbtn, creator)); } }
protected override void InitializeForm() { XML form = FormHelper.LoadGladeXML("Dialogs.Message.glade", "dlgMessage"); form.Autoconnect(this); dlgMessage.Icon = string.IsNullOrEmpty(dialogIcon) ? FormHelper.LoadImage("Icons.AppMain16.png").Pixbuf : FormHelper.LoadImage(dialogIcon).Pixbuf; dlgMessage.Title = title; if (!string.IsNullOrEmpty(messageIcon)) { Image image = FormHelper.LoadImage(messageIcon); algDialogIcon.Add(image); image.Show(); } lblDialogMessage = new WrapLabel(); lblDialogMessage.Text = message; lblDialogMessage.Show(); algDialogMessage.Add(lblDialogMessage); btnOK.SetChildImage(FormHelper.LoadImage("Icons.Ok24.png")); btnRetry.SetChildImage(FormHelper.LoadImage("Icons.Retry24.png")); btnCancel.SetChildImage(FormHelper.LoadImage("Icons.Cancel24.png")); btnYes.SetChildImage(FormHelper.LoadImage("Icons.Ok24.png")); btnNo.SetChildImage(FormHelper.LoadImage("Icons.Cancel24.png")); btnRestart.SetChildImage(FormHelper.LoadImage("Icons.Retry24.png")); Buttons = MessageButtons.OK; base.InitializeForm(); InitializeFormStrings(); }
protected override void CreateBody() { CreateBody(Translator.GetString("Enter your company information")); WrapLabel footer = new WrapLabel { Markup = string.Format(Translator.GetString( "This information will be printed on the documents you issue. If you want to change that information later go to:{0}{1}"), Environment.NewLine, new PangoStyle { Italic = true, Bold = true, Text = Translator.GetString("Edit->Administration->Company information...") }) }; footer.Show(); vboBody.PackStart(footer, false, true, 0); panel = new EditNewCompanyRecordPanel(CompanyRecord.GetDefault()); panel.Show(); vboBody.PackStart(panel, true, true, 10); }
protected override void CreateBody() { CreateBody(Translator.GetString("Choose your locations")); WrapLabel footer = new WrapLabel { Markup = string.Format(Translator.GetString( "Locations are used for your physical locations where you store items, place orders, or make purchases from. To create the locations quickly use the form bellow. To edit your locations later go to:{0}{1}"), Environment.NewLine, new PangoStyle { Italic = true, Bold = true, Text = Translator.GetString("Edit->Locations...") }) }; footer.Show(); vboBody.PackStart(footer, false, true, 0); if (schemas.Count == 0) { foreach (TypeExtensionNode node in AddinManager.GetExtensionNodes("/Warehouse/Presentation/SetupAssistant/LocationsSetup")) { object instance = node.CreateInstance(); LocationsSetup schema = instance as LocationsSetup; if (schema != null) { schemas.Add(schema); } } schemas.Sort((p1, p2) => Math.Max(-1, Math.Min(1, p1.Ordinal - p2.Ordinal))); } if (schemas.Count > 1) { nbkMain = new Notebook(); foreach (LocationsSetup schema in schemas) { Label lblTab = new Label(schema.Label) { Xpad = 4 }; Widget page = schema.GetPageWidget(); page.Show(); Alignment alg = new Alignment(.5f, .5f, 1f, 1f) { LeftPadding = 4, RightPadding = 4, TopPadding = 4, BottomPadding = 4 }; alg.Add(page); alg.Show(); EventBox evb = new EventBox { alg }; evb.Show(); nbkMain.AppendPage(evb, lblTab); } nbkMain.Show(); vboBody.PackStart(nbkMain, true, true, 10); } else if (schemas.Count == 1) { Widget page = schemas [0].GetPageWidget(); page.Show(); Alignment alg = new Alignment(.5f, .5f, 1f, 1f) { LeftPadding = 4, RightPadding = 4, TopPadding = 4, BottomPadding = 4 }; alg.Add(page); alg.Show(); vboBody.PackStart(alg, true, true, 10); } }
protected override void CreateBody() { CreateBody(Translator.GetString("What is the main purpose of this workstation?")); List <PurposeBase> allPurposes = new List <PurposeBase> (); foreach (TypeExtensionNode node in AddinManager.GetExtensionNodes("/Warehouse/Presentation/SetupAssistant/Purpose")) { object instance = node.CreateInstance(); PurposeBase purpose = instance as PurposeBase; if (purpose != null) { allPurposes.Add(purpose); } } allPurposes.Sort((p1, p2) => Math.Max(-1, Math.Min(1, p1.Ordinal - p2.Ordinal))); HBox hbo = new HBox(); hbo.Show(); vboBody.PackStart(hbo, true, true, 6); VBox vbo = new VBox(); vbo.Show(); hbo.PackStart(vbo, true, true, 4); algImage = new Alignment(.5f, .5f, 1f, 1f) { WidthRequest = 220 }; algImage.Show(); hbo.PackStart(algImage, false, true, 4); RadioButton group = null; bool activeSet = false; foreach (PurposeBase purpose in allPurposes) { Widget rbtn = purpose.GetSelectionWidget(ref group); rbtn.Show(); purpose.Toggled += rbtn_Toggled; vbo.PackStart(rbtn, false, true, 4); choices.Add(purpose); if (activeSet) { continue; } activeSet = true; purpose.Active = true; rbtn_Toggled(rbtn, EventArgs.Empty); } WrapLabel footer = new WrapLabel { Markup = string.Format(Translator.GetString( "The selection here will determine the content displayed when {1} is started. To change this later please go to:{0}{2}"), Environment.NewLine, DataHelper.ProductName, new PangoStyle { Italic = true, Bold = true, Text = Translator.GetString("Other->Settings->Special->Startup->Startup page") }) }; footer.Show(); vboBody.PackStart(footer, true, true, 4); }
private void BuildTile() { BorderWidth = 5; RowSpacing = 1; ColumnSpacing = 5; Image image = new Image(); image.IconName = "package-x-generic"; image.IconSize = (int)IconSize.Dnd; image.Yalign = 0.0f; image.Show(); Attach(image, 0, 1, 0, 3, AttachOptions.Shrink, AttachOptions.Fill | AttachOptions.Expand, 0, 0); title = new Label(); SetLabelStyle(title); title.Show(); title.Xalign = 0.0f; title.Markup = String.Format("<b>{0}</b>", GLib.Markup.EscapeText(addin.Name)); Attach(title, 1, 3, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0); description = new WrapLabel(); SetLabelStyle(description); description.Show(); description.Text = addin.Description.Description; description.Wrap = false; Attach(description, 1, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0); authors = new WrapLabel(); SetLabelStyle(authors); authors.Markup = String.Format( "<small><b>{0}</b> <i>{1}</i></small>", Catalog.GetString("Authors:"), GLib.Markup.EscapeText(addin.Description.Author) ); Attach(authors, 1, 2, 2, 3, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 4); button_box = new VBox(); HBox box = new HBox(); box.Spacing = 3; button_box.PackEnd(box, false, false, 0); Pango.FontDescription font = PangoContext.FontDescription.Copy(); font.Size = (int)(font.Size * Pango.Scale.Small); Label label = new Label("Details"); label.ModifyFont(font); details_button = new Button(); details_button.Add(label); details_button.Clicked += OnDetailsClicked; box.PackStart(details_button, false, false, 0); label = new Label(); label.ModifyFont(font); activate_button = new Button(); activate_button.Add(label); activate_button.Clicked += OnActivateClicked; box.PackStart(activate_button, false, false, 0); Attach(button_box, 2, 3, 2, 3, AttachOptions.Shrink, AttachOptions.Expand | AttachOptions.Fill, 0, 0); Show(); UpdateState(); }
protected override void CreateBody() { CreateBody(Translator.GetString("How do you want to handle the taxes?")); #region VAT or Sales tax WrapLabel lblVATorTax = new WrapLabel { Markup = new PangoStyle { Size = PangoStyle.TextSize.Large, Text = Translator.GetString("Are you using VAT or Sales tax?") } }; lblVATorTax.Show(); vboBody.PackStart(lblVATorTax, true, true, 5); rbnVAT = new RadioButton(Translator.GetString("VAT")); rbnSalesTax = new RadioButton(rbnVAT, Translator.GetString("Sales tax")); rbnVAT.Toggled += rbnVAT_Toggled; HBox hbo = new HBox { Spacing = 10 }; hbo.PackStart(rbnVAT, false, true, 0); hbo.PackStart(rbnSalesTax, false, true, 0); hbo.ShowAll(); vboBody.PackStart(hbo, false, true, 5); #endregion HSeparator hs = new HSeparator(); hs.Show(); vboBody.PackStart(hs, true, true, 2); #region Default tax WrapLabel lblTaxRateTitle = new WrapLabel { Markup = new PangoStyle { Size = PangoStyle.TextSize.Large, Text = Translator.GetString("What is the dafault tax rate you want to use?") } }; lblTaxRateTitle.Show(); vboBody.PackStart(lblTaxRateTitle, true, true, 5); Label lblTaxRate = new Label { Markup = new PangoStyle { Text = Translator.GetString("Rate:") } }; defaultVatGroup = VATGroup.GetById(VATGroup.DefaultVATGroupId); txtTaxRate = new Entry { Text = Percent.ToEditString(defaultVatGroup.VatValue) }; txtTaxRate.WidthChars = 10; txtTaxRate.Alignment = 1; hbo = new HBox { Spacing = 10 }; hbo.PackStart(lblTaxRate, false, true, 0); hbo.PackStart(txtTaxRate, false, true, 0); hbo.ShowAll(); vboBody.PackStart(hbo, false, true, 5); #endregion hs = new HSeparator(); hs.Show(); vboBody.PackStart(hs, true, true, 2); #region With or without VAT WrapLabel lblPrices = new WrapLabel { Markup = new PangoStyle { Size = PangoStyle.TextSize.Large, Text = Translator.GetString("How do you want to use the prices in the application? Choose which value you want to round your prices to.") } }; lblPrices.Show(); vboBody.PackStart(lblPrices, true, true, 5); rbnWithVAT = new RadioButton(Translator.GetString("With VAT")); rbnWithoutVAT = new RadioButton(rbnWithVAT, Translator.GetString("Without VAT")); hbo = new HBox { Spacing = 10 }; hbo.PackStart(rbnWithVAT, false, true, 0); hbo.PackStart(rbnWithoutVAT, false, true, 0); hbo.ShowAll(); vboBody.PackStart(hbo, false, true, 5); lblNote = new WrapLabel { Text = Translator.GetString("Note: You can easely add or subtract VAT after you enter the prices in the operation, using the buttons on the right.") }; lblNote.Show(); vboBody.PackStart(lblNote, true, true, 5); #endregion }
protected override void CreateBody() { CreateBody(Translator.GetString("Choose your items")); WrapLabel footer = new WrapLabel { Markup = string.Format(Translator.GetString( "Items are used to describe the goods and services that you purchase and sell. To modify your items later go to:{0}{1}"), Environment.NewLine, new PangoStyle { Italic = true, Bold = true, Text = Translator.GetString("Edit->Items...") }) }; footer.Show(); vboBody.PackStart(footer, false, true, 0); if (setups.Count == 0) { foreach (TypeExtensionNode node in AddinManager.GetExtensionNodes("/Warehouse/Presentation/SetupAssistant/ItemsSetup")) { object instance = node.CreateInstance(); ItemsSetup setup = instance as ItemsSetup; if (setup != null) { setups.Add(setup); } } setups.Sort((p1, p2) => Math.Max(-1, Math.Min(1, p1.Ordinal - p2.Ordinal))); } nbkMain = new Notebook(); if (setups.Count > 0) { foreach (ItemsSetup setup in setups) { Label lblTab = new Label(setup.Label) { Xpad = 4 }; Widget page = setup.GetPageWidget(); page.Show(); Alignment alg = new Alignment(.5f, .5f, 1f, 1f) { LeftPadding = 4, RightPadding = 4, TopPadding = 4, BottomPadding = 4 }; alg.Add(page); alg.Show(); EventBox evb = new EventBox { alg }; evb.Show(); nbkMain.AppendPage(evb, lblTab); } nbkMain.Show(); } vboBody.PackStart(nbkMain, true, true, 10); wlbError = new WrapLabel(); vboBody.PackStart(wlbError, false, true, 0); pgbProgress = new ProgressBar { Fraction = 0.00 }; vboBody.PackEnd(pgbProgress, false, true, 2); lblProgress = new Label(); vboBody.PackEnd(lblProgress, false, true, 4); }