timetracking: add default time in minutes to config (#7227)
Closes #7224
This commit is contained in:
committed by
Tomas Slusny
parent
acdf6541b4
commit
c18185c097
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user