• R/O
  • SSH
  • HTTPS

mantisbtmonitor: Commit


Commit MetaInfo

Revision33 (tree)
Time2017-09-29 06:22:45
Authorderekwildstar

Log Message

- Ajustes no sistema de navegação de notas

Change Summary

Incremental Difference

--- trunk/client/prj/MantisNotification.bdsproj (revision 32)
+++ trunk/client/prj/MantisNotification.bdsproj (revision 33)
@@ -150,7 +150,7 @@
150150 <VersionInfo Name="MajorVer">1</VersionInfo>
151151 <VersionInfo Name="MinorVer">2</VersionInfo>
152152 <VersionInfo Name="Release">3</VersionInfo>
153- <VersionInfo Name="Build">798</VersionInfo>
153+ <VersionInfo Name="Build">833</VersionInfo>
154154 <VersionInfo Name="Debug">False</VersionInfo>
155155 <VersionInfo Name="PreRelease">False</VersionInfo>
156156 <VersionInfo Name="Special">False</VersionInfo>
@@ -162,7 +162,7 @@
162162 <VersionInfoKeys>
163163 <VersionInfoKeys Name="CompanyName"></VersionInfoKeys>
164164 <VersionInfoKeys Name="FileDescription"></VersionInfoKeys>
165- <VersionInfoKeys Name="FileVersion">1.2.3.798</VersionInfoKeys>
165+ <VersionInfoKeys Name="FileVersion">1.2.3.833</VersionInfoKeys>
166166 <VersionInfoKeys Name="InternalName"></VersionInfoKeys>
167167 <VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
168168 <VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
--- trunk/client/src/lib/UFunctions.pas (revision 32)
+++ trunk/client/src/lib/UFunctions.pas (revision 33)
@@ -3,7 +3,7 @@
33 interface
44
55 uses
6- SHDocVw;
6+ SHDocVw, DBClient;
77
88 type
99 TIssueInfo = record
@@ -24,6 +24,7 @@
2424 procedure DownloadAttachment(AAttachmentId: Cardinal; AFileName: String; AOpen: Boolean = True);
2525 function UploadAttachment(AIssueNumber: Cardinal; AFileName: String): Cardinal;
2626 procedure LoadWebBrowserHTML(AWebBrowser: TWebBrowser; AText: String; ADecode: Boolean = False);
27+procedure GenerateSimpleComments(AWebBrowser: TWebBrowser; AClientDataSet: TClientDataSet);
2728
2829 implementation
2930
@@ -142,7 +143,7 @@
142143 + '</html>';
143144 begin
144145 if ADeCode then
145- ABody := StringReplace(DecodeString(ABody),#13#10,'<br>',[rfReplaceAll])
146+ ABody := StringReplace(UTF8Decode(DecodeString(ABody)),#13#10,'<br>',[rfReplaceAll])
146147 else
147148 ABody := StringReplace(ABody,#13#10,'<br>',[rfReplaceAll]);
148149 Result := Format(HTML,[ABody]);
@@ -165,4 +166,38 @@
165166 end;
166167 end;
167168
169+procedure GenerateSimpleComments(AWebBrowser: TWebBrowser; AClientDataSet: TClientDataSet);
170+const
171+ COMMENT = '<div style="background-color: %s; font-weight: bold; color: #FFFFFF; padding: 5px">(%s) <span style="color: #FFFF00">%s</span> respondeu em <span style="color: #FFFF00">%s</span></div><div>%s</div><br>';
172+var
173+ Comments: String;
174+ Color: String;
175+begin
176+ if AClientDataSet.RecordCount > 0 then
177+ begin
178+ AClientDataSet.First;
179+ try
180+ Comments := '';
181+ while not AClientDataSet.Eof do
182+ begin
183+ if AClientDataSet.FieldByName('private').AsInteger = 1 then
184+ Color := '#808080'
185+ else
186+ Color := '#008000';
187+
188+ Comments := Comments + Format(COMMENT,[Color
189+ ,FormatFloat('00000000',AClientDataSet.FieldByName('id').Asinteger)
190+ ,AClientDataSet.FieldByName('Reporter').AsString
191+ ,FormatDateTime('dd/mm/yyyy "às" hh:nn:ss',AClientDataSet.FieldByName('Date').AsDateTime)
192+ ,UTF8Decode(DecodeString(AClientDataSet.FieldByName('Note').AsString))]);
193+ AClientDataSet.Next;
194+ end;
195+ LoadWebBrowserHTML(AWebBrowser,Comments);
196+ finally
197+ AClientDataSet.First;
198+ end;
199+ end;
200+end;
201+
202+
168203 end.
--- trunk/client/src/UFormIssue.pas (revision 32)
+++ trunk/client/src/UFormIssue.pas (revision 33)
@@ -76,13 +76,13 @@
7676 ACTNNoteReply: TAction;
7777 ACTNNoteFullScreen: TAction;
7878 PACONotes: TPageControl;
79- TASHNoteIndividual: TTabSheet;
80- TASHNoteContinuous: TTabSheet;
79+ TASHNoteAdvanced: TTabSheet;
80+ TASHNoteSimple: TTabSheet;
8181 PANE: TPanel;
8282 Label1: TLabel;
8383 LABENoteDate: TLabel;
84- PNSBNextNote: TPngSpeedButton;
85- PNSBPreviousNote: TPngSpeedButton;
84+ PNSBNotePrevious: TPngSpeedButton;
85+ PNSBNoteNext: TPngSpeedButton;
8686 LABENoteAuthor: TLabel;
8787 WEBRNote: TWebBrowser;
8888 LABENoteNumber: TLabel;
@@ -90,14 +90,18 @@
9090 PANEButtons: TPanel;
9191 PNBBNoteReply: TPngBitBtn;
9292 PNBBNoteFullScreen: TPngBitBtn;
93- WEBRNotesContinuous: TWebBrowser;
93+ WEBRNotesSimple: TWebBrowser;
9494 PANE1: TPanel;
9595 PNSBNoteNew: TPngSpeedButton;
9696 ACTNNoteNew: TAction;
97- procedure TASHNoteContinuousShow(Sender: TObject);
97+ LABENoteCount: TLabel;
98+ PNSBNoteLast: TPngSpeedButton;
99+ PNSBNoteFirst: TPngSpeedButton;
100+ procedure PNSBNoteFirstClick(Sender: TObject);
101+ procedure PNSBNoteLastClick(Sender: TObject);
98102 procedure CLDSCommentsAfterScroll(DataSet: TDataSet);
99- procedure PNSBNextNoteClick(Sender: TObject);
100- procedure PNSBPreviousNoteClick(Sender: TObject);
103+ procedure PNSBNotePreviousClick(Sender: TObject);
104+ procedure PNSBNoteNextClick(Sender: TObject);
101105 procedure FormShow(Sender: TObject);
102106 procedure ACTNNoteFullScreenExecute(Sender: TObject);
103107 procedure ACTNNoteReplyExecute(Sender: TObject);
@@ -119,7 +123,6 @@
119123 FAttachmentsLoaded: Boolean;
120124 FRelationshipsLoaded: Boolean;
121125 FCommentsLoaded: Boolean;
122- FContinuousCommentsLoaded: Boolean;
123126 FAdditionalInfoLoaded: Boolean;
124127 FStepsToReproduceLoaded: Boolean;
125128
@@ -130,7 +133,6 @@
130133 procedure LoadAttachments;
131134 procedure LoadRelationships;
132135 procedure LoadComments;
133- procedure LoadContinuousComments;
134136 protected
135137 procedure CreateParams(var Params: TCreateParams); override;
136138 public
@@ -160,6 +162,7 @@
160162 Application.ProcessMessages;
161163 end;
162164
165+
163166 procedure TFormIssue.ACTNNoteFullScreenExecute(Sender: TObject);
164167 begin
165168 inherited;
@@ -177,10 +180,11 @@
177180 inherited;
178181 LABENoteAuthor.Caption := CLDSCommentsReporter.AsString;
179182 LABENoteDate.Caption := FormatDateTime('dd/mm/yyyy "às" hh:nn:ss',CLDSCommentsDate.AsDateTime);
180- LABENoteNumber.Caption := '(' + CLDSCommentsid.AsString + ')';
183+ LABENoteNumber.Caption := '(' + FormatFloat('00000000',CLDSCommentsid.AsInteger) + ')';
181184 LoadWebBrowserHTML(WEBRNote,CLDSCommentsNote.AsString,True);
182185 PNBBNoteReply.Tag := CLDSCommentsId.AsInteger;
183186 PNBBNoteFullScreen.Tag := CLDSCommentsId.AsInteger;
187+ LABENoteCount.Caption := Format('Anotação %u de %u',[Abs(CLDSComments.RecordCount - CLDSComments.RecNo + 1),CLDSComments.RecordCount]);
184188
185189 if CLDSCommentsPrivate.AsInteger = 1 then
186190 PANE.Color := clGray
@@ -187,8 +191,11 @@
187191 else
188192 PANE.Color := clGreen;
189193
190- PNSBNextNote.Enabled := CLDSComments.RecNo > 1;
191- PNSBPreviousNote.Enabled := CLDSComments.RecNo < CLDSComments.RecordCount;
194+ PNSBNoteLast.Enabled := CLDSComments.RecNo > 1;
195+ PNSBNoteNext.Enabled := PNSBNoteLast.Enabled;
196+
197+ PNSBNoteFirst.Enabled := CLDSComments.RecNo < CLDSComments.RecordCount;
198+ PNSBNotePrevious.Enabled := PNSBNoteFirst.Enabled;
192199 end;
193200
194201 procedure TFormIssue.CLDSRelatedIssuesStatusGetText(Sender: TField; var Text: string; DisplayText: Boolean);
@@ -246,15 +253,13 @@
246253 procedure TFormIssue.LoadComments;
247254 begin
248255 if not FCommentsLoaded then
256+ begin
249257 FCommentsLoaded := GetComments(FIssueInfo.Id,Configurations.UserId,CLDSComments);
258+ if FCommentsLoaded then
259+ GenerateSimpleComments(WEBRNotesSimple,CLDSComments);
260+ end;
250261 end;
251262
252-procedure TFormIssue.LoadContinuousComments;
253-begin
254- if not FContinuousCommentsLoaded then
255- FContinuousCommentsLoaded := True;
256-end;
257-
258263 procedure TFormIssue.LoadIssueHeader;
259264 begin
260265 Caption := 'Caso Mantis #' + IntToStr(FIssueInfo.Id);
@@ -323,18 +328,30 @@
323328 Close;
324329 end;
325330
326-procedure TFormIssue.PNSBNextNoteClick(Sender: TObject);
331+procedure TFormIssue.PNSBNotePreviousClick(Sender: TObject);
327332 begin
328333 inherited;
329- CLDSComments.Prior;
334+ CLDSComments.Next;
330335 end;
331336
332-procedure TFormIssue.PNSBPreviousNoteClick(Sender: TObject);
337+procedure TFormIssue.PNSBNoteFirstClick(Sender: TObject);
333338 begin
334339 inherited;
335- CLDSComments.Next;
340+ CLDSComments.Last;
336341 end;
337342
343+procedure TFormIssue.PNSBNoteLastClick(Sender: TObject);
344+begin
345+ inherited;
346+ CLDSComments.First;
347+end;
348+
349+procedure TFormIssue.PNSBNoteNextClick(Sender: TObject);
350+begin
351+ inherited;
352+ CLDSComments.Prior;
353+end;
354+
338355 class function TFormIssue.ShowMe(AIssueNumber: Cardinal; AModal: Boolean = False): TModalResult;
339356 begin
340357 Result := mrNone;
@@ -348,7 +365,6 @@
348365 FAttachmentsLoaded := False;
349366 FRelationshipsLoaded := False;
350367 FCommentsLoaded := False;
351- FContinuousCommentsLoaded := False;
352368 FAdditionalInfoLoaded := False;
353369 FStepsToReproduceLoaded := False;
354370
@@ -378,12 +394,6 @@
378394 LoadComments;
379395 end;
380396
381-procedure TFormIssue.TASHNoteContinuousShow(Sender: TObject);
382-begin
383- inherited;
384- LoadContinuousComments;
385-end;
386-
387397 procedure TFormIssue.TASHStepsToReproduceShow(Sender: TObject);
388398 begin
389399 inherited;
--- trunk/client/src/UFormViewNote.pas (revision 32)
+++ trunk/client/src/UFormViewNote.pas (revision 33)
@@ -13,8 +13,8 @@
1313 LABE2: TLabel;
1414 LABENoteDate: TLabel;
1515 WEBRNote: TWebBrowser;
16- PNSBNextNote: TPngSpeedButton;
17- PNSBPreviousNote: TPngSpeedButton;
16+ PNSBPrevious: TPngSpeedButton;
17+ PNSBNext: TPngSpeedButton;
1818 CLDSComments: TClientDataSet;
1919 CLDSCommentsId: TIntegerField;
2020 CLDSCommentsReporter: TStringField;
@@ -23,15 +23,15 @@
2323 CLDSCommentsNote: TMemoField;
2424 LABENoteAuthor: TLabel;
2525 IMAGOpenWithMantis: TImage;
26+ PNSBFirst: TPngSpeedButton;
2627 PNSBLast: TPngSpeedButton;
27- PNSBFirst: TPngSpeedButton;
28+ procedure PNSBLastClick(Sender: TObject);
2829 procedure PNSBFirstClick(Sender: TObject);
29- procedure PNSBLastClick(Sender: TObject);
3030 procedure IMAGOpenWithMantisClick(Sender: TObject);
3131 procedure FormShow(Sender: TObject);
3232 procedure CLDSCommentsAfterScroll(DataSet: TDataSet);
33- procedure PNSBNextNoteClick(Sender: TObject);
34- procedure PNSBPreviousNoteClick(Sender: TObject);
33+ procedure PNSBPreviousClick(Sender: TObject);
34+ procedure PNSBNextClick(Sender: TObject);
3535 procedure PNBBOKClick(Sender: TObject);
3636 private
3737 { Private declarations }
@@ -57,7 +57,7 @@
5757 inherited;
5858 LABENoteAuthor.Caption := CLDSCommentsReporter.AsString;
5959 LABENoteDate.Caption := FormatDateTime('dd/mm/yyyy "às" hh:nn:ss',CLDSCommentsDate.AsDateTime);
60- LABECaption.Caption := Format(FCaptionTemplate,[CLDSCommentsid.AsInteger,CLDSComments.RecNo,CLDSComments.RecordCount]);
60+ LABECaption.Caption := Format(FCaptionTemplate,[FormatFloat('00000000',CLDSCommentsid.AsInteger),Abs(CLDSComments.RecordCount - CLDSComments.RecNo + 1),CLDSComments.RecordCount]);
6161 LoadWebBrowserHTML(WEBRNote,CLDSCommentsNote.AsString,True);
6262
6363 if CLDSCommentsPrivate.AsInteger = 1 then
@@ -66,10 +66,10 @@
6666 PANE.Color := clGreen;
6767
6868 PNSBLast.Enabled := CLDSComments.RecNo > 1;
69- PNSBNextNote.Enabled := PNSBLast.Enabled;
69+ PNSBNext.Enabled := PNSBLast.Enabled;
7070
7171 PNSBFirst.Enabled := CLDSComments.RecNo < CLDSComments.RecordCount;
72- PNSBPreviousNote.Enabled := PNSBFirst.Enabled;
72+ PNSBPrevious.Enabled := PNSBFirst.Enabled;
7373 end;
7474
7575 procedure TFormViewNote.FormShow(Sender: TObject);
@@ -91,28 +91,28 @@
9191 // Método para responder a anotação visível
9292 end;
9393
94-procedure TFormViewNote.PNSBFirstClick(Sender: TObject);
94+procedure TFormViewNote.PNSBLastClick(Sender: TObject);
9595 begin
9696 inherited;
97- CLDSComments.Last;
97+ CLDSComments.First;
9898 end;
9999
100-procedure TFormViewNote.PNSBLastClick(Sender: TObject);
100+procedure TFormViewNote.PNSBFirstClick(Sender: TObject);
101101 begin
102102 inherited;
103- CLDSComments.First;
103+ CLDSComments.Last;
104104 end;
105105
106-procedure TFormViewNote.PNSBNextNoteClick(Sender: TObject);
106+procedure TFormViewNote.PNSBPreviousClick(Sender: TObject);
107107 begin
108108 inherited;
109- CLDSComments.Prior;
109+ CLDSComments.Next;
110110 end;
111111
112-procedure TFormViewNote.PNSBPreviousNoteClick(Sender: TObject);
112+procedure TFormViewNote.PNSBNextClick(Sender: TObject);
113113 begin
114114 inherited;
115- CLDSComments.Next;
115+ CLDSComments.Prior;
116116 end;
117117
118118 class function TFormViewNote.ShowMeModal(AOwner: TComponent; AIssueNumber: Cardinal; ANoteId: Cardinal): TModalResult;
@@ -119,7 +119,7 @@
119119 begin
120120 with Self.Create(AOwner) do
121121 begin
122- FCaptionTemplate := 'Visualizando anotação #%u (%u/%u)';
122+ FCaptionTemplate := 'Visualizando anotação #%s (%u/%u)';
123123 FIssueNumber := AIssueNumber;
124124 FNoteId := ANoteId;
125125 Result := ShowModal;
Show on old repository browser