コード例 #1
0
        /// <summary>
        /// server gui stuff:
        /// server path
        /// server username + password
        /// check server ssl certificate yes/no
        /// </summary>
        /// <param name="insertTo"></param>
        /// <param name="defaultSpacing"></param>
        void SetupGuiServerRelated(Gtk.Box insertTo, int defaultSpacing)
        {
            Gtk.Table customBox = new Gtk.Table(3, 2, false);

            // somehow you can't change the default spacing or set it for all rows
            for (int i = 0; i < 3; i++)
            {
                customBox.SetRowSpacing((uint)i, (uint)defaultSpacing);
            }

            // insert the labels
            customBox.Attach(new Gtk.Label(Catalog.GetString("Server path:")), 0, 1, 0, 1);
            customBox.Attach(new Gtk.Label(Catalog.GetString("Username:"******"Password:"******"SaveConfiguration" is called
            //IPropertyEditor serverEditor = Services.Factory.CreatePropertyEditorEntry(
            //	AddinPreferences.SYNC_PRIVATENOTES_SERVERPATH, server_path);
            //serverEditor.Setup();

            server_user = new Gtk.Entry();
            customBox.Attach(server_user, 1, 2, 1, 2);
            string serverUser = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_SERVERUSER) as String;

            server_user.Text = serverUser;
            // NO EDITOR! because we only save when "SaveConfiguration" is called
            //IPropertyEditor userEditor = Services.Factory.CreatePropertyEditorEntry(
            // AddinPreferences.SYNC_PRIVATENOTES_SERVERUSER, server_user);
            //userEditor.Setup();

            server_pass = new Gtk.Entry();
            server_pass.InvisibleChar = '*';
            server_pass.Visibility    = false;
            customBox.Attach(server_pass, 1, 2, 2, 3);
            string serverpass = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_SERVERPASS) as String;

            server_pass.Text = serverpass;
            // NO EDITOR! because we only save when "SaveConfiguration" is called
            //IPropertyEditor passEditor = Services.Factory.CreatePropertyEditorEntry(
            // AddinPreferences.SYNC_PRIVATENOTES_SERVERPASS, server_pass);
            //passEditor.Setup();

            check_ssl = new Gtk.CheckButton(Catalog.GetString("Check servers SSL certificate"));
            insertTo.PackStart(check_ssl);

            // set up check-ssl certificate stuff
            object value = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_SERVERCHECKSSLCERT);

            if (value == null || value.Equals(true))
            {
                check_ssl.Active = true;
            }
        }
コード例 #2
0
    void reset_hbox_list_d(int colsNum)
    {
        foreach (Gtk.SpinButton sp in hbox_list_d.Children)
        {
            hbox_list_d.Remove(sp);
        }

        for (int i = 0; i < colsNum; i++)
        {
            switch (i)
            {
            case 0:
                hbox_list_d.PackStart(spin_d_0, false, false, 0);
                break;

            case 1:
                hbox_list_d.PackStart(spin_d_1, false, false, 0);
                break;

            case 2:
                hbox_list_d.PackStart(spin_d_2, false, false, 0);
                break;

            case 3:
                hbox_list_d.PackStart(spin_d_3, false, false, 0);
                break;

            case 4:
                hbox_list_d.PackStart(spin_d_4, false, false, 0);
                break;

            case 5:
                hbox_list_d.PackStart(spin_d_5, false, false, 0);
                break;

            case 6:
                hbox_list_d.PackStart(spin_d_6, false, false, 0);
                break;

            case 7:
                hbox_list_d.PackStart(spin_d_7, false, false, 0);
                break;

            case 8:
                hbox_list_d.PackStart(spin_d_8, false, false, 0);
                break;

            case 9:
                hbox_list_d.PackStart(spin_d_9, false, false, 0);
                break;
            }
        }
        hbox_list_d.ShowAll();
    }
コード例 #3
0
    private void createComboSelect()
    {
        combo_select = ComboBox.NewText();

        selectArray = new ArrayList(jumpTypes.Length);
        string [] jumpNamesToCombo = new String [jumpTypes.Length];
        int       i = 0;

        foreach (string jumpType in jumpTypes)
        {
            string [] j = jumpType.Split(new char[] { ':' });
            string    nameTranslated = Catalog.GetString(j[1]);

            jumpNamesToCombo[i] = nameTranslated;
            i++;

            ArrayList options = new ArrayList(3);
            options.Add("startIn:" + j[2]);                     //startIn
            options.Add("weight:" + j[3]);                      //weight
            options.Add("description:" + j[4]);                 //description
            TrCombo tc = new TrCombo(
                Convert.ToInt32(j[0]), j[1],                    //uniqueID, name
                nameTranslated, options);
            selectArray.Add(tc);
        }

        UtilGtk.ComboUpdate(combo_select, jumpNamesToCombo, "");
        combo_select.Active = 0;

        hbox_combo_select.PackStart(combo_select, true, true, 0);
        hbox_combo_select.ShowAll();
    }
コード例 #4
0
    private void createComboSpeciallities(int sportID)
    {
        combo_speciallities = ComboBox.NewText();
        speciallities       = SqliteSpeciallity.SelectAll(true, sportID);   //show undefined, filter by sport

        //first value has to be any
        speciallities[0] = "-1:" + Constants.Any + ":" + Catalog.GetString(Constants.Any);

        //create speciallities translated, only with translated stuff
        speciallitiesTranslated = new String[speciallities.Length];
        int i = 0;

        foreach (string row in speciallities)
        {
            string [] myStrFull = row.Split(new char[] { ':' });
            speciallitiesTranslated[i++] = myStrFull[2];
        }

        //sort array (except first row)
        System.Array.Sort(speciallities, 1, speciallities.Length - 1);

        UtilGtk.ComboUpdate(combo_speciallities, speciallitiesTranslated, "");
        combo_speciallities.Active = UtilGtk.ComboMakeActive(speciallitiesTranslated,
                                                             Catalog.GetString(Constants.Any));

        hbox_combo_speciallities.PackStart(combo_speciallities, true, true, 0);
        hbox_combo_speciallities.ShowAll();
        combo_speciallities.Sensitive = true;
        combo_speciallities.Changed  += new EventHandler(on_combo_other_changed);
        UtilGtk.ComboPackShowAndSensitive(hbox_combo_speciallities, combo_speciallities);
    }
コード例 #5
0
        static void gtml_import_full(object obj, EventArgs args)
        {
            Gtk.Dialog dialog = new Gtk.Dialog("Full Import", window, dflags);
            Gtk.Grid   dgrid  = new Gtk.Grid();
            Gtk.FileChooserButton[] import =
            {
                new Gtk.FileChooserButton("Full",    fcact),
                new Gtk.FileChooserButton("Partial", fcact),
                new Gtk.FileChooserButton("Link",    fcact),
                null
            };
            Gtk.Button[] importb =
            {
                new Gtk.Button("Full"),
                new Gtk.Button("Partial"),
                new Gtk.Button("Link"),
                null
            };

            //importb[0].TooltipText ("Moves all the application\'s information from its current location.");
            //importb[1].TooltipText ("Copies all the application\'s information from its current location.");
            //importb[2].TooltipText ("Links the application to the program.");

            dgrid.ColumnHomogeneous = true;

            dgrid.Attach(importb[0], 0, 0, 1, 1);
            dgrid.Attach(importb[1], 1, 0, 1, 1);
            dgrid.Attach(importb[2], 2, 0, 1, 1);
            dgrid.Attach(import[0], 0, 1, 1, 1);
            dgrid.Attach(import[1], 1, 1, 1, 1);
            dgrid.Attach(import[2], 2, 1, 1, 1);

            Gtk.Box dbox = dialog.ContentArea;
            dbox.PackStart(dgrid, true, true, 0);

            dialog.ShowAll();
            import[0].Hide();
            import[1].Hide();
            import[2].Hide();

            /*
             * g_signal_connect_swapped (tbutton,"clicked",(GCallback)gtk_widget_show,timport);
             * g_signal_connect_swapped (tbutton,"clicked",(GCallback)gtk_widget_hide,pimport);
             * g_signal_connect_swapped (tbutton,"clicked",(GCallback)gtk_widget_hide,limport);
             *
             * g_signal_connect_swapped (pbutton,"clicked",(GCallback)gtk_widget_hide,timport);
             * g_signal_connect_swapped (pbutton,"clicked",(GCallback)gtk_widget_show,pimport);
             * g_signal_connect_swapped (pbutton,"clicked",(GCallback)gtk_widget_hide,limport);
             *
             * g_signal_connect_swapped (lbutton,"clicked",(GCallback)gtk_widget_hide,timport);
             * g_signal_connect_swapped (lbutton,"clicked",(GCallback)gtk_widget_hide,pimport);
             * g_signal_connect_swapped (lbutton,"clicked",(GCallback)gtk_widget_show,limport);
             *
             * g_signal_connect (timport,"file-set",(GCallback)start_import,dialog);
             * g_signal_connect (pimport,"file-set",(GCallback)start_import,dialog);
             * g_signal_connect (limport,"file-set",(GCallback)start_import,dialog);
             *
             */
        }
コード例 #6
0
    // ---- Language stuff

    //private void createComboLanguage(string myLanguageCode) {
    private void createComboLanguage()
    {
        combo_language = ComboBox.NewText();
        fillLanguages();

        hbox_combo_language.PackStart(combo_language, false, false, 0);
        hbox_combo_language.ShowAll();
    }
コード例 #7
0
 public void InitWebKit(Gtk.Box w)
 {
     wb = new MonoMac.WebKit.WebView(new System.Drawing.RectangleF(10, 10, 200, 200), "foo", "bar");
     scrollWindow.AddWithViewport(NSViewToGtkWidget(wb));
     w.PackStart(scrollWindow, true, true, 0);
     w.ShowAll();
     wb.ShouldCloseWithWindow = true;
 }
コード例 #8
0
 public void InitWebKit(Gtk.Box w)
 {
     wb = new WebKit.WebView();
     scrollWindow.Add(wb);
     // Hack to work around webkit bug; webkit will crash the app if a size is not provided
     // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=466360 for a related bug report
     wb.SetSizeRequest(2, 2);
     w.PackStart(scrollWindow, true, true, 0);
     w.ShowAll();
 }
コード例 #9
0
ファイル: HTMLView.cs プロジェクト: ed2014/ApsimX
 public void InitWebKit(Gtk.Box w)
 {
     HoldingWidget = w;
     wb            = new Safari(new System.Drawing.RectangleF(10, 10, 200, 200), "foo", "bar");
     wb.OnKeyDown += OnKeyDown;
     scrollWindow.AddWithViewport(NSViewToGtkWidget(wb));
     w.PackStart(scrollWindow, true, true, 0);
     w.ShowAll();
     wb.ShouldCloseWithWindow = true;
 }
コード例 #10
0
        public void AddAction(string name, EventHandler e)
        {
            Button action = new Button(name);

            if (e != null)
            {
                action.Clicked += e;
            }

            action_box.PackStart(action, false, true, 0);
        }
コード例 #11
0
    public void SetComboValues(string [] values, string current)
    {
        combo = ComboBox.NewText();
        UtilGtk.ComboUpdate(combo, values, "");

        hbox_combo.PackStart(combo, true, true, 0);
        hbox_combo.ShowAll();
        combo.Sensitive = true;

        combo.Active = UtilGtk.ComboMakeActive(values, current);
    }
コード例 #12
0
    protected void createComboEventType(Event myEvent)
    {
        combo_eventType = ComboBox.NewText();
        string [] myTypes = findTypes(myEvent);
        UtilGtk.ComboUpdate(combo_eventType, myTypes, "");
        combo_eventType.Active = UtilGtk.ComboMakeActive(myTypes, myEvent.Type);
        hbox_combo_eventType.PackStart(combo_eventType, true, true, 0);
        hbox_combo_eventType.ShowAll();

        createSignal();
    }
コード例 #13
0
 public void InitWebKit(Gtk.Box w)
 {
     HoldingWidget = w;
     Browser       = new WebKit.WebView();
     ScrollWindow.Add(Browser);
     // Hack to work around webkit bug; webkit will crash the app if a size is not provided
     // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=466360 for a related bug report
     Browser.SetSizeRequest(2, 2);
     Browser.KeyPressEvent += Wb_KeyPressEvent;
     w.PackStart(ScrollWindow, true, true, 0);
     w.ShowAll();
 }
コード例 #14
0
            // FIXME clicking the spinbutton too fast seems to switch the view to browse

            public FaceBox(Gtk.Box tb, PhotoImageView vw) : base()
            {
                m_list     = new ArrayList();
                face_store = Core.Database.Faces;
                View       = vw;
                tag_store  = FSpot.Core.Database.Tags;

                Gtk.Label lab = new Gtk.Label("Face det:");
                lab.Show();
                tb.PackStart(lab, false, true, 0);

                face_button = new ToolbarButton();
                face_button.Add(new Gtk.Image("f-spot-sepia", IconSize.Button));
                tb.PackStart(face_button, false, true, 0);

                face_button.Clicked += HandleFaceButtonClicked;

                tag_entry = new Gtk.Entry("test");
                tag_entry.Show();
                tag_entry.Sensitive = false;
                tb.PackStart(tag_entry, false, true, 0);

                m_newtag_button = new  ToolbarButton();
                m_newtag_button.Add(new Gtk.Image("f-spot-new-tag", IconSize.Button));
                m_newtag_button.Show();
                m_newtag_button.Sensitive = false;
                tb.PackStart(m_newtag_button, false, true, 0);

                m_newtag_button.Clicked += HandleNewTagButtonClicked;

                m_spin = new SpinButton(1, 1, 1);
                m_spin.Show();
                m_spin.Sensitive = false;
                tb.PackStart(m_spin, false, true, 0);

                m_spin.Changed += HandleSpinChanged;

                //m.spin.ValueChanged += jesli w bazie, to pokaz jego tag
                //this.Add(tag_widget);
            }
コード例 #15
0
ファイル: MainWindow.cs プロジェクト: sharpend/Sharpend
        protected void createChildren()
        {
            box1        = new Gtk.Box(Orientation.Vertical, 0);
            box1.Name   = "box1";
            box1.Expand = true;

            toolbar1         = new Gtk.Toolbar();
            toolbar1.Name    = "toolbar1";
            toolbar1.Visible = true;
            //TODO add toolbar or not changeable by config
            box1.PackStart(toolbar1, false, false, 0);

            this.Add(box1);
        }
コード例 #16
0
    private void createComboLevels()
    {
        combo_levels = ComboBox.NewText();
        levels       = Constants.Levels;

        //first value has to be any (but is ok to put the id value of the LevelUndefinedID)
        levels[0] = Constants.LevelUndefinedID.ToString() + ":" + Catalog.GetString(Constants.Any);

        UtilGtk.ComboUpdate(combo_levels, levels, "");
        combo_levels.Active = UtilGtk.ComboMakeActive(levels,
                                                      Constants.LevelUndefinedID.ToString() + ":" +
                                                      Catalog.GetString(Constants.Any));

        hbox_combo_levels.PackStart(combo_levels, true, true, 0);
        hbox_combo_levels.ShowAll();
        combo_levels.Sensitive = false;         //level is shown when sport is not "undefined" and not "none"
        combo_levels.Changed  += new EventHandler(on_combo_other_changed);
        UtilGtk.ComboPackShowAndSensitive(hbox_combo_levels, combo_levels);
    }
コード例 #17
0
    public void CreateComboCheckBoxes()
    {
        if (hbox_combo_all_none_selected.Children.Length > 0)
        {
            hbox_combo_all_none_selected.Remove(combo_all_none_selected);
        }

        combo_all_none_selected = ComboBox.NewText();
        UtilGtk.ComboUpdate(combo_all_none_selected, comboCheckBoxesOptions, "");

        //combo_all_none_selected.DisableActivate ();
        combo_all_none_selected.Changed += new EventHandler(on_combo_all_none_selected_changed);

        hbox_combo_all_none_selected.PackStart(combo_all_none_selected, true, true, 0);
        hbox_combo_all_none_selected.ShowAll();
        combo_all_none_selected.Sensitive = true;

        combo_all_none_selected.Active =
            UtilGtk.ComboMakeActive(comboCheckBoxesOptions, Catalog.GetString("Selected"));
    }
コード例 #18
0
    private void createComboCountries()
    {
        combo_countries = ComboBox.NewText();

        countries = new String[1];
        //record countries with id:english name:translatedName
        countries [0] = Constants.CountryUndefinedID + ":" + Constants.CountryUndefined + ":" + Catalog.GetString(Constants.CountryUndefined);

        string [] myCountries = new String[1];
        myCountries [0] = Catalog.GetString(Constants.CountryUndefined);
        UtilGtk.ComboUpdate(combo_countries, myCountries, "");
        combo_countries.Active = UtilGtk.ComboMakeActive(myCountries,
                                                         Catalog.GetString(Constants.CountryUndefined));


        combo_countries.Changed += new EventHandler(on_combo_countries_changed);

        hbox_combo_countries.PackStart(combo_countries, true, true, 0);
        hbox_combo_countries.ShowAll();
        combo_countries.Sensitive = false;
    }
コード例 #19
0
    private void createComboCamera(string [] devices, int current)
    {
        combo_camera = ComboBox.NewText();

        if (devices.Length == 0)
        {
            devices = Util.StringToStringArray(Constants.CameraNotFound);
            current = 0;
        }

        UtilGtk.ComboUpdate(combo_camera, devices, "");
        hbox_combo_camera.PackStart(combo_camera, true, true, 0);
        hbox_combo_camera.ShowAll();

        if (current >= devices.Length)
        {
            current = 0;
        }

        combo_camera.Active = UtilGtk.ComboMakeActive(devices, devices[current]);
    }
コード例 #20
0
        static void gtml_activate()
        {
            icons = new Gtk.IconFactory();
            icons.AddDefault();

            window              = new Gtk.Window(PN);
            window.DeleteEvent += new DeleteEventHandler(Window_Delete);
            window.SetDefaultSize(800, 120);
            window.Decorated = true;

            grid = new Gtk.Grid();
            grid.ColumnHomogeneous = true;

            Gtk.Image icon = new Gtk.Image();
            icon.IconName          = ("list-add-symbolic");
            import_button          = new Gtk.Button(icon);
            import_button.Clicked += new EventHandler(gtml_import_full);
            Gtk.Box naw = new Gtk.Box(Gtk.Orientation.Horizontal, 1);
            naw.PackStart(import_button, true, true, 1);
            naw.ShowAll();

            stack             = new Gtk.Notebook();
            stack.EnablePopup = true;
            stack.GroupName   = "Mozilla Programs";
            stack.Scrollable  = true;

            stack.SetActionWidget(naw, Gtk.PackType.End);

            stack.Hexpand = true;
            stack.Vexpand = true;

            grid.Attach(stack, 1, 1, 1, 1);
            gtml_reload();

            window.Add(grid);

            window.ShowAll();
        }
コード例 #21
0
ファイル: MainWindow.cs プロジェクト: sharpend/Sharpend
        /// <summary>
        /// initialize the main window
        /// </summary>
        public virtual void init()
        {
            windowlist = new Dictionary <string, DockableWidget>(20);

            this.Title          = "MainWindow";
            this.WindowPosition = WindowPosition.Center;

            if (frame == null)
            {
                frame = new DockFrame();
                box1.PackStart(frame, true, true, 0);
                frame.Expand = true;
            }

            addWindows(null);
            loadToolbar();

            foreach (KeyValuePair <String, DockableWidget> kp in windowlist)
            {
                kp.Value.afterInit();
            }

            if ((StoredWidth > 0) && (StoredHeight > 0))
            {
                this.SetDefaultSize(StoredWidth, StoredHeight);
            }
            else
            {
                this.SetDefaultSize(800, 600);
            }

            if (Maximized)
            {
                this.Maximize();
            }

            CreateStartupWindows();
        }
コード例 #22
0
    private void createComboContinents()
    {
        combo_continents = ComboBox.NewText();
        continents       = Constants.Continents;

        //create continentsTranslated, only with translated stuff
        continentsTranslated = new String[Constants.Continents.Length];
        int i = 0;

        foreach (string continent in continents)
        {
            continentsTranslated[i++] = Util.FetchName(continent);
        }

        UtilGtk.ComboUpdate(combo_continents, continentsTranslated, "");
        combo_continents.Active = UtilGtk.ComboMakeActive(continentsTranslated,
                                                          Catalog.GetString(Constants.ContinentUndefined));

        combo_continents.Changed += new EventHandler(on_combo_continents_changed);

        hbox_combo_continents.PackStart(combo_continents, true, true, 0);
        hbox_combo_continents.ShowAll();
        combo_continents.Sensitive = true;
    }
コード例 #23
0
ファイル: HigMessageDialog.cs プロジェクト: GNOME/gbrainy
        public HigMessageDialog(Gtk.Window parent,
			                 Gtk.DialogFlags flags,
			                 Gtk.MessageType type,
			                 Gtk.ButtonsType buttons,
			                 string          header,
			                 string          msg)
            : base()
        {
            BorderWidth = 5;
            Resizable = false;
            Title = string.Empty;

            ContentArea.Spacing = 12;
            ActionArea.Layout = Gtk.ButtonBoxStyle.End;

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

            Gtk.HBox hbox = new Gtk.HBox (false, 12);
            hbox.BorderWidth = 5;
            hbox.Show ();
            ContentArea.PackStart (hbox, false, false, 0);

            switch (type) {
            case Gtk.MessageType.Error:
                image = new Gtk.Image (Gtk.Stock.DialogError,
                                   Gtk.IconSize.Dialog);
                break;
            case Gtk.MessageType.Question:
                image = new Gtk.Image (Gtk.Stock.DialogQuestion,
                                   Gtk.IconSize.Dialog);
                break;
            case Gtk.MessageType.Info:
                image = new Gtk.Image (Gtk.Stock.DialogInfo,
                                   Gtk.IconSize.Dialog);
                break;
            case Gtk.MessageType.Warning:
                image = new Gtk.Image (Gtk.Stock.DialogWarning,
                                   Gtk.IconSize.Dialog);
                break;
            default:
                image = new Gtk.Image ();
                break;
            }

            if (image != null) {
                image.Show ();
                image.Yalign = 0;
                hbox.PackStart (image, false, false, 0);
            }

            Gtk.Box label_vbox = new Gtk.Box (Orientation.Vertical, 0);
            label_vbox.Show ();
            hbox.PackStart (label_vbox, true, true, 0);

            string title = String.Format ("<span weight='bold' size='larger'>{0}" +
                                      "</span>\n",
                                      header);

            Gtk.Label label;

            label = new Gtk.Label (title);
            label.UseMarkup = true;
            label.UseUnderline = false;
            label.Justify = Gtk.Justification.Left;
            label.LineWrap = true;
            label.SetAlignment (0.0f, 0.5f);
            label.Show ();
            label_vbox.PackStart (label, false, false, 0);

            label = new Gtk.Label (msg);
            label.UseMarkup = true;
            label.UseUnderline = false;
            label.Justify = Gtk.Justification.Left;
            label.LineWrap = true;
            label.SetAlignment (0.0f, 0.5f);
            label.Show ();
            label_vbox.PackStart (label, false, false, 0);

            extra_widget_vbox = new Gtk.Box (Orientation.Vertical, 0);
            extra_widget_vbox.Show();
            label_vbox.PackStart (extra_widget_vbox, true, true, 12);

            switch (buttons) {
            case Gtk.ButtonsType.None:
                break;
            case Gtk.ButtonsType.Ok:
                AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
                break;
            case Gtk.ButtonsType.Close:
                AddButton (Gtk.Stock.Close, Gtk.ResponseType.Close, true);
                break;
            case Gtk.ButtonsType.Cancel:
                AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, true);
                break;
            case Gtk.ButtonsType.YesNo:
                AddButton (Gtk.Stock.No, Gtk.ResponseType.No, false);
                AddButton (Gtk.Stock.Yes, Gtk.ResponseType.Yes, true);
                break;
            case Gtk.ButtonsType.OkCancel:
                AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
                AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
                break;
            }

            if (parent != null)
                TransientFor = parent;

            if ((int) (flags & Gtk.DialogFlags.Modal) != 0)
                Modal = true;

            if ((int) (flags & Gtk.DialogFlags.DestroyWithParent) != 0)
                DestroyWithParent = true;
        }
コード例 #24
0
        /// <summary>
        /// setup fields like: store password:yes/no and the actual password entry,
        /// if it should be stored
        /// </summary>
        /// <param name="insertTo"></param>
        /// <param name="defaultSpacing"></param>
        void SetupGuiEncryptionRelated(Gtk.Box insertTo, int defaultSpacing)
        {
            Gtk.HBox customBox = new Gtk.HBox(false, defaultSpacing);
            insertTo.PackStart(customBox);
            rbt_storePw = new Gtk.RadioButton(Catalog.GetString("_Store password"));
            customBox.PackStart(rbt_storePw);

            customBox = new Gtk.HBox(false, defaultSpacing);
            insertTo.PackStart(customBox);

            //	--- Password Boxes ---
#if WIN32 && DPAPI
            String pw = DPAPIUtil.getPassword();
#else
            String pw = Convert.ToString(Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_PASSWORD));
#endif
            pw = (pw == null) ? "" : pw;
            Gtk.VBox pwbox    = new Gtk.VBox(false, defaultSpacing);
            Gtk.HBox superbox = new Gtk.HBox(false, defaultSpacing);
            superbox.PackStart(new Gtk.Alignment(0, 0, 200, 0));             // spacer
            superbox.PackStart(pwbox);
            customBox.PackStart(superbox);

            stored_pw = new Gtk.Entry();
            // set password style:
            stored_pw.InvisibleChar = '*';
            stored_pw.Visibility    = false;
            stored_pw.Text          = pw;
            pwbox.PackStart(stored_pw);

            stored_pw2 = new Gtk.Entry();
            // set password style:
            stored_pw2.InvisibleChar = '*';
            stored_pw2.Visibility    = false;
            stored_pw2.Text          = pw;
            pwbox.PackStart(stored_pw2);

            match_label        = new Gtk.Label();
            match_label.Markup = Catalog.GetString(AddinPreferences.MATCH_TEXT);
            pwbox.PackStart(match_label);

            customBox = new Gtk.HBox(false, defaultSpacing);
            insertTo.PackStart(customBox);

            // give the first rbt here to link the 2
            rbt_alwaysAsk = new Gtk.RadioButton(rbt_storePw, Catalog.GetString("_Always ask for password"));
            customBox.PackStart(rbt_alwaysAsk);


            // assign event-listener
            rbt_storePw.Toggled += PasswordMethodChanged;

            // init with values from preferences
            object value = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_ASKEVERYTIME);
            if (value == null || value.Equals(false))
            {
                rbt_storePw.Active = true;
            }
            else
            {
                rbt_alwaysAsk.Active = true;
            }

            // assign event-listeners
            stored_pw.Changed  += PasswordChanged;
            stored_pw2.Changed += PasswordChanged;
        }
コード例 #25
0
ファイル: utilGtk.cs プロジェクト: DiazGopar/chronojump
 public static void ComboPackShowAndSensitive(Gtk.Box box, Gtk.ComboBox combo)
 {
     box.PackStart(combo, true, true, 0);
     box.ShowAll();
     combo.Sensitive = true;
 }
コード例 #26
0
        public MiniMode(BaseClientWindow defaultMainWindow) : base(Catalog.GetString("Banshee Media Player"), "minimode", 0, 0)
        {
            default_main_window = defaultMainWindow;

            glade = new Glade.XML(System.Reflection.Assembly.GetExecutingAssembly(), "minimode.glade", "MiniModeWindow", null);
            glade.Autoconnect(this);

            Widget child = glade["mini_mode_contents"];

            (child.Parent as Container).Remove(child);
            Add(child);
            BorderWidth = 12;
            Resizable   = false;

            // Playback Buttons
            Widget previous_button = ActionService.PlaybackActions["PreviousAction"].CreateToolItem();

            Widget playpause_button = ActionService.PlaybackActions["PlayPauseAction"].CreateToolItem();

            Widget     button      = ActionService.PlaybackActions["NextAction"].CreateToolItem();
            Menu       menu        = ActionService.PlaybackActions.ShuffleActions.CreateMenu();
            MenuButton next_button = new MenuButton(button, menu, true);

            PlaybackBox.PackStart(previous_button, false, false, 0);
            PlaybackBox.PackStart(playpause_button, false, false, 0);
            PlaybackBox.PackStart(next_button, false, false, 0);
            PlaybackBox.ShowAll();

            // Seek Slider/Position Label
            seek_slider = new ConnectedSeekSlider();

            SeekContainer.PackStart(seek_slider, false, false, 0);
            SeekContainer.ShowAll();

            // Volume button
            volume_button = new ConnectedVolumeButton();
            VolumeContainer.PackStart(volume_button, false, false, 0);
            volume_button.Show();

            // Source combobox
            source_combo_box = new SourceComboBox();
            SourceBox.PackStart(source_combo_box, true, true, 0);
            source_combo_box.Show();

            // Track info
            track_info_display = new ClassicTrackInfoDisplay();
            track_info_display.Show();
            CoverBox.PackStart(track_info_display, true, true, 0);

            // Repeat button
            RepeatActionButton repeat_toggle_button = new RepeatActionButton();

            LowerButtonsBox.PackEnd(repeat_toggle_button, false, false, 0);
            LowerButtonsBox.ShowAll();

            tooltip_host = TooltipSetter.CreateHost();

            SetTip(fullmode_button, Catalog.GetString("Switch back to full mode"));
            SetTip(repeat_toggle_button, Catalog.GetString("Change repeat playback mode"));

            // Hook up everything
            ServiceManager.PlayerEngine.ConnectEvent(OnPlayerEvent,
                                                     PlayerEvent.Error |
                                                     PlayerEvent.StateChange |
                                                     PlayerEvent.TrackInfoUpdated);

            SetHeightLimit();
        }
コード例 #27
0
    protected void fillDialog(Event myEvent)
    {
        fillWindowTitleAndLabelHeader();

        string id = myEvent.UniqueID.ToString();

        if (myEvent.Simulated == Constants.Simulated)
        {
            label_simulated.Show();
        }

        label_event_id_value.Text      = id;
        label_event_id_value.UseMarkup = true;

        if (showTv)
        {
            fillTv(myEvent);
        }
        else
        {
            label_tv_title.Hide();
            entry_tv_value.Hide();
            label_tv_units.Hide();
        }

        if (showTc)
        {
            fillTc(myEvent);
        }
        else
        {
            label_tc_title.Hide();
            entry_tc_value.Hide();
            label_tc_units.Hide();
        }

        if (showFall)
        {
            fillFall(myEvent);
        }
        else
        {
            label_fall_title.Hide();
            entry_fall_value.Hide();
            label_fall_units.Hide();
        }

        if (showDistance)
        {
            fillDistance(myEvent);
        }
        else
        {
            label_distance_title.Hide();
            entry_distance_value.Hide();
            label_distance_units.Hide();
        }

        if (showTime)
        {
            fillTime(myEvent);
        }
        else
        {
            label_time_title.Hide();
            entry_time_value.Hide();
            label_time_units.Hide();
        }

        if (showSpeed)
        {
            fillSpeed(myEvent);
        }
        else
        {
            label_speed_title.Hide();
            label_speed_value.Hide();
            label_speed_units.Hide();
        }

        if (showWeight)
        {
            fillWeight(myEvent);
        }
        else
        {
            label_weight_title.Hide();
            entry_weight_value.Hide();
            label_weight_units.Hide();
        }

        if (showLimited)
        {
            fillLimited(myEvent);
        }
        else
        {
            label_limited_title.Hide();
            label_limited_value.Hide();
        }

        if (showAngle)
        {
            fillAngle(myEvent);
        }
        else
        {
            label_angle_title.Hide();
            entry_angle_value.Hide();
            label_angle_units.Hide();
        }

        if (!showMistakes)
        {
            label_mistakes.Hide();
            spin_mistakes.Hide();
        }


        //also remove new line for old descriptions that used a textview
        string temp = Util.RemoveTildeAndColonAndDot(myEvent.Description);

        entry_description.Text = Util.RemoveNewLine(temp, true);

        createComboEventType(myEvent);

        if (!showType)
        {
            label_type_title.Hide();
            combo_eventType.Hide();
        }

        if (showRunStart)
        {
            fillRunStart(myEvent);
        }
        else
        {
            label_run_start_title.Hide();
            label_run_start_value.Hide();
        }

        ArrayList persons = SqlitePersonSession.SelectCurrentSessionPersons(
            myEvent.SessionID,
            false);                     //means: do not returnPersonAndPSlist

        string [] personsStrings = new String[persons.Count];
        int       i = 0;

        foreach (Person person in persons)
        {
            personsStrings[i++] = person.IDAndName(":");
        }

        combo_persons = ComboBox.NewText();
        UtilGtk.ComboUpdate(combo_persons, personsStrings, "");
        combo_persons.Active = UtilGtk.ComboMakeActive(personsStrings, myEvent.PersonID + ":" + myEvent.PersonName);

        oldPersonID = myEvent.PersonID;

        hbox_combo_person.PackStart(combo_persons, true, true, 0);
        hbox_combo_person.ShowAll();

        //show video if available
        videoFileName = Util.GetVideoFileName(myEvent.SessionID, typeOfTest, myEvent.UniqueID);
        if (File.Exists(videoFileName))
        {
            label_video_yes.Visible      = true;
            label_video_no.Visible       = false;
            button_video_watch.Sensitive = true;
            button_video_url.Sensitive   = true;
        }
        else
        {
            label_video_yes.Visible      = false;
            label_video_no.Visible       = true;
            button_video_watch.Sensitive = false;
            button_video_url.Sensitive   = false;
        }
    }
コード例 #28
0
        public HigMessageDialog(Gtk.Window parent,
                                Gtk.DialogFlags flags,
                                Gtk.MessageType type,
                                Gtk.ButtonsType buttons,
                                string header,
                                string msg) : base()
        {
            BorderWidth = 5;
            Resizable   = false;
            Title       = string.Empty;

            ContentArea.Spacing = 12;
            ActionArea.Layout   = Gtk.ButtonBoxStyle.End;

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

            Gtk.HBox hbox = new Gtk.HBox(false, 12);
            hbox.BorderWidth = 5;
            hbox.Show();
            ContentArea.PackStart(hbox, false, false, 0);

            switch (type)
            {
            case Gtk.MessageType.Error:
                image = new Gtk.Image(Gtk.Stock.DialogError,
                                      Gtk.IconSize.Dialog);
                break;

            case Gtk.MessageType.Question:
                image = new Gtk.Image(Gtk.Stock.DialogQuestion,
                                      Gtk.IconSize.Dialog);
                break;

            case Gtk.MessageType.Info:
                image = new Gtk.Image(Gtk.Stock.DialogInfo,
                                      Gtk.IconSize.Dialog);
                break;

            case Gtk.MessageType.Warning:
                image = new Gtk.Image(Gtk.Stock.DialogWarning,
                                      Gtk.IconSize.Dialog);
                break;

            default:
                image = new Gtk.Image();
                break;
            }

            if (image != null)
            {
                image.Show();
                image.Yalign = 0;
                hbox.PackStart(image, false, false, 0);
            }

            Gtk.Box label_vbox = new Gtk.Box(Orientation.Vertical, 0);
            label_vbox.Show();
            hbox.PackStart(label_vbox, true, true, 0);

            string title = String.Format("<span weight='bold' size='larger'>{0}" +
                                         "</span>\n",
                                         header);

            Gtk.Label label;

            label              = new Gtk.Label(title);
            label.UseMarkup    = true;
            label.UseUnderline = false;
            label.Justify      = Gtk.Justification.Left;
            label.LineWrap     = true;
            label.SetAlignment(0.0f, 0.5f);
            label.Show();
            label_vbox.PackStart(label, false, false, 0);

            label              = new Gtk.Label(msg);
            label.UseMarkup    = true;
            label.UseUnderline = false;
            label.Justify      = Gtk.Justification.Left;
            label.LineWrap     = true;
            label.SetAlignment(0.0f, 0.5f);
            label.Show();
            label_vbox.PackStart(label, false, false, 0);

            extra_widget_vbox = new Gtk.Box(Orientation.Vertical, 0);
            extra_widget_vbox.Show();
            label_vbox.PackStart(extra_widget_vbox, true, true, 12);

            switch (buttons)
            {
            case Gtk.ButtonsType.None:
                break;

            case Gtk.ButtonsType.Ok:
                AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
                break;

            case Gtk.ButtonsType.Close:
                AddButton(Gtk.Stock.Close, Gtk.ResponseType.Close, true);
                break;

            case Gtk.ButtonsType.Cancel:
                AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, true);
                break;

            case Gtk.ButtonsType.YesNo:
                AddButton(Gtk.Stock.No, Gtk.ResponseType.No, false);
                AddButton(Gtk.Stock.Yes, Gtk.ResponseType.Yes, true);
                break;

            case Gtk.ButtonsType.OkCancel:
                AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
                AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
                break;
            }

            if (parent != null)
            {
                TransientFor = parent;
            }

            if ((int)(flags & Gtk.DialogFlags.Modal) != 0)
            {
                Modal = true;
            }

            if ((int)(flags & Gtk.DialogFlags.DestroyWithParent) != 0)
            {
                DestroyWithParent = true;
            }
        }
コード例 #29
0
        public MiniMode()
        {
            glade = new Glade.XML(null, "minimode.glade", "MiniModeWindow", "banshee");
            glade.Autoconnect(this);
            if (MiniModeWindow == null)
            {
                throw new Exception(); // This propagate Glade errors to Banshee's plugin framework
            }
            IconThemeUtils.SetWindowIcon(MiniModeWindow);
            MiniModeWindow.DeleteEvent += delegate {
                PlayerCore.UserInterface.Quit();
            };

            // Playback Buttons
            ActionButton previous_button = new ActionButton(Globals.ActionManager["PreviousAction"]);

            previous_button.LabelVisible = false;
            previous_button.Padding      = 1;

            ActionButton next_button = new ActionButton(Globals.ActionManager["NextAction"]);

            next_button.LabelVisible = false;
            next_button.Padding      = 1;

            ActionButton playpause_button = new ActionButton(Globals.ActionManager["PlayPauseAction"]);

            playpause_button.LabelVisible = false;
            playpause_button.Padding      = 1;

            PlaybackBox.PackStart(previous_button, false, false, 0);
            PlaybackBox.PackStart(playpause_button, false, false, 0);
            PlaybackBox.PackStart(next_button, false, false, 0);
            PlaybackBox.ShowAll();

            // Seek Slider/Position Label
            seek_slider = new SeekSlider();
            seek_slider.SetSizeRequest(125, -1);
            seek_slider.SeekRequested += delegate {
                PlayerEngineCore.Position = (uint)seek_slider.Value;
            };

            stream_position_label = new StreamPositionLabel(seek_slider);

            SeekContainer.PackStart(seek_slider, false, false, 0);
            SeekContainer.PackStart(stream_position_label, false, false, 0);
            SeekContainer.ShowAll();

            // Volume button
            volumeButton = new VolumeButton();
            VolumeContainer.PackStart(volumeButton, false, false, 0);
            volumeButton.Show();
            volumeButton.VolumeChanged += delegate(int volume) {
                PlayerEngineCore.Volume = (ushort)volume;
                Globals.Configuration.Set(GConfKeys.Volume, volume);
            };

            // Cover
            coverArtThumbnail = new CoverArtThumbnail(90);
            Gdk.Pixbuf default_pixbuf = Banshee.Base.IconThemeUtils.LoadIcon("audio-x-generic", 128);
            if (default_pixbuf == null)
            {
                default_pixbuf = new Gdk.Pixbuf(System.Reflection.Assembly.GetEntryAssembly(), "banshee-logo.png");
            }
            coverArtThumbnail.NoArtworkPixbuf = default_pixbuf;
            CoverBox.PackStart(coverArtThumbnail, false, false, 0);

            // Source combobox
            sourceComboBox = new SourceComboBox();
            SourceBox.PackStart(sourceComboBox, true, true, 0);
            sourceComboBox.ShowAll();

            // Repeat/Shuffle buttons
            MultiStateToggleButton shuffle_toggle_button = new MultiStateToggleButton();

            shuffle_toggle_button.AddState(typeof(ShuffleDisabledToggleState),
                                           Globals.ActionManager["ShuffleAction"] as ToggleAction);
            shuffle_toggle_button.AddState(typeof(ShuffleEnabledToggleState),
                                           Globals.ActionManager["ShuffleAction"] as ToggleAction);
            shuffle_toggle_button.Relief    = ReliefStyle.None;
            shuffle_toggle_button.ShowLabel = false;
            shuffle_toggle_button.ShowAll();

            MultiStateToggleButton repeat_toggle_button = new MultiStateToggleButton();

            repeat_toggle_button.AddState(typeof(RepeatNoneToggleState),
                                          Globals.ActionManager["RepeatNoneAction"] as ToggleAction);
            repeat_toggle_button.AddState(typeof(RepeatAllToggleState),
                                          Globals.ActionManager["RepeatAllAction"] as ToggleAction);
            repeat_toggle_button.AddState(typeof(RepeatSingleToggleState),
                                          Globals.ActionManager["RepeatSingleAction"] as ToggleAction);
            repeat_toggle_button.Relief    = ReliefStyle.None;
            repeat_toggle_button.ShowLabel = false;
            repeat_toggle_button.ShowAll();


            LowerButtonsBox.PackEnd(repeat_toggle_button, false, false, 0);
            LowerButtonsBox.PackEnd(shuffle_toggle_button, false, false, 0);
            LowerButtonsBox.ShowAll();

            // Hook up everything
            PlayerEngineCore.EventChanged += OnPlayerEngineEventChanged;
            PlayerEngineCore.StateChanged += OnPlayerEngineStateChanged;
        }
コード例 #30
0
        public MiniMode() : base(Branding.ApplicationLongName)
        {
            default_main_window = InterfaceElements.MainWindow;

            glade = new Glade.XML(null, "minimode.glade", "MiniModeWindow", null);
            glade.Autoconnect(this);

            Widget child = glade["mini_mode_contents"];

            (child.Parent as Container).Remove(child);
            Add(child);
            BorderWidth = 12;
            Resizable   = false;

            IconThemeUtils.SetWindowIcon(this);
            DeleteEvent += delegate {
                Globals.ActionManager["QuitAction"].Activate();
            };

            // Playback Buttons
            ActionButton previous_button = new ActionButton(Globals.ActionManager["PreviousAction"]);

            previous_button.LabelVisible = false;
            previous_button.Padding      = 1;

            ActionButton next_button = new ActionButton(Globals.ActionManager["NextAction"]);

            next_button.LabelVisible = false;
            next_button.Padding      = 1;

            ActionButton playpause_button = new ActionButton(Globals.ActionManager["PlayPauseAction"]);

            playpause_button.LabelVisible = false;
            playpause_button.Padding      = 1;

            PlaybackBox.PackStart(previous_button, false, false, 0);
            PlaybackBox.PackStart(playpause_button, false, false, 0);
            PlaybackBox.PackStart(next_button, false, false, 0);
            PlaybackBox.ShowAll();

            // Seek Slider/Position Label
            seek_slider = new SeekSlider();
            seek_slider.SetSizeRequest(125, -1);
            seek_slider.SeekRequested += delegate {
                PlayerEngineCore.Position = (uint)seek_slider.Value;
            };

            stream_position_label = new StreamPositionLabel(seek_slider);

            SeekContainer.PackStart(seek_slider, false, false, 0);
            SeekContainer.PackStart(stream_position_label, false, false, 0);
            SeekContainer.ShowAll();

            // Volume button
            volume_button = new VolumeButton();
            VolumeContainer.PackStart(volume_button, false, false, 0);
            volume_button.Show();
            volume_button.VolumeChanged += delegate(int volume) {
                PlayerEngineCore.Volume = (ushort)volume;
                PlayerEngineCore.VolumeSchema.Set(volume);
            };

            // Cover
            cover_art_thumbnail = new CoverArtThumbnail(90);
            Gdk.Pixbuf default_pixbuf = Banshee.Base.Branding.DefaultCoverArt;
            cover_art_thumbnail.NoArtworkPixbuf = default_pixbuf;
            CoverBox.PackStart(cover_art_thumbnail, false, false, 0);

            // Source combobox
            source_combo_box = new SourceComboBox();
            SourceBox.PackStart(source_combo_box, true, true, 0);
            source_combo_box.ShowAll();

            // Repeat/Shuffle buttons
            MultiStateToggleButton shuffle_toggle_button = new MultiStateToggleButton();

            shuffle_toggle_button.AddState(typeof(ShuffleDisabledToggleState),
                                           Globals.ActionManager["ShuffleAction"] as ToggleAction);
            shuffle_toggle_button.AddState(typeof(ShuffleEnabledToggleState),
                                           Globals.ActionManager["ShuffleAction"] as ToggleAction);
            shuffle_toggle_button.Relief    = ReliefStyle.None;
            shuffle_toggle_button.ShowLabel = false;
            try {
                shuffle_toggle_button.ActiveStateIndex = PlayerWindowSchema.PlaybackShuffle.Get() ? 1 : 0;
            } catch {
                shuffle_toggle_button.ActiveStateIndex = 0;
            }
            shuffle_toggle_button.ShowAll();

            MultiStateToggleButton repeat_toggle_button = new MultiStateToggleButton();

            repeat_toggle_button.AddState(typeof(RepeatNoneToggleState),
                                          Globals.ActionManager["RepeatNoneAction"] as ToggleAction);
            repeat_toggle_button.AddState(typeof(RepeatAllToggleState),
                                          Globals.ActionManager["RepeatAllAction"] as ToggleAction);
            repeat_toggle_button.AddState(typeof(RepeatSingleToggleState),
                                          Globals.ActionManager["RepeatSingleAction"] as ToggleAction);
            repeat_toggle_button.Relief    = ReliefStyle.None;
            repeat_toggle_button.ShowLabel = false;
            try {
                repeat_toggle_button.ActiveStateIndex = (int)PlayerWindowSchema.PlaybackRepeat.Get();
            } catch {
                repeat_toggle_button.ActiveStateIndex = 0;
            }
            repeat_toggle_button.ShowAll();

            LowerButtonsBox.PackEnd(repeat_toggle_button, false, false, 0);
            LowerButtonsBox.PackEnd(shuffle_toggle_button, false, false, 0);
            LowerButtonsBox.ShowAll();

            // Tooltips
            toolTips = new Tooltips();

            SetTip(previous_button, Catalog.GetString("Play previous song"));
            SetTip(playpause_button, Catalog.GetString("Play/pause current song"));
            SetTip(next_button, Catalog.GetString("Play next song"));
            SetTip(fullmode_button, Catalog.GetString("Switch back to full mode"));
            SetTip(volume_button, Catalog.GetString("Adjust volume"));
            SetTip(repeat_toggle_button, Catalog.GetString("Change repeat playback mode"));
            SetTip(shuffle_toggle_button, Catalog.GetString("Toggle shuffle playback mode"));

            // Hook up everything
            PlayerEngineCore.EventChanged += OnPlayerEngineEventChanged;
            PlayerEngineCore.StateChanged += OnPlayerEngineStateChanged;

            SetHeightLimit();
        }