cipher: Fix build option and use a dialog for entering the password

Fix the sqlcipher build option in the qmake project to actually enable
the SQLCipher support.

Add a new dialog called CipherDialog which is used to ask the user for
the password and other encryption details instead of using standard Qt
input dialogs.
This commit is contained in:
Martin Kleusberg
2014-11-02 13:12:31 +01:00
parent 9ba36d02b2
commit 167d8cbd74
8 changed files with 265 additions and 21 deletions

166
src/CipherDialog.ui Normal file
View File

@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CipherDialog</class>
<widget class="QDialog" name="CipherDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>475</width>
<height>147</height>
</rect>
</property>
<property name="windowTitle">
<string>SQLCipher encryption</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="labelDialogDescription"/>
</item>
<item>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="labelPassword">
<property name="text">
<string>&amp;Password</string>
</property>
<property name="buddy">
<cstring>editPassword</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="editPassword">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelPassword2">
<property name="text">
<string>&amp;Reenter password</string>
</property>
<property name="buddy">
<cstring>editPassword2</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="editPassword2">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Page &amp;size</string>
</property>
<property name="buddy">
<cstring>spinPageSize</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="spinPageSize">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>8092</number>
</property>
<property name="value">
<number>4096</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>CipherDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>227</x>
<y>110</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>126</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>CipherDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>295</x>
<y>116</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>126</y>
</hint>
</hints>
</connection>
<connection>
<sender>editPassword</sender>
<signal>textChanged(QString)</signal>
<receiver>CipherDialog</receiver>
<slot>checkInputFields()</slot>
<hints>
<hint type="sourcelabel">
<x>150</x>
<y>38</y>
</hint>
<hint type="destinationlabel">
<x>155</x>
<y>26</y>
</hint>
</hints>
</connection>
<connection>
<sender>editPassword2</sender>
<signal>textChanged(QString)</signal>
<receiver>CipherDialog</receiver>
<slot>checkInputFields()</slot>
<hints>
<hint type="sourcelabel">
<x>201</x>
<y>57</y>
</hint>
<hint type="destinationlabel">
<x>206</x>
<y>46</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>checkInputFields()</slot>
</slots>
</ui>