diff options
Diffstat (limited to 'UMain.pas')
| -rw-r--r-- | UMain.pas | 549 |
1 files changed, 286 insertions, 263 deletions
@@ -22,14 +22,14 @@ unit UMain; interface uses - gtk2, gdk2, gdk2pixbuf, lazglib2, lazgobject2, pango, StrUtils, SysUtils, Types, Classes, DateUtils, + StrUtils, SysUtils, Types, Classes, DateUtils, + lazglib2, lazgobject2, lazpango1, lazgdkpixbuf2, lazgdk3, lazgtk3, GTKForms, GTKControls, GTKMenus, GTKStdCtrls, GTKExtCtrls, GTKView, GTKConsts, GTKUtils, GTKClasses, GTKPixbuf, UEngines, UConfig, UGnome, UVFSCore, UCoreClasses; type TFMain = class(TGTKForm) MainVBox : TGTKVBox; - MainMenuHandleBox : TGTKHandleBox; MainMenu : TGTKMenuBar; LeftPanelBox, RightPanelBox : TGTKVBox; PanelSeparator : TGTKHPaned; @@ -43,7 +43,7 @@ type LeftBookmarkButton, RightBookmarkButton : TGTKButton; LeftEqualButton, RightEqualButton : TGTKButton; LeftDiskInfoLabel, RightDiskInfoLabel : TGTKLabel; - ButtonsBox : TGTKTable; + ButtonsBox : TGTKHBox; F2Button, F3Button, F4Button, F5Button, F6Button, F7Button, F8Button : TGTKButton; mnuFile, mnuMark, mnuCommands, mnuShow, mnuSettings, mnuHelp : TGTKMenuItem; miExit : TGTKMenuItem; @@ -62,7 +62,7 @@ type LeftQuickFindEntry, RightQuickFindEntry: TGTKEntry; LeftQuickFindSeparator, RightQuickFindSeparator, ButtonBoxSeparator: TGTKHSeparator; CommandLineHBox: TGTKHBox; - CommandLineCombo: TGTKCombo; + CommandLineCombo: TGTKComboBoxEntry; CommandLineLabel: TGTKLabel; SplitterPopupMenu: TGTKMenuItem; FilePopupMenu: TGTKMenuItem; @@ -71,11 +71,9 @@ type miShowDirectorySizes, miTargetSource: TGTKMenuItem; miCopyNames, miCopyFullPaths: TGTKMenuItem; ButtonBoxSpace: TGTKEventBox; - MounterBarHandleBox : TGTKHandleBox; - MounterBarTable: TGTKTable; + MounterBarBox, LeftMounterBarBox, RightMounterBarBox: TGTKHBox; MounterButtonPopupMenu, miMount, miUmount, miEject: TGTKMenuItem; miMounterSettings, miNoMounterBar, miShowOneMounterBar, miShowTwoMounterBar: TGTKMenuItem; - LeftMounterTable, RightMounterTable: TGTKTable; miColumns: TGTKMenuItem; mnuPlugins, miTestPlugin: TGTKMenuItem; miSavePosition: TGTKMenuItem; @@ -87,7 +85,7 @@ type LeftDisconnectButton, RightDisconnectButton, LeftLeaveArchiveButton, RightLeaveArchiveButton: TGTKButton; OpenTerminalButton: TGTKButton; miNewTab: TGTKMenuItem; - LeftPasswordButton, RightPasswordButton: TGTKImageButton; + LeftPasswordButton, RightPasswordButton: TGTKButton; PathBoxPopupMenu: TGTKMenuItem; miPathBoxRefresh, miPathBoxCopyPath: TGTKMenuItem; miDiff, miSynchronizeDirs: TGTKMenuItem; @@ -189,7 +187,7 @@ type InplaceEditItem: TGTKListItem; SavedCmdLine: string; LastMounterButton: TGTKButton; - MounterTableList, MounterTableListLeft, MounterTableListRight: TList; + MounterBarBoxList, MounterBarBoxListLeft, MounterBarBoxListRight: TList; LeftNotebookBoxList, RightNotebookBoxList: TList; LeftPathsHighlight, RightPathsHighlight: TStringList; LeftTabEngines, RightTabEngines: TList; @@ -242,7 +240,7 @@ type function ExtractFromArchive(var NewPath: string; Engine: TPanelEngine; const FileToExtract: string; ExtractAll: boolean): boolean; function HandleKey(Key: Word; Shift: TShiftState; LeftPanel: boolean): boolean; function IsEditing(AListView: TGTKListView): boolean; - function PanelFindEditableWidget(AListView: TGTKListView): PGtkWidget; + function PanelFindEditableWidget(AListView: TGTKListView): PGtkEditable; function CheckForUnsavedConnection(Engine: TVFSEngine; AllowCancel: boolean): boolean; // Returns False to Cancel procedure SaveCursorPositionTabbed(LeftPanel: boolean); public @@ -288,9 +286,9 @@ begin LastUsedFilter := '*.*'; RedrawLeftInactive := False; RedrawRightInactive := False; - MounterTableList := TList.Create; - MounterTableListLeft := TList.Create; - MounterTableListRight := TList.Create; + MounterBarBoxList := TList.Create; + MounterBarBoxListLeft := TList.Create; + MounterBarBoxListRight := TList.Create; LeftNotebookBoxList := TList.Create; RightNotebookBoxList := TList.Create; LeftPathsHighlight := TStringList.Create; @@ -301,10 +299,8 @@ begin WindowPosition := wpCenter; MainVBox := TGTKVBox.Create(Self); AddControl(MainVBox); - MainMenuHandleBox := TGTKHandleBox.Create(Self); - MainVBox.AddControlEx(MainMenuHandleBox, False, True, 0); MainMenu := TGTKMenuBar.Create(Self); - MainMenuHandleBox.AddControl(MainMenu); + MainVBox.AddControlEx(MainMenu, False, True, 0); ConstructMenu; InplaceEditTimer := TGTKTimer.Create(Self); InplaceEditTimer.Enabled := False; @@ -315,11 +311,8 @@ begin RightMouseSelectPopupTimer := TGTKTimer.Create(Self); RightMouseSelectPopupTimer.Enabled := False; RightMouseSelectPopupTimer.OnTimer := @RightMouseSelectPopupTimerTimer; - MounterBarHandleBox := TGTKHandleBox.Create(Self); - MounterBarHandleBox.SetSizeRequest(10, -1); - MainVBox.AddControlEx(MounterBarHandleBox, False, True, 0); - MounterBarTable := TGTKTable.Create(Self); - MounterBarHandleBox.AddControl(MounterBarTable); + MounterBarBox := TGTKHBox.Create(Self); + MainVBox.AddControlEx(MounterBarBox, False, True, 0); LeftPanelBox := TGTKVBox.Create(Self); RightPanelBox := TGTKVBox.Create(Self); PanelSeparator := TGTKHPaned.Create(Self); @@ -329,14 +322,12 @@ begin ConstructPanels; CommandLineHBox := TGTKHBox.Create(Self); CommandLineHBox.Homogeneous := False; - CommandLineCombo := TGTKCombo.Create(Self); - CommandLineCombo.DisableActivate; - CommandLineCombo.MatchValue := False; - CommandLineCombo.CaseSensitive := True; + CommandLineCombo := TGTKComboBoxEntry.Create(Self); // CommandLineCombo.Entry.OnKeyDown := CommandLineComboKeyDown; CommandLineLabel := TGTKLabel.Create(Self); CommandLineLabel.Alignment := taRightJustify; - CommandLineLabel.SetAlignment(1, 0.5); + CommandLineLabel.XAlign := 1; + CommandLineLabel.YAlign := 0.5; CommandLineLabel.SetSizeRequest(300, -1); OpenTerminalButton := TGTKButton.Create(Self); OpenTerminalButton.Caption := LANGOpenTerminalButton_Caption; @@ -350,7 +341,7 @@ begin CommandLineHBox.AddControlEx(OpenTerminalButton, False, False, 2); MainVBox.AddControlEx(TGTKHSeparator.Create(Self), False, False, 2); MainVBox.AddControlEx(CommandLineHBox, False, False, 0); - ButtonsBox := TGTKTable.Create(Self); + ButtonsBox := TGTKHBox.Create(Self); F2Button := TGTKButton.Create(Self); F3Button := TGTKButton.Create(Self); F4Button := TGTKButton.Create(Self); @@ -358,19 +349,20 @@ begin F6Button := TGTKButton.Create(Self); F7Button := TGTKButton.Create(Self); F8Button := TGTKButton.Create(Self); - ButtonsBox.AddControlEx(0, 0, 1, 1, F2Button, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 0, 0); - ButtonsBox.AddControlEx(1, 0, 1, 1, TGTKVSeparator.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 4); - ButtonsBox.AddControlEx(2, 0, 1, 1, F3Button, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 0, 0); - ButtonsBox.AddControlEx(3, 0, 1, 1, TGTKVSeparator.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 4); - ButtonsBox.AddControlEx(4, 0, 1, 1, F4Button, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 0, 0); - ButtonsBox.AddControlEx(5, 0, 1, 1, TGTKVSeparator.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 4); - ButtonsBox.AddControlEx(6, 0, 1, 1, F5Button, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 0, 0); - ButtonsBox.AddControlEx(7, 0, 1, 1, TGTKVSeparator.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 4); - ButtonsBox.AddControlEx(8, 0, 1, 1, F6Button, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 0, 0); - ButtonsBox.AddControlEx(9, 0, 1, 1, TGTKVSeparator.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 4); - ButtonsBox.AddControlEx(10, 0, 1, 1, F7Button, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 0, 0); - ButtonsBox.AddControlEx(11, 0, 1, 1, TGTKVSeparator.Create(Self), [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 4); - ButtonsBox.AddControlEx(12, 0, 1, 1, F8Button, [taoExpand, taoFill], [taoShrink, taoExpand, taoFill], 0, 0); + ButtonsBox.AddControlEx(F2Button, True, True, 0); + // TODO: ypadding = 4 + ButtonsBox.AddControlEx(TGTKVSeparator.Create(Self), False, False, 2); + ButtonsBox.AddControlEx(F3Button, True, True, 0); + ButtonsBox.AddControlEx(TGTKVSeparator.Create(Self), False, False, 2); + ButtonsBox.AddControlEx(F4Button, True, True, 0); + ButtonsBox.AddControlEx(TGTKVSeparator.Create(Self), False, False, 2); + ButtonsBox.AddControlEx(F5Button, True, True, 0); + ButtonsBox.AddControlEx(TGTKVSeparator.Create(Self), False, False, 2); + ButtonsBox.AddControlEx(F6Button, True, True, 0); + ButtonsBox.AddControlEx(TGTKVSeparator.Create(Self), False, False, 2); + ButtonsBox.AddControlEx(F7Button, True, True, 0); + ButtonsBox.AddControlEx(TGTKVSeparator.Create(Self), False, False, 2); + ButtonsBox.AddControlEx(F8Button, True, True, 0); ButtonBoxSeparator := TGTKHSeparator.Create(Self); ButtonBoxSpace := TGTKEventBox.Create(Self); MainVBox.AddControlEx(ButtonBoxSpace, False, False, 2); @@ -456,14 +448,14 @@ end; procedure TFMain.ConstructPanels; begin - LeftMounterTable := TGTKTable.Create(Self); - LeftMounterTable.SetSizeRequest(10, -1); - RightMounterTable := TGTKTable.Create(Self); - RightMounterTable.SetSizeRequest(10, -1); - LeftMounterTable.BorderWidth := 2; - RightMounterTable.BorderWidth := 2; - LeftPanelBox.AddControlEx(LeftMounterTable, False, False, 0); - RightPanelBox.AddControlEx(RightMounterTable, False, False, 0); + LeftMounterBarBox := TGTKHBox.Create(Self); + LeftMounterBarBox.SetSizeRequest(10, -1); + RightMounterBarBox := TGTKHBox.Create(Self); + RightMounterBarBox.SetSizeRequest(10, -1); + LeftMounterBarBox.BorderWidth := 2; + RightMounterBarBox.BorderWidth := 2; + LeftPanelBox.AddControlEx(LeftMounterBarBox, False, False, 0); + RightPanelBox.AddControlEx(RightMounterBarBox, False, False, 0); LeftStatusBox := TGTKHBox.Create(Self); RightStatusBox := TGTKHBox.Create(Self); LeftStatusBox.Homogeneous := False; @@ -480,8 +472,8 @@ begin RightPathLabelHBox.Homogeneous := False; LeftBookmarkButton := TGTKButton.Create(Self); LeftBookmarkButton.Caption := '❇'; RightBookmarkButton := TGTKButton.Create(Self); RightBookmarkButton.Caption := '❇'; - LeftPasswordButton := TGTKImageButton.Create(Self); LeftPasswordButton.Icon := StockLock16; - RightPasswordButton := TGTKImageButton.Create(Self); RightPasswordButton.Icon := StockLock16; + LeftPasswordButton := TGTKButton.CreateFromIconName(Self, 'lock'); + RightPasswordButton := TGTKButton.CreateFromIconName(Self, 'lock'); LeftPasswordButton.BorderStyle := bsNone; RightPasswordButton.BorderStyle := bsNone; LeftBookmarkButton.SetSizeRequest(22, 22); LeftBookmarkButton.Tooltip := LANGBookmarkButton_Tooltip + ' (Ctrl+D)'; @@ -575,7 +567,6 @@ begin LeftPanelNotebook.ShowCloseButtons := True; LeftPanelNotebook.AllowDragDrop := True; LeftPanelNotebook.AllowDragOutside := True; - LeftPanelNotebook.ShowTooltips := True; LeftPanelNotebook.OnNotebookReordered := @NotebookReordered; LeftPanelNotebook.OnTabClose := @NotebookTabClosed; LeftPanelNotebook.OnTabDoubleClick := @NotebookTabDoubleClick; @@ -591,7 +582,6 @@ begin RightPanelNotebook.ShowCloseButtons := True; RightPanelNotebook.AllowDragDrop := True; RightPanelNotebook.AllowDragOutside := True; - RightPanelNotebook.ShowTooltips := True; RightPanelNotebook.OnNotebookReordered := @NotebookReordered; RightPanelNotebook.OnTabClose := @NotebookTabClosed; RightPanelNotebook.OnTabDoubleClick := @NotebookTabDoubleClick; @@ -661,22 +651,30 @@ begin ConstructColumns(LeftListView); ConstructColumns(RightListView); LeftPathLabel.XAlign := 0; - LeftPathLabel.XPadding := 5; - LeftPathLabel.YPadding := 1; + LeftPathLabel.MarginStart := 5; + LeftPathLabel.MarginEnd := 5; + LeftPathLabel.MarginTop := 1; + LeftPathLabel.MarginBottom := 1; RightPathLabel.XAlign := 0; - RightPathLabel.XPadding := 5; - RightPathLabel.YPadding := 1; + RightPathLabel.MarginStart := 5; + RightPathLabel.MarginEnd := 5; + RightPathLabel.MarginTop := 1; + RightPathLabel.MarginBottom := 1; LeftDiskInfoLabel.XAlign := 0; - LeftDiskInfoLabel.XPadding := 5; + LeftDiskInfoLabel.MarginStart := 5; + LeftDiskInfoLabel.MarginEnd := 5; LeftDiskInfoLabel.YAlign := 0.5; RightDiskInfoLabel.XAlign := 0; - RightDiskInfoLabel.XPadding := 5; + RightDiskInfoLabel.MarginStart := 5; + RightDiskInfoLabel.MarginEnd := 5; RightDiskInfoLabel.YAlign := 0.5; LeftStatusLine.XAlign := 0; - LeftStatusLine.XPadding := 5; + LeftStatusLine.MarginStart := 5; + LeftStatusLine.MarginEnd := 5; LeftStatusLine.YAlign := 0.5; RightStatusLine.XAlign := 0; - RightStatusLine.XPadding := 5; + RightStatusLine.MarginStart := 5; + RightStatusLine.MarginEnd := 5; RightStatusLine.YAlign := 0.5; { LeftStatusBox.SetSizeRequest(1, 18); RightStatusBox.SetSizeRequest(1, 18); } @@ -697,10 +695,9 @@ begin mnuFile := TGTKMenuItem.Create(Self); mnuFile.Caption := LANGmnuFile_Caption; MainMenu.Items.Add(mnuFile); -// mnuFile.Add(TGTKMenuItem.CreateTyped(Self, itTearOff)); miChangePermissions := TGTKMenuItem.CreateTyped(Self, itImageText); miChangePermissions.Caption := LANGmiChangePermissions_Caption; - miChangePermissions.StockIcon := 'gtk-convert'; + miChangePermissions.IconName := 'gtk-convert'; miChangePermissions.OnClick := @miChangePermissionsClick; mnuFile.Add(miChangePermissions); miChangeOwner := TGTKMenuItem.Create(Self); @@ -710,7 +707,7 @@ begin mnuFile.Add(TGTKMenuItem.CreateTyped(Self, itSeparator)); miCreateSymlink := TGTKMenuItem.CreateTyped(Self, itImageText); miCreateSymlink.Caption := LANGmiCreateSymlink_Caption; - miCreateSymlink.StockIcon := 'gtk-jump-to'; + miCreateSymlink.IconName := 'gtk-jump-to'; miCreateSymlink.OnClick := @miCreateSymlinkClick; mnuFile.Add(miCreateSymlink); miEditSymlink := TGTKMenuItem.Create(Self); @@ -747,48 +744,46 @@ begin mnuFile.Add(TGTKMenuItem.CreateTyped(Self, itSeparator)); miExit := TGTKMenuItem.CreateTyped(Self, itImageText); miExit.Caption := LANGmiExit_Caption; - miExit.StockIcon := 'gtk-quit'; + miExit.IconName := 'gtk-quit'; miExit.OnClick := @miExitClick; mnuFile.Add(miExit); mnuMark := TGTKMenuItem.Create(Self); mnuMark.Caption := LANGmnuMark_Caption; MainMenu.Items.Add(mnuMark); -// mnuMark.Add(TGTKMenuItem.CreateTyped(Self, itTearOff)); miSelectGroup := TGTKMenuItem.CreateTyped(Self, itImageText); miSelectGroup.Caption := LANGmiSelectGroup_Caption; - miSelectGroup.ShortCuts.Add(MakeGDKShortCut(GDK_KP_PLUS, False, False, False, False)); - miSelectGroup.StockIcon := 'gtk-add'; + miSelectGroup.ShortCuts.Add(MakeGDKShortCut(GDK_KEY_plus, False, False, False, False)); + miSelectGroup.IconName := 'gtk-add'; miSelectGroup.OnClick := @mnuMarkClick; mnuMark.Add(miSelectGroup); miUnselectGroup := TGTKMenuItem.CreateTyped(Self, itImageText); miUnselectGroup.Caption := LANGmiUnselectGroup_Caption; - miUnselectGroup.ShortCuts.Add(MakeGDKShortCut(GDK_KP_MINUS, False, False, False, False)); - miUnselectGroup.StockIcon := 'gtk-remove'; + miUnselectGroup.ShortCuts.Add(MakeGDKShortCut(GDK_KEY_minus, False, False, False, False)); + miUnselectGroup.IconName := 'gtk-remove'; miUnselectGroup.OnClick := @mnuMarkClick; mnuMark.Add(miUnselectGroup); miSelectAll := TGTKMenuItem.Create(Self); miSelectAll.Caption := LANGmiSelectAll_Caption; - miSelectAll.ShortCuts.Add(MakeGDKShortCut(GDK_KP_PLUS, False, False, False, True)); + miSelectAll.ShortCuts.Add(MakeGDKShortCut(GDK_KEY_plus, False, False, False, True)); miSelectAll.OnClick := @mnuMarkClick; mnuMark.Add(miSelectAll); miUnselectAll := TGTKMenuItem.Create(Self); miUnselectAll.Caption := LANGmiUnselectAll_Caption; - miUnselectAll.ShortCuts.Add(MakeGDKShortCut(GDK_KP_MINUS, False, False, False, True)); + miUnselectAll.ShortCuts.Add(MakeGDKShortCut(GDK_KEY_minus, False, False, False, True)); miUnselectAll.OnClick := @mnuMarkClick; mnuMark.Add(miUnselectAll); miInvertSelection := TGTKMenuItem.Create(Self); miInvertSelection.Caption := LANGmiInvertSelection_Caption; - miInvertSelection.ShortCuts.Add(MakeGDKShortCut(GDK_KP_ASTERISK, False, False, False, False)); + miInvertSelection.ShortCuts.Add(MakeGDKShortCut(GDK_KEY_asterisk, False, False, False, False)); miInvertSelection.OnClick := @mnuMarkClick; mnuMark.Add(miInvertSelection); mnuCommands := TGTKMenuItem.Create(Self); mnuCommands.Caption := LANGmnuCommands_Caption; MainMenu.Items.Add(mnuCommands); -// mnuCommands.Add(TGTKMenuItem.CreateTyped(Self, itTearOff)); miSearch := TGTKMenuItem.CreateTyped(Self, itImageText); - miSearch.StockIcon := 'gtk-find'; + miSearch.IconName := 'gtk-find'; miSearch.Caption := LANGmiSearchCaption2; miSearch.ShortCuts.AddName('<Alt>F7'); miSearch.OnClick := @miSearchClick; @@ -796,7 +791,7 @@ begin mnuCommands.Add(TGTKMenuItem.CreateTyped(Self, itSeparator)); miRefresh := TGTKMenuItem.CreateTyped(Self, itImageText); miRefresh.Caption := LANGmiRefresh_Caption; - miRefresh.StockIcon := 'gtk-refresh'; + miRefresh.IconName := 'gtk-refresh'; miRefresh.ShortCuts.AddName('<Control>R'); miRefresh.OnClick := @miRefreshClick; mnuCommands.Add(miRefresh); @@ -813,7 +808,7 @@ begin miCopyFullPaths := TGTKMenuItem.CreateTyped(Self, itImageText); miCopyFullPaths.Caption := LANGCopyFullPathNamesToClipboard; miCopyFullPaths.ShortCuts.AddName('<Control>F2'); - miCopyFullPaths.StockIcon := 'gtk-copy'; + miCopyFullPaths.IconName := 'gtk-copy'; miCopyFullPaths.OnClick := @miCopyNamesClick; mnuCommands.Add(miCopyFullPaths); mnuCommands.Add(TGTKMenuItem.CreateTyped(Self, itSeparator)); @@ -821,7 +816,7 @@ begin miNewTab.Caption := LANGmiNewTab_Caption; miNewTab.ShortCuts.AddName('<Control>T'); miNewTab.OnClick := @miDuplicateTabClick; - miNewTab.StockIcon := 'gtk-index'; + miNewTab.IconName := 'gtk-index'; mnuCommands.Add(miNewTab); mnuCommands.Add(TGTKMenuItem.CreateTyped(Self, itSeparator)); miTargetSource := TGTKMenuItem.CreateTyped(Self, itImageText); @@ -833,7 +828,6 @@ begin mnuShow := TGTKMenuItem.Create(Self); mnuShow.Caption := LANGmnuShow_Caption; MainMenu.Items.Add(mnuShow); -// mnuShow.Add(TGTKMenuItem.CreateTyped(Self, itTearOff)); miShowDotFiles := TGTKMenuItem.CreateTyped(Self, itCheck); miShowDotFiles.Caption := LANGmiShowDotFiles_Caption; miShowDotFiles.Checked := ConfShowDotFiles; @@ -865,10 +859,9 @@ begin mnuBookmarks.OnPopup := @mnuBookmarksPopup; mnuBookmarks.OnClick := @mnuBookmarksPopup; MainMenu.Items.Add(mnuBookmarks); -// mnuBookmarks.Add(TGTKMenuItem.CreateTyped(Self, itTearOff)); miAddBookmark := TGTKMenuItem.CreateTyped(Self, itImageText); miAddBookmark.Caption := LANGmiAddBookmark_Caption; - miAddBookmark.StockIcon := 'gtk-add'; + miAddBookmark.IconName := 'gtk-add'; miAddBookmark.OnClick := @miAddBookmarkClick; mnuBookmarks.Add(miAddBookmark); miEditBookmarks := TGTKMenuItem.CreateTyped(Self, itImageText); @@ -889,17 +882,16 @@ begin mnuNetwork := TGTKMenuItem.Create(Self); mnuNetwork.Caption := LANGmnuNetworkCaption; MainMenu.Items.Add(mnuNetwork); -// mnuNetwork.Add(TGTKMenuItem.CreateTyped(Self, itTearOff)); miConnections := TGTKMenuItem.CreateTyped(Self, itImageText); miConnections.Caption := LANGmiConnectionsCaption; - miConnections.StockIcon := 'gtk-network'; + miConnections.IconName := 'gtk-network'; miConnections.Enabled := False; mnuNetwork.Add(miConnections); mnuNetwork.Add(TGTKMenuItem.CreateTyped(Self, itSeparator)); miOpenConnection := TGTKMenuItem.CreateTyped(Self, itImageText); miOpenConnection.Caption := LANGmiOpenConnectionCaption; miOpenConnection.OnClick := @miOpenConnectionClick; - miOpenConnection.StockIcon := 'gtk-connect'; + miOpenConnection.IconName := 'gtk-connect'; miOpenConnection.ShortCuts.AddName('<Control>F'); mnuNetwork.Add(miOpenConnection); miQuickConnect := TGTKMenuItem.CreateTyped(Self, itImageText); @@ -912,14 +904,13 @@ begin miDisconnect.Caption := LANGmiDisconnect_Caption; miDisconnect.Enabled := False; miDisconnect.ShortCuts.AddName('<Shift><Control>F'); - miDisconnect.StockIcon := 'gtk-disconnect'; + miDisconnect.IconName := 'gtk-disconnect'; miDisconnect.OnClick := @miDisconnectClick; mnuNetwork.Add(miDisconnect); mnuPlugins := TGTKMenuItem.Create(Self); mnuPlugins.Caption := LANGmnuPluginsCaption; MainMenu.Items.Add(mnuPlugins); -// mnuPlugins.Add(TGTKMenuItem.CreateTyped(Self, itTearOff)); miTestPlugin := TGTKMenuItem.CreateTyped(Self, itImageText); miTestPlugin.Caption := LANGmiTestPluginCaption; miTestPlugin.OnClick := @miTestPluginClick; @@ -929,10 +920,9 @@ begin mnuSettings := TGTKMenuItem.Create(Self); mnuSettings.Caption := LANGmnuSettings_Caption; MainMenu.Items.Add(mnuSettings); -// mnuSettings.Add(TGTKMenuItem.CreateTyped(Self, itTearOff)); miPreferences := TGTKMenuItem.CreateTyped(Self, itImageText); miPreferences.Caption := LANGmiPreferences_Caption; - miPreferences.StockIcon := 'gtk-preferences'; + miPreferences.IconName := 'gtk-preferences'; miPreferences.OnClick := @miPreferencesClick; mnuSettings.Add(miPreferences); miFileTypes := TGTKMenuItem.CreateTyped(Self, itImageText); @@ -956,16 +946,14 @@ begin mnuHelp := TGTKMenuItem.Create(Self); mnuHelp.Caption := LANGmnuHelp_Caption; MainMenu.Items.Add(mnuHelp); -// mnuHelp.Add(TGTKMenuItem.CreateTyped(Self, itTearOff)); miAbout := TGTKMenuItem.CreateTyped(Self, itImageText); miAbout.Caption := LANGmiAbout_Caption; - miAbout.StockIcon := 'gtk-about'; + miAbout.IconName := 'gtk-about'; miAbout.OnClick := @miAboutClick; mnuHelp.Add(miAbout); // Splitter popup menu SplitterPopupMenu := TGTKMenuItem.Create(Self); -// SplitterPopupMenu.Add(TGTKMenuItem.CreateTyped(Self, itTearOff)); for i := 2 to 8 do begin Item := TGTKMenuItem.Create(Self); Item.Caption := Format('%d - %d', [i * 10, (10 - i) * 10]); @@ -983,17 +971,17 @@ begin MounterButtonPopupMenu.OnPopup := @MounterButtonPopupMenuPopup; miMount := TGTKMenuItem.CreateTyped(Self, itImageText); miMount.Caption := LANGmiMountCaption; - miMount.StockIcon := 'gtk-connect'; + miMount.IconName := 'gtk-connect'; miMount.OnClick := @miMountClick; MounterButtonPopupMenu.Add(miMount); miUmount := TGTKMenuItem.CreateTyped(Self, itImageText); miUmount.Caption := LANGmiUmountCaption; - miUmount.StockIcon := 'gtk-disconnect'; + miUmount.IconName := 'gtk-disconnect'; miUmount.OnClick := @miUmountClick; MounterButtonPopupMenu.Add(miUmount); miEject := TGTKMenuItem.CreateTyped(Self, itImageText); miEject.Caption := LANGmiEjectCaption; -// miEject.StockIcon := 'gtk-cdrom'; +// miEject.IconName := 'gtk-cdrom'; miEject.OnClick := @miEjectClick; MounterButtonPopupMenu.Add(miEject); @@ -1004,14 +992,14 @@ begin miDuplicateTab.Caption := LANGmiDuplicateTabCaption; miDuplicateTab.ShortCuts.AddName('<Control>T'); miDuplicateTab.OnClick := @miDuplicateTabClick; - miDuplicateTab.StockIcon := 'gtk-index'; + miDuplicateTab.IconName := 'gtk-index'; TabPopupMenu.Add(miDuplicateTab); TabPopupMenu.Add(TGTKMenuItem.CreateTyped(Self, itSeparator)); miCloseTab := TGTKMenuItem.CreateTyped(Self, itImageText); miCloseTab.Caption := LANGmiCloseTabCaption; miCloseTab.ShortCuts.AddName('<Control>W'); miCloseTab.OnClick := @miCloseTabClick; - miCloseTab.StockIcon := 'gtk-close'; + miCloseTab.IconName := 'gtk-close'; TabPopupMenu.Add(miCloseTab); miCloseAllTabs := TGTKMenuItem.CreateTyped(Self, itImageText); miCloseAllTabs.Caption := LANGmiCloseAllTabsCaption; @@ -1022,14 +1010,14 @@ begin PathBoxPopupMenu := TGTKMenuItem.Create(Self); miPathBoxRefresh := TGTKMenuItem.CreateTyped(Self, itImageText); miPathBoxRefresh.Caption := LANGmiRefresh_Caption; - miPathBoxRefresh.StockIcon := 'gtk-refresh'; + miPathBoxRefresh.IconName := 'gtk-refresh'; miPathBoxRefresh.ShortCuts.AddName('<Control>R'); miPathBoxRefresh.OnClick := @miRefreshClick; PathBoxPopupMenu.Add(miPathBoxRefresh); PathBoxPopupMenu.Add(TGTKMenuItem.CreateTyped(Self, itSeparator)); miPathBoxCopyPath := TGTKMenuItem.CreateTyped(Self, itImageText); miPathBoxCopyPath.Caption := LANGCopyPathToClipboard; - miPathBoxCopyPath.StockIcon := 'gtk-copy'; + miPathBoxCopyPath.IconName := 'gtk-copy'; miPathBoxCopyPath.OnClick := @miPathBoxCopyPathClick; PathBoxPopupMenu.Add(miPathBoxCopyPath); end; @@ -1126,10 +1114,13 @@ begin end; // Set the list font + // TODO +{ if not ConfUseSystemFont then begin FontDesc := pango_font_description_from_string(PChar(ConfPanelFont)); gtk_widget_modify_font(ListView.FWidget, FontDesc); end else gtk_widget_modify_font(ListView.FWidget, nil); +} g_object_set(PGObject(ListView.FWidget), 'fixed_height_mode', [1, nil]); end; @@ -1274,15 +1265,16 @@ begin // Apply the settings ApplySettings(False, False, True); - MounterBarHandleBox.Visible := ConfShowMounterBar = 1; - LeftMounterTable.Visible := ConfShowMounterBar = 2; - RightMounterTable.Visible := ConfShowMounterBar = 2; + MounterBarBox.Visible := ConfShowMounterBar = 1; + LeftMounterBarBox.Visible := ConfShowMounterBar = 2; + RightMounterBarBox.Visible := ConfShowMounterBar = 2; FillMounterBar; LeftListView.SetFocus; if CommandLineHistory.Count > 0 then for i := 0 to CommandLineHistory.Count - 1 do - CommandLineCombo.Items.Append(CommandLineHistory[i]); + CommandLineCombo.AppendItem(CommandLineHistory[i]); + CommandLineCombo.ItemIndex := -1; CommandLineCombo.Entry.Text := ''; RefreshBookmarksMenu; @@ -1366,8 +1358,9 @@ var XLeft, XRight: gint; begin if Button = mbRight then begin Accept := False; - gtk_widget_get_pointer(LeftPanelBox.FWidget, @XLeft, nil); - gtk_widget_get_pointer(RightPanelBox.FWidget, @XRight, nil); + // TODO +// gtk_widget_get_pointer(LeftPanelBox.FWidget, @XLeft, nil); +// gtk_widget_get_pointer(RightPanelBox.FWidget, @XRight, nil); if (XLeft >= LeftPanelBox.Width) and (XRight < 0) then SplitterPopupMenu.PopUp; end; end; @@ -1402,7 +1395,7 @@ begin KeyHandled := False; case Key of - GDK_TAB, 65056 : if (ssCtrl in Shift) and ANotebook.Visible then begin + GDK_KEY_Tab, GDK_KEY_ISO_Left_Tab : if (ssCtrl in Shift) and ANotebook.Visible then begin Accept := False; KeyHandled := True; x := (ANotebook.PageIndex + 1 - 2*Ord(ssShift in Shift)) mod ANotebook.ChildrenCount; @@ -1417,9 +1410,9 @@ begin if LeftPanel then RightListView.SetFocus else LeftListView.SetFocus; end; - GDK_RETURN, GDK_KP_ENTER : begin + GDK_KEY_Return, GDK_KEY_KP_Enter : begin KeyHandled := True; - if {(Key = GDK_RETURN) and} (Shift = [ssAlt, ssShift]) then DoGetDirSize(True) + if {(Key = GDK_KEY_Return) and} (Shift = [ssAlt, ssShift]) then DoGetDirSize(True) else if ([ssAlt] = Shift) or ([ssCtrl] = Shift) then begin CommandLineComboKeyDown(Sender, Key, Shift, Accept); @@ -1430,7 +1423,7 @@ begin if Length(Trim(CommandLineCombo.Entry.Text)) > 0 then CommandLineComboKeyDown(Sender, Key, Shift, Accept) else if Assigned(AListView.Selected) then ActivateItem(AListView.Selected.Index); end; - GDK_BACKSPACE : begin + GDK_KEY_BackSpace : begin KeyHandled := True; if QuickFind then QuickFindSendKey(LeftPanel, Key) else begin @@ -1438,7 +1431,7 @@ begin else PathButtonClick(RightUpButton); end; end; - GDK_Right : begin + GDK_KEY_Right : begin if [ssCtrl] = Shift then SwitchPanelCtrlLeftRight(LeftPanel, False) else if ConfLynxLikeMotion then begin if Assigned(AListView.Selected) then ActivateItem(AListView.Selected.Index); @@ -1446,7 +1439,7 @@ begin Accept := False; KeyHandled := True; end; - GDK_Left : begin + GDK_KEY_Left : begin if [ssCtrl] = Shift then SwitchPanelCtrlLeftRight(LeftPanel, True) else if ConfLynxLikeMotion then if LeftPanel then PathButtonClick(LeftUpButton) @@ -1454,11 +1447,11 @@ begin Accept := False; KeyHandled := True; end; - GDK_INSERT : begin + GDK_KEY_Insert : begin KeyHandled := True; DoSelect(5); end; - GDK_SPACE : if not QuickFind then begin + GDK_KEY_space : if not QuickFind then begin Accept := False; KeyHandled := True; if Length(CommandLineCombo.Entry.Text) > 0 then ActivateCommandLine(Key) @@ -1467,14 +1460,14 @@ begin DoSelect(8); end; end; - GDK_F1 : begin + GDK_KEY_F1 : begin KeyHandled := True; if Shift = [ssAlt] then begin ShowBookmarkQuick(True); Accept := False; end; end; - GDK_F2 : begin + GDK_KEY_F2 : begin KeyHandled := True; if Shift = [ssAlt] then begin ShowBookmarkQuick(False); @@ -1485,27 +1478,27 @@ begin F6ButtonClick(nil); end; end; - GDK_F3 : begin + GDK_KEY_F3 : begin DeactivateQuickFind(LeftPanel); Accept:= False; KeyHandled := True; F3F4ButtonClick(F3Button); end; - GDK_F4 : begin + GDK_KEY_F4 : begin DeactivateQuickFind(LeftPanel); Accept:= False; KeyHandled := True; if ssShift in Shift then EditViewFile(LeftPanel, AListView, False, True) else F3F4ButtonClick(F4Button); end; - GDK_F5 : begin + GDK_KEY_F5 : begin DeactivateQuickFind(LeftPanel); Accept:= False; KeyHandled := True; if ssShift in Shift then F5ButtonClick(nil) else F5ButtonClick(Sender); end; - GDK_F6 : begin + GDK_KEY_F6 : begin DeactivateQuickFind(LeftPanel); Accept:= False; KeyHandled := True; @@ -1514,31 +1507,31 @@ begin DoQuickRename(LeftPanel, AListView, True); end else F6ButtonClick(Sender); end; - GDK_F7 : begin + GDK_KEY_F7 : begin DeactivateQuickFind(LeftPanel); Accept:= False; KeyHandled := True; if ssAlt in Shift then miSearchClick(Sender) else F7ButtonClick(Sender); end; - GDK_F8, GDK_Delete_Key : begin + GDK_KEY_F8, GDK_KEY_Delete : begin DeactivateQuickFind(LeftPanel); Accept:= False; KeyHandled := True; F8ButtonClick(Sender); end; - GDK_ESCAPE : begin + GDK_KEY_Escape : begin if not QuickFind then CommandLineCombo.Entry.Text := ''; DeactivateQuickFind(LeftPanel); KeyHandled := True; if RunningEscSensitive > 0 then FMainEscPressed := True; end; - GDK_WIN_POPUP : begin +{ GDK_WIN_POPUP : begin Accept := False; KeyHandled := True; PopupFileMenuPos; - end; - GDK_HOME: begin + end; } + GDK_KEY_Home: begin if Shift = [ssCtrl] then begin if LeftPanel then PathButtonClick(LeftHomeButton) else PathButtonClick(RightHomeButton); @@ -1546,27 +1539,27 @@ begin end else if Assigned(AListView.Selected) and (AListView.ConvertToSorted(AListView.Selected.Index) = 0) then Accept := False; KeyHandled := True; end; - GDK_END: begin + GDK_KEY_End: begin if Assigned(AListView.Selected) and (AListView.ConvertToSorted(AListView.Selected.Index) = AListView.Items.Count - 1) then Accept := False; KeyHandled := True; end; - GDK_SLASH, GDK_KP_SLASH: begin - if Shift = [ssCtrl] then begin - if LeftPanel then PathButtonClick(LeftRootButton) - else PathButtonClick(RightRootButton); - Accept := False; - end else - if (Shift = []) then ActivateQuickFind(LeftPanel); - KeyHandled := True; - end; + GDK_KEY_slash: begin + if Shift = [ssCtrl] then begin + if LeftPanel then PathButtonClick(LeftRootButton) + else PathButtonClick(RightRootButton); + Accept := False; + end else + if (Shift = []) then ActivateQuickFind(LeftPanel); + KeyHandled := True; + end; { GDK_0..GDK_9: if ConfBookmarkQuickJump and (Shift = [ssAlt]) then QuickJumpToBookmark(LeftPanel, Key - GDK_1) else begin Accept := False; if QuickFind then QuickFindSendKey(LeftPanel, Key) else ActivateCommandLine(Key); end; } - GDK_Down : begin + GDK_KEY_Down : begin KeyHandled := False; if [ssCtrl] = Shift then begin Accept := False; @@ -1584,7 +1577,7 @@ begin end; end; end; - GDK_Up : begin + GDK_KEY_Up : begin KeyHandled := False; if QuickFind and (Shift = []) then begin KeyHandled := QuickFindSendKey(LeftPanel, Key); @@ -1595,42 +1588,42 @@ begin if Assigned(AListView.Selected) and (AListView.ConvertToSorted(AListView.Selected.Index) = 0) then Accept := False; end; end; - GDK_Page_Up, GDK_Page_Down: begin + GDK_KEY_Page_Up, GDK_KEY_Page_Down: begin KeyHandled := True; if (Shift = [ssCtrl]) and ANotebook.Visible then begin Accept := False; - x := (ANotebook.PageIndex + 1 - 2*Ord(Key = GDK_Page_Up)) mod ANotebook.ChildrenCount; + x := (ANotebook.PageIndex + 1 - 2*Ord(Key = GDK_KEY_Page_Up)) mod ANotebook.ChildrenCount; if x < 0 then x := ANotebook.ChildrenCount - 1; ANotebook.PageIndex := x; end else begin if Assigned(AListView.Selected) and - (((Key = GDK_Page_Up) and (AListView.ConvertToSorted(AListView.Selected.Index) = 0)) or - ((Key = GDK_Page_Down) and (AListView.ConvertToSorted(AListView.Selected.Index) = AListView.Items.Count - 1))) + (((Key = GDK_KEY_Page_Up) and (AListView.ConvertToSorted(AListView.Selected.Index) = 0)) or + ((Key = GDK_KEY_Page_Down) and (AListView.ConvertToSorted(AListView.Selected.Index) = AListView.Items.Count - 1))) then Accept := False; end; end; - GDK_A, GDK_Capital_A: if ((Shift = [ssAlt]) and (ConfQuickSearchActivationKey <> 2)) or (Shift = [ssCtrl]) then begin + GDK_KEY_A: if ((Shift = [ssAlt]) and (ConfQuickSearchActivationKey <> 2)) or (Shift = [ssCtrl]) then begin KeyHandled := True; CommandLineComboKeyDown(Sender, Key, Shift, Accept); end; - GDK_D, GDK_Capital_D: if Shift = [ssCtrl] then begin + GDK_KEY_D: if Shift = [ssCtrl] then begin Accept := False; KeyHandled := True; ShowBookmarkQuick(LeftPanel); end; - GDK_O, GDK_Capital_O : if (Shift = [ssAlt]) and (ConfQuickSearchActivationKey <> 2) then begin + GDK_KEY_O : if (Shift = [ssAlt]) and (ConfQuickSearchActivationKey <> 2) then begin Accept := False; KeyHandled := True; SwitchOtherPanel(LeftPanel, False); end; - GDK_P, GDK_Capital_P, GDK_N, GDK_Capital_N: + GDK_KEY_P, GDK_KEY_N: if (((Shift = [ssAlt]) and (ConfQuickSearchActivationKey <> 2)) or (Shift = [ssCtrl])) { and (CommandLineHistory.Count > 0) } then begin KeyHandled := True; CommandLineComboKeyDown(Sender, Key, Shift, Accept); end; - GDK_S, GDK_Capital_S : if ((Shift = [ssAlt]) and (ConfQuickSearchActivationKey <> 2)) or (Shift = [ssCtrl]) then begin + GDK_KEY_S : if ((Shift = [ssAlt]) and (ConfQuickSearchActivationKey <> 2)) or (Shift = [ssCtrl]) then begin KeyHandled := True; ActivateQuickFind(LeftPanel); end; @@ -2205,19 +2198,23 @@ function TFMain.IsEditing(AListView: TGTKListView): boolean; var i: integer; begin Result := False; - for i := 0 to AListView.Columns.Count - 1 do - if Assigned(AListView.Columns[i].FColumn^.editable_widget) then Result := True; + // TODO +{ for i := 0 to AListView.Columns.Count - 1 do + if Assigned(AListView.Columns[i].FColumn^.editable_widget) then Result := True; } end; -function TFMain.PanelFindEditableWidget(AListView: TGTKListView): PGtkWidget; +function TFMain.PanelFindEditableWidget(AListView: TGTKListView): PGtkEditable; var i: integer; begin Result := nil; + // TODO +{ for i := 0 to AListView.Columns.Count - 1 do if Assigned(AListView.Columns[i].FColumn^.editable_widget) then begin Result := AListView.Columns[i].FColumn^.editable_widget; Break; end; + } end; procedure TFMain.ProcessMarkKey(KeyType, Key: integer); @@ -2244,11 +2241,11 @@ end; procedure TFMain.mnuMarkClick(Sender: TObject); begin - if Sender = miSelectGroup then ProcessMarkKey(1, GDK_KP_PLUS) else - if Sender = miUnselectGroup then ProcessMarkKey(2, GDK_KP_MINUS) else + if Sender = miSelectGroup then ProcessMarkKey(1, GDK_KEY_plus) else + if Sender = miUnselectGroup then ProcessMarkKey(2, GDK_KEY_minus) else if Sender = miSelectAll then DoSelect(6) else if Sender = miUnselectAll then DoSelect(7) else - if Sender = miInvertSelection then ProcessMarkKey(4, GDK_KP_ASTERISK); + if Sender = miInvertSelection then ProcessMarkKey(4, GDK_KEY_asterisk); end; (********************************************************************************************************************************) @@ -2259,13 +2256,15 @@ var s: PChar; i, ColumnID, ColumnIdx: integer; DataList: TList; TreePath: PGtkTreePath; - AFGColor, ABGColor: PGdkColor; + AFGColor, ABGColor: string; + ABGColorRGBA: TGdkRGBA; { Rect, VisibleRect: TGdkRectangle; } begin ColumnIdx := gtk_tree_view_column_get_sort_column_id(tree_column); ColumnID := ColumnSortIDs[ColumnIdx + 1] - 1; ImageCol := False; - if ColumnIdx = 0 then ImageCol := GTK_IS_CELL_RENDERER_PIXBUF(cell); + // TODO + if ColumnIdx = 0 then ImageCol := Assigned(cell); Data := nil; if Sender = LeftListView then DataList := LeftPanelData else DataList := RightPanelData; @@ -2284,6 +2283,8 @@ begin Sel := gtk_tree_selection_iter_is_selected((Sender as TGTKView).FSelection, iter); with Data^ do begin // ################ Prepare colors + // TODO +{ if Selected then AFGColor := SelectedItemGDKColor else begin if Sel then begin if (Sender as TGTKView).Focused @@ -2294,27 +2295,28 @@ begin if not Sel then ABGColor := NormalItemGDKBackground else if (Sender as TGTKView).Focused then ABGColor := ActiveItemGDKBackground else ABGColor := InactiveItemGDKBackground; - - - + // TODO - FG + gdk_rgba_parse(@ABGColorRGBA, PChar(ABGColor)); +} // ################ Setting the properties if not ImageCol then begin - if Editing and (InplaceEditItem.Data = Data) and (ColumnID < 3) and ((ColumnID = 0) or (ColumnID = 1) or Assigned(tree_column^.editable_widget)) + if Editing and (InplaceEditItem.Data = Data) and (ColumnID < 3) and ((ColumnID = 0) or (ColumnID = 1) { TODO or Assigned(tree_column^.editable_widget)}) then begin if (ColumnID = 0) or (ColumnID = 1) then s := FDisplayName else s := nil; - g_object_set(PGObject(cell), 'text', [s, 'foreground-gdk', AFGColor, nil]); - g_object_set(PGObject(cell), 'background-gdk', [ABGColor, nil]); + // TODO + g_object_set(PGObject(cell), 'text', [s, 'foreground-gdk', PChar(AFGColor), nil]); + g_object_set(PGObject(cell), 'cell-background-rgba', [@ABGColorRGBA, nil]); end else begin // not editing if ConfDirsInBold then begin - if IsDir or UpDir then g_object_set(PGObject(cell), 'markup', [PChar(Format('<span weight="bold">%s</span>', [QuoteMarkupStr(ColumnData[ColumnID])])), 'foreground-gdk', AFGColor, nil]) - else g_object_set(PGObject(cell), 'markup', [PChar(QuoteMarkupStr(ColumnData[ColumnID])), 'foreground-gdk', AFGColor, nil]); - end else g_object_set(PGObject(cell), 'text', [ColumnData[ColumnID], 'foreground-gdk', AFGColor, nil]); - g_object_set(PGObject(cell), 'background-gdk', [ABGColor, nil]); + if IsDir or UpDir then g_object_set(PGObject(cell), 'markup', [PChar(Format('<span weight="bold">%s</span>', [QuoteMarkupStr(ColumnData[ColumnID])])), 'foreground-gdk', PChar(AFGColor), nil]) + else g_object_set(PGObject(cell), 'markup', [PChar(QuoteMarkupStr(ColumnData[ColumnID])), 'foreground-gdk', PChar(AFGColor), nil]); + end else g_object_set(PGObject(cell), 'text', [ColumnData[ColumnID], 'foreground-gdk', PChar(AFGColor), nil]); + g_object_set(PGObject(cell), 'cell-background-rgba', [@ABGColorRGBA, nil]); end; end else // this is the image column if ConfUseFileTypeIcons then begin // Assign icons - g_object_set(PGObject(cell), 'cell-background-gdk', [ABGColor, nil]); + g_object_set(PGObject(cell), 'cell-background-rgba', [@ABGColorRGBA, nil]); if Sel and (not (Sender as TGTKView).Focused) then begin if Sender = LeftListView then RedrawLeftInactive := True else RedrawRightInactive := True; @@ -2831,14 +2833,16 @@ begin if ColumnSortIDs[i] in [1, 2] then begin ListView.Columns[i - 1].SetProperty('editable', 1); ListView.StartEditing(i - 1); - if ConfQuickRenameSkipExt and (ListView.Columns[i - 1].FColumn^.editable_widget <> nil) then begin + // TODO +(* + if ConfQuickRenameSkipExt { TODO and (ListView.Columns[i - 1].FColumn^.editable_widget <> nil) } then begin s := gtk_entry_get_text(PGtkEntry(ListView.Columns[i - 1].FColumn^.editable_widget)); if (s <> nil) and (g_utf8_strlen(s, -1) > 0) then begin // DebugMsg(['TFMain.DoQuickRename: s = "', s, '", g_utf8_strlen(s) = ', g_utf8_strlen(s, -1)]); if AnsiPos('.', s) > 0 then gtk_editable_select_region(PGtkEditable(ListView.Columns[i - 1].FColumn^.editable_widget), 0, g_utf8_strlen(s, -1) - g_utf8_strlen(PChar(ExtractFileExt(s)), -1)); end; - end; + end; *) Break; end; end; @@ -2978,8 +2982,8 @@ begin DataList := RightPanelData; end; -// DebugMsg(['TFMain.QuickFindSendKey: Key = ', Key, ', GDK_Down = ', GDK_Down, ', GDK_Up = ', GDK_Up]); - if Key = GDK_BACKSPACE then begin +// DebugMsg(['TFMain.QuickFindSendKey: Key = ', Key, ', GDK_KEY_Down = ', GDK_KEY_Down, ', GDK_KEY_Up = ', GDK_KEY_Up]); + if Key = GDK_KEY_BackSpace then begin if g_utf8_strlen(PChar(Entry.Text), -1) > 0 then begin // DebugMsg(['TFMain.QuickFindSendKey: before delete: "', Entry.Text, '", ansi = "', UTF8ToStr(Entry.Text), '"']); g := malloc(Length(Entry.Text)); @@ -2991,7 +2995,7 @@ begin end; NewText := Entry.Text; end else - if (Key = GDK_Down) or (Key = GDK_Up) then begin + if (Key = GDK_KEY_Down) or (Key = GDK_KEY_Up) then begin if Length(Entry.Text) = 0 then begin DeactivateQuickFind(LeftPanel); Result := False; @@ -3005,12 +3009,12 @@ begin if (DataList.Count > 0) and (Length(NewText) > 0) then begin NewIndex := -1; - StartIndex := (AListView.ConvertToSorted(AListView.Selected.Index) + Ord(Key = GDK_Down) - Ord(Key = GDK_Up)) mod DataList.Count; + StartIndex := (AListView.ConvertToSorted(AListView.Selected.Index) + Ord(Key = GDK_KEY_Down) - Ord(Key = GDK_KEY_Up)) mod DataList.Count; if StartIndex < 0 then StartIndex := 0; if StartIndex > DataList.Count - 1 then StartIndex := DataList.Count - 1; // DebugMsg(['TFMain.QuickFindSendKey: StartIndex = ', StartIndex]); - if Key <> GDK_Up then begin + if Key <> GDK_KEY_Up then begin // Search down for i := StartIndex to DataList.Count - 1 do begin Data := DataList[AListView.ConvertFromSorted(i)]; @@ -3625,7 +3629,7 @@ begin try InternalLock; case Key of - GDK_RETURN, GDK_KP_ENTER: begin + GDK_KEY_Return, GDK_KEY_KP_Enter: begin Accept := False; if LeftLastFocused then Engine := LeftPanelEngine else Engine := RightPanelEngine; @@ -3671,41 +3675,39 @@ begin if Length(Orig) > 0 then begin SaveItemToHistory(Orig, CommandLineHistory); - if CommandLineCombo.Items.Count > 0 then - for i := CommandLineCombo.Items.Count - 1 downto 0 do - CommandLineCombo.Items.Delete(i); + CommandLineCombo.ClearItems(); if CommandLineHistory.Count > 0 then for i := 0 to CommandLineHistory.Count - 1 do - CommandLineCombo.Items.Append(CommandLineHistory[i]); + CommandLineCombo.AppendItem(CommandLineHistory[i]); CommandLineCombo.Entry.Text := ''; end; end; - GDK_Down, GDK_Up: + GDK_KEY_Down, GDK_KEY_Up: begin Accept := False; if LeftLastFocused then AListView := LeftListView else AListView := RightListView; - if (not (([ssCtrl] = Shift) and (Key = GDK_Up))) and ( - ((Key = GDK_Down) and (AListView.ConvertToSorted(AListView.Selected.Index) < AListView.Items.Count - 1)) or - ((Key = GDK_Up) and (AListView.ConvertToSorted(AListView.Selected.Index) > 0))) then + if (not (([ssCtrl] = Shift) and (Key = GDK_KEY_Up))) and ( + ((Key = GDK_KEY_Down) and (AListView.ConvertToSorted(AListView.Selected.Index) < AListView.Items.Count - 1)) or + ((Key = GDK_KEY_Up) and (AListView.ConvertToSorted(AListView.Selected.Index) > 0))) then begin - AListView.Selected := AListView.Items[AListView.ConvertFromSorted(AListView.ConvertToSorted(AListView.Selected.Index) + (Ord(Key = GDK_Down) * 2) - 1)]; + AListView.Selected := AListView.Items[AListView.ConvertFromSorted(AListView.ConvertToSorted(AListView.Selected.Index) + (Ord(Key = GDK_KEY_Down) * 2) - 1)]; AListView.Selected.SetCursor(0, False, False, 0, 0); end; AListView.SetFocus; end; - GDK_ESCAPE: begin + GDK_KEY_Escape: begin Accept := False; CommandLineCombo.Entry.Text := ''; if LeftLastFocused then LeftListView.SetFocus else RightListView.SetFocus; end; - GDK_TAB: begin - Accept := False; - if LeftLastFocused then RightListView.SetFocus - else LeftListView.SetFocus; - end; - GDK_P, GDK_Capital_P: if ((Shift = [ssAlt]) or (Shift = [ssCtrl])) and (CommandLineHistory.Count > 0) then + GDK_KEY_Tab: begin + Accept := False; + if LeftLastFocused then RightListView.SetFocus + else LeftListView.SetFocus; + end; + GDK_KEY_P: if ((Shift = [ssAlt]) or (Shift = [ssCtrl])) and (CommandLineHistory.Count > 0) then begin Accept := False; Orig := Trim(CommandLineCombo.Entry.Text); @@ -3719,7 +3721,7 @@ begin CommandLineCombo.Entry.SetFocus; CommandLineCombo.Entry.SelectRegion(Length(CommandLineCombo.Entry.Text), Length(CommandLineCombo.Entry.Text)); end else if not CommandLineCombo.Entry.Focused then ActivateCommandLine(Key); - GDK_N, GDK_Capital_N: if ((Shift = [ssAlt]) or (Shift = [ssCtrl])) and (CommandLineHistory.Count > 0) then + GDK_KEY_N: if ((Shift = [ssAlt]) or (Shift = [ssCtrl])) and (CommandLineHistory.Count > 0) then begin Accept := False; Orig := Trim(CommandLineCombo.Entry.Text); @@ -3734,7 +3736,7 @@ begin CommandLineCombo.Entry.SetFocus; CommandLineCombo.Entry.SelectRegion(Length(CommandLineCombo.Entry.Text), Length(CommandLineCombo.Entry.Text)); end else if not CommandLineCombo.Entry.Focused then ActivateCommandLine(Key); - GDK_A, GDK_Capital_A: if (Shift = [ssAlt]) or (Shift = [ssCtrl]) then + GDK_KEY_A: if (Shift = [ssAlt]) or (Shift = [ssCtrl]) then begin Accept := False; if LeftLastFocused then Engine := LeftPanelEngine @@ -3784,7 +3786,7 @@ begin end; if CommandLineCombo.Entry.Focused then CommandLineComboKeyDown(Sender, Key, Shift, Accept); - if Editing and (Key = GDK_ESCAPE) then begin + if Editing and (Key = GDK_KEY_Escape) then begin Editing := False; if LeftLastFocused then AListView := LeftListView else AListView := RightListView; @@ -3868,7 +3870,7 @@ begin if Assigned(AListView.Selected) then AWorkingThread.SelectedItem := AListView.Selected.Data; if not FChmod.RecursiveCheckButton.Checked then AWorkingThread.ChmodRecurseType := -1 - else AWorkingThread.ChmodRecurseType := FChmod.RecursiveOptionMenu.ItemIndex; + else AWorkingThread.ChmodRecurseType := FChmod.RecursiveComboBox.ItemIndex; AWorkingThread.ChmodMode := FChmod.LastMode; AWorkingThread.AEngine := Engine; AWorkingThread.DataList := DataList; @@ -4097,7 +4099,7 @@ begin if not DataItem^.IsDir then begin Item := TGTKMenuItem.CreateTyped(Self, itImageText); Item.Caption := Format(LANGPopupRunS, [QuoteMarkupStr(StrToUTF8(ShortFName), True)]); - Item.StockIcon := 'gtk-execute'; + Item.IconName := 'gtk-execute'; Item.Data := Pointer(1); Item.OnClick := @FilePopupMenuItemClick; Item.Enabled := Engine.FileCanRun(FileName); @@ -4107,7 +4109,7 @@ begin Item := TGTKMenuItem.CreateTyped(Self, itImageText); if UpDir then Item.Caption := LANGPopupGoUp else Item.Caption := Format(LANGPopupOpenS, [QuoteMarkupStr(StrToUTF8(ShortFName), True)]); - Item.StockIcon := 'gtk-open'; + Item.IconName := 'gtk-open'; Item.Data := Pointer(1); Item.OnClick := @FilePopupMenuItemClick; FilePopupMenu.Add(Item); @@ -4170,7 +4172,7 @@ begin FilePopupMenu.Add(TGTKMenuItem.CreateTyped(Self, itSeparator)); Item := TGTKMenuItem.CreateTyped(Self, itImageText); Item.Caption := LANGPopupViewFile; - Item.StockIcon := 'gtk-find'; + Item.IconName := 'gtk-find'; Item.Data := Pointer(200); // This number HAVE to be here due to F3F4ButtonClick method using Item.OnClick := @F3F4ButtonClick; FilePopupMenu.Add(Item); @@ -4183,7 +4185,7 @@ begin if not DataItem^.IsDir then FilePopupMenu.Add(TGTKMenuItem.CreateTyped(Self, itSeparator)); Item := TGTKMenuItem.CreateTyped(Self, itImageText); Item.Caption := LANGPopupMakeSymlink; - Item.StockIcon := 'gtk-jump-to'; + Item.IconName := 'gtk-jump-to'; Item.OnClick := @miCreateSymlinkClick; FilePopupMenu.Add(Item); if DataItem^.IsLnk then begin @@ -4195,7 +4197,7 @@ begin FilePopupMenu.Add(TGTKMenuItem.CreateTyped(Self, itSeparator)); Item := TGTKMenuItem.CreateTyped(Self, itImageText); Item.Caption := LANGmiChangePermissions_Caption; - Item.StockIcon := 'gtk-convert'; + Item.IconName := 'gtk-convert'; Item.OnClick := @miChangePermissionsClick; Item.Enabled := not UpDir; FilePopupMenu.Add(Item); @@ -4212,7 +4214,7 @@ begin FilePopupMenu.Add(Item); Item := TGTKMenuItem.CreateTyped(Self, itImageText); Item.Caption := LANGPopupDelete; - Item.StockIcon := 'gtk-delete'; + Item.IconName := 'gtk-delete'; Item.OnClick := @F8ButtonClick; Item.Enabled := not UpDir; FilePopupMenu.Add(Item); @@ -4376,6 +4378,8 @@ begin // Colors Section SetupColors; + // TODO +{ gtk_widget_modify_base(LeftListView.FWidget, GTK_STATE_NORMAL, NormalItemGDKBackground); gtk_widget_modify_base(RightListView.FWidget, GTK_STATE_NORMAL, NormalItemGDKBackground); gtk_widget_modify_base(LeftListView.FWidget, GTK_STATE_SELECTED, ActiveItemGDKBackground); @@ -4389,18 +4393,16 @@ begin gtk_widget_modify_text(RightListView.FWidget, GTK_STATE_SELECTED, ActiveItemGDKColor); gtk_widget_modify_text(LeftListView.FWidget, GTK_STATE_ACTIVE, InactiveItemGDKColor); gtk_widget_modify_text(RightListView.FWidget, GTK_STATE_ACTIVE, InactiveItemGDKColor); - +} // Resize commandline history if ConfNumHistoryItems < CommandLineHistory.Count then begin try for i := CommandLineHistory.Count downto ConfNumHistoryItems + 1 do CommandLineHistory.Delete(i - 1); - if CommandLineCombo.Items.Count > 0 then - for i := CommandLineCombo.Items.Count - 1 downto 0 do - CommandLineCombo.Items.Delete(i); + CommandLineCombo.ClearItems(); if CommandLineHistory.Count > 0 then for i := 0 to CommandLineHistory.Count - 1 do - CommandLineCombo.Items.Append(CommandLineHistory[i]); + CommandLineCombo.AppendItem(CommandLineHistory[i]); except end; CommandLineCombo.Entry.Text := ''; end; @@ -4510,14 +4512,19 @@ end; function form_event_handler(widget: PGtkWidget; event: PGdkEvent; user_data: gpointer): gboolean; cdecl; begin Result := False; - if event^._type = GDK_FOCUS_CHANGE then - if event^.focus_change._in = 1 then FMain.HandleFormFocusIn + if event^.type_ = GDK_FOCUS_CHANGE then + if event^.focus_change.in_ = 1 then FMain.HandleFormFocusIn else FileListTipsHide; end; procedure TFMain.HandleFormFocusIn; var ChangedMainGUI, ChangedAssoc, ChangedBookmarks, ChangedMounter, ChangedConnMgr, APerformRefresh: boolean; begin + ChangedMainGUI := False; + ChangedAssoc := False; + ChangedBookmarks := False; + ChangedMounter := False; + ChangedConnMgr := False; try if (csDestroying in ComponentState) or (not Assigned(FMain)) then Exit; if ApplicationShuttingDown then begin @@ -4586,15 +4593,17 @@ end; procedure menu_position_cb(menu: PGtkMenu; x, y: Pgint; push_in: pgboolean; user_data: gpointer); cdecl; var menu_requisition: TGtkRequisition; + allocation: TGtkAllocation; max_x, max_y: integer; begin (* Calculate our preferred position. *) gdk_window_get_origin(PGtkWidget(user_data)^.Window, x, y); - x^ := x^ + PGtkWidget(user_data)^.allocation.x + PGtkWidget(user_data)^.allocation.width; - y^ := y^ + PGtkWidget(user_data)^.allocation.y + PGtkWidget(user_data)^.allocation.height; + gtk_widget_get_allocation(PGtkWidget(user_data), @allocation); + x^ := x^ + allocation.x + allocation.width; + y^ := y^ + allocation.y + allocation.height; (* Now make sure we are on the screen. *) - gtk_widget_size_request(PGtkWidget(menu), @menu_requisition); + gtk_widget_get_preferred_size(PGtkWidget(menu), @menu_requisition, nil); max_x := Max(0, gdk_screen_width () - menu_requisition.width); max_y := Max(0, gdk_screen_height () - menu_requisition.height); x^ := x^ - menu_requisition.width; @@ -4631,7 +4640,7 @@ begin gdk_window_get_origin(gtk_tree_view_get_bin_window(TreeView), x, y); y^ := y^ + Rect.y + Rect.height; - gtk_widget_size_request(PGtkWidget(menu), @menu_requisition); + gtk_widget_get_preferred_size(PGtkWidget(menu), @menu_requisition, nil); if y^ > gdk_screen_height - menu_requisition.height then begin gdk_window_get_origin(gtk_tree_view_get_bin_window(TreeView), x, y); y^ := y^ + Rect.y - menu_requisition.height; @@ -4676,6 +4685,7 @@ var AListView: TGTKListView; s: string; DontShowAgain: boolean; begin + DontShowAgain := False; if LeftPanel then begin AListView := LeftListView; SrcEngine := LeftPanelEngine; @@ -4728,7 +4738,7 @@ end; (********************************************************************************************************************************) procedure TFMain.FillMounterBar; - procedure ClearButtons(List: TList; Table: TGTKTable); + procedure ClearButtons(List: TList; Table: TGTKHBox); var i: integer; begin if List.Count > 0 then @@ -4737,7 +4747,7 @@ procedure TFMain.FillMounterBar; List.Clear; end; - procedure FillTableButtons(List: TList; Table: TGTKTable); + procedure FillTableButtons(List: TList; Box: TGTKHBox); var i: integer; Button: TGTKButton; Pixmap: TGDKPixbuf; @@ -4748,14 +4758,14 @@ procedure TFMain.FillMounterBar; for i := 0 to MounterList.Count - 1 do with TMounterItem(MounterList[i]) do begin if ConfMounterPushDown then begin - Button := TGTKImageToggleButton.Create(Self); - if Length(DisplayText) > 0 then (Button as TGTKImageToggleButton).Caption := DisplayText else - (Button as TGTKImageToggleButton).Caption := Copy(MountPath, LastDelimiter(PathDelim, ExcludeTrailingPathDelimiter(MountPath)) + 1, - Length(ExcludeTrailingPathDelimiter(MountPath)) - LastDelimiter(PathDelim, ExcludeTrailingPathDelimiter(MountPath))); + Button := TGTKToggleButton.Create(Self); + if Length(DisplayText) > 0 then (Button as TGTKToggleButton).Caption := DisplayText else + (Button as TGTKToggleButton).Caption := Copy(MountPath, LastDelimiter(PathDelim, ExcludeTrailingPathDelimiter(MountPath)) + 1, + Length(ExcludeTrailingPathDelimiter(MountPath)) - LastDelimiter(PathDelim, ExcludeTrailingPathDelimiter(MountPath))); end else begin - Button := TGTKImageButton.Create(Self); - if Length(DisplayText) > 0 then (Button as TGTKImageButton).Caption := DisplayText else - (Button as TGTKImageButton).Caption := Copy(MountPath, LastDelimiter(PathDelim, ExcludeTrailingPathDelimiter(MountPath)) + 1, + Button := TGTKButton.Create(Self); + if Length(DisplayText) > 0 then (Button as TGTKButton).Caption := DisplayText else + Button.Caption := Copy(MountPath, LastDelimiter(PathDelim, ExcludeTrailingPathDelimiter(MountPath)) + 1, Length(ExcludeTrailingPathDelimiter(MountPath)) - LastDelimiter(PathDelim, ExcludeTrailingPathDelimiter(MountPath))); end; Button.CanFocus := False; @@ -4788,44 +4798,51 @@ procedure TFMain.FillMounterBar; 3 : Pixmap := MounterFloppy; 4 : Pixmap := MounterNetwork; end; + // TODO if ConfMounterPushDown then begin - (Button as TGTKImageToggleButton).Icon := Pixmap; - (Button as TGTKImageToggleButton).Checked := Mounted; - end else (Button as TGTKImageButton).Icon := Pixmap; +// (Button as TGTKToggleButton).Icon := Pixmap; + (Button as TGTKToggleButton).Checked := Mounted; + end; // TODO else Button.Icon := Pixmap; Button.OnClick := @MounterButtonClick; // It has to be here because setting the Checked property causes the signal emitting + Button.MarginTop := 1; + Button.MarginBottom := 1; - Table.AddControlEx(2*i + 1, 0, 1, 1, Button, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 0, 1); + Box.AddControlEx(Button, False, True, 0); List.Add(Button); if i < MounterList.Count - 1 then begin Sep := TGTKVSeparator.Create(Self); - Table.AddControlEx(2*(i + 1), 0, 1, 1, Sep, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 6); + Sep.MarginTop := 6; + Sep.MarginBottom := 6; + Box.AddControlEx(Sep, False, True, 2); List.Add(Sep); end; end; end; - + var Lab: TGTKLabel; begin if ConfMounterUseFSTab then FillDefaultFstabMounterItems; // Clean all items - ClearButtons(MounterTableList, MounterBarTable); - ClearButtons(MounterTableListLeft, LeftMounterTable); - ClearButtons(MounterTableListRight, RightMounterTable); + ClearButtons(MounterBarBoxList, MounterBarBox); + ClearButtons(MounterBarBoxListLeft, LeftMounterBarBox); + ClearButtons(MounterBarBoxListRight, RightMounterBarBox); // Fill the new items Lab := TGTKLabel.Create(Self); Lab.Caption := Format('<span weight="bold">%s</span>', [LANGMountSC]); Lab.UseMarkup := True; - MounterTableList.Add(Lab); - MounterBarTable.AddControlEx(0, 0, 1, 1, Lab, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 5, 1); + Lab.MarginTop := 1; + Lab.MarginBottom := 1; + MounterBarBoxList.Add(Lab); + MounterBarBox.AddControlEx(Lab, False, True, 5); case ConfShowMounterBar of - 1: FillTableButtons(MounterTableList, MounterBarTable); + 1: FillTableButtons(MounterBarBoxList, MounterBarBox); 2: begin - FillTableButtons(MounterTableListLeft, LeftMounterTable); - FillTableButtons(MounterTableListRight, RightMounterTable); + FillTableButtons(MounterBarBoxListLeft, LeftMounterBarBox); + FillTableButtons(MounterBarBoxListRight, RightMounterBarBox); end; end; end; @@ -4839,8 +4856,8 @@ begin try Item := TMounterItem((Sender as TGTKButton).Tag); if (not Assigned(Item)) or (Item.MountPath = '') then DebugMsg(['*** Error in mounter button: incorrect data']) else begin - if MounterTableListLeft.IndexOf(Sender) > -1 then LeftPanel := True else - if MounterTableListRight.IndexOf(Sender) > -1 then LeftPanel := False else LeftPanel := LeftLastFocused; + if MounterBarBoxListLeft.IndexOf(Sender) > -1 then LeftPanel := True else + if MounterBarBoxListRight.IndexOf(Sender) > -1 then LeftPanel := False else LeftPanel := LeftLastFocused; if LeftPanel then Engine := LeftPanelEngine else Engine := RightPanelEngine; try @@ -4976,9 +4993,9 @@ procedure TFMain.miShowMounterBarClick(Sender: TObject); begin if miShowOneMounterBar.Checked then ConfShowMounterBar := 1 else if miShowTwoMounterBar.Checked then ConfShowMounterBar := 2 else ConfShowMounterBar := 0; - MounterBarHandleBox.Visible := ConfShowMounterBar = 1; - LeftMounterTable.Visible := ConfShowMounterBar = 2; - RightMounterTable.Visible := ConfShowMounterBar = 2; + MounterBarBox.Visible := ConfShowMounterBar = 1; + LeftMounterBarBox.Visible := ConfShowMounterBar = 2; + RightMounterBarBox.Visible := ConfShowMounterBar = 2; FillMounterBar; end; @@ -5112,7 +5129,7 @@ begin InternalLock; FTestPlugin := TFTestPlugin.Create(Self); if (FTestPlugin.Run = mbOK) and (PluginList.Count > 0) then begin - Engine := TVFSEngine.Create(TVFSPlugin(PluginList[FTestPlugin.PluginOptionMenu.ItemIndex])); + Engine := TVFSEngine.Create(LookupVFSPlugin(FTestPlugin.PluginComboBox.ItemID)); if not Engine.VFSOpenURI(FTestPlugin.CommandEntry.Text, nil, nil, nil, nil, nil) then begin Application.MessageBox(LANGCouldntOpenURI, [mbOK], mbError, mbOK, mbOK); Exit; @@ -5140,14 +5157,13 @@ var AboutBox: PGtkWidget; begin VFSItem := TVFSPlugin(PluginList[(Sender as TGTKMenuItem).Tag]); InternalLock; - if (libGnomeUI2Handle = nil) or (gnome_about_new = nil) then - Application.MessageBox(Format(LANGPluginAboutInside, [VFSItem.ModuleName, VFSItem.ModuleAbout, VFSItem.ModuleCopyright])) - else begin + // TODO + Application.MessageBox(Format(LANGPluginAboutInside, [VFSItem.ModuleName, VFSItem.ModuleAbout, VFSItem.ModuleCopyright])); +{ else begin AboutBox := gnome_about_new(PChar(VFSItem.ModuleName), nil, PChar(VFSItem.ModuleCopyright), PChar(VFSItem.ModuleAbout), @Authors, nil, nil, AppIcon64.FPixbuf); - gtk_window_set_transient_for(GTK_WINDOW(AboutBox), GTK_WINDOW(FMain.FWidget)); - gtk_dialog_run(GTK_DIALOG(AboutBox)); - end; - Application.ProcessMessages; + gtk_window_set_transient_for(PGtkWindow(AboutBox), PGtkWindow(FMain.FWidget)); + gtk_dialog_run(PGtkDialog(AboutBox)); + end; } InternalLockInit(False); end; @@ -5244,6 +5260,7 @@ var AEngine: TPanelEngine; DontShowAgain: boolean; NewTabPosition: integer; begin + DontShowAgain := False; if LeftPanel then begin AEngine := LeftPanelEngine; ATabList := LeftPanelTabs; @@ -5617,29 +5634,39 @@ end; function TFMain.NotebookFindNotebookAtPointerEvent(Sender: TObject; const AbsX, AbsY: integer): TEphyNotebook; var wx, wy: Integer; + allocation: TGtkAllocation; begin // DebugMsg([' *** NotebookFindNotebookAtPointerEvent(AbsX = ', AbsX, ', AbsY = ', AbsY, ')']); Result := nil; + // TODO if LeftPanelNotebook.Visible then begin - gtk_widget_get_pointer(LeftPanelNotebook.FWidget, @wx, @wy); - if (wx > 0) and (wy > 0) and (wx < LeftPanelNotebook.FWidget^.allocation.width) and - (wy < LeftPanelNotebook.FWidget^.allocation.height) then Result := LeftPanelNotebook; + gdk_window_get_device_position(gtk_widget_get_window(LeftPanelNotebook.FWidget), nil, @wx, @wy, nil); +// gtk_widget_get_pointer(LeftPanelNotebook.FWidget, @wx, @wy); + gtk_widget_get_allocation(LeftPanelNotebook.FWidget, @allocation); + if (wx > 0) and (wy > 0) and (wx < allocation.width) and + (wy < allocation.height) then Result := LeftPanelNotebook; end else begin - gtk_widget_get_pointer(LeftScrolledWindow.FWidget, @wx, @wy); - if (wx > 0) and (wy > 0) and (wx < LeftScrolledWindow.FWidget^.allocation.width) and - (wy < LeftScrolledWindow.FWidget^.allocation.height) then Result := LeftPanelNotebook; + gdk_window_get_device_position(gtk_widget_get_window(LeftScrolledWindow.FWidget), nil, @wx, @wy, nil); +// gtk_widget_get_pointer(LeftScrolledWindow.FWidget, @wx, @wy); + gtk_widget_get_allocation(LeftScrolledWindow.FWidget, @allocation); + if (wx > 0) and (wy > 0) and (wx < allocation.width) and + (wy < allocation.height) then Result := LeftPanelNotebook; end; if Result = nil then begin if RightPanelNotebook.Visible then begin - gtk_widget_get_pointer(RightPanelNotebook.FWidget, @wx, @wy); - if (wx > 0) and (wy > 0) and (wx < RightPanelNotebook.FWidget^.allocation.width) and - (wy < RightPanelNotebook.FWidget^.allocation.height) then Result := RightPanelNotebook; + gdk_window_get_device_position(gtk_widget_get_window(RightPanelNotebook.FWidget), nil, @wx, @wy, nil); +// gtk_widget_get_pointer(RightPanelNotebook.FWidget, @wx, @wy); + gtk_widget_get_allocation(RightPanelNotebook.FWidget, @allocation); + if (wx > 0) and (wy > 0) and (wx < allocation.width) and + (wy < allocation.height) then Result := RightPanelNotebook; end else begin - gtk_widget_get_pointer(RightScrolledWindow.FWidget, @wx, @wy); - if (wx > 0) and (wy > 0) and (wx < RightScrolledWindow.FWidget^.allocation.width) and - (wy < RightScrolledWindow.FWidget^.allocation.height) then Result := RightPanelNotebook; + gdk_window_get_device_position(gtk_widget_get_window(RightScrolledWindow.FWidget), nil, @wx, @wy, nil); +// gtk_widget_get_pointer(RightScrolledWindow.FWidget, @wx, @wy); + gtk_widget_get_allocation(RightScrolledWindow.FWidget, @allocation); + if (wx > 0) and (wy > 0) and (wx < allocation.width) and + (wy < allocation.height) then Result := RightPanelNotebook; end; end; @@ -5832,10 +5859,8 @@ begin AFConnectionProperties := TFConnectionProperties.Create(Self); try AFConnectionProperties.URIEntry.Text := URI; - if (Engine.CustomPluginIDSave <> '') and (AFConnectionProperties.PluginOptionMenu.Items.Count > 0) then - for i := 0 to PluginList.Count - 1 do - if TVFSPlugin(PluginList[i]).ModuleID = Engine.CustomPluginIDSave - then AFConnectionProperties.PluginOptionMenu.ItemIndex := i + 1; + if (Engine.CustomPluginIDSave <> '') and (PluginList.Count > 0) then + AFConnectionProperties.PluginComboBox.ItemID := Engine.CustomPluginIDSave; if AFConnectionProperties.Run = mbOK then begin ReadConnections; ConnMgrItem := TConnMgrItem.Create; @@ -5845,9 +5870,7 @@ begin ConnMgrItem.Username := AFConnectionProperties.UserNameEntry.Text; ConnMgrItem.Password := AFConnectionProperties.PasswordEntry.Text; ConnMgrItem.TargetDir := AFConnectionProperties.TargetDirEntry.Text; - ConnMgrItem.PluginID := ''; - if AFConnectionProperties.PluginOptionMenu.ItemIndex <> 0 then - ConnMgrItem.PluginID := TVFSPlugin(PluginList[AFConnectionProperties.PluginOptionMenu.ItemIndex - 1]).ModuleID; + ConnMgrItem.PluginID := AFConnectionProperties.PluginComboBox.ItemID; ConfConnMgrActiveItem := ConnectionMgrList.Add(ConnMgrItem); WriteConnections; end; |
