Ejemplo n.º 1
0
        void HandleSendButtonClicked(object sender, EventArgs e)
        {
            string email = mailEntry.Text;

            if (!ValidateEmail(email))
            {
                mailWarningLabel.Show();
                mailEntry.GrabFocus();
                return;
            }
            mailWarningLabel.Hide();

            if (textEntry.Buffer.Text.Length == 0)
            {
                bodyWarningLabel.Show();
                textEntry.GrabFocus();
                return;
            }

            FeedbackService.SendFeedback(email, textEntry.Buffer.Text);

            mainFrame.Remove(mainBox);
            mainBox.Destroy();

            Gtk.VBox box = new Gtk.VBox(false, 18);
            box.PackStart(new Gtk.Label(), true, true, 0); // Filler
            string txt = "<big>" + GettextCatalog.GetString("Thank you for your feedback!") + "</big>";

            Gtk.Label lab = new Gtk.Label();
            lab.Markup = txt;
            box.PackStart(lab, false, false, 0);

            lab = new Gtk.Label(GettextCatalog.GetString("Feedbacks sent: {0}", FeedbackService.FeedbacksSent));
            box.PackStart(lab, false, false, 0);

            box.PackStart(new Gtk.Label(), true, true, 0); // Filler
            box.ShowAll();

            mainFrame.Add(box);
            GLib.Timeout.Add(1000, delegate
            {
                Close();
                return(false);
            });
            sent = true;
        }
Ejemplo n.º 2
0
        void UpdatePointerTextBox(Gtk.Entry entry, ValueReference r)
        {
            pointerFrame.Remove(pointerFrame.Child);

            subEditor = new ObjectGroupEditor();
            Gtk.Alignment alignment = new Gtk.Alignment(0.5F, 0.5F, 0.0F, 0.8F);
            try {
                Project.GetFileWithLabel(entry.Text.Trim());
                subEditor.SetObjectGroup(Project.GetDataType <ObjectGroup>(r.GetStringValue()));
                subEditor.ShowAll();
                alignment.Add(subEditor);
                r.SetValue(entry.Text.Trim());
            }
            catch (InvalidLookupException) {
                subEditor.SetObjectGroup(null);
                Gtk.Label label = new Gtk.Label("Error: label \"" + entry.Text + "\" not found.");
                label.Show();
                alignment.Add(label);
            }
            pointerFrame.Label = entry.Text;
            pointerFrame.Add(alignment);
            pointerFrame.ShowAll();
        }