From: Shamus Hammons Date: Mon, 8 Mar 2010 20:46:29 +0000 (+0000) Subject: More incremental improvements to the "Insert Cart" dialog... X-Git-Tag: 2.0.0~34^2~32 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0231914da63ed8c44751d7c7ef07f8e311ae0db1;hp=caf1236884015695c52910a75b8420be7c63d574;p=virtualjaguar More incremental improvements to the "Insert Cart" dialog... --- diff --git a/res/cart-blank.png b/res/cart-blank.png index 93338b8..fe8c575 100644 Binary files a/res/cart-blank.png and b/res/cart-blank.png differ diff --git a/res/label-blank.png b/res/label-blank.png index 8605f74..46538f6 100644 Binary files a/res/label-blank.png and b/res/label-blank.png differ diff --git a/src/gui/about.cpp b/src/gui/about.cpp index 5a3c02c..dc8a93a 100644 --- a/src/gui/about.cpp +++ b/src/gui/about.cpp @@ -20,7 +20,7 @@ AboutWindow::AboutWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog) { - setWindowTitle("About Virtual Jaguar..."); + setWindowTitle(tr("About Virtual Jaguar...")); layout = new QVBoxLayout(); layout->setSizeConstraint(QLayout::SetFixedSize); diff --git a/src/gui/filepicker.cpp b/src/gui/filepicker.cpp index f642571..8d9afb3 100644 --- a/src/gui/filepicker.cpp +++ b/src/gui/filepicker.cpp @@ -50,16 +50,53 @@ FilePickerWindow::FilePickerWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt: model = new FileListModel; fileList = new QListView; fileList->setModel(model); - fileList->setItemDelegate(new ImageDelegate(this)); +// fileList->setItemDelegate(new ImageDelegate(this)); + fileList->setItemDelegate(new ImageDelegate()); - QVBoxLayout * layout = new QVBoxLayout; +// QVBoxLayout * layout = new QVBoxLayout; + QHBoxLayout * layout = new QHBoxLayout; setLayout(layout); layout->addWidget(fileList); + // Weird note: This layout has to be added *before* putting anything into it... + QVBoxLayout * vLayout = new QVBoxLayout; + layout->addLayout(vLayout); + + QLabel * image = new QLabel; +// image->setAlignment(Qt::AlignRight); +// image->setPixmap(QPixmap(":/res/cart-blank.png")); + QImage cartImg(":/res/cart-blank.png"); + QPainter painter(&cartImg); + painter.drawPixmap(23, 87, 373, 172, QPixmap(":/res/label-blank.png")); + painter.end(); + image->setPixmap(QPixmap::fromImage(cartImg)); + image->setMargin(4); + vLayout->addWidget(image); + + QLabel * text1 = new QLabel(QString(tr( + "

Attack of the Mutant Penguins (World)

" + ))); + text1->setMargin(6); + text1->setAlignment(Qt::AlignCenter); + vLayout->addWidget(text1); + + QLabel * text2 = new QLabel(QString(tr( + "" + "" + "" + "" + "" + "
Type: 4MB Cartridge
CRC32: FEDCBA98
Compatibility: DOES NOT WORK
Notes: Universal Header detected; Requires DSP
" + ))); + vLayout->addWidget(text2); + fileThread = new FileThread(this); // connect(fileThread, SIGNAL(FoundAFile(unsigned long)), this, SLOT(AddFileToList(unsigned long))); connect(fileThread, SIGNAL(FoundAFile2(unsigned long, QString, QImage *)), this, SLOT(AddFileToList2(unsigned long, QString, QImage *))); fileThread->Go(); +/* +New sizes: 373x172 (label), 420x340 (cart) +*/ } // @@ -83,3 +120,31 @@ printf("FilePickerWindow(2): Found match [%s]...\n", romList[index].name); model->AddData(index, str, QImage()); } +/* + Super Duper Awesome Guy (World) + + Type: 4MB Cartridge + CRC32: FEDCBA98 +Compatibility: DOES NOT WORK + Notes: Universal Header detected; Requires DSP + + + Stupid Homebrew Game That Sux + + Type: ABS/COF Executable (43853 bytes) + CRC32: 76543210 +Compatibility: Unknown + Notes: $4000 Load, $4000 Run + + + Action Hopscotch Plus (Prototype) + + Type: 2MB Alpine ROM + CRC32: 44889921 +Compatibility: 80% (or ****) + Notes: EEPROM available + + +*/ + + diff --git a/src/gui/imagedelegate.cpp b/src/gui/imagedelegate.cpp index f7dfa9b..6d81005 100644 --- a/src/gui/imagedelegate.cpp +++ b/src/gui/imagedelegate.cpp @@ -17,12 +17,11 @@ #include "imagedelegate.h" #include "filedb.h" -//#include "filelistmodel.h" -ImageDelegate::ImageDelegate(QObject * parent): QAbstractItemDelegate(parent), pixelSize(12) -{ -} +//ImageDelegate::ImageDelegate(QObject * parent): QAbstractItemDelegate(parent)//, pixelSize(12) +//{ +//} /* Each item is rendered by the delegate's paint() function. The view calls this function with a ready-to-use QPainter object, style information that the delegate should use to correctly draw the item, and an index to the item in the model: diff --git a/src/gui/imagedelegate.h b/src/gui/imagedelegate.h index 78d07dc..303e925 100644 --- a/src/gui/imagedelegate.h +++ b/src/gui/imagedelegate.h @@ -12,7 +12,7 @@ class ImageDelegate: public QAbstractItemDelegate // Q_OBJECT public: - ImageDelegate(QObject * parent = 0); +// ImageDelegate(QObject * parent = 0); void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index ) const; @@ -20,8 +20,8 @@ class ImageDelegate: public QAbstractItemDelegate // public slots: // void setPixelSize(int size); - private: - int pixelSize; +// private: +// int pixelSize; }; #endif // __IMAGEDELEGATE_H__