Commits

Anonymous committed 8c9d927

Fix for effect's On/Off button bug introduced in previous commit

  • Participants
  • Parent commits 1e24978

Comments (0)

Files changed (3)

File plug/effect.cpp

 
 void Effect::choose_fx(int value)
 {
+    QSettings settings;
+    effect_num = value;
+    set_changed(true);
+
     ui->comboBox->setCurrentIndex(value);
     if(value != 0)
         ((MainWindow*)parent())->empty_other(value, this);
 
-    QSettings settings;
-    effect_num = value;
-    set_changed(true);
-
     // activate proper knobs and set their max values
     switch (value)
     {
         ui->pushButton->setText(tr("On"));
         ui->comboBox->setDisabled(true);
         ui->setButton->setDisabled(true);
-        // all other are disabled by setting effect to EMPTY
-        choose_fx(EMPTY);
+        ui->dial->setDisabled(true);
+        ui->dial_2->setDisabled(true);
+        ui->dial_3->setDisabled(true);
+        ui->dial_4->setDisabled(true);
+        ui->dial_5->setDisabled(true);
+        ui->dial_6->setDisabled(true);
+        ui->spinBox->setDisabled(true);
+        ui->spinBox_2->setDisabled(true);
+        ui->spinBox_3->setDisabled(true);
+        ui->spinBox_4->setDisabled(true);
+        ui->spinBox_5->setDisabled(true);
+        ui->spinBox_6->setDisabled(true);
+        ui->checkBox->setDisabled(true);
+        ui->label->setDisabled(true);
+        ui->label_2->setDisabled(true);
+        ui->label_3->setDisabled(true);
+        ui->label_4->setDisabled(true);
+        ui->label_5->setDisabled(true);
+        ui->label_6->setDisabled(true);
+        ui->label_7->setDisabled(true);
+        effect_num = 0;
     }
     else
     {
         ui->pushButton->setText(tr("Off"));
         ui->comboBox->setDisabled(false);
         ui->setButton->setDisabled(false);
-        choose_fx(ui->comboBox->currentIndex());
+        ui->dial->setDisabled(false);
+        ui->dial_2->setDisabled(false);
+        ui->dial_3->setDisabled(false);
+        ui->dial_4->setDisabled(false);
+        ui->dial_5->setDisabled(false);
+        ui->dial_6->setDisabled(false);
+        ui->spinBox->setDisabled(false);
+        ui->spinBox_2->setDisabled(false);
+        ui->spinBox_3->setDisabled(false);
+        ui->spinBox_4->setDisabled(false);
+        ui->spinBox_5->setDisabled(false);
+        ui->spinBox_6->setDisabled(false);
+        ui->checkBox->setDisabled(false);
+        ui->label->setDisabled(false);
+        ui->label_2->setDisabled(false);
+        ui->label_3->setDisabled(false);
+        ui->label_4->setDisabled(false);
+        ui->label_5->setDisabled(false);
+        ui->label_6->setDisabled(false);
+        ui->label_7->setDisabled(false);
+        effect_num = ui->comboBox->currentIndex();
         activateWindow();
     }
     set_changed(true);

File plug/effect.ui

           <height>0</height>
          </size>
         </property>
+        <property name="maxVisibleItems">
+         <number>15</number>
+        </property>
         <item>
          <property name="text">
           <string>None</string>

File plug/library.cpp

     ui->listWidget->setFont(font);
     ui->listWidget_2->setFont(font);
 
+    ui->spinBox->setValue(font.pointSize());
+    ui->fontComboBox->setCurrentFont(font);
+
     for(int i = 0; i < 24; i++)
     {
         ui->listWidget->addItem(QString("%1").arg(names[i]));
     }
 
-    ui->spinBox->setValue(font.pointSize());
-    ui->fontComboBox->setCurrentFont(font);
-
     connect(ui->listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(load_slot(int)));
     connect(ui->listWidget_2, SIGNAL(currentRowChanged(int)), this, SLOT(load_file(int)));
     connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(get_directory()));
 {
     if(slot < 0)
         return;
+
     ui->listWidget_2->setCurrentRow(-1);
     ((MainWindow*)parent())->load_from_amp(slot);
 }
 void Library::get_directory()
 {
     QSettings settings;
-    QString directory = QFileDialog::getExistingDirectory(this, QString(tr("Choose directory")), QDir::homePath());
+
+    QString directory = QFileDialog::getExistingDirectory(this, QString(tr("Choose directory")), settings.value("Library/lastDirectory", QString(QDir::homePath())).toString());
+
+    if(directory.isEmpty())
+        return;
+
     settings.setValue("Library/lastDirectory", directory);
     emit directory_changed(directory);
 }
 {
     if(row < 0)
         return;
+
     ui->listWidget->setCurrentRow(-1);
     ((MainWindow*)parent())->loadfile((*files)[row].canonicalFilePath());
 }
 {
     QSettings settings;
     QFont font(ui->listWidget_2->font());
+
     font.setPointSize(value);
     ui->listWidget->setFont(font);
     ui->listWidget_2->setFont(font);