Ejemplo n.º 1
0
        public bool Execute(PhotoStore store, Photo photo, Gtk.Window parent_window)
        {
            var request = new VersionNameDialog(VersionNameDialog.RequestType.Create, photo, parent_window);

            var response = request.Run(out var name);

            if (response != ResponseType.Ok)
            {
                return(false);
            }

            try {
                photo.DefaultVersionId = photo.CreateVersion(name, photo.DefaultVersionId, true);
                store.Commit(photo);
                return(true);
            } catch (Exception e) {
                HandleException("Could not create a new version", e, parent_window);
                return(false);
            }
        }
Ejemplo n.º 2
0
        public bool Execute(PhotoStore store, Photo photo, Gtk.Window parent_window)
        {
            VersionNameDialog request = new VersionNameDialog(VersionNameDialog.RequestType.Rename,
                                                              photo, parent_window);

            string       new_name;
            ResponseType response = request.Run(out new_name);

            if (response != ResponseType.Ok)
            {
                return(false);
            }

            try {
                photo.RenameVersion(photo.DefaultVersionId, new_name);
                store.Commit(photo);
                return(true);
            } catch (Exception e) {
                HandleException("Could not rename a version", e, parent_window);
                return(false);
            }
        }