Skip to content

Commit

Permalink
Accessibility: Hidden Volume
Browse files Browse the repository at this point in the history
Accessability: tab order in hidden volume form
Accessability: names and description in hidden volume setup form

Fixes #9

Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
  • Loading branch information
szszszsz committed Apr 7, 2017
1 parent 9604eec commit 3a1140d
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 6 deletions.
9 changes: 8 additions & 1 deletion src/ui/stick20hiddenvolumedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,10 @@ void stick20HiddenVolumeDialog::setHighWaterMarkText(void) {
ui->StartBlockSpin->setValue(HV_Setup_st.StartBlockPercent_u8);
ui->EndBlockSpin->setValue(HV_Setup_st.EndBlockPercent_u8);
ui->l_sd_size->setText(tr("Storage capacity: %1GB").arg(sd_size_GB));
ui->l_rounding_info->setText(ui->l_rounding_info->text().arg((sd_size_GB * 1024 / 100)));
auto rounding_info = ui->l_rounding_info->text().arg((sd_size_GB * 1024 / 100));
ui->l_rounding_info->setText(rounding_info);
ui->StartBlockSpin->setAccessibleDescription(rounding_info);
ui->EndBlockSpin->setAccessibleDescription(rounding_info);
}


Expand All @@ -264,6 +267,8 @@ void stick20HiddenVolumeDialog::on_rd_unit_clicked(QString text) {
QString end = tr("End hidden volume at %1 of the encrypted storage:");
ui->l_sd_start->setText(start.arg(text));
ui->l_sd_end->setText(end.arg(text));
ui->StartBlockSpin->setAccessibleName(start.arg(text));
ui->EndBlockSpin->setAccessibleName(end.arg(text));

switch (last) {
case 'M':
Expand Down Expand Up @@ -326,6 +331,7 @@ void stick20HiddenVolumeDialog::set_spins_min_max(const double min, const double
}

void stick20HiddenVolumeDialog::on_EndBlockSpin_valueChanged(double i){
Q_UNUSED(i)
if (cancel_BlockSpin_event_propagation) return;
cancel_BlockSpin_event_propagation = true;
auto start_val = ui->StartBlockSpin->value();
Expand All @@ -339,6 +345,7 @@ void stick20HiddenVolumeDialog::on_EndBlockSpin_valueChanged(double i){
}

void stick20HiddenVolumeDialog::on_StartBlockSpin_valueChanged(double i){
Q_UNUSED(i)
if (cancel_BlockSpin_event_propagation) return;
cancel_BlockSpin_event_propagation = true;
auto end_val = ui->EndBlockSpin->value();
Expand Down
52 changes: 47 additions & 5 deletions src/ui/stick20hiddenvolumedialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>430</width>
<height>574</height>
<height>575</height>
</rect>
</property>
<property name="sizePolicy">
Expand All @@ -20,7 +20,7 @@
<string>Setup hidden volume</string>
</property>
<property name="windowIcon">
<iconset resource="../resources.qrc">
<iconset resource="../../resources.qrc">
<normaloff>:/images/CS_icon.png</normaloff>:/images/CS_icon.png</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
Expand Down Expand Up @@ -56,7 +56,7 @@
<string/>
</property>
<property name="pixmap">
<pixmap resource="../resources.qrc">:/images/warning.png</pixmap>
<pixmap resource="../../resources.qrc">:/images/warning.png</pixmap>
</property>
</widget>
</item>
Expand All @@ -68,6 +68,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;You should understand the properties of hidden volumes before proceeding. It can destroy your encrypted data! &lt;br/&gt;Please read &lt;/span&gt;&lt;a href=&quot;https://www.nitrokey.com/documentation/hidden-volumes&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline; color:#0000ff;&quot;&gt;these instructions&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-weight:600;&quot;&gt; first.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
Expand All @@ -92,6 +95,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;1. You may want to copy some innocuous files to the encrypted data.&lt;br/&gt;2. Configure hidden volumes in this dialogue. &lt;br/&gt;3. Once you configured a hidden volume you must not use/write to the encryption volume anymore. Otherwise it may destroy the data in your hidden volume.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
Expand All @@ -115,6 +121,12 @@
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="HVPasswordEdit">
<property name="accessibleName">
<string>Hidden volume password</string>
</property>
<property name="accessibleDescription">
<string>Please use shift+tab key shortcut for instructions</string>
</property>
<property name="text">
<string notr="true">12345678901234567890</string>
</property>
Expand All @@ -138,6 +150,9 @@
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="accessibleName">
<string>Hidden volume password (repeated)</string>
</property>
<property name="text">
<string notr="true">12345678901234567890</string>
</property>
Expand Down Expand Up @@ -167,6 +182,9 @@
</item>
<item>
<widget class="QProgressBar" name="password_strength_progressBar">
<property name="accessibleName">
<string>Password strength:</string>
</property>
<property name="value">
<number>42</number>
</property>
Expand Down Expand Up @@ -281,6 +299,9 @@
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QComboBox" name="comboBox">
<property name="accessibleDescription">
<string>Slot under which hidden volume information will be stored</string>
</property>
<item>
<property name="text">
<string>Hidden volume slot 1</string>
Expand Down Expand Up @@ -321,6 +342,9 @@
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="l_sd_size">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="text">
<string notr="true">Storage capacity: %1GB</string>
</property>
Expand Down Expand Up @@ -348,20 +372,32 @@
</item>
<item>
<widget class="QRadioButton" name="rd_percent">
<property name="accessibleName">
<string/>
</property>
<property name="accessibleDescription">
<string>Use this as hidden volume size unit</string>
</property>
<property name="text">
<string>%</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rd_MB">
<property name="accessibleDescription">
<string>Use this as hidden volume size unit</string>
</property>
<property name="text">
<string>MB</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rd_GB">
<property name="accessibleDescription">
<string>Use this as hidden volume size unit</string>
</property>
<property name="text">
<string>GB</string>
</property>
Expand Down Expand Up @@ -400,6 +436,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="accessibleName">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
Expand Down Expand Up @@ -465,7 +504,7 @@
</size>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Size will be rounded down to integral percent of total storage size (%1MB)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>Size will be rounded down to integral percent of total storage size (%1MB)</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -515,18 +554,21 @@
</layout>
</widget>
<tabstops>
<tabstop>l_top_instructions</tabstop>
<tabstop>l_instructions</tabstop>
<tabstop>HVPasswordEdit</tabstop>
<tabstop>HVPasswordEdit_2</tabstop>
<tabstop>ShowPasswordCheckBox</tabstop>
<tabstop>comboBox</tabstop>
<tabstop>l_sd_size</tabstop>
<tabstop>rd_percent</tabstop>
<tabstop>rd_MB</tabstop>
<tabstop>rd_GB</tabstop>
<tabstop>StartBlockSpin</tabstop>
<tabstop>EndBlockSpin</tabstop>
</tabstops>
<resources>
<include location="../resources.qrc"/>
<include location="../../resources.qrc"/>
</resources>
<connections/>
</ui>

0 comments on commit 3a1140d

Please sign in to comment.