Polishment of the simple Search dialog

Based on a patch by racoon.
This commit is contained in:
Juergen Spitzmueller 2018-12-24 14:47:48 +01:00
parent 4d51206585
commit d2527038a3
2 changed files with 148 additions and 169 deletions

View File

@ -47,6 +47,9 @@ GuiSearch::GuiSearch(GuiView & lv)
{ {
setupUi(this); setupUi(this);
// fix height to minimum
setFixedHeight(sizeHint().height());
connect(buttonBox, SIGNAL(clicked(QAbstractButton *)), connect(buttonBox, SIGNAL(clicked(QAbstractButton *)),
this, SLOT(slotButtonBox(QAbstractButton *))); this, SLOT(slotButtonBox(QAbstractButton *)));
connect(findPB, SIGNAL(clicked()), this, SLOT(findClicked())); connect(findPB, SIGNAL(clicked()), this, SLOT(findClicked()));

View File

@ -7,57 +7,102 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>416</width> <width>416</width>
<height>197</height> <height>228</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string/> <string/>
</property> </property>
<property name="sizeGripEnabled"> <property name="sizeGripEnabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="findLA"> <layout class="QGridLayout" name="gridLayout_2">
<property name="text"> <item row="0" column="0" rowspan="2">
<string>Fi&amp;nd:</string> <layout class="QGridLayout" name="gridLayout">
</property> <item row="0" column="0">
<property name="buddy"> <widget class="QLabel" name="findLA">
<cstring>findCO</cstring> <property name="text">
</property> <string>Fi&amp;nd:</string>
</widget> </property>
</item> <property name="buddy">
<item row="0" column="2" colspan="2"> <cstring>findCO</cstring>
<widget class="QComboBox" name="findCO"> </property>
<property name="sizePolicy"> </widget>
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> </item>
<horstretch>0</horstretch> <item row="0" column="1">
<verstretch>0</verstretch> <widget class="QComboBox" name="findCO">
</sizepolicy> <property name="sizePolicy">
</property> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<property name="focusPolicy"> <horstretch>0</horstretch>
<enum>Qt::StrongFocus</enum> <verstretch>0</verstretch>
</property> </sizepolicy>
<property name="editable"> </property>
<bool>true</bool> <property name="focusPolicy">
</property> <enum>Qt::StrongFocus</enum>
<property name="maxCount"> </property>
<number>666</number> <property name="editable">
</property> <bool>true</bool>
<property name="insertPolicy"> </property>
<enum>QComboBox::InsertAtTop</enum> <property name="maxCount">
</property> <number>666</number>
<property name="autoCompletion"> </property>
<bool>false</bool> <property name="insertPolicy">
</property> <enum>QComboBox::InsertAtTop</enum>
<property name="duplicatesEnabled"> </property>
<bool>false</bool> <property name="autoCompletion">
</property> <bool>false</bool>
</widget> </property>
</item> <property name="duplicatesEnabled">
<item row="0" column="4" rowspan="5"> <bool>false</bool>
<layout class="QVBoxLayout" name="verticalLayout"> </property>
<item> </widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="replaceLA">
<property name="text">
<string>Repla&amp;ce with:</string>
</property>
<property name="buddy">
<cstring>replaceCO</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="replaceCO">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="maxCount">
<number>666</number>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertAtTop</enum>
</property>
<property name="autoCompletion">
<bool>false</bool>
</property>
<property name="duplicatesEnabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="findPB"> <widget class="QPushButton" name="findPB">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@ -70,7 +115,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="1">
<widget class="QPushButton" name="replacePB"> <widget class="QPushButton" name="replacePB">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@ -80,141 +125,72 @@
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="2" column="0">
<widget class="QPushButton" name="replaceallPB"> <layout class="QVBoxLayout" name="verticalLayout_4">
<property name="enabled"> <item>
<bool>false</bool> <widget class="QCheckBox" name="caseCB">
</property> <property name="text">
<property name="text"> <string>Case &amp;sensitive[[search]]</string>
<string>Replace &amp;All</string> </property>
</property> </widget>
</widget> </item>
<item>
<widget class="QCheckBox" name="wordsCB">
<property name="text">
<string>Match w&amp;hole words only</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="backwardsCB">
<property name="text">
<string>Search &amp;backwards</string>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item row="2" column="1">
<widget class="QDialogButtonBox" name="buttonBox"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="standardButtons"> <item>
<set>QDialogButtonBox::Close</set> <widget class="QPushButton" name="replaceallPB">
</property> <property name="enabled">
</widget> <bool>false</bool>
</property>
<property name="text">
<string>Replace &amp;All</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>89</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="0" colspan="2"> <item row="1" column="0">
<widget class="QLabel" name="replaceLA"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="text"> <property name="standardButtons">
<string>Repla&amp;ce with:</string> <set>QDialogButtonBox::Close</set>
</property>
<property name="buddy">
<cstring>replaceCO</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2" colspan="2">
<widget class="QComboBox" name="replaceCO">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="maxCount">
<number>666</number>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertAtTop</enum>
</property>
<property name="autoCompletion">
<bool>false</bool>
</property>
<property name="duplicatesEnabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="QCheckBox" name="caseCB">
<property name="text">
<string>Case &amp;sensitive[[search]]</string>
</property>
</widget>
</item>
<item row="2" column="3">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0" colspan="3">
<widget class="QCheckBox" name="wordsCB">
<property name="text">
<string>Match w&amp;hole words only</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QCheckBox" name="backwardsCB">
<property name="text">
<string>Search &amp;backwards</string>
</property>
</widget>
</item>
<item row="5" column="1">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="4">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<tabstops>
<tabstop>findCO</tabstop>
<tabstop>replaceCO</tabstop>
<tabstop>caseCB</tabstop>
<tabstop>wordsCB</tabstop>
<tabstop>backwardsCB</tabstop>
<tabstop>findPB</tabstop>
<tabstop>replacePB</tabstop>
<tabstop>replaceallPB</tabstop>
</tabstops>
<includes> <includes>
<include location="local">qt_i18n.h</include> <include location="local">qt_i18n.h</include>
</includes> </includes>