• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiona8940cf3b3261e09af70dfac1f4f3d1d4f1de83e (tree)
Zeit2011-07-15 13:58:01
Autorjakago <jakago@4267...>
Commiterjakago

Log Message

add option past enews (not finished)

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/capturestream/trunk@23 4267046d-1765-4020-a4b0-b01f4314ac75

Ändern Zusammenfassung

Diff

--- a/downloadmanager.cpp
+++ b/downloadmanager.cpp
@@ -34,7 +34,7 @@
3434 #define SEARCH_AT_ONCE 100
3535 #define VIDEO_PLAYER_WIDE "video_player_wide.swf"
3636
37-DownloadManager::DownloadManager( bool _reread ) : reread(_reread) {
37+DownloadManager::DownloadManager( bool _reread, bool _past ) : reread(_reread), past(_past) {
3838 connect( &manager, SIGNAL(finished(QNetworkReply*)), SLOT(downloadFinished(QNetworkReply*)) );
3939 }
4040
@@ -57,8 +57,10 @@ void DownloadManager::execute() {
5757
5858 if ( !reread ) {
5959 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+ }
6264 }
6365
6466 for ( QDate i = today; i >= from; i = i.addDays( -1 ) ) {
--- a/downloadmanager.h
+++ b/downloadmanager.h
@@ -34,7 +34,7 @@ class DownloadManager: public QObject {
3434 Q_OBJECT
3535
3636 public:
37- DownloadManager( bool _reread );
37+ DownloadManager( bool _reread, bool _past );
3838 void singleShot();
3939
4040 QStringList flvList;
@@ -45,6 +45,7 @@ private:
4545
4646 QEventLoop eventLoop;
4747 bool reread;
48+ bool past;
4849 mutable QMutex mutex;
4950 QNetworkAccessManager manager;
5051 QList<QNetworkReply *> currentDownloads;
--- a/downloadthread.cpp
+++ b/downloadthread.cpp
@@ -194,7 +194,7 @@ void DownloadThread::downloadCharo() {
194194
195195 void DownloadThread::downloadENews( bool re_read ) {
196196 emit current( QString::fromUtf8( "ニュースで英会話のhtmlを分析中" ) );
197- DownloadManager manager( re_read );
197+ DownloadManager manager( re_read, ui->checkBox_enews_past->isChecked() );
198198 manager.singleShot();
199199 qSort( manager.flvList.begin(), manager.flvList.end(), qGreater<QString>() );
200200
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -7,7 +7,7 @@
77 <x>0</x>
88 <y>0</y>
99 <width>548</width>
10- <height>374</height>
10+ <height>400</height>
1111 </rect>
1212 </property>
1313 <property name="sizePolicy">
@@ -19,13 +19,13 @@
1919 <property name="minimumSize">
2020 <size>
2121 <width>548</width>
22- <height>374</height>
22+ <height>400</height>
2323 </size>
2424 </property>
2525 <property name="maximumSize">
2626 <size>
2727 <width>548</width>
28- <height>374</height>
28+ <height>400</height>
2929 </size>
3030 </property>
3131 <property name="windowTitle">
@@ -44,10 +44,10 @@
4444 <x>9</x>
4545 <y>9</y>
4646 <width>531</width>
47- <height>321</height>
47+ <height>351</height>
4848 </rect>
4949 </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">
5151 <item row="0" column="0">
5252 <widget class="QCheckBox" name="checkBox_0">
5353 <property name="text">
@@ -97,26 +97,6 @@
9797 </property>
9898 </widget>
9999 </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>
120100 <item row="7" column="0">
121101 <widget class="QCheckBox" name="checkBox_13">
122102 <property name="text">
@@ -234,16 +214,6 @@
234214 </item>
235215 </layout>
236216 </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>
247217 <item row="9" column="1">
248218 <layout class="QHBoxLayout" name="horizontalLayout_10">
249219 <item>
@@ -291,13 +261,53 @@
291261 </item>
292262 </layout>
293263 </item>
294- <item row="10" column="1">
264+ <item row="12" column="1">
295265 <widget class="QPushButton" name="downloadButton">
296266 <property name="text">
297267 <string>ダウンロード</string>
298268 </property>
299269 </widget>
300270 </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>
301311 </layout>
302312 </widget>
303313 <widget class="QCheckBox" name="checkBox_this_week">
@@ -401,6 +411,13 @@
401411 <bool>false</bool>
402412 </property>
403413 </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>
404421 </widget>
405422 <widget class="QMenuBar" name="menuBar">
406423 <property name="geometry">
@@ -437,8 +454,6 @@
437454 <tabstop>checkBox_14</tabstop>
438455 <tabstop>comboBox_enews</tabstop>
439456 <tabstop>checkBox_15</tabstop>
440- <tabstop>checkBox_skip</tabstop>
441- <tabstop>checkBox_keep_on_error</tabstop>
442457 <tabstop>downloadButton</tabstop>
443458 <tabstop>checkBox_this_week</tabstop>
444459 <tabstop>checkBox_next_week</tabstop>