private Widget CreateIconViewPane() { iFoldersScrolledWindow = new ScrolledWindow(); iFoldersIconView = new iFolderIconView(iFoldersScrolledWindow); myiFoldersFilter = new TreeModelFilter(ifdata.iFolders, null); myiFoldersFilter.VisibleFunc = SynchronizedFoldersFilterFunc; localGroup = new iFolderViewGroup(Util.GS("iFolders on This Computer"), myiFoldersFilter, SearchEntry); iFoldersIconView.AddGroup(localGroup); VBox emptyVBox = new VBox(false, 0); emptyVBox.BorderWidth = 12; Table table = new Table(3, 2, false); emptyVBox.PackStart(table, true, true, 0); table.RowSpacing = 12; table.ColumnSpacing = 12; Label l = new Label( string.Format("<span size=\"large\">{0}</span>", Util.GS("There are no iFolders on this computer. To set up an iFolder, do one of the following:"))); table.Attach(l, 0, 2, 0, 1, AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0); l.UseMarkup = true; l.LineWrap = true; l.Xalign = 0; Image uploadImg = new Image(Util.ImagesPath("upload48.png")); table.Attach(uploadImg, 0, 1, 1, 2, AttachOptions.Shrink | AttachOptions.Fill, 0, 0, 0); l = new Label( string.Format("<span>{0}</span>", Util.GS("Select an existing folder on this computer to upload to an iFolder Server"))); table.Attach(l, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0); l.UseMarkup = true; l.LineWrap = true; l.Xalign = 0; Image downloadImg = new Image(Util.ImagesPath("download48.png")); table.Attach(downloadImg, 0, 1, 2, 3, AttachOptions.Shrink | AttachOptions.Fill, 0, 0, 0); l = new Label( string.Format("<span>{0}</span>", Util.GS("Select an iFolder on the server to download to this computer"))); table.Attach(l, 1, 2, 2, 3, AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0); l.UseMarkup = true; l.LineWrap = true; l.Xalign = 0; localGroup.EmptyWidget = emptyVBox; VBox emptySearchVBox = new VBox(false, 0); emptySearchVBox.BorderWidth = 12; l = new Label( string.Format("<span size=\"large\">{0}</span>", Util.GS("No matches found"))); emptySearchVBox.PackStart(l, true, true, 0); l.UseMarkup = true; l.LineWrap = true; localGroup.EmptySearchWidget = emptySearchVBox; TargetEntry[] targets = new TargetEntry[] { new TargetEntry ("text/uri-list", 0, (uint) DragTargetType.UriList), new TargetEntry ("application/x-root-window-drop", 0, (uint) DragTargetType.RootWindow), new TargetEntry ("text/ifolder-id", 0, (uint) DragTargetType.iFolderID) }; Drag.DestSet(iFoldersIconView, DestDefaults.All, targets, Gdk.DragAction.Copy | Gdk.DragAction.Move); iFoldersIconView.DragMotion += new DragMotionHandler(OnIconViewDragMotion); iFoldersIconView.DragDrop += new DragDropHandler(OnIconViewDragDrop); iFoldersIconView.DragDataReceived += new DragDataReceivedHandler(OnIconViewDragDataReceived); DomainInformation[] domains = domainController.GetDomains(); foreach (DomainInformation domain in domains) { AddServerGroup(domain.ID); } iFoldersIconView.SelectionChanged += new EventHandler(OniFolderIconViewSelectionChanged); iFoldersIconView.BackgroundClicked += new iFolderClickedHandler(OniFolderIconViewBackgroundClicked); iFoldersIconView.iFolderClicked += new iFolderClickedHandler(OniFolderClicked); iFoldersIconView.iFolderActivated += new iFolderActivatedHandler(OniFolderActivated); iFoldersIconView.KeyPressEvent += new KeyPressEventHandler(OniFolderIconViewKeyPress); iFoldersScrolledWindow.AddWithViewport(iFoldersIconView); return iFoldersScrolledWindow; }
private Widget CreateIconViewPane() { iFoldersScrolledWindow = new ScrolledWindow(); iFoldersIconView = new iFolderIconView(iFoldersScrolledWindow); myiFoldersFilter = new TreeModelFilter(ifdata.iFolders, null); myiFoldersFilter.VisibleFunc = SynchronizedFoldersFilterFunc; localGroup = new iFolderViewGroup(Util.GS("iFolders on This Computer"), myiFoldersFilter); iFoldersIconView.AddGroup(localGroup); DomainInformation[] domains = domainController.GetDomains(); foreach (DomainInformation domain in domains) { AddServerGroup(domain.ID); } iFoldersIconView.SelectionChanged += new EventHandler(OniFolderIconViewSelectionChanged); iFoldersIconView.BackgroundClicked += new iFolderClickedHandler(OniFolderIconViewBackgroundClicked); iFoldersIconView.iFolderClicked += new iFolderClickedHandler(OniFolderClicked); iFoldersIconView.iFolderActivated += new iFolderActivatedHandler(OniFolderActivated); iFoldersIconView.KeyPressEvent += new KeyPressEventHandler(OniFolderIconViewKeyPress); TargetEntry[] targets = new TargetEntry[] { new TargetEntry ("text/uri-list", 0, (uint) TargetType.UriList), new TargetEntry ("application/x-root-window-drop", 0, (uint) TargetType.RootWindow) }; Drag.DestSet(iFoldersIconView, DestDefaults.All, targets, Gdk.DragAction.Copy | Gdk.DragAction.Move); iFoldersIconView.DragMotion += new DragMotionHandler(OnIconViewDragMotion); iFoldersIconView.DragDrop += new DragDropHandler(OnIconViewDragDrop); iFoldersIconView.DragDataReceived += new DragDataReceivedHandler(OnIconViewDragDataReceived); iFoldersScrolledWindow.AddWithViewport(iFoldersIconView); return iFoldersScrolledWindow; }