X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fgui%2Ffilepicker.cpp;h=e8a44d1bad7ea9d88d32fb99bd71fa06170afdff;hb=09adab3161f986d5cc8dbeffe15cb6545afa138f;hp=2280f82202c10b55798cc9aaadec4af6c30a4127;hpb=be0b102eec76acf80acce7cd3de8e690e27564d4;p=virtualjaguar diff --git a/src/gui/filepicker.cpp b/src/gui/filepicker.cpp index 2280f82..e8a44d1 100644 --- a/src/gui/filepicker.cpp +++ b/src/gui/filepicker.cpp @@ -13,6 +13,10 @@ #include "filepicker.h" +#include "crc32.h" +#include "filelistmodel.h" +#include "filethread.h" +#include "settings.h" #include "types.h" struct RomIdentifier @@ -22,7 +26,7 @@ struct RomIdentifier const char file[128]; }; -RomIdentifier romList[] = { +RomIdentifier romList2[] = { { 0x0509C85E, "Raiden (World)", "" }, { 0x08F15576, "Iron Soldier (World) (v1.04)", "" }, { 0x0957A072, "Kasumi Ninja (World)", "" }, @@ -98,5 +102,87 @@ in romList for future reference. When constructing the list, use the index to pull up an image of the cart and put that in the list. User picks from a graphical image of the cart. + +Ideally, the label will go into the archive along with the ROM image, but that's +for the future... +Maybe box art, screenshots will go as well... */ +//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