Exemplo n.º 1
0
 protected void HandleAddResponse(object sender, Gtk.ResponseArgs args)
 {
     if (args.ResponseId == Gtk.ResponseType.Ok)
     {
         SmugMugAccount account = new SmugMugAccount(username, password);
         SmugMugAccountManager.GetInstance().AddAccount(account);
     }
     Dialog.Destroy();
 }
Exemplo n.º 2
0
        public static SmugMugAccountManager GetInstance()
        {
            if (instance == null)
            {
                instance = new SmugMugAccountManager();
            }

            return(instance);
        }
Exemplo n.º 3
0
 protected void HandleEditResponse(object sender, Gtk.ResponseArgs args)
 {
     if (args.ResponseId == Gtk.ResponseType.Ok)
     {
         account.Username = username;
         account.Password = password;
         SmugMugAccountManager.GetInstance().MarkChanged(true, account);
     }
     else if (args.ResponseId == Gtk.ResponseType.Reject)
     {
         // NOTE we are using Reject to signal the remove action.
         SmugMugAccountManager.GetInstance().RemoveAccount(account);
     }
     Dialog.Destroy();
 }
Exemplo n.º 4
0
        public SmugMugExport(IBrowsableCollection selection) : base("smugmug_export_dialog")
        {
            this.items             = selection.Items;
            album_button.Sensitive = false;
            IconView view = new IconView(selection);

            view.DisplayDates = false;
            view.DisplayTags  = false;

            Dialog.Modal        = false;
            Dialog.TransientFor = null;
            Dialog.Close       += HandleCloseEvent;

            thumb_scrolledwindow.Add(view);
            view.Show();
            Dialog.Show();

            SmugMugAccountManager manager = SmugMugAccountManager.GetInstance();

            manager.AccountListChanged += PopulateSmugMugOptionMenu;
            PopulateSmugMugOptionMenu(manager, null);

            if (edit_button != null)
            {
                edit_button.Clicked += HandleEditGallery;
            }

            rh = new Gtk.ResponseHandler(HandleResponse);
            Dialog.Response += HandleResponse;
            connect          = true;
            HandleSizeActive(null, null);
            Connect();

            scale_check.Toggled += HandleScaleCheckToggled;

            LoadPreference(Preferences.EXPORT_SMUGMUG_SCALE);
            LoadPreference(Preferences.EXPORT_SMUGMUG_SIZE);
            LoadPreference(Preferences.EXPORT_SMUGMUG_ROTATE);
            LoadPreference(Preferences.EXPORT_SMUGMUG_BROWSER);
        }
Exemplo n.º 5
0
        private void PopulateSmugMugOptionMenu(SmugMugAccountManager manager, SmugMugAccount changed_account)
        {
            Gtk.Menu menu = new Gtk.Menu();
            this.account = changed_account;
            int pos = -1;

            accounts = manager.GetAccounts();
            if (accounts == null || accounts.Count == 0)
            {
                Gtk.MenuItem item = new Gtk.MenuItem(Mono.Unix.Catalog.GetString("(No Gallery)"));
                menu.Append(item);
                gallery_optionmenu.Sensitive = false;
                edit_button.Sensitive        = false;
            }
            else
            {
                int i = 0;
                foreach (SmugMugAccount account in accounts)
                {
                    if (account == changed_account)
                    {
                        pos = i;
                    }

                    Gtk.MenuItem item = new Gtk.MenuItem(account.Username);
                    menu.Append(item);
                    i++;
                }
                gallery_optionmenu.Sensitive = true;
                edit_button.Sensitive        = true;
            }

            menu.ShowAll();
            gallery_optionmenu.Menu = menu;
            gallery_optionmenu.SetHistory((uint)pos);
        }
Exemplo n.º 6
0
        private void PopulateSmugMugOptionMenu(SmugMugAccountManager manager, SmugMugAccount changed_account)
        {
            Gtk.Menu menu = new Gtk.Menu ();
                        this.account = changed_account;
                        int pos = -1;

                        accounts = manager.GetAccounts ();
                        if (accounts == null || accounts.Count == 0) {
                                Gtk.MenuItem item = new Gtk.MenuItem (Mono.Unix.Catalog.GetString ("(No Gallery)"));
                                menu.Append (item);
                                gallery_optionmenu.Sensitive = false;
                                edit_button.Sensitive = false;
                        } else {
                                int i = 0;
                                foreach (SmugMugAccount account in accounts) {
                                        if (account == changed_account)
                                                pos = i;

                                        Gtk.MenuItem item = new Gtk.MenuItem (account.Username);
                                        menu.Append (item);
                                        i++;
                                }
                                gallery_optionmenu.Sensitive = true;
                                edit_button.Sensitive = true;
                        }

                        menu.ShowAll ();
                        gallery_optionmenu.Menu = menu;
                        gallery_optionmenu.SetHistory ((uint)pos);
        }
Exemplo n.º 7
0
        public static SmugMugAccountManager GetInstance()
        {
            if (instance == null) {
                                instance = new SmugMugAccountManager ();
                        }

                        return instance;
        }