Changeset 9332363


Ignore:
Timestamp:
04/08/15 07:58:22 (4 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, enter/10, releng/10.1.2
Children:
f55f138, cd95bf4
Parents:
3ffa2ff
Message:

Clean up the UI-interactivity for scrub changes.

Location:
src-qt5/life-preserver/lp-gui
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src-qt5/life-preserver/lp-gui/LPConfig.cpp

    r2cec0c3 r9332363  
    1515  connect(ui->tool_cancel,SIGNAL(clicked()), this, SLOT(slotCancelConfig()) ); 
    1616  connect(ui->push_scanNetwork, SIGNAL(clicked()), this, SLOT(autoDetectReplicationTargets()) ); 
     17  connect(ui->groupScrub, SIGNAL(toggled(bool)), this, SLOT(UpdateScrubUI()) ); 
     18  connect(ui->combo_scrub_schedule, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateScrubUI()) ); 
    1719} 
    1820 
     
    9799  } 
    98100  ui->time_scrub->setTime( QTime(scrubTime, 0) ); 
    99  
     101   
    100102  // - Replication settings 
    101103  ui->groupReplicate->setChecked(isReplicated); 
     
    121123  //Now update the visibility of items appropriately 
    122124  on_combo_local_schedule_currentIndexChanged(ui->combo_local_schedule->currentIndex()); 
    123   on_combo_scrub_schedule_currentIndexChanged(ui->combo_scrub_schedule->currentIndex()); 
    124125  on_combo_remote_schedule_currentIndexChanged(ui->combo_remote_schedule->currentIndex()); 
     126  UpdateScrubUI(); 
    125127} 
    126128 
     
    268270} 
    269271 
    270 void LPConfig::on_combo_scrub_schedule_currentIndexChanged(int index){ 
     272void LPConfig::UpdateScrubUI(){ 
     273  int index = ui->combo_scrub_schedule->currentIndex(); 
     274  bool active = ui->groupScrub->isChecked(); 
    271275  //Adjust whether the day of week box is enabled 
    272   ui->combo_scrub_day_week->setEnabled( (index == 1) ); 
    273   ui->combo_scrub_day_week->setDisabled( (index != 1) ); 
     276  ui->combo_scrub_day_week->setEnabled( (index == 1) && active); 
    274277  //Adjust whether the day of month box is enabled 
    275   ui->spin_scrub_day_month->setEnabled( (index == 2) ); 
    276   ui->spin_scrub_day_month->setDisabled( (index != 2) ); 
     278  ui->spin_scrub_day_month->setEnabled( (index == 2) && active); 
     279  // Always make time box enabled 
     280  ui->time_scrub->setEnabled(active); 
    277281} 
    278282 
  • src-qt5/life-preserver/lp-gui/LPConfig.h

    r2cec0c3 r9332363  
    3838        void slotCancelConfig(); 
    3939        void on_combo_local_schedule_currentIndexChanged(int); 
    40         void on_combo_scrub_schedule_currentIndexChanged(int); 
     40        void UpdateScrubUI(); 
    4141        void on_combo_remote_schedule_currentIndexChanged(int index); 
    4242        void autoDetectReplicationTargets(); 
  • src-qt5/life-preserver/lp-gui/LPConfig.ui

    r3e28cbb r9332363  
    4545    <widget class="QTabWidget" name="tabWidget"> 
    4646     <property name="currentIndex"> 
    47       <number>2</number> 
     47      <number>0</number> 
    4848     </property> 
    4949     <widget class="QWidget" name="tab_local"> 
  • src-qt5/life-preserver/lp-gui/LPWizard.cpp

    rd12810a r9332363  
    99  connect(this,SIGNAL(rejected()),this,SLOT(slotCancelled()) ); 
    1010  connect(ui->push_scanNetwork, SIGNAL(clicked()), this, SLOT(scanNetwork()) ); 
     11  connect(ui->combo_scrub_schedule, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateScrubUI()) ); 
     12  connect(ui->groupScrub, SIGNAL(toggled(bool)), this, SLOT(UpdateScrubUI()) ); 
     13  UpdateScrubUI(); 
    1114} 
    1215 
     
    109112} 
    110113 
    111 void LPWizard::on_combo_scrub_schedule_currentIndexChanged(int index){ 
     114void LPWizard::UpdateScrubUI(){ 
     115  int index = ui->combo_scrub_schedule->currentIndex(); 
     116  bool active = ui->groupScrub->isChecked(); 
    112117  //Adjust whether the day of week box is enabled 
    113   ui->combo_scrub_day_week->setEnabled( (index == 1) ); 
    114   ui->combo_scrub_day_week->setDisabled( (index != 1) ); 
     118  ui->combo_scrub_day_week->setEnabled( (index == 1) && active); 
    115119  //Adjust whether the day of month box is enabled 
    116   ui->spin_scrub_day_month->setEnabled( (index == 2) ); 
    117   ui->spin_scrub_day_month->setDisabled( (index != 2) ); 
     120  ui->spin_scrub_day_month->setEnabled( (index == 2) && active); 
    118121  // Always make time box enabled 
    119   ui->time_scrub->setEnabled(true); 
     122  ui->time_scrub->setEnabled(active); 
    120123} 
    121124 
  • src-qt5/life-preserver/lp-gui/LPWizard.h

    r2cec0c3 r9332363  
    3838        void scanNetwork(); 
    3939        void on_combo_remote_freq_currentIndexChanged(int index); 
    40         void on_combo_scrub_schedule_currentIndexChanged(int index); 
     40        void UpdateScrubUI(); 
    4141}; 
    4242 
Note: See TracChangeset for help on using the changeset viewer.