This commit is contained in:
Murilo Venturoso 2019-01-10 16:28:16 -02:00
parent f3d956002e
commit ee306b626e
2 changed files with 8 additions and 5 deletions

View File

@ -206,7 +206,7 @@ namespace EasySSH {
var notebook = select_host.notebook;
notebook.hexpand = true;
if(notebook.n_tabs == 0) {
var connect = new Connection(select_host, notebook, window);
var connect = new Connection(select_host, notebook, window, this);
var tab = new Granite.Widgets.Tab (select_host.name, null, connect);
notebook.insert_tab(tab, 0);
}else if(notebook.n_tabs > 0) {
@ -362,7 +362,7 @@ namespace EasySSH {
n.tab_removed.connect(() => {
if(n.n_tabs == 0) {
var n_host = hostmanager.get_host_by_name(host.name);
var n_connect = new Connection(n_host, n, window);
var n_connect = new Connection(n_host, n, window, this);
var n_tab = new Granite.Widgets.Tab (n_host.name, null, n_connect);
n.insert_tab(n_tab, 0);
window.current_terminal = null;
@ -475,7 +475,7 @@ namespace EasySSH {
return (TerminalWidget)((TerminalBox)tab.page).term;
}
private void set_badge_item (Granite.Widgets.SourceList.Item item, Granite.Widgets.DynamicNotebook notebook){
public void set_badge_item (Granite.Widgets.SourceList.Item item, Granite.Widgets.DynamicNotebook notebook){
if(notebook.n_tabs == 0){
item.badge = null;
}else if(notebook.n_tabs == 1){

View File

@ -27,14 +27,16 @@ namespace EasySSH {
private Gtk.Label title;
private Gtk.Label description;
public MainWindow window {get; construct;}
public SourceListView sourcelist {get; construct;}
public Connection (Host host, Granite.Widgets.DynamicNotebook notebook, MainWindow window) {
public Connection (Host host, Granite.Widgets.DynamicNotebook notebook, MainWindow window, SourceListView sourcelist) {
Object (
orientation: Gtk.Orientation.VERTICAL,
valign: Gtk.Align.CENTER,
host: host,
notebook: notebook,
window: window
window: window,
sourcelist: sourcelist
);
}
@ -86,6 +88,7 @@ namespace EasySSH {
notebook.insert_tab (tab, next_tab);
notebook.remove_tab(notebook.current);
notebook.current = tab;
sourcelist.set_badge_item (host.item, notebook);
destroy();
}