Changeset f299a08 in confclerk_git for src/gui/mainwindow.cpp
- Timestamp:
- 04/22/10 17:34:03 (13 years ago)
- Branches:
- master, qt5
- Children:
- 66428e7
- Parents:
- c8c414f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/mainwindow.cpp
rc8c414f rf299a08 82 82 QNetworkProxy::setApplicationProxy(proxy); 83 83 84 #if 085 // list of conferences must be maintained by ConferenceEditor86 // here must be one of the signals from the closing ConferenceEditor (or model):87 // selectedConf(conference), noConf()88 connect(importScheduleWidget, SIGNAL(scheduleImported(int)), SLOT(scheduleImported(int)));89 connect(importScheduleWidget, SIGNAL(scheduleDeleted(const QString&)), SLOT(scheduleDeleted(const QString&)));90 #endif91 92 84 // event details have changed 93 85 connect(dayTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool))); … … 98 90 connect(searchTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool))); 99 91 100 // event conference map button clicked101 #if 0102 // TODO: think about it when return to maps103 connect(showMapButton, SIGNAL(clicked()), SLOT(conferenceMapClicked()));104 #endif105 106 92 connect(aboutAction, SIGNAL(triggered()), SLOT(aboutApp())); 107 93 connect(settingsAction, SIGNAL(triggered()), SLOT(setup())); … … 116 102 } 117 103 104 // TODO: open conferences at startup? 118 105 #if 0 119 // TODO: remove GUI 120 // initialisation of model and pick active conference from there and call conferenceChanged() 121 // selectConference->setDuplicatesEnabled(false); 122 int confCount = Conference::getAll().count(); 123 if(confCount) 124 { 125 initTabs(); 126 // fillAndShowConferenceHeader(); 127 setWindowTitle(Conference::getById(confId).title()); 128 129 QList<Conference> confs = Conference::getAll(); 130 QListIterator<Conference> i(confs); 131 while(i.hasNext()) 132 { 133 Conference conf = i.next(); 134 // TODO: remove GUI 135 // selectConference->addItem(conf.title(),conf.id()); 136 } 137 // TODO: remove GUI 138 // int idx = selectConference->findText(Conference::getById(Conference::activeConference()).title()); 139 // selectConference->setCurrentIndex(idx); 140 // connect(selectConference, SIGNAL(currentIndexChanged(int)), SLOT(conferenceChanged(int))); 141 // conferenceChanged(idx); 142 } 143 else 144 { 145 // TODO: remove GUI 146 // conferenceHeader->hide(); 147 // selectConferenceWidget->hide(); 148 // // go to the 'conferenceTab', so the user can import the schedule 149 // tabWidget->setCurrentIndex(6); // 6 - conference tab 106 if(!confCount) 107 tabWidget->setCurrentIndex(6); // 6 - conference tab 150 108 } 151 109 #endif … … 170 128 } 171 129 172 void MainWindow::scheduleImported(int aConfId)173 {174 Q_UNUSED(aConfId);175 176 // TODO: this all goes to ConferenceEditor and model of conferences177 #if 0178 179 Conference conf = Conference::getById(aConfId);180 if( selectConference->findText(conf.title()) < 0 ) // item doesn't exist181 {182 disconnect(selectConference, SIGNAL(currentIndexChanged(int)), this, SLOT(conferenceChanged(int)));183 selectConference->addItem(conf.title(),conf.id());184 connect(selectConference, SIGNAL(currentIndexChanged(int)), SLOT(conferenceChanged(int)));185 }186 int confCount = Conference::getAll().count();187 if(confCount)188 {189 int idx = selectConference->findText(conf.title());190 selectConference->setCurrentIndex(idx);191 192 selectConferenceWidget->show();193 194 conferenceChanged(idx);195 }196 #endif197 }198 199 void MainWindow::scheduleDeleted(const QString& title)200 {201 Q_UNUSED(title);202 // TODO: this all goes to ConferenceEditor and model of conferences203 #if 0204 int idx = selectConference->findText(title);205 206 if (idx == -1) {207 // should not happen208 qWarning() << __PRETTY_FUNCTION__ << "removed non-existent item:" << title;209 // this happens when you remove the only conference (the list is not ptoperly inited in this case)210 // now make sure that conferencet211 if (selectConference->count() > 0) {212 selectConference->setCurrentIndex(0);213 conferenceChanged(0);214 } else {215 conferenceChanged(-1);216 }217 } else {218 // will it signal "changed"?219 selectConference->removeItem(idx);220 }221 #endif222 }223 224 130 void MainWindow::aboutApp() 225 131 { … … 270 176 // it takes much CPU, making travelling between conferences in ConferenceEditor longer 271 177 // and is not seen in maemo WM anyway 272 // instead run it explicitly where needed 178 // instead run it explicitly 179 // 1. at startup 180 // 2. when ConferenceEditor finished 273 181 // dont forget to protect the calls by try-catch! 274 182 … … 349 257 ConferenceEditor dialog(conferenceModel, this); 350 258 351 // TODO: connect signals about progress of network and parsing352 353 259 connect(&dialog, SIGNAL(haveConferenceUrl(const QString&)), SLOT(importFromNetwork(const QString&))); 354 260 connect(&dialog, SIGNAL(haveConferenceFile(const QString&)), SLOT(importFromFile(const QString&))); … … 366 272 connect(this, SIGNAL(conferenceRemoved()), &dialog, SLOT(conferenceRemoved())); 367 273 274 // TODO: propagate press of showMapButton here 275 // connect(showMapButton, SIGNAL(clicked()), SLOT(conferenceMapClicked())); 276 368 277 dialog.exec(); 369 278 … … 391 300 void MainWindow::importData(const QByteArray &aData, const QString& url) 392 301 { 393 // TODO: remove GUI 394 // instead send signals to the child dialog 395 #if 0 396 browse->hide(); 397 online->hide(); 398 progressBar->show(); 399 // proxySettings->hide(); 400 #endif 401 402 int confId = mXmlParser->parseData(aData, url); 403 404 #if 0 405 progressBar->hide(); 406 browse->show(); 407 online->show(); 408 // proxySettings->show(); 409 importScheduleLabel->setText("Schedule:"); 410 411 #endif 412 if (confId > 0) { 413 emit(scheduleImported(confId)); 414 } 302 mXmlParser->parseData(aData, url); 415 303 } 416 304
Note: See TracChangeset
for help on using the changeset viewer.