timetracking: add default time in minutes to config (#7227)

Closes #7224
This commit is contained in:
Jake Wilson
2019-01-10 18:50:21 -05:00
committed by Tomas Slusny
parent acdf6541b4
commit c18185c097
2 changed files with 12 additions and 3 deletions

View File

@@ -70,6 +70,17 @@ public interface TimeTrackingConfig extends Config
return false;
}
@ConfigItem(
keyName = "defaultTimerMinutes",
name = "Default Time (Minutes)",
description = "The default time for the timer in minutes",
position = 4
)
default int defaultTimerMinutes()
{
return 5;
}
@ConfigItem(
keyName = "activeTab",
name = "Active Tab",

View File

@@ -41,8 +41,6 @@ import net.runelite.client.plugins.timetracking.TimeTrackingConfig;
@Singleton
public class ClockManager
{
private static final long DEFAULT_TIMER_DURATION = 60 * 5; // 5 minutes
@Inject
private ConfigManager configManager;
@@ -63,7 +61,7 @@ public class ClockManager
void addTimer()
{
timers.add(new Timer("Timer " + (timers.size() + 1), DEFAULT_TIMER_DURATION));
timers.add(new Timer("Timer " + (timers.size() + 1), config.defaultTimerMinutes() * 60));
saveTimers();
SwingUtilities.invokeLater(clockTabPanel::rebuild);