Pārlūkot izejas kodu

Better ResponseCode handling
ResponseCode in Statusbar

Simon Grossenbacher 8 gadi atpakaļ
vecāks
revīzija
8e59540d99
5 mainītis faili ar 36 papildinājumiem un 37 dzēšanām
  1. BIN
      RESTDebugger.exe
  2. 17 17
      prj/RESTDebugger.dproj
  3. 6 6
      prj/RESTDebugger.stat
  4. 7 10
      src/_frmMain.dfm
  5. 6 4
      src/_frmMain.pas

BIN
RESTDebugger.exe


+ 17 - 17
prj/RESTDebugger.dproj

@@ -197,12 +197,27 @@
                         <Overwrite>true</Overwrite>
                     </Platform>
                 </DeployFile>
-                <DeployClass Name="ProjectiOSDeviceResourceRules">
+                <DeployClass Name="DependencyModule">
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                        <Extensions>.dll;.bpl</Extensions>
+                    </Platform>
                     <Platform Name="iOSDevice64">
                         <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\MacOS</RemoteDir>
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
                     </Platform>
                     <Platform Name="iOSDevice32">
                         <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
                     </Platform>
                 </DeployClass>
                 <DeployClass Name="ProjectOSXResource">
@@ -581,27 +596,12 @@
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="DependencyModule">
-                    <Platform Name="Win32">
-                        <Operation>0</Operation>
-                        <Extensions>.dll;.bpl</Extensions>
-                    </Platform>
+                <DeployClass Name="ProjectiOSDeviceResourceRules">
                     <Platform Name="iOSDevice64">
                         <Operation>1</Operation>
-                        <Extensions>.dylib</Extensions>
-                    </Platform>
-                    <Platform Name="OSX32">
-                        <RemoteDir>Contents\MacOS</RemoteDir>
-                        <Operation>1</Operation>
-                        <Extensions>.dylib</Extensions>
                     </Platform>
                     <Platform Name="iOSDevice32">
                         <Operation>1</Operation>
-                        <Extensions>.dylib</Extensions>
-                    </Platform>
-                    <Platform Name="iOSSimulator">
-                        <Operation>1</Operation>
-                        <Extensions>.dylib</Extensions>
                     </Platform>
                 </DeployClass>
                 <ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>

+ 6 - 6
prj/RESTDebugger.stat

@@ -1,10 +1,10 @@
 [Stats]
-EditorSecs=10677
-DesignerSecs=2966
-InspectorSecs=1781
-CompileSecs=404903
-OtherSecs=3131
+EditorSecs=10827
+DesignerSecs=2995
+InspectorSecs=1811
+CompileSecs=439325
+OtherSecs=3037
 StartTime=27.10.2016 18:27:37
 RealKeys=0
 EffectiveKeys=0
-DebugSecs=8114
+DebugSecs=9671

+ 7 - 10
src/_frmMain.dfm

@@ -32,7 +32,6 @@ object frmMain: TfrmMain
     Color = clWhite
     ParentBackground = False
     TabOrder = 2
-    ExplicitWidth = 731
     object Label1: TLabel
       Left = 25
       Top = 41
@@ -85,7 +84,6 @@ object frmMain: TfrmMain
       Height = 23
       Align = dalTop
       BarManager = dxBarManager
-      ExplicitWidth = 731
     end
   end
   object dxStatusBar: TdxStatusBar
@@ -102,9 +100,14 @@ object frmMain: TfrmMain
       item
         PanelStyleClassName = 'TdxStatusBarTextPanelStyle'
         MinWidth = 100
-        Text = 'Response Time: 10'#39'000 msec'
+        Text = 'Response Time: 10'#39'000 ms'
         Width = 150
       end
+      item
+        PanelStyleClassName = 'TdxStatusBarTextPanelStyle'
+        Text = 'Response Code: 200'
+        Width = 110
+      end
       item
         PanelStyleClassName = 'TdxStatusBarTextPanelStyle'
         Text = 'Default project loaded.'
@@ -114,7 +117,6 @@ object frmMain: TfrmMain
     Font.Height = -11
     Font.Name = 'Tahoma'
     Font.Style = []
-    ExplicitWidth = 731
   end
   object cxPageControl1: TcxPageControl
     Left = 0
@@ -125,7 +127,6 @@ object frmMain: TfrmMain
     TabOrder = 3
     Properties.ActivePage = tabContent
     Properties.CustomButtons.Buttons = <>
-    ExplicitWidth = 731
     ClientRectBottom = 460
     ClientRectLeft = 2
     ClientRectRight = 723
@@ -133,7 +134,6 @@ object frmMain: TfrmMain
     object tabContent: TcxTabSheet
       Caption = 'Response Content'
       ImageIndex = 0
-      ExplicitWidth = 727
       object EditorContent: TBCEditor
         Left = 0
         Top = 0
@@ -227,13 +227,11 @@ object frmMain: TfrmMain
           FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
           FF00}
         WordWrap.Indicator.MaskColor = clFuchsia
-        ExplicitWidth = 727
       end
     end
     object tabHeaders: TcxTabSheet
       Caption = 'Response Headers'
       ImageIndex = 1
-      ExplicitWidth = 727
       object EditorResponseHeaders: TBCEditor
         Left = 0
         Top = 0
@@ -326,7 +324,6 @@ object frmMain: TfrmMain
           FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
           FF00}
         WordWrap.Indicator.MaskColor = clFuchsia
-        ExplicitWidth = 727
       end
     end
   end
@@ -338,7 +335,7 @@ object frmMain: TfrmMain
     Align = alTop
     BevelOuter = bvNone
     TabOrder = 0
-    ExplicitWidth = 731
+    ExplicitTop = 57
     object Label2: TLabel
       Left = 8
       Top = 16

+ 6 - 4
src/_frmMain.pas

@@ -438,7 +438,7 @@ begin
       mtDELETE: dmy := HTTP.Delete(edtFullURL.Text);
     end;
 
-    if HTTP.ResponseCode <> 200 then
+    if HTTP.ResponseCode.ToString[1] <> '2' then
     begin
       ShowError(HTTP.ResponseText);
     end;
@@ -468,7 +468,7 @@ begin
         mtPUT: dmy := HTTP.Put(edtFullURL.Text, strstream);
       end;
 
-      if HTTP.ResponseCode <> 200 then
+      if HTTP.ResponseCode.ToString[1] <> '2' then
       begin
         ShowError(HTTP.ResponseText);
       end;
@@ -696,6 +696,7 @@ begin
   EditorResponseHeaders.Lines.Clear;
 
   dxStatusBar.Panels[1].Text := '';
+  dxStatusBar.Panels[2].Text := '';
 end;
 
 function TfrmMain.GetAppVersion: string;
@@ -770,11 +771,11 @@ procedure TfrmMain.LoadProject;
 begin
   if FIsTempProjectLoaded then
   begin
-    dxStatusBar.Panels[2].Text := 'Default project loaded.';
+    dxStatusBar.Panels[3].Text := 'Default project loaded.';
   end
   else
   begin
-    dxStatusBar.Panels[2].Text := 'Loaded project: ' + FActiveProject;
+    dxStatusBar.Panels[3].Text := 'Loaded project: ' + FActiveProject;
     FMainConfig.WriteString('Project', 'LastUsed', FActiveProject);
   end;
 
@@ -942,6 +943,7 @@ begin
     end;
   finally
     dxStatusBar.Panels[1].Text := FormatFloat('Response Time: 0, ms', GetTickCount - tick);
+    dxStatusBar.Panels[2].Text := 'Response Code: ' + HTTP.ResponseCode.ToString;
     Screen.Cursor := crDefault;
   end;
 end;