예제 #1
0
		public FullSlide (Gtk.Window parent, IBrowsableItem [] items) : base ("Slideshow")
		{
			screenshot =  PixbufUtils.LoadFromScreen (parent.GdkWindow);
			
			this.Destroyed += HandleDestroyed;

			this.TransientFor = parent;

			this.ButtonPressEvent += HandleSlideViewButtonPressEvent;
			this.KeyPressEvent += HandleSlideViewKeyPressEvent;
			this.AddEvents ((int) (EventMask.ButtonPressMask | EventMask.KeyPressMask | EventMask.PointerMotionMask));
			slideview = new SlideView (screenshot, items);
			this.Add (slideview);
			this.Decorated = false;
			this.Fullscreen();
			this.Realize ();

			busy = new Gdk.Cursor (Gdk.CursorType.Watch);
			this.GdkWindow.Cursor = busy;
			none = Empty ();

			hide = new Delay (2000, new GLib.IdleHandler (HideCursor));
		}
예제 #2
0
        public FullSlide(Gtk.Window parent, IBrowsableItem [] items) : base("Slideshow")
        {
            screenshot = PixbufUtils.LoadFromScreen(parent.GdkWindow);

            this.Destroyed += HandleDestroyed;

            this.TransientFor = parent;

            this.ButtonPressEvent += HandleSlideViewButtonPressEvent;
            this.KeyPressEvent    += HandleSlideViewKeyPressEvent;
            this.AddEvents((int)(EventMask.ButtonPressMask | EventMask.KeyPressMask | EventMask.PointerMotionMask));
            slideview = new SlideView(screenshot, items);
            this.Add(slideview);
            this.Decorated = false;
            this.Fullscreen();
            this.Realize();

            busy = new Gdk.Cursor(Gdk.CursorType.Watch);
            this.GdkWindow.Cursor = busy;
            none = GdkUtils.CreateEmptyCursor(GdkWindow.Display);

            hide = new Delay(2000, new GLib.IdleHandler(HideCursor));
        }
예제 #3
0
            public SlideShow(string name)
            {
                Tag tag;

                if (name != null)
                {
                    tag = Database.Tags.GetTagByName(name);
                }
                else
                {
                    int id = (int)Preferences.Get(Preferences.SCREENSAVER_TAG);
                    tag = Database.Tags.GetTagById(id);
                }

                Photo [] photos;
                if (tag != null)
                {
                    photos = Database.Photos.Query(new Tag [] { tag });
                }
                else if ((int)Preferences.Get(Preferences.SCREENSAVER_TAG) == 0)
                {
                    photos = db.Photos.Query(new Tag [] {});
                }
                else
                {
                    photos = new Photo [0];
                }

                window = new XScreenSaverSlide();
                SetStyle(window);
                if (photos.Length > 0)
                {
                    Array.Sort(photos, new Photo.RandomSort());

                    Gdk.Pixbuf black = new Gdk.Pixbuf(Gdk.Colorspace.Rgb, false, 8, 1, 1);
                    black.Fill(0x00000000);
                    slideview = new SlideView(black, photos);
                    window.Add(slideview);
                }
                else
                {
                    Gtk.HBox outer = new Gtk.HBox();
                    Gtk.HBox hbox  = new Gtk.HBox();
                    Gtk.VBox vbox  = new Gtk.VBox();

                    outer.PackStart(new Gtk.Label(String.Empty));
                    outer.PackStart(vbox, false, false, 0);
                    vbox.PackStart(new Gtk.Label(String.Empty));
                    vbox.PackStart(hbox, false, false, 0);
                    hbox.PackStart(new Gtk.Image(Gtk.Stock.DialogWarning, Gtk.IconSize.Dialog),
                                   false, false, 0);
                    outer.PackStart(new Gtk.Label(String.Empty));

                    string msg;
                    string long_msg;

                    if (tag != null)
                    {
                        msg      = String.Format(Catalog.GetString("No photos matching {0} found"), tag.Name);
                        long_msg = String.Format(Catalog.GetString("The tag \"{0}\" is not applied to any photos. Try adding\n" +
                                                                   "the tag to some photos or selecting a different tag in the\n" +
                                                                   "F-Spot preference dialog."), tag.Name);
                    }
                    else
                    {
                        msg      = Catalog.GetString("Search returned no results");
                        long_msg = Catalog.GetString("The tag F-Spot is looking for does not exist. Try\n" +
                                                     "selecting a different tag in the F-Spot preference\n" +
                                                     "dialog.");
                    }

                    Gtk.Label label = new Gtk.Label(msg);
                    hbox.PackStart(label, false, false, 0);

                    Gtk.Label long_label = new Gtk.Label(long_msg);
                    long_label.Markup = String.Format("<small>{0}</small>", long_msg);

                    vbox.PackStart(long_label, false, false, 0);
                    vbox.PackStart(new Gtk.Label(String.Empty));

                    window.Add(outer);
                    SetStyle(label);
                    SetStyle(long_label);
                    //SetStyle (image);
                }
                window.ShowAll();
            }
예제 #4
0
			public SlideShow (string name)
			{
				Tag tag;
				
				if (name != null)
					tag = Database.Tags.GetTagByName (name);
				else {
					int id = (int) Preferences.Get (Preferences.SCREENSAVER_TAG);
					tag = Database.Tags.GetTagById (id);
				}
				
				Photo [] photos;
				if (tag != null)
					photos = Database.Photos.Query (new Tag [] { tag } );
 				else if ((int) Preferences.Get (Preferences.SCREENSAVER_TAG) == 0)
 					photos = db.Photos.Query (new Tag [] {});
				else
					photos = new Photo [0];

				window = new XScreenSaverSlide ();
				SetStyle (window);
				if (photos.Length > 0) {
					Array.Sort (photos, new Photo.RandomSort ());
					
					Gdk.Pixbuf black = new Gdk.Pixbuf (Gdk.Colorspace.Rgb, false, 8, 1, 1);
					black.Fill (0x00000000);
					slideview = new SlideView (black, photos);
					window.Add (slideview);
				} else {
					Gtk.HBox outer = new Gtk.HBox ();
					Gtk.HBox hbox = new Gtk.HBox ();
					Gtk.VBox vbox = new Gtk.VBox ();

					outer.PackStart (new Gtk.Label (String.Empty));
					outer.PackStart (vbox, false, false, 0);
					vbox.PackStart (new Gtk.Label (String.Empty));
					vbox.PackStart (hbox, false, false, 0);
					hbox.PackStart (new Gtk.Image (Gtk.Stock.DialogWarning, Gtk.IconSize.Dialog),
							false, false, 0);
					outer.PackStart (new Gtk.Label (String.Empty));

					string msg;
					string long_msg;

					if (tag != null) {
						msg = String.Format (Catalog.GetString ("No photos matching {0} found"), tag.Name);
						long_msg = String.Format (Catalog.GetString ("The tag \"{0}\" is not applied to any photos. Try adding\n" +
											     "the tag to some photos or selecting a different tag in the\n" +
											     "F-Spot preference dialog."), tag.Name);
					} else {
						msg = Catalog.GetString ("Search returned no results");
						long_msg = Catalog.GetString ("The tag F-Spot is looking for does not exist. Try\n" + 
									      "selecting a different tag in the F-Spot preference\n" + 
									      "dialog.");
					}

					Gtk.Label label = new Gtk.Label (msg);
					hbox.PackStart (label, false, false, 0);

					Gtk.Label long_label = new Gtk.Label (long_msg);
					long_label.Markup  = String.Format ("<small>{0}</small>", long_msg);

					vbox.PackStart (long_label, false, false, 0);
					vbox.PackStart (new Gtk.Label (String.Empty));

					window.Add (outer);
					SetStyle (label);
					SetStyle (long_label);
					//SetStyle (image);
				}
				window.ShowAll ();
			}