+//FilePickerWindow::FilePickerWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog)//could use Window as well...
+FilePickerWindow::FilePickerWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Window)
+{
+ setWindowTitle("Insert Cartridge...");
+
+#if 1
+ fileList2 = new QListWidget(this);
+// addWidget(fileList);
+
+ QVBoxLayout * layout = new QVBoxLayout();
+// layout->setSizeConstraint(QLayout::SetFixedSize);
+ setLayout(layout);
+
+ layout->addWidget(fileList2);
+
+// PopulateList();
+ fileThread = new FileThread(this);
+
+ /*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);
+ QFileInfoList list = romDir.entryInfoList();
+
+ for(int i=0; i<list.size(); i++)
+ {
+ QFileInfo fileInfo = list.at(i);
+// std::cout << qPrintable(QString("%1 %2").arg(fileInfo.size(), 10)
+// .arg(fileInfo.fileName()));
+// std::cout << std::endl;
+ QFile file(romDir.filePath(fileInfo.fileName()));
+ uint8 * buffer = new uint8[fileInfo.size()];
+
+ if (file.open(QIODevice::ReadOnly))
+ {
+ file.read((char *)buffer, fileInfo.size());
+ uint32 crc = crc32_calcCheckSum(buffer, fileInfo.size());
+ file.close();
+//printf("FilePickerWindow: File crc == %08X...\n", crc);
+
+ for(int j=0; romList2[j].crc32 != 0xFFFFFFFF; j++)
+ {
+ if (romList2[j].crc32 == crc)
+ {
+printf("FilePickerWindow: Found match [%s]...\n", romList2[j].name);
+ new QListWidgetItem(QIcon(":/res/generic.png"), romList2[j].name, fileList);
+ break;
+ }
+ }
+ }
+
+ delete[] buffer;
+ }
+}
+*/