From b2eef29ed635e4995213fca8cf9bead6e20f3ba7 Mon Sep 17 00:00:00 2001 From: Julien Ozog Date: Mon, 28 Jul 2014 15:57:05 +0200 Subject: [PATCH 01/19] Port to Gnome 3.12 --- extension.js | 31 ++++++++++++---------- metadata.json | 4 +-- search.js | 71 +++++++++++++++++++++------------------------------ 3 files changed, 49 insertions(+), 57 deletions(-) diff --git a/extension.js b/extension.js index 6130d5e..1d7f555 100644 --- a/extension.js +++ b/extension.js @@ -72,7 +72,12 @@ const ConnectionManager = new Lang.Class({ this._searchProvider = null; this._sshList = []; this._searchProvider = new Search.SshSearchProvider('CONNECTION MANAGER'); - Main.overview.addSearchProvider(this._searchProvider); + if(typeof Main.overview.viewSelector === "object" && + typeof Main.overview.viewSelector._searchResults === "object" && + typeof Main.overview.viewSelector._searchResults._searchSystem === "object" && + typeof Main.overview.viewSelector._searchResults._searchSystem.addProvider === "function") { + Main.overview.viewSelector._searchResults._searchSystem.addProvider(this._searchProvider); + } this._readConf(); }, @@ -181,12 +186,12 @@ const ConnectionManager = new Lang.Class({ // Add ssh entry in search array this._sshList.push( - [ - child.Type, - this.TermCmd.get_terminal(), - child.Name+' - '+child.Host, - command - ] + { + 'type': child.Type, + 'terminal': this.TermCmd.get_terminal(), + 'name': child.Name+' - '+child.Host, + 'command': command + } ); } @@ -223,12 +228,12 @@ const ConnectionManager = new Lang.Class({ // Add ssh entry in search array this._sshList.push( - [ - child.Type, - this.TermCmd.get_terminal(), - child.Name+' - '+child.Host, - command - ] + { + 'type': child.Type, + 'terminal': this.TermCmd.get_terminal(), + 'name': child.Name+' - '+child.Host, + 'command': command + } ); } diff --git a/metadata.json b/metadata.json index fbbde72..022d7ce 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { - "shell-version": ["3.10"], - "version": "0.8.2", + "shell-version": ["3.12"], + "version": "0.8.3", "uuid": "connectionmanager2@ciancio.net", "name": "Connection Manager", "description": "Simple GUI app for Gnome 3 that provides a menu for initiating SSH/Telnet/Custom Apps connections.", diff --git a/search.js b/search.js index 24f03d9..64a7e6a 100644 --- a/search.js +++ b/search.js @@ -27,8 +27,7 @@ const SshSearchProvider = new Lang.Class({ Name: 'SshSearchProvider', _init: function(title) { - this.title = title; - this.searchSystem = null; + this.id = title; this.sshNames = []; }, @@ -45,69 +44,57 @@ const SshSearchProvider = new Lang.Class({ return null; }, - getInitialResultSet: function(terms) { + getInitialResultSet: function(terms, callback) { let searching = []; for (var i=0; i Date: Wed, 15 Oct 2014 11:07:21 +0200 Subject: [PATCH 02/19] Gnome 3.14 support --- extension.js | 11 +++++++---- metadata.json | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/extension.js b/extension.js index 0c82dac..da33738 100644 --- a/extension.js +++ b/extension.js @@ -74,11 +74,14 @@ const ConnectionManager = new Lang.Class({ this._searchProvider = new Search.SshSearchProvider('CONNECTION MANAGER'); if( typeof Main.overview.viewSelector === "object" && - typeof Main.overview.viewSelector._searchResults === "object" && - typeof Main.overview.viewSelector._searchResults._searchSystem === "object" && - typeof Main.overview.viewSelector._searchResults._searchSystem.addProvider === "function") { + typeof Main.overview.viewSelector._searchResults === "object") { + if(typeof Main.overview.viewSelector._searchResults._registerProvider === "function") { //3.14 + Main.overview.viewSelector._searchResults._registerProvider(this._searchProvider); + } else if(typeof Main.overview.viewSelector._searchResults._searchSystem === "object" && + typeof Main.overview.viewSelector._searchResults._searchSystem.addProvider === "function") { //3.12 Main.overview.viewSelector._searchResults._searchSystem.addProvider(this._searchProvider); - } + } + } this._readConf(); }, diff --git a/metadata.json b/metadata.json index 022d7ce..2c07258 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { - "shell-version": ["3.12"], - "version": "0.8.3", + "shell-version": ["3.12", "3.14"], + "version": "0.8.4", "uuid": "connectionmanager2@ciancio.net", "name": "Connection Manager", "description": "Simple GUI app for Gnome 3 that provides a menu for initiating SSH/Telnet/Custom Apps connections.", From 9041b1f5a2f946a9eb87efb5db848276d01185c8 Mon Sep 17 00:00:00 2001 From: Julien Ozog Date: Thu, 16 Oct 2014 10:22:21 +0200 Subject: [PATCH 03/19] Remove search provider on disable to avoid duplicated search provider on each session lock/unlock --- extension.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extension.js b/extension.js index da33738..bba1b11 100644 --- a/extension.js +++ b/extension.js @@ -331,6 +331,11 @@ function enable() { } function disable() { + if(cm._searchProvider!=null) { + Main.overview.removeSearchProvider(cm._searchProvider); + cm._searchProvider = null; + } + cm.monitor.cancel(); cm.destroy(); } From 068395f63de0be60ae0270f039fd4a6de0c3527c Mon Sep 17 00:00:00 2001 From: Gerd Riesselmann Date: Wed, 8 Apr 2015 17:00:02 +0200 Subject: [PATCH 04/19] Fix #51 Fixed .ssh/config parsing but replaces it by a simpler algorithm, ignoring HostName, User, Port (and IdentityFile, which is already ignored) --- connmgr.py | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/connmgr.py b/connmgr.py index 30d23a4..ba576b7 100644 --- a/connmgr.py +++ b/connmgr.py @@ -625,28 +625,14 @@ def a_host(line): lines = [line.strip() for line in file(SSH_CONFIG_FILE)] comments_removed = [remove_comment(line) for line in lines] blanks_removed = [line for line in comments_removed if line] + non_hosts_removed = [line for line in blanks_removed if a_host(line)] - block = itertools.groupby(blanks_removed, not_a_host) - - first_block = False - for key, group in block: - Info = dict([line.split(None, 1) for line in group]) - - if (not key): - if (not first_block): - first_block = True - importedHost = Info['Host'] - if (key and first_block): - if 'HostName' in Info: - importedHostname = Info['HostName'] - if 'User' in Info: - importedHostname = Info['User']+'@'+importedHostname - if 'Port' in Info: - importedHostname = '-p '+Info['Port']+' '+importedHostname - + for line in non_hosts_removed: + importedHosts = line.split(None)[1:] + for importedHost in importedHosts: if importedHost != '*': treestore.append(import_iter, ['__item__', - importedHost, importedHostname, 'Unnamed', 'ssh']) + importedHost, importedHost, 'Unnamed', 'ssh']) def is_folder(self, iter): if self.treestore.get_value(iter, 0) == '__folder__': From cf2afa83048384656b91cb745988ed34943fedcd Mon Sep 17 00:00:00 2001 From: Dario Lesca Date: Thu, 21 May 2015 10:39:14 +0200 Subject: [PATCH 05/19] Update metadata.json Add support to Gnome 3.14/3.16 --- metadata.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metadata.json b/metadata.json index 022d7ce..0a3ba77 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { - "shell-version": ["3.12"], - "version": "0.8.3", + "shell-version": ["3.12", "3.14", "3.16"], + "version": "0.8.4", "uuid": "connectionmanager2@ciancio.net", "name": "Connection Manager", "description": "Simple GUI app for Gnome 3 that provides a menu for initiating SSH/Telnet/Custom Apps connections.", From 4f87806949d7a2d9cef7c8d2e9fc268dac68470a Mon Sep 17 00:00:00 2001 From: Udi Oron Date: Mon, 2 Nov 2015 00:08:47 +0200 Subject: [PATCH 06/19] updated to gnome 3.18 --- metadata.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metadata.json b/metadata.json index 0a3ba77..f5b3372 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { - "shell-version": ["3.12", "3.14", "3.16"], - "version": "0.8.4", + "shell-version": ["3.12", "3.14", "3.16", "3.18"], + "version": "0.8.5", "uuid": "connectionmanager2@ciancio.net", "name": "Connection Manager", "description": "Simple GUI app for Gnome 3 that provides a menu for initiating SSH/Telnet/Custom Apps connections.", From cd0b860995536568051199665dfc2b7bd2a0144f Mon Sep 17 00:00:00 2001 From: Julien Ozog Date: Mon, 2 Nov 2015 17:52:02 +0100 Subject: [PATCH 07/19] Gnome does not like results set containing id=0 ("Invalid result meta returned from search provider CONNECTION MANAGER") --- search.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/search.js b/search.js index 6079f9c..6fe7839 100644 --- a/search.js +++ b/search.js @@ -54,7 +54,8 @@ const SshSearchProvider = new Lang.Class({ for (var j=0; j Date: Wed, 8 Apr 2015 17:00:02 +0200 Subject: [PATCH 08/19] Fix #51 Fixed .ssh/config parsing but replaces it by a simpler algorithm, ignoring HostName, User, Port (and IdentityFile, which is already ignored) --- connmgr.py | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/connmgr.py b/connmgr.py index 30d23a4..ba576b7 100644 --- a/connmgr.py +++ b/connmgr.py @@ -625,28 +625,14 @@ def a_host(line): lines = [line.strip() for line in file(SSH_CONFIG_FILE)] comments_removed = [remove_comment(line) for line in lines] blanks_removed = [line for line in comments_removed if line] + non_hosts_removed = [line for line in blanks_removed if a_host(line)] - block = itertools.groupby(blanks_removed, not_a_host) - - first_block = False - for key, group in block: - Info = dict([line.split(None, 1) for line in group]) - - if (not key): - if (not first_block): - first_block = True - importedHost = Info['Host'] - if (key and first_block): - if 'HostName' in Info: - importedHostname = Info['HostName'] - if 'User' in Info: - importedHostname = Info['User']+'@'+importedHostname - if 'Port' in Info: - importedHostname = '-p '+Info['Port']+' '+importedHostname - + for line in non_hosts_removed: + importedHosts = line.split(None)[1:] + for importedHost in importedHosts: if importedHost != '*': treestore.append(import_iter, ['__item__', - importedHost, importedHostname, 'Unnamed', 'ssh']) + importedHost, importedHost, 'Unnamed', 'ssh']) def is_folder(self, iter): if self.treestore.get_value(iter, 0) == '__folder__': From 42084611656e9a96eff8e4de4291105746999142 Mon Sep 17 00:00:00 2001 From: Dario Lesca Date: Thu, 21 May 2015 10:35:33 +0200 Subject: [PATCH 09/19] Update terminals.js Add support to Mate Terminal --- terminals.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminals.js b/terminals.js index bfa0561..c0252d3 100644 --- a/terminals.js +++ b/terminals.js @@ -19,7 +19,7 @@ // Supported terminals. This terminal list must match as in connmgr.py const TERMINALS = new Array( "gnome-terminal", "terminator", "guake", "tmux", - "urxvt", "urxvt256c", "lilyterm"); + "urxvt", "urxvt256c", "lilyterm", "mate-terminal"); // ****************************************************** From 327bb726680ff28e61d5cc41ea59e6211afb605e Mon Sep 17 00:00:00 2001 From: Dario Lesca Date: Thu, 21 May 2015 10:32:09 +0200 Subject: [PATCH 10/19] Update connmgr.py Add support to Mate Terminal --- connmgr.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/connmgr.py b/connmgr.py index ba576b7..3333344 100644 --- a/connmgr.py +++ b/connmgr.py @@ -36,20 +36,20 @@ import re import sys -VERSION = '0.8.3' +VERSION = '0.8.4' -supportedTerms = ["Gnome Terminal", "Terminator", "Guake", "TMux", "urxvt", "urxvt256c", "LilyTerm"] -supportedTermsCmd = ["gnome-terminal", "terminator", "guake", "tmux", "urxvt", "urxvt256c", "lilyterm"] -supportedTermsSite = ["http://library.gnome.org/users/gnome-terminal/stable/", - "http://www.tenshu.net/p/terminator.html", - "http://guake.org/", +supportedTerms = ["Gnome Terminal", "Terminator", "Guake", "TMux", "urxvt", "urxvt256c", "LilyTerm", "Mate Terminal"] +supportedTermsCmd = ["gnome-terminal", "terminator", "guake", "tmux", "urxvt", "urxvt256c", "lilyterm", "mate-terminal"] +supportedTermsSite = ["http://library.gnome.org/users/gnome-terminal/stable/", + "http://www.tenshu.net/p/terminator.html", + "http://guake.org/", "http://tmux.sourceforge.net/", "http://software.schmorp.de/pkg/rxvt-unicode.html", "http://software.schmorp.de/pkg/rxvt-unicode.html", - "http://lilyterm.luna.com.tw/index.html" + "http://lilyterm.luna.com.tw/index.html", + "http://www.mate-desktop.org/" ] - # TreeStore object: # Type, Name, Host, Profile, Protocol treestore = Gtk.TreeStore(str, str, str, str, str) From 1686b5d561501d2ded05da0d1f2b63617d263f68 Mon Sep 17 00:00:00 2001 From: Stijn Segers Date: Tue, 13 Sep 2016 22:19:40 +0200 Subject: [PATCH 11/19] Added XFCE Terminal support --- connmgr.py | 7 ++++--- terminals.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/connmgr.py b/connmgr.py index 3333344..1f38f4d 100644 --- a/connmgr.py +++ b/connmgr.py @@ -38,8 +38,8 @@ VERSION = '0.8.4' -supportedTerms = ["Gnome Terminal", "Terminator", "Guake", "TMux", "urxvt", "urxvt256c", "LilyTerm", "Mate Terminal"] -supportedTermsCmd = ["gnome-terminal", "terminator", "guake", "tmux", "urxvt", "urxvt256c", "lilyterm", "mate-terminal"] +supportedTerms = ["Gnome Terminal", "Terminator", "Guake", "TMux", "urxvt", "urxvt256c", "LilyTerm", "Mate Terminal", "XFCE terminal"] +supportedTermsCmd = ["gnome-terminal", "terminator", "guake", "tmux", "urxvt", "urxvt256c", "lilyterm", "mate-terminal", "xfce4-terminal"] supportedTermsSite = ["http://library.gnome.org/users/gnome-terminal/stable/", "http://www.tenshu.net/p/terminator.html", "http://guake.org/", @@ -47,7 +47,8 @@ "http://software.schmorp.de/pkg/rxvt-unicode.html", "http://software.schmorp.de/pkg/rxvt-unicode.html", "http://lilyterm.luna.com.tw/index.html", - "http://www.mate-desktop.org/" + "http://www.mate-desktop.org/", + "http://www.xfce.org/" ] # TreeStore object: diff --git a/terminals.js b/terminals.js index c0252d3..ca000c9 100644 --- a/terminals.js +++ b/terminals.js @@ -19,7 +19,7 @@ // Supported terminals. This terminal list must match as in connmgr.py const TERMINALS = new Array( "gnome-terminal", "terminator", "guake", "tmux", - "urxvt", "urxvt256c", "lilyterm", "mate-terminal"); + "urxvt", "urxvt256c", "lilyterm", "mate-terminal", "xfce4-terminal"); // ****************************************************** From b8de9d0838c7be7d9d9eae9f6ed3a5d6783832af Mon Sep 17 00:00:00 2001 From: Stijn Segers Date: Tue, 13 Sep 2016 22:27:44 +0200 Subject: [PATCH 12/19] add support for multiple Gnome versions including 3.22. Debian Testing is on 3.21.91 atm. --- metadata.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index f5b3372..ef93e44 100644 --- a/metadata.json +++ b/metadata.json @@ -1,5 +1,15 @@ { - "shell-version": ["3.12", "3.14", "3.16", "3.18"], + "shell-version": [ + "3.8", + "3.10", + "3.12", + "3.14", + "3.16", + "3.18", + "3.20", + "3.21.91", + "3.22" + ], "version": "0.8.5", "uuid": "connectionmanager2@ciancio.net", "name": "Connection Manager", From 47677d61781ef0e23d156a3b48b6b937e8034a58 Mon Sep 17 00:00:00 2001 From: Stijn Segers Date: Tue, 13 Sep 2016 22:33:15 +0200 Subject: [PATCH 13/19] Bump UI version number to same one reported in metadata.json --- connmgr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connmgr.py b/connmgr.py index 1f38f4d..ceadca6 100644 --- a/connmgr.py +++ b/connmgr.py @@ -36,7 +36,7 @@ import re import sys -VERSION = '0.8.4' +VERSION = '0.8.5' supportedTerms = ["Gnome Terminal", "Terminator", "Guake", "TMux", "urxvt", "urxvt256c", "LilyTerm", "Mate Terminal", "XFCE terminal"] supportedTermsCmd = ["gnome-terminal", "terminator", "guake", "tmux", "urxvt", "urxvt256c", "lilyterm", "mate-terminal", "xfce4-terminal"] From 3d946e93193eaaad532a964c2a27af791bcf1fcc Mon Sep 17 00:00:00 2001 From: returntrip Date: Sat, 22 Oct 2016 19:39:44 +0200 Subject: [PATCH 14/19] Add Terminix Terminal --- connmgr.py | 15 ++++++++------- terminals.js | 53 ++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 57 insertions(+), 11 deletions(-) diff --git a/connmgr.py b/connmgr.py index ceadca6..3abc232 100644 --- a/connmgr.py +++ b/connmgr.py @@ -38,8 +38,8 @@ VERSION = '0.8.5' -supportedTerms = ["Gnome Terminal", "Terminator", "Guake", "TMux", "urxvt", "urxvt256c", "LilyTerm", "Mate Terminal", "XFCE terminal"] -supportedTermsCmd = ["gnome-terminal", "terminator", "guake", "tmux", "urxvt", "urxvt256c", "lilyterm", "mate-terminal", "xfce4-terminal"] +supportedTerms = ["Gnome Terminal", "Terminator", "Guake", "TMux", "urxvt", "urxvt256c", "LilyTerm", "Mate Terminal", "XFCE terminal", "Terminix"] +supportedTermsCmd = ["gnome-terminal", "terminator", "guake", "tmux", "urxvt", "urxvt256c", "lilyterm", "mate-terminal", "xfce4-terminal", "terminix"] supportedTermsSite = ["http://library.gnome.org/users/gnome-terminal/stable/", "http://www.tenshu.net/p/terminator.html", "http://guake.org/", @@ -49,6 +49,7 @@ "http://lilyterm.luna.com.tw/index.html", "http://www.mate-desktop.org/", "http://www.xfce.org/" + "https://github.com/gnunn1/terminix" ] # TreeStore object: @@ -387,7 +388,7 @@ def __init__(self): options.pack_start(labelTerm, False, False, 10) options.pack_start(terms_combo, False, False, 0) options.pack_end(self.terminal_site, False, False, 10) - + # About Label about = Gtk.VBox(False, spacing=2) @@ -473,7 +474,7 @@ def on_check_option_toggled(self, button, name): def on_combo_option_toggled(self, combo, name): global GlobalSettings GlobalSettings[name] = combo.get_active() - + self.terminal_site.set_uri(supportedTermsSite[GlobalSettings['terminal']]) self.conf_modified() @@ -570,7 +571,7 @@ def on_click_me_importsshconf(self, button): import_iter = iter iter = model.iter_next(iter) - + else: import_found = False @@ -683,9 +684,9 @@ def item_dialog(self, row): # Profile Combo ---------------------------- label3 = Gtk.Label("Profile") - + entry3 = Gtk.ComboBoxText() - + if "org.gnome.Terminal.ProfilesList" in Gio.Settings.list_schemas(): profilesList = Gio.Settings.new("org.gnome.Terminal.ProfilesList").get_value("list") diff --git a/terminals.js b/terminals.js index ca000c9..2663dc7 100644 --- a/terminals.js +++ b/terminals.js @@ -1,5 +1,5 @@ -// ConnectionManager 3 - Simple GUI app for Gnome 3 that provides a menu -// for initiating SSH/Telnet/Custom Apps connections. +// ConnectionManager 3 - Simple GUI app for Gnome 3 that provides a menu +// for initiating SSH/Telnet/Custom Apps connections. // Copyright (C) 2011 Stefano Ciancio // // This library is free software; you can redistribute it and/or @@ -19,7 +19,7 @@ // Supported terminals. This terminal list must match as in connmgr.py const TERMINALS = new Array( "gnome-terminal", "terminator", "guake", "tmux", - "urxvt", "urxvt256c", "lilyterm", "mate-terminal", "xfce4-terminal"); + "urxvt", "urxvt256c", "lilyterm", "mate-terminal", "xfce4-terminal", "terminix"); // ****************************************************** @@ -49,6 +49,9 @@ function TerminalCommand(terminal) { case 6: this.resClass = new LilyTermCommand(terminal); break; + case 7: + this.resClass = new TerminixCommand(terminal); + break; default: this.resClass = new GnomeTerminalCommand(terminal); break; @@ -166,7 +169,7 @@ GnomeTerminalCommand.prototype = { if (this.child.Profile && this.child.Profile.length > 0) { this.command += ' --tab-with-profile=' + (this.child.Profile).quote(); } - else + else { this.command = ' --tab '; } @@ -408,3 +411,45 @@ LilyTermCommand.prototype = { } +// ****************************************************** +// TerminixTerm class derived from base class +// ****************************************************** +function TerminixCommand(terminal) { + this._init(terminal); +} + +TerminixCommand.prototype = { + __proto__: TerminalCommand.prototype, + + createCmd: function () { + + if (this.child.Type == '__item__') { + this._setParams(); + + this.command += this.cmdTerm; + + if (this.sshparams && this.sshparams.length > 0) { + this.command = this.sshparams + ' ' + this.command; + } + + this.command += ' --title ' + (this.child.Name).quote(); + this.command += ' -e ' + (this.child.Protocol + " " + this.sshparams_noenv).quote(); + + this.command = 'sh -c ' + this.command.quote(); + + } + + if (this.child.Type == '__app__') { + + if (this.child.Protocol == 'True') { + this.command += this.cmdTerm + ' --title ' + (this.child.Name).quote() + ' -e '; + this.command += (this.child.Host).quote(); + } else { + this.command += this.child.Host; + } + } + + return this.command; + }, + +} From 370bba5c7d318d5b8b0195d5578349129c3e62d3 Mon Sep 17 00:00:00 2001 From: returntrip Date: Sat, 22 Oct 2016 19:49:52 +0200 Subject: [PATCH 15/19] Fixe issue: missing comma from supportedTermsSite --- connmgr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connmgr.py b/connmgr.py index 3abc232..84c8276 100644 --- a/connmgr.py +++ b/connmgr.py @@ -48,7 +48,7 @@ "http://software.schmorp.de/pkg/rxvt-unicode.html", "http://lilyterm.luna.com.tw/index.html", "http://www.mate-desktop.org/", - "http://www.xfce.org/" + "http://www.xfce.org/", "https://github.com/gnunn1/terminix" ] From 7d717119386c356a044eb9e57f0e7f98f23c7c95 Mon Sep 17 00:00:00 2001 From: returntrip Date: Sat, 22 Oct 2016 19:49:52 +0200 Subject: [PATCH 16/19] Fix issue: missing comma from supportedTermsSite --- connmgr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connmgr.py b/connmgr.py index 3abc232..84c8276 100644 --- a/connmgr.py +++ b/connmgr.py @@ -48,7 +48,7 @@ "http://software.schmorp.de/pkg/rxvt-unicode.html", "http://lilyterm.luna.com.tw/index.html", "http://www.mate-desktop.org/", - "http://www.xfce.org/" + "http://www.xfce.org/", "https://github.com/gnunn1/terminix" ] From 2db78d3eaf6c74efe70d5befcba3106dcda2d56e Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Fri, 17 Mar 2017 13:02:48 -0500 Subject: [PATCH 17/19] Gnome 3.24 compat changes - fixing outdated JS functions --- connmgr.py | 15 +++++---- extension.js | 2 +- metadata.json | 19 +++++------ terminals.js | 91 ++++++++++++++++++++++++++------------------------- 4 files changed, 64 insertions(+), 63 deletions(-) diff --git a/connmgr.py b/connmgr.py index 84c8276..2c2bde2 100644 --- a/connmgr.py +++ b/connmgr.py @@ -38,7 +38,7 @@ VERSION = '0.8.5' -supportedTerms = ["Gnome Terminal", "Terminator", "Guake", "TMux", "urxvt", "urxvt256c", "LilyTerm", "Mate Terminal", "XFCE terminal", "Terminix"] +supportedTerms = ["Gnome Terminal", "Terminator", "Guake", "TMux", "urxvt", "urxvt256c", "LilyTerm", "Mate Terminal", "XFCE Terminal", "Terminix"] supportedTermsCmd = ["gnome-terminal", "terminator", "guake", "tmux", "urxvt", "urxvt256c", "lilyterm", "mate-terminal", "xfce4-terminal", "terminix"] supportedTermsSite = ["http://library.gnome.org/users/gnome-terminal/stable/", "http://www.tenshu.net/p/terminator.html", @@ -47,11 +47,12 @@ "http://software.schmorp.de/pkg/rxvt-unicode.html", "http://software.schmorp.de/pkg/rxvt-unicode.html", "http://lilyterm.luna.com.tw/index.html", - "http://www.mate-desktop.org/", + "http://www.mate-desktop.org", "http://www.xfce.org/", "https://github.com/gnunn1/terminix" ] + # TreeStore object: # Type, Name, Host, Profile, Protocol treestore = Gtk.TreeStore(str, str, str, str, str) @@ -388,7 +389,7 @@ def __init__(self): options.pack_start(labelTerm, False, False, 10) options.pack_start(terms_combo, False, False, 0) options.pack_end(self.terminal_site, False, False, 10) - + # About Label about = Gtk.VBox(False, spacing=2) @@ -474,7 +475,7 @@ def on_check_option_toggled(self, button, name): def on_combo_option_toggled(self, combo, name): global GlobalSettings GlobalSettings[name] = combo.get_active() - + self.terminal_site.set_uri(supportedTermsSite[GlobalSettings['terminal']]) self.conf_modified() @@ -571,7 +572,7 @@ def on_click_me_importsshconf(self, button): import_iter = iter iter = model.iter_next(iter) - + else: import_found = False @@ -684,9 +685,9 @@ def item_dialog(self, row): # Profile Combo ---------------------------- label3 = Gtk.Label("Profile") - + entry3 = Gtk.ComboBoxText() - + if "org.gnome.Terminal.ProfilesList" in Gio.Settings.list_schemas(): profilesList = Gio.Settings.new("org.gnome.Terminal.ProfilesList").get_value("list") diff --git a/extension.js b/extension.js index bba1b11..71da3e4 100644 --- a/extension.js +++ b/extension.js @@ -303,7 +303,7 @@ const ConnectionManager = new Lang.Class({ mycommand += commandTab[c]+' '; } - Util.spawnCommandLine(' sh -c '+(sshparamsTab[0]+' '+term+' '+mycommand).quote()+' &'); + Util.spawnCommandLine(' sh -c '+JSON.stringify(sshparamsTab[0]+' '+term+' '+mycommand)+' &'); }); } diff --git a/metadata.json b/metadata.json index ef93e44..c50bd9c 100644 --- a/metadata.json +++ b/metadata.json @@ -1,15 +1,14 @@ { "shell-version": [ - "3.8", - "3.10", - "3.12", - "3.14", - "3.16", - "3.18", - "3.20", - "3.21.91", - "3.22" - ], + "3.12", + "3.14", + "3.16", + "3.18", + "3.20", + "3.22", + "3.23.91", + "3.24" + ], "version": "0.8.5", "uuid": "connectionmanager2@ciancio.net", "name": "Connection Manager", diff --git a/terminals.js b/terminals.js index 2663dc7..0030b38 100644 --- a/terminals.js +++ b/terminals.js @@ -1,5 +1,5 @@ -// ConnectionManager 3 - Simple GUI app for Gnome 3 that provides a menu -// for initiating SSH/Telnet/Custom Apps connections. +// ConnectionManager 3 - Simple GUI app for Gnome 3 that provides a menu +// for initiating SSH/Telnet/Custom Apps connections. // Copyright (C) 2011 Stefano Ciancio // // This library is free software; you can redistribute it and/or @@ -51,7 +51,7 @@ function TerminalCommand(terminal) { break; case 7: this.resClass = new TerminixCommand(terminal); - break; + break; default: this.resClass = new GnomeTerminalCommand(terminal); break; @@ -64,6 +64,7 @@ TerminalCommand.prototype = { _init: function(terminal) { + this.resClass = this.resClass || null; this.terminal = terminal; this.cmdTerm = TERMINALS[terminal]; this.child = null; @@ -108,7 +109,7 @@ TerminalCommand.prototype = { return false; }, createTabCmd: function () { - return false; + return [false, false]; }, } @@ -136,21 +137,21 @@ GnomeTerminalCommand.prototype = { } if (this.child.Profile && this.child.Profile.length > 0) { - this.command += ' --window-with-profile=' + (this.child.Profile).quote(); + this.command += ' --window-with-profile=' + JSON.stringify(this.child.Profile); } - this.command += ' --title=' + (this.child.Name).quote(); - this.command += ' -e ' + ("sh -c " + (this.child.Protocol + " " + this.sshparams_noenv).quote()).quote(); + this.command += ' --title=' + JSON.stringify(this.child.Name); + this.command += ' -e ' + JSON.stringify("sh -c " + JSON.stringify(this.child.Protocol + " " + this.sshparams_noenv)); - this.command = 'sh -c ' + this.command.quote(); + this.command = 'sh -c ' + JSON.stringify(this.command); } if (this.child.Type == '__app__') { if (this.child.Protocol == 'True') { - this.command += this.cmdTerm + ' --title=' + (this.child.Name).quote() + ' -e '; - this.command += (this.child.Host).quote(); + this.command += this.cmdTerm + ' --title=' + JSON.stringify(this.child.Name) + ' -e '; + this.command += JSON.stringify(this.child.Host); } else { this.command += this.child.Host; } @@ -167,22 +168,22 @@ GnomeTerminalCommand.prototype = { this.command += ' '; if (this.child.Profile && this.child.Profile.length > 0) { - this.command += ' --tab-with-profile=' + (this.child.Profile).quote(); + this.command += ' --tab-with-profile=' + JSON.stringify(this.child.Profile); } else { this.command = ' --tab '; } - this.command += ' --title=' + (this.child.Name).quote(); - this.command += ' -e ' + ("sh -c " + (this.child.Protocol + " " + this.sshparams_noenv).quote()).quote(); + this.command += ' --title=' + JSON.stringify(this.child.Name); + this.command += ' -e ' + JSON.stringify("sh -c " + JSON.stringify(this.child.Protocol + " " + this.sshparams_noenv)); } if (this.child.Type == '__app__') { // Ignore "execute in a shell" when open all as tabs - this.command += ' --tab --title=' + (this.child.Name).quote() + ' -e '; - this.command += (this.child.Host).quote(); + this.command += ' --tab --title=' + JSON.stringify(this.child.Name) + ' -e '; + this.command += JSON.stringify(this.child.Host); } return [this.command, this.sshparams]; @@ -212,21 +213,21 @@ TerminatorCommand.prototype = { } if (this.child.Profile && this.child.Profile.length > 0) { - this.command += ' --profile=' + (this.child.Profile).quote(); + this.command += ' --profile=' + JSON.stringify(this.child.Profile); } - this.command += ' --title=' + (this.child.Name).quote(); - this.command += ' -e ' + ("sh -c " + (this.child.Protocol + " " + this.sshparams_noenv).quote()).quote(); + this.command += ' --title=' + JSON.stringify(this.child.Name); + this.command += ' -e ' + JSON.stringify("sh -c " + JSON.stringify(this.child.Protocol + " " + this.sshparams_noenv)); - this.command = 'sh -c ' + this.command.quote(); + this.command = 'sh -c ' + JSON.stringify(this.command); } if (this.child.Type == '__app__') { if (this.child.Protocol == 'True') { - this.command += this.cmdTerm + ' --title=' + (this.child.Name).quote() + ' -e '; - this.command += (this.child.Host).quote(); + this.command += this.cmdTerm + ' --title=' + JSON.stringify(this.child.Name) + ' -e '; + this.command += JSON.stringify(this.child.Host); } else { this.command += this.child.Host; } @@ -253,17 +254,17 @@ GuakeCommand.prototype = { this.command += this.cmdTerm; - this.command += ' --new-tab=' + (this.child.Name).quote(); - this.command += ' --rename-tab=' + (this.child.Name).quote(); - this.command += ' -e ' + (this.sshparams +" sh -c " + (this.child.Protocol + " " + this.sshparams_noenv).quote()).quote(); + this.command += ' --new-tab=' + JSON.stringify(this.child.Name); + this.command += ' --rename-tab=' + JSON.stringify(this.child.Name); + this.command += ' -e ' + JSON.stringify(this.sshparams +" sh -c " + JSON.stringify(this.child.Protocol + " " + this.sshparams_noenv)); } if (this.child.Type == '__app__') { if (this.child.Protocol == 'True') { - this.command += this.cmdTerm + ' --rename-tab=' + (this.child.Name).quote() + ' --new-tab=' + (this.child.Name).quote() + ' -e '; - this.command += (this.child.Host).quote(); + this.command += this.cmdTerm + ' --rename-tab=' + JSON.stringify(this.child.Name) + ' --new-tab=' + JSON.stringify(this.child.Name) + ' -e '; + this.command += JSON.stringify(this.child.Host); } else { this.command += this.child.Host; } @@ -290,15 +291,15 @@ TMuxCommand.prototype = { this._setParams(); this.command += this.cmdTerm; - this.command += ' new-window -n ' + (this.child.Name).quote(); - this.command += ' ' + (this.sshparams + this.child.Protocol + " " + this.sshparams_noenv).quote(); + this.command += ' new-window -n ' + JSON.stringify(this.child.Name); + this.command += ' ' + JSON.stringify(this.sshparams + this.child.Protocol + " " + this.sshparams_noenv); } if (this.child.Type == '__app__') { if (this.child.Protocol == 'True') { - this.command += this.cmdTerm + ' new-window -n ' + (this.child.Name).quote(); - this.command += ' ' + (this.child.Host).quote(); + this.command += this.cmdTerm + ' new-window -n ' + JSON.stringify(this.child.Name); + this.command += ' ' + JSON.stringify(this.child.Host); } else { this.command += this.child.Host; } @@ -331,18 +332,18 @@ URXVTCommand.prototype = { this.command = this.sshparams + ' ' + this.command; } - this.command += ' -title ' + (this.child.Name).quote(); - this.command += ' -e ' + ("sh -c " + (this.child.Protocol + " " + this.sshparams_noenv).quote()); + this.command += ' -title ' + JSON.stringify(this.child.Name); + this.command += ' -e ' + JSON.stringify("sh -c " + (this.child.Protocol + " " + this.sshparams_noenv)); - this.command = 'sh -c ' + this.command.quote(); + this.command = 'sh -c ' + JSON.stringify(this.command); } if (this.child.Type == '__app__') { if (this.child.Protocol == 'True') { - this.command += this.cmdTerm + ' -title ' + (this.child.Name).quote() + ' -e '; - this.command += (this.child.Host).quote(); + this.command += this.cmdTerm + ' -title ' + JSON.stringify(this.child.Name) + ' -e '; + this.command += JSON.stringify(this.child.Host); } else { this.command += this.child.Host; } @@ -388,18 +389,18 @@ LilyTermCommand.prototype = { this.command = this.sshparams + ' ' + this.command; } - this.command += ' --title ' + (this.child.Name).quote(); - this.command += ' -s -e ' + ("sh -c " + (this.child.Protocol + " " + this.sshparams_noenv).quote()); + this.command += ' --title ' + JSON.stringify(this.child.Name); + this.command += ' -s -e ' + JSON.stringify("sh -c " + (this.child.Protocol + " " + this.sshparams_noenv)); - this.command = 'sh -c ' + this.command.quote(); + this.command = 'sh -c ' + JSON.stringify(this.command); } if (this.child.Type == '__app__') { if (this.child.Protocol == 'True') { - this.command += this.cmdTerm + ' --title ' + (this.child.Name).quote() + ' -s -e '; - this.command += (this.child.Host).quote(); + this.command += this.cmdTerm + ' --title ' + JSON.stringify(this.child.Name) + ' -s -e '; + this.command += JSON.stringify(this.child.Host); } else { this.command += this.child.Host; } @@ -432,18 +433,18 @@ TerminixCommand.prototype = { this.command = this.sshparams + ' ' + this.command; } - this.command += ' --title ' + (this.child.Name).quote(); - this.command += ' -e ' + (this.child.Protocol + " " + this.sshparams_noenv).quote(); + this.command += ' --title ' + JSON.stringify(this.child.Name); + this.command += ' -e ' + JSON.stringify(this.child.Protocol + " " + this.sshparams_noenv); - this.command = 'sh -c ' + this.command.quote(); + this.command = 'sh -c ' + JSON.stringify(this.command); } if (this.child.Type == '__app__') { if (this.child.Protocol == 'True') { - this.command += this.cmdTerm + ' --title ' + (this.child.Name).quote() + ' -e '; - this.command += (this.child.Host).quote(); + this.command += this.cmdTerm + ' --title ' + JSON.stringify(this.child.Name) + ' -e '; + this.command += JSON.stringify(this.child.Host); } else { this.command += this.child.Host; } From d6b5687f4d46bde1716d907dad5ec5a58a5fb7fc Mon Sep 17 00:00:00 2001 From: Dennis Koot Date: Wed, 10 May 2017 10:05:10 +0200 Subject: [PATCH 18/19] the option rename-tab renames the first tab instead of the new one, rename-current-tab should be used --- terminals.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terminals.js b/terminals.js index 0030b38..3c43491 100644 --- a/terminals.js +++ b/terminals.js @@ -255,7 +255,7 @@ GuakeCommand.prototype = { this.command += this.cmdTerm; this.command += ' --new-tab=' + JSON.stringify(this.child.Name); - this.command += ' --rename-tab=' + JSON.stringify(this.child.Name); + this.command += ' --rename-current-tab=' + JSON.stringify(this.child.Name); this.command += ' -e ' + JSON.stringify(this.sshparams +" sh -c " + JSON.stringify(this.child.Protocol + " " + this.sshparams_noenv)); } @@ -263,7 +263,7 @@ GuakeCommand.prototype = { if (this.child.Type == '__app__') { if (this.child.Protocol == 'True') { - this.command += this.cmdTerm + ' --rename-tab=' + JSON.stringify(this.child.Name) + ' --new-tab=' + JSON.stringify(this.child.Name) + ' -e '; + this.command += this.cmdTerm + ' --rename-current-tab=' + JSON.stringify(this.child.Name) + ' --new-tab=' + JSON.stringify(this.child.Name) + ' -e '; this.command += JSON.stringify(this.child.Host); } else { this.command += this.child.Host; From f73e7e85f132e23455c10956dac12bd1305a40ad Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Wed, 18 Oct 2017 12:23:51 -0500 Subject: [PATCH 19/19] Update metadata support --- metadata.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metadata.json b/metadata.json index c50bd9c..95e2e31 100644 --- a/metadata.json +++ b/metadata.json @@ -6,8 +6,8 @@ "3.18", "3.20", "3.22", - "3.23.91", - "3.24" + "3.24", + "3.26" ], "version": "0.8.5", "uuid": "connectionmanager2@ciancio.net",