示例#1
0
// Clear out the contents of the board. Repaint the screen
// set values to their defaults.
void Editor::newBoard() {
    if (!testSave())
	return;



    theBoard.clearBoardLayout();



    clean=true;
    numTiles=0;
    statusChanged();
    repaint(false);
}
示例#2
0
void Editor::loadBoard()
{
    if (!testSave()) {
        return;
    }

    KUrl url = KFileDialog::getOpenUrl(KUrl(), i18n("*.layout|Board Layout (*.layout)\n*|All File"
        "s"), this, i18n("Open Board Layout"));

    if (url.isEmpty()) {
            return;
    }

    theBoard.loadBoardLayout(url.path());
    update();
}
示例#3
0
void Editor::newBoard()
{
    // Clear out the contents of the board. Repaint the screen
    // set values to their defaults.

    if (!testSave()) {
        return;
    }

    theBoard.clearBoardLayout();

    clean = true;
    numTiles = 0;

    statusChanged();
    update();
}
示例#4
0
void Editor::closeEvent(QCloseEvent *e)
{
    if (testSave()) {
        theBoard.clearBoardLayout();
        clean = true;
        numTiles = 0;
        statusChanged();
        update();

        // Save the window geometry.
        Prefs::setEditorGeometry(geometry());
        Prefs::self()->writeConfig();

        e->accept();
    } else {
        e->ignore();
    }
}
示例#5
0
void Editor::loadBoard() {

    if ( !testSave() )
	return;

    KURL url = KFileDialog::getOpenURL(
				NULL,
				i18n("*.layout|Board Layout (*.layout)\n"
				"*|All Files"),
				this,
				i18n("Open Board Layout" ));

   if ( url.isEmpty() )
        return;


    theBoard.loadBoardLayout( url.path() );

    repaint(false);
}
int main(int argc, char* argv[]) {
  // initialize
  TlCommunicate& rComm = TlCommunicate::getInstance(argc, argv);

  // ===================================================================
  //   testConstructer();
  //   testCopyConstructer();
  //   testCopyConstructer2();
  //   testSet();
  //   testOperatorPlusEqual();
  //   testOperatorMultiEqual();
  //   testMulti1();
  //   testMulti2();
  testSave();
  testLoad();
  //   testInverse();
  //   testInverse2();
  //   testDiagonal();
  // ===================================================================

  // finalize
  rComm.finalize();
  return EXIT_SUCCESS;
}