Exemple #1
0
    private void createButtons()
    {
        FakeButtonCloseSerialPort = new Gtk.Button();
        Gtk.Button button_close_serial_port = new Gtk.Button("Close serial port (debug)");
        button_close_serial_port.Clicked += new EventHandler(on_button_close_serial_port_clicked);

        Gtk.Button button_OSX_readme = new Gtk.Button("MacOSX Readme");
        button_OSX_readme.Clicked += new EventHandler(on_button_OSX_readme_clicked);

        //---- button close start --->
        Gtk.Button button_close = new Gtk.Button("Close Window");
        button_close.Clicked += new EventHandler(on_button_close_clicked);

        Gtk.AccelGroup ag = new Gtk.AccelGroup();          //button can be called clicking Escape key
        chronopic_register_win.AddAccelGroup(ag);

        button_close.AddAccelerator
            ("activate", ag, new Gtk.AccelKey
                (Gdk.Key.Escape, Gdk.ModifierType.None,
                Gtk.AccelFlags.Visible));
        //<---- button close end

        //add buttons to containers
        Gtk.HButtonBox hbox = new Gtk.HButtonBox();
        //hbox.Add(button_close_serial_port);

        if (UtilAll.GetOSEnum() == UtilAll.OperatingSystems.MACOSX)
        {
            hbox.Add(button_OSX_readme);
        }

        hbox.Add(button_close);

        vbox_main.Add(hbox);
    }
    private void createButtons()
    {
        Frame frame = new Frame();

        frame.ShadowType  = ShadowType.In;
        frame.LabelXalign = 0f;
        frame.LabelYalign = 0.5f;

        frame.Label = Catalog.GetString("There is a known problem on macOS:");
        Gtk.Label label_macOS = new Gtk.Label(
            Catalog.GetString("If Chronopic is disconnected after jumps or runs execution,\nthat port will be blocked until restart of machine."));

        Gtk.VBox vbox_m = new Gtk.VBox();
        vbox_m.PackStart(label_macOS, false, false, 8);

        Gtk.HBox hbox_m = new Gtk.HBox();
        hbox_m.PackStart(vbox_m, false, false, 8);

        if (UtilAll.GetOSEnum() == UtilAll.OperatingSystems.MACOSX)
        {
            frame.Add(hbox_m);
            vbox_main.Add(frame);
        }

        FakeButtonCloseSerialPort = new Gtk.Button();
        Gtk.Button button_close_serial_port = new Gtk.Button("Close serial port (debug)");
        button_close_serial_port.Clicked += new EventHandler(on_button_close_serial_port_clicked);

        //---- button close start --->
        Gtk.Button button_close = new Gtk.Button("Close Window");
        button_close.CanFocus = true;
        button_close.IsFocus  = true;
        button_close.Clicked += new EventHandler(on_button_close_clicked);

        Gtk.AccelGroup ag = new Gtk.AccelGroup();          //button can be called clicking Escape key
        chronopic_register_win.AddAccelGroup(ag);

        button_close.AddAccelerator
            ("activate", ag, new Gtk.AccelKey
                (Gdk.Key.Escape, Gdk.ModifierType.None,
                Gtk.AccelFlags.Visible));
        //<---- button close end

        //add buttons to containers
        Gtk.HButtonBox hbox = new Gtk.HButtonBox();
        //hbox.Add(button_close_serial_port);

        hbox.Add(button_close);

        vbox_main.Add(hbox);
    }
        private void AddButton(string stock_id, Gtk.ResponseType response, bool is_default)
        {
            Gtk.Button button = new Gtk.Button(stock_id);
            button.CanDefault = true;
            button.Show();

            AddActionWidget(button, response);

            if (is_default)
            {
                DefaultResponse = response;
                button.AddAccelerator("activate", accel_group, (uint)Gdk.Key.Return, 0, Gtk.AccelFlags.Visible);
            }
        }
        public VersionInformationDialog()
            : base()
        {
            AccelGroup accel_group = new AccelGroup();
            AddAccelGroup(accel_group);
            Modal = true;

            Button button = new Button("gtk-close");
            button.CanDefault = true;
            button.UseStock = true;
            button.Show();
            DefaultResponse = ResponseType.Close;
            button.AddAccelerator("activate", accel_group, (uint)Gdk.Key.Escape,
                0, Gtk.AccelFlags.Visible);

            AddActionWidget(button, ResponseType.Close);

            Title = Catalog.GetString("Assembly Version Information");
            BorderWidth = 10;

            version_tree = new TreeView();

            version_tree.RulesHint = true;
            version_tree.AppendColumn(Catalog.GetString("Assembly Name"),
                new CellRendererText(), "text", 0);
            version_tree.AppendColumn(Catalog.GetString("Version"),
                new CellRendererText(), "text", 1);

            version_tree.Model = FillStore();
            version_tree.CursorChanged += OnCursorChanged;

            ScrolledWindow scroll = new ScrolledWindow();
            scroll.Add(version_tree);
            scroll.ShadowType = ShadowType.In;
            scroll.SetSizeRequest(420, 200);

            ContentArea.PackStart(scroll, true, true, 0);
            ContentArea.Spacing = 5;

            path_label = new Label();
            path_label.Ellipsize = Pango.EllipsizeMode.End;
            path_label.Hide();
            path_label.Xalign = 0.0f;
            path_label.Yalign = 1.0f;
            ContentArea.PackStart(path_label, false, true, 0);

            scroll.ShowAll();
        }
Exemple #5
0
        private void AddButton(Gtk.Button button, Gtk.ResponseType response, bool is_default)
        {
            button.Show();

            AddActionWidget(button, response);

            if (is_default)
            {
                DefaultResponse = response;
                button.AddAccelerator("activate",
                                      accel_group,
                                      (uint)Gdk.Key.Escape,
                                      0,
                                      Gtk.AccelFlags.Visible);
            }
        }
Exemple #6
0
    private void createButtons()
    {
        label_macOSX      = new Gtk.Label();
        label_macOSX.Text = Catalog.GetString("There is a known problem with MacOSX:") + "\n" +
                            Catalog.GetString("If Chronopic is disconnected after jumps or runs execution,\nthat port will be blocked until restart of machine.") + "\n\n" +
                            Catalog.GetString("We are working on a solution.");
        if (UtilAll.GetOSEnum() == UtilAll.OperatingSystems.MACOSX)
        {
            vbox_main.Add(label_macOSX);
        }

        FakeButtonCloseSerialPort = new Gtk.Button();
        Gtk.Button button_close_serial_port = new Gtk.Button("Close serial port (debug)");
        button_close_serial_port.Clicked += new EventHandler(on_button_close_serial_port_clicked);

        //---- button close start --->
        Gtk.Button button_close = new Gtk.Button("Close Window");
        button_close.Clicked += new EventHandler(on_button_close_clicked);

        Gtk.AccelGroup ag = new Gtk.AccelGroup();          //button can be called clicking Escape key
        chronopic_register_win.AddAccelGroup(ag);

        button_close.AddAccelerator
            ("activate", ag, new Gtk.AccelKey
                (Gdk.Key.Escape, Gdk.ModifierType.None,
                Gtk.AccelFlags.Visible));
        //<---- button close end

        //add buttons to containers
        Gtk.HButtonBox hbox = new Gtk.HButtonBox();
        //hbox.Add(button_close_serial_port);

        hbox.Add(button_close);

        vbox_main.Add(hbox);
    }
        private void AddButton(string stock_id, Gtk.ResponseType response, bool is_default)
        {
            Button button = new Button(stock_id);
            button.CanDefault = true;
            button.Show();

            AddActionWidget(button, response);

            if(is_default) {
                DefaultResponse = response;
                button.AddAccelerator("activate", accel_group, (uint)Gdk.Key.Return, 
                    0, AccelFlags.Visible);
            }
        }
Exemple #8
0
        public StationEditor(DatabaseTrackInfo track)
            : base()
        {
            AccelGroup accel_group = new AccelGroup ();
            AddAccelGroup (accel_group);

            Title = String.Empty;
            SkipTaskbarHint = true;
            Modal = true;

            this.track = track;

            string title = track == null
                ? Catalog.GetString ("Add new radio station")
                : Catalog.GetString ("Edit radio station");

            BorderWidth = 6;
            DefaultResponse = ResponseType.Ok;
            Modal = true;

            ContentArea.Spacing = 6;

            HBox split_box = new HBox ();
            split_box.Spacing = 12;
            split_box.BorderWidth = 6;

            Image image = new Image ();
            image.IconSize = (int)IconSize.Dialog;
            image.IconName = "radio";
            image.Yalign = 0.0f;
            image.Show ();

            VBox main_box = new VBox ();
            main_box.BorderWidth = 5;
            main_box.Spacing = 10;

            Label header = new Label ();
            header.Markup = String.Format ("<big><b>{0}</b></big>", GLib.Markup.EscapeText (title));
            header.Xalign = 0.0f;
            header.Show ();

            Label message = new Label ();
            message.Text = Catalog.GetString ("Enter the Genre, Title and URL of the radio station you wish to add. A description is optional.");
            message.Xalign = 0.0f;
            message.Wrap = true;
            message.Show ();

            table = new Table (5, 2, false);
            table.RowSpacing = 6;
            table.ColumnSpacing = 6;

            genre_entry = ComboBoxText.NewWithEntry ();

            foreach (string genre in ServiceManager.DbConnection.QueryEnumerable<string> ("SELECT DISTINCT Genre FROM CoreTracks ORDER BY Genre")) {
                if (!String.IsNullOrEmpty (genre)) {
                    genre_entry.AppendText (genre);
                }
            }

            if (track != null && !String.IsNullOrEmpty (track.Genre)) {
                genre_entry.Entry.Text = track.Genre;
            }

            AddRow (Catalog.GetString ("Station Genre:"), genre_entry);

            name_entry        = AddEntryRow (Catalog.GetString ("Station Name:"));
            stream_entry      = AddEntryRow (Catalog.GetString ("Stream URL:"));
            creator_entry     = AddEntryRow (Catalog.GetString ("Station Creator:"));
            description_entry = AddEntryRow (Catalog.GetString ("Description:"));

            rating_entry = new RatingEntry ();
            HBox rating_box = new HBox ();
            rating_box.PackStart (rating_entry, false, false, 0);
            AddRow (Catalog.GetString ("Rating:"), rating_box);

            table.ShowAll ();

            main_box.PackStart (header, false, false, 0);
            main_box.PackStart (message, false, false, 0);
            main_box.PackStart (table, false, false, 0);
            main_box.Show ();

            split_box.PackStart (image, false, false, 0);
            split_box.PackStart (main_box, true, true, 0);
            split_box.Show ();

            ContentArea.PackStart (split_box, true, true, 0);

            Button cancel_button = new Button (Stock.Cancel);
            cancel_button.CanDefault = false;
            cancel_button.UseStock = true;
            cancel_button.Show ();
            AddActionWidget (cancel_button, ResponseType.Close);

            cancel_button.AddAccelerator ("activate", accel_group, (uint)Gdk.Key.Escape,
                0, Gtk.AccelFlags.Visible);

            save_button = new Button (Stock.Save);
            save_button.CanDefault = true;
            save_button.UseStock = true;
            save_button.Sensitive = false;
            save_button.Show ();
            AddActionWidget (save_button, ResponseType.Ok);

            save_button.AddAccelerator ("activate", accel_group, (uint)Gdk.Key.Return,
                0, Gtk.AccelFlags.Visible);

            name_entry.HasFocus = true;

            if (track != null) {
                if (!String.IsNullOrEmpty (track.TrackTitle)) {
                    name_entry.Text = track.TrackTitle;
                }

                if (!String.IsNullOrEmpty (track.Uri.AbsoluteUri)) {
                    stream_entry.Text = track.Uri.AbsoluteUri;
                }

                if (!String.IsNullOrEmpty (track.Comment)) {
                    description_entry.Text = track.Comment;
                }

                if (!String.IsNullOrEmpty (track.ArtistName)) {
                    creator_entry.Text = track.ArtistName;
                }

                rating_entry.Value = track.Rating;
            }

            error_container = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
            error_container.TopPadding = 6;
            HBox error_box = new HBox ();
            error_box.Spacing = 4;

            Image error_image = new Image ();
            error_image.Stock = Stock.DialogError;
            error_image.IconSize = (int)IconSize.Menu;
            error_image.Show ();

            error = new Label ();
            error.Xalign = 0.0f;
            error.Show ();

            error_box.PackStart (error_image, false, false, 0);
            error_box.PackStart (error, true, true, 0);
            error_box.Show ();

            error_container.Add (error_box);

            table.Attach (error_container, 0, 2, 6, 7, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            genre_entry.Entry.Changed += OnFieldsChanged;
            name_entry.Changed += OnFieldsChanged;
            stream_entry.Changed += OnFieldsChanged;

            OnFieldsChanged (this, EventArgs.Empty);
        }
        public ProfileConfigurationDialog(Profile profile)
            : base()
        {
            this.profile = profile;

            BorderWidth = 5;

            AccelGroup accel_group = new AccelGroup();
            AddAccelGroup(accel_group);

            Button button = new Button(Stock.Close);
            button.CanDefault = true;
            button.Show();

            if(ApplicationContext.Debugging) {
                Button test_button = new Button("Test S-Expr");
                test_button.Show();
                test_button.Clicked += delegate {
                    if(sexpr_results != null) {
                        sexpr_results.Buffer.Text = profile.Pipeline.GetDefaultProcess();
                    }
                };
                ActionArea.PackStart(test_button, true, true, 0);

                sexpr_results = new TextView();
            }

            AddActionWidget(button, ResponseType.Close);
            DefaultResponse = ResponseType.Close;
            button.AddAccelerator("activate", accel_group, (uint)Gdk.Key.Return,
                0, AccelFlags.Visible);

            BuildContents();

            LoadProfile();
        }
Exemple #10
0
        public Button AddButton (Button button, ResponseType response, bool isDefault)
        {
            AddActionWidget (button, response);

            if (isDefault) {
                DefaultResponse = response;
                button.AddAccelerator ("activate", accel_group, (uint)Gdk.Key.Return, 0, AccelFlags.Visible);
            }

            return button;
        }
		public PreferencesDialog (NoteManager manager) : base(Gtk.WindowType.Toplevel)
		{
			this.addin_manager = manager.AddinManager;
			
			IconName = "tomboy";
			BorderWidth = 5;
			Resizable = true;
			Title = Catalog.GetString ("Tomboy Preferences");
			WindowPosition = WindowPosition.Center;
			
			addin_prefs_dialogs = new Dictionary<string, Gtk.Dialog> ();
			addin_info_dialogs = new Dictionary<string, Gtk.Dialog> ();
			
			// Notebook Tabs (Editing, Hotkeys)...
			
			Gtk.Notebook notebook = new Gtk.Notebook ();
			notebook.TabPos = Gtk.PositionType.Top;
			notebook.Show ();
			
			notebook.AppendPage (MakeEditingPane (), new Gtk.Label (Catalog.GetString ("Editing")));
			
			if (!(Services.Keybinder is NullKeybinder))
				notebook.AppendPage (MakeHotkeysPane (), new Gtk.Label (Catalog.GetString ("Hotkeys")));
			
			notebook.AppendPage (MakeSyncPane (), new Gtk.Label (Catalog.GetString ("Synchronization")));
			notebook.AppendPage (MakeAddinsPane (), new Gtk.Label (Catalog.GetString ("Add-ins")));
			
			// TODO: Figure out a way to have these be placed in a specific order
			foreach (PreferenceTabAddin tabAddin in addin_manager.GetPreferenceTabAddins ()) {
				Logger.Debug ("Adding preference tab addin: {0}", tabAddin.GetType ().Name);
				try {
					string tabName;
					Gtk.Widget tabWidget;
					if (tabAddin.GetPreferenceTabWidget (this, out tabName, out tabWidget) == true) {
						notebook.AppendPage (tabWidget, new Gtk.Label (tabName));
					}
				} catch (Exception e) {
					Logger.Warn ("Problems adding preferences tab addin: {0}", tabAddin.GetType ().Name);
					Logger.Debug ("{0}:\n{1}", e.Message, e.StackTrace);
				}
			}
			Gtk.VBox VBox = new Gtk.VBox ();
			VBox.PackStart (notebook, true, true, 0);
			
			addin_manager.ApplicationAddinListChanged += OnAppAddinListChanged;
			
			// Close Button
			Gtk.Button button = new Gtk.Button (Gtk.Stock.Close);
			button.CanDefault = true;
			button.Label = "Close";
			button.Clicked += OnClickedClose;
			VBox.Add (button);
			button.Show ();
			
			Gtk.AccelGroup accel_group = new Gtk.AccelGroup ();
			AddAccelGroup (accel_group);
			
			button.AddAccelerator ("activate", accel_group, (uint)Gdk.Key.Escape, 0, 0);
			
			this.Add (VBox);
			if ((this.Child != null)) {
				this.Child.ShowAll ();
			}
			this.Show ();
			Preferences.SettingChanged += HandlePreferencesSettingChanged;
		}
Exemple #12
0
        public void InitializeDialog ()
        {
            FillGenreList ();

            AccelGroup accel_group = new AccelGroup ();
            AddAccelGroup (accel_group);

            Title = String.Empty;
            SkipTaskbarHint = true;

            BorderWidth = 6;
            HasSeparator = false;
            DefaultResponse = ResponseType.Ok;

            VBox.Spacing = 6;

            HBox split_box = new HBox ();
            split_box.Spacing = 12;
            split_box.BorderWidth = 6;

            Image image = new Image ();
            image.IconSize = (int)IconSize.Dialog;
            image.IconName = "radio";
            image.Yalign = 0.0f;
            image.Show ();

            VBox main_box = new VBox ();
            main_box.BorderWidth = 5;
            main_box.Spacing = 10;

            Label header = new Label ();
            header.Text = String.Format (AddinManager.CurrentLocalizer.GetString ("{0}Radiostation fetcher{1}\n({2})"),
                "<span weight=\"bold\" size=\"larger\">", "</span>",source_name);
            header.Xalign = 0.0f;
            header.Yalign = 0.0f;
            header.UseMarkup = true;
            header.Wrap = true;
            header.Show ();

            Label message = new Label ();
            message.Text = AddinManager.CurrentLocalizer.GetString ("Choose a genre or enter a text that you wish to be queried, " +
                "then press the Get stations button. Found stations will be added to internet-radio source.");
            message.Xalign = 0.0f;
            message.Wrap = true;
            message.Show ();

            table = new Table (5, 2, false);
            table.RowSpacing = 6;
            table.ColumnSpacing = 6;

            genre_entry = ComboBox.NewText ();
            freeText_entry = new Entry ();

            genre_button = new Button (AddinManager.CurrentLocalizer.GetString ("Get stations"));
            freeText_button = new Button (AddinManager.CurrentLocalizer.GetString ("Get stations"));

            genre_button.CanDefault = true;
            genre_button.UseStock = true;
            genre_button.Clicked += OnGenreQueryButtonClick;
            genre_button.Show ();


            freeText_button.CanDefault = true;
            freeText_button.UseStock = true;
            freeText_button.Clicked += OnFreetextQueryButtonClick;
            freeText_button.Show ();

            foreach (string genre in genre_list) {
                if (!String.IsNullOrEmpty (genre))
                    genre_entry.AppendText (genre);
            }

            if (this is IGenreSearchable) {
                AddRow (AddinManager.CurrentLocalizer.GetString ("Query by genre:"), genre_entry, genre_button);
            }

            if (this is IFreetextSearchable) {
                AddRow (AddinManager.CurrentLocalizer.GetString ("Query by free text:"), freeText_entry, freeText_button);
            }

            table.ShowAll ();

            main_box.PackStart (header, false, false, 0);
            main_box.PackStart (message, false, false, 0);
            main_box.PackStart (table, false, false, 0);
            main_box.Show ();

            split_box.PackStart (image, false, false, 0);
            split_box.PackStart (main_box, true, true, 0);
            split_box.Show ();

            VBox.PackStart (split_box, true, true, 0);

            close_button = new Button ();
            close_button.Image = new Image ("gtk-close", IconSize.Button);
            close_button.Label = AddinManager.CurrentLocalizer.GetString ("_Close");
            close_button.CanDefault = true;
            close_button.UseStock = true;
            close_button.Show ();
            AddActionWidget (close_button, ResponseType.Close);

            close_button.AddAccelerator ("activate", accel_group, (uint)Gdk.Key.Escape,
                0, Gtk.AccelFlags.Visible);

            close_button.Clicked += OnCloseButtonClick;

            statusbar = new Statusbar ();
            statusbar.HasResizeGrip = false;
            SetStatusBarMessage (source_name);
            main_box.PackEnd (statusbar, false, false, 0);
        }
        private void BuildUI()
        {
            // The BorderWidth situation here is a bit nuts b/c the
            // ActionArea's is set to 5.  So we work everything else out
            // so it all totals to 12.
            //
            // WIDGET           BorderWidth
            // Dialog           5
            //   VBox           2
            //     inner_vbox   5 => total = 12
            //     ActionArea   5 => total = 12
            BorderWidth = 5;
            base.VBox.BorderWidth = 0;

            // This spacing is 2 b/c the inner_vbox and ActionArea should be
            // 12 apart, and they already have BorderWidth 5 each
            base.VBox.Spacing = 2;

            inner_vbox = new VBox () { Spacing = 12, BorderWidth = 5, Visible = true };
            base.VBox.PackStart (inner_vbox, true, true, 0);

            Visible = false;
            HasSeparator = false;

            var table = new Table (3, 2, false) {
                RowSpacing = 12,
                ColumnSpacing = 16
            };

            table.Attach (new Image () {
                    IconName = "dialog-error",
                    IconSize = (int)IconSize.Dialog,
                    Yalign = 0.0f
                }, 0, 1, 0, 3, AttachOptions.Shrink, AttachOptions.Fill | AttachOptions.Expand, 0, 0);

            table.Attach (header_label = new Label () { Xalign = 0.0f }, 1, 2, 0, 1,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);

            table.Attach (message_label = new Hyena.Widgets.WrapLabel (), 1, 2, 1, 2,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);

            var scrolled_window = new ScrolledWindow () {
                HscrollbarPolicy = PolicyType.Automatic,
                VscrollbarPolicy = PolicyType.Automatic,
                ShadowType = ShadowType.In
            };

            list_view = new TreeView () {
                HeightRequest = 120,
                WidthRequest = 200
            };
            scrolled_window.Add (list_view);

            table.Attach (details_expander = new Expander (Catalog.GetString ("Details")),
                1, 2, 2, 3,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Fill | AttachOptions.Expand,
                0, 0);
            details_expander.Add (scrolled_window);

            VBox.PackStart (table, true, true, 0);
            VBox.Spacing = 12;
            VBox.ShowAll ();

            accel_group = new AccelGroup ();
            AddAccelGroup (accel_group);

            Button button = new Button (Stock.Close);
            button.CanDefault = true;
            button.UseStock = true;
            button.Show ();
            button.Clicked += (o, a) => {
                Destroy ();
            };

            AddActionWidget (button, ResponseType.Close);

            DefaultResponse = ResponseType.Close;
            button.AddAccelerator ("activate", accel_group, (uint)Gdk.Key.Return, 0, AccelFlags.Visible);
        }
        public ArtistAdder()
            : base()
        {
            string title = Catalog.GetString("Add new SoundCloud artist");

            AccelGroup accel_group = new AccelGroup();
            AddAccelGroup(accel_group);

            Title = title;
            SkipTaskbarHint = true;
            Modal = true;
            BorderWidth = 6;
            HasSeparator = false;
            DefaultResponse = ResponseType.Ok;
            Modal = true;

            VBox.Spacing = 6;

            HBox split_box = new HBox();
            split_box.Spacing = 12;
            split_box.BorderWidth = 6;

            /* TODO:
             * 		Get this bloody image to display.
            Image image = new Image("soundcloud");
            image.IconSize =(int)IconSize.Dialog;
            image.IconName = "soundcloudd";
            image.Yalign = 0.0f;
            image.Show();
            */

            VBox main_box = new VBox();
            main_box.BorderWidth = 5;
            main_box.Spacing = 10;

            Label header = new Label();
            header.Markup = String.Format("<big><b>{0}</b></big>", GLib.Markup.EscapeText(title));
            header.Xalign = 0.0f;
            header.Show();

            Label message = new Label();
            message.Text = Catalog.GetString("Enter the name of the artist you'd like to add.");
            message.Xalign = 0.0f;
            message.Wrap = true;
            message.Show();

            table = new Table(5, 2, false);
            table.RowSpacing = 6;
            table.ColumnSpacing = 6;

            artist_entry = AddEntryRow(Catalog.GetString("Artist Name:"));

            table.ShowAll();

            main_box.PackStart(header, false, false, 0);
            main_box.PackStart(message, false, false, 0);
            main_box.PackStart(table, false, false, 0);
            main_box.Show();

            //split_box.PackStart(image, false, false, 0);
            split_box.PackStart(main_box, true, true, 0);
            split_box.Show();

            VBox.PackStart(split_box, true, true, 0);

            Button cancel_button = new Button(Stock.Cancel);
            cancel_button.CanDefault = false;
            cancel_button.UseStock = true;
            cancel_button.Show();
            AddActionWidget(cancel_button, ResponseType.Close);

            cancel_button.AddAccelerator("activate", accel_group,(uint)Gdk.Key.Escape,
                0, Gtk.AccelFlags.Visible);

            save_button = new Button(Stock.Save);
            save_button.CanDefault = true;
            save_button.UseStock = true;
            save_button.Sensitive = false;
            save_button.Show();
            AddActionWidget(save_button, ResponseType.Ok);

            save_button.AddAccelerator("activate", accel_group,(uint)Gdk.Key.Return,
                0, Gtk.AccelFlags.Visible);

            artist_entry.HasFocus = true;

            error_container = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
            error_container.TopPadding = 6;
            HBox error_box = new HBox();
            error_box.Spacing = 4;

            Image error_image = new Image();
            error_image.Stock = Stock.DialogError;
            error_image.IconSize =(int)IconSize.Menu;
            error_image.Show();

            error = new Label();
            error.Xalign = 0.0f;
            error.Show();

            error_box.PackStart(error_image, false, false, 0);
            error_box.PackStart(error, true, true, 0);
            error_box.Show();

            error_container.Add(error_box);

            table.Attach(error_container, 0, 2, 6, 7, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            artist_entry.Changed += OnFieldsChanged;

            OnFieldsChanged(this, EventArgs.Empty);
        }
Exemple #15
0
        //        Entry sipServerAddressEntry;
        //        Entry sipUsernameEntry;
        //        Entry sipPasswordEntry;
        public PreferencesDialog()
            : base()
        {
            SetDefaultSize (600, 600);
            WindowPosition = WindowPosition.Center;
            IconName = "rtc";
            HasSeparator = false;
            BorderWidth = 5;
            Resizable = true;
            Title = Catalog.GetString ("Banter Preferences");

            VBox.Spacing = 5;
            ActionArea.Layout = ButtonBoxStyle.End;

            // Notebook Tabs (General, Messages)...
            Gtk.Notebook notebook = new Notebook ();
            notebook.TabPos = PositionType.Top;
            notebook.BorderWidth = 5;
            notebook.Show ();

            //			notebook.AppendPage (MakeGeneralPage (),
            //									new Label (Catalog.GetString ("General")));
            notebook.AppendPage (MakeAccountsPage (),
                                    new Label (Catalog.GetString ("Accounts")));
            notebook.AppendPage (MakeMessagesPage (),
                                    new Label (Catalog.GetString ("Messages")));

            VBox.PackStart (notebook, true, true, 0);

            // Close button...
            Button button = new Button (Stock.Close);
            button.CanDefault = true;
            button.Show ();

            AccelGroup accelGroup = new AccelGroup ();
            AddAccelGroup (accelGroup);

            button.AddAccelerator ("activate",
                                    accelGroup,
                                    (uint) Gdk.Key.Escape,
                                    0,
                                    0);

            AddActionWidget (button, ResponseType.Close);
            DefaultResponse = ResponseType.Close;

            Realized += DialogRealized;

            Preferences.PreferenceChanged += PreferenceChanged;

            ShowAll ();
        }