-rw-r--r-- | noncore/apps/opie-sheet/mainwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/opie-sheet/mainwindow.cpp b/noncore/apps/opie-sheet/mainwindow.cpp index 9d69b8a..efbcc20 100644 --- a/noncore/apps/opie-sheet/mainwindow.cpp +++ b/noncore/apps/opie-sheet/mainwindow.cpp | |||
@@ -476,129 +476,129 @@ void MainWindow::initStandardToolbar() | |||
476 | fileNew->addTo(toolbarStandard); | 476 | fileNew->addTo(toolbarStandard); |
477 | fileOpen->addTo(toolbarStandard); | 477 | fileOpen->addTo(toolbarStandard); |
478 | fileSave->addTo(toolbarStandard); | 478 | fileSave->addTo(toolbarStandard); |
479 | 479 | ||
480 | comboSheets=new QComboBox(toolbarStandard); | 480 | comboSheets=new QComboBox(toolbarStandard); |
481 | toolbarStandard->setStretchableWidget(comboSheets); | 481 | toolbarStandard->setStretchableWidget(comboSheets); |
482 | connect(comboSheets, SIGNAL(activated(const QString &)), this, SLOT(slotSheetChanged(const QString &))); | 482 | connect(comboSheets, SIGNAL(activated(const QString &)), this, SLOT(slotSheetChanged(const QString &))); |
483 | } | 483 | } |
484 | 484 | ||
485 | void MainWindow::initFunctionsToolbar() | 485 | void MainWindow::initFunctionsToolbar() |
486 | { | 486 | { |
487 | toolbarFunctions=new QPEToolBar(this); | 487 | toolbarFunctions=new QPEToolBar(this); |
488 | toolbarFunctions->setHorizontalStretchable(TRUE); | 488 | toolbarFunctions->setHorizontalStretchable(TRUE); |
489 | moveToolBar(toolbarFunctions, Bottom); | 489 | moveToolBar(toolbarFunctions, Bottom); |
490 | 490 | ||
491 | funcEqual->addTo(toolbarFunctions); | 491 | funcEqual->addTo(toolbarFunctions); |
492 | funcPlus->addTo(toolbarFunctions); | 492 | funcPlus->addTo(toolbarFunctions); |
493 | funcMinus->addTo(toolbarFunctions); | 493 | funcMinus->addTo(toolbarFunctions); |
494 | funcCross->addTo(toolbarFunctions); | 494 | funcCross->addTo(toolbarFunctions); |
495 | funcDivide->addTo(toolbarFunctions); | 495 | funcDivide->addTo(toolbarFunctions); |
496 | funcParanOpen->addTo(toolbarFunctions); | 496 | funcParanOpen->addTo(toolbarFunctions); |
497 | funcParanClose->addTo(toolbarFunctions); | 497 | funcParanClose->addTo(toolbarFunctions); |
498 | funcComma->addTo(toolbarFunctions); | 498 | funcComma->addTo(toolbarFunctions); |
499 | 499 | ||
500 | toolFunction=new QToolButton(toolbarFunctions); | 500 | toolFunction=new QToolButton(toolbarFunctions); |
501 | toolFunction->setPixmap(func_func_xpm); | 501 | toolFunction->setPixmap(func_func_xpm); |
502 | toolFunction->setTextLabel(tr("Functions")); | 502 | toolFunction->setTextLabel(tr("Functions")); |
503 | toolFunction->setPopup(submenuFunc); | 503 | toolFunction->setPopup(submenuFunc); |
504 | toolFunction->setPopupDelay(0); | 504 | toolFunction->setPopupDelay(0); |
505 | } | 505 | } |
506 | 506 | ||
507 | void MainWindow::initEditToolbar() | 507 | void MainWindow::initEditToolbar() |
508 | { | 508 | { |
509 | toolbarEdit=new QPEToolBar(this); | 509 | toolbarEdit=new QPEToolBar(this); |
510 | toolbarEdit->setHorizontalStretchable(TRUE); | 510 | toolbarEdit->setHorizontalStretchable(TRUE); |
511 | moveToolBar(toolbarEdit, Bottom); | 511 | moveToolBar(toolbarEdit, Bottom); |
512 | 512 | ||
513 | editAccept->addTo(toolbarEdit); | 513 | editAccept->addTo(toolbarEdit); |
514 | editCancel->addTo(toolbarEdit); | 514 | editCancel->addTo(toolbarEdit); |
515 | 515 | ||
516 | editData=new QLineEdit(toolbarEdit); | 516 | editData=new QLineEdit(toolbarEdit); |
517 | toolbarEdit->setStretchableWidget(editData); | 517 | toolbarEdit->setStretchableWidget(editData); |
518 | connect(editData, SIGNAL(returnPressed()), this, SLOT(slotEditAccept())); | 518 | connect(editData, SIGNAL(returnPressed()), this, SLOT(slotEditAccept())); |
519 | 519 | ||
520 | editCellSelect->addTo(toolbarEdit); | 520 | editCellSelect->addTo(toolbarEdit); |
521 | } | 521 | } |
522 | 522 | ||
523 | void MainWindow::slotHelpGeneral() | 523 | void MainWindow::slotHelpGeneral() |
524 | { | 524 | { |
525 | if (QFile::exists(helpFile)) | 525 | if (QFile::exists(helpFile)) |
526 | { | 526 | { |
527 | QCopEnvelope e("QPE/Application/helpbrowser", "showFile(QString)"); | 527 | QCopEnvelope e("QPE/Application/helpbrowser", "showFile(QString)"); |
528 | e << helpFile; | 528 | e << helpFile; |
529 | } | 529 | } |
530 | else | 530 | else |
531 | QMessageBox::critical(this, tr("Error"), tr("Help file not found!")); | 531 | QMessageBox::critical(this, tr("Error"), tr("Help file not found!")); |
532 | } | 532 | } |
533 | 533 | ||
534 | void MainWindow::slotHelpAbout() | 534 | void MainWindow::slotHelpAbout() |
535 | { | 535 | { |
536 | QDialog dialogAbout(this, 0, TRUE); | 536 | QDialog dialogAbout(this, 0, TRUE); |
537 | dialogAbout.resize(width()-40, height()-80); | 537 | dialogAbout.resize(width()-40, height()-80); |
538 | dialogAbout.setCaption(tr("About Opie Sheet")); | 538 | dialogAbout.setCaption(tr("About Opie Sheet")); |
539 | 539 | ||
540 | QLabel label(tr("Opie Sheet\nSpreadsheet Software for Opie\nQWDC Beta Winner (as Sheet/Qt)\n\nDeveloped by: Serdar Ozler\nVersion: 1.0.1 (Final)\nRelease Date: July 4, 2002\n\nThis product is licensed under GPL. It is freely distributable. If you want to get the latest version and also the source code, please visit the web site.\n\nhttp://qtopia.sitebest.com"), &dialogAbout); | 540 | QLabel label(tr("Opie Sheet\nSpreadsheet Software for Opie\nQWDC Beta Winner (as Sheet/Qt)\n\nDeveloped by: Serdar Ozler\nRelease 1.0.1\nRelease Date: July 04, 2002\n\nThis product is licensed under GPL. It is freely distributable. If you want to get the latest version and also the source code, please visit the web site.\n\nhttp://qtopia.sitebest.com"), &dialogAbout); |
541 | label.setGeometry(dialogAbout.rect()); | 541 | label.setGeometry(dialogAbout.rect()); |
542 | label.setAlignment(Qt::AlignCenter | Qt::WordBreak); | 542 | label.setAlignment(Qt::AlignCenter | Qt::WordBreak); |
543 | 543 | ||
544 | dialogAbout.exec(); | 544 | dialogAbout.exec(); |
545 | } | 545 | } |
546 | 546 | ||
547 | void MainWindow::initSheet() | 547 | void MainWindow::initSheet() |
548 | { | 548 | { |
549 | sheet=new Sheet(DEFAULT_NUM_ROWS, DEFAULT_NUM_COLS, this); | 549 | sheet=new Sheet(DEFAULT_NUM_ROWS, DEFAULT_NUM_COLS, this); |
550 | setCentralWidget(sheet); | 550 | setCentralWidget(sheet); |
551 | 551 | ||
552 | connect(sheet, SIGNAL(currentDataChanged(const QString &)), editData, SLOT(setText(const QString &))); | 552 | connect(sheet, SIGNAL(currentDataChanged(const QString &)), editData, SLOT(setText(const QString &))); |
553 | connect(sheet, SIGNAL(cellClicked(const QString &)), this, SLOT(slotCellClicked(const QString &))); | 553 | connect(sheet, SIGNAL(cellClicked(const QString &)), this, SLOT(slotCellClicked(const QString &))); |
554 | connect(sheet, SIGNAL(sheetModified()), this, SLOT(slotDocModified())); | 554 | connect(sheet, SIGNAL(sheetModified()), this, SLOT(slotDocModified())); |
555 | 555 | ||
556 | connect(editCut, SIGNAL(activated()), sheet, SLOT(editCut())); | 556 | connect(editCut, SIGNAL(activated()), sheet, SLOT(editCut())); |
557 | connect(editCopy, SIGNAL(activated()), sheet, SLOT(editCopy())); | 557 | connect(editCopy, SIGNAL(activated()), sheet, SLOT(editCopy())); |
558 | connect(editClear, SIGNAL(activated()), sheet, SLOT(editClear())); | 558 | connect(editClear, SIGNAL(activated()), sheet, SLOT(editClear())); |
559 | } | 559 | } |
560 | 560 | ||
561 | void MainWindow::slotEditAccept() | 561 | void MainWindow::slotEditAccept() |
562 | { | 562 | { |
563 | sheet->setData(editData->text()); | 563 | sheet->setData(editData->text()); |
564 | } | 564 | } |
565 | 565 | ||
566 | void MainWindow::slotEditCancel() | 566 | void MainWindow::slotEditCancel() |
567 | { | 567 | { |
568 | editData->setText(sheet->getData()); | 568 | editData->setText(sheet->getData()); |
569 | } | 569 | } |
570 | 570 | ||
571 | void MainWindow::slotCellSelect(bool lock) | 571 | void MainWindow::slotCellSelect(bool lock) |
572 | { | 572 | { |
573 | sheet->lockClicks(lock); | 573 | sheet->lockClicks(lock); |
574 | } | 574 | } |
575 | 575 | ||
576 | void MainWindow::addToData(const QString &data) | 576 | void MainWindow::addToData(const QString &data) |
577 | { | 577 | { |
578 | editData->setText(editData->text().insert(editData->cursorPosition(), data)); | 578 | editData->setText(editData->text().insert(editData->cursorPosition(), data)); |
579 | } | 579 | } |
580 | 580 | ||
581 | void MainWindow::slotFuncOutput() | 581 | void MainWindow::slotFuncOutput() |
582 | { | 582 | { |
583 | if (sender()->isA("QAction")) | 583 | if (sender()->isA("QAction")) |
584 | addToData(((QAction *)sender())->toolTip()); | 584 | addToData(((QAction *)sender())->toolTip()); |
585 | } | 585 | } |
586 | 586 | ||
587 | void MainWindow::slotInsertRows() | 587 | void MainWindow::slotInsertRows() |
588 | { | 588 | { |
589 | NumberDialog dialogNumber(this); | 589 | NumberDialog dialogNumber(this); |
590 | if (dialogNumber.exec(tr("Insert Rows"), tr("&Number of rows:"))==QDialog::Accepted) | 590 | if (dialogNumber.exec(tr("Insert Rows"), tr("&Number of rows:"))==QDialog::Accepted) |
591 | sheet->insertRows(dialogNumber.getValue()); | 591 | sheet->insertRows(dialogNumber.getValue()); |
592 | } | 592 | } |
593 | 593 | ||
594 | void MainWindow::slotInsertCols() | 594 | void MainWindow::slotInsertCols() |
595 | { | 595 | { |
596 | NumberDialog dialogNumber(this); | 596 | NumberDialog dialogNumber(this); |
597 | if (dialogNumber.exec(tr("Insert Columns"), tr("&Number of columns:"))==QDialog::Accepted) | 597 | if (dialogNumber.exec(tr("Insert Columns"), tr("&Number of columns:"))==QDialog::Accepted) |
598 | sheet->insertColumns(dialogNumber.getValue()); | 598 | sheet->insertColumns(dialogNumber.getValue()); |
599 | } | 599 | } |
600 | 600 | ||
601 | void MainWindow::slotInsertSheets() | 601 | void MainWindow::slotInsertSheets() |
602 | { | 602 | { |
603 | NumberDialog dialogNumber(this); | 603 | NumberDialog dialogNumber(this); |
604 | if (dialogNumber.exec(tr("Add Sheets"), tr("&Number of sheets:"))==QDialog::Accepted) | 604 | if (dialogNumber.exec(tr("Add Sheets"), tr("&Number of sheets:"))==QDialog::Accepted) |