Summary: | Add option to exit after printing | ||
---|---|---|---|
Product: | [Applications] okular | Reporter: | Kai Uwe Broulik <kde> |
Component: | general | Assignee: | Okular developers <okular-devel> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | aacid, abhyu195, avinashzebisky, cgrstnr, dileepsankhla.ds, nate, ronnietom, simonandric5 |
Priority: | NOR | Keywords: | junior-jobs |
Version: | 0.16.60 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/okular/09b7b079ac92bd1da7bac6b04e2bed139506f2f8 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | Patch to add --print_and_exit |
Description
Kai Uwe Broulik
2013-04-27 23:05:15 UTC
I'd probably go with a --print_and_exit since adding a --exit param makes no sense :D Created attachment 79914 [details]
Patch to add --print_and_exit
Here's a patch to add --print_and_exit to okular. It is perhaps overly simple. Because batch processing was specifically mentioned it doesn't open the window with print dialog, it simply prints and exits (with exit status guessed via Part::doPrint(), again for batch processing/scriptability) though that would obviously be trivial to change.
Anyway, it worked the one time I tested it connected to a printer. :)
Hi Clayton, could you please use reviewboard.kde.org for the patches? It's much easier to keep track of them and comment there than here in bugzilla. Thanks! Clayton? And that's why one has to use reviewboard, because you leave a comment here and you don't add yourself to the cc's so you ignore my answers... Please Clayton, read up. is this bug open? can I solve this bug? > is this bug open?
Have you tried?
I would like to solve this bug. Where do I start? Have you compiled okular already? No. where do I get the project to get started with? I installed it, how do i compile it? Spend a few hours trying to answer the question for yourself and if you really can't find the answer come back and ask again. I installed kde4 and got a copy of okular. I'm following the steps given here https://okular.kde.org/download.php and i'm stuck at this command cmake -DCMAKE_INSTALL_PREFIX=/path/to/your/kde4/install/dir I can't seem to figure out the path to the kde4 installation, I've tried searching a lot (http://askubuntu.com/questions/527492/kde4-config-shows-no-output/527512?iemail=1&noredirect=1#527512) but couldn't find anything /path/to/your/kde4/install/dir is whatever path you want. Thank you for patiently helping, I apologize for the newbie questions. I've compiled and installed the copy of okular. How should I proceed further? Have you tried doing anything at all before asking for what to do? Anyway the bug even has a patch attached and you are not even asking about it, are you not curious about it? Maybe someone should actually read all the comments of the bug and attach it to reviewboard as I asked? Sorry this is the first time I'm trying to fix bugs so I don't have an idea about anything. I did look into the path but didn't really understand anything and after reading the comments i thought the bug hasn't been resolved yet so asked about how to go about resolving it. So, i'm going what you need to do, you need to read okular code and produce a patch that does what the bug says. From here it's your work, you need to put 99.999% of the time, and then if you have a very specific question, you drop by our IRC client or our mailing list and ask it. If you want to reuse the existing patch or not is your choice. And I hope you don't do the same mistake Clayton did. I'd like to have a go at this bug... I've compiled the program, but I think that the shell/okular file is using the okularpart from my distribution's okular package. So, how can I make okular load the 'okularpart' which was compiled with it? Do I need to install it in /usr/local? I would prefer installing it some directory in my $HOME though.. Ah.. right, I should have read the manual. Thank you! What does the issue actually mean - adding an option to automatically exit with the exit code and message after acknowledging the print dialog when launched with --print parameter or adding a separate parameter option as --print_and_exit that do the same? Or is it something different? Confuse between improving an existing parameter or adding a new parameter for the same. What comment #1 says, so add --print_and_exit Thank you. One more thing, should it opens the print dialog and then exit on printing or should it be non-GUI that simply prints and exits? If the latter case, should it print the exit code? You need to show the gui, how will you select the printer, if you want black and white or not, etc if you don't? Git commit 09b7b079ac92bd1da7bac6b04e2bed139506f2f8 by Albert Astals Cid, on behalf of Dileep Sankhla. Committed on 03/03/2018 at 16:36. Pushed by aacid into branch 'master'. Option to exit after printing 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. 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 M +11 -11 autotests/mainshelltest.cpp M +19 -4 part.cpp M +3 -1 part.h M +1 -0 shell/main.cpp M +2 -0 shell/shell.cpp M +22 -13 shell/shellutils.cpp M +3 -2 shell/shellutils.h https://commits.kde.org/okular/09b7b079ac92bd1da7bac6b04e2bed139506f2f8 |