Skip to content
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

Minimize CKAN to tray and automatic refreshing #2565

Merged
merged 4 commits into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Core/Win32Registry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public interface IWin32Registry
void SetKSPBuilds(string buildMap);
string DownloadCacheDir { get; set; }
long? CacheSizeLimit { get; set; }
int RefreshRate { get; set; }
}

public class Win32Registry : IWin32Registry
Expand Down Expand Up @@ -83,6 +84,26 @@ public long? CacheSizeLimit
}
}

/// <summary>
/// Get and set the interval in minutes to refresh the modlist.
/// Never refresh if 0.
/// </summary>
public int RefreshRate
{
get { return GetRegistryValue(@"RefreshRate", 0); }
set
{
if (value <= 0)
{
DeleteRegistryValue(@"RefreshRate");
}
else
{
SetRegistryValue(@"RefreshRate", value);
}
}
}

private int InstanceCount
{
get { return GetRegistryValue(@"KSPInstanceCount", 0); }
Expand Down
5 changes: 4 additions & 1 deletion GUI/CKAN-GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@
</Compile>
<Compile Include="Configuration.cs" />
<Compile Include="ControlFactory.cs" />
<Compile Include="DropdownMenuButton.cs" />
<Compile Include="DropdownMenuButton.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="ErrorDialog.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -152,6 +154,7 @@
<SubType>Form</SubType>
</Compile>
<Compile Include="MainImport.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainInstall.cs">
<SubType>Form</SubType>
Expand Down
4 changes: 4 additions & 0 deletions GUI/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ public class Configuration
public bool CheckForUpdatesOnLaunch = false;
public bool CheckForUpdatesOnLaunchNoNag = false;

public bool EnableTrayIcon = false;
public bool MinimizeToTray = false;

public bool HideEpochs = true;
public bool HideV = false;

public bool RefreshOnStartup = true; // Defaults to true, so everyone is forced to refresh on first start
public bool RefreshOnStartupNoNag = false;
public bool RefreshPaused = false;

public bool AutoSortByUpdate = true;

Expand Down
145 changes: 137 additions & 8 deletions GUI/Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading