~ubuntu-branches/ubuntu/quantal/qgo/quantal

« back to all changes in this revision

Viewing changes to src/interfacehandler.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Chaboisseau
  • Date: 2006-10-03 23:46:07 UTC
  • mfrom: (1.2.1 upstream) (2.1.9 edgy)
  • Revision ID: james.westby@ubuntu.com-20061003234607-jtuoreigx712b4lw
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <qslider.h>
21
21
#include <qtabwidget.h>
22
22
 
23
 
#ifdef USE_XPM
 
23
//#ifdef USE_XPM
24
24
#include ICON_NODE_BLACK
25
25
#include ICON_NODE_WHITE
26
 
#endif
 
26
//#endif
27
27
 
28
28
struct ButtonState
29
29
{
98
98
                commentEdit->setReadOnly(true);
99
99
                commentEdit2->setReadOnly(false);
100
100
                commentEdit2->setDisabled(false);
101
 
    editCut->setEnabled(false);                  //added eb 9
102
 
    editDelete->setEnabled(false);               //end add eb 9
 
101
                editCut->setEnabled(false);
 
102
                editDelete->setEnabled(false);
 
103
                fileNew->setEnabled(false);
 
104
                fileNewBoard->setEnabled(false);
 
105
                fileOpen->setEnabled(false);
103
106
                statusMode->setText(" " + QObject::tr("O", "Board status line: observe mode") + " ");
104
107
                statusMark->setText(getStatusMarkText(board->getMarkType()));
105
108
                return modeObserve;
119
122
                commentEdit->setReadOnly(true);
120
123
                commentEdit2->setReadOnly(false);
121
124
                commentEdit2->setDisabled(false);
 
125
                fileNew->setEnabled(false);
 
126
                fileNewBoard->setEnabled(false);
 
127
                fileOpen->setEnabled(false);
122
128
                statusMode->setText(" " + QObject::tr("P", "Board status line: play mode") + " ");
123
129
                statusMark->setText(getStatusMarkText(board->getMarkType()));
124
130
                return modeMatch;
138
144
                commentEdit->setReadOnly(true);
139
145
                commentEdit2->setReadOnly(false);
140
146
                commentEdit2->setDisabled(false);
 
147
                fileNew->setEnabled(false);
 
148
                fileNewBoard->setEnabled(false);
 
149
                fileOpen->setEnabled(false);
141
150
                statusMode->setText(" " + QObject::tr("P", "Board status line: play mode") + " ");
142
151
                statusMark->setText(getStatusMarkText(board->getMarkType()));
143
152
                return modeComputer;               //end add eb 12
157
166
                commentEdit->setReadOnly(true);
158
167
                commentEdit2->setReadOnly(false);
159
168
                commentEdit2->setDisabled(false);
 
169
                fileNew->setEnabled(false);
 
170
                fileNewBoard->setEnabled(false);
 
171
                fileOpen->setEnabled(false);
160
172
                statusMode->setText(" " + QObject::tr("T", "Board status line: teach mode") + " ");
161
173
                statusMark->setText(getStatusMarkText(board->getMarkType()));
162
174
                return modeTeach;
250
262
                navSwapVariations->setEnabled(hasPrev);
251
263
                navPrevComment->setEnabled(hasParent);
252
264
                navNextComment->setEnabled(sons);
253
 
    navIntersection->setEnabled(true); //SL added eb 11
 
265
                navIntersection->setEnabled(true); //SL added eb 11
254
266
                
255
267
                slider->setEnabled(true);
256
268
        }
257
 
  else  if (board->getGameMode() == modeObserve)  // add eb 8
 
269
        else  if (board->getGameMode() == modeObserve)  // add eb 8
258
270
        {
259
271
                // Update the toolbar buttons
260
272
                navBackward->setEnabled(hasParent);
263
275
                navLast->setEnabled(sons);
264
276
                navPrevComment->setEnabled(hasParent);
265
277
                navNextComment->setEnabled(sons);
266
 
    navIntersection->setEnabled(true);  //SL added eb 11
 
278
                navIntersection->setEnabled(true);  //SL added eb 11
267
279
 
268
280
                slider->setEnabled(true);
269
281
 
270
 
    board->getBoardHandler()->display_incoming_move = !bool(sons);            //SL added eb 9 - This is used to know whether we are browsing through a game or at the last move
271
 
                                                    
272
 
  }                                                 
 
282
                board->getBoardHandler()->display_incoming_move = !bool(sons);            //SL added eb 9 - This is used to know whether we are browsing through a game or at the last move
 
283
 
 
284
        }
273
285
        else                                               //end add eb 8
274
286
                slider->setDisabled(true);
275
287
        
375
387
                if (board->getBoardHandler()->getBlackTurn())
376
388
                {
377
389
                        current->setPLinfo(stoneWhite);
378
 
#ifndef USE_XPM
379
 
                        mainWidget->colorButton->setPixmap(QPixmap(ICON_NODE_WHITE));
380
 
#else
 
390
//#ifndef USE_XPM
 
391
//                      mainWidget->colorButton->setPixmap(QPixmap(ICON_NODE_WHITE));
 
392
//#else
381
393
                        mainWidget->colorButton->setPixmap(QPixmap(const_cast<const char**>(node_white_xpm)));
382
 
#endif
 
394
//#endif
383
395
                }
384
396
                else
385
397
                {
386
398
                        current->setPLinfo(stoneBlack);
387
 
#ifndef USE_XPM
388
 
                        mainWidget->colorButton->setPixmap(QPixmap(ICON_NODE_BLACK));
389
 
#else
 
399
//#ifndef USE_XPM
 
400
//                      mainWidget->colorButton->setPixmap(QPixmap(ICON_NODE_BLACK));
 
401
//#else
390
402
                        mainWidget->colorButton->setPixmap(QPixmap(const_cast<const char**>(node_black_xpm)));
391
 
#endif
 
403
//#endif
392
404
                }
393
405
 
394
406
                // check if set color is natural color: