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 *CMakeSettingsPage::createPage(QWidget *parent)
{ {
QWidget *outerWidget = new QWidget(parent); QWidget *outerWidget = new QWidget(parent);
QVBoxLayout *outerLayout = new QVBoxLayout(outerWidget); QFormLayout *formLayout = new QFormLayout(outerWidget);
QGroupBox *groupBox = new QGroupBox;
outerLayout->addWidget(groupBox);
outerLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
QFormLayout *formLayout = new QFormLayout(groupBox);
m_pathchooser = new Utils::PathChooser; m_pathchooser = new Utils::PathChooser;
m_pathchooser->setExpectedKind(Utils::PathChooser::Command); m_pathchooser->setExpectedKind(Utils::PathChooser::Command);
formLayout->addRow(tr("Executable:"), m_pathchooser); formLayout->addRow(tr("Executable:"), m_pathchooser);
formLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
m_pathchooser->setPath(cmakeExecutable()); m_pathchooser->setPath(cmakeExecutable());
return outerWidget; return outerWidget;
} }

View File

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

View File

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

View File

@@ -2,54 +2,16 @@
<ui version="4.0"> <ui version="4.0">
<class>CodePaster::SettingsPage</class> <class>CodePaster::SettingsPage</class>
<widget class="QWidget" name="CodePaster::SettingsPage"> <widget class="QWidget" name="CodePaster::SettingsPage">
<layout class="QVBoxLayout" name="verticalLayout"> <property name="geometry">
<item> <rect>
<widget class="QGroupBox" name="groupBox"> <x>0</x>
<property name="sizePolicy"> <y>0</y>
<sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <width>281</width>
<horstretch>0</horstretch> <height>229</height>
<verstretch>0</verstretch> </rect>
</sizepolicy>
</property> </property>
<layout class="QFormLayout" name="formLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="8" column="0" colspan="2">
<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>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@@ -62,6 +24,40 @@
</property> </property>
</spacer> </spacer>
</item> </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> </layout>
</widget> </widget>
<resources/> <resources/>

View File

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

View File

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

View File

@@ -6,19 +6,10 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>441</width> <width>283</width>
<height>503</height> <height>142</height>
</rect> </rect>
</property> </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"> <layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::ExpandingFieldsGrow</enum>
@@ -58,25 +49,50 @@
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="1">
<widget class="Utils::PathChooser" name="licenseTemplatePathChooser"/> <widget class="Utils::PathChooser" name="licenseTemplatePathChooser" native="true"/>
</item> </item>
</layout> <item row="4" column="0" colspan="2">
</widget>
</item>
<item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>0</width>
<height>430</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </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> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>

View File

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

View File

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

View File

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

View File

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

View File

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