Git commit 8445660539256c96c47718873d4ec6164e37f471 by Albert Astals Cid. Committed on 18/10/2015 at 20:29. Pushed by aacid into branch 'frameworks'.
Merge remote-tracking branch 'origin/master' into frameworks M +1 -0 CMakeLists.txt R +32 -0 autotests/parttest.cpp M +12 -1 cmake/modules/FindPoppler.cmake M +8 -0 conf/okular.kcfg M +14 -0 core/document.cpp M +15 -0 core/document.h M +5 -0 core/generator.cpp M +8 -0 core/generator.h M +13 -1 core/movie.cpp M +14 -2 core/movie.h M +2 -2 core/pagetransition.h M +22 -4 doc/index.docbook M +24 -0 generators/chm/okularApplication_chm.desktop M +24 -0 generators/comicbook/okularApplication_comicbook.desktop M +24 -0 generators/djvu/okularApplication_djvu.desktop M +24 -0 generators/dvi/okularApplication_dvi.desktop M +25 -1 generators/epub/okularApplication_epub.desktop M +25 -1 generators/fax/okularApplication_fax.desktop M +25 -1 generators/fictionbook/okularApplication_fb.desktop M +25 -1 generators/kimgio/okularApplication_kimgio.desktop M +24 -0 generators/mobipocket/okularApplication_mobi.desktop M +25 -1 generators/ooo/okularApplication_ooo.desktop M +25 -1 generators/plucker/okularApplication_plucker.desktop M +3 -0 generators/poppler/config-okular-poppler.h.cmake M +15 -1 generators/poppler/generator_pdf.cpp M +2 -1 generators/poppler/generator_pdf.h M +24 -0 generators/poppler/okularApplication_pdf.desktop M +25 -1 generators/spectre/okularApplication_ghostview.desktop M +25 -1 generators/tiff/okularApplication_tiff.desktop M +25 -1 generators/txt/okularApplication_txt.desktop M +25 -1 generators/xps/okularApplication_xps.desktop M +32 -18 part.cpp M +4 -1 part.h R +25 -1 shell/org.kde.okular.desktop M +0 -3 ui/formwidgets.cpp M +34 -285 ui/ktreeviewsearchline.cpp M +4 -107 ui/ktreeviewsearchline.h M +56 -0 ui/layers.h M +13 -0 ui/pageview.cpp M +1 -0 ui/pageview.h M +10 -1 ui/pageviewutils.cpp M +1 -0 ui/pageviewutils.h M +52 -18 ui/presentationwidget.cpp M +1 -0 ui/presentationwidget.h M +49 -9 ui/sidebar.cpp M +12 -7 ui/sidebar.h M +1 -1 ui/toc.cpp M +16 -7 ui/videowidget.cpp http://commits.kde.org/okular/8445660539256c96c47718873d4ec6164e37f471 diff --cc CMakeLists.txt index 8a23feb,d0b180e..4aea44d --- a/CMakeLists.txt +++ b/CMakeLists.txt @@@ -292,15 -211,12 +292,16 @@@ set(okularpart_SRC ui/toc.cpp ui/tocmodel.cpp ui/toolaction.cpp - ui/tts.cpp ui/videowidget.cpp + ui/layers.cpp ) -kde4_add_ui_files(okularpart_SRCS +if (Qt5TextToSpeech_FOUND) + set(okularpart_SRCS ${okularpart_SRCS} + ui/tts.cpp) +endif() + +ki18n_wrap_ui(okularpart_SRCS conf/dlgaccessibilitybase.ui conf/dlgeditorbase.ui conf/dlggeneralbase.ui diff --cc autotests/parttest.cpp index a2a7c1b,46bbf90..66d6f9d --- a/autotests/parttest.cpp +++ b/autotests/parttest.cpp @@@ -7,16 -7,19 +7,19 @@@ * (at your option) any later version. * ***************************************************************************/ -#include <qtest_kde.h> -#include <qtestmouse.h> +#include <QtTest> + #include "../core/page.h" #include "../part.h" #include "../ui/toc.h" + #include "../ui/pageview.h" #include <KConfigDialog> +#include <KGlobal> #include <KStandardDirs> -#include <KTempDir> +#include <KAboutData> + #include <QClipboard> #include <QTreeView> namespace Okular @@@ -170,6 -163,34 +174,34 @@@ void PartTest::testGeneratorPreferences delete dialog; } + void PartTest::testSelectText() + { + QVariantList dummyArgs; - Okular::Part part(NULL, NULL, dummyArgs, KGlobal::mainComponent()); ++ Okular::Part part(NULL, NULL, dummyArgs); + part.openDocument(KDESRCDIR "data/file2.pdf"); + part.widget()->show(); + QTest::qWaitForWindowShown(part.widget()); + + const int width = part.m_pageView->width(); + const int height = part.m_pageView->height(); + + // wait for pixmap + while (!part.m_document->page(0)->hasPixmap(part.m_pageView)) + QTest::qWait(100); + + QMetaObject::invokeMethod(part.m_pageView, "slotSetMouseTextSelect"); + + QTest::mouseMove(part.m_pageView->viewport(), QPoint(width * 0.12, height * 0.16)); + QTest::mousePress(part.m_pageView->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(width * 0.12, height * 0.16)); + QTest::mouseMove(part.m_pageView->viewport(), QPoint(width * 0.8, height * 0.16)); + QTest::mouseRelease(part.m_pageView->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(width * 0.8, height * 0.16)); + + QApplication::clipboard()->clear(); + QMetaObject::invokeMethod(part.m_pageView, "copyTextSelection"); + + QCOMPARE(QApplication::clipboard()->text(), QString("Hola que tal\n")); + } + } int main(int argc, char *argv[]) diff --cc cmake/modules/FindPoppler.cmake index 4362967,10e1ec7..80a7862 --- a/cmake/modules/FindPoppler.cmake +++ b/cmake/modules/FindPoppler.cmake @@@ -84,14 -130,25 +84,25 @@@ check_cxx_source_compiles( int main() { Poppler::Page *p = 0; - p->annotations( QSet<Poppler::Annotation::SubType>() << Poppler::Annotation::ASound ); + p->annotations( QSet<Poppler::Annotation::SubType>() << Poppler::Annotation::ARichMedia ); return 0; } -" HAVE_POPPLER_0_28) +" HAVE_POPPLER_0_36) + check_cxx_source_compiles(" + #include <poppler-qt4.h> + int main() + { + Poppler::PageTransition *p = 0; + return p->durationReal(); + } + " HAVE_POPPLER_0_37) + set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_LIBRARIES) - if (HAVE_POPPLER_0_28) + if (HAVE_POPPLER_0_37) + set(popplerVersionMessage "0.37") + elseif (HAVE_POPPLER_0_28) set(popplerVersionMessage "0.28") elseif (HAVE_POPPLER_0_24) set(popplerVersionMessage "0.24") diff --cc core/document.h index dab0364,63f5874..1e49b33 --- a/core/document.h +++ b/core/document.h @@@ -19,18 -19,19 +19,19 @@@ #include <QtCore/QObject> #include <QtCore/QStringList> #include <QtCore/QVector> -#include <QtGui/QPrinter> +#include <QtPrintSupport/QPrinter> #include <QtXml/QDomDocument> -#include <kmimetype.h> +#include <QMimeType> +#include <QUrl> class QPrintDialog; -class KComponentData; class KBookmark; class KConfigDialog; +class KComponentData; class KXMLGUIClient; -class KUrl; class DocumentItem; + class QAbstractItemModel; namespace Okular { diff --cc generators/chm/okularApplication_chm.desktop index 57f1468,0a0052c..56e2bd7 --- a/generators/chm/okularApplication_chm.desktop +++ b/generators/chm/okularApplication_chm.desktop @@@ -124,7 -124,31 +124,31 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx -Exec=okular %U %i -caption %c +Exec=okular %U Icon=okular Type=Application InitialPreference=3 diff --cc generators/comicbook/okularApplication_comicbook.desktop index dee494b,410be84..7b47eee --- a/generators/comicbook/okularApplication_comicbook.desktop +++ b/generators/comicbook/okularApplication_comicbook.desktop @@@ -124,7 -124,31 +124,31 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx -Exec=okular %U %i -caption %c +Exec=okular %U Icon=okular Type=Application InitialPreference=7 diff --cc generators/djvu/okularApplication_djvu.desktop index 1dc6e15,8a5b9d0..655b0bc --- a/generators/djvu/okularApplication_djvu.desktop +++ b/generators/djvu/okularApplication_djvu.desktop @@@ -124,7 -124,31 +124,31 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx -Exec=okular %U %i -caption %c +Exec=okular %U Icon=okular Type=Application InitialPreference=7 diff --cc generators/dvi/okularApplication_dvi.desktop index b88c9f6,bdf5319..052ab7b --- a/generators/dvi/okularApplication_dvi.desktop +++ b/generators/dvi/okularApplication_dvi.desktop @@@ -124,7 -124,31 +124,31 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx -Exec=okular %U %i -caption %c +Exec=okular %U Icon=okular Type=Application InitialPreference=7 diff --cc generators/epub/okularApplication_epub.desktop index f6b427e,706ceba..839cd9f --- a/generators/epub/okularApplication_epub.desktop +++ b/generators/epub/okularApplication_epub.desktop @@@ -124,7 -124,31 +124,31 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 - Exec=okular %U + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx -Exec=okular %U %i -caption %c ++Exec=okular %U Icon=okular Type=Application InitialPreference=1 diff --cc generators/fax/okularApplication_fax.desktop index d090ef9,d0bfab6..4958aca --- a/generators/fax/okularApplication_fax.desktop +++ b/generators/fax/okularApplication_fax.desktop @@@ -124,7 -124,31 +124,31 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 - Exec=okular %U + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx -Exec=okular %U %i -caption %c ++Exec=okular %U Icon=okular Type=Application InitialPreference=1 diff --cc generators/fictionbook/okularApplication_fb.desktop index 3edba26,80f5867..97c9dec --- a/generators/fictionbook/okularApplication_fb.desktop +++ b/generators/fictionbook/okularApplication_fb.desktop @@@ -124,7 -124,31 +124,31 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 - Exec=okular %U + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx -Exec=okular %U %i -caption %c ++Exec=okular %U Icon=okular Type=Application InitialPreference=7 diff --cc generators/kimgio/okularApplication_kimgio.desktop index 05d8802,1245df9..7090377 --- a/generators/kimgio/okularApplication_kimgio.desktop +++ b/generators/kimgio/okularApplication_kimgio.desktop @@@ -124,7 -124,31 +124,31 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 - Exec=okular %U + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx -Exec=okular %U %i -caption %c ++Exec=okular %U Icon=okular Type=Application InitialPreference=1 diff --cc generators/mobipocket/okularApplication_mobi.desktop index d8513fc,ab43d58..df3b6b8 --- a/generators/mobipocket/okularApplication_mobi.desktop +++ b/generators/mobipocket/okularApplication_mobi.desktop @@@ -124,8 -124,32 +124,32 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx TryExec=okular -Exec=okular %U %i -caption %c +Exec=okular %U Icon=okular Type=Application InitialPreference=1 diff --cc generators/ooo/okularApplication_ooo.desktop index 52219cc,e097e7a..02a4719 --- a/generators/ooo/okularApplication_ooo.desktop +++ b/generators/ooo/okularApplication_ooo.desktop @@@ -124,7 -124,31 +124,31 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 - Exec=okular %U + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx -Exec=okular %U %i -caption %c ++Exec=okular %U Icon=okular Type=Application InitialPreference=2 diff --cc generators/plucker/okularApplication_plucker.desktop index aca74ce,7af315f..da29ec9 --- a/generators/plucker/okularApplication_plucker.desktop +++ b/generators/plucker/okularApplication_plucker.desktop @@@ -124,7 -124,31 +124,31 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 - Exec=okular %U + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx -Exec=okular %U %i -caption %c ++Exec=okular %U Icon=okular Type=Application InitialPreference=7 diff --cc generators/poppler/config-okular-poppler.h.cmake index 792dcf1,c3e9b18..ecfb9c7 --- a/generators/poppler/config-okular-poppler.h.cmake +++ b/generators/poppler/config-okular-poppler.h.cmake @@@ -4,5 -16,5 +4,8 @@@ /* Defined if we have the 0.28 version of the Poppler library */ #cmakedefine HAVE_POPPLER_0_28 1 +/* Defined if we have the 0.36 version of the Poppler library */ +#cmakedefine HAVE_POPPLER_0_36 1 ++ + /* Defined if we have the 0.37 version of the Poppler library */ + #cmakedefine HAVE_POPPLER_0_37 1 diff --cc generators/poppler/generator_pdf.h index d66eb3b,7d2c8e8..bca64ee --- a/generators/poppler/generator_pdf.h +++ b/generators/poppler/generator_pdf.h @@@ -62,43 -62,44 +62,44 @@@ class PDFGenerator : public Okular::Gen Okular::Document::OpenResult loadDocumentFromDataWithPassword( const QByteArray & fileData, QVector<Okular::Page*> & pagesVector, const QString & password ); void loadPages(QVector<Okular::Page*> &pagesVector, int rotation=-1, bool clear=false); // [INHERITED] document information - Okular::DocumentInfo generateDocumentInfo( const QSet<Okular::DocumentInfo::Key> &keys ) const; - const Okular::DocumentSynopsis * generateDocumentSynopsis(); - Okular::FontInfo::List fontsForPage( int page ); - const QList<Okular::EmbeddedFile*> * embeddedFiles() const; - PageSizeMetric pagesSizeMetric() const { return Pixels; } - QAbstractItemModel * layersModel() const; + Okular::DocumentInfo generateDocumentInfo( const QSet<Okular::DocumentInfo::Key> &keys ) const Q_DECL_OVERRIDE; + const Okular::DocumentSynopsis * generateDocumentSynopsis() Q_DECL_OVERRIDE; + Okular::FontInfo::List fontsForPage( int page ) Q_DECL_OVERRIDE; + const QList<Okular::EmbeddedFile*> * embeddedFiles() const Q_DECL_OVERRIDE; - PageSizeMetric pagesSizeMetric() const Q_DECL_OVERRIDE{ return Pixels; } ++ PageSizeMetric pagesSizeMetric() const Q_DECL_OVERRIDE{ return Pixels; } ++ QAbstractItemModel * layersModel() const Q_DECL_OVERRIDE; // [INHERITED] document information - bool isAllowed( Okular::Permission permission ) const; + bool isAllowed( Okular::Permission permission ) const Q_DECL_OVERRIDE; // [INHERITED] perform actions on document / pages - QImage image( Okular::PixmapRequest *page ); + QImage image( Okular::PixmapRequest *page ) Q_DECL_OVERRIDE; // [INHERITED] print page using an already configured kprinter - bool print( QPrinter& printer ); + bool print( QPrinter& printer ) Q_DECL_OVERRIDE; // [INHERITED] reply to some metadata requests - QVariant metaData( const QString & key, const QVariant & option ) const; + QVariant metaData( const QString & key, const QVariant & option ) const Q_DECL_OVERRIDE; // [INHERITED] reparse configuration - bool reparseConfig(); - void addPages( KConfigDialog * ); + bool reparseConfig() Q_DECL_OVERRIDE; + void addPages( KConfigDialog * ) Q_DECL_OVERRIDE; // [INHERITED] text exporting - Okular::ExportFormat::List exportFormats() const; - bool exportTo( const QString &fileName, const Okular::ExportFormat &format ); + Okular::ExportFormat::List exportFormats() const Q_DECL_OVERRIDE; + bool exportTo( const QString &fileName, const Okular::ExportFormat &format ) Q_DECL_OVERRIDE; // [INHERITED] print interface - QWidget* printConfigurationWidget() const; + QWidget* printConfigurationWidget() const Q_DECL_OVERRIDE; // [INHERITED] save interface - bool supportsOption( SaveOption ) const; - bool save( const QString &fileName, SaveOptions options, QString *errorText ); - Okular::AnnotationProxy* annotationProxy() const; + bool supportsOption( SaveOption ) const Q_DECL_OVERRIDE; + bool save( const QString &fileName, SaveOptions options, QString *errorText ) Q_DECL_OVERRIDE; + Okular::AnnotationProxy* annotationProxy() const Q_DECL_OVERRIDE; protected: - bool doCloseDocument(); - Okular::TextPage* textPage( Okular::Page *page ); + bool doCloseDocument() Q_DECL_OVERRIDE; + Okular::TextPage* textPage( Okular::Page *page ) Q_DECL_OVERRIDE; protected slots: void requestFontData(const Okular::FontInfo &font, QByteArray *data); diff --cc generators/poppler/okularApplication_pdf.desktop index afa4f0e,e0e8cd7..85b5c95 --- a/generators/poppler/okularApplication_pdf.desktop +++ b/generators/poppler/okularApplication_pdf.desktop @@@ -124,7 -124,31 +124,31 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx -Exec=okular %U %i -caption %c +Exec=okular %U Icon=okular Type=Application InitialPreference=8 diff --cc generators/spectre/okularApplication_ghostview.desktop index a4937b5,d6f462d..7d8f40d --- a/generators/spectre/okularApplication_ghostview.desktop +++ b/generators/spectre/okularApplication_ghostview.desktop @@@ -124,7 -124,31 +124,31 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 - Exec=okular %U + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx -Exec=okular %U %i -caption %c ++Exec=okular %U Icon=okular Type=Application InitialPreference=7 diff --cc generators/tiff/okularApplication_tiff.desktop index 1a35e38,a7a5e11..ae5c6a9 --- a/generators/tiff/okularApplication_tiff.desktop +++ b/generators/tiff/okularApplication_tiff.desktop @@@ -124,7 -124,31 +124,31 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 - Exec=okular %U + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx -Exec=okular %U %i -caption %c ++Exec=okular %U Icon=okular Type=Application InitialPreference=1 diff --cc generators/txt/okularApplication_txt.desktop index b91d101,fb303d8..92b9db9 --- a/generators/txt/okularApplication_txt.desktop +++ b/generators/txt/okularApplication_txt.desktop @@@ -124,7 -124,31 +124,31 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 - Exec=okular %U + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx -Exec=okular %U %i -caption %c ++Exec=okular %U Icon=okular Type=Application InitialPreference=3 diff --cc generators/xps/okularApplication_xps.desktop index a795b04,40da21d..7d57b33 --- a/generators/xps/okularApplication_xps.desktop +++ b/generators/xps/okularApplication_xps.desktop @@@ -124,7 -124,31 +124,31 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 - Exec=okular %U + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx -Exec=okular %U %i -caption %c ++Exec=okular %U Icon=okular Type=Application InitialPreference=7 diff --cc part.cpp index bce40cd,d8f1750..910e486 --- a/part.cpp +++ b/part.cpp @@@ -361,31 -376,35 +362,37 @@@ m_cliPresentation(false), m_cliPrint(fa // [left toolbox: Table of Contents] | [] m_toc = new TOC( 0, m_document ); connect( m_toc, SIGNAL(hasTOC(bool)), this, SLOT(enableTOC(bool)) ); - tbIndex = m_sidebar->addItem( m_toc, QIcon::fromTheme(QApplication::isLeftToRight() ? "format-justify-left" : "format-justify-right"), i18n("Contents") ); - m_sidebar->addItem( m_toc, KIcon(QApplication::isLeftToRight() ? "format-justify-left" : "format-justify-right"), i18n("Contents") ); ++ m_sidebar->addItem( m_toc, QIcon::fromTheme(QApplication::isLeftToRight() ? "format-justify-left" : "format-justify-right"), i18n("Contents") ); enableTOC( false ); + // [left toolbox: Layers] | [] + m_layers = new Layers( 0, m_document ); + connect( m_layers, SIGNAL(hasLayers(bool)), this, SLOT(enableLayers(bool)) ); - m_sidebar->addItem( m_layers, KIcon( "draw-freehand" ), i18n( "Layers" ) ); ++ m_sidebar->addItem( m_layers, QIcon::fromTheme( "draw-freehand" ), i18n( "Layers" ) ); + enableLayers( false ); + // [left toolbox: Thumbnails and Bookmarks] | [] - KVBox * thumbsBox = new ThumbnailsBox( 0 ); - thumbsBox->setSpacing( 6 ); + QWidget * thumbsBox = new ThumbnailsBox( 0 ); + thumbsBox->layout()->setSpacing( 6 ); m_searchWidget = new SearchWidget( thumbsBox, m_document ); + thumbsBox->layout()->addWidget(m_searchWidget); m_thumbnailList = new ThumbnailList( thumbsBox, m_document ); + thumbsBox->layout()->addWidget(m_thumbnailList); // ThumbnailController * m_tc = new ThumbnailController( thumbsBox, m_thumbnailList ); connect( m_thumbnailList, SIGNAL(rightClick(const Okular::Page*,QPoint)), this, SLOT(slotShowMenu(const Okular::Page*,QPoint)) ); - tbIndex = m_sidebar->addItem( thumbsBox, QIcon::fromTheme( "view-preview" ), i18n("Thumbnails") ); - m_sidebar->setCurrentIndex( tbIndex ); - m_sidebar->addItem( thumbsBox, KIcon( "view-preview" ), i18n("Thumbnails") ); ++ m_sidebar->addItem( thumbsBox, QIcon::fromTheme( "view-preview" ), i18n("Thumbnails") ); + + m_sidebar->setCurrentItem( thumbsBox ); // [left toolbox: Reviews] | [] m_reviewsWidget = new Reviews( 0, m_document ); - m_sidebar->addItem( m_reviewsWidget, KIcon("draw-freehand"), i18n("Reviews") ); + m_sidebar->addItem( m_reviewsWidget, QIcon::fromTheme("draw-freehand"), i18n("Reviews") ); - m_sidebar->setItemEnabled( 2, false ); + m_sidebar->setItemEnabled( m_reviewsWidget, false ); // [left toolbox: Bookmarks] | [] m_bookmarkList = new BookmarkList( m_document, 0 ); - m_sidebar->addItem( m_bookmarkList, KIcon("bookmarks"), i18n("Bookmarks") ); + m_sidebar->addItem( m_bookmarkList, QIcon::fromTheme("bookmarks"), i18n("Bookmarks") ); - m_sidebar->setItemEnabled( 3, false ); + m_sidebar->setItemEnabled( m_bookmarkList, false ); // widgets: [../miniBarContainer] | [] #ifdef OKULAR_ENABLE_MINIBAR @@@ -1765,13 -1786,13 +1774,13 @@@ void Part::slotDoFileDirty( if ( m_viewportDirty.pageNumber >= (int) m_document->pages() ) m_viewportDirty.pageNumber = (int) m_document->pages() - 1; m_document->setViewport( m_viewportDirty ); - m_oldUrl = KUrl(); + m_oldUrl = QUrl(); m_viewportDirty.pageNumber = -1; m_document->setRotation( m_dirtyPageRotation ); - if ( m_sidebar->currentIndex() != m_dirtyToolboxIndex && m_sidebar->isItemEnabled( m_dirtyToolboxIndex ) + if ( m_sidebar->currentItem() != m_dirtyToolboxItem && m_sidebar->isItemEnabled( m_dirtyToolboxItem ) && !m_sidebar->isCollapsed() ) { - m_sidebar->setCurrentIndex( m_dirtyToolboxIndex ); + m_sidebar->setCurrentItem( m_dirtyToolboxItem ); } if ( m_sidebar->isSidebarVisible() != m_wasSidebarVisible ) { diff --cc part.h index 80a066e,44d032e..b1ded8d --- a/part.h +++ b/part.h @@@ -64,7 -64,7 +64,8 @@@ class MiniBarLogic class FileKeeper; class Reviews; class BookmarkList; +class DrawingToolActions; + class Layers; namespace Okular { @@@ -283,10 -285,10 +286,10 @@@ class OKULARPART_EXPORT Part : public K // document watcher (and reloader) variables KDirWatch *m_watcher; QTimer *m_dirtyHandler; - KUrl m_oldUrl; + QUrl m_oldUrl; Okular::DocumentViewport m_viewportDirty; bool m_wasPresentationOpen; - int m_dirtyToolboxIndex; + QWidget *m_dirtyToolboxItem; bool m_wasSidebarVisible; bool m_wasSidebarCollapsed; bool m_fileWasRemoved; diff --cc shell/org.kde.okular.desktop index fa9179e,9978c22..b8ef3b7 --- a/shell/org.kde.okular.desktop +++ b/shell/org.kde.okular.desktop @@@ -123,7 -123,31 +123,31 @@@ GenericName[uk]=Переглядач д GenericName[x-test]=xxDocument Viewerxx GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 - Exec=okular %U + Comment=Universal document viewer + Comment[ca]=Visualitzador universal de documents + Comment[cs]=Uneverzální prohlížeč dokumentů + Comment[de]=Universeller Dokumentenbetrachter + Comment[el]=Καθολικός προβολέας εγγράφων + Comment[en_GB]=Universal document viewer + Comment[es]=Visor de documentos universal + Comment[fi]=Yleinen asiakirjakatselin + Comment[is]=Fjölhæfur skjalaskoðari + Comment[it]=Visore di documenti universale + Comment[ko]=만능 문서 뷰어 + Comment[nl]=Universele documentviewer + Comment[pl]=Wszechstronna przeglądarka dokumentów + Comment[pt]=Visualizador de documentos universal + Comment[pt_BR]=Visualizador de documentos universal + Comment[sk]=Univerzálny prehliadač dokumentov + Comment[sl]=Vsestranski pregledovalnik dokumentov + Comment[sr]=Универзални приказивач докумената + Comment[sr@ijekavian]=Универзални приказивач докумената + Comment[sr@ijekavianlatin]=Univerzalni prikazivač dokumenata + Comment[sr@latin]=Univerzalni prikazivač dokumenata + Comment[sv]=Generell dokumentvisare + Comment[uk]=Універсальний переглядач документів + Comment[x-test]=xxUniversal document viewerxx -Exec=okular %U %i -caption %c ++Exec=okular %U Icon=okular Type=Application X-DocPath=okular/index.html diff --cc ui/ktreeviewsearchline.cpp index f84e523,4a987ec..5a9fdd3 --- a/ui/ktreeviewsearchline.cpp +++ b/ui/ktreeviewsearchline.cpp @@@ -179,26 -123,9 +123,6 @@@ void KTreeViewSearchLine::Private::slot // private methods //////////////////////////////////////////////////////////////////////////////// -- - void KTreeViewSearchLine::Private::checkColumns() - { - canChooseColumns = parent->canChooseColumnsCheck(); - } - - void KTreeViewSearchLine::Private::checkItemParentsNotVisible( QTreeView *treeView ) - { - // TODO: PORT ME - #if 0 - QTreeWidgetItemIterator it( treeWidget ); - - for ( ; *it; ++it ) { - QTreeWidgetItem *item = *it; - item->treeWidget()->setItemHidden( item, !parent->itemMatches( item, search ) ); - } - #endif - } - - -#include <kvbox.h> - /** Check whether \p item, its siblings and their descendents should be shown. Show or hide the items as necessary. * * \p item The list view item to start showing / hiding items at. Typically, this is the first child of another item, or the diff --cc ui/ktreeviewsearchline.h index bbb372d,64a35ef..39350f4 --- a/ui/ktreeviewsearchline.h +++ b/ui/ktreeviewsearchline.h @@@ -48,22 -47,12 +47,12 @@@ class KTreeViewSearchLine : public KLin * Constructs a KTreeViewSearchLine with \a treeView being the QTreeView to * be filtered. * - * If \a treeView is null then the widget will be disabled until listviews - * are set with setTreeView(), setTreeViews() or added with addTreeView(). + * If \a treeView is null then the widget will be disabled until listview + * are set with setTreeView(). */ - explicit KTreeViewSearchLine( QWidget *parent = 0, QTreeView *treeView = 0 ); + explicit KTreeViewSearchLine( QWidget *parent = Q_NULLPTR, QTreeView *treeView = 0 ); /** - * Constructs a KTreeViewSearchLine with \a treeViews being the list of - * pointers to QTreeViews to be filtered. - * - * If \a treeViews is empty then the widget will be disabled until listviews - * are set with setTreeView(), setTreeViews() or added with addTreeView(). - */ - KTreeViewSearchLine( QWidget *parent, const QList<QTreeView *> &treeViews ); - - - /** * Destroys the KTreeViewSearchLine. */ virtual ~KTreeViewSearchLine(); diff --cc ui/layers.h index 0000000,66c9543..42b226f mode 000000,100644..100644 --- a/ui/layers.h +++ b/ui/layers.h @@@ -1,0 -1,56 +1,56 @@@ + /*************************************************************************** + * Copyright (C) 2015 by Saheb Preet Singh <[email protected]> * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + + #ifndef _OKULAR_LAYERS_H_ + #define _OKULAR_LAYERS_H_ + + #include <qwidget.h> + #include "core/observer.h" + -#include "okular_part_export.h" ++#include "okularpart_export.h" + + class PageView; + class QModelIndex; + class QTreeView; + class KTreeViewSearchLine; + + namespace Okular { + class Document; + class PartTest; + } + -class OKULAR_PART_EXPORT Layers : public QWidget, public Okular::DocumentObserver ++class OKULARPART_EXPORT Layers : public QWidget, public Okular::DocumentObserver + { + Q_OBJECT + friend class Okular::PartTest; + + public: + Layers(QWidget *parent, Okular::Document *document); + ~Layers(); + + // inherited from DocumentObserver + void notifySetup( const QVector< Okular::Page * > & pages, int setupFlags ); + + void setPageView( PageView *pageView ); + + signals: + void hasLayers(bool has); + + private slots: + void saveSearchOptions(); + + private: + + Okular::Document *m_document; + QTreeView *m_treeView; + KTreeViewSearchLine *m_searchLine; + PageView *m_pageView; + }; + + #endif diff --cc ui/presentationwidget.cpp index 18413e7,d8895e5..3680de1 --- a/ui/presentationwidget.cpp +++ b/ui/presentationwidget.cpp @@@ -1232,11 -1193,57 +1218,57 @@@ QRect PresentationWidget::routeMouseDra double nX = ( (double)e->x() - (double)geom.left() ) / (double)geom.width(); double nY = ( (double)e->y() - (double)geom.top() ) / (double)geom.height(); QRect ret; - if ( hasclicked && nX >= 0 && nX < 1 && nY >= 0 && nY < 1 ) + bool isInside = nX >= 0 && nX < 1 && nY >= 0 && nY < 1; + + if ( hasclicked && !isInside ) { + // Fake a move to the last border pos + nX = qBound(0., nX, 1.); + nY = qBound(0., nY, 1.); + m_drawingEngine->event( AnnotatorEngine::Move, button, nX, nY, geom.width(), geom.height(), page ); + + // Fake a release in the following lines + eventType = AnnotatorEngine::Release; + isInside = true; + } else if ( !hasclicked && isInside ) + { + // we're coming from the outside, pretend we started clicking at the closest border + if ( nX < ( 1 - nX ) && nX < nY && nX < ( 1 - nY ) ) + nX = 0; + else if ( nY < ( 1 - nY ) && nY < nX && nY < ( 1 - nX ) ) + nY = 0; + else if ( ( 1 - nX ) < nX && ( 1 - nX ) < nY && ( 1 - nX ) < ( 1 - nY ) ) + nX = 1; + else + nY = 1; + + hasclicked = true; + eventType = AnnotatorEngine::Press; + } + + if ( hasclicked && isInside ) + { ret = m_drawingEngine->event( eventType, button, nX, nY, geom.width(), geom.height(), page ); + } if ( eventType == AnnotatorEngine::Release ) + { hasclicked = false; + } + + if ( m_drawingEngine->creationCompleted() ) + { + // add drawing to current page + m_frames[ m_frameIndex ]->drawings << m_drawingEngine->endSmoothPath(); + + // manually disable and re-enable the pencil mode, so we can do + // cleaning of the actual drawer and create a new one just after + // that - that gives continuous drawing - togglePencilMode( false ); - togglePencilMode( true ); ++ slotChangeDrawingToolEngine( QDomElement() ); ++ slotChangeDrawingToolEngine( m_currentDrawingToolElement ); + + // schedule repaint + update(); + } return ret; } diff --cc ui/sidebar.h index f99bf5d,6865878..5856378 --- a/ui/sidebar.h +++ b/ui/sidebar.h @@@ -41,14 -44,14 +43,14 @@@ class Sidebar : public QWidge void setCollapsed( bool collapsed ); bool isCollapsed() const; - void moveSplitter( int sideWidgetSize ); + void moveSplitter( int sideWidgetSize ); signals: - void urlsDropped( const KUrl::List& urls ); + void urlsDropped( const QList<QUrl>& urls ); protected: - void dragEnterEvent( QDragEnterEvent* event ); - void dropEvent( QDropEvent* event ); + void dragEnterEvent( QDragEnterEvent* event ) Q_DECL_OVERRIDE; + void dropEvent( QDropEvent* event ) Q_DECL_OVERRIDE; private slots: void itemClicked( QListWidgetItem *item ); diff --cc ui/toc.cpp index 707c368,09625af..a205ad1 --- a/ui/toc.cpp +++ b/ui/toc.cpp @@@ -47,9 -47,9 +47,9 @@@ TOC::TOC(QWidget *parent, Okular::Docum m_treeView->setItemDelegate( new PageItemDelegate( m_treeView ) ); m_treeView->header()->hide(); m_treeView->setSelectionBehavior( QAbstractItemView::SelectRows ); - connect( m_treeView, SIGNAL(clicked(QModelIndex)), this, SLOT(slotExecuted(QModelIndex)) ); - connect( m_treeView, SIGNAL(activated(QModelIndex)), this, SLOT(slotExecuted(QModelIndex)) ); + connect(m_treeView, &QTreeView::clicked, this, &TOC::slotExecuted); + connect(m_treeView, &QTreeView::activated, this, &TOC::slotExecuted); - m_searchLine->addTreeView( m_treeView ); + m_searchLine->setTreeView( m_treeView ); } TOC::~TOC() _______________________________________________ kde-doc-english mailing list [email protected] https://mail.kde.org/mailman/listinfo/kde-doc-english
