Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

42
LINES

< > BotCompany Repo | #1019679 // Important Directories [comment on local directories & select for backup & monitoring]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (11531L/61K).

1  
!7
2  
3  
concept Entry {
4  
  S path;
5  
  //LS alternatePaths;
6  
  S comment;
7  
  bool shouldBeBackedUp, monitor, isPrivate;
8  
9  
  sS _fieldOrder = "path comment shouldBeBackedUp monitor isPrivate";
10  
}
11  
12  
cmodule UserDirectories > DynCRUD<Entry> {
13  
  start {
14  
    // Add some default stuff
15  
    add(userDir(), "Your home directory");
16  
    add(javaxDataDir(), "JavaX data directory");
17  
    cset(add(javaxSecretDir(), "JavaX secret directory"), isPrivate := true);
18  
    add(javaxCachesDir(), "JavaX cache directory");
19  
    add(javaxCodeDir(), "JavaX code directory");
20  
    add(desktopDir(), "Your desktop");
21  
    add(downloadsDir(), "Your downloads");
22  
  }
23  
  
24  
  afterVisualize {
25  
    makeSortable();
26  
    onTableCellLeftClick(table(), voidfunc(int col, int row) {
27  
      if (col == 3)
28  
        cflipBool(selected(), 'shouldBeBackedUp);
29  
      else if (col == 4)
30  
        cflipBool(selected(), 'monitor);
31  
    });
32  
  }
33  
  
34  
  // API
35  
  
36  
  // only sets comment if it was empty
37  
  Entry add(File dir, S comment) {
38  
    Entry e = uniq(Entry, path := f2s(dir));
39  
    if (emptyAfterTrim(e.comment)) cset(e, +comment);
40  
    ret e;
41  
  }
42  
}

Author comment

Began life as a copy of #1019281

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1019679
Snippet name: Important Directories [comment on local directories & select for backup & monitoring]
Eternal ID of this version: #1019679/17
Text MD5: b4c41b0e8e409b9e6178f03ac970a9ee
Transpilation MD5: 6e35cbbf94926457307ac5bc400a70cf
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-01-22 15:06:21
Source code size: 1119 bytes / 42 lines
Pitched / IR pitched: No / No
Views / Downloads: 365 / 2444
Version history: 16 change(s)
Referenced in: [show references]