Commit graph

123 commits

Author SHA1 Message Date
Nicolas Fella
7a4bdcc62d [cli] Allow sharing files and URLs together
Summary:
Depends on D15787

Restricting sharing multiple urls to files seems unnecessary to me.

Test Plan: kdeconnect-cli --share foo.txt google.com

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: apol, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D15788
2018-09-28 15:13:05 +02:00
Nicolas Fella
518251342c [cli] Always take working dir into account when parsing url
Summary:
Bug: 399115

When using kdeconnect-cli --share the first argument was not recognised as a file when a relative path was specified.

Test Plan:
kdeconnect-cli --share File1.txt File2.txt : Check that both files are sent
kdeconnect-cli --sahre phabricator.kde.org : Check that web page is opend

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: apol, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D15787
2018-09-28 15:12:29 +02:00
Thomas Surrel
5ae67e0feb [CLI] Unpair unreachable devices
Summary: You should be ableto unpair unreachable devices with the CLI

Reviewers: kdeconnect, albertvaka

Reviewed By: albertvaka

Subscribers: albertvaka

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D15677
2018-09-24 15:59:08 +02:00
Simon Redman
bcc9fb06db Split SMS and Telephony plugin on desktop
Summary:
Telephony and SMS handling are quite distinct so they should be in separate plugins for better maintainability, given that @sredman has big plans with SMS.
This diff should be fully backwards compatible, but whether we really want to do that is up to discussion

Test Plan: Only supeficially tested. Receive an SMS (old way), Notification is shown

Reviewers: #kde_connect, sredman

Reviewed By: sredman

Subscribers: albertvaka, apol, sredman, kdeconnect, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D13594
2018-09-10 11:31:05 +02:00
Aleix Pol
95dd01b818 Fix comment 2018-06-08 20:23:18 +02:00
Matthijs Tijink
cc072e4a2c Add more scripting helpers to cli command
Summary:
Adds "--name-only" and "--id-name-only", in addition to the already existing "--id-only".

This is useful for the zsh autocompletion which I've written.

Test Plan: The output is identical without the new flags.

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Differential Revision: https://phabricator.kde.org/D10875
2018-02-27 17:46:55 +01:00
Albert Vaca
3a955f0ced Allow sharing more than one file
Eg: --share *.mp3
2018-02-17 15:14:11 +01:00
Yuri Chornoivan
6e3fb3289a Make kdeconnect-cli translatable 2018-01-27 14:38:37 +02:00
Matthijs Tijink
6a6b97e7c9 Fix kdeconnect-cli device list
Summary:
Previously, the .devices() call passed the parameters in the wrong order. I checked the order in the interface and the daemon, and this was the only place it went wrong.

Now running `kdeconnect-cli -l` correctly lists all paired devices, even if unreachable.

Test Plan: Tested with both a reachable and unreachable device.

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: apol

Differential Revision: https://phabricator.kde.org/D9060
2017-12-03 19:29:05 +01:00
Jean Vincent
72535ecf48 Make member variable names, & placement and * placement more coherent
Summary:
Change all member variables to the form m_fooBar because it is the preferred form in Qt (it was half and half between this and mFooBar, and a minority didn't have anything).
Place all references and pointers on the side of the type since it is the majority.

Basically:
 - mFoo -> m_foo
 - foo -> m_foo (if it is a member variable)
 - Type &ref -> Type& ref
 - Type *ptr -> Type* ptr

Reviewers: #kde_connect, nicolasfella, albertvaka

Reviewed By: #kde_connect, nicolasfella, albertvaka

Subscribers: albertvaka, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D7312
2017-09-03 21:45:08 +02:00
Jean Vincent
c864267f04 Replace Q_FOREACH with C++11 range-for
Summary:
The use of Q_FOREACH is advised against (https://doc.qt.io/qt-5/qtglobal.html#Q_FOREACH) since Qt 5.7 and will eventually be removed from Qt.

I replaced all occurrences with the range-for loop introduced in C++11 (except for the one in daemon.cpp in deviceIdByName which might have a bug / typo in it).

I added const to the container or casted it with qAsConst when appropriate to avoid unnecessary copies.

(This is my first submission. I did all the unit tests, and they all passed but I don't know how to show it here.)

Reviewers: #kde_connect, nicolasfella, apol

Reviewed By: #kde_connect, nicolasfella, apol

Subscribers: albertvaka, apol, nicolasfella

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D6724
2017-07-21 09:57:19 +02:00
Aleix Pol
077bed106f Introduce a URL handler and offer handling tel:/// urls
Summary: Makes it possible to handle tel urls with any KDE Connect device

Test Plan: Manual testing

Reviewers: #kde_connect, albertvaka, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: nicolasfella

Differential Revision: https://phabricator.kde.org/D6120
2017-06-09 13:42:16 +02:00
Albert Vaca
7cc39aada8 Added an option to the cli to return your own device id 2017-02-24 22:37:22 +01:00
Aleix Pol
339ce7beea Improve how we deal with dbus errors from the cli
Summary: Always use pending calls and centralize dbus error management

Reviewers: #kde_connect, albertvaka

Differential Revision: https://phabricator.kde.org/D4206
2017-01-24 20:08:33 +01:00
Holger Kaelberer
30cffbd96e Add remotekeyboard plugin
BUG: 370919
REVIEW: 129727
2017-01-23 09:08:27 +01:00
Aleix Pol
a164983b6f Revert "kdeconnect-kde: Add remotekeyboard plugin"
This reverts commit 040ad7357b.

Sorry, didn't mean to push that myself ^^'
2017-01-11 17:20:22 +01:00
Holger Kaelberer
040ad7357b kdeconnect-kde: Add remotekeyboard plugin
Allow to inject keypress events to remote peers (most notably Android devices)

Notes / open issues / possible improvements:

- For the json-payload I used the syntax of the key-events as sent by mousepad-plugin with the addition of a "sendAck"-flag. If "sendAck" is set to true the remote peer should echo a key-event if it could be handled, thus allowing the local client to find out whether the key was accepted. For performance reasons, it's allowed to send multi-char strings in the "key" property (performs much better if you send a whole string via "echo '...' |  kdeconnect-cli ..." e.g.)

- kdeconnect-cli: For now takes a string and transforms it into single key-events for visible characters only. In a first implementation I used a kbhit() helper that used termios.h to catch and relay keypresses interactively (including some special-events), which was not optimal. A better approch might be to use linux input-api directly. Would this be an option regarding cross-platform compatibility or can I assume to develop for Linux only? Being a command-line guy, I'd really like to have a fully featured kdeconnect-cli interface ;-)

- Factor out the Qt::Key-to-internal keymap to some core-helper because it corresponds to the mapping in the mousepad-plugin?

- The plasmoid is not perfect as it is: A single line containing a non-echoing TextField (i.e. it eats all the KeyPress events), and only ack-ed keypress-packets from the peer device are injected if they contain visible keys. Advantage: the user sees whether his key-presses are accepted by the peer device. Disadvantage: The echoed text does not correspond 1:1 to what is shown on the peer's display, user might be confused when typing without success. I played around with different variations each of which with its proper shortcomings:
1. An echoing Textfield for typing: Has the advantage that the user can directly see what he is typing, which makes interaction in the typing field easier, BUT messes up interaction if the Editor on the peer is changed silently and does not notify the user if his keypresses are not handled by the peer.
2. A non-echoing TextField for typing PLUS a readonly one for printing visible echoed keys. Disadvantage: same as for the previous one and uses more space on the plasmoid.
Comments? Ideas?

REVIEW: 129727
BUG: 370919
2017-01-10 21:12:42 +01:00
Aleix Pol
7249f0b41e Show help upon error 2016-11-30 15:40:30 +01:00
Albert Vaca
60331ccbf1 Clazy says all this QStringLiteral and QLatin1String were missing/wrong 2016-11-26 16:21:29 +01:00
Albert Vaca
6aa058bfd4 Fixed kdeconnect-cli never reporting devices as paired 2016-11-23 17:20:59 +01:00
Aleix Pol
7d88340da7 Makes it possible to send sms from kdeconnect-cli
Summary: Introduces --send-sms and --destination

Test Plan: Sent an sms to Albert Vaca

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Differential Revision: https://phabricator.kde.org/D3252
2016-11-04 12:27:52 +01:00
Albert Vaca
1d7faabcdb Exit early if no device is specified. 2016-10-24 12:42:42 +02:00
Albert Vaca
0b3de33d74 Minor 2016-07-12 12:33:57 +02:00
Albert Vaca
e880e14ed5 Preffer Q_FOREACH to foreach 2016-06-21 14:50:17 +02:00
Aleix Pol
bdff499965 Remote Commands plugin
Allows executing remote plugins from this client

Reviewed by Albert Vaca
2016-06-12 20:16:58 +02:00
Aleix Pol
c7429b56b7 In the CLI interface, make it possible to refer a device by name
Only works with trusted devices
2016-06-06 01:21:37 +02:00
Aleix Pol
751bd5849b small style changes 2016-06-06 01:21:37 +02:00
Albert Vaca
82bc73dd9b WIPx2 2015-12-01 07:25:34 -08:00
Albert Vaca
16f9af908a WIP 2015-11-30 10:36:01 -08:00
Albert Vaca
30d2dd991b Merge branch 'master' into sslmaster 2015-11-30 03:40:07 -08:00
David Edmundson
7f794c093a Fixed the CLI
Enter discoverability mode if pairing with an unpaired device.

Use the correct isPaired. This exists as a method and a property,
callign the method returns QDbusPendingReply which shouldn't be checked
immediately
2015-09-12 22:08:12 +02:00
David Edmundson
9985a59608 Find my phone plugin
Add a plugin that sends a package to ring an alarm on a phone

Also adjusts plasmoid to have a button to invoke this.
2015-09-11 21:12:12 +02:00
Aleix Pol
5e0a7a34b9 Merge branch 'master' into ssl
# Conflicts:
#	cli/kdeconnect-cli.cpp
#	core/backends/lan/landevicelink.cpp
#	core/backends/lan/landevicelink.h
#	core/backends/lan/lanlinkprovider.cpp
#	core/backends/lan/lanlinkprovider.h
#	core/backends/lan/socketlinereader.h
#	core/backends/lan/uploadjob.cpp
#	core/backends/lan/uploadjob.h
#	core/backends/loopback/loopbackdevicelink.h
#	core/daemon.cpp
#	core/daemon.h
#	core/device.cpp
#	core/device.h
2015-09-11 17:25:23 +02:00
Albert Vaca
ea253b1755 Merge branch 'stable' 2015-09-11 04:35:41 -07:00
Albert Vaca
825a02f76a Fixed compilation error because QCA doesn't include QIODevice 2015-09-11 04:35:22 -07:00
Aleix Pol
ca4a81b8e8 Merge branch 'stable' 2015-09-11 12:24:15 +02:00
Aleix Pol
67c5a2b5f1 Fix variable scope 2015-09-11 12:22:35 +02:00
Patrick von Reth
da5c9bd30e Fix compilation on Windows. 2015-09-10 15:51:38 +02:00
Aleix Pol
361fbbd81d Adapt kdeconnect-cli to changes in core 2015-09-09 23:22:59 +02:00
Vineet Garg
06d8b3c54e Merge branch 'master' into pairinghandler 2015-07-27 21:00:05 +05:30
Aleix Pol
be2a3252c2 Make it possible to lock the screen from KDE Connect
Connects to freedesktop ScreenSaver interface and un/locks it upon request.

REVIEW: 124170
2015-07-22 03:37:34 +02:00
Vineet Garg
eda2563d03 Fixed encryption info in cli 2015-07-19 20:25:28 +05:30
Vineet Garg
20e46418ba Encryption info in cli 2015-07-18 18:54:10 +05:30
Vineet Garg
8915d770b6 Relative file path sent as link in share in cli
Fixed it
2015-06-22 22:57:41 +05:30
Yuri Chornoivan
1ee846231d Fix typo 2015-03-20 10:07:34 +02:00
Aleix Pol
021bb1781a Fix kdeconnect-cli after DevicesModel refactoring
Can't use the model anymore as it is asynchronous, so just use the dbus
interfaces directly.
2015-03-16 02:58:22 +01:00
Albert Vaca
a3decd542c Includes cleanup 2015-03-13 21:20:58 -07:00
Albert Vaca
0cb24acbc0 Improved kdeconnect-cli, adding parameters to ease scripting.
Also:
Added some missing i18n calls.
Using QTextStream(stderr) instead of qCritical() to avoid "quoted output".
2015-02-24 22:17:44 -08:00
Albert Vaca
c013966f4b Version number is now set in a single place 2015-02-04 23:52:07 -08:00
Aleix Pol
5285b8b9c2 Drop Qt5::Gui requirement 2014-11-28 17:42:53 +01:00
Aleix Pol
233607d246 Fix build from broken merge 2014-11-12 12:58:25 +01:00
Albert Vaca
a58fab4fb3 Merge branch 'master' into frameworks
Conflicts:
	cli/kdeconnect-cli.cpp
	core/device.cpp
	core/filetransferjob.cpp
	core/filetransferjob.h
	core/networkpackage.h
	kded/CMakeLists.txt
	plugins/share/shareplugin.cpp
	plugins/telephony/telephonyplugin.cpp
2014-11-11 21:40:54 -08:00
Albert Vaca
b001d25a9a Added -d as shortuct for --device in kdeconnect-cli 2014-11-09 22:08:13 -08:00
Albert Vaca
8e3f8f42dc Using QTextStream instead of std::cout to print text to console
This way we add support for non-ascii chars

BUG: 340764
2014-11-09 17:14:53 -08:00
Aleix Pol
21ab5a4f81 Merge branch 'master' into frameworks
Mostly kDebug -> qCDebug
Also some KCmdLineArgs -> QCommandLineParser

Conflicts:
	cli/kdeconnect-cli.cpp
	core/CMakeLists.txt
	core/backends/lan/lanlinkprovider.cpp
	core/daemon.cpp
	core/pluginloader.cpp
	interfaces/CMakeLists.txt
	kio/kiokdeconnect.cpp
	plugins/mousepad/CMakeLists.txt
	plugins/mousepad/mousepadplugin.h
	plugins/mpriscontrol/mpriscontrolplugin.cpp
	plugins/sftp/sftpplugin.cpp
2014-11-04 19:12:29 +01:00
Albert Vaca
3814fff705 Added myself as author of kdeconnect-cli 2014-09-26 20:40:06 -07:00
Albert Vaca
f41fb4de2a Customizable ping messages. 2014-09-26 20:39:38 -07:00
Albert Vaca
2cffbedcd4 Added --refresh option to the CLI tool. 2014-09-26 19:22:46 +02:00
Aleix Pol
1abf0686f5 Port kdeconnect-cli away from kdelibs4supposrt 2014-09-22 02:26:06 +02:00
Àlex Fiestas
e96fe74b64 Remove unused include in kdeconenct-cli
We are not using KUrl.
2014-09-21 21:58:55 +02:00
Aleix Pol
a8fb015a22 Fix compilation after merge 2014-07-02 01:39:38 +02:00
Albert Vaca
a303b73238 Merge branch 'master' into frameworks
Conflicts:
	cli/kdeconnect-cli.cpp
	core/CMakeLists.txt
	plasmoid/package/contents/ui/FullRepresentation.qml
	plugins/ping/pingplugin.cpp
2014-07-01 23:59:38 +02:00
Albert Vaca
4ef2a07f7b CLI can now list notifications from a device 2014-07-01 01:26:07 +02:00
Aleix Pol
c8dbbed685 Move the send ping code to the ping plugin
turn it into a dbus call to the plugin

Reviewed by Albert Vaca
2014-06-27 18:21:40 +02:00
Aleix Pol
db0d30e2e9 When listing from the cli, display if a device is paired. 2014-06-27 16:18:43 +02:00
Aleix Pol
02e18a9759 Extend kdeconnect-cli
Make it show whether devices are paired.
Let it un/pair devices.

Reviewed by Albert Vaca
2014-06-23 18:15:10 +02:00
Aleix Pol
b618a64f51 Merge remote-tracking branch 'origin/master' into frameworks
Conflicts:
	cli/kdeconnect-cli.cpp
2014-06-18 02:46:14 +02:00
Aleix Pol
bf272ea3e7 Remove usage of KDE4_ variables 2014-06-18 02:39:30 +02:00
Albert Vaca
f12a3768b4 Translated sendfileitemaction and the CLI 2014-06-17 22:21:58 +02:00
Aleix Pol
a1a560c469 First approach to a KF5 port of KDE Connect
Ported using KDELibs4Support, for a smaller delta, so we can keep
developing on master until we decide not to.

At the moment, it builds and installs but tests don't pass because
of a QCA2 initialization problem I didn't manage to debug yet.

CCMAIL: kdeconnect@kde.org
2014-06-16 20:02:07 +02:00
Rohan Garg
83c882cbdd Fix build 2014-06-14 16:50:54 +02:00
Aleix Pol
b88897847b Reorganize sources
We broke kded into core and kded, core contains the library with the backends
and plugins.
Also we renamed libkdeconnect to interfaces.
2014-06-14 15:22:40 +02:00
Aleix Pol
d5928197b2 CLI application to interact with kdeconnect kded module
Lists devices and makes it possible to share a url or a file with any
device.

REVIEW: 113343
2014-04-01 03:12:31 +02:00