@@ -32,7 +32,7 @@ let win = null, settingsWin = null, aboutWin = null, tourWin = null, floatingWin
3232 kioskInterval = null ,
3333 recorderDate = null , tempDate = null , yearAndMon = null , yearMonDay = null , year = null ,
3434 estimCurrent = 0 , todaySum = 0 ,
35- store = null , styleCache = null , statistics = null , timingData = null ,
35+ store = null , styleCache = null , statistics = null , timingData = null , recapStore = null ,
3636 personalizationNotificationList = [ [ ] , [ ] , [ ] , [ ] , [ ] , [ ] ] ,
3737 isMultiMonitorLoose = false ;
3838
@@ -396,9 +396,11 @@ app.on('ready', () => {
396396 if ( process . env . NODE_ENV === "portable" ) {
397397 store = new Store ( { cwd : app . getPath ( 'exe' ) . replace ( "wnr.exe" , "" ) , name : 'wnr-config' } ) ; //accept portable
398398 statistics = new Store ( { cwd : app . getPath ( 'exe' ) . replace ( "wnr.exe" , "" ) , name : 'wnr-statistics' } ) ;
399+ recapStore = new Store ( { cwd : app . getPath ( 'exe' ) . replace ( "wnr.exe" , "" ) , name : 'wnr-recap' } ) ;
399400 } else {
400401 store = new Store ( ) ;
401402 statistics = new Store ( { name : 'statistics' } ) ;
403+ recapStore = new Store ( { name : 'recap' } ) ;
402404 }
403405 styleCache = new Store ( { name : 'style-cache' } ) ;
404406 timingData = new Store ( { name : 'timing-data' } ) ;
@@ -1894,6 +1896,34 @@ ipcMain.on('warning-giver-all-task-end', function () {
18941896 traySolution ( isFullscreenMode ) ;
18951897} )
18961898
1899+ ipcMain . on ( 'save-recap-entry' , function ( event , data ) {
1900+ if ( ! recapStore . has ( 'entries' ) ) {
1901+ recapStore . set ( 'entries' , [ ] ) ;
1902+ }
1903+ let entries = recapStore . get ( 'entries' ) ;
1904+ entries . push ( {
1905+ title : data . title ,
1906+ note : data . note ,
1907+ sessionId : data . sessionId ,
1908+ timestamp : data . timestamp ,
1909+ date : new Date ( data . timestamp ) . toISOString ( ) . split ( 'T' ) [ 0 ] ,
1910+ method : data . method ,
1911+ isOnlyRest : data . isOnlyRest
1912+ } ) ;
1913+ recapStore . set ( 'entries' , entries ) ;
1914+ } )
1915+
1916+ ipcMain . on ( 'recap-delete-confirm' , function ( event , data ) {
1917+ let confirmMsg = "" ;
1918+ if ( data . type === 'entry' ) {
1919+ confirmMsg = i18n . __ ( 'recap-delete-entry-confirm' ) ;
1920+ } else if ( data . type === 'date' ) {
1921+ confirmMsg = i18n . __ ( 'recap-delete-date-confirm' ) + " " + data . date + "?" ;
1922+ }
1923+ customDialog ( "select_on" , i18n . __ ( 'recap-delete-title' ) , confirmMsg ,
1924+ "win.webContents.send('recap-delete-execute', " + JSON . stringify ( data ) + ");" ) ;
1925+ } )
1926+
18971927ipcMain . on ( 'update-feedback' , function ( event , message ) {
18981928 // another button usage: button3_update
18991929 if ( message === "update-available" ) {
@@ -1927,7 +1957,7 @@ ipcMain.on('can-redo-alert', function () {
19271957
19281958ipcMain . on ( 'delete-all-data' , function ( ) {
19291959 if ( settingsWin != null ) {
1930- customDialog ( "select_on" , i18n . __ ( 'delete-all-data-dialog-box-title' ) , i18n . __ ( 'delete-all-data-dialog-box-content' ) , "store.clear();statistics.clear();styleCache.clear();timingData.clear();relaunchSolution()" ) ;
1960+ customDialog ( "select_on" , i18n . __ ( 'delete-all-data-dialog-box-title' ) , i18n . __ ( 'delete-all-data-dialog-box-content' ) , "store.clear();statistics.clear();styleCache.clear();timingData.clear();recapStore.clear(); relaunchSolution()" ) ;
19311961 }
19321962} )
19331963
0 commit comments