Skip to content

Commit fb9bcc8

Browse files
authored
Merge pull request #59 from CyanCoding/CyanCoding-folder-branch
CyanCoding folder branch
2 parents c270e70 + 2cf9bdc commit fb9bcc8

19 files changed

Lines changed: 28538 additions & 22 deletions

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ With the Project Tracker, easily **create**, **manage**, **track**, and **develo
33
programming projects. At the heart of the Project Tracker is a *simple* to-do list.
44
Create tasks for each project, categorized by three simple criteria (error, feature,
55
or comment). You'll be able to manage all of your development tasks and to-do's better
6-
with Project Tracker's *blazingly* fast features and intuitive design created for developers. Coming soon
7-
are more features designed to help you develop faster and more efficiently like
8-
automatic lines of code counting, offline GitHub project integration, easy access
9-
to your project's folders and files with the click of a button, and more!
6+
with Project Tracker's *blazingly* fast features and intuitive design created for developers.
7+
8+
9+
Some of these features include **automatic code counting** and **folder integration**. Code counting
10+
means you can keep track of the length of your project and how much coding you've done on it.
11+
Folder integration means never again will you have to navigate endlessly through File Explorer
12+
looking for your project! With the click of a button, navigate to your project's folder.
13+
14+
Coming soon are more features designed to help you develop faster and more efficiently like
15+
offline GitHub project integration, project searching, and more!
1016

1117
![Project Tracker](https://i.imgur.com/iWFPgGg.png)

ROADMAP.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ date will be posted allowing you to stay up to date with when new updates will b
3737

3838
### v3.0:
3939
**Estimated release date:** `July 10th, 2020`
40+
- [x] A way to see the release date of the next project and what new features it's bringing.
41+
- [x] Lines of code counting and display.
42+
- [x] Allow linking of a folder to each project to easily see files from Project Tracker.
4043
- [ ] Bring back project duration.
41-
- [ ] Allow linking of a folder to each project to easily see files from Project Tracker.
4244
- [ ] GitHub integration!
43-
- [ ] Lines of code counting and display.
44-
- [ ] A way to see the release date of the next project and what new features it's bringing.
4545
- [ ] Search bar functionality.
4646
- [ ] Themes.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Microsoft.WindowsAPICodePack.Dialogs;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
using System.Windows.Forms;
8+
9+
namespace Project_Tracker {
10+
class Folder {
11+
// WARNING: READONLY VARIABLES. IF YOU CHANGE THESE, CHANGE IN ALL OTHER FILES.
12+
private static readonly string INITIAL_FILE_DIALOG_DIRECTORY = Environment.SpecialFolder.MyDocuments.ToString();
13+
14+
public static string SelectFolder() {
15+
CommonOpenFileDialog folderDialog = new CommonOpenFileDialog();
16+
folderDialog.InitialDirectory = INITIAL_FILE_DIALOG_DIRECTORY;
17+
folderDialog.IsFolderPicker = true;
18+
19+
if (folderDialog.ShowDialog() == CommonFileDialogResult.Ok) {
20+
return folderDialog.FileName;
21+
}
22+
else {
23+
return "";
24+
}
25+
}
26+
}
27+
}

app/Project Tracker/Project Tracker/MainWindow.xaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,10 @@
323323
<Label x:Name="tasksMadeLabel" Content="Tasks created: 0" HorizontalAlignment="Left" Margin="20,90,0,0" VerticalAlignment="Top" FontSize="24"/>
324324
<Label x:Name="tasksCompletedLabel" Content="Tasks completed: 0" HorizontalAlignment="Left" Margin="20,125,0,0" VerticalAlignment="Top" FontSize="24"/>
325325
<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"/>
326+
<Label x:Name="linesOfCodeLabel" Content="Lines of code: 0" HorizontalAlignment="Left" Margin="20,270,0,0" VerticalAlignment="Top" FontSize="24"/>
327327
<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+
<Label x:Name="folderLocationLabel" Content="Folder location: " HorizontalAlignment="Left" Margin="20,0,0,92" VerticalAlignment="Bottom" FontSize="24" Width="780"/>
329+
<Button x:Name="folderLocationResetButton" Content="Set folder location" HorizontalAlignment="Left" Margin="20,0,0,40" VerticalAlignment="Bottom" Width="202" Height="52" FontSize="18" Cursor="Hand" PreviewMouseDown="folderLocationResetButton_PreviewMouseDown"/>
328330

329331
</Grid>
330332

app/Project Tracker/Project Tracker/MainWindow.xaml.cs

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System;
33
using System.Collections.Generic;
44
using System.ComponentModel;
5+
using System.Diagnostics;
56
using System.IO;
67
using System.Net;
78
using System.Text;
@@ -23,7 +24,7 @@ public partial class MainWindow : UWPHost.Window {
2324
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
2425
+ "/Project Tracker";
2526
// IF YOU CHANGE THIS, ALSO CHANGE IT IN UpdateWindow.xaml.cs
26-
private readonly string CURRENT_VERSION = "2.2";
27+
private readonly string CURRENT_VERSION = "2.4";
2728

2829
private readonly string DATA_DIRECTORY =
2930
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
@@ -91,7 +92,7 @@ public partial class MainWindow : UWPHost.Window {
9192
private string icon;
9293

9394

94-
95+
#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
9596
public MainWindow() {
9697
InitializeComponent();
9798
Startup();
@@ -387,14 +388,16 @@ private void CheckmarkPressed(object sender, MouseButtonEventArgs e) {
387388
string name = callingImage.Name;
388389
name = name.Remove(0, 1); // Removes the t from the name (e.g. t5 -> 5)
389390

390-
if (taskData[Int32.Parse(name) - 1] == "1") {
391+
if (taskData[Int32.Parse(name) - 1] == "1") { // It's already checked
391392
taskData[Int32.Parse(name) - 1] = "0";
393+
tasksCompleted--;
392394
}
393-
else {
395+
else { // It's not checked
394396
taskData[Int32.Parse(name) - 1] = "1";
397+
tasksCompleted++;
395398
}
396399

397-
tasksCompleted++;
400+
398401

399402
CalculatePercentage();
400403
}
@@ -1312,7 +1315,17 @@ private void ProjectStatisticsMouseDown(object sender, MouseButtonEventArgs e) {
13121315
tasksMadeLabel.Content = "Tasks created: " + tasksMade;
13131316
tasksCompletedLabel.Content = "Tasks completed: " + tasksCompleted;
13141317
statisticsDurationLabel.Content = "Duration: coming soon...";
1315-
linesOfCodeLabel.Content = "Lines of code: " + Statistics.CountLines(linesOfCodeFiles.ToArray());
1318+
linesOfCodeLabel.Content = "Lines of code: " + String.Format("{0:#,###0}", Statistics.CountLines(linesOfCodeFiles.ToArray()));
1319+
1320+
1321+
if (folderLocation != "" && Directory.Exists(folderLocation)) {
1322+
folderLocationResetButton.Content = "Reset folder location";
1323+
folderLocationLabel.Content = "Folder location: " + folderLocation;
1324+
}
1325+
else {
1326+
folderLocationLabel.Content = "Folder location: not set";
1327+
folderLocationResetButton.Content = "Set folder location";
1328+
}
13161329
}
13171330

13181331
private void RenameProjectButtonPressed(object sender, MouseButtonEventArgs e) {
@@ -1609,6 +1622,7 @@ private void SetSelectedProject() {
16091622
completeGrid.Visibility = Visibility.Visible;
16101623
addItemBorder.Visibility = Visibility.Visible;
16111624
settingsImage.Visibility = Visibility.Visible;
1625+
folderImage.Visibility = Visibility.Visible;
16121626

16131627
string json = File.ReadAllText(filesRead[selectedIndex - 1]);
16141628
MainTableManifest.Rootobject projectInfo =
@@ -2077,7 +2091,10 @@ private void UpdateButtonMouseDown(object sender, MouseButtonEventArgs e) {
20772091
File.Delete(NEXT_VERSION_INFO);
20782092
}
20792093

2094+
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
20802095
DisableUpdateButton();
2096+
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
2097+
20812098
// Download latest version information
20822099
try {
20832100
updateButton1.IsEnabled = false;
@@ -2215,6 +2232,7 @@ private void Window_SizeChanged(object sender, SizeChangedEventArgs e) {
22152232
blackRectangle.Height = this.Height + 5;
22162233
addItemBorder.Width = this.Width - 450;
22172234
changeTitleBorder.Width = this.Width - 700;
2235+
folderLocationLabel.Width = this.Width - 420;
22182236

22192237
scrollviewerGrid.Width = this.Width - 450;
22202238

@@ -2411,7 +2429,14 @@ private void FeatureItemPressed(object sender, MouseButtonEventArgs e) {
24112429
#endregion Item selection presses
24122430

24132431
private void folderImage_PreviewMouseDown(object sender, MouseButtonEventArgs e) {
2432+
if (folderLocation == "" || !Directory.Exists(folderLocation)) {
2433+
folderLocation = Folder.SelectFolder();
24142434

2435+
Save(filesRead[selectedIndex - 1]);
2436+
}
2437+
else {
2438+
Process.Start(folderLocation);
2439+
}
24152440
}
24162441

24172442
private void setCodeCountingButton_PreviewMouseDown(object sender, MouseButtonEventArgs e) {
@@ -2423,7 +2448,18 @@ private void setCodeCountingButton_PreviewMouseDown(object sender, MouseButtonEv
24232448

24242449
Save(filesRead[selectedIndex - 1]);
24252450

2426-
linesOfCodeLabel.Content = "Lines of code: " + Statistics.CountLines(linesOfCodeFiles.ToArray());
2451+
linesOfCodeLabel.Content = "Lines of code: " + String.Format("{0:#,###0}", Statistics.CountLines(linesOfCodeFiles.ToArray()));
2452+
}
2453+
2454+
private void folderLocationResetButton_PreviewMouseDown(object sender, MouseButtonEventArgs e) {
2455+
folderLocation = Folder.SelectFolder();
2456+
Save(filesRead[selectedIndex - 1]);
2457+
2458+
folderLocationLabel.Content = "Folder location: " + folderLocation;
2459+
2460+
if (folderLocation != "" && Directory.Exists(folderLocation)) {
2461+
folderLocationResetButton.Content = "Reset folder location";
2462+
}
24272463
}
24282464
}
24292465
}

app/Project Tracker/Project Tracker/Project Tracker.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@
4242
<Reference Include="Microsoft.Windows.Shell, Version=3.5.41019.1, Culture=neutral, processorArchitecture=MSIL">
4343
<HintPath>..\packages\UWPHost.1.0.0\lib\net40\Microsoft.Windows.Shell.dll</HintPath>
4444
</Reference>
45+
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
46+
<HintPath>..\packages\WindowsAPICodePack-Core.1.1.1\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
47+
</Reference>
48+
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
49+
<HintPath>..\packages\WindowsAPICodePack-Shell.1.1.1\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
50+
</Reference>
4551
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
4652
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
4753
</Reference>
@@ -74,6 +80,7 @@
7480
<SubType>Designer</SubType>
7581
</ApplicationDefinition>
7682
<Compile Include="BackgroundProcesses.cs" />
83+
<Compile Include="Folder.cs" />
7784
<Compile Include="NextVersionManifest.cs" />
7885
<Compile Include="SettingsManifest.cs" />
7986
<Compile Include="Statistics.cs" />

app/Project Tracker/Project Tracker/UpdateWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public partial class UpdateWindow : Window {
1818

1919
private readonly string INSTALLER_PATH = @"C:\Program Files\Project Tracker\Project Tracker Installer.exe";
2020
private readonly string VERSION_FILE = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "/Project Tracker/update.txt";
21-
private readonly string CURRENT_VERSION = "2.2";
21+
private readonly string CURRENT_VERSION = "2.4";
2222
private readonly Color sortColor = Color.FromRgb(228, 233, 235);
2323
private readonly FontFamily textFont = new FontFamily("Microsoft Sans Serif");
2424

app/Project Tracker/Project Tracker/packages.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
<packages>
33
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net472" />
44
<package id="UWPHost" version="1.0.0" targetFramework="net472" />
5+
<package id="WindowsAPICodePack-Core" version="1.1.1" targetFramework="net472" />
6+
<package id="WindowsAPICodePack-Shell" version="1.1.1" targetFramework="net472" />
57
</packages>
390 KB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)