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).

!7

concept Entry {
  S path;
  //LS alternatePaths;
  S comment;
  bool shouldBeBackedUp, monitor, isPrivate;

  sS _fieldOrder = "path comment shouldBeBackedUp monitor isPrivate";
}

cmodule UserDirectories > DynCRUD<Entry> {
  start {
    // Add some default stuff
    add(userDir(), "Your home directory");
    add(javaxDataDir(), "JavaX data directory");
    cset(add(javaxSecretDir(), "JavaX secret directory"), isPrivate := true);
    add(javaxCachesDir(), "JavaX cache directory");
    add(javaxCodeDir(), "JavaX code directory");
    add(desktopDir(), "Your desktop");
    add(downloadsDir(), "Your downloads");
  }
  
  afterVisualize {
    makeSortable();
    onTableCellLeftClick(table(), voidfunc(int col, int row) {
      if (col == 3)
        cflipBool(selected(), 'shouldBeBackedUp);
      else if (col == 4)
        cflipBool(selected(), 'monitor);
    });
  }
  
  // API
  
  // only sets comment if it was empty
  Entry add(File dir, S comment) {
    Entry e = uniq(Entry, path := f2s(dir));
    if (emptyAfterTrim(e.comment)) cset(e, +comment);
    ret e;
  }
}

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: 364 / 2442
Version history: 16 change(s)
Referenced in: [show references]