mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed findwindow
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@704 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e261a8b515
commit
08285b512d
@ -1,11 +1,32 @@
|
|||||||
|
/****************************************************************
|
||||||
|
* RetroShare is distributed under the following license:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008, defnax
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
****************************************************************/
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
//#include "ui_window.h"
|
//#include "ui_findwindow.h"
|
||||||
#include "findwindow.h"
|
#include "FindWindow.h"
|
||||||
#include "mainwindowimpl.h"
|
#include "gui/LibraryDialog.h"
|
||||||
|
|
||||||
extern QString fileToFind;
|
extern QString fileToFind;
|
||||||
|
|
||||||
Window::Window(QWidget *parent)
|
FindWindow::FindWindow(QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
{
|
{
|
||||||
browseButton = createButton(tr("&Browse..."), SLOT(browse()));
|
browseButton = createButton(tr("&Browse..."), SLOT(browse()));
|
||||||
@ -43,7 +64,7 @@ extern QString fileToFind;
|
|||||||
resize(700, 300);
|
resize(700, 300);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::browse()
|
void FindWindow::browse()
|
||||||
{
|
{
|
||||||
QString directory = QFileDialog::getExistingDirectory(this,
|
QString directory = QFileDialog::getExistingDirectory(this,
|
||||||
tr("Find Files"), QDir::currentPath());
|
tr("Find Files"), QDir::currentPath());
|
||||||
@ -53,7 +74,7 @@ extern QString fileToFind;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::find()
|
void FindWindow::find()
|
||||||
{
|
{
|
||||||
filesTable->setRowCount(0);
|
filesTable->setRowCount(0);
|
||||||
|
|
||||||
@ -91,7 +112,7 @@ extern QString fileToFind;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QStringList Window::findFiles( QDir &directory, QStringList &files,
|
QStringList FindWindow::findFiles( QDir &directory, QStringList &files,
|
||||||
QString &text)
|
QString &text)
|
||||||
{
|
{
|
||||||
QStringList foundFiles;
|
QStringList foundFiles;
|
||||||
@ -114,7 +135,7 @@ QStringList Window::findFiles( QDir &directory, QStringList &files,
|
|||||||
return foundFiles;
|
return foundFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::showFiles(const QDir &directory, const QStringList &files)
|
void FindWindow::showFiles(const QDir &directory, const QStringList &files)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < files.size(); ++i) {
|
for (int i = 0; i < files.size(); ++i) {
|
||||||
QFile file(directory.absoluteFilePath(files[i]));
|
QFile file(directory.absoluteFilePath(files[i]));
|
||||||
@ -135,7 +156,7 @@ QStringList Window::findFiles( QDir &directory, QStringList &files,
|
|||||||
filesFoundLabel->setText(tr("%1 file(s) found").arg(files.size()));
|
filesFoundLabel->setText(tr("%1 file(s) found").arg(files.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::showFolders(const QDir &directory, const QStringList &folders)
|
void FindWindow::showFolders(const QDir &directory, const QStringList &folders)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < folders.size(); ++i) {
|
for (int i = 0; i < folders.size(); ++i) {
|
||||||
QDir folder(directory.absoluteFilePath(folders[i]));
|
QDir folder(directory.absoluteFilePath(folders[i]));
|
||||||
@ -152,14 +173,14 @@ void Window::showFolders(const QDir &directory, const QStringList &folders)
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPushButton *Window::createButton(const QString &text, const char *member)
|
QPushButton *FindWindow::createButton(const QString &text, const char *member)
|
||||||
{
|
{
|
||||||
QPushButton *button = new QPushButton(text);
|
QPushButton *button = new QPushButton(text);
|
||||||
connect(button, SIGNAL(clicked()), this, member);
|
connect(button, SIGNAL(clicked()), this, member);
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
QComboBox *Window::createComboBox(const QString &text)
|
QComboBox *FindWindow::createComboBox(const QString &text)
|
||||||
{
|
{
|
||||||
QComboBox *comboBox = new QComboBox;
|
QComboBox *comboBox = new QComboBox;
|
||||||
comboBox->setEditable(true);
|
comboBox->setEditable(true);
|
||||||
@ -168,7 +189,7 @@ void Window::showFolders(const QDir &directory, const QStringList &folders)
|
|||||||
return comboBox;
|
return comboBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::createFilesTable()
|
void FindWindow::createFilesTable()
|
||||||
{
|
{
|
||||||
filesTable = new QTableWidget(0, 2);
|
filesTable = new QTableWidget(0, 2);
|
||||||
QStringList labels;
|
QStringList labels;
|
||||||
|
@ -1,3 +1,24 @@
|
|||||||
|
/****************************************************************
|
||||||
|
* RetroShare is distributed under the following license:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008, defnax
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
****************************************************************/
|
||||||
|
|
||||||
#ifndef FINDWINDOW_H
|
#ifndef FINDWINDOW_H
|
||||||
#define FINDWINDOW_H
|
#define FINDWINDOW_H
|
||||||
|
|
||||||
@ -9,12 +30,12 @@
|
|||||||
class QPushButton;
|
class QPushButton;
|
||||||
class QTableWidget;
|
class QTableWidget;
|
||||||
|
|
||||||
class Window : public QDialog
|
class FindWindow : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Window(QWidget *parent = 0);
|
FindWindow(QWidget *parent = 0);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void browse();
|
void browse();
|
||||||
|
Loading…
Reference in New Issue
Block a user