mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 05:25:50 +03:00
ShareDialog: remove the search button (#3737)
This commit is contained in:
parent
11ef07c74a
commit
6e42405113
4 changed files with 11 additions and 34 deletions
|
@ -46,6 +46,7 @@ ShareDialog::ShareDialog(AccountPtr account, const QString &sharePath, const QSt
|
|||
|
||||
QPushButton *closeButton = _ui->buttonBox->button(QDialogButtonBox::Close);
|
||||
connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
|
||||
closeButton->setDefault(false); // Because people press enter in the dialog and we don't want to close for that
|
||||
|
||||
// Set icon
|
||||
QFileInfo f_info(_localPath);
|
||||
|
|
|
@ -65,8 +65,6 @@ ShareUserGroupWidget::ShareUserGroupWidget(AccountPtr account, const QString &sh
|
|||
_completer->setModel(_completerModel);
|
||||
_ui->shareeLineEdit->setCompleter(_completer);
|
||||
|
||||
_ui->searchPushButton->setEnabled(false);
|
||||
|
||||
_manager = new ShareManager(_account, this);
|
||||
connect(_manager, SIGNAL(sharesFetched(QList<QSharedPointer<Share>>)), SLOT(slotSharesFetched(QList<QSharedPointer<Share>>)));
|
||||
connect(_manager, SIGNAL(shareCreated(QSharedPointer<Share>)), SLOT(getShares()));
|
||||
|
@ -76,7 +74,7 @@ ShareUserGroupWidget::ShareUserGroupWidget(AccountPtr account, const QString &sh
|
|||
// Queued connection so this signal is recieved after textChanged
|
||||
connect(_ui->shareeLineEdit, SIGNAL(textEdited(QString)),
|
||||
this, SLOT(slotLineEditTextEdited(QString)), Qt::QueuedConnection);
|
||||
connect(&_completionTimer, SIGNAL(timeout()), this, SLOT(on_searchPushButton_clicked()));
|
||||
connect(&_completionTimer, SIGNAL(timeout()), this, SLOT(searchForSharees()));
|
||||
_completionTimer.setSingleShot(true);
|
||||
_completionTimer.setInterval(600);
|
||||
|
||||
|
@ -88,14 +86,9 @@ ShareUserGroupWidget::~ShareUserGroupWidget()
|
|||
delete _ui;
|
||||
}
|
||||
|
||||
void ShareUserGroupWidget::on_shareeLineEdit_textChanged(const QString &text)
|
||||
void ShareUserGroupWidget::on_shareeLineEdit_textChanged(const QString &)
|
||||
{
|
||||
_completionTimer.stop();
|
||||
if (text == "") {
|
||||
_ui->searchPushButton->setEnabled(false);
|
||||
} else {
|
||||
_ui->searchPushButton->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void ShareUserGroupWidget::slotLineEditTextEdited(const QString& text)
|
||||
|
@ -108,7 +101,7 @@ void ShareUserGroupWidget::slotLineEditTextEdited(const QString& text)
|
|||
}
|
||||
|
||||
|
||||
void ShareUserGroupWidget::on_searchPushButton_clicked()
|
||||
void ShareUserGroupWidget::searchForSharees()
|
||||
{
|
||||
_completionTimer.stop();
|
||||
ShareeModel::ShareeSet blacklist;
|
||||
|
|
|
@ -97,7 +97,7 @@ private slots:
|
|||
void slotSharesFetched(const QList<QSharedPointer<Share>> &shares);
|
||||
|
||||
void on_shareeLineEdit_textChanged(const QString &text);
|
||||
void on_searchPushButton_clicked();
|
||||
void searchForSharees();
|
||||
void slotLineEditTextEdited(const QString &text);
|
||||
|
||||
void slotCompleterActivated(const QModelIndex & index);
|
||||
|
|
|
@ -14,11 +14,6 @@
|
|||
<string>Share NewDocument.odt</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="shareeLineEdit">
|
||||
<property name="placeholderText">
|
||||
|
@ -26,18 +21,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="searchPushButton">
|
||||
<property name="text">
|
||||
<string>Search</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="sizePolicy">
|
||||
|
@ -61,7 +44,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>441</width>
|
||||
<height>124</height>
|
||||
<height>128</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3"/>
|
||||
|
|
Loading…
Reference in a new issue