FileBrowser::FileBrowser(QWidget *parent) { Q_UNUSED(parent); this->CreateDialogLayout(); connect(lstDir, SIGNAL(itemDoubleClicked()), this, SLOT(onLstDirDoubleClick())); connect(lstFile, SIGNAL(itemDoubleClicked()), this, SLOT(onLstFileDoubleClick())); connect(btnCancel, SIGNAL(pressed()), this, SLOT(onCancelPressed())); connect(txtFilename, SIGNAL(textEdited(const QString &)), this, SLOT(onFilenameChanged())); connect(txtFilename, SIGNAL(returnPressed()), this, SLOT(onAcceptPressed())); connect(cmbFilter, SIGNAL(activated(int)), this, SLOT(onFilterActivated(int))); connect(btnHome, SIGNAL(pressed()), this, SLOT(onHomePressed())); connect(btnMachine, SIGNAL(pressed()), this, SLOT(onMachinePressed())); connect(btnRemote, SIGNAL(pressed()), this, SLOT(onRemotePressed())); connect(btnAccessGrid, SIGNAL(pressed()), this, SLOT(onAccessGridPressed())); connect(cmbDirectory, SIGNAL(activated(int)), this, SLOT(onDirActivated(int))); connect(btnDirUp, SIGNAL(pressed()), this, SLOT(onDirUpPressed())); connect(cmbHistory, SIGNAL(activated(int)), this, SLOT(onHistoryActivated(int))); connect(btnAccept, SIGNAL(pressed()), this, SLOT(onAcceptPressed())); connect(this, SIGNAL(requestLists(QString, QString)), this->mTUIElement, SLOT(handleRequestLists(QString, QString))); connect(this, SIGNAL(filterChange(QString)), this->mTUIElement, SLOT(handleFilterUpdate(QString))); connect(this, SIGNAL(dirChange(QString)), this->mTUIElement, SLOT(handleDirChange(QString))); connect(this, SIGNAL(requestClients()), this->mTUIElement, SLOT(handleClientRequest())); connect(this, SIGNAL(locationChanged(QString)), this->mTUIElement, SLOT(handleLocationChange(QString))); connect(this, SIGNAL(requestLocalHome()), this->mTUIElement, SLOT(handleLocalHome())); connect(this, SIGNAL(reqDriveList()), this->mTUIElement, SLOT(handleReqDriveList())); connect(this, SIGNAL(fileSelected(QString, QString, bool)), this->mTUIElement, SLOT(sendSelectedFile(QString, QString, bool))); this->mLocationPath = ""; this->mFilename = new QStringList(); mRCDialog = new Ui_RemoteClients(); mRCDialog->setupUi(mRCDialog); this->mMode = FileBrowser::OPEN; }
void FileBrowser::onRemotePressed() { // select remote machine to browse for files this->mRCDialog->raise(); this->mRCDialog->show(); emit requestClients(); }
FileBrowser::FileBrowser(TUIFileBrowserButton *instance, QWidget *parent, int id) { Q_UNUSED(parent); this->mTUIElement = instance; this->CreateDialogLayout(); connect(lstDir, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(onLstDirDoubleClick(QListWidgetItem *))); connect(lstFile, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(onLstFileDoubleClick(QListWidgetItem *))); connect(lstFile, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(onLstFileClick(QListWidgetItem *))); connect(btnCancel, SIGNAL(pressed()), this, SLOT(onCancelPressed())); connect(txtFilename, SIGNAL(textEdited(QString)), this, SLOT(onFilenameChanged(QString))); connect(txtFilename, SIGNAL(returnPressed()), this, SLOT(onAcceptPressed())); connect(this, SIGNAL(fileNameEntered()), this, SLOT(onAcceptPressed())); connect(cmbFilter, SIGNAL(activated(int)), this, SLOT(onFilterActivated(int))); connect(btnHome, SIGNAL(pressed()), this, SLOT(onHomePressed())); connect(btnMachine, SIGNAL(pressed()), this, SLOT(onMachinePressed())); connect(btnRemote, SIGNAL(pressed()), this, SLOT(onRemotePressed())); connect(btnAccessGrid, SIGNAL(pressed()), this, SLOT(onAccessGridPressed())); connect(cmbDirectory, SIGNAL(activated(int)), this, SLOT(onDirActivated(int))); connect(btnDirUp, SIGNAL(pressed()), this, SLOT(onDirUpPressed())); connect(cmbHistory, SIGNAL(activated(int)), this, SLOT(onHistoryActivated(int))); connect(btnAccept, SIGNAL(pressed()), this, SLOT(onAcceptPressed())); connect(this, SIGNAL(requestLists(QString, QString)), this->mTUIElement, SLOT(handleRequestLists(QString, QString))); connect(this, SIGNAL(filterChange(QString)), this->mTUIElement, SLOT(handleFilterUpdate(QString))); connect(this, SIGNAL(dirChange(QString)), this->mTUIElement, SLOT(handleDirChange(QString))); connect(this, SIGNAL(requestClients()), this->mTUIElement, SLOT(handleClientRequest())); connect(this, SIGNAL(locationChanged(QString)), this->mTUIElement, SLOT(handleLocationChange(QString))); connect(this, SIGNAL(requestLocalHome()), this->mTUIElement, SLOT(handleLocalHome())); connect(this, SIGNAL(reqDriveList()), this->mTUIElement, SLOT(handleReqDriveList())); connect(this, SIGNAL(fileSelected(QString, QString, bool)), this->mTUIElement, SLOT(sendSelectedFile(QString, QString, bool))); this->mLocationPath = ""; this->mId = id; this->mFilename = new QStringList(); mRCDialog = new Ui_RemoteClients(); mRCDialog->setupUi(mRCDialog); this->mMode = FileBrowser::OPEN; QObject::connect(this->mRCDialog->buttonBox, SIGNAL(accepted()), this, SLOT(remoteClientsAccept())); QObject::connect(this->mRCDialog->buttonBox, SIGNAL(rejected()), this, SLOT(remoteClientsReject())); QObject::connect(this->mRCDialog->listWidget, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(handleItemClicked(QListWidgetItem *))); emit dirChange(this->mLocationPath); // std::string tmp = this->mLocationPath.toStdString(); //std::cerr << "FileBrowser: Path: " << tmp.c_str() << std::endl; }
/** * @brief KGuardiantServer::run */ void KGuardiantServer::run() { //Bloque de código principal. qDebug() << "KGuardiantServer.Run is executing"; log->log("KGuardiantServer.Run is executing"); cam = new DeviceMgr(this); clock = new QTimer(this); clock->setInterval(300); clock->setSingleShot(false); connect(cam, SIGNAL(finished()), cam, SLOT(deleteLater())); connect(clock, SIGNAL(timeout()), cam, SLOT(requestImage())); detector = new MovementDetector(this); connect(cam, SIGNAL(newImage(cv::Mat&)), detector, SLOT(processImg(cv::Mat&)), Qt::DirectConnection); connect(cam, SIGNAL(newImage(cv::Mat&,cv::Mat&)), detector, SLOT(processImg(cv::Mat&,cv::Mat&)) ,Qt::DirectConnection); connect(detector, SIGNAL(processedImg(QByteArray)), &server, SLOT(sendImg(QByteArray))); connect(detector, SIGNAL(finished()), detector, SLOT(deleteLater())); console = new Console(this); connect(console,SIGNAL(finished()),console,SLOT(deleteLater())); connect(console,SIGNAL(startServer()),&server,SLOT(startServer())); connect(console,SIGNAL(stopServer()),&server,SLOT(stopServer())); connect(console,SIGNAL(checkClients()),&server,SLOT(requestClients())); connect(&server, SIGNAL(clientList(QHash<qintptr,TCPConnection*>*)), console, SLOT(printClients(QHash<qintptr,TCPConnection*>*))); connect(console,SIGNAL(finish()),this,SLOT(quit())); cam->start(); detector->start(); clock->start(); server.startServer(); //console->start(); //QTimer::singleShot(10,console,SLOT(startC())); //Débese chamar a quit() para finalizar o bucle de eventos do sistema. //quit(); }