public HmPreferencesWidget()
            : base()
        {
            HmBackend.LoadCredentials (out this.username, out this.password);

            //Fixme Please ! I look UGLY!
            VBox mainVBox = new VBox(false, 12);
            mainVBox.BorderWidth = 10;
            mainVBox.Show();
            Add(mainVBox);

            HBox usernameBox = new HBox(false, 12);
            Gtk.Label emailLabel = new Label ("Email Address");
            usernameBox.Add (emailLabel);
            emailEntry = new Entry(username);
            usernameBox.Add (emailEntry);
            usernameBox.ShowAll();
            mainVBox.PackStart (usernameBox, false, false, 0);

            HBox passwordBox = new HBox(false, 12);
            Gtk.Label passwordLabel = new Label ("Password");
            passwordBox.Add (passwordLabel);
            passwordEntry = new Entry(password);
            passwordBox.Add (passwordEntry);
            passwordBox.ShowAll();
            mainVBox.PackStart (passwordBox, false, false, 0);

            // Status message label
            statusLabel = new Label();
            statusLabel.Justify = Gtk.Justification.Center;
            statusLabel.Wrap = true;
            statusLabel.LineWrap = true;
            statusLabel.Show();
            statusLabel.UseMarkup = true;
            statusLabel.UseUnderline = false;

            mainVBox.PackStart(statusLabel, false, false, 0);

            authButton = new LinkButton("Click Here to Connect");
            authButton.Show();
            mainVBox.PackStart(authButton, false, false, 0);
            mainVBox.ShowAll();

            authButton.Clicked += OnAuthButtonClicked;
        }
Example #2
0
		// called when no search results are found in the selected notebook
		void NoMatchesFoundAction ()
		{
			hpaned.Remove (matches_window);
			String message = Catalog.GetString ("No results found " +
				"in the selected notebook.\nClick here to " +
				"search across all notes.");
			Gtk.LinkButton link_button = new Gtk.LinkButton ("", message);
			Gtk.LinkButton.SetUriHook(ShowAllSearchResults);
			link_button.TooltipText = Catalog.GetString 
				("Click here to search across all notebooks");
			link_button.Show();
			Gtk.Table no_matches_found_table = new Gtk.Table (1, 3, false);
			no_matches_found_table.Attach (link_button, 1, 2, 0, 1,
			                               Gtk.AttachOptions.Fill | Gtk.AttachOptions.Shrink,
			                 Gtk.AttachOptions.Shrink,
			                0, 0
			              );
			
			no_matches_found_table.ColumnSpacing = 4;
			no_matches_found_table.ShowAll ();
			no_matches_box = new HBox (false, 0);
			no_matches_box.PackStart (no_matches_found_table, true, true, 0);
			no_matches_box.Show ();
			hpaned.Add2 (no_matches_box);
		}
        public RtmPreferencesWidget(RtmBackend backend, IPreferences preferences)
            : base()
        {
            if (backend == null)
                throw new ArgumentNullException ("backend");
            if (preferences == null)
                throw new ArgumentNullException ("preferences");
            this.backend = backend;
            this.preferences = preferences;

            LoadPreferences ();

            BorderWidth = 0;

            // We're using an event box so we can paint the background white
            EventBox imageEb = new EventBox ();
            imageEb.BorderWidth = 0;
            imageEb.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
            imageEb.ModifyBase(StateType.Normal, new Gdk.Color(255,255,255));
            imageEb.Show ();

            VBox mainVBox = new VBox(false, 0);
            mainVBox.BorderWidth = 10;
            mainVBox.Show();
            Add(mainVBox);

            // Add the rtm logo
            image = new Gtk.Image (normalPixbuf);
            image.Show();
            //make the dialog box look pretty without hard coding total size and
            //therefore clipping displays with large fonts.
            Alignment spacer = new Alignment((float)0.5, 0, 0, 0);
            spacer.SetPadding(0, 0, 125, 125);
            spacer.Add(image);
            spacer.Show();
            imageEb.Add (spacer);
            mainVBox.PackStart(imageEb, true, true, 0);

            // Status message label
            statusLabel = new Label();
            statusLabel.Justify = Gtk.Justification.Center;
            statusLabel.Wrap = true;
            statusLabel.LineWrap = true;
            statusLabel.Show();
            statusLabel.UseMarkup = true;
            statusLabel.UseUnderline = false;

            authButton = new LinkButton (
            #if GETTEXT
            Catalog.GetString ("Click Here to Connect"));
            #elif ANDROID

            #endif
            authButton.Clicked += OnAuthButtonClicked;

            if ( isAuthorized ) {
                statusLabel.Text = "\n\n" +
            #if GETTEXT
                    Catalog.GetString ("You are currently connected");
            #elif ANDROID

            #endif
                string userName = preferences.Get (PreferencesKeys.UserNameKey);
                if (userName != null && userName.Trim () != string.Empty)
                    statusLabel.Text = "\n\n" +
            #if GETTEXT
                        Catalog.GetString ("You are currently connected as") +
            #elif ANDROID

            #endif
                        "\n" + userName.Trim();
            } else {
                statusLabel.Text = "\n\n" +
            #if GETTEXT
                    Catalog.GetString ("You are not connected");
            #elif ANDROID

            #endif
                authButton.Show();
            }
            mainVBox.PackStart(statusLabel, false, false, 0);
            mainVBox.PackStart(authButton, false, false, 0);

            Label blankLabel = new Label("\n");
            blankLabel.Show();
            mainVBox.PackStart(blankLabel, false, false, 0);
        }
Example #4
0
		// Page 3
		// Extension Preferences
		public Gtk.Widget MakeAddinsPane ()
		{
			Gtk.VBox vbox = new Gtk.VBox (false, 6);
			vbox.BorderWidth = 6;
			Gtk.Label l = new Gtk.Label (Catalog.GetString (
			                                     "The following add-ins are installed"));
			l.Xalign = 0;
			l.Show ();
			vbox.PackStart (l, false, false, 0);

			Gtk.HBox hbox = new Gtk.HBox (false, 6);

			// TreeView of Add-ins
			Gtk.TreeView tree = new Gtk.TreeView ();
			addin_tree = new Mono.Addins.Gui.AddinTreeWidget (tree);

			tree.Show ();

			Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow ();
			sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
			sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
			sw.ShadowType = Gtk.ShadowType.In;
			sw.Add (tree);
			sw.Show ();
			Gtk.LinkButton get_more_link =
				new Gtk.LinkButton ("http://live.gnome.org/Tomboy/PluginList",
				                    Catalog.GetString ("Get More Add-Ins..."));
			get_more_link.Show ();
			Gtk.VBox tree_box = new Gtk.VBox (false, 0);
			tree_box.Add (sw);
			tree_box.PackEnd (get_more_link, false, false, 5);
			tree_box.Show ();
			hbox.PackStart (tree_box, true, true, 0);

			// Action Buttons (right of TreeView)
			Gtk.VButtonBox button_box = new Gtk.VButtonBox ();
			button_box.Spacing = 4;
			button_box.Layout = Gtk.ButtonBoxStyle.Start;

			// TODO: In a future version, add in an "Install Add-ins..." button

			// TODO: In a future version, add in a "Repositories..." button

			enable_addin_button =
			        new Gtk.Button (Catalog.GetString ("_Enable"));
			enable_addin_button.Sensitive = false;
			enable_addin_button.Clicked += OnEnableAddinButton;
			enable_addin_button.Show ();

			disable_addin_button =
			        new Gtk.Button (Catalog.GetString ("_Disable"));
			disable_addin_button.Sensitive = false;
			disable_addin_button.Clicked += OnDisableAddinButton;
			disable_addin_button.Show ();

			addin_prefs_button =
			        new Gtk.Button (Gtk.Stock.Preferences);
			addin_prefs_button.Sensitive = false;
			addin_prefs_button.Clicked += OnAddinPrefsButton;
			addin_prefs_button.Show ();

			addin_info_button =
			        new Gtk.Button (Gtk.Stock.Info);
			addin_info_button.Sensitive = false;
			addin_info_button.Clicked += OnAddinInfoButton;
			addin_info_button.Show ();

			button_box.PackStart (enable_addin_button);
			button_box.PackStart (disable_addin_button);
			button_box.PackStart (addin_prefs_button);
			button_box.PackStart (addin_info_button);

			button_box.Show ();
			hbox.PackStart (button_box, false, false, 0);

			hbox.Show ();
			vbox.PackStart (hbox, true, true, 0);
			vbox.Show ();

			tree.Selection.Changed += OnAddinTreeSelectionChanged;
			LoadAddins ();

			return vbox;
		}
        public void AddSignUpButton()
        {
            if (signup_button != null) {
                return;
            }

            Resize (2, 2);
            signup_button = new LinkButton (account.SignUpUrl, Catalog.GetString ("Sign up for Last.fm"));
            signup_button.Show ();
            Attach (signup_button, 1, 2, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
        }
        protected void SetupGui()
        {
            // This is all just stuff to make the UI work sanely.
            sbInitialDeposit.Adjustment.PageIncrement = 100;

            sbInitialDeposit.Xalign = 1.0f;
            sbReserveRequirement.Xalign = 1.0f;
            sbIterations.Xalign = 1.0f;
            sbBankCanLoan.Xalign = 1.0f;
            sbBankHasLoanedOut.Xalign = 1.0f;
            sbBanksNextLoan.Xalign = 1.0f;
            sbBanksReserves.Xalign = 1.0f;
            sbWhatCustomersThink.Xalign = 1.0f;
            sbTotalInterestAndPrincipal.Xalign = 1.0f;
            sbTotalInterestOnly.Xalign = 1.0f;
            sbInterestPeriods.Xalign = 1.0f;
            sbInterestRate.Xalign = 1.0f;

            lblInitDeposit.Xalign = 1.0f;
            lblReserveRequirement.Xalign = 1.0f;
            lblIterations.Xalign = 1.0f;

            // Make the headings a larger, bold font.
            Pango.FontDescription fd = new Pango.FontDescription ();
            fd.Family = "Sans";

            // The following bit is unreliable. See below.
            OperatingSystem os = Environment.OSVersion;
            PlatformID pid = os.Platform;
            switch (pid) {
            case PlatformID.MacOSX:  // Does not work.
                fd.Size = Convert.ToInt32 (16 * Pango.Scale.PangoScale);
                break;
            case PlatformID.Unix:  // Macs lie and say they are Unix.
                fd.Size = Convert.ToInt32 (12 * Pango.Scale.PangoScale);
                break;
            default: // Windows.
                fd.Size = Convert.ToInt32 (12 * Pango.Scale.PangoScale);
                break;
            }
            // Since macs lie, we need to properly determine if we're on a mac.
            // The following method was taken from a question on StackOverflow.
            if (IsRunningOnMac ()) {
                fd.Size = Convert.ToInt32 (16 * Pango.Scale.PangoScale);
            }

            fd.Weight = Pango.Weight.Bold;

            // Set the font on the headings.
            lblFractionalResults.ModifyFont(fd);
            lblInterestOwedParameters.ModifyFont(fd);
            lblInitParams.ModifyFont(fd);
            lblInterestResults.ModifyFont (fd);

            // Set the default values.
            sbInitialDeposit.Value = 1000;
            sbIterations.Value = 10;
            sbReserveRequirement.Value = 0.1f;
            sbWhatCustomersThink.Value = 0;

            cbxCompounded.Active = 1; // Set it to monthly
            sbInterestPeriods.Value = 10; // Set 10 years
            sbInterestRate.Value = 0.05; // Set 5%

            // Info
            LinkButton lb = new LinkButton("Click here for more information and tutorials.");
            lb.Uri = "http://cynic.me/";
            lb.Xalign = 0.5f;
            fixed1.Add (lb);
            lb.Clicked += CynicLinkClicked;
            lb.Show ();

            // Do the initial population of the calculated spin button values.
            DoFractionalMath();
        }