-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add more walkthroughs, donation prompt, and responsive layout for welcome tab #13679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 22 commits
06ec2cb
adcb443
bcb08af
66248ae
235b815
54b5a03
25eb89f
7aa6c28
4e8633a
8396fd0
e7c27fc
f2ff8be
0820579
7df9b4a
df6862d
82b8f24
c835d10
a84fc33
bacb5e8
28d6c3b
dc249d2
174f62d
b12af73
b55db22
f8f48af
a3346f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.jabref.gui.preferences; | ||
|
||
import javafx.beans.property.BooleanProperty; | ||
import javafx.beans.property.IntegerProperty; | ||
import javafx.beans.property.SimpleBooleanProperty; | ||
import javafx.beans.property.SimpleIntegerProperty; | ||
|
||
public class DonationPreferences { | ||
private final BooleanProperty neverShowAgain = new SimpleBooleanProperty(); | ||
private final IntegerProperty lastShownEpochDay = new SimpleIntegerProperty(); | ||
|
||
public DonationPreferences(boolean neverShowAgain, int lastShownEpochDay) { | ||
this.neverShowAgain.set(neverShowAgain); | ||
this.lastShownEpochDay.set(lastShownEpochDay); | ||
} | ||
|
||
public boolean isNeverShowAgain() { | ||
return neverShowAgain.get(); | ||
} | ||
|
||
public void setNeverShowAgain(boolean value) { | ||
this.neverShowAgain.set(value); | ||
} | ||
|
||
public BooleanProperty neverShowAgainProperty() { | ||
return neverShowAgain; | ||
} | ||
|
||
public int getLastShownEpochDay() { | ||
return lastShownEpochDay.get(); | ||
} | ||
|
||
public void setLastShownEpochDay(int value) { | ||
this.lastShownEpochDay.set(value); | ||
} | ||
|
||
public IntegerProperty lastShownEpochDayProperty() { | ||
return lastShownEpochDay; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -204,6 +204,11 @@ public class JabRefGuiPreferences extends JabRefCliPreferences implements GuiPre | |
private static final String INCLUDE_CROSS_REFERENCES = "includeCrossReferences"; | ||
private static final String ASK_FOR_INCLUDING_CROSS_REFERENCES = "askForIncludingCrossReferences"; | ||
|
||
// region Donation preferences | ||
private static final String DONATION_NEVER_SHOW = "donationNeverShow"; | ||
private static final String DONATION_LAST_SHOWN_EPOCH_DAY = "donationLastShownEpochDay"; | ||
// endregion | ||
|
||
// region NewEntryPreferences | ||
private static final String CREATE_ENTRY_APPROACH = "latestApproach"; | ||
private static final String CREATE_ENTRY_EXPAND_RECOMMENDED = "typesRecommendedExpanded"; | ||
|
@@ -378,6 +383,11 @@ private JabRefGuiPreferences() { | |
defaults.put(ASK_FOR_INCLUDING_CROSS_REFERENCES, Boolean.TRUE); | ||
defaults.put(INCLUDE_CROSS_REFERENCES, Boolean.FALSE); | ||
|
||
// region donation defaults | ||
defaults.put(DONATION_NEVER_SHOW, Boolean.FALSE); | ||
defaults.put(DONATION_LAST_SHOWN_EPOCH_DAY, -1); | ||
// endregion | ||
|
||
// region NewEntryUnifierPreferences | ||
defaults.put(CREATE_ENTRY_APPROACH, List.of(NewEntryDialogTab.values()).indexOf(NewEntryDialogTab.CHOOSE_ENTRY_TYPE)); | ||
defaults.put(CREATE_ENTRY_EXPAND_RECOMMENDED, true); | ||
|
@@ -1192,6 +1202,13 @@ public NewEntryPreferences getNewEntryPreferences() { | |
return newEntryPreferences; | ||
} | ||
|
||
public DonationPreferences getDonationPreferences() { | ||
DonationPreferences dp = new DonationPreferences(getBoolean(DONATION_NEVER_SHOW), getInt(DONATION_LAST_SHOWN_EPOCH_DAY)); | ||
EasyBind.listen(dp.neverShowAgainProperty(), (_, _, nv) -> putBoolean(DONATION_NEVER_SHOW, nv)); | ||
EasyBind.listen(dp.lastShownEpochDayProperty(), (_, _, nv) -> putInt(DONATION_LAST_SHOWN_EPOCH_DAY, nv.intValue())); | ||
return dp; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expand abbreviations dp and nv. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DonationPreferences does not use the current cache pattern, which is okay. But it needs to be documented why. Please add a comment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer to have it consistent with other preferences in case we want to reuse it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed by adding the cache pattern |
||
|
||
/** | ||
* In GUI mode, we can lookup the directory better | ||
*/ | ||
|
Uh oh!
There was an error while loading. Please reload this page.