300
300
a->setIcon (KIcon( QLatin1String( "go-home" )));
301
301
a->setShortcut (Qt::Key_Home);
302
connect (a, SIGNAL (triggered (bool)), game, SLOT (setStandardView()));
302
connect (a, SIGNAL (triggered(bool)), game, SLOT (setStandardView()));
304
304
a = actionCollection()->addAction ( QLatin1String( "redo_all" ));
305
305
a->setText (i18n("Redo All"));
306
306
a->setShortcut (Qt::SHIFT + Qt::Key_R);
307
connect (a, SIGNAL (triggered (bool)), game, SLOT (redoAll()));
307
connect (a, SIGNAL (triggered(bool)), game, SLOT (redoAll()));
309
309
// Read-only display of Singmaster moves on the toolbar.
310
310
singmasterLabel = new QLabel (i18n("Singmaster Moves"), this);
370
370
a = actionCollection()->addAction ( QLatin1String( "new_cube" ));
371
371
a->setText (i18n("Make your own..."));
372
connect (a, SIGNAL (triggered (bool)), game, SLOT (newCubeDialog()));
372
connect (a, SIGNAL (triggered(bool)), game, SLOT (newCubeDialog()));
375
375
KToggleAction * b;
377
377
viewGroup->setExclusive (true);
379
379
QSignalMapper * viewMapper = new QSignalMapper (this);
380
connect (viewMapper, SIGNAL (mapped (const int)),
381
game, SLOT (changeScene (const int)));
380
connect (viewMapper, SIGNAL (mapped(int)),
381
game, SLOT (changeScene(int)));
383
383
b = new KToggleAction (i18n ("1 Cube"), this);
384
384
actionCollection()->addAction ( QLatin1String( "scene_1" ), b);
386
386
b->setWhatsThis (i18n ("Show one view of this cube, "
387
387
"from the front."));
388
388
b->setIcon (KIcon( QLatin1String( "arrow-left" ))); // IDW - Temporary.
389
connect (b, SIGNAL(triggered (bool)), viewMapper, SLOT(map()));
389
connect (b, SIGNAL(triggered(bool)), viewMapper, SLOT(map()));
390
390
b->setChecked (true);
391
391
viewMapper->setMapping (b, OneCube);
392
392
viewGroup->addAction (b);
397
397
b->setWhatsThis (i18n ("Show two views of this cube, from "
398
398
"the front and the back. Both can rotate."));
399
399
b->setIcon (KIcon( QLatin1String( "arrow-up" ))); // IDW - Temporary.
400
connect (b, SIGNAL(triggered (bool)), viewMapper, SLOT(map()));
400
connect (b, SIGNAL(triggered(bool)), viewMapper, SLOT(map()));
401
401
viewMapper->setMapping (b, TwoCubes);
402
402
viewGroup->addAction (b);
409
409
"ones, from the front and the back. Only "
410
410
"the large one can rotate."));
411
411
b->setIcon (KIcon( QLatin1String( "arrow-right" ))); // IDW - Temporary.
412
connect (b, SIGNAL(triggered (bool)), viewMapper, SLOT(map()));
412
connect (b, SIGNAL(triggered(bool)), viewMapper, SLOT(map()));
413
413
viewMapper->setMapping (b, ThreeCubes);
414
414
viewGroup->addAction (b);
419
419
b = new KToggleAction (i18n("&Watch Shuffling"), this);
420
420
actionCollection()->addAction ( QLatin1String( "watch_shuffling" ), b);
421
421
b->setShortcut (Qt::Key_W);
422
connect (b, SIGNAL (triggered (bool)), game, SLOT (watchShuffling()));
422
connect (b, SIGNAL (triggered(bool)), game, SLOT (watchShuffling()));
424
424
b = new KToggleAction (i18n("Watch Your &Own Moves"), this);
425
425
actionCollection()->addAction ( QLatin1String( "watch_moves" ), b);
426
426
b->setShortcut (Qt::Key_O);
427
connect (b, SIGNAL (triggered (bool)), game, SLOT (watchMoves()));
427
connect (b, SIGNAL (triggered(bool)), game, SLOT (watchMoves()));
429
429
// DISCONTINUED a = actionCollection()->addAction ( QLatin1String( "enable_messages" ));
430
430
// a->setText (i18n("Show Beginners' &Messages"));
431
// connect (a, SIGNAL (triggered (bool)), game, SLOT (enableMessages()));
431
// connect (a, SIGNAL (triggered(bool)), game, SLOT (enableMessages()));
433
433
// Sorry to be "non-standard" (below), but I am an English-speaker, born and
434
434
// bred, and I just don't find the KDE standard texts "Configure Kubrick"
454
454
a = actionCollection()->addAction ( QLatin1String( "x_axis" ));
455
455
a->setText (i18n("X Axis"));
456
456
a->setShortcut (Qt::Key_X);
457
connect (a, SIGNAL (triggered (bool)), moveAxis, SLOT (map()));
457
connect (a, SIGNAL (triggered(bool)), moveAxis, SLOT (map()));
458
458
moveAxis->setMapping (a, 0);
460
460
a = actionCollection()->addAction ( QLatin1String( "y_axis" ));
461
461
a->setText (i18n("Y Axis"));
462
462
a->setShortcut (Qt::Key_Y);
463
connect (a, SIGNAL (triggered (bool)), moveAxis, SLOT (map()));
463
connect (a, SIGNAL (triggered(bool)), moveAxis, SLOT (map()));
464
464
moveAxis->setMapping (a, 1);
466
466
a = actionCollection()->addAction ( QLatin1String( "z_axis" ));
467
467
a->setText (i18n("Z Axis"));
468
468
a->setShortcut (Qt::Key_Z);
469
connect (a, SIGNAL (triggered (bool)), moveAxis, SLOT (map()));
469
connect (a, SIGNAL (triggered(bool)), moveAxis, SLOT (map()));
470
470
moveAxis->setMapping (a, 2);
472
connect (moveAxis, SIGNAL (mapped (int)), game, SLOT (setMoveAxis (int)));
472
connect (moveAxis, SIGNAL (mapped(int)), game, SLOT (setMoveAxis(int)));
474
474
// Keys to choose the slice number for a slice move.
475
475
QSignalMapper * moveSlice = new QSignalMapper (this);
481
481
a = actionCollection()->addAction (ident);
482
482
a->setText (i18n("Slice %1", i));
483
483
a->setShortcut (Qt::Key_0 + i);
484
connect (a, SIGNAL (triggered (bool)), moveSlice, SLOT (map()));
484
connect (a, SIGNAL (triggered(bool)), moveSlice, SLOT (map()));
485
485
moveSlice->setMapping (a, i);
489
489
a = actionCollection()->addAction ( QLatin1String( "turn_cube" ));
490
490
a->setText (i18n("Turn whole cube"));
491
491
a->setShortcut (Qt::Key_C);
492
connect (a, SIGNAL (triggered (bool)), moveSlice, SLOT (map()));
492
connect (a, SIGNAL (triggered(bool)), moveSlice, SLOT (map()));
493
493
moveSlice->setMapping (a, 0);
495
connect (moveSlice, SIGNAL (mapped (int)), game, SLOT (setMoveSlice(int)));
495
connect (moveSlice, SIGNAL (mapped(int)), game, SLOT (setMoveSlice(int)));
497
497
// Keys to choose the direction for a slice move (clock or anti-clock).
498
498
QSignalMapper * moveDirection = new QSignalMapper (this);
500
500
a = actionCollection()->addAction ( QLatin1String( "anti_clockwise" ));
501
501
a->setText (i18n("Anti-clockwise"));
502
502
a->setShortcut (Qt::Key_Left);
503
connect (a, SIGNAL (triggered (bool)), moveDirection, SLOT (map()));
503
connect (a, SIGNAL (triggered(bool)), moveDirection, SLOT (map()));
504
504
moveDirection->setMapping (a, 0);
506
506
a = actionCollection()->addAction ( QLatin1String( "clockwise" ));
507
507
a->setText (i18n("Clockwise"));
508
508
a->setShortcut (Qt::Key_Right);
509
connect (a, SIGNAL (triggered (bool)), moveDirection, SLOT (map()));
509
connect (a, SIGNAL (triggered(bool)), moveDirection, SLOT (map()));
510
510
moveDirection->setMapping (a, 1);
512
connect (moveDirection, SIGNAL (mapped (int)),
513
game, SLOT (setMoveDirection (int)));
512
connect (moveDirection, SIGNAL (mapped(int)),
513
game, SLOT (setMoveDirection(int)));
515
515
// Keys for Singmaster (sm) moves.
516
516
QSignalMapper * smMove = new QSignalMapper (this);
540
540
Qt::Key_Enter, SM_EXECUTE);
541
541
a = mapAction (smMove, "sm_space", i18n("Add space to Singmaster moves"),
542
542
Qt::Key_Space, SM_SPACER);
543
connect (smMove, SIGNAL (mapped (int)), game, SLOT (smInput (int)));
543
connect (smMove, SIGNAL (mapped(int)), game, SLOT (smInput(int)));
545
545
// IDW - Key for switching the background (temporary) - FIX IT FOR KDE 4.2.
546
546
a = actionCollection()->addAction ( QLatin1String( "switch_background" ));
547
547
a->setShortcut (Qt::Key_K);
548
connect (a, SIGNAL (triggered ()), game, SLOT (switchBackground ()));
548
connect (a, SIGNAL (triggered()), game, SLOT (switchBackground()));
556
556
a = actionCollection()->addAction (name);
557
557
a->setText (text);
558
558
a->setShortcut (key);
559
connect (a, SIGNAL (triggered (bool)), mapper, SLOT (map()));
559
connect (a, SIGNAL (triggered(bool)), mapper, SLOT (map()));
560
560
mapper->setMapping (a, mapping);