- Timestamp:
- 04/15/10 14:01:48 (13 years ago)
- Branches:
- master, qt5
- Children:
- f5b68a4
- Parents:
- be9b645
- Location:
- src/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/importschedulewidget.cpp
rbe9b645 rd06ae27 30 30 #include <appsettings.h> 31 31 32 const QString SCHEDULE_URL = "http://fosdem.org/2010/schedule/xml"; 32 // TODO: this is temporary 33 #include <QInputDialog> 34 35 #include "conference.h" 36 37 // const QString SCHEDULE_URL = "http://fosdem.org/2010/schedule/xml"; 33 38 34 39 const QString PROXY_USERNAME; … … 91 96 } 92 97 93 importData(file.readAll() );98 importData(file.readAll(), QString()); 94 99 95 100 } … … 108 113 else 109 114 { 110 importData(aReply->readAll() );115 importData(aReply->readAll(), aReply->url().toEncoded()); 111 116 } 112 117 } … … 115 120 { 116 121 QNetworkRequest request; 117 request.setUrl(QUrl(SCHEDULE_URL)); 122 123 // TODO: make a nicer GUI 124 // basically, you have to do the following things: 125 // 1. store schedule URL for each conteferce 126 // 2. allow refreshing of the current conference schedule with "1 button click" 127 // 3. allow changing of the URL for a conference; 128 // run refresh together with it is ok and even justified by usability, 129 // but it must not loose this change if refresh not available. 130 // So it cannot be done as "do like #4 and rely on REPLACE". 131 // 4. allow getting the new conference by URL 132 133 QString url_default; 134 try { 135 url_default = Conference::getById(Conference::activeConference()).getUrl(); 136 } catch (OrmException& e) { 137 qWarning() << "failed to get default URL:" << e.text(); 138 } 139 140 bool ok = false; 141 QString url = QInputDialog::getText(this, "URL request", "Put proper schedule URL or let it try with it", QLineEdit::Normal, url_default, &ok); 142 if (!ok) { // cancel pressed 143 return; 144 } 145 request.setUrl(QUrl(url)); 118 146 119 147 mNetworkAccessManager->setProxy(QNetworkProxy::applicationProxy()); … … 121 149 } 122 150 123 void ImportScheduleWidget::importData(const QByteArray &aData )151 void ImportScheduleWidget::importData(const QByteArray &aData, const QString& url) 124 152 { 125 153 browse->hide(); … … 128 156 // proxySettings->hide(); 129 157 130 int confId = mXmlParser->parseData(aData );158 int confId = mXmlParser->parseData(aData, url); 131 159 132 160 progressBar->hide(); -
src/gui/importschedulewidget.h
rbe9b645 rd06ae27 42 42 void scheduleImported(int confId); 43 43 private: 44 void importData(const QByteArray &aData );44 void importData(const QByteArray &aData, const QString& url); 45 45 private: 46 46 ScheduleXmlParser *mXmlParser;
Note: See TracChangeset
for help on using the changeset viewer.