From a04fa2a24bca999d47ed8c14e5ba97cb90320d9c Mon Sep 17 00:00:00 2001 From: gambas Date: Sat, 16 May 2020 01:41:58 +0200 Subject: [PATCH] FileChooser & DirChooser: Custom bookmarks are now correctly refreshed when they change. [GB.FORM] * BUG: FileChooser & DirChooser: Custom bookmarks are now correctly refreshed when they change. * NEW: Add 'unselect' stock icon. --- comp/src/gb.form/.src/File/Bookmark/CBookmarkList.class | 4 ++++ comp/src/gb.form/.src/File/Bookmarks.class | 6 ++++++ comp/src/gb.form/.src/File/Chooser/FDirChooser.class | 2 ++ comp/src/gb.form/map/icon.map | 1 + 4 files changed, 13 insertions(+) diff --git a/comp/src/gb.form/.src/File/Bookmark/CBookmarkList.class b/comp/src/gb.form/.src/File/Bookmark/CBookmarkList.class index 10468f7a3..97e3ba14f 100644 --- a/comp/src/gb.form/.src/File/Bookmark/CBookmarkList.class +++ b/comp/src/gb.form/.src/File/Bookmark/CBookmarkList.class @@ -5,6 +5,7 @@ Inherits CBookmark[] Property Private As Collection[] Private $aPrivate As Collection[] +Private $iBookmarkAge As Integer Public Sub _new() @@ -41,6 +42,9 @@ Public Sub Load() Dim aBookmark As String[] Dim cPrivate As Collection Dim hBookmark As Bookmark + + If $iBookmarkAge = Bookmarks._Age Then Return + $iBookmarkAge = Bookmarks._Age Me.Clear() diff --git a/comp/src/gb.form/.src/File/Bookmarks.class b/comp/src/gb.form/.src/File/Bookmarks.class index d00f96d39..afccc6df1 100644 --- a/comp/src/gb.form/.src/File/Bookmarks.class +++ b/comp/src/gb.form/.src/File/Bookmarks.class @@ -6,6 +6,8 @@ Static Property Read Count As Integer Static Private $aBookmark As New Bookmark[] +Static Public _Age As Integer = 1 + Static Public Sub Add(Path As String, Optional Name As String, Icon As String) Dim hBookmark As Bookmark @@ -18,6 +20,7 @@ Static Public Sub Add(Path As String, Optional Name As String, Icon As String) End With $aBookmark.Add(hBookmark) + Inc _Age End @@ -35,6 +38,8 @@ Static Public Sub Remove(Path As String) Endif Wend + Inc _Age + End Static Private Function Count_Read() As Integer @@ -46,6 +51,7 @@ End Static Public Sub Clear() $aBookmark.Clear + Inc _Age End diff --git a/comp/src/gb.form/.src/File/Chooser/FDirChooser.class b/comp/src/gb.form/.src/File/Chooser/FDirChooser.class index 5f7d78a4a..0129e63ae 100644 --- a/comp/src/gb.form/.src/File/Chooser/FDirChooser.class +++ b/comp/src/gb.form/.src/File/Chooser/FDirChooser.class @@ -953,6 +953,8 @@ Private Sub FillMenu() If IsBookmarkVisible() Then + $hBookmarkList.Load() + mnuBookmark = New Menu(mnuPopup) mnuBookmark.Name = "mnuBookmark" mnuBookmark.Text = ("Bookmarks") diff --git a/comp/src/gb.form/map/icon.map b/comp/src/gb.form/map/icon.map index 1b85cb92c..dca1d37ed 100644 --- a/comp/src/gb.form/map/icon.map +++ b/comp/src/gb.form/map/icon.map @@ -190,6 +190,7 @@ trash [breeze*!16]places/user-trash;places/user-trash undo actions/edit-undo unindent actions/format-indent-less unlock actions/object-unlocked +unselect actions/edit-select-none up actions/go-up upload [breeze*]actions/cloud-upload user [breeze*]actions/user-identity;stock/stock_person;status/avatar-default