public LoginFrame()
            : base("Account")
        {
            this.BorderWidth     = 10;
            this.loginBox        = new VBox();
            this.loginButtonBox  = new VButtonBox();
            this.loginButton     = new Button();
            this.subscribeButton = new Button();

            // Button Box
            this.Add(loginBox);
            loginBox.PackStart(loginButtonBox, false, false, 10);
            loginBox.Add(loginButtonBox);


            // Login button
            loginButtonBox.PackStart(loginButton, true, true, 0);
            loginButtonBox.Add(loginButton);

            // Login Image button
            this.imageBox     = new HBox();
            this.accountImage = new Image("../../icons/account.png");

            loginButton.Add(imageBox);
            imageBox.PackStart(accountImage, false, false, 3);
            imageBox.Add(accountImage);

            this.loginLabel = new Label(loginText);
            imageBox.PackStart(loginLabel, false, false, 0);
            imageBox.Add(loginLabel);

            // subscribe Button
            loginButtonBox.PackStart(subscribeButton, true, true, 0);
            loginButtonBox.Add(subscribeButton);

            // logout button
            this.logoutLabel  = new Label("Logout");
            this.logoutButton = new Button();
            logoutButton.Add(logoutLabel);

            // subscribe Label Button
            this.subscribeLabel = new Label(subscribeText);
            subscribeButton.Add(subscribeLabel);


            //Buttons
            loginButton.Clicked     += new EventHandler(OpenLoginWindow);
            subscribeButton.Clicked += new EventHandler(OpenSubscribeWindow);

            logoutButton.Clicked += new EventHandler(Logout);

            this.LoginWindow = new Authentication();
            this.LoginWindow.HideAll();

            this.SubscriptionWindow = new Subscription();
            this.SubscriptionWindow.HideAll();
        }
        void BuildGui()
        {
            CellRendererText cellId   = new CellRendererText();
            TreeViewColumn   idColumn = new TreeViewColumn();

            idColumn.Title = GettextCatalog.GetString("ID");
            idColumn.PackStart(cellId, false);
            idColumn.AddAttribute(cellId, "text", 0);

            CellRendererText cellTitle   = new CellRendererText();
            TreeViewColumn   titleColumn = new TreeViewColumn();

            titleColumn.Title  = "Title";
            titleColumn.Expand = true;
            titleColumn.Sizing = TreeViewColumnSizing.Fixed;
            titleColumn.PackStart(cellTitle, true);
            titleColumn.AddAttribute(cellTitle, "text", 1);

            CellRendererCombo cellAction   = new CellRendererCombo();
            TreeViewColumn    actionColumn = new TreeViewColumn();

            actionColumn.Title = "Action";
            actionColumn.PackStart(cellAction, false);
            actionColumn.AddAttribute(cellAction, "text", 2);
            cellAction.Editable   = true;
            cellAction.Model      = checkinActions;
            cellAction.TextColumn = 0;
            cellAction.HasEntry   = false;
            cellAction.Edited    += OnActionChanged;
            //checkinActions.AppendValues(WorkItemCheckinAction.None.ToString());
            checkinActions.AppendValues(WorkItemCheckinAction.Associate.ToString());
            //checkinActions.AppendValues(WorkItemCheckinAction.Resolve.ToString());

            workItemsView.AppendColumn(idColumn);
            workItemsView.AppendColumn(titleColumn);
            workItemsView.AppendColumn(actionColumn);

            workItemsView.Model         = workItemStore;
            workItemsView.WidthRequest  = 300;
            workItemsView.HeightRequest = 120;

            this.PackStart(workItemsView, true, true, 3);

            VButtonBox buttonBox = new VButtonBox();
            Button     addButton = new Button();

            addButton.Label        = GettextCatalog.GetString("Add Work Item");
            addButton.Clicked     += OnAddWorkItem;
            removeButton.Label     = GettextCatalog.GetString("Remove Work Item");
            removeButton.Sensitive = false;
            removeButton.Clicked  += OnRemoveWorkItem;

            addButton.WidthRequest = removeButton.WidthRequest = 150;

            buttonBox.PackStart(addButton);
            buttonBox.PackStart(removeButton);
            buttonBox.Layout = ButtonBoxStyle.Start;

            this.PackStart(buttonBox, false, false, 3);

            this.ShowAll();
        }
Exemplo n.º 3
0
        private void Initialize()
        {
            Title        = Catalog.GetString("New Smart Playlist");
            VBox.Spacing = 8;

            AddStockButton(Stock.Cancel, ResponseType.Cancel);
            ok_button = AddStockButton(Stock.Save, ResponseType.Ok, true);

            var builder_box = new VBox()
            {
                BorderWidth = 5,
                Spacing     = 10
            };

            var name_box = new HBox()
            {
                Spacing = 2
            };

            name_box.PackStart(new Label()
            {
                Text         = Catalog.GetString("Playlist _Name:"),
                UseUnderline = true
            }, false, false, 0);

            name_box.PackStart(name_entry = new Entry(), true, true, 0);
            name_entry.Changed           += HandleNameChanged;
            builder_box.PackStart(name_box, false, false, 0);

            builder_box.PackStart(builder = new BansheeQueryBox(), true, true, 0);
            builder.Show();
            builder.Spacing = 4;

            var expander = new Expander(Catalog.GetString("Predefined Smart Playlists"));
            var hbox     = new HBox()
            {
                Spacing = 8
            };
            var scrolled_window = new ScrolledWindow()
            {
                HscrollbarPolicy = PolicyType.Never,
                VscrollbarPolicy = PolicyType.Automatic,
                ShadowType       = ShadowType.In
            };
            var button_box = new VButtonBox()
            {
                Spacing     = 2,
                LayoutStyle = ButtonBoxStyle.Start
            };

            button_box.PackStart(adv_use_button = new Button(Catalog.GetString("Open in editor")), false, false, 0);
            button_box.PackStart(adv_add_button = new Button(Catalog.GetString("Create and save")), false, false, 0);

            scrolled_window.Add(adv_tree_view = new TreeView()
            {
                HeightRequest  = 150,
                HeadersVisible = false
            });
            hbox.PackStart(scrolled_window, true, true, 0);
            hbox.PackStart(button_box, false, false, 0);

            expander.Add(hbox);

            VBox.PackStart(builder_box, true, true, 0);
            VBox.PackStart(expander, false, false, 0);

            // Model is Name, SmartPlaylistDefinition
            ListStore list_model = new ListStore(typeof(string), typeof(SmartPlaylistDefinition));

            bool have_any_predefined = false;

            foreach (SmartPlaylistDefinition def in primary_source.PredefinedSmartPlaylists)
            {
                list_model.AppendValues(
                    String.Format("<b>{0}</b>\n<small>{1}</small>", def.Name, def.Description), def
                    );
                have_any_predefined = true;
            }

            adv_tree_view.Selection.Mode = SelectionMode.Multiple;
            adv_tree_view.Model          = list_model;
            CellRendererText renderer = new CellRendererText();

            renderer.Ellipsize = Pango.EllipsizeMode.End;
            adv_tree_view.AppendColumn("title", renderer, "markup", 0);
            adv_tree_view.Selection.Changed += HandleAdvSelectionChanged;

            UpdateAdvButtons(0);

            adv_add_button.Clicked += HandleAdvAdd;
            adv_use_button.Clicked += HandleAdvUse;

            if (!have_any_predefined)
            {
                expander.NoShowAll = true;
                expander.Hide();
            }

            Update();

            name_entry.GrabFocus();

            ShowAll();
        }