Exemple #1
0
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;
}
Exemple #2
0
	void ScanDlg::finished()
	{
		QMutexLocker lock(&mutex);
		scanning = false;
		timer.stop();
		progress(100,100);
		update();
		if (!isStopped())
		{
			if (restart)
			{
				tc->start();
			}
			
			if (silently)
				accept();
			else
			{
				// cancel now becomes a close button
				m_cancel->setGuiItem(KStandardGuiItem::close()); 
				disconnect(m_cancel,SIGNAL(clicked()),this,SLOT(onCancelPressed()));
				connect(m_cancel,SIGNAL(clicked()),this,SLOT(accept()));
			}
		}
		else
		{
			if (restart)
			{
				tc->start();
			}
			
			KDialog::reject();
		}
	}
Exemple #3
0
	ScanDlg::ScanDlg(QWidget* parent) 
		: KDialog(parent),bt::DataCheckerListener(false),mutex(QMutex::Recursive)
	{
		setButtons(KDialog::None);
		Ui::ScanDlgBase ui;
		QWidget *widget = new QWidget(this);
		ui.setupUi(widget);
		setMainWidget(widget);
		m_torrent_label = ui.torrent_label;
		m_chunks_found = ui.chunks_found;
		m_chunks_failed = ui.chunks_failed;
		m_chunks_downloaded = ui.chunks_downloaded;
		m_chunks_not_downloaded = ui.chunks_not_downloaded;
		m_progress = ui.progress;
		m_cancel = ui.cancel;
		m_cancel->setGuiItem(KStandardGuiItem::cancel());
		connect(m_cancel,SIGNAL(clicked()),this,SLOT(onCancelPressed()));
		connect(&timer,SIGNAL(timeout()),this,SLOT(update()));
		tc = 0;
		silently = false;
		restart = false;
		scanning = false;
		num_chunks = 0;
		total_chunks = 0;
		num_downloaded = 0;
		num_failed = 0;
		num_found = 0;
		num_not_downloaded = 0;
		m_progress->setMaximum(100);
		m_progress->setValue(0);
	}
Exemple #4
0
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;
}