! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Conflicting options: --save and --clipboard cannot be used at the same time.
Status:
RESOLVED: FIXED
Product:
Xfce4-screenshooter
Component:
General

Comments

Description Or Schiro 2017-12-25 11:01:37 CET
Dear all, 

I tried the following command with xfce4-screenshooter 1.8.2: 

orschiro@x230 ~ $ xfce4-screenshooter -csr ~/Pictures
Conflicting options: --save and --clipboard cannot be used at the same time.

Would it be possible to resolve this conflict between those two useful options? 

I would like to use them at the same time.

Thank you.
Comment 1 Andre Miranda editbugs 2018-01-25 02:49:21 CET
In the UI the user is able to just pick only one action so the command line options followed the same behavior. Fine, we could change the CLI options to be more flexible, but the (UX) questions are: should it be only for save and clipboard? Clipboard does not open a dialog, just save, but what about upload (zimagez), imgur and open? One dialog after the other? What if the user dismisses/cancels one of them?
Comment 2 Or Schiro 2018-01-25 14:32:26 CET
These are very good questions. In my opinion, the GUI interface can stay as simple as it is. I guess it is sufficient for most users. However, if someone wants a more customisable experience, he could default to these new CLI options. What do you think?
Comment 3 Andre Miranda editbugs 2018-02-13 01:10:32 CET
Created attachment 7596 
WIP patch

Check the attached patch, I have reworked the part of the code that handles actions, now "clipboard" is independent of other actions.
Seems to work fine, but I'm afraid I changed many things, possibly broke something, needs testing.
Comment 4 Or Schiro 2018-02-13 10:30:19 CET
Dear Andre,

Thanks so much for creating this patch!

I am currently on Fedora GNOME. Can I still help testing the patch? What would be the steps? 

Download the source code of the screenshot tool, download the patch, merge it into the source code branch and then try to compile it?

Thank you!

PS: Also shared this link on Reddit [1] to get the help from others testing. :-)

[1] https://www.reddit.com/r/xfce/comments/7x8a40/need_help_testing_patch_for_screenshot_tool_to/
Comment 5 Andre Miranda editbugs 2018-02-13 17:19:23 CET
You would need exo 0.11, I don't know if it's available in Fedora's repo. The 0.12 stable is release is just around the corner, meanwhile if you can't install it on Fedora, try a VM with Manjaro or other bleeding edge distro. You may also need other libs (e.g. xfce-dev-tools and the devel libs of xfce4ui and xfce4util) and build tools (e.g. gcc, make, libtool). Once you have things in place, these are the steps to compile the screenshooter with this patch:

git clone git://git.xfce.org/apps/xfce4-screenshooter
cd xfce4-screenshooter
curl https://bugzilla.xfce.org/attachment.cgi\?id\=7596 | git apply
./autogen.sh --prefix=/usr && make && sudo make install
Comment 6 Or Schiro 2018-02-13 17:39:45 CET
Thanks! I guess I need to test it in a virtual machine then:

checking for exo-2 >= 0.11.0... not found
*** The required package exo-2 was not found on your system.
*** Please install exo-2 (atleast version 0.11.0) or adjust
*** the PKG_CONFIG_PATH environment variable if you
*** installed the package in a nonstandard prefix so that
*** pkg-config is able to find it.

See also: https://bugzilla.redhat.com/show_bug.cgi?id=1464717
Comment 7 Or Schiro 2018-02-14 17:29:19 CET
Now installed Xubuntu 18.04 daily image on Virtualbox but still cannot compile this. Any ideas?

checking for libxfce4panel-2.0 >= 4.12.0... not found
*** The required package libxfce4panel-2.0 was not found on your system.
*** Please install libxfce4panel-2.0 (atleast version 4.12.0) or adjust
*** the PKG_CONFIG_PATH environment variable if you
*** installed the package in a nonstandard prefix so that
*** pkg-config is able to find it.
test@test-VirtualBox:~/xfce4-screenshooter$ sudo apt install libxfce4panel-2.0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libxfce4panel-2.0-4' for regex 'libxfce4panel-2.0'
Note, selecting 'libxfce4panel-2.0-dev' for regex 'libxfce4panel-2.0'
libxfce4panel-2.0-4 is already the newest version (4.12.1-1ubuntu1).
libxfce4panel-2.0-dev is already the newest version (4.12.1-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
test@test-VirtualBox:~/xfce4-screenshooter$ sudo apt install libxfce4panel-2.0-4Reading package lists... Done
Building dependency tree       
Reading state information... Done
libxfce4panel-2.0-4 is already the newest version (4.12.1-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Comment 8 Andre Miranda editbugs 2018-02-17 04:19:17 CET
From a Xubuntu 18.04 image, these are the packages I had to install:
sudo apt install git curl xfce4-dev-tools libexo-2-dev libxfce4panel-2.0-dev libxfce4ui-2-dev libsoup2.4-dev
Comment 9 Or Schiro 2018-02-17 09:00:05 CET
Now it finally compiled! :-) 

Is this the desired output when using both options?

make[4]: Entering directory '/home/test/xfce4-screenshooter'
Updating Gtk icon cache.
gtk-update-icon-cache: Cache file created successfully.
make[4]: Leaving directory '/home/test/xfce4-screenshooter'
make[3]: Leaving directory '/home/test/xfce4-screenshooter'
make[2]: Leaving directory '/home/test/xfce4-screenshooter'
make[1]: Leaving directory '/home/test/xfce4-screenshooter'
test@test-VirtualBox:~/xfce4-screenshooter$ xfce4-
xfce4-about                   xfce4-popup-directorymenu
xfce4-accessibility-settings  xfce4-popup-notes
xfce4-appearance-settings     xfce4-popup-places
xfce4-appfinder               xfce4-popup-whiskermenu
xfce4-dict                    xfce4-popup-windowmenu
xfce4-display-settings        xfce4-power-manager
xfce4-keyboard-settings       xfce4-power-manager-settings
xfce4-kiosk-query             xfce4-screenshooter
xfce4-mime-settings           xfce4-session
xfce4-mouse-settings          xfce4-session-logout
xfce4-notes                   xfce4-session-settings
xfce4-notes-settings          xfce4-settings-editor
xfce4-notifyd-config          xfce4-settings-manager
xfce4-panel                   xfce4-taskmanager
xfce4-pm-helper               xfce4-terminal
xfce4-popup-applicationsmenu  xfce4-terminal.wrapper
test@test-VirtualBox:~/xfce4-screenshooter$ xfce4-screenshooter --save --clipboard

** (xfce4-screenshooter:17568): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-YXgRICqQ8G: Connection refused
The --save option is only used when --fullscreen, --window or --region is given. It will be ignored.
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
Comment 10 Andre Miranda editbugs 2018-02-17 14:16:52 CET
That's the current behavior, you need to specify a region. You also need to indicate where --save is supposed to point the Save Dialog.
Here are a few examples that allow the use of clipboard in tandem with the other options:

xfce4-screenshooter --fullscreen --clipboard --save ~
xfce4-screenshooter --window --clipboard --upload
xfce4-screenshooter --region --clipboard --imgur

While testing this I found a bug with --open option, unrelated to this patch, I'll try to fix soon.
Comment 11 Andre Miranda editbugs 2018-02-17 15:43:17 CET
Created attachment 7606 
WIP patch 2

I opened Bug #14225 to track the --save and --open bug, I have already pushed a partial fix that is complemented by this updated patch.
Comment 12 Or Schiro 2018-02-17 20:05:33 CET
Cool! I think it works. :-)

Applied your patch 7606 and ran xfce4-screenshooter --fullscreen --clipboard --save ~

1. It shows me a dialog window to save to home
2. Then I opened Firefox
3. Went to imgur.com
4. Pressed Ctrl + V and voila, I could paste from clipboard! :-D
Comment 13 Git Bot editbugs 2018-02-24 22:49:19 CET
Andre Miranda referenced this bugreport in commit 4225942f7237f6d0bb47f1d49db53e2dac60fa71

Allow --clipboard option to be used with the others (Bug #14120)

https://git.xfce.org/apps/xfce4-screenshooter/commit?id=4225942f7237f6d0bb47f1d49db53e2dac60fa71
Comment 14 Andre Miranda editbugs 2018-02-24 22:52:28 CET
Glad you were able to build and test :)
Closing, this feature will be available in v1.9.2

Bug #14120

Reported by:
Or Schiro
Reported on: 2017-12-25
Last modified on: 2018-02-24

People

Assignee:
Andre Miranda
CC List:
1 user

Version

Attachments

WIP patch (8.32 KB, patch)
2018-02-13 01:10 CET , Andre Miranda
no flags
WIP patch 2 (8.12 KB, patch)
2018-02-17 15:43 CET , Andre Miranda
no flags

Additional information