Skip to content

Commit

Permalink
Various changes and fixes
Browse files Browse the repository at this point in the history
Last Change date now works correctly
Some GUI work on #26
Fixed various issues with saving Updates
  • Loading branch information
BlakCake committed Oct 2, 2019
1 parent cbd7c56 commit 90cb0a2
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 22 deletions.
63 changes: 42 additions & 21 deletions ProgressTracker.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Codename=ProgressTracker
CurrentUser=%A_UserName% ;Placeholder for collaboration in the future
Temp_File=0 ; Check to see if the current file is a temp file
SaveLocation=%A_MyDocuments%\ProgressTracker\ProgramData ; Default save location
FormatTime, LocalTime,,ShortDate
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
;#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
Expand Down Expand Up @@ -45,20 +46,21 @@ Gui, Font, s11

Menu, FileMenu, Add, &New Program`tCtrl+N, MenuFileNew
Menu, FileMenu, Add, &Open Program`tCtrl+O, MenuFileOpen
Menu, FileMenu, Add, Save Program As, MenuFileSaveAs
Menu, FileMenu, Add, Save Program &As, MenuFileSaveAs
Menu, FileMenu, Add
Menu, FileMenu, Add, Settings, MenuSettings
Menu, FileMenu, Add, &Settings, MenuSettings
Menu, FileMenu, Add
Menu, FileMenu, Add, E&xit, GuiClose

Menu, NotesMenu, Add, Create a Note, CreateNote
Menu, NotesMenu, Add, View Notes, OpenNoteMenu
Menu, NotesMenu, Add, &Create a Note, CreateNote
Menu, NotesMenu, Add, &View Notes, OpenNoteMenu

Menu, RemindersMenu, Add, Create a Reminder, CreateReminder
Menu, RemindersMenu, Add, View Reminders, OpenReminderMenu
Menu, RemindersMenu, Add, &Create a Reminder, CreateReminder
Menu, RemindersMenu, Add, &View Reminders, OpenReminderMenu

Menu, OtherMenu, Add, Save a Link, SaveLink
Menu, OtherMenu, Add, Attach a File, AttachFile
Menu, OtherMenu, Add, Save a &Link`tCtrl+L, SaveLink
Menu, OtherMenu, Add, Attach a &File`tCtrl+F, AttachFile
Menu, OtherMenu, Add, Open Tags Menu, OpenTags

Menu, HelpMenu, Add, About, MenuAbout

Expand Down Expand Up @@ -204,6 +206,8 @@ SaveLink:
return
AttachFile:
return
OpenTags:
return

MenuAbout:
DisableAllGui()
Expand Down Expand Up @@ -353,6 +357,7 @@ TV_GetText(TVItemName, TVItemID)
TVItemParentID := TV_GetParent(TVItemID)
TV_GetText(TVItemParentName, TVItemParentID)
IniWrite, %ProjectDescriptionText%, %CurrentSaveFile%, %TVItemName%, ProjectDescription
IniWrite, %LocalTime%, %CurrentSaveFile%, %TVItemName%, LastChange
Sleep 100
TV_Modify(TVItemID, Select)
return
Expand All @@ -364,6 +369,7 @@ TV_GetText(TVItemName, TVItemID)
TVItemParentID := TV_GetParent(TVItemID)
TV_GetText(TVItemParentName, TVItemParentID)
IniWrite, %ProgramDescriptionText%, %CurrentSaveFile%, %TVItemName%, ProjectDescription
IniWrite, %LocalTime%, %CurrentSaveFile%, %TVItemName%, LastChange
Sleep 100
TV_Modify(TVItemID, Select)
return
Expand All @@ -375,6 +381,7 @@ TV_GetText(TVItemName, TVItemID)
TVItemParentID := TV_GetParent(TVItemID)
TV_GetText(TVItemParentName, TVItemParentID)
IniWrite, %TaskDescriptionText%, %CurrentSaveFile%, %TVItemParentName%, TaskDescription%TaskNumber%
IniWrite, %LocalTime%, %CurrentSaveFile%, %TVItemParentName%, LastChange
Sleep 100
TV_Modify(TVItemID, Select)
return
Expand Down Expand Up @@ -460,6 +467,7 @@ if A_GuiEvent = Normal
IniRead, SavedProgramName, %CurrentSaveFile%, ProgramInfo, ProgramName
IniRead, UpdateTitle, %A_MyDocuments%\ProgressTracker\ProgramData\%SavedProgramName%\Updates\%TVItemName%\%UpdateFileName%, UpdateInfo, UpdateTitle
IniRead, UpdateDescription, %A_MyDocuments%\ProgressTracker\ProgramData\%SavedProgramName%\Updates\%TVItemName%\%UpdateFileName%, UpdateContent, UpdateDescription
StringReplace, UpdateDescription, UpdateDescription, |, `n, All
;MsgBox, %UpdateFileIni% %UpdateFileName% %UpdateTitle% %UpdateDescription% %SavedProgramName%
if UpdateTitle = ERROR
{
Expand All @@ -475,7 +483,20 @@ if A_GuiEvent = Normal
return

TagsButton:
return
gui, TagSelector:New, ToolWindow, Tag Selector
gui, Add, Text,, Select the tag(s) for this update:
gui, Add, ListView, w150 r10, Tags
gui, Add, Button, w25 gAddTag, +
gui, Add, Button, Default x35 y229 w125 gSaveSelectedTags, OK
gui, Show
Return

AddTag:
Return

SaveSelectedTags:
gui, Submit, NoHide
Return

SaveUpdate:
gui, Submit, NoHide
Expand Down Expand Up @@ -518,29 +539,29 @@ FileCreateDir, %A_MyDocuments%\ProgressTracker\ProgramData\%SavedProgramName%\Up
WriteUpdate(UpdateTitle,UpdateDescription,UpdateTags,FullUpdateFile)
Sleep 250
RefreshUpdateList(TVItemName,SavedProgramName,TVItemParentName,CurrentSaveFile)
IniWrite, %LocalTime%, %CurrentSaveFile%, %TVItemParentName%, LastChange
TV_Modify(TVItemID, Select)
GuiControl,,ProgressBar, %TotalProgress%
return

F1::
Gui, ProgressTracker:Default
Gui, Treeview, MainTreeView
TreeViewItemCount := TV_GetCount()
MsgBox, %TreeViewItemCount%
ToolTip, DevTimeTestingArea
FormatTime, LocalTime,,M/d/yy h:mmtt
Clipboard = %A_Now%`,%LocalTime%
MsgBox, %A_Now%
ToolTip,
return

NotesListBox:
return
ReminderListBox:
return
OtherListBox:
return

ProgressTrackerGuiClose:
MsgBox 52, Warning, All progress that has not been saved will be lost. `nAre you sure?
IfMsgBox No
{
return
}
else
{
ExitApp
}

GuiClose:
MsgBox 52, Warning, All progress that has not been saved will be lost. `nAre you sure?
IfMsgBox No
Expand Down
6 changes: 5 additions & 1 deletion TrackerFunctions.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ WriteNewTask(TaskName,ProjectName,SaveFile)

ChangeName(SelectedItem,ProjectName,SaveFile,ProjectOrTask)
{
FormatTime, LocalTime,,ShortDate
InputBox, NewItemName, Change Name, Choose a new name for this item,,250,125
if ErrorLevel = 1
{
Expand All @@ -301,7 +302,7 @@ ChangeName(SelectedItem,ProjectName,SaveFile,ProjectOrTask)
IniRead, SavedProgramName, %SaveFile%, ProgramInfo, ProgramName
FileMove, %A_MyDocuments%\ProgressTracker\ProgramData\%SavedProgramName%\Updates\%SelectedItem%.ptl, %A_MyDocuments%\ProgressTracker\ProgramData\%SavedProgramName%\Updates\%NewItemName%.ptl, 1
FileMoveDir, %A_MyDocuments%\ProgressTracker\ProgramData\%SavedProgramName%\Updates\%SelectedItem%, %A_MyDocuments%\ProgressTracker\ProgramData\%SavedProgramName%\Updates\%NewItemName%, R

IniWrite, %LocalTime%, %SaveFile%, %ProjectName%, LastChange
}
if ProjectOrTask = 0
{
Expand All @@ -313,13 +314,15 @@ ChangeName(SelectedItem,ProjectName,SaveFile,ProjectOrTask)
FileDelete, %SaveFile%
FileAppend, %SaveFileString%, %SaveFile%
IniWrite, %NewItemName%, %SaveFile%, %NewItemName%, ProjectTitle
IniWrite, %LocalTime%, %SaveFile%, %NewItemName%, LastChange
}
if ProjectOrTask = 2
{
IniWrite, %NewItemName%, %SaveFile%, ProgramInfo , ProgramName
FileRead, SaveFileString, %SaveFile%
StringReplace, SaveFileString, SaveFileString, %SelectedItem%, %NewItemName%
IniWrite, %NewItemName%, %SaveFile%, %NewItemName%, ProjectTitle
IniWrite, %LocalTime%, %SaveFile%, %NewItemName%, LastChange
}
}

Expand All @@ -330,6 +333,7 @@ WriteUpdate(Title,Description,Tags,SaveFile)
IniWrite, %A_Now%, %SaveFile%, UpdateInfo, UpdateTime
IniWrite, A_User, %SaveFile%, UpdateInfo, UpdateUser
IniWrite, %Tags%, %SaveFile%, UpdateInfo, UpdateTags
StringReplace, Description, Description, `n, |, All
IniWrite, %Description%, %SaveFile%, UpdateContent, UpdateDescription
}

Expand Down

0 comments on commit 90cb0a2

Please sign in to comment.