Commit 718f8fa8 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Replace handcrafted filter widgets by Utils::FilterLineEdit

parent f098f039
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>561</width>
<height>866</height>
<width>650</width>
<height>549</height>
</rect>
</property>
<property name="windowTitle">
......@@ -22,6 +22,9 @@
</property>
<item>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="pidLabel">
<property name="text">
......@@ -32,31 +35,8 @@
<item row="0" column="1">
<widget class="QLineEdit" name="pidLineEdit"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="filterLabel">
<property name="text">
<string>Filter:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QWidget" name="filterWidget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="filterLineEdit"/>
</item>
<item>
<widget class="QToolButton" name="filterClearToolButton">
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
</layout>
</widget>
<item row="1" column="0" colspan="2">
<widget class="Utils::FilterLineEdit" name="filterWidget"/>
</item>
</layout>
</item>
......@@ -86,6 +66,18 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Utils::FancyLineEdit</class>
<extends>QLineEdit</extends>
<header location="global">utils/fancylineedit.h</header>
</customwidget>
<customwidget>
<class>Utils::FilterLineEdit</class>
<extends>Utils::FancyLineEdit</extends>
<header location="global">utils/filterlineedit.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
......@@ -248,7 +248,7 @@ AttachExternalDialog::AttachExternalDialog(QWidget *parent)
QPushButton *refreshButton = new QPushButton(tr("Refresh"));
connect(refreshButton, SIGNAL(clicked()), this, SLOT(rebuildProcessList()));
m_ui->buttonBox->addButton(refreshButton, QDialogButtonBox::ActionRole);
m_ui->filterLineEdit->setFocus(Qt::TabFocusReason);
m_ui->filterWidget->setFocus(Qt::TabFocusReason);
// Do not use activated, will be single click in Oxygen
connect(m_ui->procView, SIGNAL(doubleClicked(QModelIndex)),
......@@ -256,11 +256,10 @@ AttachExternalDialog::AttachExternalDialog(QWidget *parent)
connect(m_ui->pidLineEdit, SIGNAL(textChanged(QString)),
this, SLOT(pidChanged(QString)));
connect(m_ui->filterClearToolButton, SIGNAL(clicked()),
m_ui->filterLineEdit, SLOT(clear()));
connect(m_ui->filterLineEdit, SIGNAL(textChanged(QString)),
connect(m_ui->filterWidget, SIGNAL(filterChanged(QString)),
this, SLOT(setFilterString(QString)));
setMinimumHeight(500);
rebuildProcessList();
}
......
......@@ -32,7 +32,6 @@
#include "gitorious.h"
#include "ui_gitoriousprojectwidget.h"
#include <coreplugin/coreconstants.h>
#include <utils/qtcassert.h>
#include <QtCore/QRegExp>
......@@ -71,9 +70,7 @@ GitoriousProjectWidget::GitoriousProjectWidget(int hostIndex,
ui->infoToolButton->setEnabled(false);
connect(ui->infoToolButton, SIGNAL(clicked()), this, SLOT(slotInfo()));
// Filter
connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), m_filterModel, SLOT(setFilterFixedString(QString)));
ui->filterClearButton->setIcon(QIcon(Core::Constants::ICON_RESET));
connect(ui->filterClearButton, SIGNAL(clicked()), ui->filterLineEdit, SLOT(clear()));
connect(ui->filterLineEdit, SIGNAL(filterChanged(QString)), m_filterModel, SLOT(setFilterFixedString(QString)));
// Updater
ui->updateCheckBox->setChecked(true);
if (Gitorious::instance().hostState(hostIndex) != GitoriousHost::ProjectsQueryRunning)
......
......@@ -14,27 +14,6 @@
<string>WizardPage</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="filterLabel">
<property name="text">
<string>Filter:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="filterLineEdit"/>
</item>
<item>
<widget class="QToolButton" name="filterClearButton">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QTreeView" name="projectTreeView"/>
</item>
......@@ -69,8 +48,23 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="Utils::FilterLineEdit" name="filterLineEdit"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Utils::FancyLineEdit</class>
<extends>QLineEdit</extends>
<header location="global">utils/fancylineedit.h</header>
</customwidget>
<customwidget>
<class>Utils::FilterLineEdit</class>
<extends>Utils::FancyLineEdit</extends>
<header location="global">utils/filterlineedit.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
......@@ -33,7 +33,6 @@
#include "gitorious.h"
#include "ui_gitoriousrepositorywizardpage.h"
#include <coreplugin/coreconstants.h>
#include <utils/qtcassert.h>
#include <QtCore/QDebug>
......@@ -90,9 +89,7 @@ GitoriousRepositoryWizardPage::GitoriousRepositoryWizardPage(const GitoriousProj
ui->setupUi(this);
// Filter
connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), m_filterModel, SLOT(setFilterFixedString(QString)));
ui->filterClearButton->setIcon(QIcon(Core::Constants::ICON_RESET));
connect(ui->filterClearButton, SIGNAL(clicked()), ui->filterLineEdit, SLOT(clear()));
connect(ui->filterLineEdit, SIGNAL(filterChanged(QString)), m_filterModel, SLOT(setFilterFixedString(QString)));
// Tree view
ui->repositoryTreeView->setModel(m_filterModel);
ui->repositoryTreeView->setUniformRowHeights(true);
......
......@@ -15,31 +15,33 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="filterLabel">
<property name="text">
<string>Filter:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="filterLineEdit"/>
</item>
<item>
<widget class="QToolButton" name="filterClearButton">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
<widget class="Utils::FilterLineEdit" name="filterLineEdit">
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
</widget>
</item>
<item>
<widget class="QTreeView" name="repositoryTreeView"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Utils::FancyLineEdit</class>
<extends>QLineEdit</extends>
<header location="global">utils/fancylineedit.h</header>
</customwidget>
<customwidget>
<class>Utils::FilterLineEdit</class>
<extends>Utils::FancyLineEdit</extends>
<header location="global">utils/filterlineedit.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>filterLineEdit</tabstop>
<tabstop>repositoryTreeView</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
......@@ -174,7 +174,7 @@ NickNameDialog::NickNameDialog(QStandardItemModel *model, QWidget *parent) :
SLOT(slotDoubleClicked(QModelIndex)));
connect(m_ui->filterTreeView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
this, SLOT(slotCurrentItemChanged(QModelIndex)));
connect(m_ui->filterLineEdit, SIGNAL(textChanged(QString)),
connect(m_ui->filterLineEdit, SIGNAL(filterChanged(QString)),
m_filterModel, SLOT(setFilterFixedString(QString)));
}
......
......@@ -15,38 +15,7 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="filterLabel">
<property name="text">
<string>Filter:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="filterLineEdit"/>
</item>
<item>
<widget class="QToolButton" name="filterClearToolButton">
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
<widget class="Utils::FilterLineEdit" name="filterLineEdit"/>
</item>
<item>
<widget class="QTreeView" name="filterTreeView"/>
......@@ -63,6 +32,18 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Utils::FancyLineEdit</class>
<extends>QLineEdit</extends>
<header location="global">utils/fancylineedit.h</header>
</customwidget>
<customwidget>
<class>Utils::FilterLineEdit</class>
<extends>Utils::FancyLineEdit</extends>
<header location="global">utils/filterlineedit.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
......@@ -97,21 +78,5 @@
</hint>
</hints>
</connection>
<connection>
<sender>filterClearToolButton</sender>
<signal>clicked()</signal>
<receiver>filterLineEdit</receiver>
<slot>clear()</slot>
<hints>
<hint type="sourcelabel">
<x>263</x>
<y>14</y>
</hint>
<hint type="destinationlabel">
<x>198</x>
<y>19</y>
</hint>
</hints>
</connection>
</connections>
</ui>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment