GUI: Improve the Application dialog layoyt.

In GNOME the whole big text area was not shown without making the
dialog bigger. So improve the layout for better scaling and adjust
dialog size when it gets initialized.
This commit is contained in:
Kimmo Varis 2011-04-04 11:00:09 +03:00
parent cfd570e1f3
commit 820e1697cc
2 changed files with 91 additions and 62 deletions

View File

@ -10,15 +10,33 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>569</width> <width>569</width>
<height>328</height> <height>471</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>Add an application</string> <string>Add an application</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>Here you can add an application that can open error files. Specify a name for the application, the application executable and command line parameters for the application. <string>Here you can add an application that can open error files. Specify a name for the application, the application executable and command line parameters for the application.
@ -29,92 +47,102 @@ The following texts in parameters are replaced with appropriate values when appl
(severity) - Error severity (severity) - Error severity
Example opening a file with Kate and make Kate scroll to the correct line: Example opening a file with Kate and make Kate scroll to the correct line:
executable: kate Executable: kate
parameters: -l(line) (file)</string> Parameters: -l(line) (file)</string>
</property> </property>
<property name="textFormat"> <property name="textFormat">
<enum>Qt::AutoText</enum> <enum>Qt::AutoText</enum>
</property> </property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QLabel" name="label_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="text"> <item>
<string>&amp;Application's name:</string> <widget class="QLabel" name="label_2">
</property> <property name="text">
<property name="buddy"> <string>&amp;Name:</string>
<cstring>mName</cstring> </property>
</property> <property name="buddy">
</widget> <cstring>mName</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>&amp;Executable:</string>
</property>
<property name="buddy">
<cstring>mPath</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>&amp;Parameters:</string>
</property>
<property name="buddy">
<cstring>mParameters</cstring>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_3"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="text"> <item>
<string>&amp;Executable:</string> <widget class="QLineEdit" name="mName"/>
</property> </item>
<property name="buddy"> <item>
<cstring>mPath</cstring> <widget class="QLineEdit" name="mPath"/>
</property> </item>
</widget> <item>
</item> <widget class="QLineEdit" name="mParameters"/>
<item> </item>
<widget class="QLabel" name="label_4"> </layout>
<property name="text">
<string>&amp;Parameters:</string>
</property>
<property name="buddy">
<cstring>mParameters</cstring>
</property>
</widget>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QLineEdit" name="mName"/> <spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="mPath"/> <widget class="QPushButton" name="mButtonBrowse">
</item> <property name="text">
<item> <string>Browse</string>
<widget class="QLineEdit" name="mParameters"/> </property>
</widget>
</item> </item>
</layout> </layout>
</item> </item>
</layout> </layout>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="mButtonBrowse">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item> <item>
<widget class="QDialogButtonBox" name="mButtons"> <widget class="QDialogButtonBox" name="mButtons">
<property name="orientation"> <property name="orientation">

View File

@ -40,6 +40,7 @@ ApplicationDialog::ApplicationDialog(const QString &title,
mUI.mName->setText(app.getName()); mUI.mName->setText(app.getName());
mUI.mParameters->setText(app.getParameters()); mUI.mParameters->setText(app.getParameters());
setWindowTitle(title); setWindowTitle(title);
adjustSize();
} }