Diffstat (limited to 'noncore/games/fifteen/fifteen.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/fifteen/fifteen.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/noncore/games/fifteen/fifteen.cpp b/noncore/games/fifteen/fifteen.cpp index bb57ee1..c41c0a4 100644 --- a/noncore/games/fifteen/fifteen.cpp +++ b/noncore/games/fifteen/fifteen.cpp | |||
@@ -14,26 +14,26 @@ | |||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "fifteen.h" | 21 | #include "fifteen.h" |
22 | 22 | ||
23 | #include "fifteenconfigdialog.h" | 23 | #include "fifteenconfigdialog.h" |
24 | 24 | ||
25 | #include <opie2/ofileselector.h> | 25 | #include <opie2/ofileselector.h> |
26 | #include <opie2/oresource.h> | ||
26 | 27 | ||
27 | #include <qtopia/resource.h> | ||
28 | #include <qtopia/config.h> | 28 | #include <qtopia/config.h> |
29 | #include <qtopia/qpeapplication.h> | 29 | #include <qtopia/qpeapplication.h> |
30 | 30 | ||
31 | #include <qvbox.h> | 31 | #include <qvbox.h> |
32 | #include <qaction.h> | 32 | #include <qaction.h> |
33 | #include <qpainter.h> | 33 | #include <qpainter.h> |
34 | #include <qmessagebox.h> | 34 | #include <qmessagebox.h> |
35 | #include <qtoolbar.h> | 35 | #include <qtoolbar.h> |
36 | #include <qmenubar.h> | 36 | #include <qmenubar.h> |
37 | #include <qimage.h> | 37 | #include <qimage.h> |
38 | 38 | ||
39 | #include <stdlib.h> | 39 | #include <stdlib.h> |
@@ -43,57 +43,49 @@ FifteenMainWindow::FifteenMainWindow(QWidget *parent, const char* name, WFlags f | |||
43 | : QMainWindow( parent, name, fl ) | 43 | : QMainWindow( parent, name, fl ) |
44 | { | 44 | { |
45 | 45 | ||
46 | // random seed | 46 | // random seed |
47 | srand(time(0)); | 47 | srand(time(0)); |
48 | setCaption( tr("Fifteen Pieces") ); | 48 | setCaption( tr("Fifteen Pieces") ); |
49 | 49 | ||
50 | QToolBar *toolbar = new QToolBar(this); | 50 | QToolBar *toolbar = new QToolBar(this); |
51 | toolbar->setHorizontalStretchable( FALSE ); | 51 | toolbar->setHorizontalStretchable( FALSE ); |
52 | QMenuBar *menubar = new QMenuBar( toolbar ); | 52 | QMenuBar *menubar = new QMenuBar( toolbar ); |
53 | menubar->setMargin(0); | 53 | menubar->setMargin(0); |
54 | QPopupMenu *game = new QPopupMenu( this ); | 54 | QPopupMenu *game = new QPopupMenu( this ); |
55 | menubar->insertItem( tr( "Game" ), game ); | ||
55 | 56 | ||
56 | QWidget *spacer = new QWidget( toolbar ); | 57 | QWidget *spacer = new QWidget( toolbar ); |
57 | spacer->setBackgroundMode( PaletteButton ); | 58 | spacer->setBackgroundMode( PaletteButton ); |
58 | toolbar->setStretchableWidget( spacer ); | 59 | toolbar->setStretchableWidget( spacer ); |
59 | 60 | ||
60 | 61 | ||
61 | setToolBarsMovable( FALSE ); | 62 | setToolBarsMovable( FALSE ); |
62 | QVBox *vbox = new QVBox( this ); | 63 | QVBox *vbox = new QVBox( this ); |
63 | PiecesTable *table = new PiecesTable( vbox ); | 64 | PiecesTable *table = new PiecesTable( vbox ); |
64 | setCentralWidget(vbox); | 65 | setCentralWidget(vbox); |
65 | 66 | ||
66 | 67 | ||
67 | 68 | ||
68 | QAction *a = new QAction( tr( "Randomize" ), Resource::loadPixmap( "new" ), | 69 | QAction *a = new QAction( tr( "Randomize" ), Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ), |
69 | QString::null, 0, this, 0 ); | 70 | QString::null, 0, this, 0 ); |
70 | connect( a, SIGNAL( activated() ), table, SLOT( slotRandomize() ) ); | 71 | connect( a, SIGNAL( activated() ), table, SLOT( slotRandomize() ) ); |
71 | a->addTo( game ); | 72 | a->addTo( game ); |
72 | a->addTo( toolbar ); | 73 | a->addTo( toolbar ); |
73 | 74 | ||
74 | 75 | ||
75 | a = new QAction( tr("Configure"), Resource::loadPixmap( "SettingsIcon" ), | 76 | a = new QAction( tr("Configure"), Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon ), |
76 | QString::null, 0, this, 0 ); | 77 | QString::null, 0, this, 0 ); |
77 | connect( a, SIGNAL( activated()), table, SLOT( slotConfigure()) ); | 78 | connect( a, SIGNAL( activated()), table, SLOT( slotConfigure()) ); |
78 | a->addTo( game ); | 79 | a->addTo( game ); |
79 | |||
80 | /* This is pointless and confusing. | ||
81 | a = new QAction( tr( "Solve" ), Resource::loadIconSet( "repeat" ), | ||
82 | QString::null, 0, this, 0 ); | ||
83 | connect( a, SIGNAL( activated() ), table, SLOT( slotReset() ) ); | ||
84 | a->addTo( game ); | ||
85 | a->addTo( toolbar ); | ||
86 | */ | ||
87 | menubar->insertItem( tr( "Game" ), game ); | ||
88 | } | 80 | } |
89 | 81 | ||
90 | 82 | ||
91 | 83 | ||
92 | 84 | ||
93 | /////////////// | 85 | /////////////// |
94 | /////// Pieces table Implementation | 86 | /////// Pieces table Implementation |
95 | /////// | 87 | /////// |
96 | PiecesTable::PiecesTable(QWidget* parent, const char* name ) | 88 | PiecesTable::PiecesTable(QWidget* parent, const char* name ) |
97 | : QTableView(parent, name), _menu(0), _randomized(false), | 89 | : QTableView(parent, name), _menu(0), _randomized(false), |
98 | _dialog( 0l ) | 90 | _dialog( 0l ) |
99 | { | 91 | { |