@@ -363,11 +363,6 @@ private JabRefGuiPreferences() {
363363 defaults .put (ASK_FOR_INCLUDING_CROSS_REFERENCES , Boolean .TRUE );
364364 defaults .put (INCLUDE_CROSS_REFERENCES , Boolean .FALSE );
365365
366- // region donation defaults
367- defaults .put (DONATION_NEVER_SHOW , Boolean .FALSE );
368- defaults .put (DONATION_LAST_SHOWN_EPOCH_DAY , -1 );
369- // endregion
370-
371366 // region NewEntryUnifierPreferences
372367 defaults .put (CREATE_ENTRY_APPROACH , List .of (NewEntryDialogTab .values ()).indexOf (NewEntryDialogTab .CHOOSE_ENTRY_TYPE ));
373368 defaults .put (CREATE_ENTRY_EXPAND_RECOMMENDED , true );
@@ -414,6 +409,7 @@ public void clear() throws BackingStoreException {
414409
415410 getWorkspacePreferences ().setAll (WorkspacePreferences .getDefault ());
416411 getGuiPreferences ().setAll (CoreGuiPreferences .getDefault ());
412+ getDonationPreferences ().setAll (DonationPreferences .getDefault ());
417413 }
418414
419415 @ Override
@@ -423,6 +419,7 @@ public void importPreferences(Path file) throws JabRefException {
423419 // in case of incomplete or corrupt xml fall back to current preferences
424420 getWorkspacePreferences ().setAll (getWorkspacePreferencesFromBackingStore (getWorkspacePreferences ()));
425421 getGuiPreferences ().setAll (getCoreGuiPreferencesFromBackingStore (getGuiPreferences ()));
422+ getDonationPreferences ().setAll (getDonationPreferencesFromBackingStore (getDonationPreferences ()));
426423 }
427424
428425 // region EntryEditorPreferences
@@ -1212,17 +1209,26 @@ public NewEntryPreferences getNewEntryPreferences() {
12121209 return newEntryPreferences ;
12131210 }
12141211
1212+ // region Donation preferences
12151213 public DonationPreferences getDonationPreferences () {
12161214 if (donationPreferences != null ) {
12171215 return donationPreferences ;
12181216 }
12191217
1220- donationPreferences = new DonationPreferences (getBoolean (DONATION_NEVER_SHOW ), getInt (DONATION_LAST_SHOWN_EPOCH_DAY ));
1218+ donationPreferences = getDonationPreferencesFromBackingStore (DonationPreferences .getDefault ());
1219+
12211220 EasyBind .listen (donationPreferences .neverShowAgainProperty (), (_ , _ , newValue ) -> putBoolean (DONATION_NEVER_SHOW , newValue ));
12221221 EasyBind .listen (donationPreferences .lastShownEpochDayProperty (), (_ , _ , newValue ) -> putInt (DONATION_LAST_SHOWN_EPOCH_DAY , newValue .intValue ()));
12231222 return donationPreferences ;
12241223 }
12251224
1225+ private DonationPreferences getDonationPreferencesFromBackingStore (DonationPreferences defaults ) {
1226+ return new DonationPreferences (
1227+ getBoolean (DONATION_NEVER_SHOW , defaults .isNeverShowAgain ()),
1228+ getInt (DONATION_LAST_SHOWN_EPOCH_DAY , defaults .getLastShownEpochDay ()));
1229+ }
1230+ // endregion
1231+
12261232 /**
12271233 * In GUI mode, we can lookup the directory better
12281234 */
0 commit comments