Revision | a8940cf3b3261e09af70dfac1f4f3d1d4f1de83e (tree) |
---|---|
Zeit | 2011-07-15 13:58:01 |
Autor | jakago <jakago@4267...> |
Commiter | jakago |
add option past enews (not finished)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/capturestream/trunk@23 4267046d-1765-4020-a4b0-b01f4314ac75
@@ -34,7 +34,7 @@ | ||
34 | 34 | #define SEARCH_AT_ONCE 100 |
35 | 35 | #define VIDEO_PLAYER_WIDE "video_player_wide.swf" |
36 | 36 | |
37 | -DownloadManager::DownloadManager( bool _reread ) : reread(_reread) { | |
37 | +DownloadManager::DownloadManager( bool _reread, bool _past ) : reread(_reread), past(_past) { | |
38 | 38 | connect( &manager, SIGNAL(finished(QNetworkReply*)), SLOT(downloadFinished(QNetworkReply*)) ); |
39 | 39 | } |
40 | 40 |
@@ -57,8 +57,10 @@ void DownloadManager::execute() { | ||
57 | 57 | |
58 | 58 | if ( !reread ) { |
59 | 59 | from = today.addDays( -7 ); |
60 | - doDownload( QUrl(SEARCH_20100323 ) ); | |
61 | - doDownload( QUrl(SEARCH_20090330 ) ); | |
60 | + if ( past ) { | |
61 | + doDownload( QUrl(SEARCH_20100323 ) ); | |
62 | + doDownload( QUrl(SEARCH_20090330 ) ); | |
63 | + } | |
62 | 64 | } |
63 | 65 | |
64 | 66 | for ( QDate i = today; i >= from; i = i.addDays( -1 ) ) { |
@@ -34,7 +34,7 @@ class DownloadManager: public QObject { | ||
34 | 34 | Q_OBJECT |
35 | 35 | |
36 | 36 | public: |
37 | - DownloadManager( bool _reread ); | |
37 | + DownloadManager( bool _reread, bool _past ); | |
38 | 38 | void singleShot(); |
39 | 39 | |
40 | 40 | QStringList flvList; |
@@ -45,6 +45,7 @@ private: | ||
45 | 45 | |
46 | 46 | QEventLoop eventLoop; |
47 | 47 | bool reread; |
48 | + bool past; | |
48 | 49 | mutable QMutex mutex; |
49 | 50 | QNetworkAccessManager manager; |
50 | 51 | QList<QNetworkReply *> currentDownloads; |
@@ -194,7 +194,7 @@ void DownloadThread::downloadCharo() { | ||
194 | 194 | |
195 | 195 | void DownloadThread::downloadENews( bool re_read ) { |
196 | 196 | emit current( QString::fromUtf8( "ニュースで英会話のhtmlを分析中" ) ); |
197 | - DownloadManager manager( re_read ); | |
197 | + DownloadManager manager( re_read, ui->checkBox_enews_past->isChecked() ); | |
198 | 198 | manager.singleShot(); |
199 | 199 | qSort( manager.flvList.begin(), manager.flvList.end(), qGreater<QString>() ); |
200 | 200 |
@@ -7,7 +7,7 @@ | ||
7 | 7 | <x>0</x> |
8 | 8 | <y>0</y> |
9 | 9 | <width>548</width> |
10 | - <height>374</height> | |
10 | + <height>400</height> | |
11 | 11 | </rect> |
12 | 12 | </property> |
13 | 13 | <property name="sizePolicy"> |
@@ -19,13 +19,13 @@ | ||
19 | 19 | <property name="minimumSize"> |
20 | 20 | <size> |
21 | 21 | <width>548</width> |
22 | - <height>374</height> | |
22 | + <height>400</height> | |
23 | 23 | </size> |
24 | 24 | </property> |
25 | 25 | <property name="maximumSize"> |
26 | 26 | <size> |
27 | 27 | <width>548</width> |
28 | - <height>374</height> | |
28 | + <height>400</height> | |
29 | 29 | </size> |
30 | 30 | </property> |
31 | 31 | <property name="windowTitle"> |
@@ -44,10 +44,10 @@ | ||
44 | 44 | <x>9</x> |
45 | 45 | <y>9</y> |
46 | 46 | <width>531</width> |
47 | - <height>321</height> | |
47 | + <height>351</height> | |
48 | 48 | </rect> |
49 | 49 | </property> |
50 | - <layout class="QGridLayout" name="gridLayout_3" rowstretch="0,0,0,0,0,0,0,0,0,0,0"> | |
50 | + <layout class="QGridLayout" name="gridLayout_3" rowstretch="0,0,0,0,0,0,0,0,0,0,0,0,0"> | |
51 | 51 | <item row="0" column="0"> |
52 | 52 | <widget class="QCheckBox" name="checkBox_0"> |
53 | 53 | <property name="text"> |
@@ -97,26 +97,6 @@ | ||
97 | 97 | </property> |
98 | 98 | </widget> |
99 | 99 | </item> |
100 | - <item row="8" column="0"> | |
101 | - <widget class="Line" name="line_2"> | |
102 | - <property name="lineWidth"> | |
103 | - <number>2</number> | |
104 | - </property> | |
105 | - <property name="orientation"> | |
106 | - <enum>Qt::Horizontal</enum> | |
107 | - </property> | |
108 | - </widget> | |
109 | - </item> | |
110 | - <item row="9" column="0"> | |
111 | - <widget class="QCheckBox" name="checkBox_skip"> | |
112 | - <property name="text"> | |
113 | - <string>既存のファイルはスキップ</string> | |
114 | - </property> | |
115 | - <property name="checked"> | |
116 | - <bool>true</bool> | |
117 | - </property> | |
118 | - </widget> | |
119 | - </item> | |
120 | 100 | <item row="7" column="0"> |
121 | 101 | <widget class="QCheckBox" name="checkBox_13"> |
122 | 102 | <property name="text"> |
@@ -234,16 +214,6 @@ | ||
234 | 214 | </item> |
235 | 215 | </layout> |
236 | 216 | </item> |
237 | - <item row="10" column="0"> | |
238 | - <widget class="QCheckBox" name="checkBox_keep_on_error"> | |
239 | - <property name="text"> | |
240 | - <string>ダウンロード未完でも変換</string> | |
241 | - </property> | |
242 | - <property name="checked"> | |
243 | - <bool>false</bool> | |
244 | - </property> | |
245 | - </widget> | |
246 | - </item> | |
247 | 217 | <item row="9" column="1"> |
248 | 218 | <layout class="QHBoxLayout" name="horizontalLayout_10"> |
249 | 219 | <item> |
@@ -291,13 +261,53 @@ | ||
291 | 261 | </item> |
292 | 262 | </layout> |
293 | 263 | </item> |
294 | - <item row="10" column="1"> | |
264 | + <item row="12" column="1"> | |
295 | 265 | <widget class="QPushButton" name="downloadButton"> |
296 | 266 | <property name="text"> |
297 | 267 | <string>ダウンロード</string> |
298 | 268 | </property> |
299 | 269 | </widget> |
300 | 270 | </item> |
271 | + <item row="10" column="1"> | |
272 | + <widget class="QCheckBox" name="checkBox_enews_past"> | |
273 | + <property name="text"> | |
274 | + <string>「ニュースで英会話」過去分</string> | |
275 | + </property> | |
276 | + <property name="checked"> | |
277 | + <bool>false</bool> | |
278 | + </property> | |
279 | + </widget> | |
280 | + </item> | |
281 | + <item row="12" column="0"> | |
282 | + <widget class="QCheckBox" name="checkBox_keep_on_error"> | |
283 | + <property name="text"> | |
284 | + <string>ダウンロード未完でも変換</string> | |
285 | + </property> | |
286 | + <property name="checked"> | |
287 | + <bool>false</bool> | |
288 | + </property> | |
289 | + </widget> | |
290 | + </item> | |
291 | + <item row="10" column="0"> | |
292 | + <widget class="QCheckBox" name="checkBox_skip"> | |
293 | + <property name="text"> | |
294 | + <string>既存のファイルはスキップ</string> | |
295 | + </property> | |
296 | + <property name="checked"> | |
297 | + <bool>true</bool> | |
298 | + </property> | |
299 | + </widget> | |
300 | + </item> | |
301 | + <item row="9" column="0"> | |
302 | + <widget class="Line" name="line_2"> | |
303 | + <property name="lineWidth"> | |
304 | + <number>2</number> | |
305 | + </property> | |
306 | + <property name="orientation"> | |
307 | + <enum>Qt::Horizontal</enum> | |
308 | + </property> | |
309 | + </widget> | |
310 | + </item> | |
301 | 311 | </layout> |
302 | 312 | </widget> |
303 | 313 | <widget class="QCheckBox" name="checkBox_this_week"> |
@@ -401,6 +411,13 @@ | ||
401 | 411 | <bool>false</bool> |
402 | 412 | </property> |
403 | 413 | </widget> |
414 | + <zorder>gridLayoutWidget_3</zorder> | |
415 | + <zorder>checkBox_this_week</zorder> | |
416 | + <zorder>checkBox_next_week</zorder> | |
417 | + <zorder>label_2</zorder> | |
418 | + <zorder>past_days</zorder> | |
419 | + <zorder>checkBox_past_week</zorder> | |
420 | + <zorder>downloadButton</zorder> | |
404 | 421 | </widget> |
405 | 422 | <widget class="QMenuBar" name="menuBar"> |
406 | 423 | <property name="geometry"> |
@@ -437,8 +454,6 @@ | ||
437 | 454 | <tabstop>checkBox_14</tabstop> |
438 | 455 | <tabstop>comboBox_enews</tabstop> |
439 | 456 | <tabstop>checkBox_15</tabstop> |
440 | - <tabstop>checkBox_skip</tabstop> | |
441 | - <tabstop>checkBox_keep_on_error</tabstop> | |
442 | 457 | <tabstop>downloadButton</tabstop> |
443 | 458 | <tabstop>checkBox_this_week</tabstop> |
444 | 459 | <tabstop>checkBox_next_week</tabstop> |