Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Made it compile in Delphi 2010 again. Don't pop up a balloon every minute when refreshing fails (e.g. if the network is down); only do that once every 15 minutes. Try saving the position and current edge when the window is docked. |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
92eee129fcdd25cb1f1f763f9466b341 |
User & Date: | MCO 2013-05-17 15:35:56.690 |
Context
2013-05-23
| ||
07:29 | Added Application.MainFormOnTaskbar := False, so the main form's window is not visible on the taskbar. check-in: c5cc44ca2e user: MCO tags: trunk | |
2013-05-17
| ||
15:35 | Made it compile in Delphi 2010 again. Don't pop up a balloon every minute when refreshing fails (e.g. if the network is down); only do that once every 15 minutes. Try saving the position and current edge when the window is docked. check-in: 92eee129fc user: MCO tags: trunk | |
2011-12-30
| ||
12:20 | Upgraded to Delphi XE2. When today's start time has not been reached, start drawing at the current time instead of at the start time. check-in: 1ab81676cc user: MCO tags: trunk | |
Changes
Changes to src/F_Main.dfm.
1 2 3 4 5 6 7 | object frmMain: TfrmMain Left = 0 Top = 0 AlphaBlend = True AlphaBlendValue = 204 Caption = 'Work hours' ClientHeight = 356 | | > > < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | object frmMain: TfrmMain Left = 0 Top = 0 AlphaBlend = True AlphaBlendValue = 204 Caption = 'Work hours' ClientHeight = 356 ClientWidth = 158 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] OldCreateOrder = False PopupMenu = pumContext Position = poScreenCenter ShowHint = True OnActivate = FormActivate OnClose = FormClose OnCreate = FormCreate OnDestroy = FormDestroy OnDeactivate = FormDeactivate OnPaint = FormPaint OnResize = FormResize PixelsPerInch = 96 TextHeight = 13 object httpClient: TIdHTTP AllowCookies = True HandleRedirects = True ProxyParams.BasicAuthentication = False ProxyParams.ProxyPort = 0 Request.ContentLength = -1 Request.ContentRangeEnd = -1 Request.ContentRangeStart = -1 Request.ContentRangeInstanceLength = -1 Request.Accept = 'text/xml, text/html, */*' Request.BasicAuthentication = False Request.UserAgent = 'Mozilla/3.0 (compatible; Indy Library)' HTTPOptions = [hoForceEncodeParams] Left = 32 Top = 72 end object tmrFetchTimes: TTimer Enabled = False Interval = 900000 |
︙ | ︙ | |||
115 116 117 118 119 120 121 | OnClick = miCloseClick end end object imlMain: TImageList Left = 32 Top = 232 Bitmap = { | | | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | OnClick = miCloseClick end end object imlMain: TImageList Left = 32 Top = 232 Bitmap = { 494C010102000400180010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 0000000000003600000028000000400000001000000001002000000000000010 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 |
︙ | ︙ |
Changes to src/F_Main.pas.
︙ | ︙ | |||
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | procedure FormResize(Sender: TObject); procedure tmrUpdateProgressTimer(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure FormPaint(Sender: TObject); procedure miRefreshClick(Sender: TObject); procedure miCloseClick(Sender: TObject); procedure mnuOpacityClick(Sender: TObject); private { Private declarations } FSettings: TIniFile; FStartTime: TDateTime; FStopTime: TDateTime; FLunchStart: TDateTime; FLunchStop: TDateTime; FWaypoints: array of TControlPoint; function DateTimeFromXML(ISODateTime: string): TDateTime; procedure FetchHoursOnline(); protected procedure OnAppBarStateChange(Proposed: boolean; Edge: TAppBarEdge); override; public { Public declarations } end; var frmMain: TfrmMain; implementation uses | > > > > > | > > > > > > > > > > > < < < < | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | procedure FormResize(Sender: TObject); procedure tmrUpdateProgressTimer(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure FormPaint(Sender: TObject); procedure miRefreshClick(Sender: TObject); procedure miCloseClick(Sender: TObject); procedure mnuOpacityClick(Sender: TObject); procedure FormActivate(Sender: TObject); procedure FormDeactivate(Sender: TObject); private { Private declarations } FSettings: TIniFile; FStartTime: TDateTime; FStopTime: TDateTime; FLunchStart: TDateTime; FLunchStop: TDateTime; FWaypoints: array of TControlPoint; FErrorFetchesAgo: Integer; function DateTimeFromXML(ISODateTime: string): TDateTime; procedure FetchHoursOnline(); protected procedure CreateParams (var Params: TCreateParams); override; procedure OnAppBarStateChange(Proposed: boolean; Edge: TAppBarEdge); override; public { Public declarations } end; var frmMain: TfrmMain; implementation uses DateUtils, ComObj, ActiveX, Math, IdURI, L_VersionInfoW; {$R *.dfm} var XMLFS: TFormatSettings; { ------------------------------------------------------------------------------------------------ } procedure TfrmMain.CreateParams(var Params: TCreateParams); begin RootKey := HKEY_CURRENT_USER; KeyName := '\Software\Voronwë\TimeRemaining\AppBar'; // LoadSettings; inherited; end; { ------------------------------------------------------------------------------------------------ } procedure TfrmMain.FormCreate(Sender: TObject); var i: integer; Percentage: integer; begin FSettings := TIniFile.Create(ChangeFileExt(ParamStr(0), '.ini')); FErrorFetchesAgo := -1; Application.HintHidePause := FSettings.ReadInteger('General', 'HintTimeout', 5000); SetLength(FWaypoints, 4); FWaypoints[0].RGB.Color := StringToColor(FSettings.ReadString('Gradient', 'StartColor', 'clHighlight')); FWaypoints[0].Position := 0; FWaypoints[0].MapArg := FSettings.ReadInteger('Gradient', 'StartCurve', 4); FWaypoints[1].RGB.Color := StringToColor(FSettings.ReadString('Gradient', 'CloseColor', '$007F00')); FWaypoints[1].Position := 0.5; //(IncHour(FStopTime, -1) - FStartTime) / Duration; |
︙ | ︙ | |||
122 123 124 125 126 127 128 | end; trayIcon.BalloonTitle := Application.Title; trayIcon.Hint := Application.Title; try with TFileVersionInfo.Create(ParamStr(0)) do begin | | > > > > > > > > > > > > > | 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | end; trayIcon.BalloonTitle := Application.Title; trayIcon.Hint := Application.Title; try with TFileVersionInfo.Create(ParamStr(0)) do begin Self.httpClient.Request.UserAgent := Internalname + '/' + FileVersion + ' Indy/' + httpClient.Version; end; except // ignore if this goes wrong end; tmrFetchTimesTimer(tmrFetchTimes); end; { ------------------------------------------------------------------------------------------------ } procedure TfrmMain.FormActivate(Sender: TObject); begin LoadSettings; UpdateBar; end; { ------------------------------------------------------------------------------------------------ } procedure TfrmMain.FormDeactivate(Sender: TObject); begin SaveSettings; end; { ------------------------------------------------------------------------------------------------ } procedure TfrmMain.FormClose(Sender: TObject; var Action: TCloseAction); begin SaveSettings; end; |
︙ | ︙ | |||
396 397 398 399 400 401 402 | end; { ------------------------------------------------------------------------------------------------ } procedure TfrmMain.OnAppBarStateChange(Proposed: boolean; Edge: TAppBarEdge); begin inherited; | | < > > > > > > > | | | | > > > > > > | 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 | end; { ------------------------------------------------------------------------------------------------ } procedure TfrmMain.OnAppBarStateChange(Proposed: boolean; Edge: TAppBarEdge); begin inherited; if Edge <> abeUnknown then SaveSettings; end; { ------------------------------------------------------------------------------------------------ } procedure TfrmMain.tmrFetchTimesTimer(Sender: TObject); begin TTimer(Sender).Enabled := False; try if trayIcon.Visible then trayIcon.Visible := False; try FetchHoursOnline; FErrorFetchesAgo := -1; except on E: Exception do begin tmrFetchTimes.Interval := 60000; // try again in a minute or so if FErrorFetchesAgo = -1 then FErrorFetchesAgo := 0 else Inc(FErrorFetchesAgo); if (FErrorFetchesAgo mod 15) = 0 then begin trayIcon.BalloonHint := E.Message + #13#10'[' + E.ClassName + ']'; trayIcon.Hint := Application.Title + ' - ' + E.Message; trayIcon.Visible := True; trayIcon.ShowBalloonHint; end; try httpClient.Disconnect; except // ignore end; end; end; finally TTimer(Sender).Enabled := True; end; end{TfrmMain.tmrFetchTimesTimer}; |
︙ | ︙ |
Changes to src/lib/AppBar.pas.
︙ | ︙ | |||
17 18 19 20 21 22 23 | interface uses Windows, Messages, SysUtils, Classes, Forms, Dialogs, Controls, ExtCtrls, | | | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | interface uses Windows, Messages, SysUtils, Classes, Forms, Dialogs, Controls, ExtCtrls, ShellApi, Registry; const // AppBar's user notification message WM_APPBARNOTIFY = WM_USER + 100; // Timer interval |
︙ | ︙ | |||
1706 1707 1708 1709 1710 1711 1712 | var reg : TRegistry; begin // Set the default return value Result := False; // Create a TRegistry object reg := TRegistry.Create; | > | | | | | | > | | > | | > | 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 | var reg : TRegistry; begin // Set the default return value Result := False; // Create a TRegistry object reg := TRegistry.Create; try // Set the RootKey reg.RootKey := FabSettingsLocation.nRootKey; // Open the KeyName, creating it if not exists if reg.OpenKey(FabSettingsLocation.KeyName, True) then begin // Save the FABS record in the 'default' value reg.WriteBinaryData('', FABS, sizeof(FABS)); OutputDebugString(PChar(Format('SaveSettings; Edge: %d', [Ord(FABS.abEdge)]))); Result := True; end; finally // Free the TRegistry object reg.Destroy end; end; end. |
Changes to src/prj/d2009/TempusFugit.dpr.
︙ | ︙ | |||
12 13 14 15 16 17 18 19 20 21 | if not CheckPrevious.RestoreIfRunning(Application.Handle) then begin ShowWindow(Application.Handle, SW_HIDE); SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW); Application.Initialize; Application.Title := 'Tempus Fugit'; Application.CreateForm(TfrmMain, frmMain); ShowWindow(Application.Handle, SW_SHOW); Application.Run; end; end. | > | 12 13 14 15 16 17 18 19 20 21 22 | if not CheckPrevious.RestoreIfRunning(Application.Handle) then begin ShowWindow(Application.Handle, SW_HIDE); SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW); Application.Initialize; Application.Title := 'Tempus Fugit'; Application.CreateForm(TfrmMain, frmMain); ShowWindow(Application.Handle, SW_SHOW); frmMain.UpdateBar; Application.Run; end; end. |
Changes to src/prj/d2009/TempusFugit.dproj.
︙ | ︙ | |||
10 11 12 13 14 15 16 | <Platform Condition="'$(Platform)'==''">Win32</Platform> <TargetedPlatforms>1</TargetedPlatforms> <AppType>Application</AppType> </PropertyGroup> <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''"> <Base>true</Base> </PropertyGroup> | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | <Platform Condition="'$(Platform)'==''">Win32</Platform> <TargetedPlatforms>1</TargetedPlatforms> <AppType>Application</AppType> </PropertyGroup> <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''"> <Base>true</Base> </PropertyGroup> <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''"> <Cfg_1>true</Cfg_1> <CfgParent>Base</CfgParent> <Base>true</Base> </PropertyGroup> <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''"> <Cfg_2>true</Cfg_2> <CfgParent>Base</CfgParent> <Base>true</Base> </PropertyGroup> <PropertyGroup Condition="'$(Base)'!=''"> <VerInfo_PreRelease>true</VerInfo_PreRelease> <Manifest_File>None</Manifest_File> <Icon_MainIcon>..\..\..\res\Stopwatch.ico</Icon_MainIcon> <VerInfo_Locale>1043</VerInfo_Locale> <VerInfo_Build>7</VerInfo_Build> <VerInfo_AutoGenVersion>true</VerInfo_AutoGenVersion> <DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)</DCC_Namespace> <VerInfo_Keys>CompanyName=Voronwë;FileDescription=TempusFugit;FileVersion=1.0.0.7;InternalName=TempusFugit;LegalCopyright=© Martijn Coppoolse;LegalTrademarks=;OriginalFilename=TempusFugit.exe;ProductName=Tempus Fugit;ProductVersion=1.0.0.0;Comments=http://martijn.coppoolse.com/software/</VerInfo_Keys> <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo> <DCC_DependencyCheckOutputName>..\..\..\out\TempusFugit.exe</DCC_DependencyCheckOutputName> <DCC_UnitSearchPath>..\..;..\..\Lib;W:\Lib;$(DCC_UnitSearchPath)</DCC_UnitSearchPath> <DCC_UsePackage>vcl;rtl;vclx;dbrtl;vcldb;adortl;xmlrtl;vclactnband;inet;vclie;inetdbbde;inetdbxpress;IndyCore;IndySystem;dclOfficeXP;VclSmp;soaprtl;dsnap;IndyProtocols;bdertl;teeui;teedb;tee;vcldbx;TMSD2006;Scit;DL_Geo_100;DL_Base_100;S303_r100;B305_r100;DL_Control_100;DL_GDI_100;RaizeComponentsVcl;$(DCC_UsePackage)</DCC_UsePackage> <DCC_ImageBase>00400000</DCC_ImageBase> <DCC_RangeChecking>true</DCC_RangeChecking> <DCC_ExeOutput>..\..\..\out\</DCC_ExeOutput> <DCC_Platform>x86</DCC_Platform> <DCC_K>false</DCC_K> <DCC_F>false</DCC_F> |
︙ | ︙ | |||
102 103 104 105 106 107 108 | <VerInfo_Debug>true</VerInfo_Debug> <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define> <DCC_OutputDependencies>true</DCC_OutputDependencies> <DCC_Optimize>false</DCC_Optimize> <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames> <DCC_RunTimeTypeInfo>true</DCC_RunTimeTypeInfo> </PropertyGroup> | < < < < < < < < < < < < < < < < < < | > > > < < < | | | | | | | | < | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | <VerInfo_Debug>true</VerInfo_Debug> <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define> <DCC_OutputDependencies>true</DCC_OutputDependencies> <DCC_Optimize>false</DCC_Optimize> <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames> <DCC_RunTimeTypeInfo>true</DCC_RunTimeTypeInfo> </PropertyGroup> <ItemGroup> <DelphiCompile Include="TempusFugit.dpr"> <MainSource>MainSource</MainSource> </DelphiCompile> <BuildConfiguration Include="Base"> <Key>Base</Key> </BuildConfiguration> <BuildConfiguration Include="Debug"> <Key>Cfg_2</Key> <CfgParent>Base</CfgParent> </BuildConfiguration> <BuildConfiguration Include="Release"> <Key>Cfg_1</Key> <CfgParent>Base</CfgParent> </BuildConfiguration> </ItemGroup> <Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/> <ProjectExtensions> <Borland.Personality>Delphi.Personality.12</Borland.Personality> <Borland.ProjectType/> <BorlandProject> <Delphi.Personality> <Source> <Source Name="MainSource">TempusFugit.dpr</Source> </Source> <Parameters> <Parameters Name="UseLauncher">False</Parameters> <Parameters Name="LoadAllSymbols">True</Parameters> <Parameters Name="LoadUnspecifiedSymbols">False</Parameters> </Parameters> <VersionInfo> <VersionInfo Name="IncludeVerInfo">True</VersionInfo> <VersionInfo Name="AutoIncBuild">False</VersionInfo> <VersionInfo Name="MajorVer">1</VersionInfo> <VersionInfo Name="MinorVer">0</VersionInfo> <VersionInfo Name="Release">1</VersionInfo> <VersionInfo Name="Build">0</VersionInfo> <VersionInfo Name="Debug">False</VersionInfo> <VersionInfo Name="PreRelease">False</VersionInfo> <VersionInfo Name="Special">False</VersionInfo> <VersionInfo Name="Private">False</VersionInfo> <VersionInfo Name="DLL">False</VersionInfo> <VersionInfo Name="Locale">1043</VersionInfo> <VersionInfo Name="CodePage">1252</VersionInfo> </VersionInfo> <VersionInfoKeys> <VersionInfoKeys Name="CompanyName">Voronwë</VersionInfoKeys> <VersionInfoKeys Name="FileDescription">TempusFugit</VersionInfoKeys> <VersionInfoKeys Name="FileVersion">1.0.1.0</VersionInfoKeys> <VersionInfoKeys Name="InternalName">TempusFugit</VersionInfoKeys> <VersionInfoKeys Name="LegalCopyright">© Martijn Coppoolse</VersionInfoKeys> <VersionInfoKeys Name="LegalTrademarks"/> <VersionInfoKeys Name="OriginalFilename">TempusFugit.exe</VersionInfoKeys> <VersionInfoKeys Name="ProductName">Tempus Fugit</VersionInfoKeys> <VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys> <VersionInfoKeys Name="Comments">http://martijn.coppoolse.com/software/</VersionInfoKeys> </VersionInfoKeys> <Excluded_Packages> <Excluded_Packages Name="%BDSBIN%\dcloffice2k160.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages> <Excluded_Packages Name="%BDSBIN%\dclofficexp160.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages> </Excluded_Packages> </Delphi.Personality> <Platforms> <Platform value="Win64">False</Platform> <Platform value="Win32">True</Platform> </Platforms> </BorlandProject> <ProjectFileVersion>12</ProjectFileVersion> </ProjectExtensions> </Project> |
Changes to src/prj/d2009/TempusFugit.res.
cannot compute difference between binary files