Changeset ba525df in subsurface


Ignore:
Timestamp:
Jan 20, 2015, 9:03:18 PM (3 years ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
Mtest, android_test, dcDownload, foratdotde, gitMerge, gitdebug, gitpictures, ios, master, mergeKirigamiPort, pictimeshift, resolutionIndependence, spinner, testTomaz, testing, v4.4-branch, v4.5-branch
Children:
1d67bae
Parents:
0787d941
git-author:
Anton Lundin <glance@…> (01/20/15 13:40:50)
git-committer:
Dirk Hohndel <dirk@…> (01/20/15 21:03:18)
Message:

Use a progressbar in the configure dc dialog

This switches from a couple of labels in the dialog to a progress bar,
to later being able to use it to provide better user experience.

Signed-off-by: Anton Lundin <glance@…>
Signed-off-by: Dirk Hohndel <dirk@…>

Location:
qt-ui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • qt-ui/configuredivecomputerdialog.cpp

    r02d8dd5d rba525df  
    671671void ConfigureDiveComputerDialog::readSettings()
    672672{
    673         ui.statusLabel->clear();
    674         ui.errorLabel->clear();
     673        // Disable the retrieve button while read thread is running
     674        ui.progressBar->setValue(0);
     675        ui.progressBar->setFormat("%p%");
     676        ui.progressBar->setTextVisible(true);
    675677
    676678        getDeviceData();
     
    680682void ConfigureDiveComputerDialog::resetSettings()
    681683{
    682         ui.statusLabel->clear();
    683         ui.errorLabel->clear();
     684        ui.progressBar->setValue(0);
     685        ui.progressBar->setFormat("%p%");
     686        ui.progressBar->setTextVisible(true);
    684687
    685688        getDeviceData();
     
    689692void ConfigureDiveComputerDialog::configMessage(QString msg)
    690693{
    691         ui.statusLabel->setText(msg);
     694        ui.progressBar->setFormat(msg);
    692695}
    693696
    694697void ConfigureDiveComputerDialog::configError(QString err)
    695698{
    696         ui.statusLabel->setText("");
    697         ui.errorLabel->setText(err);
     699        ui.progressBar->setFormat("Error: " + err);
    698700}
    699701
     
    717719void ConfigureDiveComputerDialog::on_saveSettingsPushButton_clicked()
    718720{
     721        ui.progressBar->setValue(0);
     722        ui.progressBar->setFormat("%p%");
     723        ui.progressBar->setTextVisible(true);
     724
    719725        populateDeviceDetails();
    720726        getDeviceData();
     
    10591065                                                            filename, tr("All files (*.*)"));
    10601066        if (!firmwarePath.isEmpty()) {
     1067                ui.progressBar->setValue(0);
     1068                ui.progressBar->setFormat("%p%");
     1069                ui.progressBar->setTextVisible(true);
     1070
    10611071                getDeviceData();
    10621072                config->startFirmwareUpdate(firmwarePath, &device_data);
  • qt-ui/configuredivecomputerdialog.ui

    rf72ec5e rba525df  
    23742374   </item>
    23752375   <item>
    2376     <widget class="QLabel" name="errorLabel">
    2377      <property name="styleSheet">
    2378       <string notr="true">color: rgb(242, 19, 25);</string>
     2376    <widget class="QProgressBar" name="progressBar">
     2377     <property name="value">
     2378      <number>0</number>
    23792379     </property>
    2380      <property name="text">
    2381       <string/>
    2382      </property>
    2383     </widget>
    2384    </item>
    2385    <item>
    2386     <widget class="QLabel" name="statusLabel">
    2387      <property name="text">
     2380     <property name="format">
    23882381      <string/>
    23892382     </property>
Note: See TracChangeset for help on using the changeset viewer.