// ============================================
        // PRIVATE Members
        // ============================================
        // ============================================
        // PUBLIC Constructors
        // ============================================
        public NetworkViewer()
        {
            // Initialize Scrolled Window
            BorderWidth = 0;
            ShadowType = ShadowType.EtchedIn;
            SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            // Initialize Network Store
            this.store = new NetworkStore();

            // Initialize Icon View
            iconView = new IconView(store);
            iconView.TextColumn = NetworkStore.COL_NAME;
            iconView.PixbufColumn = NetworkStore.COL_PIXBUF;
            iconView.SelectionMode = SelectionMode.Single;

            // Initialize Icon View Events
            iconView.ItemActivated += new ItemActivatedHandler(OnItemActivated);
            iconView.ButtonPressEvent += new ButtonPressEventHandler(OnItemClicked);

            // Initialize Icon View Drag & Drop
            iconView.EnableModelDragDest(Dnd.TargetTable, Gdk.DragAction.Copy);
            iconView.DragDataReceived += new DragDataReceivedHandler(OnDragDataReceived);

            // Add IconView to ScrolledWindow
            Add(iconView);
        }
Example #2
0
        // ============================================
        // PRIVATE Members
        // ============================================

        // ============================================
        // PUBLIC Constructors
        // ============================================
        public NetworkViewer()
        {
            // Initialize Scrolled Window
            BorderWidth = 0;
            ShadowType  = ShadowType.EtchedIn;
            SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            // Initialize Network Store
            this.store = new NetworkStore();

            // Initialize Icon View
            iconView               = new IconView(store);
            iconView.TextColumn    = NetworkStore.COL_NAME;
            iconView.PixbufColumn  = NetworkStore.COL_PIXBUF;
            iconView.SelectionMode = SelectionMode.Single;

            // Initialize Icon View Events
            iconView.ItemActivated    += new ItemActivatedHandler(OnItemActivated);
            iconView.ButtonPressEvent += new ButtonPressEventHandler(OnItemClicked);

            // Initialize Icon View Drag & Drop
            iconView.EnableModelDragDest(Dnd.TargetTable, Gdk.DragAction.Copy);
            iconView.DragDataReceived += new DragDataReceivedHandler(OnDragDataReceived);

            // Add IconView to ScrolledWindow
            Add(iconView);
        }
Example #3
0
        public IconView()
        {
            store    = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(object));
            iconView = new Gtk.IconView(store);
            iconView.PixbufColumn  = 0;
            iconView.ColumnSpacing = 6;
            iconView.RowSpacing    = 6;
            CellRendererText cr = new CellRendererText();

            cr.WrapWidth = 80;
            cr.WrapMode  = Pango.WrapMode.Word;
            cr.Yalign    = 0.0f;
            cr.Xalign    = 0.5f;
            iconView.PackEnd(cr, true);
            iconView.ItemWidth = 80;
            iconView.SetAttributes(cr, "text", 1);

            iconView.SelectionChanged   += new EventHandler(HandleIconSelected);
            iconView.ActivateCursorItem += new ActivateCursorItemHandler(HandleDoubleClick);

            this.Add(iconView);
            this.WidthRequest  = 350;
            this.HeightRequest = 200;
            this.ShadowType    = Gtk.ShadowType.In;
        }
Example #4
0
		public ViewNameIcon() : base()
		{
			upbutton = new Button();
			upbutton.Add( new Image(Stock.GoUp, IconSize.Button) );
			upbutton.Clicked += OnUpClicked;
			downbutton = new Button();			
			downbutton.Add( new Image(Stock.GoDown, IconSize.Button) );
			downbutton.Clicked += OnDownClicked;
			swindow = new ScrolledWindow();
			view = new IconView();
			
			CellRendererPixbuf cellicon= new CellRendererPixbuf();
			CellRendererText celltext = new CellRendererText();
			celltext.Xalign=0.5f;
			view.PackStart(cellicon, false);
			view.SetCellDataFunc(cellicon, CellRenderFunctions.RenderIcon);
			view.PackStart(celltext, false);
			view.SetCellDataFunc(celltext, CellRenderFunctions.RenderName);
			view.SelectionMode = Gtk.SelectionMode.Browse;
			view.SelectionChanged += OnSelectionChanged;
			view.ItemActivated += OnRowActivated;
			swindow.Add(view);
			swindow.HscrollbarPolicy = PolicyType.Never;
			swindow.VscrollbarPolicy = PolicyType.Automatic;
			this.PackStart(upbutton, false, false, 0);
			this.PackStart(swindow, true, true, 0);
			this.PackStart(downbutton, false, false, 0);
			
			store = new StoreBase();
			view.Model=store.ViewModel;
			
			ShowAll();
		}
    private void OnSwitchPage(object sender, SwitchPageArgs s)
    {
        OnFilterbarCloseClicked(sender, s);
        int pageNum = ((Gtk.Notebook)sender).Page;

        CurrentIconView  = IconViews[pageNum];
        FilterEntry.Text = "";
        switch (pageNum)
        {
        case 0: man.ArtType = CConfiguration.ArtType.atBackground_gnome; break;

        case 1: man.ArtType = CConfiguration.ArtType.atBackground_other; break;

        case 2: man.ArtType = CConfiguration.ArtType.atBackground_nature; break;

        case 3: man.ArtType = CConfiguration.ArtType.atBackground_abstract; break;

        case 4: man.ArtType = CConfiguration.ArtType.atApplication; break;

        case 5: man.ArtType = CConfiguration.ArtType.atWindowDecoration; break;

        case 6: man.ArtType = CConfiguration.ArtType.atIcon; break;

        case 7: man.ArtType = CConfiguration.ArtType.atGdmGreeter; break;

        case 8: man.ArtType = CConfiguration.ArtType.atSplash; break;

        case 9: man.ArtType = CConfiguration.ArtType.atGtkEngine; break;
        }

        Gtk.TreeIter iter;
        CurrentIconView.Model.GetIterFirst(out iter);
        //Falls noch kein gefüllter Store (und damit noch kein gültiger Iterator -> Stamp==0
        if (iter.Stamp == 0)
        {
            man.GetAllThumbs();
            FillStore(pageNum);
            Gtk.TreeModelFilter filter = new Gtk.TreeModelFilter(CurrentIconView.Model, null);
            filter.VisibleFunc    = new Gtk.TreeModelFilterVisibleFunc(onFilter);
            CurrentIconView.Model = filter;
            CurrentIconView.GrabFocus();
        }
        if (CurrentIconView.SelectedItems.Length > 0)
        {
            man.ThemeIndex = int.Parse(CurrentIconView.SelectedItems[0].ToString());
        }
        FillExtendedSection(man.Theme);
    }
Example #6
0
		public DemoIconView () : base ("Gtk.IconView demo")
		{
			SetDefaultSize (650, 400);
			DeleteEvent += new DeleteEventHandler (OnWinDelete);

			VBox vbox = new VBox (false, 0);
			Add (vbox);

			Toolbar toolbar = new Toolbar ();
			vbox.PackStart (toolbar, false, false, 0);

			upButton = new ToolButton (Stock.GoUp);
			upButton.IsImportant = true;
			upButton.Sensitive = false;
			toolbar.Insert (upButton, -1);

			ToolButton homeButton = new ToolButton (Stock.Home);
			homeButton.IsImportant = true;
			toolbar.Insert (homeButton, -1);

			fileIcon = GetIcon (Stock.File);
			dirIcon = GetIcon (Stock.Open);

			ScrolledWindow sw = new ScrolledWindow ();
			sw.ShadowType = ShadowType.EtchedIn;
			sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
			vbox.PackStart (sw, true, true, 0);

			// Create the store and fill it with the contents of '/'
			store = CreateStore ();
			FillStore ();

			IconView iconView = new IconView (store);
			iconView.SelectionMode = SelectionMode.Multiple;

			upButton.Clicked += new EventHandler (OnUpClicked);
			homeButton.Clicked += new EventHandler (OnHomeClicked);

			iconView.TextColumn = COL_DISPLAY_NAME;
			iconView.PixbufColumn = COL_PIXBUF;

			iconView.ItemActivated += new ItemActivatedHandler (OnItemActivated);
			sw.Add (iconView);
			iconView.GrabFocus ();

			ShowAll ();
		}
        public SelectAvatarDialog(Window parent)
            : base()
        {
            XML glade = new XML (null, "FileFind.Meshwork.GtkClient.meshwork.glade",
                        "SelectAvatarDialog", null);

            this.Remove (this.Child);

            glade.Autoconnect (this);

            Window window = (Window) glade ["SelectAvatarDialog"];
            this.Title = window.Title;
            Widget child = window.Child;
            child.Reparent (this);
            window.Destroy ();
            child.Show ();

            store = new ListStore (typeof (Gdk.Pixbuf),
                        typeof (string));

            avatarIconView = new IconView (store);
            avatarIconView.PixbufColumn = 0;
            avatarIconView.ItemActivated += avatarIconView_ItemActivated;
            avatarIconView.SelectionChanged += avatarIconView_SelectionChanged;
            avatarIconView.DragDataReceived += avatarIconView_DragDataReceived;
            avatarIconView.ButtonPressEvent += avatarIconView_ButtonPressEvent;

            Gtk.Drag.DestSet (avatarIconView, DestDefaults.All,
                    new TargetEntry [] {
                        new TargetEntry ("STRING",
                                0, (uint) 0)
                    },
                    Gdk.DragAction.Copy);

            iconViewScrolledWindow.Add (avatarIconView);

            avatarIconView.Show ();

            Resize (570, 400);

            GLib.Timeout.Add (50, new GLib.TimeoutHandler (PulseProgressBar));

            // Load images
            gravatarThread = new Thread (new ThreadStart (LoadImages));
            gravatarThread.Start ();
        }
Example #8
0
        // ============================================
        // PRIVATE Members
        // ============================================

        // ============================================
        // PUBLIC Constructors
        // ============================================
        /// Create New Folder Viewer
        public FolderViewer(UserInfo userInfo)
        {
            // Initialize Scrolled Window
            BorderWidth = 0;
            ShadowType  = ShadowType.EtchedIn;
            SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            // Initialize UserInfo
            this.userInfo = userInfo;
            if (this.userInfo == MyInfo.GetInstance())
            {
                baseDirectory = Paths.UserSharedDirectory(MyInfo.Name);
            }
            else
            {
                baseDirectory = "/";
            }
            currentDirectory = new DirectoryInfo(baseDirectory);

            // Initialize Folder Store
            this.store = new FolderStore();
            this.store.DirectoryAdded += new ObjectEventHandler(OnStoreDirAdded);
            this.store.FileAdded      += new ObjectEventHandler(OnStoreFileAdded);

            // Initialize Icon View
            iconView               = new IconView(store);
            iconView.TextColumn    = FolderStore.COL_NAME;
            iconView.PixbufColumn  = FolderStore.COL_PIXBUF;
            iconView.SelectionMode = SelectionMode.Multiple;

            // Initialize Icon View Events
            iconView.ItemActivated    += new ItemActivatedHandler(OnItemActivated);
            iconView.ButtonPressEvent += new ButtonPressEventHandler(OnItemClicked);

            // Initialize Icon View Drag & Drop
            iconView.EnableModelDragDest(Dnd.TargetTable, Gdk.DragAction.Copy);
            iconView.DragDataReceived += new DragDataReceivedHandler(OnDragDataReceived);

            // Add IconView to ScrolledWindow
            Add(iconView);

            // Refresh Icon View
            Refresh();
        }
		public TimeDialog (Db db, IBrowsableCollection collection) : base ("time_dialog")
		{
			this.db = db;
			this.collection = collection;

			tray = new TrayView (collection);
			tray_scrolled.Add (tray);
			tray.Selection.Changed += HandleSelectionChanged;

			view = new PhotoImageView (collection);
			view_scrolled.Add (view);
			Item = view.Item;
			Item.Changed += HandleItemChanged;
			Item.MoveFirst ();

			//forward_button.Clicked += HandleForwardClicked;
			//back_button.Clicked += HandleBackClicked;
			ok_button.Clicked += HandleOkClicked;
			cancel_button.Clicked += HandleCancelClicked;

			photo_spin.ValueChanged += HandleSpinChanged;
			photo_spin.SetIncrements (1.0, 1.0);
			photo_spin.Adjustment.StepIncrement = 1.0;
			photo_spin.Wrap = true;

			date_edit.TimeChanged += HandleTimeChanged;
			date_edit.DateChanged += HandleTimeChanged;
			Gtk.Entry entry = (Gtk.Entry) date_edit.Children [0];
			entry.Changed += HandleTimeChanged;
			entry = (Gtk.Entry) date_edit.Children [2];
			entry.Changed += HandleTimeChanged;
			offset_entry.Changed += HandleOffsetChanged;
			Dialog.ShowAll ();
			HandleCollectionChanged (collection);

			spacing_entry.Changed += HandleSpacingChanged;
			spacing_entry.Sensitive = ! difference_check.Active;
		      
			difference_check.Toggled += HandleActionToggled;
		}
        // ============================================
        // PRIVATE Members
        // ============================================

        // ============================================
        // PUBLIC Constructors
        // ============================================
        /// Create New Folder Viewer
        public ImageViewer()
        {
            // Initialize Scrolled Window
            BorderWidth = 0;
            ShadowType  = ShadowType.EtchedIn;
            SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            // Initialize Folder Store
            this.store = new ImageStore();

            // Initialize Icon View
            iconView               = new IconView(store);
            iconView.TextColumn    = ImageStore.COL_NAME;
            iconView.PixbufColumn  = ImageStore.COL_PIXBUF;
            iconView.SelectionMode = SelectionMode.Multiple;

            // Initialize Icon View Events
            iconView.ButtonPressEvent += new ButtonPressEventHandler(OnItemClicked);

            // Add IconView to ScrolledWindow
            Add(iconView);
        }
        // ============================================
        // PRIVATE Members
        // ============================================
        // ============================================
        // PUBLIC Constructors
        // ============================================
        /// Create New Folder Viewer
        public ImageViewer()
        {
            // Initialize Scrolled Window
            BorderWidth = 0;
            ShadowType = ShadowType.EtchedIn;
            SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            // Initialize Folder Store
            this.store = new ImageStore();

            // Initialize Icon View
            iconView = new IconView(store);
            iconView.TextColumn = ImageStore.COL_NAME;
            iconView.PixbufColumn = ImageStore.COL_PIXBUF;
            iconView.SelectionMode = SelectionMode.Multiple;

            // Initialize Icon View Events
            iconView.ButtonPressEvent += new ButtonPressEventHandler(OnItemClicked);

            // Add IconView to ScrolledWindow
            Add(iconView);
        }
		public IconView ()
		{
			store = new ListStore (typeof (Gdk.Pixbuf), typeof (string), typeof (object));
			iconView = new Gtk.IconView (store);
			iconView.PixbufColumn = 0;
			iconView.ColumnSpacing = 6;
			iconView.RowSpacing = 6;
			CellRendererText cr = new CellRendererText ();
			cr.WrapWidth = 80;
			cr.WrapMode = Pango.WrapMode.Word;
			cr.Yalign = 0.0f;
			cr.Xalign = 0.5f;
			iconView.PackEnd (cr, true);
			iconView.ItemWidth = 80;
			iconView.SetAttributes (cr, "text", 1);

			iconView.SelectionChanged += new EventHandler (HandleIconSelected);
			iconView.ActivateCursorItem += new ActivateCursorItemHandler (HandleDoubleClick);

			this.Add (iconView);
			this.WidthRequest = 350;
			this.HeightRequest = 200;
			this.ShadowType = Gtk.ShadowType.In;
		}
Example #13
0
 void initialize()
 {
     this.piecesStore = new ListStore(typeof(string),typeof(ConstructorInfo),typeof(Gdk.Pixbuf));
     this.piecesView = new IconView();
     this.piecesView.Model = this.piecesStore;
     this.piecesView.TextColumn = 0x00;
     this.piecesView.PixbufColumn = 0x02;
     this.piecesView.SelectionChanged += pieces_selection_changed;
     this.sketchpad = new SketchPad();
     this.sketchpad.RootPiece = new RunPiece();
     this.sketchpad.Tool = SketchPadTool.CreateNew;
     this.invokePieces(Assembly.GetExecutingAssembly());
     ScrolledWindow sw = new ScrolledWindow();
     ScrolledWindow sw2 = new ScrolledWindow();
     sw.Add(this.piecesView);
     sw.SetPolicy(PolicyType.Never,PolicyType.Always);
     sw.SetSizeRequest(1920,100);
     sw2.AddWithViewport(this.sketchpad);
     sw2.SetPolicy(PolicyType.Always,PolicyType.Always);
     sw2.SetSizeRequest(700,500);
     this.vbox1.PackStart(sw,false,false,0x00);
     this.vbox1.PackStart(sw2,true,true,0x00);
     this.Maximize();
     this.ShowAll();
 }
		public bool Execute (Tag t)
		{
			this.CreateDialog ("edit_icon_dialog");

			this.Dialog.Title = String.Format (Catalog.GetString ("Edit Icon for Tag {0}"), t.Name);

			PreviewPixbuf = t.Icon;

			query = new FSpot.PhotoQuery (db.Photos);
			
			if (db.Tags.Hidden != null)
				query.Terms = FSpot.OrTerm.FromTags (new Tag []{ t, db.Tags.Hidden });
			else 
				query.Terms = new FSpot.Literal (t);

			image_view = new FSpot.PhotoImageView (query);
			image_view.SelectionXyRatio = 1.0;
			image_view.SelectionChanged += HandleSelectionChanged;
			image_view.PhotoChanged += HandlePhotoChanged;

                        external_photo_chooser = new Gtk.FileChooserButton (Catalog.GetString ("Select Photo from file"),
                                                                 Gtk.FileChooserAction.Open);

			external_photo_chooser.Filter = new FileFilter();
			external_photo_chooser.Filter.AddPixbufFormats();
                        external_photo_chooser.LocalOnly = false;
                        external_photo_chooser_hbox.PackStart (external_photo_chooser);

    			Dialog.ShowAll ();
			external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;

			photo_scrolled_window.Add (image_view);

			if (query.Count > 0) {
				photo_spin_button.Wrap = true;
				photo_spin_button.Adjustment.Lower = 1.0;
				photo_spin_button.Adjustment.Upper = (double) query.Count;
				photo_spin_button.Adjustment.StepIncrement = 1.0;
				photo_spin_button.ValueChanged += HandleSpinButtonChanged;
				
				image_view.Item.Index = 0;
			} else {
				from_photo_label.Markup = String.Format (Catalog.GetString (
					"\n<b>From Photo</b>\n" +
					" You can use one of your library photos as an icon for this tag.\n" +
					" However, first you must have at least one photo associated\n" +
					" with this tag. Please tag a photo as '{0}' and return here\n" +
					" to use it as an icon."), t.Name); 
				photo_scrolled_window.Visible = false;
				photo_label.Visible = false;
				photo_spin_button.Visible = false;
			}			

			icon_store = new ListStore (typeof (string), typeof (Gdk.Pixbuf));

			icon_view = new Gtk.IconView (icon_store); 
			icon_view.PixbufColumn = 1;
			icon_view.SelectionMode = SelectionMode.Single;
			icon_view.SelectionChanged += HandleIconSelectionChanged;

			icon_scrolled_window.Add (icon_view);

			icon_view.Show();

			image_view.Show ();

			FSpot.Delay fill_delay = new FSpot.Delay (FillIconView);
			fill_delay.Start ();

			ResponseType response = (ResponseType) this.Dialog.Run ();
			bool success = false;

			if (response == ResponseType.Ok) {
				try {
					if (IconName != null) {
						t.ThemeIconName = IconName;
					} else {
						t.ThemeIconName = null;
						t.Icon = PreviewPixbuf_WithoutProfile;
					}
					//db.Tags.Commit (t);
					success = true;
				} catch (Exception ex) {
					// FIXME error dialog.
					Console.WriteLine ("error {0}", ex);
				}
			} else if (response == (ResponseType) (1)) {
				t.Icon = null;
				success = true;
			}
			
			this.Dialog.Destroy ();
			return success;
		}
Example #15
0
        public EditTagIconDialog(Db db, Tag t, Gtk.Window parent_window)
            : base("EditTagIconDialog.ui", "edit_tag_icon_dialog")
        {
            this.db = db;
            TransientFor = parent_window;
            Title = String.Format (Catalog.GetString ("Edit Icon for Tag {0}"), t.Name);

            preview_pixbuf = t.Icon;
            Cms.Profile screen_profile;
            if (preview_pixbuf != null && FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) {
                preview_image.Pixbuf = preview_pixbuf.Copy ();
                ColorManagement.ApplyProfile (preview_image.Pixbuf, screen_profile);
            } else
                preview_image.Pixbuf = preview_pixbuf;

            query = new FSpot.PhotoQuery (db.Photos);

            if (db.Tags.Hidden != null)
                query.Terms = FSpot.OrTerm.FromTags (new Tag [] {t});
            else
                query.Terms = new FSpot.Literal (t);

            image_view = new PhotoImageView (query) {CropHelpers = false};
            image_view.SelectionXyRatio = 1.0;
            image_view.SelectionChanged += HandleSelectionChanged;
            image_view.PhotoChanged += HandlePhotoChanged;

            external_photo_chooser = new Gtk.FileChooserButton (Catalog.GetString ("Select Photo from file"),
                    Gtk.FileChooserAction.Open);

            external_photo_chooser.Filter = new FileFilter();
            external_photo_chooser.Filter.AddPixbufFormats();
                        external_photo_chooser.LocalOnly = false;
            external_photo_chooser_hbox.PackStart (external_photo_chooser);
            external_photo_chooser.Show ();
            external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;

            photo_scrolled_window.Add (image_view);

            if (query.Count > 0) {
                photo_spin_button.Wrap = true;
                photo_spin_button.Adjustment.Lower = 1.0;
                photo_spin_button.Adjustment.Upper = (double) query.Count;
                photo_spin_button.Adjustment.StepIncrement = 1.0;
                photo_spin_button.ValueChanged += HandleSpinButtonChanged;

                image_view.Item.Index = 0;
            } else {
                from_photo_label.Markup = String.Format (Catalog.GetString (
                    "\n<b>From Photo</b>\n" +
                    " You can use one of your library photos as an icon for this tag.\n" +
                    " However, first you must have at least one photo associated\n" +
                    " with this tag. Please tag a photo as '{0}' and return here\n" +
                    " to use it as an icon."), t.Name);
                photo_scrolled_window.Visible = false;
                photo_label.Visible = false;
                photo_spin_button.Visible = false;
            }

            icon_store = new ListStore (typeof (string), typeof (Gdk.Pixbuf));

            icon_view = new Gtk.IconView (icon_store);
            icon_view.PixbufColumn = 1;
            icon_view.SelectionMode = SelectionMode.Single;
            icon_view.SelectionChanged += HandleIconSelectionChanged;

            icon_scrolled_window.Add (icon_view);

            icon_view.Show();

            image_view.Show ();

            FSpot.Delay fill_delay = new FSpot.Delay (FillIconView);
            fill_delay.Start ();
        }
Example #16
0
        private void build()
        {
            this.vbox1 = new VBox();

            this.toolbar1 = new Toolbar();
            this.aboutbtn1 = new ToolButton(Stock.About);
            this.aboutbtn1.Label = "About";
            this.aboutbtn1.IsImportant = true;
            this.toolbar1.ToolbarStyle = ToolbarStyle.BothHoriz;
            this.toolbar1.Add(this.aboutbtn1);
            this.vbox1.PackStart(this.toolbar1, false, true, 0);

            this.treestore1 = this.populateTreeStoreFromSession();
            this.scrollw1 = new ScrolledWindow();
            this.hpaned1 = new HPaned();
            this.treeview1 = new TreeView(this.treestore1);
            this.treeview1.HeadersVisible = true;
            this.treeview1.AppendColumn("Session", new CellRendererText(), "text", 0);
            this.treeview1.AppendColumn("Name", new CellRendererText(), "text", 1);
            this.treeview1.ExpandAll();
            this.scrollw1.Add(this.treeview1);
            this.iconview1 = new IconView();
            this.hpaned1.Add1(this.scrollw1);
            this.hpaned1.Add2(this.iconview1);
            this.hpaned1.Position = 254;
            this.vbox1.PackStart(this.hpaned1, true, true, 0);

            this.statusbar1 = new Statusbar();
            this.vbox1.PackEnd(this.statusbar1, false, true, 0);

            this.Add(this.vbox1);
            this.SetSizeRequest(800,600);

            this.DeleteEvent += HandleDeleteEvent;
        }
Example #17
0
        public RevisionView()
            : base(false, 0)
        {
            Count = 0;
            Selected = 0;

            TreeView treeview = new TreeView ();
            SelectedTextColor  = GdkColorToHex (treeview.Style.Foreground (StateType.Selected));

            Window window = new Window ("");
            SecondaryTextColor = GdkColorToHex (window.Style.Foreground (StateType.Insensitive));

            ToggleButton = new ToggleButton ();
            ToggleButton.Clicked += ToggleView;
            ToggleButton.Relief = ReliefStyle.None;

            ScrolledWindow = new ScrolledWindow ();

            Viewport = new Viewport ();
            Viewport.Add (new Label (""));

            Store = new ListStore (typeof (Gdk.Pixbuf),
                                   typeof (string),
                                   typeof (int));

            IconView = new IconView (Store);
            IconView.SelectionChanged += ChangeSelection;
            IconView.MarkupColumn = 1;
            IconView.Margin       = 12;
            IconView.Orientation  = Orientation.Horizontal;
            IconView.PixbufColumn = 0;
            IconView.Spacing      = 12;

            Image = new Image ();

            ScrolledWindow.Add (Viewport);
            PackStart (ScrolledWindow, true, true, 0);
        }
    public GnomeArtNgApp(string[] args)
    {
        Application.Init();
        //i18n
        Catalog.Init("gnomeartng", "./locale");
        config = new CConfiguration();
        //initialize Glade
        string mainW = "MainWindow";

        Glade.XML gxml = new Glade.XML(null, "gui.glade", mainW, null);
        mainWindow = (Gtk.Window)gxml.GetWidget(mainW);
        gxml.Autoconnect(this);

        //Connect all events
        mainWindow.DeleteEvent       += new DeleteEventHandler(OnWindowDeleteEvent);
        ExtInfoPreviewButton.Clicked += new EventHandler(OnPreviewButtonClicked);
        InstallButton.Clicked        += new EventHandler(OnInstallButtonClicked);
        RevertButton.Clicked         += new EventHandler(OnRevertButtonClicked);
        RefreshButton.Clicked        += new EventHandler(OnRefreshButtonClicked);
        SaveButton.Clicked           += new EventHandler(OnSaveButtonClicked);
        MainNotebook.SwitchPage      += new SwitchPageHandler(OnSwitchPage);
        FilterEntry.Changed          += new EventHandler(OnFilterEntriesChanged);
//		SortKindCb.Changed += new EventHandler(OnSortKindEntryChanged);
//		SortDirectionCb.Changed += new EventHandler(OnSortDirectionEntryChanged);
//		SortCloseButton.Clicked += new EventHandler(OnSortCloseClicked);
        FilterEntry.KeyReleaseEvent += new KeyReleaseEventHandler(OnFilterbarKeyReleased);
        FilterCloseButton.Clicked   += new EventHandler(OnFilterbarCloseClicked);

        //Menuitems
        QuitMenuItem.Activated   += new EventHandler(OnQuitItemSelected);
        UpdateMenuItem.Activated += new EventHandler(OnUpdateItemSelected);
        DonateMenuItem.Activated += new EventHandler(CUpdateWindow.onDonateButtonClicked);
        FilterMenuItem.Activated += new EventHandler(OnFilterItemSelected);
//		SortMenuItem.Activated += new EventHandler(OnSortItemSelected);
        InfoMenuItem.Activated        += new EventHandler(OnInfoItemSelected);
        PreferencesMenuItem.Activated += new EventHandler(OnPreferencesItemSelected);
        FTAItem.Activated             += new EventHandler(onFtaItemSelected);

        //First, download all thumbs...but don't bother the user with the update message, even if there is one
        bool RestartApp = false;

        if (config.NeverStartedBefore)
        {
            new CFirstTimeAssistant(config);
        }
//		else if (config.DontBotherForUpdates==false) {
//			if (config.UpdateAvailable) {
//				Console.WriteLine("An update is available, newest version is: "+config.NewestVersionNumberOnServer);
//			RestartApp = ShowUpdateWindow();
//			}
//		}

        if (!RestartApp)
        {
            //Application placement - doesn't work properly with compiz (is it the window placement plugin?)
            if (config.SettingsLoadOk)
            {
                mainWindow.Resize(config.Window.Width, config.Window.Height);
                mainWindow.Move(config.Window.X, config.Window.Y);
                //Console.WriteLine(config.Window.X+" "+ config.Window.Y);
            }

            //ArtManager erzeugen
            man = new CArtManager(config);

            //Stores anlegen und IconViews anlegen
            for (int i = 0; i < ListStoreCount; i++)
            {
                sWins[i]     = (Gtk.ScrolledWindow)(gxml.GetWidget("swin" + i));
                stores[i]    = new ListStore(typeof(Pixbuf), typeof(string), typeof(string), typeof(int));
                IconViews[i] = new Gtk.IconView(stores[i]);
                IconViews[i].SelectionChanged += new System.EventHandler(OnSelChanged);
                IconViews[i].ItemActivated    += new ItemActivatedHandler(OnItemActivated);
                IconViews[i].PixbufColumn      = 0;
                CurrentIconView = IconViews[0];

                sWins[i].Add(IconViews[i]);
                IconViews[i].Show();
            }

            //Create the comboboxes
            imageTypeBox        = ComboBox.NewText();
            imageResolutionsBox = ComboBox.NewText();
            imageStyleBox       = ComboBox.NewText();

            //Verschiedene Styles hinzufügen
            imageStyleBox.AppendText(Catalog.GetString("Centered"));
            imageStyleBox.AppendText(Catalog.GetString("Filled"));
            imageStyleBox.AppendText(Catalog.GetString("Scaled"));
            imageStyleBox.AppendText(Catalog.GetString("Zoomed"));
            imageStyleBox.AppendText(Catalog.GetString("Tiled"));
            imageStyleBox.Active   = 0;
            imageStyleBox.Changed += new EventHandler(OnImageStyleBoxChanged);

            LowerTable.Attach(imageTypeBox, 1, 2, 2, 3);
            LowerTable.Attach(imageResolutionsBox, 1, 2, 3, 4);
            LowerTable.Attach(imageStyleBox, 1, 2, 4, 5);

            UpdateMenuItem.Hide();

            OnSwitchPage(MainNotebook, new SwitchPageArgs());
            Gtk.Application.Run();
        }
    }
Example #19
0
        public FileExplorer()
        {
            navigBar = new NavigationBar(NavigationBar.NavigationType.favorites);

            navigBar.OnChangePath+= NavigateBarChange;

            Toolbar toolbar = new Toolbar ();
            //WinMenuBar  toolbar = new WinMenuBar ();
            this.PackStart (toolbar, false, false, 0);

            refreshButton = new ToolButton ("refresh.png");//Stock.Home);
            refreshButton.IsImportant = true;
            refreshButton.Label = MainClass.Languages.Translate("menu_refresh");
            refreshButton.BorderWidth = 1;
            refreshButton.Clicked+= delegate {
                FillStore (true);
            };
            toolbar.Insert (refreshButton, -1);

            upButton = new ToolButton  ("go-up.png");//Stock.GoUp
            upButton.Sensitive = false;
            upButton.Label ="Up";
            upButton.BorderWidth = 1;
            toolbar.Insert (upButton, -1);

            Gtk.Menu menu = new Gtk.Menu ();

            MenuItem mi = new MenuItem ("Workspace");
            mi.Activated += OnWorkspaceClicked;
            menu.Insert (mi, -1);
            mi = new MenuItem ("Project");
            mi.Activated += OnProjectClicked;
            menu.Insert (mi, -1);
            menu.ShowAll ();
            mi = new MenuItem ("User home folder");
            mi.Activated += OnHomeClicked;
            menu.Insert (mi, -1);
            menu.ShowAll ();
            mi = new MenuItem ("Output folder");
            mi.Activated += OnOutputClicked;
            menu.Insert (mi, -1);
            menu.ShowAll ();
            mi = new MenuItem ("Disk root");
            mi.Activated += OnOutputClicked;
            menu.Insert (mi, -1);
            menu.ShowAll ();

            if(MainClass.Platform.IsWindows){

                SeparatorMenuItem smi = new SeparatorMenuItem();
                menu.Insert (smi, -1);

                string[] drives = Environment.GetLogicalDrives();
                 foreach(string strDrive in drives)
                 {
                    mi = new MenuItem (strDrive);
                    mi.TooltipText = strDrive;
                    mi.Activated += delegate(object sender, EventArgs e)
                    {
                        string drive = (sender as  MenuItem).TooltipText;
                        parent = new DirectoryInfo(drive);
                        FillStore (true);
                        upButton.Sensitive = false;
                    };
                    menu.Insert (mi, -1);
                    menu.ShowAll ();

                };
            }

            MenusToolButton gotoButton= new MenusToolButton(menu,"workspace.png");
            gotoButton.IsImportant = true;
            gotoButton.Label = "Go To";
            toolbar.Insert (gotoButton, -1);

            Gtk.Menu menuAdd = new Gtk.Menu ();
            mi = new MenuItem (MainClass.Languages.Translate("menu_create_file"));
            mi.Activated += OnCreateFileClicked;
            menuAdd.Insert (mi, -1);
            mi = new MenuItem (MainClass.Languages.Translate("menu_create_dir"));
            mi.Activated += OnCreateDirectoryClicked;
            menuAdd.Insert (mi, -1);
            menuAdd.ShowAll ();

            MenusToolButton mtbCreate= new MenusToolButton(menuAdd,"file-new.png");
            mtbCreate.IsImportant = true;
            mtbCreate.Label = "Create";
            toolbar.Insert (mtbCreate, -1);

            fileIcon = GetIcon ("file.png");//Stock.File);
            dirIcon = GetIcon ("folder.png");//Stock.Open);
            upIcon = GetIcon ("go-up.png");

            ScrolledWindow sw = new ScrolledWindow ();
            sw.ShadowType = ShadowType.EtchedIn;
            sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
            this.PackStart (sw, true, true, 0);

            // Create the store and fill it with the contents of '/'
            store = CreateStore ();

            iconView = new IconView (store);
            iconView.ButtonReleaseEvent+= OnButtonRelease;

            iconView.SelectionMode = SelectionMode.Single;

            iconView.Columns = 1;
            iconView.Orientation = Orientation.Horizontal;

            upButton.Clicked += new EventHandler (OnUpClicked);

            iconView.TextColumn = COL_DISPLAY_NAME;
            iconView.PixbufColumn = COL_PIXBUF;
            iconView.TooltipColumn = COL_PATH;
            iconView.RowSpacing = -6;
            iconView.Spacing = -1;
            iconView.ColumnSpacing=0;
            iconView.Margin=-5;

            iconView.ItemActivated += new ItemActivatedHandler (OnItemActivated);

            sw.Add (iconView);

            iconView.SelectionChanged+= delegate(object sender, EventArgs e) {
                Gtk.TreePath[] selRow = iconView.SelectedItems;
                if(selRow.Length<1) return;

                Gtk.TreePath tp = selRow[0];
                TreeIter ti = new TreeIter();
                store.GetIter(out ti,tp);

                if(tp.Equals(TreeIter.Zero))return;

                string name = store.GetValue(ti, 1).ToString();
                if(name == ".."){
                    selectedItem = null;
                } else {
                    selectedItem = store.GetValue(ti, 0).ToString();
                    isDir = (bool)store.GetValue(ti, 3);
                }
            };
            this.PackEnd (navigBar, false, false, 0);
        }
Example #20
0
#pragma warning restore 649

        public EditTagIconDialog(Db db, Tag t, Gtk.Window parent_window) : base("EditTagIconDialog.ui", "edit_tag_icon_dialog")
        {
            TransientFor = parent_window;
            Title        = Strings.EditIconForTagName(t.Name);

            // FIXME, Icon
            //preview_pixbuf = t.Icon;
            if (preview_pixbuf != null && ColorManagement.Profiles.TryGetValue(Preferences.Get <string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out var screen_profile))
            {
                preview_image.Pixbuf = preview_pixbuf.Copy();
                ColorManagement.ApplyProfile(preview_image.Pixbuf, screen_profile);
            }
            else
            {
                preview_image.Pixbuf = preview_pixbuf;
            }

            query = new PhotoQuery(db.Photos);

            if (db.Tags.Hidden != null)
            {
                query.Terms = OrTerm.FromTags(new[] { t });
            }
            else
            {
                query.Terms = new Literal(t);
            }

            image_view = new PhotoImageView(query)
            {
                CropHelpers = false
            };
            image_view.SelectionXyRatio  = 1.0;
            image_view.SelectionChanged += HandleSelectionChanged;
            image_view.PhotoChanged     += HandlePhotoChanged;

            external_photo_chooser = new Gtk.FileChooserButton(Strings.SelectPhotoFromFile, Gtk.FileChooserAction.Open)
            {
                Filter = new FileFilter()
            };
            external_photo_chooser.Filter.AddPixbufFormats();
            external_photo_chooser.LocalOnly = false;
            external_photo_chooser_hbox.PackStart(external_photo_chooser);
            external_photo_chooser.Show();
            external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;

            photo_scrolled_window.Add(image_view);

            if (query.Count > 0)
            {
                photo_spin_button.Wrap                     = true;
                photo_spin_button.Adjustment.Lower         = 1.0;
                photo_spin_button.Adjustment.Upper         = query.Count;
                photo_spin_button.Adjustment.StepIncrement = 1.0;
                photo_spin_button.ValueChanged            += HandleSpinButtonChanged;

                image_view.Item.Index = 0;
            }
            else
            {
                from_photo_label.Markup       = string.Format($"\n<b>{Strings.FromPhoto}</b>\n{Strings.TagFromPhotoLabelMessage}", t.Name);
                photo_scrolled_window.Visible = false;
                photo_label.Visible           = false;
                photo_spin_button.Visible     = false;
            }

            icon_store = new ListStore(typeof(string), typeof(Gdk.Pixbuf));

            icon_view = new Gtk.IconView(icon_store)
            {
                PixbufColumn  = 1,
                SelectionMode = SelectionMode.Single
            };
            icon_view.SelectionChanged += HandleIconSelectionChanged;

            icon_scrolled_window.Add(icon_view);

            icon_view.Show();

            image_view.Show();

            //var fill_delay = new DelayedOperation (FillIconView);
            //fill_delay.Start ();
        }
Example #21
0
    private void OnSwitchPage(object sender, SwitchPageArgs s)
    {
        OnFilterbarCloseClicked(sender, s);
        int pageNum = ((Gtk.Notebook)sender).Page;
        CurrentIconView = IconViews[pageNum];
        FilterEntry.Text = "";
        switch(pageNum){
            case 0: man.ArtType=CConfiguration.ArtType.atBackground_gnome; break;
            case 1: man.ArtType=CConfiguration.ArtType.atBackground_other; break;
            case 2: man.ArtType=CConfiguration.ArtType.atBackground_nature; break;
            case 3: man.ArtType=CConfiguration.ArtType.atBackground_abstract; break;
            case 4: man.ArtType=CConfiguration.ArtType.atApplication; break;
            case 5: man.ArtType=CConfiguration.ArtType.atWindowDecoration; break;
            case 6: man.ArtType=CConfiguration.ArtType.atIcon; break;
            case 7: man.ArtType=CConfiguration.ArtType.atGdmGreeter; break;
            case 8: man.ArtType=CConfiguration.ArtType.atSplash; break;
            case 9: man.ArtType=CConfiguration.ArtType.atGtkEngine;	break;
        }

        Gtk.TreeIter iter;
        CurrentIconView.Model.GetIterFirst(out iter);
        //Falls noch kein gefüllter Store (und damit noch kein gültiger Iterator -> Stamp==0
        if (iter.Stamp==0){
            man.GetAllThumbs();
            FillStore(pageNum);
            Gtk.TreeModelFilter filter = new Gtk.TreeModelFilter (CurrentIconView.Model, null);
            filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (onFilter);
            CurrentIconView.Model = filter;
            CurrentIconView.GrabFocus ();
        }
        if (CurrentIconView.SelectedItems.Length > 0)
            man.ThemeIndex=int.Parse(CurrentIconView.SelectedItems[0].ToString());
        FillExtendedSection(man.Theme);
    }
Example #22
0
    public GnomeArtNgApp(string[] args)
    {
        Application.Init();
        //i18n
        Catalog.Init("gnomeartng","./locale");
        config=new CConfiguration();
        //initialize Glade
        string mainW = "MainWindow";
        Glade.XML gxml = new Glade.XML (null, "gui.glade", mainW, null);
        mainWindow = (Gtk.Window) gxml.GetWidget (mainW);
        gxml.Autoconnect (this);

        //Connect all events
        mainWindow.DeleteEvent+=new DeleteEventHandler(OnWindowDeleteEvent);
        ExtInfoPreviewButton.Clicked += new EventHandler(OnPreviewButtonClicked);
        InstallButton.Clicked  += new EventHandler(OnInstallButtonClicked);
        RevertButton.Clicked  += new EventHandler(OnRevertButtonClicked);
        RefreshButton.Clicked += new EventHandler(OnRefreshButtonClicked);
        SaveButton.Clicked  += new EventHandler(OnSaveButtonClicked);
        MainNotebook.SwitchPage += new SwitchPageHandler(OnSwitchPage);
        FilterEntry.Changed += new EventHandler(OnFilterEntriesChanged);
        //		SortKindCb.Changed += new EventHandler(OnSortKindEntryChanged);
        //		SortDirectionCb.Changed += new EventHandler(OnSortDirectionEntryChanged);
        //		SortCloseButton.Clicked += new EventHandler(OnSortCloseClicked);
        FilterEntry.KeyReleaseEvent += new KeyReleaseEventHandler(OnFilterbarKeyReleased);
        FilterCloseButton.Clicked += new EventHandler(OnFilterbarCloseClicked);

        //Menuitems
        QuitMenuItem.Activated += new EventHandler(OnQuitItemSelected);
        UpdateMenuItem.Activated += new EventHandler(OnUpdateItemSelected);
        DonateMenuItem.Activated += new EventHandler(CUpdateWindow.onDonateButtonClicked);
        FilterMenuItem.Activated += new EventHandler(OnFilterItemSelected);
        //		SortMenuItem.Activated += new EventHandler(OnSortItemSelected);
        InfoMenuItem.Activated += new EventHandler(OnInfoItemSelected);
        PreferencesMenuItem.Activated += new EventHandler(OnPreferencesItemSelected);
        FTAItem.Activated += new EventHandler(onFtaItemSelected);

        //First, download all thumbs...but don't bother the user with the update message, even if there is one
        bool RestartApp= false;
        if (config.NeverStartedBefore)
            new CFirstTimeAssistant(config);
        else if (config.DontBotherForUpdates==false) {
            if (config.UpdateAvailable) {
                Console.WriteLine("An update is available, newest version is: "+config.NewestVersionNumberOnServer);
                RestartApp = ShowUpdateWindow();
            }
        }

        if (!RestartApp) {
            //Application placement - doesn't work properly with compiz (is it the window placement plugin?)
            if (config.SettingsLoadOk) {
                mainWindow.Resize(config.Window.Width, config.Window.Height);
                mainWindow.Move(config.Window.X, config.Window.Y);
                //Console.WriteLine(config.Window.X+" "+ config.Window.Y);
            }

            //ArtManager erzeugen
            man = new CArtManager(config);

            //Stores anlegen und IconViews anlegen
            for(int i=0;i<ListStoreCount;i++){
                sWins[i] = (Gtk.ScrolledWindow)(gxml.GetWidget("swin"+i));
                stores[i]= new ListStore (typeof(Pixbuf),typeof (string), typeof (string), typeof(int));
                IconViews[i] = new Gtk.IconView(stores[i]);
                IconViews[i].SelectionChanged += new System.EventHandler(OnSelChanged);
                IconViews[i].ItemActivated += new ItemActivatedHandler(OnItemActivated);
                IconViews[i].PixbufColumn = 0;
                CurrentIconView = IconViews[0];

                sWins[i].Add(IconViews[i]);
                IconViews[i].Show();
            }

            //Create the comboboxes
            imageTypeBox = ComboBox.NewText();
            imageResolutionsBox = ComboBox.NewText();
            imageStyleBox = ComboBox.NewText();

            //Verschiedene Styles hinzufügen
            imageStyleBox.AppendText(Catalog.GetString("Centered"));
            imageStyleBox.AppendText(Catalog.GetString("Filled"));
            imageStyleBox.AppendText(Catalog.GetString("Scaled"));
            imageStyleBox.AppendText(Catalog.GetString("Zoomed"));
            imageStyleBox.AppendText(Catalog.GetString("Tiled"));
            imageStyleBox.Active=0;
            imageStyleBox.Changed += new EventHandler(OnImageStyleBoxChanged);

            LowerTable.Attach(imageTypeBox,1,2,2,3);
            LowerTable.Attach(imageResolutionsBox,1,2,3,4);
            LowerTable.Attach(imageStyleBox,1,2,4,5);

            OnSwitchPage(MainNotebook,new SwitchPageArgs());
            Gtk.Application.Run ();

        }
    }
		public SingleView (Uri [] uris) 
		{
			string glade_name = "single_view";
			this.uri = uris [0];
			
			System.Console.WriteLine ("uri = {0}", uri.ToString ());

			xml = new Glade.XML (null, "f-spot.glade", glade_name, "f-spot");
			xml.Autoconnect (this);
			window = (Gtk.Window) xml.GetWidget (glade_name);
		
			LoadPreference (Preferences.VIEWER_WIDTH);
			LoadPreference (Preferences.VIEWER_MAXIMIZED);

			Gtk.Toolbar toolbar = new Gtk.Toolbar ();
			toolbar_hbox.PackStart (toolbar);
			Widget rl_button = GtkUtil.MakeToolbarButton (toolbar, "f-spot-rotate-270", new System.EventHandler (HandleRotate270Command));
			SetTip (rl_button, Catalog.GetString ("Rotate photo left"));
			Widget rr_button = GtkUtil.MakeToolbarButton (toolbar, "f-spot-rotate-90", new System.EventHandler (HandleRotate90Command));
			SetTip (rr_button, Catalog.GetString ("Rotate photo right"));

			toolbar.AppendSpace ();

			Widget fs_button = GtkUtil.MakeToolbarButton (toolbar, "f-spot-fullscreen", new System.EventHandler (HandleViewFullscreen));
			SetTip (fs_button, Catalog.GetString ("View photos fullscreen"));
			Widget ss_button = GtkUtil.MakeToolbarButton (toolbar, "f-spot-slideshow", new System.EventHandler (HandleViewSlideshow));
			SetTip (ss_button, Catalog.GetString ("View photos in a slideshow"));

			collection = new UriCollection (uris);

			TargetEntry [] dest_table = {   new TargetEntry ("text/uri-list", 0, 0),
							new TargetEntry ("text/plain", 0, 1)};
			
			directory_view = new IconView (collection);
			directory_view.Selection.Changed += HandleSelectionChanged;
			directory_view.DragDataReceived += HandleDragDataReceived;
			Gtk.Drag.DestSet (directory_view, DestDefaults.All, dest_table, 
					DragAction.Copy | DragAction.Move); 
			directory_view.DisplayTags = false;
			directory_view.DisplayDates = false;
			directory_scrolled.Add (directory_view);

			ThumbnailGenerator.Default.OnPixbufLoaded += delegate { directory_view.QueueDraw (); };

			image_view = new PhotoImageView (collection);
			FSpot.Global.ModifyColors (image_view);
			FSpot.Global.ModifyColors (image_scrolled);
			image_view.ZoomChanged += HandleZoomChanged;
			image_view.Item.Changed += HandleItemChanged;
			image_view.ButtonPressEvent += HandleImageViewButtonPressEvent;
			image_view.DragDataReceived += HandleDragDataReceived;
			Gtk.Drag.DestSet (image_view, DestDefaults.All, dest_table,
					DragAction.Copy | DragAction.Move); 
			image_scrolled.Add (image_view);
			
			Window.ShowAll ();

			zoom_scale.ValueChanged += HandleZoomScaleValueChanged;
		
			LoadPreference (Preferences.VIEWER_SHOW_TOOLBAR);
 			LoadPreference (Preferences.VIEWER_INTERPOLATION);
			LoadPreference (Preferences.VIEWER_TRANSPARENCY);
			LoadPreference (Preferences.VIEWER_TRANS_COLOR);

			ShowSidebar = collection.Count > 1;

			near_image.SetFromStock ("f-spot-stock_near", Gtk.IconSize.SmallToolbar);
			far_image.SetFromStock ("f-spot-stock_far", Gtk.IconSize.SmallToolbar);

			slide_delay = new FSpot.Delay (new GLib.IdleHandler (SlideShow));

			LoadPreference (Preferences.VIEWER_SHOW_FILENAMES);

			Preferences.SettingChanged += OnPreferencesChanged;
			window.DeleteEvent += HandleDeleteEvent;
			
			collection.Changed += HandleCollectionChanged;
			UpdateStatusLabel ();
			
			if (collection.Count > 0)
				directory_view.Selection.Add (0);

			export.Submenu = (Mono.Addins.AddinManager.GetExtensionNode ("/FSpot/Menus/Exports") as FSpot.Extensions.SubmenuNode).GetMenuItem ().Submenu;
			export.Submenu.ShowAll ();
			export.Activated += HandleExportActivated ;
		}
Example #24
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);
        }
        // ============================================
        // PRIVATE Members
        // ============================================
        // ============================================
        // PUBLIC Constructors
        // ============================================
        /// Create New Folder Viewer
        public FolderViewer(UserInfo userInfo)
        {
            // Initialize Scrolled Window
            BorderWidth = 0;
            ShadowType = ShadowType.EtchedIn;
            SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            // Initialize UserInfo
            this.userInfo = userInfo;
            if (this.userInfo == MyInfo.GetInstance()) {
                baseDirectory = Paths.UserSharedDirectory(MyInfo.Name);
            } else {
                baseDirectory = "/";
            }
            currentDirectory = new DirectoryInfo(baseDirectory);

            // Initialize Folder Store
            this.store = new FolderStore();
            this.store.DirectoryAdded += new ObjectEventHandler(OnStoreDirAdded);
            this.store.FileAdded += new ObjectEventHandler(OnStoreFileAdded);

            // Initialize Icon View
            iconView = new IconView(store);
            iconView.TextColumn = FolderStore.COL_NAME;
            iconView.PixbufColumn = FolderStore.COL_PIXBUF;
            iconView.SelectionMode = SelectionMode.Multiple;

            // Initialize Icon View Events
            iconView.ItemActivated += new ItemActivatedHandler(OnItemActivated);
            iconView.ButtonPressEvent += new ButtonPressEventHandler(OnItemClicked);

            // Initialize Icon View Drag & Drop
            iconView.EnableModelDragDest(Dnd.TargetTable, Gdk.DragAction.Copy);
            iconView.DragDataReceived += new DragDataReceivedHandler(OnDragDataReceived);

            // Add IconView to ScrolledWindow
            Add(iconView);

            // Refresh Icon View
            Refresh();
        }
Example #26
0
        public bool Execute(Tag t)
        {
            this.CreateDialog("edit_icon_dialog");

            this.Dialog.Title = String.Format(Catalog.GetString("Edit Icon for Tag {0}"), t.Name);

            PreviewPixbuf = t.Icon;

            query = new FSpot.PhotoQuery(db.Photos);

            if (db.Tags.Hidden != null)
            {
                query.Terms = FSpot.OrTerm.FromTags(new Tag [] { t, db.Tags.Hidden });
            }
            else
            {
                query.Terms = new FSpot.Literal(t);
            }

            image_view = new FSpot.PhotoImageView(query);
            image_view.SelectionXyRatio  = 1.0;
            image_view.SelectionChanged += HandleSelectionChanged;
            image_view.PhotoChanged     += HandlePhotoChanged;

            external_photo_chooser = new Gtk.FileChooserButton(Catalog.GetString("Select Photo from file"),
                                                               Gtk.FileChooserAction.Open);

            external_photo_chooser.Filter = new FileFilter();
            external_photo_chooser.Filter.AddPixbufFormats();
            external_photo_chooser.LocalOnly = false;
            external_photo_chooser_hbox.PackStart(external_photo_chooser);

            Dialog.ShowAll();
            external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;

            photo_scrolled_window.Add(image_view);

            if (query.Count > 0)
            {
                photo_spin_button.Wrap                     = true;
                photo_spin_button.Adjustment.Lower         = 1.0;
                photo_spin_button.Adjustment.Upper         = (double)query.Count;
                photo_spin_button.Adjustment.StepIncrement = 1.0;
                photo_spin_button.ValueChanged            += HandleSpinButtonChanged;

                image_view.Item.Index = 0;
            }
            else
            {
                from_photo_label.Markup = String.Format(Catalog.GetString(
                                                            "\n<b>From Photo</b>\n" +
                                                            " You can use one of your library photos as an icon for this tag.\n" +
                                                            " However, first you must have at least one photo associated\n" +
                                                            " with this tag. Please tag a photo as '{0}' and return here\n" +
                                                            " to use it as an icon."), t.Name);
                photo_scrolled_window.Visible = false;
                photo_label.Visible           = false;
                photo_spin_button.Visible     = false;
            }

            icon_store = new ListStore(typeof(string), typeof(Gdk.Pixbuf));

            icon_view = new Gtk.IconView(icon_store);
            icon_view.PixbufColumn      = 1;
            icon_view.SelectionMode     = SelectionMode.Single;
            icon_view.SelectionChanged += HandleIconSelectionChanged;

            icon_scrolled_window.Add(icon_view);

            icon_view.Show();

            image_view.Show();

            FSpot.Delay fill_delay = new FSpot.Delay(FillIconView);
            fill_delay.Start();

            ResponseType response = (ResponseType)this.Dialog.Run();
            bool         success  = false;

            if (response == ResponseType.Ok)
            {
                try {
                    if (IconName != null)
                    {
                        t.ThemeIconName = IconName;
                    }
                    else
                    {
                        t.ThemeIconName = null;
                        t.Icon          = PreviewPixbuf_WithoutProfile;
                    }
                    //db.Tags.Commit (t);
                    success = true;
                } catch (Exception ex) {
                    // FIXME error dialog.
                    Console.WriteLine("error {0}", ex);
                }
            }
            else if (response == (ResponseType)(1))
            {
                t.Icon  = null;
                success = true;
            }

            this.Dialog.Destroy();
            return(success);
        }
Example #27
0
        public EditTagIconDialog(Db db, Tag t, Gtk.Window parent_window) : base("EditTagIconDialog.ui", "edit_tag_icon_dialog")
        {
            TransientFor = parent_window;
            Title        = String.Format(Catalog.GetString("Edit Icon for Tag {0}"), t.Name);

            preview_pixbuf = t.Icon;
            Cms.Profile screen_profile;
            if (preview_pixbuf != null && ColorManagement.Profiles.TryGetValue(Preferences.Get <string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile))
            {
                preview_image.Pixbuf = preview_pixbuf.Copy();
                ColorManagement.ApplyProfile(preview_image.Pixbuf, screen_profile);
            }
            else
            {
                preview_image.Pixbuf = preview_pixbuf;
            }

            query = new PhotoQuery(db.Photos);

            if (db.Tags.Hidden != null)
            {
                query.Terms = OrTerm.FromTags(new [] { t });
            }
            else
            {
                query.Terms = new Literal(t);
            }

            image_view = new PhotoImageView(query)
            {
                CropHelpers = false
            };
            image_view.SelectionXyRatio  = 1.0;
            image_view.SelectionChanged += HandleSelectionChanged;
            image_view.PhotoChanged     += HandlePhotoChanged;

            external_photo_chooser = new Gtk.FileChooserButton(Catalog.GetString("Select Photo from file"),
                                                               Gtk.FileChooserAction.Open);

            external_photo_chooser.Filter = new FileFilter();
            external_photo_chooser.Filter.AddPixbufFormats();
            external_photo_chooser.LocalOnly = false;
            external_photo_chooser_hbox.PackStart(external_photo_chooser);
            external_photo_chooser.Show();
            external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;

            photo_scrolled_window.Add(image_view);

            if (query.Count > 0)
            {
                photo_spin_button.Wrap                     = true;
                photo_spin_button.Adjustment.Lower         = 1.0;
                photo_spin_button.Adjustment.Upper         = (double)query.Count;
                photo_spin_button.Adjustment.StepIncrement = 1.0;
                photo_spin_button.ValueChanged            += HandleSpinButtonChanged;

                image_view.Item.Index = 0;
            }
            else
            {
                from_photo_label.Markup = String.Format(Catalog.GetString(
                                                            "\n<b>From Photo</b>\n" +
                                                            " You can use one of your library photos as an icon for this tag.\n" +
                                                            " However, first you must have at least one photo associated\n" +
                                                            " with this tag. Please tag a photo as '{0}' and return here\n" +
                                                            " to use it as an icon."), t.Name);
                photo_scrolled_window.Visible = false;
                photo_label.Visible           = false;
                photo_spin_button.Visible     = false;
            }

            icon_store = new ListStore(typeof(string), typeof(Gdk.Pixbuf));

            icon_view = new Gtk.IconView(icon_store);
            icon_view.PixbufColumn      = 1;
            icon_view.SelectionMode     = SelectionMode.Single;
            icon_view.SelectionChanged += HandleIconSelectionChanged;

            icon_scrolled_window.Add(icon_view);

            icon_view.Show();

            image_view.Show();

            DelayedOperation fill_delay = new DelayedOperation(FillIconView);

            fill_delay.Start();
        }
Example #28
0
        public ForumView(Forum site, String forum)
        {
            this.site = site;
            this.forum = forum;
            this.Destroyed += delegate(object sender, EventArgs e) {
                if (iconThread != null)
                if (iconThread.IsAlive)
                    iconThread.Abort ();
            };
            topicWindow = new ScrolledWindow ();
            topicWindow.ShadowType = ShadowType.EtchedIn;
            topicWindow.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);

            treeviewTopics = new TreeView ();
            treeviewTopics.BorderWidth = 0;

            treeviewTopics.AppendColumn ("", new CellRendererPixbuf (), "pixbuf", 5);
            CellRendererText cellTopic = new CellRendererText ();
            TreeViewColumn topicCol = treeviewTopics.AppendColumn ("Topic", cellTopic, "text", 1);
            topicCol.SetCellDataFunc (cellTopic, new Gtk.TreeCellDataFunc (renderTopic));
            topicCol.Resizable = true;
            treeviewTopics.AppendColumn ("Author", new CellRendererText (), "text", 2).Resizable = true;
            ;
            treeviewTopics.AppendColumn ("Replies", new CellRendererText (), "text", 3).Resizable = true;
            ;
            treeviewTopics.AppendColumn ("Last Reply", new CellRendererText (), "text", 4).Resizable = true;
            ;
            // Use treeView.Selection.Changed?
            treeviewTopics.RowActivated += treeviewTopics_RowActivated;
            treeviewTopics.ButtonPressEvent += treeviewTopics_ButtonPress;

            topicWindow.Add (treeviewTopics);
            this.Add1 (topicWindow);

            contentBox = new VBox (false, 0);
            Toolbar toolbar = new Toolbar ();
            toolbar.HeightRequest = 38;
            toolbar.ToolbarStyle = ToolbarStyle.Icons;
            toolbar.BorderWidth = 0;
            firstbtn = new ToolButton (Stock.GotoFirst);
            firstbtn.TooltipText = "First page";
            firstbtn.Sensitive = false;
            firstbtn.Clicked += firstbtn_Clicked;
            prevbtn = new ToolButton (Stock.GoBack);
            prevbtn.TooltipText = "Previous page";
            prevbtn.Sensitive = false;
            prevbtn.Clicked += prevbtn_Clicked;
            nextbtn = new ToolButton (Stock.GoForward);
            nextbtn.TooltipText = "Next page";
            nextbtn.Sensitive = false;
            nextbtn.Clicked += nextbtn_Clicked;
            lastbtn = new ToolButton (Stock.GotoLast);
            lastbtn.TooltipText = "Last page";
            lastbtn.Sensitive = false;
            lastbtn.Clicked += lastbtn_Clicked;

            Image tmpimage = new Image ();
            tmpimage.Pixbuf = new Gdk.Pixbuf (".images/icon_up.png");
            upbtn = new ToolButton (tmpimage, "");
            upbtn.TooltipText = "Expand view to top";
            upbtn.Clicked += upbtn_Clicked;
            Image tmpimage2 = new Image ();
            tmpimage2.Pixbuf = new Gdk.Pixbuf (".images/icon_down.png");
            downbtn = new ToolButton (tmpimage2, "");
            downbtn.TooltipText = "Split view";
            downbtn.Clicked += downbtn_Clicked;
            closebtn = new ToolButton (Stock.Close);
            closebtn.TooltipText = "Close image view";
            closebtn.Clicked += closebtn_Clicked;
            Image tmpimage3 = new Image ();
            tmpimage3.Pixbuf = new Gdk.Pixbuf (".images/rotate_16.png");
            rotatebtn = new ToolButton (tmpimage3, "");
            rotatebtn.TooltipText = "Rotate image clockwise";
            rotatebtn.Clicked += rotatebtn_Clicked;
            Image tmpimage4 = new Image ();
            tmpimage4.Pixbuf = new Gdk.Pixbuf (".images/icon_save.png");
            savebtn = new ToolButton (tmpimage4, "");
            savebtn.TooltipText = "Download image";
            savebtn.Clicked += savebtn_Clicked;
            pageLabel = new Label ("");
            ToolItem textItem = new ToolItem ();
            textItem.Expand = false;
            textItem.Add (pageLabel);
            imageviewbtn = new ToggleToolButton (Stock.ZoomFit);
            imageviewbtn.TooltipText = "Image view";
            imageviewbtn.Toggled += imageviewbtn_Toggled;
            textviewbtn = new ToggleToolButton (Stock.Properties);
            textviewbtn.TooltipText = "Thread view";
            textviewbtn.Active = true;
            textviewbtn.Toggled += textviewbtn_Toggled;
            SeparatorToolItem sepSpacer = new SeparatorToolItem ();
            sepSpacer.Expand = true;
            sepSpacer.Draw = false;
            sepFullsize = new SeparatorToolItem ();
            imageSortAscending = new ToggleToolButton (Stock.SortAscending);
            imageSortAscending.TooltipText = "Show earliest images first";
            imageSortAscending.Active = true;
            imageSortAscending.Toggled += imageSortAscending_Toggled;
            imageSortDescending = new ToggleToolButton (Stock.SortDescending);
            imageSortDescending.TooltipText = "Show latest images first";
            imageSortDescending.Toggled += imageSortDescending_Toggled;
            imageLoadingProgress = new ProgressBar ();
            ToolItem progressItem = new ToolItem ();
            progressItem.Expand = false;
            progressItem.Add (imageLoadingProgress);
            imageLoadingProgress.Fraction = 0;
            toolbar.Add (imageSortAscending);
            toolbar.Add (imageSortDescending);
            toolbar.Add (progressItem);
            toolbar.Add (firstbtn);
            toolbar.Add (prevbtn);
            toolbar.Add (textItem);
            toolbar.Add (nextbtn);
            toolbar.Add (lastbtn);
            toolbar.Add (sepFullsize);
            toolbar.Add (savebtn);
            toolbar.Add (rotatebtn);
            toolbar.Add (sepSpacer);
            toolbar.Add (imageviewbtn);
            toolbar.Add (textviewbtn);
            toolbar.Add (closebtn);
            toolbar.Add (upbtn);
            toolbar.Add (downbtn);
            threadwindow = new ScrolledWindow ();
            threadbrowser = new WebView ();
            threadbrowser.Editable = false;
            threadbrowser.NavigationRequested += threadbrowser_NavigationRequested;
            threadwindow.Add (threadbrowser);

            iconStore = new ListStore (typeof(string), typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(int), typeof(int));
            iconview = new IconView (iconStore);
            iconview.Margin = 1;
            iconview.Spacing = 1;
            iconview.BorderWidth = 0;
            iconview.ColumnSpacing = 1;
            iconview.RowSpacing = 1;
            iconview.PixbufColumn = 1;
            iconview.TooltipColumn = 2;
            iconview.SelectionMode = SelectionMode.Multiple;
            iconview.ItemActivated += iconview_ItemActivated;
            iconview.ButtonPressEvent += iconView_ButtonPress;
            iconview.Model = iconStore;
            iconview.ModifyBase (StateType.Normal, new Gdk.Color (0x66, 0x66, 0x66));
            iconwindow = new ScrolledWindow ();
            iconwindow.ShadowType = ShadowType.EtchedIn;
            iconwindow.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
            iconwindow.Add (iconview);

            imagewindow = new EventBox ();
            fullSizeImage = new Image ();
            // JICE TEST
            fullsizeLayout = new Layout (null, null);
            fullsizeLayout.Add (fullSizeImage);
            fullsizeLayout.SizeRequested += fullsizeLayout_SizeRequested;
            imagewindow.ModifyBase (StateType.Normal, new Gdk.Color (0x66, 0x66, 0x66));
            imagewindow.Add (fullsizeLayout);
            imagewindow.CanFocus = true;
            imagewindow.KeyPressEvent += imagewindow_keyPressEvent;
            imagewindow.SizeRequested += imagewindow_sizeAllocated;

            //			imagewindow.Add(fullSizeImage);

            contentBox.PackStart (toolbar, false, false, 0);
            contentBox.PackStart (iconwindow);
            contentBox.PackStart (imagewindow);
            contentBox.PackStart (threadwindow);
            this.Add2 (contentBox);
            this.ShowAll ();
            imageSortAscending.Hide ();
            imageSortDescending.Hide ();
            iconwindow.Hide ();
            imagewindow.Hide ();
            closebtn.Hide ();
            rotatebtn.Hide ();
            savebtn.Hide ();
            sepFullsize.Hide ();
            downbtn.Hide ();
            imageLoadingProgress.Hide ();

            String favouriteThreads = UserSettings.getValue ("Site" + site.forumName + ".Forum" + forum + ".Favourites");
            favThreads = favouriteThreads.Split (';');

            treestoreTopics = new TreeStore (typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(Gdk.Pixbuf));

            topicsLoaded = 0;
            loadTopics ();
            treeviewTopics.Model = treestoreTopics;
        }