Example #1
0
        public PasswordEntry()
        {
            autoReset = new AutoResetEvent(false);
            Title     = Catalog.GetString("Please enter the password");
            Gtk.VBox pwbox = new Gtk.VBox(false, 6);

            pwbox.PackStart(new Gtk.Label(Catalog.GetString("Please enter the password:"******"";
            pwbox.PackStart(pw);

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

            pw.Changed  += PasswordChanged;
            pw2.Changed += PasswordChanged;

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


            Gtk.Button button = (Gtk.Button)AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok);
            button.CanDefault = true;
            //button.Show();
            pwbox.PackStart(button);
            //this.VBox.PackStart(button);

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

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

            AddActionWidget(button, Gtk.ResponseType.Ok);
            DefaultResponse = Gtk.ResponseType.Ok;

            accel_group.AccelActivate += OnAction;
            Response += OnResponse;

            DeleteEvent += new Gtk.DeleteEventHandler(PasswordEntry_DeleteEvent);

            pwbox.ShowAll();
            this.VBox.PackStart(pwbox);

            // show() must happen on ui thread
            Gtk.Application.Invoke(RunInUiThread);
        }
Example #2
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);
            }
        }
Example #3
0
        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.Escape,
                                      0,
                                      Gtk.AccelFlags.Visible);
            }
        }
		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.Escape, 
						       0,
						       Gtk.AccelFlags.Visible);
			}
		}
Example #5
0
		public PreferencesDialog (AddinManager addin_manager)
: base ()
		{
			this.addin_manager = addin_manager;

			IconName = "tomboy";
			HasSeparator = false;
			BorderWidth = 5;
			Resizable = true;
			Title = Catalog.GetString ("Tomboy Preferences");

			ActionArea.Layout = Gtk.ButtonBoxStyle.End;

			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);
				}
			}

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

			addin_manager.ApplicationAddinListChanged += OnAppAddinListChanged;


			// Ok button...

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

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

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

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

			Preferences.SettingChanged += HandlePreferencesSettingChanged;
		}