private void BuildWidget()
        {
            Spacing = 10;

            Label title = new Label();
            title.Markup = String.Format("<big><b>{0}</b></big>",
                             GLib.Markup.EscapeText(Catalog.GetString("iTunes Music Store")));
            title.Xalign = 0.0f;

            Label label = new Label(plugin.Description);
            label.Wrap = true;

            Alignment alignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
            alignment.LeftPadding = 10;
            alignment.RightPadding = 10;

            Frame frame = new Frame();
            Alignment frame_alignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
            frame_alignment.BorderWidth = 5;
            frame_alignment.LeftPadding = 10;
            frame_alignment.RightPadding = 10;
            frame_alignment.BottomPadding = 10;

            frame.LabelWidget = new Label (Catalog.GetString ("Account Information"));
            frame.ShadowType = ShadowType.EtchedIn;

            table = new PropertyTable();
            table.RowSpacing = 5;

            user_entry = table.AddEntry(Catalog.GetString("Username"), "", false);
            pass_entry = table.AddEntry(Catalog.GetString("Password"), "", false);
            pass_entry.Visibility = false;

            user_entry.Text = plugin.Username;
            pass_entry.Text = plugin.Password;
            user_entry.Changed += OnUserPassChanged;
            pass_entry.Changed += OnUserPassChanged;

            country_combo = ComboBox.NewText ();
            country_combo.Changed += OnCountryChanged;

            TreeIter loaded_iter = TreeIter.Zero;
            foreach (string country in FairStore.Countries.AllKeys) {
                TreeIter iter = ((ListStore)country_combo.Model).AppendValues (country);
                if (country == plugin.Country)
                    loaded_iter = iter;
            }
            country_combo.SetActiveIter (loaded_iter);

            table.AddWidget (Catalog.GetString ("Country"), country_combo, false);

            frame_alignment.Add(table);
            frame.Add(frame_alignment);

            Label copyright = new Label (Catalog.GetString ("Apple and iTunes Music Store are registered trademarks of Apple Computer, Inc."));

            PackStart(title, false, false, 0);
            PackStart(label, false, false, 0);
            PackStart(alignment, false, false, 0);
            PackStart(frame, true, false, 0);
            PackStart(copyright, false, false, 0);

            ShowAll();
        }
Пример #2
0
        public DapPropertiesDialog(DapSource source) : base(
                // Translators: {0} is the name assigned to a Digital Audio Player by its owner
                String.Format(Catalog.GetString("{0} Properties"), source.Name),
                null,
                DialogFlags.Modal,
                Stock.Close,
                ResponseType.Close)
        {
            this.source = source;

            HBox iconbox = new HBox();

            iconbox.Spacing = 10;
            //Image icon = new Image (source.Properties.Get<string> ("Icon.Names")[0], IconSize.Dialog);
            //icon.Yalign = 0.0f;
            //icon.Pixbuf = device.GetIcon(48);
            //iconbox.PackStart(icon, false, false, 0);

            VBox box = new VBox();

            box.Spacing = 10;

            PropertyTable table = new PropertyTable();

            table.ColumnSpacing = 10;
            table.RowSpacing    = 5;

            if (!source.IsReadOnly && source.CanRename)
            {
                nameEntry          = table.AddEntry(Catalog.GetString("Device name"), source.Name);
                nameEntry.Changed += OnEntryChanged;
            }
            else
            {
                table.AddLabel(Catalog.GetString("Device name"), source.Name);
            }

            /*if(device.ShowOwner) {
             *  if(!device.IsReadOnly && device.CanSetOwner) {
             *      ownerEntry = table.AddEntry(Catalog.GetString("Owner name"), device.Owner);
             *      ownerEntry.Changed += OnEntryChanged;
             *  } else {
             *      table.AddLabel(Catalog.GetString("Owner name"), device.Owner);
             *  }
             * }*/

            if (!source.IsReadOnly)
            {
                try {
                    VBox profile_description_box            = new VBox();
                    ProfileComboBoxConfigurable profile_box = new ProfileComboBoxConfigurable(ServiceManager.MediaProfileManager,
                                                                                              source.UniqueId, profile_description_box);
                    profile_box.Combo.MimeTypeFilter = source.AcceptableMimeTypes;
                    table.AddWidget(Catalog.GetString("Encode to"), profile_box);
                    table.AddWidget(null, profile_description_box);
                    profile_description_box.Show();

                    table.AddSeparator();
                } catch (Exception e) {
                    Console.WriteLine(e);
                }
            }

            table.AddWidget(Catalog.GetString("Capacity used"), UsedProgressBar);

            box.PackStart(table, true, true, 0);

            PropertyTable extTable = new PropertyTable();

            extTable.ColumnSpacing = 10;
            extTable.RowSpacing    = 5;

            foreach (DapSource.DapProperty property in source.DapProperties)
            {
                extTable.AddLabel(property.Name, property.Value);
            }

            Expander expander = new Expander(Catalog.GetString("Advanced details"));

            expander.Add(extTable);
            box.PackStart(expander, false, false, 0);

            BorderWidth = 10;
            Resizable   = false;
            iconbox.PackStart(box, true, true, 0);
            iconbox.ShowAll();
            ContentArea.Add(iconbox);
        }
Пример #3
0
        public DapPropertiesDialog(DapSource source)
            : base(// Translators: {0} is the name assigned to a Digital Audio Player by its owner
            String.Format(Catalog.GetString("{0} Properties"), source.Name),
            null,
            DialogFlags.Modal,
            Stock.Close,
            ResponseType.Close)
        {
            this.source = source;

            HBox iconbox = new HBox();
            iconbox.Spacing = 10;
            //Image icon = new Image (source.Properties.Get<string> ("Icon.Names")[0], IconSize.Dialog);
            //icon.Yalign = 0.0f;
            //icon.Pixbuf = device.GetIcon(48);
            //iconbox.PackStart(icon, false, false, 0);

            VBox box = new VBox();
            box.Spacing = 10;

            PropertyTable table = new PropertyTable();
            table.ColumnSpacing = 10;
            table.RowSpacing = 5;

            if(!source.IsReadOnly && source.CanRename) {
                nameEntry = table.AddEntry(Catalog.GetString("Device name"), source.Name);
                nameEntry.Changed += OnEntryChanged;
            } else {
                table.AddLabel(Catalog.GetString("Device name"), source.Name);
            }

            /*if(device.ShowOwner) {
                if(!device.IsReadOnly && device.CanSetOwner) {
                    ownerEntry = table.AddEntry(Catalog.GetString("Owner name"), device.Owner);
                    ownerEntry.Changed += OnEntryChanged;
                } else {
                    table.AddLabel(Catalog.GetString("Owner name"), device.Owner);
                }
            }*/

            if(!source.IsReadOnly) {
                try {
                    VBox profile_description_box = new VBox();
                    ProfileComboBoxConfigurable profile_box = new ProfileComboBoxConfigurable(ServiceManager.MediaProfileManager,
                        source.UniqueId, profile_description_box);
                    profile_box.Combo.MimeTypeFilter = source.AcceptableMimeTypes;
                    table.AddWidget(Catalog.GetString("Encode to"), profile_box);
                    table.AddWidget(null, profile_description_box);
                    profile_description_box.Show();

                    table.AddSeparator();
                } catch(Exception e) {
                    Console.WriteLine(e);
                }
            }

            table.AddWidget(Catalog.GetString("Capacity used"), UsedProgressBar);

            box.PackStart(table, true, true, 0);

            PropertyTable extTable = new PropertyTable();
            extTable.ColumnSpacing = 10;
            extTable.RowSpacing = 5;

            foreach(DapSource.DapProperty property in source.DapProperties) {
                extTable.AddLabel(property.Name, property.Value);
            }

            Expander expander = new Expander(Catalog.GetString("Advanced details"));
            expander.Add(extTable);
            box.PackStart(expander, false, false, 0);

            BorderWidth = 10;
            Resizable = false;
            iconbox.PackStart(box, true, true, 0);
            iconbox.ShowAll();
            ContentArea.Add(iconbox);
        }
Пример #4
0
        private void BuildWidget()
        {
            Spacing = 10;

            Label title = new Label();

            title.Markup = String.Format("<big><b>{0}</b></big>",
                                         GLib.Markup.EscapeText(Catalog.GetString("Music Locker")));
            title.Xalign = 0.0f;

            Label label = new Label(Catalog.GetString("Enter your MP3tunes account information"));

            label.Xalign = 0.0f;

            Alignment account_alignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);

            account_alignment.BorderWidth   = 5;
            account_alignment.LeftPadding   = 10;
            account_alignment.RightPadding  = 10;
            account_alignment.BottomPadding = 10;

            table               = new PropertyTable();
            table.RowSpacing    = 5;
            table.ColumnSpacing = 5;

            user_entry            = table.AddEntry(Catalog.GetString("Username"), "", false);
            pass_entry            = table.AddEntry(Catalog.GetString("Password"), "", false);
            pass_entry.Visibility = false;
            user_entry.Text       = plugin.Username;
            pass_entry.Text       = plugin.Password;
            user_entry.Changed   += OnUserPassChanged;
            pass_entry.Changed   += OnUserPassChanged;

            account_alignment.Add(table);

            HBox logo_box = new HBox();

            logo_box.Spacing = 20;

            logo        = new Image();
            logo.Pixbuf = Gdk.Pixbuf.LoadFromResource("locker-logo.png");
            logo.Xalign = 0.0f;

            VBox   button_box            = new VBox();
            Button create_account_button = new Button(Catalog.GetString("Create an account..."));

            create_account_button.Clicked += delegate(object o, EventArgs args) {
                plugin.CreateAccount();
            };
            button_box.PackStart(create_account_button, true, false, 0);

            logo_box.PackStart(logo, false, false, 0);
            logo_box.PackStart(button_box, true, true, 0);

            PackStart(title, false, false, 0);
            PackStart(label, false, false, 0);
            PackStart(account_alignment, false, false, 0);
            PackStart(logo_box, false, false, 0);

            ShowAll();
        }
        private void BuildWidget()
        {
            Spacing = 10;

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

            Label label = new Label(Catalog.GetString("Enter your MP3tunes account information"));
            label.Xalign = 0.0f;

            Alignment account_alignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
            account_alignment.BorderWidth = 5;
            account_alignment.LeftPadding = 10;
            account_alignment.RightPadding = 10;
            account_alignment.BottomPadding = 10;

            table = new PropertyTable();
            table.RowSpacing = 5;
            table.ColumnSpacing = 5;

            user_entry = table.AddEntry(Catalog.GetString("Username"), "", false);
            pass_entry = table.AddEntry(Catalog.GetString("Password"), "", false);
            pass_entry.Visibility = false;
            user_entry.Text = plugin.Username;
            pass_entry.Text = plugin.Password;
            user_entry.Changed += OnUserPassChanged;
            pass_entry.Changed += OnUserPassChanged;

            account_alignment.Add(table);

            HBox logo_box = new HBox();
            logo_box.Spacing = 20;

            logo = new Image();
            logo.Pixbuf = Gdk.Pixbuf.LoadFromResource("locker-logo.png");
            logo.Xalign = 0.0f;

            VBox button_box = new VBox();
            Button create_account_button = new Button(Catalog.GetString("Create an account..."));
            create_account_button.Clicked += delegate(object o, EventArgs args) {
                plugin.CreateAccount();
            };
            button_box.PackStart(create_account_button, true, false, 0);

            logo_box.PackStart(logo, false, false, 0);
            logo_box.PackStart(button_box, true, true, 0);

            PackStart(title, false, false, 0);
            PackStart(label, false, false, 0);
            PackStart(account_alignment, false, false, 0);
            PackStart(logo_box, false, false, 0);

            ShowAll();
        }
        private void BuildWidget()
        {
            Spacing = 10;

            Label title = new Label();

            title.Markup = String.Format("<big><b>{0}</b></big>",
                                         GLib.Markup.EscapeText(Catalog.GetString("iTunes Music Store")));
            title.Xalign = 0.0f;

            Label label = new Label(plugin.Description);

            label.Wrap = true;

            Alignment alignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);

            alignment.LeftPadding  = 10;
            alignment.RightPadding = 10;

            Frame     frame           = new Frame();
            Alignment frame_alignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);

            frame_alignment.BorderWidth   = 5;
            frame_alignment.LeftPadding   = 10;
            frame_alignment.RightPadding  = 10;
            frame_alignment.BottomPadding = 10;

            frame.LabelWidget = new Label(Catalog.GetString("Account Information"));
            frame.ShadowType  = ShadowType.EtchedIn;

            table            = new PropertyTable();
            table.RowSpacing = 5;

            user_entry            = table.AddEntry(Catalog.GetString("Username"), "", false);
            pass_entry            = table.AddEntry(Catalog.GetString("Password"), "", false);
            pass_entry.Visibility = false;

            user_entry.Text     = plugin.Username;
            pass_entry.Text     = plugin.Password;
            user_entry.Changed += OnUserPassChanged;
            pass_entry.Changed += OnUserPassChanged;

            country_combo          = ComboBox.NewText();
            country_combo.Changed += OnCountryChanged;

            TreeIter loaded_iter = TreeIter.Zero;

            foreach (string country in FairStore.Countries.AllKeys)
            {
                TreeIter iter = ((ListStore)country_combo.Model).AppendValues(country);
                if (country == plugin.Country)
                {
                    loaded_iter = iter;
                }
            }
            country_combo.SetActiveIter(loaded_iter);

            table.AddWidget(Catalog.GetString("Country"), country_combo, false);

            frame_alignment.Add(table);
            frame.Add(frame_alignment);

            Label copyright = new Label(Catalog.GetString("Apple and iTunes Music Store are registered trademarks of Apple Computer, Inc."));

            PackStart(title, false, false, 0);
            PackStart(label, false, false, 0);
            PackStart(alignment, false, false, 0);
            PackStart(frame, true, false, 0);
            PackStart(copyright, false, false, 0);

            ShowAll();
        }