Removed redundant group boxes from options dialog pages

Reviewed-by: Jens Bache-Wiig
This commit is contained in:
Thorbjørn Lindeijer
2010-04-13 17:31:42 +02:00
parent 0d04949d1c
commit 662b27153d
13 changed files with 611 additions and 636 deletions

View File

@@ -266,14 +266,11 @@ QIcon CMakeSettingsPage::categoryIcon() const
QWidget *CMakeSettingsPage::createPage(QWidget *parent)
{
QWidget *outerWidget = new QWidget(parent);
QVBoxLayout *outerLayout = new QVBoxLayout(outerWidget);
QGroupBox *groupBox = new QGroupBox;
outerLayout->addWidget(groupBox);
outerLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
QFormLayout *formLayout = new QFormLayout(groupBox);
QFormLayout *formLayout = new QFormLayout(outerWidget);
m_pathchooser = new Utils::PathChooser;
m_pathchooser->setExpectedKind(Utils::PathChooser::Command);
formLayout->addRow(tr("Executable:"), m_pathchooser);
formLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
m_pathchooser->setPath(cmakeExecutable());
return outerWidget;
}

View File

@@ -84,24 +84,22 @@ QIcon CodePasterSettingsPage::categoryIcon() const
QWidget *CodePasterSettingsPage::createPage(QWidget *parent)
{
QGroupBox *groupBox = new QGroupBox();
QVBoxLayout *groupBoxLayout = new QVBoxLayout(groupBox);
QWidget *outerWidget = new QWidget(parent);
QVBoxLayout *outerLayout = new QVBoxLayout(outerWidget);
QFormLayout *formLayout = new QFormLayout;
formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
QLineEdit *lineedit = new QLineEdit(m_host);
connect(lineedit, SIGNAL(textChanged(QString)), this, SLOT(serverChanged(QString)));
formLayout->addRow(tr("Server:"), lineedit);
groupBoxLayout->addLayout(formLayout);
groupBoxLayout->addSpacerItem(new QSpacerItem(0, 60, QSizePolicy::Ignored, QSizePolicy::Fixed));
QLineEdit *lineEdit = new QLineEdit(m_host);
connect(lineEdit, SIGNAL(textChanged(QString)), this, SLOT(serverChanged(QString)));
formLayout->addRow(tr("Server:"), lineEdit);
outerLayout->addLayout(formLayout);
outerLayout->addSpacerItem(new QSpacerItem(0, 30, QSizePolicy::Ignored, QSizePolicy::Fixed));
QLabel *noteLabel = new QLabel(tr("Note: Specify the host name for the CodePaster service "
"without any protocol prepended (e.g. codepaster.mycompany.com)."));
noteLabel->setWordWrap(true);
groupBoxLayout->addWidget(noteLabel);
outerLayout->addWidget(noteLabel);
QWidget *outerWidget = new QWidget(parent);
QVBoxLayout *outerLayout = new QVBoxLayout(outerWidget);
outerLayout->addWidget(groupBox);
outerLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
return outerWidget;
}

View File

@@ -6,22 +6,22 @@
<rect>
<x>0</x>
<y>0</y>
<width>520</width>
<height>475</height>
<width>549</width>
<height>330</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="serverPrefix">
<property name="text">
@@ -29,9 +29,6 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit"/>
</item>
</layout>
</item>
<item>
@@ -45,7 +42,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>60</height>
<height>30</height>
</size>
</property>
</spacer>
@@ -65,9 +62,6 @@
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">

View File

@@ -2,54 +2,16 @@
<ui version="4.0">
<class>CodePaster::SettingsPage</class>
<widget class="QWidget" name="CodePaster::SettingsPage">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>281</width>
<height>229</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="protocolLabel">
<property name="text">
<string>Default Protocol:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="defaultProtocol"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="userNameLabel">
<property name="text">
<string>Username:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="userEdit"/>
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="clipboardBox">
<property name="text">
<string>Copy Paste URL to clipboard</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="displayBox">
<property name="text">
<string>Display Output Pane after sending a post</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="8" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -62,6 +24,40 @@
</property>
</spacer>
</item>
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="displayBox">
<property name="text">
<string>Display Output Pane after sending a post</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="clipboardBox">
<property name="text">
<string>Copy Paste URL to clipboard</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="userEdit"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="userNameLabel">
<property name="text">
<string>Username:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="defaultProtocol"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="protocolLabel">
<property name="text">
<string>Default protocol:</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>

View File

@@ -351,6 +351,5 @@ bool CppFileSettingsPage::matches(const QString &s) const
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}
}
}
} // namespace Internal
} // namespace CppTools

View File

@@ -45,7 +45,8 @@ QT_END_NAMESPACE
namespace CppTools {
namespace Internal {
struct CppFileSettings {
struct CppFileSettings
{
CppFileSettings();
QString headerSuffix;
@@ -61,15 +62,16 @@ struct CppFileSettings {
// Currently made public in
static QString licenseTemplate();
bool equals(const CppFileSettings &rhs) const;
};
inline bool operator==(const CppFileSettings &s1, const CppFileSettings &s2) { return s1.equals(s2); }
inline bool operator!=(const CppFileSettings &s1, const CppFileSettings &s2) { return !s1.equals(s2); }
class CppFileSettingsWidget : public QWidget {
class CppFileSettingsWidget : public QWidget
{
Q_OBJECT
public:
explicit CppFileSettingsWidget(QWidget *parent = 0);
virtual ~CppFileSettingsWidget();
@@ -92,6 +94,7 @@ private:
class CppFileSettingsPage : public Core::IOptionsPage
{
Q_DISABLE_COPY(CppFileSettingsPage)
public:
explicit CppFileSettingsPage(QSharedPointer<CppFileSettings> &settings,
QObject *parent = 0);

View File

@@ -6,19 +6,10 @@
<rect>
<x>0</x>
<y>0</y>
<width>441</width>
<height>503</height>
<width>283</width>
<height>142</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
@@ -58,25 +49,50 @@
</widget>
</item>
<item row="3" column="1">
<widget class="Utils::PathChooser" name="licenseTemplatePathChooser"/>
<widget class="Utils::PathChooser" name="licenseTemplatePathChooser" native="true"/>
</item>
</layout>
</widget>
</item>
<item>
<item row="4" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>430</height>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
<zorder>licenseTemplatePathChooser</zorder>
<zorder>sourceSuffixLabel</zorder>
<zorder>headerSuffixLabel</zorder>
<zorder>lowerCaseFileNamesCheckBox</zorder>
<zorder>headerSuffixComboBox</zorder>
<zorder>sourceSuffixComboBox</zorder>
<zorder>licenseTemplateLabel</zorder>
<zorder>licenseTemplatePathChooser</zorder>
<zorder>sourceSuffixLabel</zorder>
<zorder>headerSuffixLabel</zorder>
<zorder>lowerCaseFileNamesCheckBox</zorder>
<zorder>headerSuffixComboBox</zorder>
<zorder>sourceSuffixComboBox</zorder>
<zorder>licenseTemplateLabel</zorder>
<zorder>licenseTemplatePathChooser</zorder>
<zorder>sourceSuffixLabel</zorder>
<zorder>headerSuffixLabel</zorder>
<zorder>lowerCaseFileNamesCheckBox</zorder>
<zorder>headerSuffixComboBox</zorder>
<zorder>sourceSuffixComboBox</zorder>
<zorder>licenseTemplateLabel</zorder>
<zorder>licenseTemplatePathChooser</zorder>
<zorder>sourceSuffixLabel</zorder>
<zorder>headerSuffixLabel</zorder>
<zorder>lowerCaseFileNamesCheckBox</zorder>
<zorder>headerSuffixComboBox</zorder>
<zorder>sourceSuffixComboBox</zorder>
<zorder>licenseTemplateLabel</zorder>
</widget>
<customwidgets>
<customwidget>

View File

@@ -6,16 +6,13 @@
<rect>
<x>0</x>
<y>0</y>
<width>460</width>
<height>353</height>
<width>367</width>
<height>242</height>
</rect>
</property>
<property name="windowTitle">
<string>Configure Filters</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="configurationGroupBox">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QListWidget" name="filterList">
@@ -68,10 +65,7 @@
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<item row="1" column="0" colspan="2">
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="refreshIntervalLabel">

View File

@@ -6,16 +6,13 @@
<rect>
<x>0</x>
<y>0</y>
<width>282</width>
<height>296</height>
<width>274</width>
<height>264</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTreeWidget" name="list">
@@ -34,6 +31,9 @@
<attribute name="headerCascadingSectionResizes">
<bool>true</bool>
</attribute>
<attribute name="headerCascadingSectionResizes">
<bool>true</bool>
</attribute>
<column>
<property name="text">
<string>SDK Location</string>
@@ -49,7 +49,7 @@
<item>
<widget class="QLabel" name="errorLabel">
<property name="styleSheet">
<string notr="true">background-color: red;</string>
<string notr="true">color: red;</string>
</property>
<property name="text">
<string>Error</string>
@@ -88,9 +88,6 @@
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -744,8 +744,7 @@ QString QtOptionsPageWidget::searchKeywords() const
<< ' ' << m_ui->msvcLabel->text()
<< ' ' << m_ui->gcceLabel->text()
<< ' ' << m_ui->mwcLabel->text()
<< ' ' << m_ui->debuggingHelperLabel->text()
<< ' ' << m_ui->versionListGroupBox->title();
<< ' ' << m_ui->debuggingHelperLabel->text();
rc.remove(QLatin1Char('&'));
return rc;
}

View File

@@ -6,17 +6,11 @@
<rect>
<x>0</x>
<y>0</y>
<width>431</width>
<height>474</height>
<width>400</width>
<height>424</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="versionListGroupBox">
<property name="title">
<string>Qt versions</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
@@ -244,9 +238,6 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Utils::PathChooser</class>

View File

@@ -6,16 +6,10 @@
<rect>
<x>0</x>
<y>0</y>
<width>408</width>
<height>148</height>
<width>359</width>
<height>105</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="commonGroupBox">
<property name="title">
<string>Common Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="lineWrapCheckBox">
@@ -96,10 +90,7 @@ name &lt;email&gt; alias &lt;email&gt;</string>
<item row="3" column="1" colspan="2">
<widget class="Utils::PathChooser" name="nickNameFieldsFileChooser" native="true"/>
</item>
</layout>
</widget>
</item>
<item>
<item row="4" column="0" colspan="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -134,12 +125,12 @@ name &lt;email&gt; alias &lt;email&gt;</string>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>195</x>
<y>46</y>
<x>175</x>
<y>21</y>
</hint>
<hint type="destinationlabel">
<x>240</x>
<y>45</y>
<x>216</x>
<y>21</y>
</hint>
</hints>
</connection>