MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); setListFile(); model = new TableModel(this); model->setSettings(&settings); model->readFromFile(listfile); ui->tableView->setModel(model); readSettings(); if (settings.trayicon) { trayicon = new QSystemTrayIcon(this->windowIcon(), this); connect(trayicon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason))); traymenu = new QMenu(this); traymenu->addAction(ui->actionStart); traymenu->addAction(ui->actionStop); traymenu->addAction(ui->actionExit); trayicon->setContextMenu(traymenu); trayicon->setToolTip(tr("Upcoder")); trayicon->show(); } else { trayicon = 0; traymenu = 0; } time = new QTime(); settingsdialog = 0; resdialog = 0; connect(ui->actionSettings, SIGNAL(triggered()), this, SLOT(settingsPressed())); connect(ui->actionAdd, SIGNAL(triggered()), this, SLOT(addPressed())); connect(ui->actionDelete, SIGNAL(triggered()), this, SLOT(deletePressed())); connect(ui->actionClear, SIGNAL(triggered()), model, SLOT(clear())); connect(ui->actionStart, SIGNAL(triggered()), model, SLOT(startUploading())); connect(ui->actionStop, SIGNAL(triggered()), model, SLOT(stopUploading())); connect(ui->actionExit, SIGNAL(triggered()), this, SLOT(exitApplication())); connect(ui->actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(ui->actionShow_links_to_files, SIGNAL(triggered()), this, SLOT(showLinks())); connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(aboutPressed())); connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(showLinks())); connect(model, SIGNAL(statusChanged(QString)), ui->statusBar, SLOT(showMessage(QString))); connect(model, SIGNAL(progress(qint64,qint64)), this, SLOT(uploadProgress(qint64,qint64))); connect(model, SIGNAL(uploadingStarted()), this, SLOT(uploadingStarted())); connect(model, SIGNAL(allUploadsStarted()), this, SLOT(allUploadsStarted())); connect(model, SIGNAL(allUploadsFinished()), this, SLOT(allUploadsFinished())); }
void KGetLinkView::setLinks(const QList <QString> &links) { m_links = QList <QString> (); foreach(const QString &link, links) { m_links << link; } showLinks(m_links); }
void WFrame::manageConnections() { QObject::connect(c,SIGNAL(exitProgram()),this,SLOT(onExit())); QObject::connect(c,SIGNAL(FileLoadedSignal(int)),this,SLOT(FileLoaded(int))); QObject::connect(c,SIGNAL(closeMap()),this,SLOT(onCloseMap())); QObject::connect(this,SIGNAL(closeMapButtonClicked()),c,SLOT(closeMapClicked())); QObject::connect(c,SIGNAL(loadMapSignal()),this,SLOT(loadMap())); QObject::connect(c,SIGNAL(noNodesSignal()),this,SLOT(errorNodes())); QObject::connect(c,SIGNAL(noOSMSignal()),this,SLOT(errorOSM())); QObject::connect(c,SIGNAL(multipleDropSignal()),this,SLOT(multipleDrop())); //ACTION CONNECTS QObject::connect(open,SIGNAL(triggered()),this,SLOT(getFile())); QObject::connect(exit,SIGNAL(triggered()),c,SLOT(exitClicked())); QObject::connect(closeFile,SIGNAL(triggered()),this,SLOT(checkMap())); QObject::connect(about,SIGNAL(triggered()),this,SLOT(showAbout())); QObject::connect(links,SIGNAL(triggered()),this,SLOT(showLinks())); }