]> Shamusworld >> Repos - virtualjaguar/blobdiff - src/gui/filepicker.cpp
More ROM picker refinements...
[virtualjaguar] / src / gui / filepicker.cpp
index 13cc4d1ad11b08863b36e8dd42616dbfd78d9bde..e8a44d1bad7ea9d88d32fb99bd71fa06170afdff 100644 (file)
@@ -14,6 +14,7 @@
 #include "filepicker.h"
 
 #include "crc32.h"
+#include "filelistmodel.h"
 #include "filethread.h"
 #include "settings.h"
 #include "types.h"
@@ -112,20 +113,43 @@ FilePickerWindow::FilePickerWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt:
 {
        setWindowTitle("Insert Cartridge...");
 
-       fileList = new QListWidget(this);
+#if 1
+       fileList2 = new QListWidget(this);
 //     addWidget(fileList);
 
        QVBoxLayout * layout = new QVBoxLayout();
 //     layout->setSizeConstraint(QLayout::SetFixedSize);
        setLayout(layout);
 
-       layout->addWidget(fileList);
+       layout->addWidget(fileList2);
 
 //     PopulateList();
        fileThread = new FileThread(this);
-       fileThread->Go(fileList);
+
+       /*bool b =*/ connect(fileThread, SIGNAL(FoundAFile(unsigned long)), this, SLOT(AddFileToList(unsigned long)));
+//printf("FilePickerWindow: Connection to FileThread %s...\n", (b ? "succeeded" : "failed"));
+
+       fileThread->Go(fileList2);
+#else
+QStringList numbers;
+numbers << "One" << "Two" << "Three" << "Four" << "Five";
+
+QAbstractItemModel * model = new StringListModel(numbers);
+QListView * view = new QListView;
+view->setModel(model);
+
+#endif
+}
+
+// Need a slot here to pickup stuff from the thread...
+
+void FilePickerWindow::AddFileToList(unsigned long index)
+{
+       printf("--> Found CRC: %08X...\n", (uint32)index);
 }
 
+
+/*
 void FilePickerWindow::PopulateList(void)
 {
        QDir romDir(vjs.ROMPath);
@@ -161,4 +185,4 @@ printf("FilePickerWindow: Found match [%s]...\n", romList2[j].name);
                delete[] buffer;
        }
 }
-
+*/