traverso-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-commit] traverso/src/traverso ExportWidget.cpp


From: Ben Levitt
Subject: [Traverso-commit] traverso/src/traverso ExportWidget.cpp
Date: Wed, 23 May 2007 20:32:47 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Ben Levitt <benjie>     07/05/23 20:32:47

Modified files:
        src/traverso   : ExportWidget.cpp 

Log message:
        save cd burning device in config

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/ExportWidget.cpp?cvsroot=traverso&r1=1.38&r2=1.39

Patches:
Index: ExportWidget.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/ExportWidget.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- ExportWidget.cpp    23 May 2007 17:51:45 -0000      1.38
+++ ExportWidget.cpp    23 May 2007 20:32:47 -0000      1.39
@@ -29,6 +29,7 @@
 #include <QMessageBox>
 
 #include "Export.h"
+#include "Config.h"
 #include <AudioDevice.h>
 
 
@@ -384,7 +385,6 @@
        }
        
        m_writingState = QUERY_DEVICE;
-       cdDeviceComboBox->clear();
 #if defined (Q_WS_WIN)
        m_burnprocess->start(CDRDAO_BIN, QStringList() << "scanbus");
 #elif defined (OSX_BUILD)
@@ -443,6 +443,11 @@
        }
        
        cd_render();
+       
+       int index = cdDeviceComboBox->currentIndex();
+       if (index != -1 && cdDeviceComboBox->itemData(index) != 
QVariant::Invalid) {
+               config().set_property("Cdrdao", "drive", 
cdDeviceComboBox->itemData(index));
+       }
 }
 
 
@@ -640,6 +645,10 @@
        
        if (m_writingState == QUERY_DEVICE) {
                char buf[1024];
+               int previousIndex = cdDeviceComboBox->currentIndex();
+
+               cdDeviceComboBox->clear();
+
                while(m_burnprocess->readLine(buf, sizeof(buf)) != -1) {
                        QString data = QString(buf);
                        //printf("%s\n", QS_C(data));
@@ -680,6 +689,19 @@
                cdDeviceComboBox->addItem("IOCompactDiscServices");
                cdDeviceComboBox->addItem("IOCompactDiscServices/2");
 #endif
+               // If combo box was empty, set it to saved drive.  Else, keep 
it on previously selected drive
+               if (previousIndex == -1) {
+                       QString cdrdaoDrive = config().get_property("Cdrdao", 
"drive", "").toString();
+                       if (cdrdaoDrive != "") {
+                               int index = 
cdDeviceComboBox->findData(cdrdaoDrive);
+                               if (index != -1) {
+                                       
cdDeviceComboBox->setCurrentIndex(index);
+                               }
+                       }
+               } else {
+                       cdDeviceComboBox->setCurrentIndex(previousIndex);
+               }
+               
                update_cdburn_status(tr("Information"), NORMAL_MESSAGE);
                
                return;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]