From: <jfu...@us...> - 2006-12-19 22:27:17
|
Revision: 11098 http://svn.sourceforge.net/jvcl/?rev=11098&view=rev Author: jfudickar Date: 2006-12-19 14:27:14 -0800 (Tue, 19 Dec 2006) Log Message: ----------- Improved ThreadDialog Output Modified Paths: -------------- trunk/jvcl/run/JvBaseDBThreadedDataset.pas trunk/jvcl/run/JvOdacSmartQuery.pas trunk/jvcl/run/JvThread.pas Modified: trunk/jvcl/run/JvBaseDBThreadedDataset.pas =================================================================== --- trunk/jvcl/run/JvBaseDBThreadedDataset.pas 2006-12-19 21:19:05 UTC (rev 11097) +++ trunk/jvcl/run/JvBaseDBThreadedDataset.pas 2006-12-19 22:27:14 UTC (rev 11098) @@ -201,6 +201,7 @@ procedure SetDynControlEngine(const Value: TJvDynControlEngine); protected procedure FillDialogData; + procedure InitializeFormContents; override; procedure UpdateFormContents; override; public constructor Create(AOwner: TComponent); override; @@ -302,6 +303,7 @@ procedure ExecuteThreadSynchronize(Method: TThreadMethod); procedure HandleAfterOpenRefreshThread; procedure HandleBeforeOpenRefresh; + procedure InitOperation; procedure IntAfterThreadExecution(DataSet: TDataSet; Operation: TJvThreadedDatasetOperation); procedure IntBeforeThreadExecution(DataSet: TDataSet; Operation: TJvThreadedDatasetOperation); procedure IntSynchAfterOpen; @@ -318,7 +320,8 @@ property IThreadedDatasetInterface: IJvThreadedDatasetInterface read FIThreadedDatasetInterface; property ThreadDialog: TJvDatasetThreadDialog read FThreadDialog; public - constructor Create(AOwner: TComponent; ADataset: TDataSet); reintroduce; virtual; + constructor Create(AOwner: TComponent; ADataset: TDataSet); reintroduce; + virtual; destructor Destroy; override; procedure AfterOpen; procedure AfterRefresh; @@ -499,7 +502,8 @@ var ITmpControl: IJvDynControl; begin - if Assigned(ConnectedDatasetHandler) then + if Assigned(ConnectedDatasetHandler) + and (ConnectedDatasetHandler.CurrentOpenDuration > 0) then with ConnectedDatasetHandler do begin if DialogOptions.Caption <> '' then @@ -510,8 +514,8 @@ ITmpControl.ControlSetCaption(IntToStr(CurrentRow)); if Supports(FTimeStaticText, IJvDynControl, ITmpControl) then ITmpControl.ControlSetCaption( - FormatDateTime('hh:nn:ss', CurrentOpenDuration) + ' / ' + - FormatDateTime('hh:nn:ss', CurrentFetchDuration)); + FormatDateTime('hh:nn:ss.zzz', CurrentOpenDuration) + ' / ' + + FormatDateTime('hh:nn:ss.zzz', CurrentFetchDuration)); end else begin @@ -551,6 +555,12 @@ Result := FDialogOptions; end; +procedure TJvDatasetThreadDialogForm.InitializeFormContents; +begin + if Assigned(ConnectedDatasetHandler) then + ConnectedDatasetHandler.InitOperation; +end; + procedure TJvDatasetThreadDialogForm.SetDialogOptions(const Value: TJvThreadedDatasetDialogOptions); begin FDialogOptions := Value; @@ -754,7 +764,8 @@ //=== { TJvBaseDatasetThreadHandler } ======================================== -constructor TJvBaseDatasetThreadHandler.Create(AOwner: TComponent; ADataset: TDataSet); +constructor TJvBaseDatasetThreadHandler.Create(AOwner: TComponent; ADataset: + TDataSet); begin inherited Create (AOwner); FDataset := ADataset; @@ -1104,6 +1115,11 @@ DatasetFetchAllRecords := False; end; +procedure TJvBaseDatasetThreadHandler.InitOperation; +begin + FCurrentOperationStart := 2*Now; +end; + procedure TJvBaseDatasetThreadHandler.IntAfterThreadExecution(DataSet: TDataSet; Operation: TJvThreadedDatasetOperation); begin Modified: trunk/jvcl/run/JvOdacSmartQuery.pas =================================================================== --- trunk/jvcl/run/JvOdacSmartQuery.pas 2006-12-19 21:19:05 UTC (rev 11097) +++ trunk/jvcl/run/JvOdacSmartQuery.pas 2006-12-19 22:27:14 UTC (rev 11098) @@ -131,6 +131,8 @@ implementation +uses Dialogs; + //=== { TJvOdacSmartQuery } ================================================== constructor TJvOdacSmartQuery.Create(AOwner: TComponent); Modified: trunk/jvcl/run/JvThread.pas =================================================================== --- trunk/jvcl/run/JvThread.pas 2006-12-19 21:19:05 UTC (rev 11097) +++ trunk/jvcl/run/JvThread.pas 2006-12-19 22:27:14 UTC (rev 11098) @@ -159,6 +159,7 @@ TJvThread = class(TJvComponent) private FAfterCreateDialogForm: TJvCustomThreadDialogFormEvent; + FBeforeResume: TNotifyEvent; FThreads: TThreadList; FExclusive: Boolean; FRunOnCreate: Boolean; @@ -218,6 +219,7 @@ property ThreadDialog: TJvCustomThreadDialog read FThreadDialog write FThreadDialog; property AfterCreateDialogForm: TJvCustomThreadDialogFormEvent read FAfterCreateDialogForm write FAfterCreateDialogForm; + property BeforeResume: TNotifyEvent read FBeforeResume write FBeforeResume; property OnBegin: TNotifyEvent read FOnBegin write FOnBegin; property OnExecute: TJvNotifyParamsEvent read FOnExecute write FOnExecute; property OnFinish: TNotifyEvent read FOnFinish write FOnFinish; @@ -526,6 +528,8 @@ end; if FRunOnCreate then begin + if Assigned(BeforeResume) then + BeforeResume(Self); BaseThread.Resume; CreateThreadDialogForm; end; @@ -586,6 +590,8 @@ procedure TJvThread.Resume(Thread: THandle); begin + if Assigned(BeforeResume) then + BeforeResume(Self); ResumeThread(Thread); CreateThreadDialogForm; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |