!7 !include #1016871 // main is not run sclass SnippetsDB extends DynModule { bool withText; transient ReliableSingleThread rst = new(r updateMe); start { autoDownloadText = withText; useDBOf(#1016871); onConceptsChange(rst); fullUpdateAtStart = false; snippetsDB_init(); indexConceptField(CSnippet, 'type); } visualize { ret centerBoldLabel(jLiveValueLabel(dm_calculatedLiveValue(this, S, func -> S { n2(countConcepts(CSnippet), "snippet") }))); } enhanceFrame { addTitlePopupMenuItem(f, "Full download", rThread fullDownload); dm_boolFieldMenuItem(f, 'withText, onSet := r { autoDownloadText = withText }); } // API for other modules L snippetsOfType(S type) { ret sortedByFieldDesc('snippetID, conceptsWhere(CSnippet, +type)); } }