Skip to content
This repository has been archived by the owner on Nov 28, 2018. It is now read-only.

Commit

Permalink
Updated file headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkentim committed Apr 30, 2016
1 parent ba31a9e commit 015a8aa
Show file tree
Hide file tree
Showing 171 changed files with 2,513 additions and 783 deletions.
17 changes: 15 additions & 2 deletions ParkitectNexusClient.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderText/@EntryValue">$SOLUTION$&#xD;
Copyright $CURRENT_YEAR$ Parkitect, Tim Potze</s:String></wpf:ResourceDictionary>
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderText/@EntryValue">$SOLUTION$
Copyright (C) $CURRENT_YEAR$ ParkitectNexus, Tim Potze

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</s:String></wpf:ResourceDictionary>
26 changes: 19 additions & 7 deletions src/ParkitectNexus.Client.Base/App.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
// ParkitectNexusClient
// Copyright 2016 Parkitect, Tim Potze
// Copyright (C) 2016 ParkitectNexus, Tim Potze
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

using System.IO;
using System.Reflection;
Expand All @@ -21,13 +31,13 @@ namespace ParkitectNexus.Client.Base
public class App : IPresenter
{
private readonly ILogger _log;
private readonly IUpdateManager _updateManager;
private readonly IParkitect _parkitect;
private readonly IPresenterFactory _presenterFactory;
private readonly IQueueableTaskManager _taskManager;
private readonly IUpdateManager _updateManager;
private bool _isRunning;
private readonly Migrator _migrator;
private MainWindow _window;
private Migrator _migrator;

public App(IPresenterFactory presenterFactory, IParkitect parkitect, IQueueableTaskManager taskManager,
ILogger log, IUpdateManager updateManager, Migrator migrator)
Expand Down Expand Up @@ -57,9 +67,10 @@ public bool Initialize(ToolkitType type)
if (update != null)
{
if (
MessageDialog.AskQuestion("A required update for the ParkitectNexus Client needs to be installed.\n" +
MessageDialog.AskQuestion(
"A required update for the ParkitectNexus Client needs to be installed.\n" +
"Without this update you won't be able to install blueprints, savegames or mods trough this application. The update should take less than a minute.\n" +
$"Would you like to install it now?\n\nYou are currently running v{typeof(App).Assembly.GetName().Version}. The newest version is v{update.Version}",
$"Would you like to install it now?\n\nYou are currently running v{typeof (App).Assembly.GetName().Version}. The newest version is v{update.Version}",
"ParkitectNexus Client Update", Command.Yes, Command.No) !=
Command.Yes)
{
Expand All @@ -76,7 +87,8 @@ public bool Initialize(ToolkitType type)
if (!_parkitect.DetectInstallationPath())
{
if (
!MessageDialog.Confirm("We couldn't automatically detect Parkitect on your machine!\nPlease press OK and manually select the installation folder of Parkitect.",
!MessageDialog.Confirm(
"We couldn't automatically detect Parkitect on your machine!\nPlease press OK and manually select the installation folder of Parkitect.",
Command.Ok))
{
_window.Dispose();
Expand Down Expand Up @@ -163,4 +175,4 @@ public void Run()
Application.Dispose();
}
}
}
}
14 changes: 12 additions & 2 deletions src/ParkitectNexus.Client.Base/Components/SidebarContainer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
// ParkitectNexusClient
// Copyright 2016 Parkitect, Tim Potze
// Copyright (C) 2016 ParkitectNexus, Tim Potze
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

using Xwt;
using Xwt.Drawing;
Expand Down Expand Up @@ -39,4 +49,4 @@ public void ShowWidget(string name, Widget widget)
}
}
}
}
}
14 changes: 12 additions & 2 deletions src/ParkitectNexus.Client.Base/Components/TaskView.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
// ParkitectNexusClient
// Copyright 2016 Parkitect, Tim Potze
// Copyright (C) 2016 ParkitectNexus, Tim Potze
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

using System;
using ParkitectNexus.Data.Tasks;
Expand Down Expand Up @@ -105,4 +115,4 @@ private void Task_StatusChanged(object sender, EventArgs e)
UpdateLabels();
}
}
}
}
14 changes: 12 additions & 2 deletions src/ParkitectNexus.Client.Base/Main/MainHeaderView.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
// ParkitectNexusClient
// Copyright 2016 Parkitect, Tim Potze
// Copyright (C) 2016 ParkitectNexus, Tim Potze
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

using ParkitectNexus.Data.Presenter;
using Xwt;
Expand All @@ -13,4 +23,4 @@ public MainHeaderView()
PackStart(new ImageView(App.Images["parkitectnexus_logo_full.png"]));
}
}
}
}
20 changes: 15 additions & 5 deletions src/ParkitectNexus.Client.Base/Main/MainNotebook.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
// ParkitectNexusClient
// Copyright 2016 Parkitect, Tim Potze
// Copyright (C) 2016 ParkitectNexus, Tim Potze
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

using System;
using System.Linq;
Expand Down Expand Up @@ -44,11 +54,11 @@ private void Page_NameChanged(object sender, EventArgs e)

public void HandleSizeUpdate()
{
foreach(var tab in Tabs)
foreach (var tab in Tabs)
{
var loadableTilesView = tab.Child as LoadableDataTileView;

loadableTilesView?.HandleSizeUpdate((float)Size.Width);
loadableTilesView?.HandleSizeUpdate((float) Size.Width);

var vvv = tab.Child as TasksPageView;
vvv?.HandleSizeChange();
Expand All @@ -61,7 +71,7 @@ protected override void OnCurrentTabChanged(EventArgs e)
{
base.OnCurrentTabChanged(e);

if(!HandleSizeChangeOnTabChange)
if (!HandleSizeChangeOnTabChange)
return;

HandleSizeUpdate();
Expand All @@ -72,4 +82,4 @@ protected override void OnCurrentTabChanged(EventArgs e)

#endregion
}
}
}
15 changes: 12 additions & 3 deletions src/ParkitectNexus.Client.Base/Main/MainView.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
// ParkitectNexusClient
// Copyright 2016 Parkitect, Tim Potze
// Copyright (C) 2016 ParkitectNexus, Tim Potze
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

using ParkitectNexus.Client.Base.Components;
using ParkitectNexus.Client.Base.Pages;
using ParkitectNexus.Client.Base.Tiles;
using ParkitectNexus.Data.Presenter;
using Xwt;

Expand Down Expand Up @@ -61,4 +70,4 @@ protected override void OnBoundsChanged()
_notebook.HandleSizeUpdate();
}
}
}
}
12 changes: 11 additions & 1 deletion src/ParkitectNexus.Client.Base/Main/MainWindow.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
// ParkitectNexusClient
// Copyright 2016 Parkitect, Tim Potze
// Copyright (C) 2016 ParkitectNexus, Tim Potze
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

using ParkitectNexus.Data.Presenter;
using Xwt;
Expand Down
124 changes: 70 additions & 54 deletions src/ParkitectNexus.Client.Base/Migrations/Migrator.cs
Original file line number Diff line number Diff line change
@@ -1,54 +1,70 @@
using System;
using ParkitectNexus.Data.Game;
using System.Collections.Generic;
using Newtonsoft.Json;
using ParkitectNexus.Data.Assets.Meta;
using System.IO;

namespace ParkitectNexus.Client.Base
{
public class Migrator
{
private IParkitect _parkitect;

public Migrator(IParkitect parkitect)
{
_parkitect = parkitect;
}

private void MigrateModJsonPreClientVersion2()
{
foreach(var mod in _parkitect.Assets[ParkitectNexus.Data.Assets.AssetType.Mod])
{
var metaPath = Path.Combine(mod.InstallationPath, "modinfo.meta");
if(!File.Exists(metaPath))
{
var oldData = JsonConvert.DeserializeObject<OldModJsonFile>(File.ReadAllText(Path.Combine(mod.InstallationPath, "mod.json")));

var meta = new ModMetadata {
Tag = oldData.Tag,
Repository = oldData.Repository,
Id = null,
InstalledVersion = DateTime.Now
};

File.WriteAllText(metaPath, JsonConvert.SerializeObject(meta));
}
}
}

public void Migrate()
{
MigrateModJsonPreClientVersion2();
}

private class OldModJsonFile
{
[JsonProperty]
public string Tag { get; set; }
[JsonProperty]
public string Repository { get; set; }
}
}
}

// ParkitectNexusClient
// Copyright (C) 2016 ParkitectNexus, Tim Potze
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

using System;
using System.IO;
using Newtonsoft.Json;
using ParkitectNexus.Data.Assets;
using ParkitectNexus.Data.Assets.Meta;
using ParkitectNexus.Data.Game;

namespace ParkitectNexus.Client.Base
{
public class Migrator
{
private readonly IParkitect _parkitect;

public Migrator(IParkitect parkitect)
{
_parkitect = parkitect;
}

private void MigrateModJsonPreClientVersion2()
{
foreach (var mod in _parkitect.Assets[AssetType.Mod])
{
var metaPath = Path.Combine(mod.InstallationPath, "modinfo.meta");
if (!File.Exists(metaPath))
{
var oldData =
JsonConvert.DeserializeObject<OldModJsonFile>(
File.ReadAllText(Path.Combine(mod.InstallationPath, "mod.json")));

var meta = new ModMetadata
{
Tag = oldData.Tag,
Repository = oldData.Repository,
Id = null,
InstalledVersion = DateTime.Now
};

File.WriteAllText(metaPath, JsonConvert.SerializeObject(meta));
}
}
}

public void Migrate()
{
MigrateModJsonPreClientVersion2();
}

private class OldModJsonFile
{
[JsonProperty]
public string Tag { get; set; }

[JsonProperty]
public string Repository { get; set; }
}
}
}
17 changes: 15 additions & 2 deletions src/ParkitectNexus.Client.Base/ModLoaderUtil.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
using System;
// ParkitectNexusClient
// Copyright (C) 2016 ParkitectNexus, Tim Potze
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

using System;
using System.IO;
using System.Reflection;
using ParkitectNexus.Data.Game;
Expand Down Expand Up @@ -46,4 +59,4 @@ public static void InstallModLoader(IParkitect parkitect, ILogger logger)
}
}
}
}
}
Loading

0 comments on commit 015a8aa

Please sign in to comment.