Develop and Download Open Source Software

Browse CVS Repository

Diff of /gikonavigoeson/gikonavi/Round.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.18 by h677, Sat Jun 25 11:27:21 2005 UTC revision 1.18.2.1 by h677, Mon Jul 11 14:31:25 2005 UTC
# Line 8  uses Line 8  uses
8    
9  type  type
10          TRoundDialog = class(TForm)          TRoundDialog = class(TForm)
11      RoundPopupMenu: TPopupMenu;          RoundPopupMenu: TPopupMenu;
12      C1: TMenuItem;          C1: TMenuItem;
13      P1: TMenuItem;          P1: TMenuItem;
14                  N1: TMenuItem;                  N1: TMenuItem;
15      D1: TMenuItem;          D1: TMenuItem;
16                  ItemIcon16: TImageList;                  ItemIcon16: TImageList;
17      Panel1: TPanel;          Panel1: TPanel;
18      Label1: TLabel;          Label1: TLabel;
19      Label2: TLabel;          Label2: TLabel;
20      RoundNameComboBox: TComboBox;          RoundNameComboBox: TComboBox;
21      Panel2: TPanel;          Panel2: TPanel;
22      Panel3: TPanel;          Panel3: TPanel;
23      AllSelectButton: TButton;          AllSelectButton: TButton;
24      AllCancelButton: TButton;          AllCancelButton: TButton;
25      RoundDeleteButton: TButton;          RoundDeleteButton: TButton;
26      Panel4: TPanel;          Panel4: TPanel;
27      Button1: TButton;          Button1: TButton;
28      RoundButton: TButton;          RoundButton: TButton;
29      StatusBar1: TStatusBar;          StatusBar1: TStatusBar;
30      RoundListView: TListView;          RoundListView: TListView;
31                  procedure RoundButtonClick(Sender: TObject);                  procedure RoundButtonClick(Sender: TObject);
32                  procedure FormCreate(Sender: TObject);                  procedure FormCreate(Sender: TObject);
33                  procedure RoundListViewChange(Sender: TObject; Item: TListItem;                  procedure RoundListViewChange(Sender: TObject; Item: TListItem;
# Line 45  type Line 45  type
45                  { Public 宣言 }                  { Public 宣言 }
46          end;          end;
47    
 //var  
 //      RoundDialog: TRoundDialog;  
48    
49  implementation  implementation
50    
# Line 65  var Line 63  var
63          RoundItem: TRoundItem;          RoundItem: TRoundItem;
64  begin  begin
65  {$IF Defined(FRCRND) }  {$IF Defined(FRCRND) }
66      Giko.GikoForm.LoginAction.Checked := true; // 動作試験用途          Giko.GikoForm.LoginAction.Checked := true; // 動作試験用途
67  {$IFEND}  {$IFEND}
68    
69    {$IFNDEF LOOSENUP}      //巡回制限を緩めることにしてたら{$ELSE}の方を使う
70            if not Giko.GikoForm.LoginAction.Checked then begin
71                    if GikoSys.Setting.UserID <> '' then begin
72                            msg := 'ログインしないと巡回は出来ません' + #13#10
73                                    + '今ログインしますか';
74                            if MsgBox(Handle, msg, '確認', MB_YESNO or MB_ICONQUESTION or MB_DEFBUTTON2) <> IDYES then begin
75                                    Exit;
76                            end;
77                            Giko.GikoForm.LoginAction.Execute;
78                    end;
79                    if not Giko.GikoForm.LoginAction.Checked then begin
80                            msg := 'ログインしないと巡回は出来ません';
81                            MsgBox(Handle, msg, 'エラー', MB_OK or MB_ICONSTOP);
82                            Exit;
83                    end;
84            end;
85    {$ELSE}
86            //規制を緩めたほうは、スレ一覧のみ巡回可能
87            if not Giko.GikoForm.LoginAction.Checked then begin
88                    if GikoSys.Setting.UserID <> '' then begin
89                            msg := 'ログインしないとスレッドの巡回は出来ません' + #13#10
90                                    + '今ログインしますか';
91                            if MsgBox(Handle, msg, '確認', MB_YESNO or MB_ICONQUESTION or MB_DEFBUTTON2) <> IDYES then begin
92                                    Exit;
93                            end;
94                            Giko.GikoForm.LoginAction.Execute;
95                    end;
96            end;
97            //●なし巡回は15分以上の間隔を必要とする
98            if not Giko.GikoForm.LoginAction.Checked then begin
99                    if CompareTime(GikoForm.LastRoundTime, Now, 30) then begin
100                            msg := '一度巡回すると30分間巡回は出来ません';
101                            MsgBox(Handle, msg, 'エラー', MB_OK or MB_ICONSTOP);
102                            Exit;
103                    end;
104            end;
105    {$ENDIF}
106    
107            //一つも巡回に設定していなかったらエラーにする
108          cnt := GetRoundCount;          cnt := GetRoundCount;
109            if cnt = 0 then begin
110                    msg := '巡回したい項目に1つ以上チェックを入れてください';
111                    MsgBox(Handle, msg, 'エラー', MB_OK or MB_ICONSTOP);
112                    Exit;
113            end;
114    
115    {$IFNDEF LOOSENUP}
116            //●なし巡回は1度に100個までにする
117          if not Giko.GikoForm.LoginAction.Checked then begin          if not Giko.GikoForm.LoginAction.Checked then begin
118                  if CompareTime(GikoForm.LastRoundTime, Now, 30) then begin                  if cnt > 100 then begin
119                          msg := '一度巡回すると15分間巡回は出来ません';                          msg := '100個以上は一度に巡回できません';
120                          MsgBox(Handle, msg, 'エラー', MB_OK or MB_ICONSTOP);                          MsgBox(Handle, msg, 'エラー', MB_OK or MB_ICONSTOP);
121                          Exit;                          Exit;
122                  end;                  end;
                 if cnt > 100 then begin  
                         msg := '100個以上は一度に巡回できません';  
                         MsgBox(Handle, msg, 'エラー', MB_OK or MB_ICONSTOP);  
                         Exit;  
                 end;  
123          end;          end;
124    {$ENDIF}
125    
126            //巡回に登録されている板の数だけまわす
127          for i := 0 to RoundList.Count[grtBoard] - 1 do begin          for i := 0 to RoundList.Count[grtBoard] - 1 do begin
128                  RoundItem := RoundList.Items[i, grtBoard];                  RoundItem := RoundList.Items[i, grtBoard];
129                    //巡回のチェックがついていなければスルー
130                  if not RoundItem.BoolData then Continue;                  if not RoundItem.BoolData then Continue;
131                  if not Giko.GikoForm.LoginAction.Checked then Exit;                  //確実に板のはずだけどチェック
132                  if RoundItem.RoundType = grtBoard then begin                  if RoundItem.RoundType = grtBoard then begin
133                          Board := TBoard( RoundItem.Item );                          Board := TBoard( RoundItem.Item );
134                          //Board := BBSsFindBoardFromURL(RoundItem.URL);                          //Boardのオブジェクトが存在すれば、DLする
135                          if Board <> nil then begin                          if Board <> nil then begin
136                                  if not Board.IsThreadDatRead then                                  if not Board.IsThreadDatRead then
137                                          GikoSys.ReadSubjectFile(Board);                                          GikoSys.ReadSubjectFile(Board);
# Line 98  begin Line 141  begin
141          end;          end;
142          for i := 0 to RoundList.Count[grtItem] - 1 do begin          for i := 0 to RoundList.Count[grtItem] - 1 do begin
143                  RoundItem := RoundList.Items[i, grtItem];                  RoundItem := RoundList.Items[i, grtItem];
144                    //巡回のチェックがついていなければスルー
145                  if not RoundItem.BoolData then Continue;                  if not RoundItem.BoolData then Continue;
146                  if not Giko.GikoForm.LoginAction.Checked then Exit;  {$IFDEF LOOSENUP}
147          if RoundItem.RoundType = grtItem then begin                  //●なし巡回はスレッドはできないことにする
148                  ThreadItem := TThreadItem( RoundItem.Item );                  if not Giko.GikoForm.LoginAction.Checked then begin
149                  //ThreadItem := BBSsFindThreadFromURL(RoundItem.URL);                          msg := 'ログインしないとスレッドの巡回はできません。';
150                            MsgBox(Handle, msg, 'エラー', MB_OK or MB_ICONSTOP);
151                            break;
152                    end;
153    {$ENDIF}
154                    if RoundItem.RoundType = grtItem then begin
155                            ThreadItem := TThreadItem( RoundItem.Item );
156                          if ThreadItem <> nil then begin                          if ThreadItem <> nil then begin
 //                              GikoForm.AddMessageList('debug2:' + IntToStr(i), nil);  
157                                  GikoForm.DownloadContent(ThreadItem);                                  GikoForm.DownloadContent(ThreadItem);
158                          end;                          end;
159                  end;                  end;

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.18.2.1

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26