PathButton::PathButton(QWidget *parent) : QPushButton(parent), d(new Data) { QPushButton::setText(d->getText()); connect(this, &QPushButton::clicked, this, [=] () { switch (d->mode) { case Folder: { const auto ret = getFolder(); if (!ret.isEmpty()) { emit folderSelected(ret); if (d->editor) d->prop.write(d->editor, ret); } break; } case SingleFile: { const auto ret = getFile(); if (!ret.isEmpty()) { emit fileSelected(ret); if (d->editor) d->prop.write(d->editor, ret); } break; } case MultiFile: { const auto ret = getFiles(); if (!ret.isEmpty()) { emit filesSelected(ret); if (d->editor) d->prop.write(d->editor, ret); } } default: break; } }); }
QFakeMail::QFakeMail() : QMainWindow(0), email("([a-z0-9._%+-]+@[a-z0-9-]+\\.[a-z0-9.-]+)", Qt::CaseInsensitive) { setupUi(this); connect(server, SIGNAL(textEdited(const QString&)), SLOT(change())); connect(isfrom, SIGNAL(toggled(bool)), SLOT(change())); connect(from, SIGNAL(textEdited(const QString&)), SLOT(change())); connect(to, SIGNAL(textEdited(const QString&)), SLOT(change())); connect(files, SIGNAL(itemSelectionChanged()), SLOT(filesSelected())); connect(removefile, SIGNAL(clicked()), SLOT(removeFile())); connect(addfile, SIGNAL(clicked()), SLOT(addFile())); connect(send, SIGNAL(clicked()), SLOT(sendSlot())); connect(actionAbout, SIGNAL(triggered()), SLOT(about())); connect(&sock, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(gotErrorSlot())); connect(&sock, SIGNAL(disconnected()), SLOT(disconnected())); connect(&sock, SIGNAL(connected()), SLOT(connected())); connect(&sock, SIGNAL(readyRead()), SLOT(readed())); QSettings settings; int size = settings.beginReadArray("recents"); for (int i = 0; i < size; i++) { settings.setArrayIndex(i); recents << settings.value("server").toString(); } settings.endArray(); server->setCompleter(new QCompleter(recents, server)); }
void MultiQFileDialog::accept() { QStringList files = selectedFiles(); if (files.isEmpty()) { return; } emit filesSelected(files); QDialog::accept(); }
void CFileBrowser::saveFileToDevice(void){ //Copy file to the device QFileDialog fileDialog; connect(&fileDialog, SIGNAL(filesSelected(QStringList)), this, SLOT(saveFileToDeviceSelected(QStringList)), Qt::QueuedConnection); fileDialog.setFileMode(QFileDialog::ExistingFiles); fileDialog.exec(); fileDialog.hide(); }
/** \brief Open's a new file dialog */ void cwFileDialogHelper::open() { QStringList files; if(multipleFiles()) { files = cwGlobals::openFiles(caption(), filter(), settingKey()); } else { QString file = cwGlobals::openFile(caption(), filter(), settingKey()); files.append(file); } if(!files.isEmpty()) { emit filesSelected(files); } }
void TimeLapseGenMain::on_actionSelect_Images_triggered() { QFileDialog fileChooseDialog; fileChooseDialog.setFileMode(QFileDialog::ExistingFiles); fileChooseDialog.setNameFilter(tr("Images (*.png, *.jpeg, *.jpg, *JPG")); fileChooseDialog.setWindowTitle("Select Images"); if ( fileChooseDialog.exec()){ selectedFileNames = fileChooseDialog.selectedFiles(); emit filesSelected(); } }
TimeLapseGenMain::TimeLapseGenMain(QWidget *parent) : QMainWindow(parent), ui(new Ui::TimeLapseGenMain) { ui->setupUi(this); brightness = 0; contrast = 0; saturation = 0; eType = None; ui->labelImage->setScaledContents(1); ui->labelImage->setTextFormat(Qt::RichText); ui->labelImage->setText(welcomePage); connect(this, SIGNAL(filesSelected()), this, SLOT(loadImagesIntoMemory())); }
void Metalink::fileDlgFinished(int result) { //the dialog was not accepted untick every file, this ensures that the user does not //press start by accident without first selecting the desired files if (result != QDialog::Accepted) { untickAllFiles(); } filesSelected(); //no files selected to download or dialog rejected, stop the download if (!m_numFilesSelected || (result != QDialog::Accepted)) { setStatus(Job::Stopped); setTransferChange(Tc_Status, true); return; } startMetalink(); }
SN_PointerUI::SN_PointerUI(QWidget *parent) : QMainWindow(parent) , ui(new Ui::SN_PointerUI) , _settings(0) , _uiclientid(0) , fileTransferPort(0) , ungrabMouseAction(0) , scaleToWallX(0.0) , scaleToWallY(0.0) // , sendThread(0) , isMouseCapturing(false) , mediaDropFrame(0) , _wallPort(0) , _sharingEdge(QString("right")) , macCapture(0) , _winCapture(0) , _winCaptureServer(0) , _iodeviceForMouseHook(0) , mouseBtnPressed(0) , _wasDblClick(false) , _prevClickTime(0) , _progressDialog(0) { ui->setupUi(this); // setAttribute(Qt::WA_DeleteOnClose, true); #if defined(Q_OS_MAC) || defined(Q_OS_WIN32) ui->hookMouseBtn->hide(); #endif ui->mainToolBar->addAction(ui->actionNew_Connection); // ui->mainToolBar->addAction(ui->actionOpen_Media); ui->mainToolBar->addAction(ui->actionShare_desktop); // ui->mainToolBar->addAction(ui->actionSend_text); _settings = new QSettings("EVL", "SAGENextPointer", this); // // handle msg socket error // QObject::connect(&_tcpMsgSock, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(handleSocketError(QAbstractSocket::SocketError))); // // handle msg socket state change // QObject::connect(&_tcpMsgSock, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(handleSocketStateChange(QAbstractSocket::SocketState))); // // to receive a message from SAGENext // QObject::connect(&_tcpMsgSock, SIGNAL(readyRead()), this, SLOT(readMessage())); // QObject::connect(&_tcpMsgSock, SIGNAL(disconnected()), & // QObject::connect(&_tcpDataSock, SIGNAL(readyRead()), this, SLOT(recvFileFromWall())); // // mouse ungrab action // ungrabMouseAction = new QAction(this); ungrabMouseAction->setShortcut( QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::ALT + Qt::Key_M)); QObject::connect(ungrabMouseAction, SIGNAL(triggered()), this, SLOT(unhookMouse())); addAction(ungrabMouseAction); // timer = new QTimer(this); // timer->setInterval(500); // msec // connect(timer, SIGNAL(timeout()), this, SLOT(updateScene())); // timer->start(); // // Drag & Drop gui // mediaDropFrame = new SN_PointerUI_DropFrame(this); ui->verticalLayout->addWidget(mediaDropFrame); int lastwidgetidx = ui->verticalLayout->count() - 1; // find the index of the last (bottom) widget which is dropFrame ui->verticalLayout->setStretch(lastwidgetidx, 2); QObject::connect(mediaDropFrame, SIGNAL(mediaDropped(QList<QUrl>)), this, SLOT(runSendFileThread(QList<QUrl>))); // // file dialog (CMD + o) // //fdialog = new QFileDialog(this, "Open Media Files", QDir::homePath(), "Images (*.tif *.tiff *.svg *.bmp *.png *.jpg *.jpeg *.gif *.xpm);;Videos (*.mov *.avi *.mpg *.mp4);;Any (*)"); fdialog = new QFileDialog(this, "Open Media Files", QDir::homePath(), "*"); fdialog->setModal(false); fdialog->setVisible(false); QObject::connect(fdialog, SIGNAL(filesSelected(QStringList)), this, SLOT(readLocalFiles(QStringList))); // // progress dialog // _progressDialog = new QProgressDialog(this); _progressDialog->setWindowModality(Qt::WindowModal); _progressDialog->setAutoClose(true); // will be hidden when reset() is called _progressDialog->setAutoReset(true); // will call reset() automatically as soon as value() equals maximum() _progressDialog->setMinimumDuration(0); // QObject::connect(_progressDialog, SIGNAL(accepted()), this, SLOT(fileSendingCompleted())); // // in SAGE image // QPixmap splashsmall(":/images/splash_small.png"); _inSAGEsplash.setPixmap(splashsmall); _inSAGEsplash.setGeometry(0, 0, splashsmall.width(), splashsmall.height()); // _inSAGEsplash.setFrameShape(QFrame::NoFrame); _inSAGEsplash.hide(); // // now read the settings for _wallAddress and _wallPort // QString savedWallAddr = _settings->value("walladdr", "").toString(); quint16 savedWallPort = _settings->value("wallport", 0).toUInt(); if (!savedWallAddr.isEmpty() && savedWallPort) { // // try connecting to the server // _wallAddress = savedWallAddr; _wallPort = savedWallPort; _pointerName = _settings->value("pointername", "pointerName").toString(); _pointerColor = _settings->value("pointercolor", "#ff0000").toString(); _sharingEdge = _settings->value("sharingedge", "right").toString(); _tcpMsgSock.connectToHost(_wallAddress, _wallPort); } else { if ( ! QMetaObject::invokeMethod(this, "on_actionNew_Connection_triggered", Qt::QueuedConnection) ) { qDebug() << "invokeMethod() : on_actionNew_Connection_triggered failed"; } } }
void FilesView::slotNewSelection(const QItemSelection & selected) { emit(filesSelected(selected.size()>0)); }
void TaskUI::selectFiles() { QStringList files = QFileDialog::getOpenFileNames(this, "Select checksum file or files to generate checksum file for", "", "All files (*)"); emit filesSelected(files); }