// ********************************************************* // Variables // ********************************************************* // Screen typeof iScrW = I;; typeof iScrH = I;; // Window typeof winMain = ObjWin;; var iWinW = 640;; var iWinH = 280;; // Last version typeof txtLV0 = ObjText;; // Label typeof txtLV1 = ObjText;; // Date I typeof txtLV2 = ObjText;; // Date Clear // Version generation typeof butVG0 = ObjButton;; // Generate version typeof txtVG0 = ObjText;; // New proposed version I // Version validation typeof butVV0 = ObjButton;; // Validate version // Modify VM typeof txtVM0 = ObjText;; // Label: How to implement new version // Quit typeof butQT0 = ObjButton;; // Quit software // Version typeof iVersion = I;; // Log file var sHistFile = "tools/get_new_voyager_version/history.txt";; typeof lHist = [[S r1] r1];; // ********************************************************* // Functions // ********************************************************* // Release resources fun ReleaseResources() = _DStext txtLV0; _DStext txtLV1; _DStext txtLV2; _DSbutton butVG0; _DStext txtVG0; _DSbutton butVV0; _DStext txtVM0; _DSbutton butQT0; _closemachine; 0;; // Close fun cbWinDestroy(win, p) = ReleaseResources; 0;; // Click Version Generation button fun cbClickVG(but, p) = set iVersion = time; _SETtext txtVG0 (itoh iVersion); _ENbutton butVV0 1; 0;; // Click Version Validation button fun cbClickVV(but, p) = _SETtext txtVG0 (itoh iVersion); _ENbutton butVG0 0; _ENbutton butVV0 0; _ENbutton butQT0 1; set lHist = ((ctime iVersion)::(strcat "0x" (itoh iVersion))::nil)::lHist; _storepack (strbuild lHist) sHistFile; _SETtext txtVM0 "- Faire un copier/coller du nouveau numéro de version\n- Editer le fichier locked/etc/version.txt\n- Modifier la variable version\n- Recompiler l'installation\n- Quitter, mettre à jour la version sur le site"; 0;; // Quit fun cbClickQT(but, p) = ReleaseResources; 0;; // Entry point fun main() = //_showconsole; _fooS "********** Current version **********"; let _GETscreenSize -> [w h] in ( set iScrW = w; set iScrH = h; ); set winMain = _CRwindow _channel nil ((iScrW - iWinW) / 2) ((iScrH - iWinH) / 2) iWinW iWinH WN_MENU|WN_MINBOX|WN_NOBORDER|WN_NOSCOL "VM: Générateur de version"; set txtLV0 = _CRtext _channel winMain 0 0 240 20 ET_ALIGN_LEFT|ET_BORDER "Dernière version enregistrée:"; set txtLV1 = _CRtext _channel winMain 240 0 160 20 ET_ALIGN_CENTER|ET_BORDER ""; set txtLV2 = _CRtext _channel winMain 400 0 240 20 ET_ALIGN_CENTER|ET_BORDER ""; set butVG0 = _CRbutton _channel winMain 0 40 640 20 0 "Générer un nouveau numéro de version"; set txtVG0 = _CRtext _channel winMain 0 60 640 20 ET_ALIGN_CENTER|ET_BORDER ""; set butVV0 = _CRbutton _channel winMain 0 100 640 20 0 "Valider et enregistrer ce numéro de version"; _ENbutton butVV0 0; set txtVM0 = _CRtext _channel winMain 0 140 640 100 ET_ALIGN_LEFT|ET_BORDER ""; set butQT0 = _CRbutton _channel winMain 0 260 640 20 0 "Quitter"; _ENbutton butQT0 0; set lHist = strextr _getpack _checkpack sHistFile; if (lHist != nil) then ( let hd lHist -> [date [version _]] in ( _SETtext txtLV1 version; _SETtext txtLV2 date; ); 0; ) else 0; _CBbutton butVG0 @cbClickVG nil; _CBbutton butVV0 @cbClickVV nil; _CBbutton butQT0 @cbClickQT nil; _CBwinDestroy winMain @cbWinDestroy nil; _fooS "*************************************"; 0;;