Changeset View
Changeset View
Standalone View
Standalone View
part.cpp
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Line(s) | |||||
101 | #include "ui/pagesizelabel.h" | 101 | #include "ui/pagesizelabel.h" | ||
102 | #include "ui/bookmarklist.h" | 102 | #include "ui/bookmarklist.h" | ||
103 | #include "ui/findbar.h" | 103 | #include "ui/findbar.h" | ||
104 | #include "ui/sidebar.h" | 104 | #include "ui/sidebar.h" | ||
105 | #include "ui/fileprinterpreview.h" | 105 | #include "ui/fileprinterpreview.h" | ||
106 | #include "ui/guiutils.h" | 106 | #include "ui/guiutils.h" | ||
107 | #include "ui/layers.h" | 107 | #include "ui/layers.h" | ||
108 | #include "ui/okmenutitle.h" | 108 | #include "ui/okmenutitle.h" | ||
109 | #include "ui/signaturepanel.h" | ||||
109 | #include "conf/preferencesdialog.h" | 110 | #include "conf/preferencesdialog.h" | ||
110 | #include "settings.h" | 111 | #include "settings.h" | ||
111 | #include "core/action.h" | 112 | #include "core/action.h" | ||
112 | #include "core/annotations.h" | 113 | #include "core/annotations.h" | ||
113 | #include "core/bookmarkmanager.h" | 114 | #include "core/bookmarkmanager.h" | ||
114 | #include "core/document.h" | 115 | #include "core/document.h" | ||
115 | #include "core/generator.h" | 116 | #include "core/generator.h" | ||
116 | #include "core/page.h" | 117 | #include "core/page.h" | ||
▲ Show 20 Lines • Show All 329 Lines • ▼ Show 20 Line(s) | 312 | { | |||
446 | m_sidebar->addItem( m_reviewsWidget, QIcon::fromTheme(QStringLiteral("draw-freehand")), i18n("Reviews") ); | 447 | m_sidebar->addItem( m_reviewsWidget, QIcon::fromTheme(QStringLiteral("draw-freehand")), i18n("Reviews") ); | ||
447 | m_sidebar->setItemEnabled( m_reviewsWidget, false ); | 448 | m_sidebar->setItemEnabled( m_reviewsWidget, false ); | ||
448 | 449 | | |||
449 | // [left toolbox: Bookmarks] | [] | 450 | // [left toolbox: Bookmarks] | [] | ||
450 | m_bookmarkList = new BookmarkList( m_document, nullptr ); | 451 | m_bookmarkList = new BookmarkList( m_document, nullptr ); | ||
451 | m_sidebar->addItem( m_bookmarkList, QIcon::fromTheme(QStringLiteral("bookmarks")), i18n("Bookmarks") ); | 452 | m_sidebar->addItem( m_bookmarkList, QIcon::fromTheme(QStringLiteral("bookmarks")), i18n("Bookmarks") ); | ||
452 | m_sidebar->setItemEnabled( m_bookmarkList, false ); | 453 | m_sidebar->setItemEnabled( m_bookmarkList, false ); | ||
453 | 454 | | |||
455 | // [left toolbox: Signature Panel] | [] | ||||
456 | m_panel = new SignaturePanel( nullptr, m_document ); | ||||
457 | m_sidebar->addItem( m_panel, QIcon::fromTheme(QStringLiteral("application-pkcs7-signature")), i18n("Signatures") ); | ||||
458 | m_sidebar->setItemEnabled( m_panel, false ); | ||||
459 | | ||||
454 | // widgets: [../miniBarContainer] | [] | 460 | // widgets: [../miniBarContainer] | [] | ||
455 | #ifdef OKULAR_ENABLE_MINIBAR | 461 | #ifdef OKULAR_ENABLE_MINIBAR | ||
456 | QWidget * miniBarContainer = new QWidget( 0 ); | 462 | QWidget * miniBarContainer = new QWidget( 0 ); | ||
457 | m_sidebar->setBottomWidget( miniBarContainer ); | 463 | m_sidebar->setBottomWidget( miniBarContainer ); | ||
458 | QVBoxLayout * miniBarLayout = new QVBoxLayout( miniBarContainer ); | 464 | QVBoxLayout * miniBarLayout = new QVBoxLayout( miniBarContainer ); | ||
459 | miniBarLayout->setMargin( 0 ); | 465 | miniBarLayout->setMargin( 0 ); | ||
460 | // widgets: [../[spacer/..]] | [] | 466 | // widgets: [../[spacer/..]] | [] | ||
461 | miniBarLayout->addItem( new QSpacerItem( 6, 6, QSizePolicy::Fixed, QSizePolicy::Fixed ) ); | 467 | miniBarLayout->addItem( new QSpacerItem( 6, 6, QSizePolicy::Fixed, QSizePolicy::Fixed ) ); | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 516 | // m_splitter->setFocusProxy(m_pageView); | |||
511 | connect( m_pageView.data(), &PageView::rightClick, this, &Part::slotShowMenu ); | 517 | connect( m_pageView.data(), &PageView::rightClick, this, &Part::slotShowMenu ); | ||
512 | connect( m_document, &Document::error, this, &Part::errorMessage ); | 518 | connect( m_document, &Document::error, this, &Part::errorMessage ); | ||
513 | connect( m_document, &Document::warning, this, &Part::warningMessage ); | 519 | connect( m_document, &Document::warning, this, &Part::warningMessage ); | ||
514 | connect( m_document, &Document::notice, this, &Part::noticeMessage ); | 520 | connect( m_document, &Document::notice, this, &Part::noticeMessage ); | ||
515 | connect( m_document, &Document::sourceReferenceActivated, this, &Part::slotHandleActivatedSourceReference ); | 521 | connect( m_document, &Document::sourceReferenceActivated, this, &Part::slotHandleActivatedSourceReference ); | ||
516 | connect( m_pageView.data(), &PageView::fitWindowToPage, this, &Part::fitWindowToPage ); | 522 | connect( m_pageView.data(), &PageView::fitWindowToPage, this, &Part::fitWindowToPage ); | ||
517 | rightLayout->addWidget( m_pageView ); | 523 | rightLayout->addWidget( m_pageView ); | ||
518 | m_layers->setPageView( m_pageView ); | 524 | m_layers->setPageView( m_pageView ); | ||
525 | m_panel->setPageView( m_pageView ); | ||||
519 | m_findBar = new FindBar( m_document, rightContainer ); | 526 | m_findBar = new FindBar( m_document, rightContainer ); | ||
520 | rightLayout->addWidget( m_findBar ); | 527 | rightLayout->addWidget( m_findBar ); | ||
521 | m_bottomBar = new QWidget( rightContainer ); | 528 | m_bottomBar = new QWidget( rightContainer ); | ||
522 | QHBoxLayout * bottomBarLayout = new QHBoxLayout( m_bottomBar ); | 529 | QHBoxLayout * bottomBarLayout = new QHBoxLayout( m_bottomBar ); | ||
523 | m_pageSizeLabel = new PageSizeLabel( m_bottomBar, m_document ); | 530 | m_pageSizeLabel = new PageSizeLabel( m_bottomBar, m_document ); | ||
524 | bottomBarLayout->setMargin( 0 ); | 531 | bottomBarLayout->setMargin( 0 ); | ||
525 | bottomBarLayout->setSpacing( 0 ); | 532 | bottomBarLayout->setSpacing( 0 ); | ||
526 | bottomBarLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); | 533 | bottomBarLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); | ||
Show All 22 Lines | |||||
549 | m_document->addObserver( m_toc ); | 556 | m_document->addObserver( m_toc ); | ||
550 | m_document->addObserver( m_miniBarLogic ); | 557 | m_document->addObserver( m_miniBarLogic ); | ||
551 | #ifdef OKULAR_ENABLE_MINIBAR | 558 | #ifdef OKULAR_ENABLE_MINIBAR | ||
552 | m_document->addObserver( m_progressWidget ); | 559 | m_document->addObserver( m_progressWidget ); | ||
553 | #endif | 560 | #endif | ||
554 | m_document->addObserver( m_reviewsWidget ); | 561 | m_document->addObserver( m_reviewsWidget ); | ||
555 | m_document->addObserver( m_pageSizeLabel ); | 562 | m_document->addObserver( m_pageSizeLabel ); | ||
556 | m_document->addObserver( m_bookmarkList ); | 563 | m_document->addObserver( m_bookmarkList ); | ||
564 | m_document->addObserver( m_panel ); | ||||
557 | 565 | | |||
558 | connect( m_document->bookmarkManager(), &BookmarkManager::saved, | 566 | connect( m_document->bookmarkManager(), &BookmarkManager::saved, | ||
559 | this, &Part::slotRebuildBookmarkMenu ); | 567 | this, &Part::slotRebuildBookmarkMenu ); | ||
560 | 568 | | |||
561 | setupViewerActions(); | 569 | setupViewerActions(); | ||
562 | 570 | | |||
563 | if ( m_embedMode != ViewerWidgetMode ) | 571 | if ( m_embedMode != ViewerWidgetMode ) | ||
564 | { | 572 | { | ||
▲ Show 20 Lines • Show All 371 Lines • ▼ Show 20 Line(s) | 928 | { | |||
936 | delete m_bottomBar; | 944 | delete m_bottomBar; | ||
937 | #ifdef OKULAR_ENABLE_MINIBAR | 945 | #ifdef OKULAR_ENABLE_MINIBAR | ||
938 | delete m_progressWidget; | 946 | delete m_progressWidget; | ||
939 | #endif | 947 | #endif | ||
940 | delete m_pageSizeLabel; | 948 | delete m_pageSizeLabel; | ||
941 | delete m_reviewsWidget; | 949 | delete m_reviewsWidget; | ||
942 | delete m_bookmarkList; | 950 | delete m_bookmarkList; | ||
943 | delete m_infoTimer; | 951 | delete m_infoTimer; | ||
952 | delete m_panel; | ||||
944 | 953 | | |||
945 | delete m_document; | 954 | delete m_document; | ||
946 | 955 | | |||
947 | delete m_tempfile; | 956 | delete m_tempfile; | ||
948 | 957 | | |||
949 | qDeleteAll( m_bookmarkActions ); | 958 | qDeleteAll( m_bookmarkActions ); | ||
950 | 959 | | |||
951 | delete m_exportAsMenu; | 960 | delete m_exportAsMenu; | ||
▲ Show 20 Lines • Show All 2417 Lines • ▼ Show 20 Line(s) | |||||
3369 | 3378 | | |||
3370 | void Part::unsetDummyMode() | 3379 | void Part::unsetDummyMode() | ||
3371 | { | 3380 | { | ||
3372 | if ( m_embedMode == PrintPreviewMode ) | 3381 | if ( m_embedMode == PrintPreviewMode ) | ||
3373 | return; | 3382 | return; | ||
3374 | 3383 | | |||
3375 | m_sidebar->setItemEnabled( m_reviewsWidget, true ); | 3384 | m_sidebar->setItemEnabled( m_reviewsWidget, true ); | ||
3376 | m_sidebar->setItemEnabled( m_bookmarkList, true ); | 3385 | m_sidebar->setItemEnabled( m_bookmarkList, true ); | ||
3386 | m_sidebar->setItemEnabled( m_panel, true ); | ||||
3377 | m_sidebar->setSidebarVisibility( Okular::Settings::showLeftPanel() ); | 3387 | m_sidebar->setSidebarVisibility( Okular::Settings::showLeftPanel() ); | ||
3378 | 3388 | | |||
3379 | // add back and next in history | 3389 | // add back and next in history | ||
3380 | m_historyBack = KStandardAction::documentBack( this, SLOT(slotHistoryBack()), actionCollection() ); | 3390 | m_historyBack = KStandardAction::documentBack( this, SLOT(slotHistoryBack()), actionCollection() ); | ||
3381 | m_historyBack->setWhatsThis( i18n( "Go to the place you were before" ) ); | 3391 | m_historyBack->setWhatsThis( i18n( "Go to the place you were before" ) ); | ||
3382 | connect(m_pageView.data(), &PageView::mouseBackButtonClick, m_historyBack, &QAction::trigger); | 3392 | connect(m_pageView.data(), &PageView::mouseBackButtonClick, m_historyBack, &QAction::trigger); | ||
3383 | 3393 | | |||
3384 | m_historyNext = KStandardAction::documentForward( this, SLOT(slotHistoryNext()), actionCollection()); | 3394 | m_historyNext = KStandardAction::documentForward( this, SLOT(slotHistoryNext()), actionCollection()); | ||
▲ Show 20 Lines • Show All 195 Lines • Show Last 20 Lines |