Changeset f5b68a4
- Timestamp:
- 04/15/10 14:06:07 (13 years ago)
- Branches:
- master, qt5
- Children:
- d97bcab
- Parents:
- d06ae27
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/importschedulewidget.cpp
rd06ae27 rf5b68a4 54 54 cancel->hide(); 55 55 connect(online, SIGNAL(clicked()), SLOT(downloadSchedule())); 56 57 connect(changeUrl, SIGNAL(clicked()), SLOT(on_changeUrl())); 58 connect(newConfFromUrl, SIGNAL(clicked()), SLOT(on_newFromUrl())); 59 connect(delConf, SIGNAL(clicked()), SLOT(on_delete())); 56 60 57 61 mNetworkAccessManager = new QNetworkAccessManager(this); … … 119 123 void ImportScheduleWidget::downloadSchedule() 120 124 { 121 QNetworkRequest request;122 125 123 126 // TODO: make a nicer GUI … … 131 134 // 4. allow getting the new conference by URL 132 135 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(); 136 // FIXME: it will throw 137 // GUI should not show this button if there is no active conf 138 importFromNetwork(Conference::getById(Conference::activeConference()).getUrl()); 139 } 140 141 void ImportScheduleWidget::on_changeUrl() 142 { 143 // FIXME: it will throw 144 // GUI should not show this button if there is no active conf 145 Conference active_conference = Conference::getById(Conference::activeConference()); 146 bool ok = false; 147 QString new_url = 148 QInputDialog::getText(this, "URL request", "Enter the new URL for conference schedule" 149 , QLineEdit::Normal 150 , active_conference.getUrl() 151 , &ok); 152 if (ok) { 153 active_conference.setUrl(new_url); 154 } 155 } 156 157 void ImportScheduleWidget::on_newFromUrl() 158 { 159 bool ok = false; 160 QString url = QInputDialog::getText(this, "URL request", "Put the schedule URL", QLineEdit::Normal, "", &ok); 161 if (ok) { 162 importFromNetwork(url); 138 163 } 139 164 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 } 165 } 166 167 void ImportScheduleWidget::on_delete() 168 { 169 // TODO: implement 170 } 171 172 void ImportScheduleWidget::importFromNetwork(const QString& url) 173 { 174 QNetworkRequest request; 145 175 request.setUrl(QUrl(url)); 146 176 -
src/gui/importschedulewidget.h
rd06ae27 rf5b68a4 39 39 void networkQueryFinished(QNetworkReply *aReply); 40 40 void downloadSchedule(); 41 void on_changeUrl(); 42 void on_delete(); 43 void on_newFromUrl(); 41 44 signals: 42 45 void scheduleImported(int confId); 43 46 private: 47 void importFromNetwork(const QString& url); 44 48 void importData(const QByteArray &aData, const QString& url); 45 49 private: -
src/gui/importschedulewidget.ui
rd06ae27 rf5b68a4 7 7 <x>0</x> 8 8 <y>0</y> 9 <width> 699</width>9 <width>710</width> 10 10 <height>79</height> 11 11 </rect> … … 37 37 </item> 38 38 <item> 39 <widget class="QPushButton" name="changeUrl"> 40 <property name="text"> 41 <string>Change Url</string> 42 </property> 43 </widget> 44 </item> 45 <item> 39 46 <widget class="QPushButton" name="online"> 47 <property name="enabled"> 48 <bool>true</bool> 49 </property> 50 <property name="minimumSize"> 51 <size> 52 <width>10</width> 53 <height>0</height> 54 </size> 55 </property> 40 56 <property name="text"> 41 <string>Online</string> 57 <string>Reresh</string> 58 </property> 59 </widget> 60 </item> 61 <item> 62 <widget class="QPushButton" name="newConfFromUrl"> 63 <property name="text"> 64 <string>From Url</string> 42 65 </property> 43 66 </widget> … … 52 75 </property> 53 76 <property name="text"> 54 <string>Browse</string> 77 <string>From File</string> 78 </property> 79 </widget> 80 </item> 81 <item> 82 <widget class="QPushButton" name="delConf"> 83 <property name="text"> 84 <string>Delete</string> 55 85 </property> 56 86 </widget> -
src/mvc/conference.h
rd06ae27 rf5b68a4 60 60 } 61 61 62 #if 0 62 63 void setId(int id) { setValue("id", id); } 63 64 void setTitle(const QString& title) { setValue("title", title); } … … 71 72 void setTimeslotDuration(int timeslotDuration) { setValue("timeslot_duration", timeslotDuration); } 72 73 void setActive(bool active) { setValue("active", (int)((active))); } 73 void setUrl(const QString& url) { setValue("url", url.isNull() ? QVariant() : url); } 74 #endif 75 void setUrl(const QString& url) 76 { 77 setValue("url", url.isNull() ? QVariant() : url); 78 update("url"); 79 } 74 80 }; 75 81
Note: See TracChangeset
for help on using the changeset viewer.