Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Commit

Permalink
Propose version 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Steeven Lopes committed Mar 25, 2017
1 parent a0be5a8 commit 1dee812
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 59 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Version 0.7.0
* Fix bug #46 - Nautilus freeze on copy/paste - URGENT
* Fix Desktop Computers don't appear on kdeconnect-send context menu
* New UI for kdeconnect-send (move controls to header bar)
and a button to reload devices
* Add kdeconnect-send to Thunar 'send to' context menu
* File manager extensions now is translated
* Add Languages: French, Spanish, Catalan, Italian
* Kdeconnect-send script for file manger not supported
* Kdeconnect-send script for file manager not supported
by extension can send multiple files
* Provide OpenSuse repo - Thanks to Raúl García

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set (LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale)
set (PKGDATADIR "${DATADIR}/indicator-kdeconnect")
set (RELEASE_NAME "beta")
set (VERSION_INFO "Indicator for KDE Connect daemon")
set (VERSION "0.6")
set (VERSION "0.7")

# set gettexttranslate
set (GettextTranslate_GMO_BINARY TRUE)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ sudo dnf install kdeconnectd indicator-kdeconnect -y
OpenSuSe Leap 42.2 user's can use this repo:
```
http://download.opensuse.org/repositories/home:/Bajoja/openSUSE_Leap_42.2/
```
```

OpenSuSe Tumbleweed user's can use this repo:
```
Expand Down
28 changes: 19 additions & 9 deletions data/extensions/kdeconnect-send-caja.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
_ = gettext.gettext

class KDEConnectSendExtension(GObject.GObject, Caja.MenuProvider):

def __init__(self):
pass
self.devices_file = "/tmp/devices"
pass

"""Inicialize translations to a domain"""
def setup_gettext(self):
Expand All @@ -29,12 +31,20 @@ def setup_gettext(self):

"""Get a list of reachable devices"""
def get_reachable_devices(self):
devices = check_output(["kdeconnect-cli", "-a"]).strip().split("\n")
devices.pop()
if not isfile(self.devices_file):
return

devices = []
with open(self.devices_file, 'r') as file:
data = file.readline()
while data:
devices.append(data)
data = file.readline()

devices_a=[]
for device in devices:
device_name=re.search("(?<=-\s).+(?=:\s)", device).group(0)
device_id=re.search("(?<=:\s)[_a-z0-9]+(?=\s\()", device).group(0).strip()
device_name = re.search("(?<=-\s).+(?=:\s)", device).group(0)
device_id = re.search("(?<=:\s)[_a-z0-9]+", device).group(0).strip()
devices_a.append({ "name": device_name, "id": device_id })
return devices_a

Expand Down Expand Up @@ -75,10 +85,10 @@ def get_file_items(self, window, files):

self.setup_gettext()
"""If user only select file(s) create menu and sub menu"""
menu = Caja.MenuItem(name='KdeConnectSendExtension::KDEConnect_Send',
label=_('KDEConnect Send To'),
tip=_('send file(s) with kdeconnect'),
icon='kdeconnect')
menu = Caja.MenuItem(name = 'KdeConnectSendExtension::KDEConnect_Send',
label = _('KDEConnect Send To'),
tip = _('send file(s) with kdeconnect'),
icon = 'kdeconnect')

sub_menu = Caja.Menu()

Expand Down
13 changes: 6 additions & 7 deletions data/extensions/kdeconnect-send-nautilus.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@ def get_reachable_devices(self):
with open(self.devices_file, 'r') as file:
data = file.readline()
while data:
print "Found: "+data
devices.append(data)
data = file.readline()

devices_a=[]
for device in devices:
device_name=re.search("(?<=-\s).+(?=:\s)", device).group(0)
device_id=re.search("(?<=:\s)[_a-z0-9]+", device).group(0).strip()
device_name = re.search("(?<=-\s).+(?=:\s)", device).group(0)
device_id = re.search("(?<=:\s)[_a-z0-9]+", device).group(0).strip()
devices_a.append({ "name": device_name, "id": device_id })
return devices_a

Expand Down Expand Up @@ -86,10 +85,10 @@ def get_file_items(self, window, files):

self.setup_gettext()
"""If user only select file(s) create menu and sub menu"""
menu = Nautilus.MenuItem(name='KdeConnectSendExtension::KDEConnect_Send',
label=_('KDEConnect Send To'),
tip=_('send file(s) with kdeconnect'),
icon='kdeconnect')
menu = Nautilus.MenuItem(name = 'KdeConnectSendExtension::KDEConnect_Send',
label = _('KDEConnect Send To'),
tip = _('send file(s) with kdeconnect'),
icon = 'kdeconnect')

sub_menu = Nautilus.Menu()

Expand Down
28 changes: 19 additions & 9 deletions data/extensions/kdeconnect-send-nemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
_ = gettext.gettext

class KDEConnectSendExtension(GObject.GObject, Nemo.MenuProvider):

def __init__(self):
pass
self.devices_file = "/tmp/devices"
pass

"""Inicialize translations to a domain"""
def setup_gettext(self):
Expand All @@ -29,12 +31,20 @@ def setup_gettext(self):

"""Get a list of reachable devices"""
def get_reachable_devices(self):
devices = check_output(["kdeconnect-cli", "-a"]).strip().split("\n")
devices.pop()
if not isfile(self.devices_file):
return

devices = []
with open(self.devices_file, 'r') as file:
data = file.readline()
while data:
devices.append(data)
data = file.readline()

devices_a=[]
for device in devices:
device_name=re.search("(?<=-\s).+(?=:\s)", device).group(0)
device_id=re.search("(?<=:\s)[_a-z0-9]+(?=\s\()", device).group(0).strip()
device_name = re.search("(?<=-\s).+(?=:\s)", device).group(0)
device_id = re.search("(?<=:\s)[_a-z0-9]+", device).group(0).strip()
devices_a.append({ "name": device_name, "id": device_id })
return devices_a

Expand Down Expand Up @@ -75,10 +85,10 @@ def get_file_items(self, window, files):

self.setup_gettext()
"""If user only select file(s) create menu and sub menu"""
menu = Nemo.MenuItem(name='KdeConnectSendExtension::KDEConnect_Send',
label=_('KDEConnect - Send To'),
tip=_('send file(s) with kdeconnect'),
icon='kdeconnect')
menu = Nemo.MenuItem(name = 'KdeConnectSendExtension::KDEConnect_Send',
label = _('KDEConnect Send To'),
tip = _('send file(s) with kdeconnect'),
icon = 'kdeconnect')

sub_menu = Nemo.Menu()

Expand Down
2 changes: 1 addition & 1 deletion data/extensions/kdeconnect-send-thunar.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# the "Send To" menu.
[Desktop Entry]
Type=Application
Version=0.6
Version=0.7
Encoding=UTF-8
TryExec=kdeconnect-send
Exec=kdeconnect-send %F
Expand Down
1 change: 0 additions & 1 deletion data/extensions/teste.txt

This file was deleted.

2 changes: 2 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
indicator-kdeconnect (0.7) precise; urgency=low
* Fix bug #46 - Nautilus freeze on copy/paste - URGENT

* Fix Desktop Computers don't appear on kdeconnect-send context menu

* New UI for kdeconnect-send (move controls to header bar)
and a button to reload devices

Expand Down
5 changes: 3 additions & 2 deletions rpm/indicator-kdeconnect.spec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

Name: indicator-kdeconnect
Version: 0.6
Version: 0.7
Release: 0%{?dist}
Summary: App Indicator for KDE Connect
Group: Applications/System
Expand Down Expand Up @@ -106,12 +106,13 @@ popd
%changelog
* Thu Mar 23 2017 2300 Bajoja <[email protected]> 0.7
- Fix bug #46 - Nautilus freeze on copy/paste - URGENT
- Fix Desktop Computers don't appear on kdeconnect-send context menu
- New UI for kdeconnect-send (move controls to header bar)
and a button to reload devices
- Add kdeconnect-send to Thunar 'send to' context menu
- File manager extensions now is translated
- Add Languages: French, Spanish, Catalan, Italian
- Kdeconnect-send script for file manger not supported
- Kdeconnect-send script for file manager not supported
by extension can send multiple files
- Provide OpenSuse repo - Thanks to Raúl García

Expand Down
44 changes: 24 additions & 20 deletions src/DeviceIndicator.vala
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,10 @@ namespace KDEConnectIndicator {
}

private void update_visibility () {
if (!device.is_reachable){
if (!device.is_reachable)
indicator.set_status (AppIndicator.IndicatorStatus.PASSIVE);
delete_status();
}
else{
else
indicator.set_status (AppIndicator.IndicatorStatus.ACTIVE);
write_status();
}
}

private void update_name_item () {
Expand All @@ -211,16 +207,24 @@ namespace KDEConnectIndicator {
private void update_status_item () {

if (device.is_reachable) {
if (device.is_trusted)
if (device.is_trusted) {
status_item.label = _("Device Reachable and Trusted");
else
write_status ();
}
else {
status_item.label = _("Device Reachable but Not Trusted");
delete_status ();
}
} else {
if (device.is_trusted)
if (device.is_trusted) {
status_item.label = _("Device Trusted but not Reachable");
else
delete_status ();
}
else {
status_item.label = _("Device Not Reachable and Not Trusted");
// is this even posible?
delete_status ();
// is this even posible?
}
}
}

Expand Down Expand Up @@ -248,18 +252,18 @@ namespace KDEConnectIndicator {
separator3.visible = ring_item.visible;
}

private int write_status (){
private int write_status () {
var file = File.new_for_path (visible_devices);

if (!file.query_exists ()) {
message ("File '%s' doesn't exist.\n", file.get_path ());
return 1;
}
else{
message("File path exist '%s'\n", file.get_path());
message ("File path exist '%s'\n", file.get_path());
}

var sb = new StringBuilder();
StringBuilder sb = new StringBuilder();

string device_path = "/modules/kdeconnect/devices/";
string device_id = this.path.replace(device_path, "");
Expand All @@ -272,9 +276,9 @@ namespace KDEConnectIndicator {

//If the file contains one reference to this device just igone
while ((line = dis.read_line (null)) != null) {
stdout.printf ("%s\n", line);
message ("Status found on file %s\n", line);
if (name_id != line)
sb.append(line+"\n");
sb.append (line+"\n");
else
return 1;
}
Expand Down Expand Up @@ -306,15 +310,15 @@ namespace KDEConnectIndicator {
return 0;
}

private int delete_status(){
private int delete_status () {
var file = File.new_for_path (visible_devices);

if (!file.query_exists ())
message ("File '%s' doesn't exist.\n", file.get_path ());
else
message("File path exist '%s'\n", file.get_path());
message ("File path exist '%s'\n", file.get_path());

var sb = new StringBuilder();
StringBuilder sb = new StringBuilder();

string device_path = "/modules/kdeconnect/devices/";
string device_id = this.path.replace(device_path, "");
Expand All @@ -326,7 +330,7 @@ namespace KDEConnectIndicator {
string line;

while ((line = dis.read_line (null)) != null) {
stdout.printf ("%s\n", line);
message ("Delete status found on file %s\n", line);
if (line != name_id)
sb.append (line+"\n");
}
Expand Down
14 changes: 7 additions & 7 deletions src/KDEConnectManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ namespace KDEConnectIndicator {

var file = File.new_for_path (visible_devices);

try{
try {
file.create (FileCreateFlags.NONE);

if (!file.query_exists())
message("Devices file not creates");
if (!file.query_exists ())
message ("Devices file not creates");
else
message("New devices file created sucessfully");
message ("New devices file created sucessfully");
}
catch (Error e){
catch (Error e) {
message("%s",e.message);
}

Expand Down Expand Up @@ -129,8 +129,8 @@ namespace KDEConnectIndicator {
message ("File '%s' doesn't exist.\n", file.get_path ());
}
else{
message("File path exist '%s'\n", file.get_path());
file.delete();
message ("File path exist '%s'\n", file.get_path ());
file.delete ();
}
}
catch (Error e) {
Expand Down

0 comments on commit 1dee812

Please sign in to comment.