public GtkFileOperationProgress(ProgressWindow progress) { this.progress = progress; }
public MainWindow() : base(Gtk.WindowType.Toplevel) { //Build(); this.IconList = new Gdk.Pixbuf[] { new Gdk.Pixbuf(null, "XenonFileManager.icons.xenon16.png"), new Gdk.Pixbuf(null, "XenonFileManager.icons.xenon256.png") }; this.Title = Catalog.GetString("Xenon File Manager"); this.SetSizeRequest(600, 450); //this.DefaultWidth = 600; //this.DefaultHeight = 450; VBox vbox1 = new VBox(false, 0); UIManager uiMgr = new UIManager(); ActionGroup w1 = new ActionGroup("Default"); Gtk.Action FileAction = new Gtk.Action("FileAction", global::Mono.Unix.Catalog.GetString ("_File"), null, null); FileAction.ShortLabel = Mono.Unix.Catalog.GetString("_File"); w1.Add (FileAction, null); Gtk.Action NewTabAction = new Gtk.Action("NewTabAction", Catalog.GetString ("New _Tab"), null, null); NewTabAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("New _Tab"); w1.Add (NewTabAction, "<Control>t"); Gtk.Action CloseTabAction = new Gtk.Action("CloseTabAction", Catalog.GetString("_Close Tab"), null, null); CloseTabAction.ShortLabel = Catalog.GetString("_Close Tab"); w1.Add(CloseTabAction, "<Control>F4"); Gtk.Action NewFolderAction = new Gtk.Action("NewFolderAction", global::Mono.Unix.Catalog.GetString("New _Folder"), null, null); NewFolderAction.ShortLabel = global::Mono.Unix.Catalog.GetString("New _Folder"); w1.Add(NewFolderAction, "F7"); Gtk.Action NewFileAction = new Gtk.Action("NewFileAction", null, null, Stock.New); w1.Add(NewFileAction, ""); Gtk.Action SearchAction = new Gtk.Action("SearchAction", Catalog.GetString("_Search"), null, null); w1.Add(SearchAction, "<Control>F"); Gtk.Action RenameAction = new Gtk.Action("RenameAction", Catalog.GetString("_Rename"), null, null); w1.Add(RenameAction, "F2"); Gtk.Action DeleteAction = new Gtk.Action("DeleteAction", null, null, Stock.Delete); w1.Add(DeleteAction, "Delete"); Gtk.Action ExitAction = new Gtk.Action("ExitAction", null, null, Stock.Quit); w1.Add(ExitAction, null); Gtk.Action EditAction = new Gtk.Action("EditAction", global::Mono.Unix.Catalog.GetString ("_Edit"), null, null); w1.Add(EditAction, null); Gtk.Action CutAction = new Gtk.Action("CutAction", null, null, Stock.Cut); w1.Add(CutAction, null); Gtk.Action CopyAction = new Gtk.Action("CopyAction", null, null, Stock.Copy); w1.Add(CopyAction, null); Gtk.Action PasteAction = new Gtk.Action("PasteAction", null, null, Stock.Paste); w1.Add(PasteAction, null); Gtk.Action SelectAllAction = new Gtk.Action("SelectAllAction", null, null, Stock.SelectAll); w1.Add(SelectAllAction, "<Control>a"); Gtk.Action SelectNoneAction = new Gtk.Action("SelectNoneAction", Catalog.GetString("Select _None"), null, null); w1.Add(SelectNoneAction, "<Control><Shift>a"); Gtk.Action SettingsAction = new Gtk.Action("SettingsAction", null, null, Stock.Preferences); w1.Add(SettingsAction, null); Gtk.Action ViewAction = new Gtk.Action("ViewAction", Catalog.GetString("_View"), null, null); w1.Add(ViewAction, null); Gtk.Action RefreshAction = new Gtk.Action("RefreshAction", null, null, Stock.Refresh); w1.Add(RefreshAction, "F5"); Gtk.Action HelpMenuAction = new Gtk.Action("HelpMenuAction", Catalog.GetString("_Help"), null, null); w1.Add(HelpMenuAction, null); Gtk.Action HelpAction = new Gtk.Action("HelpAction", null, null, Stock.Help); w1.Add(HelpAction, null); Gtk.Action AboutAction = new Gtk.Action("AboutAction", null, null, Stock.About); w1.Add(AboutAction, null); uiMgr.InsertActionGroup (w1, 0); this.AddAccelGroup (uiMgr.AccelGroup); uiMgr.AddUiFromString ( @"<ui><menubar name='menubar1'> <menu name='FileAction' action='FileAction'><menuitem name='NewTabAction' action='NewTabAction'/><menuitem name='CloseTabAction' action='CloseTabAction'/><separator/> <menuitem name='NewFolderAction' action='NewFolderAction'/><menu name='NewFileAction' action='NewFileAction'/><separator/> <menuitem name='SearchAction' action='SearchAction'/><separator/> <menuitem name='RenameAction' action='RenameAction'/><menuitem name='DeleteAction' action='DeleteAction'/><separator/> <menuitem name='ExitAction' action='ExitAction'/></menu> <menu name='EditAction' action='EditAction'><menuitem name='CutAction' action='CutAction'/><menuitem name='CopyAction' action='CopyAction'/><menuitem name='PasteAction' action='PasteAction'/><separator/> <menuitem name='SelectAllAction' action='SelectAllAction'/><menuitem name='SelectNoneAction' action='SelectNoneAction'/><separator/> <menuitem name='SettingsAction' action='SettingsAction'/></menu> <menu name='ViewAction' action='ViewAction'><menuitem name='RefreshAction' action='RefreshAction'/></menu> <menu name='HelpMenuAction' action='HelpMenuAction'><menuitem name='HelpAction' action='HelpAction'/><menuitem name='AboutAction' action='AboutAction'/></menu> </menubar></ui>" ); MenuBar menubar1 = (MenuBar)uiMgr.GetWidget("/menubar1"); menubar1.Name = "menubar1"; vbox1.PackStart(menubar1, false, false, 0); toolbar = new Toolbar(); toolbar.Insert(backButton = new ToolButton(Stock.GoBack), 0); toolbar.Insert(forwardButton = new ToolButton(Stock.GoForward), 1); toolbar.Insert(parentButton = new ToolButton(Stock.GoUp), 2); toolbar.Insert(new SeparatorToolItem(), 3); toolbar.Insert(computerButton = new ToolButton(Image.NewFromIconName("computer", IconSize.Button), Catalog.GetString("Computer")), 4); toolbar.Insert(homeButton = new ToolButton(Stock.Home), 5); toolbar.Insert(refreshButton = new ToolButton(Stock.Refresh), 6); computerButton.Sensitive = CommonUtil.CanLoadComputer(); toolbar.Insert(new SeparatorToolItem(), 7); toolbar.Insert(cutButton = new ToolButton(Stock.Cut), 8); toolbar.Insert(copyButton = new ToolButton(Stock.Copy), 9); toolbar.Insert(pasteButton = new ToolButton(Stock.Paste), 10); //toolbar.Insert(new ToolButton(Stock.Preferences), 11); vbox1.PackStart(toolbar, false, false, 0); locationBar = new Entry(); vbox1.PackStart(locationBar, false, true, 0); nb = new Notebook(); //nb.AppendPage((Widget)CommonUtil.LoadControlInstance(), new Label("")); nb.AppendPage((Widget)CommonUtil.LoadControlInstance(), new TabLabel(string.Empty, nb)); vbox1.PackStart(nb, true, true, 0); this.Add(vbox1); this.DeleteEvent += OnDeleteEvent; locationBar.Activated += new EventHandler(LoadDirectory); nb.SwitchPage += new SwitchPageHandler(OnTabChanged); NewTabAction.Activated += new EventHandler(this.OnNewTabActionActivated); CloseTabAction.Activated += OnCloseTabActionActivated; NewFolderAction.Activated += new EventHandler(this.OnNewFolderActionActivated); RenameAction.Activated += OnRenameActionActivated; DeleteAction.Activated += OnDeleteActionActivated; ExitAction.Activated += OnExitActionActivated; CutAction.Activated += OnCutEvent; CopyAction.Activated += OnCopyEvent; PasteAction.Activated += OnPasteEvent; SelectAllAction.Activated += OnSelectAllActionActivated; SelectNoneAction.Activated += OnSelectNoneActionActivated; SettingsAction.Activated += new EventHandler(this.OnSettingActionActivated); RefreshAction.Activated += OnRefreshEvent; AboutAction.Activated += OnAboutActionActivated; backButton.Clicked += new EventHandler(this.OnBackEvent); forwardButton.Clicked += new EventHandler(this.OnForwardEvent); parentButton.Clicked += new EventHandler(this.OnParentEvent); computerButton.Clicked += new EventHandler(this.OnComputerEvent); homeButton.Clicked += new EventHandler(this.OnHomeEvent); refreshButton.Clicked += new EventHandler(this.OnRefreshEvent); cutButton.Clicked += OnCutEvent; copyButton.Clicked += OnCopyEvent; pasteButton.Clicked += OnPasteEvent; CommonUtil.DirectoryChanged += OnDirectoryChanged; CommonUtil.HomeButtonClicked((IDisplayInterfaceControl)nb.CurrentPageWidget); while(((IDisplayInterfaceControl)nb.CurrentPageWidget).CurrentLocation == null) Thread.Sleep(100); SetActionStates(); progress = new ProgressWindow(); progress.IconList = this.IconList; this.ShowAll(); }