Skip to content

Commit c270e70

Browse files
authored
Merge pull request #57 from CyanCoding/cyancoding-statistic-branch
CyanCoding statistic branch
2 parents 89425fa + 1c3e90d commit c270e70

8 files changed

Lines changed: 387 additions & 44 deletions

File tree

app/Project Tracker/Project Tracker/BackgroundProcesses.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ class BackgroundProcesses {
3434

3535
private static double version = 0.1;
3636

37-
37+
/// <summary>
38+
/// Downloads the latest version from the server.
39+
/// </summary>
40+
/// <param name="url">The url of the server version file.</param>
41+
/// <returns>Returns the server version.</returns>
3842
private static double ServerVersion(string url) {
3943
try {
4044
WebClient client = new WebClient();
@@ -85,6 +89,9 @@ private static void ReadVersion(string versionFile, string url, string dllUrl, s
8589
File.Delete(TEMP_SERVER_VERSION_LOCATION);
8690
}
8791

92+
/// <summary>
93+
/// Runs in the background telling the server that we're active.
94+
/// </summary>
8895
public static void DataReporting() {
8996
if (!Directory.Exists(DLL_APPDATA_LOCATION)) {
9097
Directory.CreateDirectory(DLL_APPDATA_LOCATION);
@@ -132,6 +139,9 @@ public static void DataReporting() {
132139
}
133140
}
134141

142+
/// <summary>
143+
/// Runs when the user adds a project.
144+
/// </summary>
135145
public static void ReportProject() {
136146
if (!File.Exists(SERVER_DLL_LOCATION)) {
137147
return;

app/Project Tracker/Project Tracker/MainTableManifest.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,25 @@ internal class MainTableManifest {
2222

2323

2424
public class Rootobject {
25-
public string Title { get; set; }
26-
public string[] Tasks { get; set; }
27-
public string[] TaskData { get; set; }
28-
public string[] TaskIdentifier { get; set; }
25+
// Leave these first ones, they're for when the user is using an old version and needs to migrate
2926
public string[] Errors { get; set; }
3027
public string[] ErrorsData { get; set; }
3128
public string[] Features { get; set; }
3229
public string[] FeaturesData { get; set; }
3330
public string[] Comments { get; set; }
3431
public string[] CommentsData { get; set; }
32+
33+
// The new data
34+
public string Title { get; set; }
35+
public string[] Tasks { get; set; }
36+
public string[] TaskData { get; set; }
37+
public string[] TaskIdentifier { get; set; }
38+
public string[] LinesOfCodeFiles { get; set; }
39+
public string FolderLocation { get; set; }
3540
public string Duration { get; set; }
41+
public string DateCreated { get; set; }
42+
public long TasksMade { get; set; }
43+
public long TasksCompleted { get; set; }
3644
public string Icon { get; set; }
3745
public string Percent { get; set; }
3846
}

app/Project Tracker/Project Tracker/MainWindow.xaml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,14 @@
268268
<!-- The view if there is projects made -->
269269
<Grid Margin="345,0,0,0">
270270
<Canvas HorizontalAlignment="Left" VerticalAlignment="Top" Height="45" Width="45" Margin="75,31,0,0">
271-
<Image x:Name="displayingImage" Source="{StaticResource noIcon}" Height="45" Width="45" Visibility="Hidden" PreviewMouseDown="displayingImage_PreviewMouseDown" Cursor="Hand" />
271+
<Image x:Name="displayingImage" Source="{StaticResource noIcon}" Height="45" Width="45" Visibility="Visible" PreviewMouseDown="displayingImage_PreviewMouseDown" Cursor="Hand" />
272272
</Canvas>
273273
<Canvas HorizontalAlignment="Right" VerticalAlignment="Top" Height="40" Width="40" Margin="0,45,45,0">
274274
<Image x:Name="settingsImage" Source="{StaticResource settingsDrawingImage}" Height="40" Width="40" Visibility="Hidden" PreviewMouseDown="settingsImage_PreviewMouseDown" Cursor="Hand" />
275275
</Canvas>
276+
<Canvas HorizontalAlignment="Right" VerticalAlignment="Top" Height="40" Width="40" Margin="0,45,110,0">
277+
<Image x:Name="folderImage" Source="{StaticResource folderDrawingImage}" Height="40" Width="40" Visibility="Hidden" PreviewMouseDown="folderImage_PreviewMouseDown" Cursor="Hand" />
278+
</Canvas>
276279

277280
<Label x:Name="displayingTitle" VerticalContentAlignment="Top" HorizontalAlignment="Left" Content="" FontSize="40" Margin="135,21,0,7" FontWeight="Medium" Visibility="Visible" />
278281
<Border x:Name="changeTitleBorder" BorderBrush="#FF919191" BorderThickness="2" HorizontalAlignment="Left" Height="64" Margin="135,21,0,0" VerticalAlignment="Top" Width="500" Visibility="Hidden">
@@ -314,6 +317,17 @@
314317
<Label x:Name="nextVersionUpdateThreeLabel" Visibility="Hidden" Content="3. " HorizontalAlignment="Left" Margin="20,594,0,0" VerticalAlignment="Top" FontSize="24" />
315318
</Grid>
316319

320+
<!-- The statistics menu -->
321+
<Grid x:Name="statisticsGrid" Margin="350,100,0,0" Visibility="Hidden">
322+
<Label x:Name="creationDateLabel" Content="Date created: 6/9/2020" HorizontalAlignment="Left" Margin="20,20,0,0" VerticalAlignment="Top" FontSize="28"/>
323+
<Label x:Name="tasksMadeLabel" Content="Tasks created: 0" HorizontalAlignment="Left" Margin="20,90,0,0" VerticalAlignment="Top" FontSize="24"/>
324+
<Label x:Name="tasksCompletedLabel" Content="Tasks completed: 0" HorizontalAlignment="Left" Margin="20,125,0,0" VerticalAlignment="Top" FontSize="24"/>
325+
<Label x:Name="statisticsDurationLabel" Content="Duration: coming soon..." HorizontalAlignment="Left" Margin="20,195,0,0" VerticalAlignment="Top" FontSize="24"/>
326+
<Label x:Name="linesOfCodeLabel" Content="Lines of code: 0" HorizontalAlignment="Left" Margin="20,265,0,0" VerticalAlignment="Top" FontSize="24"/>
327+
<Button x:Name="setCodeCountingButton" Content="Set up code counting" HorizontalAlignment="Left" Margin="20,312,0,0" VerticalAlignment="Top" Width="202" Height="52" FontSize="18" Cursor="Hand" PreviewMouseDown="setCodeCountingButton_PreviewMouseDown"/>
328+
329+
</Grid>
330+
317331
<!-- Incomplete vs complete grid -->
318332
<Grid x:Name="completeGrid" Margin="391,136,0,0" Visibility="Hidden">
319333
<Grid.ColumnDefinitions>
@@ -481,9 +495,9 @@
481495
</Border.Effect>
482496
<Grid>
483497
<Grid.RowDefinitions>
484-
<RowDefinition Height="70" />
485-
<RowDefinition Height="70" PreviewMouseDown="RenameProjectButtonPressed" />
486-
<RowDefinition Height="70" PreviewMouseDown="DeleteProjectButtonPressed" />
498+
<RowDefinition Height="70"/>
499+
<RowDefinition Height="70"/>
500+
<RowDefinition Height="70"/>
487501
</Grid.RowDefinitions>
488502
<Grid.ColumnDefinitions>
489503
<ColumnDefinition Width="50" />

0 commit comments

Comments
 (0)