lazhen
2025-01-09 8afe90b633046db39042aada36b88193062f8cff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Quintiq file version 2.0
#parent: #root
Method Edit (
  internal[GUIComponent] parent,
  Bookmark bookmark
) as Bookmark id:Method_DialogCreateEditBookmark_Edit
{
  #keys: '[121072.0.291119847]'
  Body:
  [*
    // New bookmark
    
    data := shadow( bookmark );
    ValueHolderIsFolder.Value( [String] data.IsFolder() )
    Dialog.Data( data );
    
    this.SetTitle( Dialog.Data().IsFolder() );
    
    // We need to set filter here because if we are editing a bookmark folder,
    // we need to filter out all of its children from the parent folder selection
    // because the code at this moment doesn't support changing a bookmark folder parent
    // to one of its children
    this.SetFilters( bookmark );
    
    result := Dialog.DoModal( parent );
    
    if( result > 0 )
    {
      bookmarks := construct( Bookmarks );
      bookmarks.Add( bookmark );
      bookmark.Update( EditorName.Text(), this.GetParentFolderName() );
    }
    
    return bookmark
  *]
}