|
|
@ -1,5 +1,4 @@ |
|
|
|
#include <QDomDocument> |
|
|
|
#include <QDomDocument> |
|
|
|
|
|
|
|
|
|
|
|
#include "UBFeaturesWidget.h" |
|
|
|
#include "UBFeaturesWidget.h" |
|
|
|
#include "domain/UBAbstractWidget.h" |
|
|
|
#include "domain/UBAbstractWidget.h" |
|
|
|
#include "gui/UBThumbnailWidget.h" |
|
|
|
#include "gui/UBThumbnailWidget.h" |
|
|
@ -61,6 +60,7 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name) |
|
|
|
layout->addWidget(mActionBar); |
|
|
|
layout->addWidget(mActionBar); |
|
|
|
|
|
|
|
|
|
|
|
connect(centralWidget->listView(), SIGNAL(clicked(const QModelIndex &)), this, SLOT(currentSelected(const QModelIndex &))); |
|
|
|
connect(centralWidget->listView(), SIGNAL(clicked(const QModelIndex &)), this, SLOT(currentSelected(const QModelIndex &))); |
|
|
|
|
|
|
|
connect(this, SIGNAL(sendFileNameList(QStringList)), centralWidget, SIGNAL(sendFileNameList(QStringList))); |
|
|
|
connect(mActionBar, SIGNAL(searchElement(const QString &)), this, SLOT( searchStarted(const QString &))); |
|
|
|
connect(mActionBar, SIGNAL(searchElement(const QString &)), this, SLOT( searchStarted(const QString &))); |
|
|
|
connect(mActionBar, SIGNAL(newFolderToCreate()), this, SLOT(createNewFolder())); |
|
|
|
connect(mActionBar, SIGNAL(newFolderToCreate()), this, SLOT(createNewFolder())); |
|
|
|
connect(mActionBar, SIGNAL(deleteElements(const UBFeaturesMimeData *)), this, SLOT(deleteElements(const UBFeaturesMimeData *))); |
|
|
|
connect(mActionBar, SIGNAL(deleteElements(const UBFeaturesMimeData *)), this, SLOT(deleteElements(const UBFeaturesMimeData *))); |
|
|
@ -79,6 +79,8 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name) |
|
|
|
connect(centralWidget, SIGNAL(createNewFolderSignal(QString)), controller, SLOT(addNewFolder(QString))); |
|
|
|
connect(centralWidget, SIGNAL(createNewFolderSignal(QString)), controller, SLOT(addNewFolder(QString))); |
|
|
|
connect(controller, SIGNAL(scanStarted()), centralWidget, SLOT(scanStarted())); |
|
|
|
connect(controller, SIGNAL(scanStarted()), centralWidget, SLOT(scanStarted())); |
|
|
|
connect(controller, SIGNAL(scanFinished()), centralWidget, SLOT(scanFinished())); |
|
|
|
connect(controller, SIGNAL(scanFinished()), centralWidget, SLOT(scanFinished())); |
|
|
|
|
|
|
|
connect(controller, SIGNAL(scanStarted()), mActionBar, SLOT(lockIt())); |
|
|
|
|
|
|
|
connect(controller, SIGNAL(scanFinished()), mActionBar, SLOT(unlockIt())); |
|
|
|
connect(controller, SIGNAL(maxFilesCountEvaluated(int)), centralWidget, SIGNAL(maxFilesCountEvaluated(int))); |
|
|
|
connect(controller, SIGNAL(maxFilesCountEvaluated(int)), centralWidget, SIGNAL(maxFilesCountEvaluated(int))); |
|
|
|
connect(controller, SIGNAL(featureAddedFromThread()), centralWidget, SLOT(increaseStatusBarValue())); |
|
|
|
connect(controller, SIGNAL(featureAddedFromThread()), centralWidget, SLOT(increaseStatusBarValue())); |
|
|
|
} |
|
|
|
} |
|
|
@ -145,6 +147,7 @@ void UBFeaturesWidget::currentSelected(const QModelIndex ¤t) |
|
|
|
void UBFeaturesWidget::createNewFolder() |
|
|
|
void UBFeaturesWidget::createNewFolder() |
|
|
|
{ |
|
|
|
{ |
|
|
|
centralWidget->showAdditionalData(UBFeaturesCentralWidget::NewFolderDialog, UBFeaturesCentralWidget::Modal); |
|
|
|
centralWidget->showAdditionalData(UBFeaturesCentralWidget::NewFolderDialog, UBFeaturesCentralWidget::Modal); |
|
|
|
|
|
|
|
emit sendFileNameList(controller->getFileNamesInFolders()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBFeaturesWidget::addFolder() |
|
|
|
void UBFeaturesWidget::addFolder() |
|
|
@ -492,6 +495,7 @@ UBFeaturesCentralWidget::UBFeaturesCentralWidget(QWidget *parent) : QWidget(pare |
|
|
|
|
|
|
|
|
|
|
|
connect(dlg, SIGNAL(createNewFolder(QString)), this, SLOT(createNewFolderSlot(QString))); |
|
|
|
connect(dlg, SIGNAL(createNewFolder(QString)), this, SLOT(createNewFolderSlot(QString))); |
|
|
|
connect(dlg, SIGNAL(closeDialog()), this, SLOT(hideAdditionalData())); |
|
|
|
connect(dlg, SIGNAL(closeDialog()), this, SLOT(hideAdditionalData())); |
|
|
|
|
|
|
|
connect(this, SIGNAL(sendFileNameList(QStringList)), dlg, SLOT(setFileNameList(QStringList))); |
|
|
|
|
|
|
|
|
|
|
|
//Progress bar to show scanning progress
|
|
|
|
//Progress bar to show scanning progress
|
|
|
|
QProgressBar *progressBar = new QProgressBar(); |
|
|
|
QProgressBar *progressBar = new QProgressBar(); |
|
|
@ -604,8 +608,6 @@ void UBFeaturesCentralWidget::increaseStatusBarValue() |
|
|
|
|
|
|
|
|
|
|
|
UBFeaturesNewFolderDialog::UBFeaturesNewFolderDialog(QWidget *parent) : QWidget(parent) |
|
|
|
UBFeaturesNewFolderDialog::UBFeaturesNewFolderDialog(QWidget *parent) : QWidget(parent) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// SET_STYLE_SHEET()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this->setStyleSheet("background:white;"); |
|
|
|
this->setStyleSheet("background:white;"); |
|
|
|
|
|
|
|
|
|
|
|
QVBoxLayout *mainLayout = new QVBoxLayout(); |
|
|
|
QVBoxLayout *mainLayout = new QVBoxLayout(); |
|
|
@ -616,14 +618,14 @@ UBFeaturesNewFolderDialog::UBFeaturesNewFolderDialog(QWidget *parent) : QWidget( |
|
|
|
QLabel *mLabel = new QLabel(labelText, this); |
|
|
|
QLabel *mLabel = new QLabel(labelText, this); |
|
|
|
mLineEdit = new QLineEdit(this); |
|
|
|
mLineEdit = new QLineEdit(this); |
|
|
|
|
|
|
|
|
|
|
|
//mValidator = new QRegExpValidator(QRegExp("[A-Za-z][1-9][0-9]{0,2}"), this);
|
|
|
|
mValidator = new QRegExpValidator(QRegExp("[^\\/\\:\\?\\*\\|\\<\\>\\\"]{2,}"), this); |
|
|
|
//mLineEdit->setValidator(mValidator);
|
|
|
|
mLineEdit->setValidator(mValidator); |
|
|
|
labelLayout->addWidget(mLabel); |
|
|
|
labelLayout->addWidget(mLabel); |
|
|
|
labelLayout->addWidget(mLineEdit); |
|
|
|
labelLayout->addWidget(mLineEdit); |
|
|
|
|
|
|
|
|
|
|
|
QHBoxLayout *buttonLayout = new QHBoxLayout(this); |
|
|
|
QHBoxLayout *buttonLayout = new QHBoxLayout(this); |
|
|
|
|
|
|
|
|
|
|
|
QPushButton *acceptButton = new QPushButton(acceptText, this); |
|
|
|
acceptButton = new QPushButton(acceptText, this); |
|
|
|
QPushButton *cancelButton = new QPushButton(cancelText, this); |
|
|
|
QPushButton *cancelButton = new QPushButton(cancelText, this); |
|
|
|
buttonLayout->addWidget(acceptButton); |
|
|
|
buttonLayout->addWidget(acceptButton); |
|
|
|
buttonLayout->addWidget(cancelButton); |
|
|
|
buttonLayout->addWidget(cancelButton); |
|
|
@ -631,14 +633,23 @@ UBFeaturesNewFolderDialog::UBFeaturesNewFolderDialog(QWidget *parent) : QWidget( |
|
|
|
mainLayout->addLayout(labelLayout); |
|
|
|
mainLayout->addLayout(labelLayout); |
|
|
|
mainLayout->addLayout(buttonLayout); |
|
|
|
mainLayout->addLayout(buttonLayout); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
acceptButton->setEnabled(false); |
|
|
|
|
|
|
|
|
|
|
|
connect(acceptButton, SIGNAL(clicked()), this, SLOT(accept())); |
|
|
|
connect(acceptButton, SIGNAL(clicked()), this, SLOT(accept())); |
|
|
|
connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject())); |
|
|
|
connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject())); |
|
|
|
|
|
|
|
connect(mLineEdit, SIGNAL(textEdited(QString)), this, SLOT(reactOnTextChanged(QString))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reactOnTextChanged(QString()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBFeaturesNewFolderDialog::setRegexp(const QRegExp pRegExp) |
|
|
|
void UBFeaturesNewFolderDialog::setRegexp(const QRegExp pRegExp) |
|
|
|
{ |
|
|
|
{ |
|
|
|
mValidator->setRegExp(pRegExp); |
|
|
|
mValidator->setRegExp(pRegExp); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
bool UBFeaturesNewFolderDialog::validString(const QString &pStr) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return mLineEdit->hasAcceptableInput() && !mFileNameList.contains(pStr, Qt::CaseSensitive); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBFeaturesNewFolderDialog::accept() |
|
|
|
void UBFeaturesNewFolderDialog::accept() |
|
|
|
{ |
|
|
|
{ |
|
|
@ -651,6 +662,20 @@ void UBFeaturesNewFolderDialog::reject() |
|
|
|
mLineEdit->clear(); |
|
|
|
mLineEdit->clear(); |
|
|
|
emit closeDialog(); |
|
|
|
emit closeDialog(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void UBFeaturesNewFolderDialog::setFileNameList(const QStringList &pLst) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mFileNameList = pLst; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void UBFeaturesNewFolderDialog::reactOnTextChanged(const QString &pStr) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (validString(pStr)) { |
|
|
|
|
|
|
|
acceptButton->setEnabled(true); |
|
|
|
|
|
|
|
mLineEdit->setStyleSheet("background:white;"); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
acceptButton->setEnabled(false); |
|
|
|
|
|
|
|
mLineEdit->setStyleSheet("background:#FFB3C8;"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBFeaturesWebView::UBFeaturesWebView(QWidget* parent, const char* name):QWidget(parent) |
|
|
|
UBFeaturesWebView::UBFeaturesWebView(QWidget* parent, const char* name):QWidget(parent) |
|
|
|
, mpView(NULL) |
|
|
|
, mpView(NULL) |
|
|
|