Changeset View
Changeset View
Standalone View
Standalone View
part.cpp
Show First 20 Lines • Show All 713 Lines • ▼ Show 20 Line(s) | 681 | #endif | |||
---|---|---|---|---|---|
714 | m_nextBookmark->setText(i18n( "Next Bookmark" )); | 714 | m_nextBookmark->setText(i18n( "Next Bookmark" )); | ||
715 | m_nextBookmark->setIcon(QIcon::fromTheme( QStringLiteral("go-down-search") )); | 715 | m_nextBookmark->setIcon(QIcon::fromTheme( QStringLiteral("go-down-search") )); | ||
716 | m_nextBookmark->setWhatsThis( i18n( "Go to the next bookmark" ) ); | 716 | m_nextBookmark->setWhatsThis( i18n( "Go to the next bookmark" ) ); | ||
717 | connect( m_nextBookmark, &QAction::triggered, this, &Part::slotNextBookmark ); | 717 | connect( m_nextBookmark, &QAction::triggered, this, &Part::slotNextBookmark ); | ||
718 | 718 | | |||
719 | m_copy = nullptr; | 719 | m_copy = nullptr; | ||
720 | 720 | | |||
721 | m_selectAll = nullptr; | 721 | m_selectAll = nullptr; | ||
722 | m_selectCurrentPage = nullptr; | ||||
722 | 723 | | |||
723 | // Find and other actions | 724 | // Find and other actions | ||
724 | m_find = KStandardAction::find( this, SLOT(slotShowFindBar()), ac ); | 725 | m_find = KStandardAction::find( this, SLOT(slotShowFindBar()), ac ); | ||
725 | QList<QKeySequence> s = m_find->shortcuts(); | 726 | QList<QKeySequence> s = m_find->shortcuts(); | ||
726 | s.append( QKeySequence( Qt::Key_Slash ) ); | 727 | s.append( QKeySequence( Qt::Key_Slash ) ); | ||
727 | ac->setDefaultShortcuts(m_find, s); | 728 | ac->setDefaultShortcuts(m_find, s); | ||
728 | m_find->setEnabled( false ); | 729 | m_find->setEnabled( false ); | ||
729 | 730 | | |||
▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Line(s) | |||||
837 | void Part::setupActions() | 838 | void Part::setupActions() | ||
838 | { | 839 | { | ||
839 | KActionCollection * ac = actionCollection(); | 840 | KActionCollection * ac = actionCollection(); | ||
840 | 841 | | |||
841 | m_copy = KStandardAction::create( KStandardAction::Copy, m_pageView, SLOT(copyTextSelection()), ac ); | 842 | m_copy = KStandardAction::create( KStandardAction::Copy, m_pageView, SLOT(copyTextSelection()), ac ); | ||
842 | 843 | | |||
843 | m_selectAll = KStandardAction::selectAll( m_pageView, SLOT(selectAll()), ac ); | 844 | m_selectAll = KStandardAction::selectAll( m_pageView, SLOT(selectAll()), ac ); | ||
844 | 845 | | |||
846 | // Setup select all action for the current page | ||||
847 | m_selectCurrentPage = ac->addAction(QStringLiteral("edit_select_all_current_page")); | ||||
848 | m_selectCurrentPage->setText(i18n("Select All Text on Current Page")); | ||||
849 | connect( m_selectCurrentPage, &QAction::triggered, m_pageView, &PageView::slotSelectPage ); | ||||
850 | m_selectCurrentPage->setEnabled( false ); | ||||
851 | | ||||
845 | m_save = KStandardAction::save( this, [this] { saveFile(); }, ac ); | 852 | m_save = KStandardAction::save( this, [this] { saveFile(); }, ac ); | ||
846 | m_save->setEnabled( false ); | 853 | m_save->setEnabled( false ); | ||
847 | 854 | | |||
848 | m_saveAs = KStandardAction::saveAs( this, SLOT(slotSaveFileAs()), ac ); | 855 | m_saveAs = KStandardAction::saveAs( this, SLOT(slotSaveFileAs()), ac ); | ||
849 | m_saveAs->setEnabled( false ); | 856 | m_saveAs->setEnabled( false ); | ||
850 | m_migrationMessage->addAction( m_saveAs ); | 857 | m_migrationMessage->addAction( m_saveAs ); | ||
851 | 858 | | |||
852 | m_showLeftPanel = ac->add<KToggleAction>(QStringLiteral("show_leftpanel")); | 859 | m_showLeftPanel = ac->add<KToggleAction>(QStringLiteral("show_leftpanel")); | ||
▲ Show 20 Lines • Show All 1287 Lines • ▼ Show 20 Line(s) | 2144 | { | |||
2140 | m_endOfDocument->setEnabled( true ); | 2147 | m_endOfDocument->setEnabled( true ); | ||
2141 | } | 2148 | } | ||
2142 | 2149 | | |||
2143 | if (m_historyBack) m_historyBack->setEnabled( !m_document->historyAtBegin() ); | 2150 | if (m_historyBack) m_historyBack->setEnabled( !m_document->historyAtBegin() ); | ||
2144 | if (m_historyNext) m_historyNext->setEnabled( !m_document->historyAtEnd() ); | 2151 | if (m_historyNext) m_historyNext->setEnabled( !m_document->historyAtEnd() ); | ||
2145 | m_reload->setEnabled( true ); | 2152 | m_reload->setEnabled( true ); | ||
2146 | if (m_copy) m_copy->setEnabled( true ); | 2153 | if (m_copy) m_copy->setEnabled( true ); | ||
2147 | if (m_selectAll) m_selectAll->setEnabled( true ); | 2154 | if (m_selectAll) m_selectAll->setEnabled( true ); | ||
2155 | if (m_selectCurrentPage) m_selectCurrentPage->setEnabled( true ); | ||||
2148 | } | 2156 | } | ||
2149 | else | 2157 | else | ||
2150 | { | 2158 | { | ||
2151 | m_gotoPage->setEnabled( false ); | 2159 | m_gotoPage->setEnabled( false ); | ||
2152 | m_beginningOfDocument->setEnabled( false ); | 2160 | m_beginningOfDocument->setEnabled( false ); | ||
2153 | m_endOfDocument->setEnabled( false ); | 2161 | m_endOfDocument->setEnabled( false ); | ||
2154 | m_prevPage->setEnabled( false ); | 2162 | m_prevPage->setEnabled( false ); | ||
2155 | m_nextPage->setEnabled( false ); | 2163 | m_nextPage->setEnabled( false ); | ||
2156 | if (m_historyBack) m_historyBack->setEnabled( false ); | 2164 | if (m_historyBack) m_historyBack->setEnabled( false ); | ||
2157 | if (m_historyNext) m_historyNext->setEnabled( false ); | 2165 | if (m_historyNext) m_historyNext->setEnabled( false ); | ||
2158 | m_reload->setEnabled( false ); | 2166 | m_reload->setEnabled( false ); | ||
2159 | if (m_copy) m_copy->setEnabled( false ); | 2167 | if (m_copy) m_copy->setEnabled( false ); | ||
2160 | if (m_selectAll) m_selectAll->setEnabled( false ); | 2168 | if (m_selectAll) m_selectAll->setEnabled( false ); | ||
2169 | if (m_selectCurrentPage) m_selectCurrentPage->setEnabled( false ); | ||||
2161 | } | 2170 | } | ||
2162 | 2171 | | |||
2163 | if ( factory() ) | 2172 | if ( factory() ) | ||
2164 | { | 2173 | { | ||
2165 | QWidget *menu = factory()->container(QStringLiteral("menu_okular_part_viewer"), this); | 2174 | QWidget *menu = factory()->container(QStringLiteral("menu_okular_part_viewer"), this); | ||
2166 | if (menu) menu->setEnabled( opened ); | 2175 | if (menu) menu->setEnabled( opened ); | ||
2167 | 2176 | | |||
2168 | menu = factory()->container(QStringLiteral("view_orientation"), this); | 2177 | menu = factory()->container(QStringLiteral("view_orientation"), this); | ||
▲ Show 20 Lines • Show All 1510 Lines • Show Last 20 Lines |