1. 17 Jul, 2019 1 commit
    • Nate Graham's avatar
      Add "Open Containing Folder" feature · ea0ea9c9
      Nate Graham authored
      Summary:
      This patch adds an "Open Containing Folder" menu item to the file menu, similar to
      other KDE apps like Gwenview that have it there. This action is especially useful
      for the case when you've downloaded a PDF from the internet that opens itself in
      Okular. The location of this file may not be clear or easy to find without this
      feature, and on several occasiona I have found myself wishing for it when this
      happens.
      
      Test Plan:
      - Delete or move aside `~/.local/config/kxmlgui5/okular/part.rc`
      - Menu item is enabled and works when there is an open document: {F6940449, size=full}
      - Menu item is disabled when there is no open document: {F6940448, size=full}
      
      Reviewers: #okular, aacid, sander
      
      Reviewed By: #okular, aacid
      
      Subscribers: shubham, davidhurka, okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D22145
      ea0ea9c9
  2. 27 May, 2019 1 commit
  3. 21 Apr, 2019 1 commit
    • Shubham  .'s avatar
      Add action in Edit menu to select the text on current page · f788b5a3
      Shubham . authored
      BUG: 358868
      
      Test Plan: Click on "Select All Text on Current Page" entry in Edit menu to select the entire page. The selected text can then be copied via Edit menu item "Copy"
      
      Reviewers: aacid, #vdg, ngraham
      
      Reviewed By: #vdg, ngraham
      
      Subscribers: yurchor, michaelweghorn, kde-doc-english, davidhurka, abetts, loh.tar, alexde, ngraham, okular-devel
      
      Tags: #okular, #documentation
      
      Differential Revision: https://phabricator.kde.org/D18744
      f788b5a3
  4. 03 Apr, 2019 1 commit
    • Michael Weghorn's avatar
      Add option to ignore print margins for non-PDF generators · 8bf1a911
      Michael Weghorn authored
      Summary:
      This adds a combobox in the print dialog of the non-PDF
      generators to allow selecting whether or not to take
      print margins into account.
      
      For the PDF case and rasterized printing, new print otions have
      been implemented in commit 2e97d587
      already, which adds an additional option to do no scaling at all.
      
      For consistency reasons, the same terms also used for the PDF
      case are used in the combobox (i.e. the two of the three that
      apply).
      
      This adds a new abstract class 'PrintOptionsWidget' with a
      'ignorePrintMargins()' method to indicate whether print margins
      should be ignored or not, and a default implementation.
      The existing widget for the PDF generator now derives from this
      class.
      
      In order to avoid an ABI breakage, the return value of
      'Document::printConfigurationWidget' is left as a 'QWidget *'
      and a dynamic_cast is done on use.
      
      FilePrinter is adapted to take into account the value set by
      'QPrinter::setFullPage()' and the margin options
      are now passed accordingly (either the values set in the dialog or '0').
      
      A big thanks to Albert Astals Cid <aacid@kde.org> for showing how
      to extend the initial implementation to cover more generators.
      
      Test Plan:
      1) Open a PostScript file in Okular (using a document size that matches
        a paper size available on the printer used later makes it easier
        to see things behave as expected)
      
      2) open print dialog, go to "Print options" and notice that there is a new
        "Scale mode" combobox whose value is set to "Fit to printable area"
         by default.
      
      3) don't change any options, print to a printer that has hardware margins
      
      Expected result: the document is scaled to the printable area (e.g.
      scaled down so that the printer's hardware margins remain empty) as it
      has been without this change.
      
      4) Set the value of the "Print Options" -> "Scale mode" combobox to
         "Fit to full page" and print again
      
      Expected result: The document is scaled to the full page size, i.e. ignoring
      the printer's hardware margins.
      
      5) Try steps 1-4 with other document formats supported by Okular and
         observe that they behave the same (except for the PDF case, where
         there's a combobox with three options that has been implemented
         independent of this change).
      
      Reviewers: #okular, ngraham
      
      Reviewed By: ngraham
      
      Subscribers: fvogt, rkflx, arthurpeters, ltoscano, okular-devel, aacid, ngraham
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D10974
      8bf1a911
  5. 12 Mar, 2019 1 commit
  6. 13 Feb, 2019 1 commit
  7. 10 Jan, 2019 1 commit
    • Chinmoy Ranjan Pradhan's avatar
      Implement digital signature support for PDF · a234a902
      Chinmoy Ranjan Pradhan authored
      This is a squash of the original branch
      
      It also contains fixes/rework from Albert Astals Cid
      
      If you're interested in its history have a look at the
      gsoc2018_digitalsignature branch
      
      The poppler dependency situation is:
       * With 0.51 you get most signature information
       * With 0.68 you also get signature location/reason information
       * With 0.73 you also get signature certificate information
      a234a902
  8. 04 Jan, 2019 1 commit
  9. 21 Dec, 2018 2 commits
  10. 18 Dec, 2018 1 commit
  11. 14 Nov, 2018 1 commit
  12. 02 Nov, 2018 1 commit
  13. 01 Nov, 2018 1 commit
  14. 28 Oct, 2018 1 commit
    • Michel Ludwig's avatar
      Don't call 'KDirWatch::stopScan()' · dcacd830
      Michel Ludwig authored
      KDirWatch maintains one global watch list per application only. Calling
      'stopScan' could therefore affect other code paths that make use of
      KDirWatch (other loaded KParts, for example).
      
      BUG: 400190
      dcacd830
  15. 23 Oct, 2018 2 commits
  16. 22 Oct, 2018 1 commit
  17. 08 Oct, 2018 1 commit
  18. 31 Aug, 2018 1 commit
  19. 26 Aug, 2018 1 commit
    • Peter Wu's avatar
      TOC: Add collapse/expand options · 61c2c2ce
      Peter Wu authored
      Large specifications with many (nested) sections are painful to navigate
      through when the TOC is expanded by default. Introduce four new options,
      "Expand/Collapse whole section" is based on Kate's document view while
      "Expand/Collapse all" was added to handle the top-level sections.
      
      As for other viewers, PDF.js uses shift-click to handle the former while
      using double-click on a the TOC icon to handle the latter. That is not
      very obvious, so extending the context menu seems the next best option.
      
      BUG: 216870
      
      Differential Revision: https://phabricator.kde.org/D14904
      61c2c2ce
  20. 13 Aug, 2018 1 commit
    • Ahmad Osama's avatar
      Fix problem of saving pdf switches from thumbnail view in sidebar to contents view · 5e622484
      Ahmad Osama authored
      Summary:
      When save/save as functions are called they internally call the openFile() function, in the open file function the side bar item is set to Table of Contents (ToC) item
      
      ```
      if ( m_document->metaData( QStringLiteral("OpenTOC") ).toBool() && m_sidebar->isItemEnabled( m_toc ) && !m_sidebar->isCollapsed() && m_sidebar->currentItem() != m_toc )
      {
           m_sidebar->setCurrentItem( m_toc, Sidebar::DoNotUncollapseIfCollapsed );
      }
      ```
      so I just store the sidebar's item before saving and then set this item back if changed.
      
      BUG: 389668
      
      Reviewers: #okular
      
      Subscribers: aacid, okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D14740
      5e622484
  21. 26 Jun, 2018 1 commit
    • Michael Eden's avatar
      Expose 'change colors' through dbus interface · 031b794e
      Michael Eden authored
      Summary:
      This exposes the Okular's functionality of changing the document's colors
      through its d-bus interface. This is mainly useful for scripting Okular to
      switch to a 'day mode' or 'night mode'.
      
      [Example] Switching themes of two applications with one hotkey:
      
      {F5905771}
      
      Reviewers: #okular, aacid
      
      Reviewed By: #okular, aacid
      
      Subscribers: okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D13471
      031b794e
  22. 24 Apr, 2018 1 commit
  23. 23 Apr, 2018 2 commits
    • Albert Astals Cid's avatar
      Use toLocal8Bit instead of toUtf8 · 991eb0ed
      Albert Astals Cid authored
      It's the most "proper" way to do it, i guess in real world scenarios it
      doesn't really matter though
      991eb0ed
    • Chinmoy Ranjan Pradhan's avatar
      Obey umask rules when saving new file · c5592689
      Chinmoy Ranjan Pradhan authored
      Summary:
      Okular saves a new file with permissions 0600 completely ignoring the umask value. This is because it
      makes use of QTemporaryFile which creates file with the said permissions and which then Okular copies
      to the new location.
      So to overcome this generate new file permissions using old mask value and change permissions of the
      new file.
      
      BUG: 392682
      
      Test Plan:
      Set umask to 0040
      Open a pdf file from the same shell and save it under a new name.
      Before patch:
      file permisions -> 0600
      After patch:
      file permisions -> 0606
      
      Reviewers: #okular, aacid
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D12049
      c5592689
  24. 16 Apr, 2018 1 commit
  25. 13 Apr, 2018 2 commits
  26. 12 Apr, 2018 1 commit
  27. 03 Mar, 2018 1 commit
    • Dileep Sankhla's avatar
      Option to exit after printing · 09b7b079
      Dileep Sankhla authored
      Summary:
      When running okular with the parameter --print to directly open the print mode, it doesn't exit after acknowledging the print dialog. Hence adding --print_and_exit option exits Okular after acknowledging the print dialog and thus is useful for the command line batch processing or a Dolphin service as the issue suggests.
      
      FEATURE: 318998
      
      Test Plan:
      1. open a file in Okular using the parameter --print. It will open Okular in print mode with the print dialog
      2. Either print the file or cancel the print dialog
      3. You will find that Okular stays open
      4. Now using this patch, see for available options with the --help parameter. You will find --print_and_exit option
      5. Now open a file in Okular using the parameter --print_and_exit. It will open Okular in print mode with the print dialog
      6. Either print the file or cancel the print dialog
      7. You will find that Okular closes after acknowledging the dialog
      
      Reviewers: aacid, #okular, ngraham
      
      Subscribers: ltoscano, ngraham, aacid, #okular
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D10249
      09b7b079
  28. 25 Feb, 2018 1 commit
    • Julian Wolff's avatar
      Make Part::openUrl not discard OpenUrlArguments · d19834f2
      Julian Wolff authored
      Applications using Okular as a KPart might set a file's mime type in the OpenUrlArguments.
      Okular currently clears the arguments while opening a document. This revision fixes this, allowing
      applications to actually pass a file's mime type to Okular.
      
      BUG: 386600
      d19834f2
  29. 05 Feb, 2018 1 commit
    • Henrik Fehlauer's avatar
      Fix saving annotations to gzipped files · ad1160be
      Henrik Fehlauer authored
      Okular supports opening zipped files like document.pdf.gz by
      transparently extracting them. However, since 559836c3 saving
      annotations back was broken. This is because this commit tries to
      prevent saving back changes to externally modified files to prevent data
      loss. The way this is checked by comparing timestamps mistakenly
      triggered for unchanged zipped files, too.
      
      This can be solved by always comparing the before/after timestamps of
      the actual file, instead of the timestamp of the temporary copy of the
      extracted file. The change has to be done in two places so saving
      repeatedly works too.
      
      BUG: 338742
      
      Test plan
          gzip autotests/data/file1.pdf && okular file1.pdf.gz
          Add annotation, saving works now instead of showing an error.
          touch normal.pdf still triggers modification warning.
      
      Differential Revision: https://phabricator.kde.org/D9580
      ad1160be
  30. 22 Jan, 2018 1 commit
  31. 07 Jan, 2018 1 commit
    • Nathaniel Graham's avatar
      Improve dialog when PDF wants to open in presentation mode · e44d5055
      Nathaniel Graham authored
      Summary:
      BUG: 388511
      
      - Describe what's actually going to happen if you answer in the affirmative
      - Use expressive button text with standard ok/cancel style icons
      - Remove tooltips, since they're not needed when the buttons clearly indicate what will happen when you press them
      
      Test Plan:
      New dialog:
      {F5626016}
      
      Both buttons still work to do what they say they'll do.
      
      Reviewers: #okular, aacid, rkflx
      
      Reviewed By: rkflx
      
      Subscribers: rkflx
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D9692
      e44d5055
  32. 14 Dec, 2017 1 commit
  33. 03 Dec, 2017 1 commit
  34. 20 Nov, 2017 1 commit
    • Albert Astals Cid's avatar
      Give warnings when the file is modified externally · 559836c3
      Albert Astals Cid authored
      Summary:
      Unfortunately, poppler (the only backed that supports saving) is not able
      to save properly if the file is modified by a third party while it is opened
      
      So we give the user a warning saying things went wrong and give him the option
      to not reload/close, that way if there was something very important in the annotations
      she added she can try to save them (even if by copy&paste the contents to a third program)
      
      Reviewers: rkflx
      
      Reviewed By: rkflx
      
      Subscribers: ngraham, rkflx, ltoscano, #okular
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D8863
      559836c3
  35. 16 Nov, 2017 2 commits