Commits

Leyorus  committed b53fec0

Fix wrong button enable/disable when reloading a file and or cancel extraction

  • Participants
  • Parent commits 9c33677

Comments (0)

Files changed (2)

File src/gtk-gui/MainWindow.cpp

     return source;
 }
 
+void MainWindow::checkUserSelection()
+{
+    if(isATrackSelected()){
+        extractOrPauseButton.set_sensitive(true);
+    }else{
+        if(!this->isExtracting()){
+            extractOrPauseButton.set_sensitive(false);
+        }
+    }
+
+}
+
 void MainWindow::onCheckboxClicked(Glib::ustring str) {
 	Gtk::TreeModel::Path path(str.c_str());
 	Gtk::TreeModel::Row row = *(refListStore->get_iter(path));
 	tracksToExtract[row[m_Columns.m_col_id]] = !tracksToExtract[row[m_Columns.m_col_id]];
-	if (isATrackSelected()) {
-		extractOrPauseButton.set_sensitive(true);
-	} else {
-		if(!this->isExtracting()) {
-			extractOrPauseButton.set_sensitive(false);
-		}
-	}
+    checkUserSelection();
 }
 
 bool MainWindow::isATrackSelected() {
 
 bool MainWindow::isExtracting() {
 	pthread_mutex_lock(&this->extraction_status_mutex);
-	bool ret = (current_state == extracting_status);
+	bool ret = (current_state == extracting_status || current_state == paused_status);
 	pthread_mutex_unlock(&this->extraction_status_mutex);
 	return ret;
 }
 	} else {
 
 	}
-
+	checkUserSelection();
 }
 
 
 
 	outputFileButton.set_current_folder(dirName(getInputFileName()));
 	labelStatus.set_text(statusLabelTextChooseTracks);
+
+	checkUserSelection();
 }
 
 void MainWindow::initTime() {

File src/gtk-gui/MainWindow.h

 	sigc::connection con;
 	bool verbose;
 
-	void showIconOnButton();
+	void checkUserSelection();
+    void showIconOnButton();
     void startExtraction();
 	bool stopExtraction();
 	void pauseExtraction();