Commit 662b2715 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer

Removed redundant group boxes from options dialog pages

Reviewed-by: Jens Bache-Wiig
parent 0d04949d
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>520</width>
<height>475</height>
<width>549</width>
<height>330</height>
</rect>
</property>
<property name="windowTitle">
......@@ -15,57 +15,51 @@
</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="0">
<widget class="QLabel" name="serverPrefix">
<property name="text">
<string>Server Prefix:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit"/>
</item>
</layout>
</item>
<item>
<spacer name="explanatoryTextSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="explanatoryTextLabel">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
<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">
<string>Server Prefix:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="explanatoryTextSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="explanatoryTextLabel">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
&lt;p&gt;&lt;a href=&quot;http://pastebin.com&quot;&gt;pastebin.com&lt;/a&gt; allows to send posts to custom subdomains (eg. qtcreator.pastebin.com). Fill in the desired prefix.&lt;/p&gt;
&lt;p&gt;Note that the plugin will use this for posting as well as fetching.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......
......@@ -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>
<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>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>281</width>
<height>229</height>
</rect>
</property>
<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/>
......
......@@ -351,6 +351,5 @@ bool CppFileSettingsPage::matches(const QString &s) const
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}
}
}
} // namespace Internal
} // namespace CppTools
......@@ -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);
......
......@@ -6,77 +6,93 @@
<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>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="headerSuffixLabel">
<property name="text">
<string>Header suffix:</string>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="headerSuffixLabel">
<property name="text">
<string>Header suffix:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="headerSuffixComboBox"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="sourceSuffixLabel">
<property name="text">
<string>Source suffix:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="sourceSuffixComboBox"/>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="lowerCaseFileNamesCheckBox">
<property name="text">
<string>Lower case file names</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="licenseTemplateLabel">
<property name="text">
<string>License Template:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Utils::PathChooser" name="licenseTemplatePathChooser"/>
</item>
</layout>
</widget>
</item>
<item>
<item row="0" column="1">
<widget class="QComboBox" name="headerSuffixComboBox"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="sourceSuffixLabel">
<property name="text">
<string>Source suffix:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="sourceSuffixComboBox"/>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="lowerCaseFileNamesCheckBox">
<property name="text">
<string>Lower case file names</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="licenseTemplateLabel">
<property name="text">
<string>License Template:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Utils::PathChooser" name="licenseTemplatePathChooser" native="true"/>
</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>
......
......@@ -50,7 +50,7 @@ class LocatorFiltersFilter : public ILocatorFilter
public:
LocatorFiltersFilter(LocatorPlugin *plugin,
LocatorWidget *locatorWidget);
LocatorWidget *locatorWidget);
// ILocatorFilter
QString displayName() const;
......
......@@ -6,72 +6,66 @@
<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">
<property name="font">
<font/>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QVBoxLayout">
<item>
<widget class="QPushButton" name="addButton">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Remove</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="editButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Edit</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QListWidget" name="filterList">
<property name="font">
<font/>
</property>
</widget>
</item>
<item>
<item row="0" column="1">
<layout class="QVBoxLayout">
<item>
<widget class="QPushButton" name="addButton">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Remove</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="editButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Edit</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0" colspan="2">
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="refreshIntervalLabel">
......
......@@ -6,89 +6,86 @@
<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">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTreeWidget" name="list">
<property name="indentation">
<number>0</number>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="uniformRowHeights">
<bool>true</bool>
</property>
<property name="columnCount">
<number>2</number>