Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Merge branch '5-consolidate_layout'
Browse files Browse the repository at this point in the history
UI corrections

Fixes #5
  • Loading branch information
szszszsz committed Jun 14, 2018
2 parents 008419e + cdecfcc commit 6e150c8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 106 deletions.
34 changes: 3 additions & 31 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ QString WELCOME = "Copyright 2018 Nitrokey UG (https://www.nitrokey.com). \n"
;
QString WELCOME2 = "This tool allows to update Nitrokey Storage's firmware. "
"<ol><li>1. Please select "
"<I>Configure -> Enable Firmware Update</I> in the Nitrokey App (select <i>Links menu->Nitrokey App</i> to open download site), </li>"
"<li>2. Download the .hex file of the latest firmware version (select <i>Links menu->Nitrokey Storage firmware</i> to open download site), </li>"
"<I>Configure -> Enable Firmware Update</I> in the Nitrokey App, </li>"
"<li>2. Download the .hex file of the latest firmware version, </li>"
"<li>3. Select the firmware file with 'Select firmware file',"
"<li>4. Start the procedure by pressing 'Update firmware' button."
"</ol>"
Expand Down Expand Up @@ -113,7 +113,6 @@ void MainWindow::timer_device_count(){
state.device_connected.update_mode = connection.count_devices_in_update_mode() > 0;
state.device_connected.production_mode = connection.count_devices_in_production_mode() > 0;

ui->cb_device_connected->setChecked(state.device_connected.update_mode);
if (last_status != state.device_connected_raw){
if(state.device_connected.production_mode && !state.finished_with_success){
logUI("Nitrokey Storage detected in Production mode. Please enable Firmware Update mode in Nitrokey App first (Configure -> Enable Firmware Update).");
Expand Down Expand Up @@ -143,8 +142,7 @@ void MainWindow::on_btn_select_file_clicked()
state.firmware_file.selected = launchInThread([&filename](){
QFileInfo check_file(filename);
return check_file.exists() && check_file.isFile();
});
ui->cb_file_selected->setChecked(state.firmware_file.selected);
});
logUI("Set file " + filename);
}

Expand Down Expand Up @@ -327,32 +325,6 @@ void MainWindow::on_actionAbout_triggered()
a.exec();
}

#include <QDesktopServices>
void MainWindow::on_actionNitrokey_Update_Tool_triggered()
{
QDesktopServices::openUrl(QUrl("https://github.com/Nitrokey/nitrokey-update-tool/releases"));
}

void MainWindow::on_actionNitrokey_Storage_firmware_triggered()
{
QDesktopServices::openUrl(QUrl("https://github.com/Nitrokey/nitrokey-storage-firmware/releases"));
}

void MainWindow::on_actionNitrokey_App_triggered()
{
QDesktopServices::openUrl(QUrl("https://github.com/Nitrokey/nitrokey-app/releases"));
}

void MainWindow::on_actionNitrokey_com_triggered()
{
QDesktopServices::openUrl(QUrl("https://www.nitrokey.com"));
}

void MainWindow::on_actionNitrokey_Support_Forum_triggered()
{
QDesktopServices::openUrl(QUrl("https://support.nitrokey.com/c/nitrokey-support"));
}

void MainWindow::on_btn_quit_clicked()
{
QApplication::quit();
Expand Down
11 changes: 0 additions & 11 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ private slots:
void on_btn_select_file_clicked();

void on_actionAbout_triggered();

void on_actionNitrokey_Update_Tool_triggered();

void on_actionNitrokey_Storage_firmware_triggered();

void on_actionNitrokey_App_triggered();

void on_actionNitrokey_com_triggered();

void on_actionNitrokey_Support_Forum_triggered();

void on_btn_quit_clicked();

private:
Expand Down
79 changes: 15 additions & 64 deletions mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>898</width>
<height>478</height>
<width>781</width>
<height>456</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -41,41 +41,28 @@
<property name="title">
<string>Status</string>
</property>
<layout class="QFormLayout" name="formLayout">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QCheckBox" name="cb_file_selected">
<property name="enabled">
<bool>false</bool>
</property>
<widget class="QPushButton" name="btn_update">
<property name="text">
<string>Firmware file selected</string>
</property>
<property name="checkable">
<bool>true</bool>
<string>Update firmware</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="cb_device_connected">
<property name="enabled">
<bool>false</bool>
</property>
<item row="0" column="1">
<widget class="QLabel" name="l_instructions_link">
<property name="text">
<string>Device in update mode connected</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://www.nitrokey.com/en/documentation/firmware-update-storage&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Instructions and firmware&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="checkable">
<bool>true</bool>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="btn_update">
<property name="text">
<string>Update firmware</string>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="1" column="0">
<widget class="QPushButton" name="btn_quit">
<property name="text">
<string>Quit</string>
Expand Down Expand Up @@ -120,7 +107,7 @@
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Progress</string>
<string>Progress:</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -173,7 +160,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>898</width>
<width>781</width>
<height>20</height>
</rect>
</property>
Expand All @@ -184,18 +171,7 @@
<addaction name="actionAbout"/>
<addaction name="actionQuit"/>
</widget>
<widget class="QMenu" name="menuLinks">
<property name="title">
<string>Links</string>
</property>
<addaction name="actionNitrokey_App"/>
<addaction name="actionNitrokey_Storage_firmware"/>
<addaction name="actionNitrokey_Update_Tool"/>
<addaction name="actionNitrokey_com"/>
<addaction name="actionNitrokey_Support_Forum"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuLinks"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<action name="actionQuit">
Expand All @@ -208,31 +184,6 @@
<string>About</string>
</property>
</action>
<action name="actionNitrokey_App">
<property name="text">
<string>Nitrokey App</string>
</property>
</action>
<action name="actionNitrokey_Storage_firmware">
<property name="text">
<string>Nitrokey Storage firmware</string>
</property>
</action>
<action name="actionNitrokey_Update_Tool">
<property name="text">
<string>Nitrokey Update Tool</string>
</property>
</action>
<action name="actionNitrokey_com">
<property name="text">
<string>Nitrokey.com</string>
</property>
</action>
<action name="actionNitrokey_Support_Forum">
<property name="text">
<string>Nitrokey Support Forum</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
Expand Down

0 comments on commit 6e150c8

Please sign in to comment.