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); 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); m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
connect(m_ui->buttonTogglePassword, SIGNAL(toggled(bool)), SLOT(togglePassword(bool))); 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_file = file;
m_filename = filename; m_filename = filename;
m_ui->labelFilename->setText(filename);
QHash<QString, QVariant> lastKeyFiles = config()->get("LastKeyFiles").toHash(); QHash<QString, QVariant> lastKeyFiles = config()->get("LastKeyFiles").toHash();
if (lastKeyFiles.contains(m_filename)) { if (lastKeyFiles.contains(m_filename)) {
m_ui->checkKeyFile->setChecked(true); m_ui->checkKeyFile->setChecked(true);

View File

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