forked from qt-creator/qt-creator
Core: Inline filesystemfilter.ui
Change-Id: I6d7fb337a1700c78becb182d30c5967906b6d432 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -108,7 +108,7 @@ add_qtc_plugin(Core
|
|||||||
locator/directoryfilter.cpp locator/directoryfilter.h locator/directoryfilter.ui
|
locator/directoryfilter.cpp locator/directoryfilter.h locator/directoryfilter.ui
|
||||||
locator/executefilter.cpp locator/executefilter.h
|
locator/executefilter.cpp locator/executefilter.h
|
||||||
locator/externaltoolsfilter.cpp locator/externaltoolsfilter.h
|
locator/externaltoolsfilter.cpp locator/externaltoolsfilter.h
|
||||||
locator/filesystemfilter.cpp locator/filesystemfilter.h locator/filesystemfilter.ui
|
locator/filesystemfilter.cpp locator/filesystemfilter.h
|
||||||
locator/ilocatorfilter.cpp locator/ilocatorfilter.h
|
locator/ilocatorfilter.cpp locator/ilocatorfilter.h
|
||||||
locator/javascriptfilter.cpp locator/javascriptfilter.h
|
locator/javascriptfilter.cpp locator/javascriptfilter.h
|
||||||
locator/locator.cpp locator/locator.h
|
locator/locator.cpp locator/locator.h
|
||||||
|
|||||||
@@ -348,7 +348,6 @@ Project {
|
|||||||
"externaltoolsfilter.h",
|
"externaltoolsfilter.h",
|
||||||
"filesystemfilter.cpp",
|
"filesystemfilter.cpp",
|
||||||
"filesystemfilter.h",
|
"filesystemfilter.h",
|
||||||
"filesystemfilter.ui",
|
|
||||||
"ilocatorfilter.cpp",
|
"ilocatorfilter.cpp",
|
||||||
"ilocatorfilter.h",
|
"ilocatorfilter.h",
|
||||||
"javascriptfilter.cpp",
|
"javascriptfilter.cpp",
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include "filesystemfilter.h"
|
#include "filesystemfilter.h"
|
||||||
|
|
||||||
#include "basefilefilter.h"
|
#include "basefilefilter.h"
|
||||||
#include "locatorwidget.h"
|
|
||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/documentmanager.h>
|
#include <coreplugin/documentmanager.h>
|
||||||
@@ -13,12 +12,20 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/idocument.h>
|
#include <coreplugin/idocument.h>
|
||||||
#include <coreplugin/vcsmanager.h>
|
#include <coreplugin/vcsmanager.h>
|
||||||
|
|
||||||
#include <utils/checkablemessagebox.h>
|
#include <utils/checkablemessagebox.h>
|
||||||
#include <utils/filepath.h>
|
#include <utils/filepath.h>
|
||||||
|
#include <utils/layoutbuilder.h>
|
||||||
#include <utils/link.h>
|
#include <utils/link.h>
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QCheckBox>
|
||||||
|
#include <QDialog>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QLineEdit>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
|
||||||
@@ -192,25 +199,62 @@ void FileSystemFilter::accept(const LocatorFilterEntry &selection,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class FileSystemFilterOptions : public QDialog
|
||||||
|
{
|
||||||
|
Q_DECLARE_TR_FUNCTIONS(Core::Internal::FileSystemFilterOptions)
|
||||||
|
|
||||||
|
public:
|
||||||
|
FileSystemFilterOptions(QWidget *parent)
|
||||||
|
: QDialog(parent)
|
||||||
|
{
|
||||||
|
resize(360, 131);
|
||||||
|
setWindowTitle(ILocatorFilter::msgConfigureDialogTitle());
|
||||||
|
|
||||||
|
auto prefixLabel = new QLabel;
|
||||||
|
prefixLabel->setText(ILocatorFilter::msgPrefixLabel());
|
||||||
|
prefixLabel->setToolTip(ILocatorFilter::msgPrefixToolTip());
|
||||||
|
|
||||||
|
shortcutEdit = new QLineEdit;
|
||||||
|
includeByDefault = new QCheckBox;
|
||||||
|
hiddenFilesFlag = new QCheckBox(tr("Include hidden files"));
|
||||||
|
|
||||||
|
prefixLabel->setBuddy(shortcutEdit);
|
||||||
|
|
||||||
|
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
|
||||||
|
|
||||||
|
using namespace Layouting;
|
||||||
|
Column {
|
||||||
|
Grid {
|
||||||
|
prefixLabel, shortcutEdit, includeByDefault, br,
|
||||||
|
tr("Filter:"), hiddenFilesFlag, br,
|
||||||
|
},
|
||||||
|
st,
|
||||||
|
Row {st, buttonBox }
|
||||||
|
}.attachTo(this);
|
||||||
|
|
||||||
|
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||||
|
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||||
|
}
|
||||||
|
|
||||||
|
QLineEdit *shortcutEdit;
|
||||||
|
QCheckBox *includeByDefault;
|
||||||
|
QCheckBox *hiddenFilesFlag;
|
||||||
|
};
|
||||||
|
|
||||||
bool FileSystemFilter::openConfigDialog(QWidget *parent, bool &needsRefresh)
|
bool FileSystemFilter::openConfigDialog(QWidget *parent, bool &needsRefresh)
|
||||||
{
|
{
|
||||||
Q_UNUSED(needsRefresh)
|
Q_UNUSED(needsRefresh)
|
||||||
Ui::FileSystemFilterOptions ui;
|
FileSystemFilterOptions dialog(parent);
|
||||||
QDialog dialog(parent);
|
dialog.includeByDefault->setText(msgIncludeByDefault());
|
||||||
ui.setupUi(&dialog);
|
dialog.includeByDefault->setToolTip(msgIncludeByDefaultToolTip());
|
||||||
dialog.setWindowTitle(ILocatorFilter::msgConfigureDialogTitle());
|
dialog.includeByDefault->setChecked(isIncludedByDefault());
|
||||||
ui.prefixLabel->setText(ILocatorFilter::msgPrefixLabel());
|
dialog.hiddenFilesFlag->setChecked(m_includeHidden);
|
||||||
ui.prefixLabel->setToolTip(ILocatorFilter::msgPrefixToolTip());
|
dialog.shortcutEdit->setText(shortcutString());
|
||||||
ui.includeByDefault->setText(msgIncludeByDefault());
|
|
||||||
ui.includeByDefault->setToolTip(msgIncludeByDefaultToolTip());
|
|
||||||
ui.hiddenFilesFlag->setChecked(m_includeHidden);
|
|
||||||
ui.includeByDefault->setChecked(isIncludedByDefault());
|
|
||||||
ui.shortcutEdit->setText(shortcutString());
|
|
||||||
|
|
||||||
if (dialog.exec() == QDialog::Accepted) {
|
if (dialog.exec() == QDialog::Accepted) {
|
||||||
m_includeHidden = ui.hiddenFilesFlag->isChecked();
|
m_includeHidden = dialog.hiddenFilesFlag->isChecked();
|
||||||
setShortcutString(ui.shortcutEdit->text().trimmed());
|
setShortcutString(dialog.shortcutEdit->text().trimmed());
|
||||||
setIncludedByDefault(ui.includeByDefault->isChecked());
|
setIncludedByDefault(dialog.includeByDefault->isChecked());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ilocatorfilter.h"
|
#include "ilocatorfilter.h"
|
||||||
#include "ui_filesystemfilter.h"
|
|
||||||
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QFutureInterface>
|
#include <QFutureInterface>
|
||||||
|
|||||||
@@ -1,111 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>Core::Internal::FileSystemFilterOptions</class>
|
|
||||||
<widget class="QDialog" name="Core::Internal::FileSystemFilterOptions">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>360</width>
|
|
||||||
<height>131</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string notr="true">Filter Configuration</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="prefixLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">Prefix:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>shortcutEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLineEdit" name="shortcutEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QCheckBox" name="includeByDefault">
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">Include by default</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1" colspan="2">
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QCheckBox" name="hiddenFilesFlag">
|
|
||||||
<property name="text">
|
|
||||||
<string>Include hidden files</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>Filter:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections>
|
|
||||||
<connection>
|
|
||||||
<sender>buttonBox</sender>
|
|
||||||
<signal>accepted()</signal>
|
|
||||||
<receiver>Core::Internal::FileSystemFilterOptions</receiver>
|
|
||||||
<slot>accept()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>248</x>
|
|
||||||
<y>254</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>157</x>
|
|
||||||
<y>274</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>buttonBox</sender>
|
|
||||||
<signal>rejected()</signal>
|
|
||||||
<receiver>Core::Internal::FileSystemFilterOptions</receiver>
|
|
||||||
<slot>reject()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>316</x>
|
|
||||||
<y>260</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>286</x>
|
|
||||||
<y>274</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
|
||||||
Reference in New Issue
Block a user