summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/drawpad/drawpad.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp
index 5c7e541..aae9ab0 100644
--- a/noncore/graphics/drawpad/drawpad.cpp
+++ b/noncore/graphics/drawpad/drawpad.cpp
@@ -441,63 +441,68 @@ void DrawPad::changeBrushColor(const QColor& color)
441 painter.fillRect(QRect(0, 12, 14, 2), m_brush.color()); 441 painter.fillRect(QRect(0, 12, 14, 2), m_brush.color());
442 painter.end(); 442 painter.end();
443 443
444 m_pBrushColorToolButton->popup()->hide(); 444 m_pBrushColorToolButton->popup()->hide();
445} 445}
446 446
447void DrawPad::choosePenColor() 447void DrawPad::choosePenColor()
448{ 448{
449 QColor newPenColor = QColorDialog::getColor(m_pen.color()); 449 QColor newPenColor = QColorDialog::getColor(m_pen.color());
450 changePenColor(newPenColor); 450 changePenColor(newPenColor);
451} 451}
452 452
453void DrawPad::chooseBrushColor() 453void DrawPad::chooseBrushColor()
454{ 454{
455 QColor newBrushColor = QColorDialog::getColor(m_brush.color()); 455 QColor newBrushColor = QColorDialog::getColor(m_brush.color());
456 changeBrushColor(newBrushColor); 456 changeBrushColor(newBrushColor);
457} 457}
458 458
459void DrawPad::updateUndoRedoToolButtons() 459void DrawPad::updateUndoRedoToolButtons()
460{ 460{
461 m_pUndoAction->setEnabled(m_pDrawPadCanvas->undoEnabled()); 461 m_pUndoAction->setEnabled(m_pDrawPadCanvas->undoEnabled());
462 m_pRedoAction->setEnabled(m_pDrawPadCanvas->redoEnabled()); 462 m_pRedoAction->setEnabled(m_pDrawPadCanvas->redoEnabled());
463} 463}
464 464
465void DrawPad::updateNavigationToolButtons() 465void DrawPad::updateNavigationToolButtons()
466{ 466{
467 m_pFirstPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled()); 467 m_pFirstPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled());
468 m_pPreviousPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled()); 468 m_pPreviousPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled());
469 m_pNextPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled()); 469 m_pNextPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled());
470 m_pLastPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled()); 470 m_pLastPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled());
471} 471}
472 472
473void DrawPad::updateCaption() 473void DrawPad::updateCaption()
474{ 474{
475 uint pagePosition = m_pDrawPadCanvas->pagePosition(); 475 uint pagePosition = m_pDrawPadCanvas->pagePosition();
476 uint pageCount = m_pDrawPadCanvas->pageCount(); 476 uint pageCount = m_pDrawPadCanvas->pageCount();
477 477
478 setCaption(tr("DrawPad") + " - " + tr("Page") + " " 478 setCaption(tr("DrawPad") + " - " + tr("Page") + " "
479 + QString::number(pagePosition) + "/" + QString::number(pageCount)); 479 + QString::number(pagePosition) + "/" + QString::number(pageCount));
480} 480}
481 481
482void DrawPad::importPage() 482void DrawPad::importPage()
483{ 483{
484 ImportDialog importDialog(this); 484 ImportDialog importDialog(this);
485 485
486 importDialog.showMaximized(); 486 importDialog.showMaximized();
487 487
488 if (importDialog.exec() == QDialog::Accepted) { 488 if (importDialog.exec() == QDialog::Accepted) {
489 m_pDrawPadCanvas->importPage(importDialog.selected()->file()); 489 const DocLnk* docLnk = importDialog.selected();
490
491 if (docLnk) {
492 m_pDrawPadCanvas->importPage(docLnk->file());
493 delete docLnk;
494 }
490 } 495 }
491} 496}
492 497
493void DrawPad::exportPage() 498void DrawPad::exportPage()
494{ 499{
495 ExportDialog exportDialog(m_pDrawPadCanvas->pagePosition(), m_pDrawPadCanvas->pageCount(), this); 500 ExportDialog exportDialog(m_pDrawPadCanvas->pagePosition(), m_pDrawPadCanvas->pageCount(), this);
496 501
497 exportDialog.showMaximized(); 502 exportDialog.showMaximized();
498 503
499 if (exportDialog.exec() == QDialog::Accepted) { 504 if (exportDialog.exec() == QDialog::Accepted) {
500 m_pDrawPadCanvas->exportPage(exportDialog.selectedFromPage(), exportDialog.selectedToPage(), 505 m_pDrawPadCanvas->exportPage(exportDialog.selectedFromPage(), exportDialog.selectedToPage(),
501 exportDialog.selectedName(), exportDialog.selectedFormat()); 506 exportDialog.selectedName(), exportDialog.selectedFormat());
502 } 507 }
503} 508}