]> Shamusworld >> Repos - virtualjaguar/commitdiff
More incremental improvements to the "Insert Cart" dialog...
authorShamus Hammons <jlhamm@acm.org>
Mon, 8 Mar 2010 20:46:29 +0000 (20:46 +0000)
committerShamus Hammons <jlhamm@acm.org>
Mon, 8 Mar 2010 20:46:29 +0000 (20:46 +0000)
res/cart-blank.png
res/label-blank.png
src/gui/about.cpp
src/gui/filepicker.cpp
src/gui/imagedelegate.cpp
src/gui/imagedelegate.h

index 93338b8d87044ecaccd73f86402a15e0be3a9c23..fe8c575e5872504eed2f65782966b9daa4d8e4bc 100644 (file)
Binary files a/res/cart-blank.png and b/res/cart-blank.png differ
index 8605f745e96608354b7217db41eb82eb23885f7c..46538f60c284bbc4d95b739282ad3c0245522b95 100644 (file)
Binary files a/res/label-blank.png and b/res/label-blank.png differ
index 5a3c02ce9fd539c817013622be0f8f8cc68fe040..dc8a93a1d5b28c645c5c4038317ec1d2daad22f6 100644 (file)
@@ -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);
index f64257126750898659b6586cff9dbb04b1d1d76b..8d9afb38f79045e910f0104761f942b21723c489 100644 (file)
@@ -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(
+               "<h2>Attack of the Mutant Penguins (World)</h2>"
+       )));
+       text1->setMargin(6);
+       text1->setAlignment(Qt::AlignCenter);
+       vLayout->addWidget(text1);
+
+       QLabel * text2 = new QLabel(QString(tr(
+               "<table>"
+               "<tr><td align='right'><b>Type: </b></td><td>4MB Cartridge</td></tr>"
+               "<tr><td align='right'><b>CRC32: </b></td><td>FEDCBA98</td></tr>"
+               "<tr><td align='right'><b>Compatibility: </b></td><td>DOES NOT WORK</td></tr>"
+               "<tr><td align='right'><b>Notes: </b></td><td>Universal Header detected; Requires DSP</td></tr>"
+               "</table>"
+       )));
+       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
+
+
+*/
+
+
index f7dfa9b1d5603fbb49a0ea8507ea25522845b2fe..6d81005b7c19924164f3e154d47c1dd53af27e8b 100644 (file)
 #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:
index 78d07dcf7f42e4d1a0e46ad7af604a5a7b6d93c1..303e9255e44c176e1aa2aef863b802294e4ff484 100644 (file)
@@ -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__