Added a config setting to denote completion of the startup wizard

This commit is contained in:
LukePulverenti 2013-03-04 11:56:29 -05:00
parent 05b9500175
commit da535db655
6 changed files with 28 additions and 3 deletions

View File

@ -158,10 +158,10 @@ namespace MediaBrowser.Common.Implementations
{ {
return Task.Run(() => return Task.Run(() =>
{ {
IsFirstRun = !ConfigurationManager.CommonConfiguration.IsStartupWizardCompleted;
Logger = LogManager.GetLogger("App"); Logger = LogManager.GetLogger("App");
IsFirstRun = !File.Exists(ApplicationPaths.SystemConfigurationFilePath);
DiscoverTypes(); DiscoverTypes();
LogManager.ReloadLogger(ConfigurationManager.CommonConfiguration.EnableDebugLevelLogging ? LogSeverity.Debug : LogSeverity.Info); LogManager.ReloadLogger(ConfigurationManager.CommonConfiguration.EnableDebugLevelLogging ? LogSeverity.Debug : LogSeverity.Info);

View File

@ -65,6 +65,13 @@ namespace MediaBrowser.Model.Configuration
/// <value>The legacy web socket port number.</value> /// <value>The legacy web socket port number.</value>
[ProtoMember(59)] [ProtoMember(59)]
public int LegacyWebSocketPortNumber { get; set; } public int LegacyWebSocketPortNumber { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is first run.
/// </summary>
/// <value><c>true</c> if this instance is first run; otherwise, <c>false</c>.</value>
[ProtoMember(4)]
public bool IsStartupWizardCompleted { get; set; }
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class. /// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.

View File

@ -430,6 +430,7 @@ namespace MediaBrowser.WebDashboard.Api
"UpdatePasswordPage.js", "UpdatePasswordPage.js",
"UserImagePage.js", "UserImagePage.js",
"UserProfilesPage.js", "UserProfilesPage.js",
"WizardFinishPage.js",
"WizardStartPage.js", "WizardStartPage.js",
"WizardUserPage.js", "WizardUserPage.js",
"SupporterKeyPage.js", "SupporterKeyPage.js",

View File

@ -0,0 +1,16 @@
var WizardFinishPage = {
onFinish: function() {
ApiClient.getServerConfiguration().done(function (config) {
config.IsStartupWizardCompleted = true;
ApiClient.updateServerConfiguration(config).done(function() {
Dashboard.navigate('dashboard.html');
});
});
}
};

View File

@ -16,7 +16,7 @@
<div class="wizardNavigation"> <div class="wizardNavigation">
<button type="button" data-iconpos="left" data-icon="arrow-left" data-inline="true" onclick="history.back();">Previous</button> <button type="button" data-iconpos="left" data-icon="arrow-left" data-inline="true" onclick="history.back();">Previous</button>
<button type="button" data-iconpos="right" data-icon="wrench" data-inline="true" onclick="Dashboard.navigate('dashboard.html');" data-theme="b">Go to the Dashboard</button> <button type="button" data-iconpos="right" data-icon="wrench" data-inline="true" onclick="WizardFinishPage.onFinish();" data-theme="b">Go to the Dashboard</button>
</div> </div>
</div> </div>

View File

@ -384,6 +384,7 @@
<EmbeddedResource Include="Html\scripts\ItemDetailPage.js" /> <EmbeddedResource Include="Html\scripts\ItemDetailPage.js" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Html\scripts\WizardFinishPage.js" />
<EmbeddedResource Include="Html\Readme.txt" /> <EmbeddedResource Include="Html\Readme.txt" />
<EmbeddedResource Include="Html\css\images\media\playCircle.png" /> <EmbeddedResource Include="Html\css\images\media\playCircle.png" />
<EmbeddedResource Include="Html\css\images\media\nextTrack.png" /> <EmbeddedResource Include="Html\css\images\media\nextTrack.png" />