Make DatabaseOpenWidget a bit prettier.

This commit is contained in:
Felix Geyer 2012-07-02 18:47:12 +02:00
parent d0fd9af5e6
commit 909e01bde5
2 changed files with 116 additions and 53 deletions

View File

@ -35,6 +35,11 @@ DatabaseOpenWidget::DatabaseOpenWidget(QWidget* parent)
{
m_ui->setupUi(this);
QFont font = m_ui->labelHeadline->font();
font.setBold(true);
font.setPointSize(font.pointSize() + 2);
m_ui->labelHeadline->setFont(font);
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
connect(m_ui->buttonTogglePassword, SIGNAL(toggled(bool)), SLOT(togglePassword(bool)));
@ -60,6 +65,8 @@ void DatabaseOpenWidget::load(QFile* file, const QString& filename)
m_file = file;
m_filename = filename;
m_ui->labelFilename->setText(filename);
QHash<QString, QVariant> lastKeyFiles = config()->get("LastKeyFiles").toHash();
if (lastKeyFiles.contains(m_filename)) {
m_ui->checkKeyFile->setChecked(true);

View File

@ -6,77 +6,120 @@
<rect>
<x>0</x>
<y>0</y>
<width>353</width>
<height>172</height>
<width>596</width>
<height>250</height>
</rect>
</property>
<property name="windowTitle">
<string>Open database</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="checkPassword">
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,0,0,1,0,0,3">
<property name="spacing">
<number>8</number>
</property>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="labelHeadline">
<property name="text">
<string>Password:</string>
<string>Enter master key</string>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="editPassword">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonTogglePassword">
<property name="text">
<string>...</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
<item>
<widget class="QLabel" name="labelFilename"/>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkKeyFile">
<property name="text">
<string>Key File:</string>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QComboBox" name="comboKeyFile">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable">
<bool>true</bool>
<item>
<layout class="QGridLayout" name="gridLayout">
<property name="verticalSpacing">
<number>8</number>
</property>
<item row="1" column="0">
<widget class="QCheckBox" name="checkKeyFile">
<property name="text">
<string>Key File:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonBrowseFile">
<item row="0" column="0">
<widget class="QCheckBox" name="checkPassword">
<property name="text">
<string>Browse</string>
<string>Password:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="editPassword">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonTogglePassword">
<property name="text">
<string>...</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QComboBox" name="comboKeyFile">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonBrowseFile">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="2" column="0" colspan="2">
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -86,6 +129,19 @@
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<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>
</widget>
<tabstops>