<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -52,10 +52,21 @@ void cb_manage_hosts()
 
 void cb_connect_host(GtkAction * action)
 {
+    Shell *shell = shell_get_main_shell();
     gchar *name;
     
     g_object_get(G_OBJECT(action), &quot;name&quot;, &amp;name, NULL);
-    remote_connect_host(name);
+    
+    if (remote_connect_host(name)) {
+        gchar *tmp;
+        
+        tmp = g_strdup_printf(&quot;Remote: &lt;b&gt;%s&lt;/b&gt;&quot;, name);
+        shell_set_remote_label(shell, tmp);
+        
+        g_free(tmp);
+    } else {
+        cb_local_computer();
+    }
 
     g_free(name);
 }
@@ -78,6 +89,7 @@ void cb_local_computer()
     
     shell_view_set_enabled(TRUE);
     shell_status_update(&quot;Done.&quot;);
+    shell_set_remote_label(shell, &quot;Local&quot;);
 }
 
 void cb_save_graphic()</diff>
      <filename>hardinfo2/callbacks.c</filename>
    </modified>
    <modified>
      <diff>@@ -353,10 +353,10 @@ static gboolean remote_connect_direct(gchar *hostname,
     return retval;
 }                                  
 
-static void remote_connect_ssh(gchar *hostname, 
-                               gint port,
-                               gchar *username,
-                               gchar *password)
+static gboolean remote_connect_ssh(gchar *hostname, 
+                                   gint port,
+                                   gchar *username,
+                                   gchar *password)
 {
     GtkWidget *dialog;
     SSHConnResponse ssh_response;
@@ -428,11 +428,14 @@ out:
     g_free(struri);
     shell_view_set_enabled(TRUE);
     shell_status_update(&quot;Done.&quot;);
+    
+    return !error;
 }                               
 
-void remote_connect_host(gchar *hostname)
+gboolean remote_connect_host(gchar *hostname)
 {
     Shell *shell = shell_get_main_shell();
+    gboolean retval = FALSE;
     
     if (!g_key_file_has_group(shell-&gt;hosts, hostname)) {
         GtkWidget *dialog;
@@ -455,16 +458,18 @@ void remote_connect_host(gchar *hostname)
             gchar *username = g_key_file_get_string(shell-&gt;hosts, hostname, &quot;username&quot;, NULL);
             gchar *password = g_key_file_get_string(shell-&gt;hosts, hostname, &quot;password&quot;, NULL);
             
-            remote_connect_ssh(hostname, port, username, password);
+            retval = remote_connect_ssh(hostname, port, username, password);
             
             g_free(username);
             g_free(password);
         } else {
-            remote_connect_direct(hostname, port);
+            retval = remote_connect_direct(hostname, port);
         }
         
         g_free(type);
     }
+    
+    return retval;
 }
 
 void connect_dialog_show(GtkWidget * parent)
@@ -472,6 +477,7 @@ void connect_dialog_show(GtkWidget * parent)
     HostDialog *he = host_dialog_new(parent, &quot;Connect to&quot;, HOST_DIALOG_MODE_CONNECT);
 
     if (gtk_dialog_run(GTK_DIALOG(he-&gt;dialog)) == GTK_RESPONSE_ACCEPT) {
+        gboolean connected;
         gchar *hostname = (gchar *)gtk_entry_get_text(GTK_ENTRY(he-&gt;txt_hostname));
         const gint selected_type = gtk_combo_box_get_active(GTK_COMBO_BOX(he-&gt;cmb_type));
         const gint port = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(he-&gt;txt_port));
@@ -482,9 +488,21 @@ void connect_dialog_show(GtkWidget * parent)
             gchar *username = (gchar *)gtk_entry_get_text(GTK_ENTRY(he-&gt;txt_ssh_user));
             gchar *password = (gchar *)gtk_entry_get_text(GTK_ENTRY(he-&gt;txt_ssh_password));
             
-            remote_connect_ssh(hostname, port, username, password);
+            connected = remote_connect_ssh(hostname, port, username, password);
+        } else {
+            connected = remote_connect_direct(hostname, port);
+        }
+        
+        if (connected) {
+            Shell *shell = shell_get_main_shell();
+            gchar *tmp;
+            
+            tmp = g_strdup_printf(&quot;Remote: &lt;b&gt;%s&lt;/b&gt;&quot;, hostname);
+            shell_set_remote_label(shell, tmp);
+            
+            g_free(tmp);
         } else {
-            remote_connect_direct(hostname, port);
+            cb_local_computer();
         }
     }
     
@@ -592,7 +610,7 @@ static HostDialog *host_dialog_new(GtkWidget * parent,
     GtkWidget *txt_port;
     GtkWidget *frame1;
     GtkWidget *alignment3;
-    GtkWidget *notebook1;
+    GtkWidget *notebook;
     GtkWidget *vbox2;
     GtkWidget *hbox2;
     GtkWidget *image1;
@@ -685,16 +703,16 @@ static HostDialog *host_dialog_new(GtkWidget * parent,
     gtk_container_add(GTK_CONTAINER(frame1), alignment3);
     gtk_alignment_set_padding(GTK_ALIGNMENT(alignment3), 0, 0, 12, 0);
 
-    notebook1 = gtk_notebook_new();
-    gtk_widget_show(notebook1);
-    gtk_container_add(GTK_CONTAINER(alignment3), notebook1);
-    GTK_WIDGET_UNSET_FLAGS(notebook1, GTK_CAN_FOCUS);
-    gtk_notebook_set_show_tabs(GTK_NOTEBOOK(notebook1), FALSE);
-    gtk_notebook_set_show_border(GTK_NOTEBOOK(notebook1), FALSE);
+    notebook = gtk_notebook_new();
+    gtk_widget_show(notebook);
+    gtk_container_add(GTK_CONTAINER(alignment3), notebook);
+    GTK_WIDGET_UNSET_FLAGS(notebook, GTK_CAN_FOCUS);
+    gtk_notebook_set_show_tabs(GTK_NOTEBOOK(notebook), FALSE);
+    gtk_notebook_set_show_border(GTK_NOTEBOOK(notebook), FALSE);
 
     vbox2 = gtk_vbox_new(FALSE, 0);
     gtk_widget_show(vbox2);
-    gtk_container_add(GTK_CONTAINER(notebook1), vbox2);
+    gtk_container_add(GTK_CONTAINER(notebook), vbox2);
 
     hbox2 = gtk_hbox_new(FALSE, 4);
     gtk_widget_show(hbox2);
@@ -719,7 +737,7 @@ static HostDialog *host_dialog_new(GtkWidget * parent,
 
     vbox3 = gtk_vbox_new(FALSE, 4);
     gtk_widget_show(vbox3);
-    gtk_container_add(GTK_CONTAINER(notebook1), vbox3);
+    gtk_container_add(GTK_CONTAINER(notebook), vbox3);
     gtk_container_set_border_width(GTK_CONTAINER(vbox3), 5);
 
     table2 = gtk_table_new(2, 2, FALSE);
@@ -818,7 +836,7 @@ static HostDialog *host_dialog_new(GtkWidget * parent,
 
     host_dlg = g_new0(HostDialog, 1);
     host_dlg-&gt;dialog = dialog;
-    host_dlg-&gt;notebook = notebook1;
+    host_dlg-&gt;notebook = notebook;
     host_dlg-&gt;txt_hostname = txt_hostname;
     host_dlg-&gt;txt_port = txt_port;
     host_dlg-&gt;txt_ssh_user = txt_ssh_user;
@@ -1040,9 +1058,9 @@ static HostManager *host_manager_new(GtkWidget * parent)
     gchar *path;
     GtkWidget *dialog;
     GtkWidget *dialog1_vbox;
-    GtkWidget *scrolledwindow2;
-    GtkWidget *treeview2;
-    GtkWidget *vbuttonbox3;
+    GtkWidget *scrolledwindow;
+    GtkWidget *treeview;
+    GtkWidget *vbuttonbox;
     GtkWidget *button3;
     GtkWidget *button6;
     GtkWidget *dialog1_action_area;
@@ -1077,27 +1095,28 @@ static HostManager *host_manager_new(GtkWidget * parent)
     gtk_box_pack_start(GTK_BOX(dialog1_vbox), hbox, TRUE, TRUE, 0);
     gtk_widget_show(hbox);
 
-    scrolledwindow2 = gtk_scrolled_window_new(NULL, NULL);
-    gtk_widget_show(scrolledwindow2);
-    gtk_box_pack_start(GTK_BOX(hbox), scrolledwindow2, TRUE, TRUE, 0);
-    gtk_widget_set_size_request(scrolledwindow2, -1, 200);
-    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow2),
+    scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
+    gtk_widget_show(scrolledwindow);
+    gtk_box_pack_start(GTK_BOX(hbox), scrolledwindow, TRUE, TRUE, 0);
+    gtk_widget_set_size_request(scrolledwindow, -1, 200);
+    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow),
 				   GTK_POLICY_AUTOMATIC,
 				   GTK_POLICY_AUTOMATIC);
     gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW
-					(scrolledwindow2), GTK_SHADOW_IN);
+					(scrolledwindow), GTK_SHADOW_IN);
 
     store =
 	gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT);
     model = GTK_TREE_MODEL(store);
 
-    treeview2 = gtk_tree_view_new_with_model(model);
-    gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview2), FALSE);
-    gtk_widget_show(treeview2);
-    gtk_container_add(GTK_CONTAINER(scrolledwindow2), treeview2);
+    treeview = gtk_tree_view_new_with_model(model);
+    gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), FALSE);
+    gtk_widget_show(treeview);
+    gtk_container_add(GTK_CONTAINER(scrolledwindow), treeview);
+    gtk_tree_view_set_reorderable(GTK_TREE_VIEW(treeview), TRUE);
 
     column = gtk_tree_view_column_new();
-    gtk_tree_view_append_column(GTK_TREE_VIEW(treeview2), column);
+    gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
 
     cr_pbuf = gtk_cell_renderer_pixbuf_new();
     gtk_tree_view_column_pack_start(column, cr_pbuf, FALSE);
@@ -1110,30 +1129,30 @@ static HostManager *host_manager_new(GtkWidget * parent)
 				       TREE_COL_NAME);
 
 
-    vbuttonbox3 = gtk_vbutton_box_new();
-    gtk_widget_show(vbuttonbox3);
-    gtk_box_pack_start(GTK_BOX(hbox), vbuttonbox3, FALSE, TRUE, 0);
-    gtk_box_set_spacing(GTK_BOX(vbuttonbox3), 5);
-    gtk_button_box_set_layout(GTK_BUTTON_BOX(vbuttonbox3),
+    vbuttonbox = gtk_vbutton_box_new();
+    gtk_widget_show(vbuttonbox);
+    gtk_box_pack_start(GTK_BOX(hbox), vbuttonbox, FALSE, TRUE, 0);
+    gtk_box_set_spacing(GTK_BOX(vbuttonbox), 5);
+    gtk_button_box_set_layout(GTK_BUTTON_BOX(vbuttonbox),
 			      GTK_BUTTONBOX_START);
 
     button3 = gtk_button_new_with_mnemonic(&quot;_Add&quot;);
     gtk_widget_show(button3);
-    gtk_container_add(GTK_CONTAINER(vbuttonbox3), button3);
+    gtk_container_add(GTK_CONTAINER(vbuttonbox), button3);
     GTK_WIDGET_SET_FLAGS(button3, GTK_CAN_DEFAULT);
     g_signal_connect(button3, &quot;clicked&quot;,
 		     G_CALLBACK(host_manager_add), rd);
 
     button6 = gtk_button_new_with_mnemonic(&quot;_Edit&quot;);
     gtk_widget_show(button6);
-    gtk_container_add(GTK_CONTAINER(vbuttonbox3), button6);
+    gtk_container_add(GTK_CONTAINER(vbuttonbox), button6);
     GTK_WIDGET_SET_FLAGS(button6, GTK_CAN_DEFAULT);
     g_signal_connect(button6, &quot;clicked&quot;, G_CALLBACK(host_manager_edit),
 		     rd);
 
     button2 = gtk_button_new_with_mnemonic(&quot;_Remove&quot;);
     gtk_widget_show(button2);
-    gtk_container_add(GTK_CONTAINER(vbuttonbox3), button2);
+    gtk_container_add(GTK_CONTAINER(vbuttonbox), button2);
     GTK_WIDGET_SET_FLAGS(button2, GTK_CAN_DEFAULT);
     g_signal_connect(button2, &quot;clicked&quot;, G_CALLBACK(host_manager_remove),
 		     rd);
@@ -1149,9 +1168,9 @@ static HostManager *host_manager_new(GtkWidget * parent)
 				 GTK_RESPONSE_CANCEL);
     GTK_WIDGET_SET_FLAGS(button8, GTK_CAN_DEFAULT);
 
-    gtk_tree_view_collapse_all(GTK_TREE_VIEW(treeview2));
+    gtk_tree_view_collapse_all(GTK_TREE_VIEW(treeview));
 
-    sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview2));
+    sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
 
     g_signal_connect(G_OBJECT(sel), &quot;changed&quot;,
 		     (GCallback) host_manager_tree_sel_changed, rd);</diff>
      <filename>hardinfo2/remote.c</filename>
    </modified>
    <modified>
      <diff>@@ -60,6 +60,16 @@ static GSList *update_sfusrc = NULL;
  * Code :) ********************************************************************
  */
 
+void shell_set_remote_label(Shell *shell, gchar *label)
+{
+    gchar *tmp;
+    
+    tmp = g_strdup_printf(&quot;&lt;small&gt;%s&lt;/small&gt; &quot;, label);
+    gtk_label_set_markup(GTK_LABEL(shell-&gt;remote_label), tmp);
+    
+    g_free(tmp);
+}
+
 Shell *shell_get_main_shell(void)
 {
     return shell;
@@ -403,6 +413,16 @@ static void create_window(void)
     gtk_widget_hide(shell-&gt;progress);
     gtk_box_pack_end(GTK_BOX(hbox), shell-&gt;progress, FALSE, FALSE, 5);
 
+    shell-&gt;remote_label = gtk_label_new(&quot;&quot;);
+    gtk_label_set_use_markup(GTK_LABEL(shell-&gt;remote_label), TRUE);
+#ifdef HAS_LIBSOUP
+    gtk_widget_show(shell-&gt;remote_label);
+#else
+    gtk_widget_hide(shell-&gt;remote_label);
+#endif
+    shell_set_remote_label(shell, &quot;Local&quot;);
+    gtk_box_pack_end(GTK_BOX(hbox), shell-&gt;remote_label, FALSE, FALSE, 0);
+
     shell-&gt;status = gtk_label_new(&quot;&quot;);
     gtk_misc_set_alignment(GTK_MISC(shell-&gt;status), 0.0, 0.5);
     gtk_widget_show(shell-&gt;status);
@@ -531,6 +551,7 @@ void shell_update_remote_menu(void)
 {
     GSList *merge_id;
     gchar **hosts;
+    gsize length;
     gint i;
     
     for (merge_id = remote_merge_ids; merge_id; merge_id = merge_id-&gt;next) {
@@ -539,7 +560,8 @@ void shell_update_remote_menu(void)
         gtk_ui_manager_remove_ui(shell-&gt;ui_manager, id);
     }
     
-    for (i = 0, hosts = g_key_file_get_groups(shell-&gt;hosts, NULL); hosts[i]; i++) {
+    hosts = g_key_file_get_groups(shell-&gt;hosts, &amp;length);
+    for (i = length - 1; i &gt;= 0; i--) {
         add_host_to_view_menu(g_strdup(hosts[i]));
     }
     </diff>
      <filename>hardinfo2/shell.c</filename>
    </modified>
    <modified>
      <diff>@@ -74,6 +74,7 @@ typedef enum {
 struct _Shell {
     GtkWidget		*window, *vbox;
     GtkWidget		*status, *progress;
+    GtkWidget		*remote_label;
     GtkWidget		*notebook;
     GtkWidget		*hpaned, *vpaned;
 
@@ -198,6 +199,8 @@ void		shell_add_modules_to_gui(gpointer _shell_module, gpointer _shell_tree);
 void		shell_save_hosts_file(void);
 void		shell_update_remote_menu(void);
 
+void		shell_set_remote_label(Shell *shell, gchar *label);
+
 #endif				/* __SHELL_H__ */
 
 </diff>
      <filename>hardinfo2/shell.h</filename>
    </modified>
    <modified>
      <diff>@@ -39,10 +39,9 @@ char *uidefs_str = &quot;&lt;ui&gt;&quot; \
 &quot;	&lt;menu name=\&quot;ViewMenu\&quot; action=\&quot;ViewMenuAction\&quot;&gt;&quot; \
 &quot;		&lt;menuitem name=\&quot;SidePane\&quot; action=\&quot;SidePaneAction\&quot;/&gt;&quot; \
 &quot;		&lt;menuitem name=\&quot;Toolbar\&quot; action=\&quot;ToolbarAction\&quot;/&gt;&quot; \
-&quot;		&lt;separator/&gt;&quot; \
-&quot;		&lt;menuitem name=\&quot;Refresh\&quot; action=\&quot;RefreshAction\&quot;/&gt;&quot; \
-&quot;		&lt;separator/&gt;&quot; \
+&quot;		&lt;separator/&gt;&quot;\
 &quot;		&lt;separator name=\&quot;LastSep\&quot;/&gt;&quot; \
+&quot;		&lt;menuitem name=\&quot;Refresh\&quot; action=\&quot;RefreshAction\&quot;/&gt;&quot; \
 &quot;	&lt;/menu&gt;&quot; \
 REMOTE_MENU_ITEMS
 &quot;	&lt;menu name=\&quot;HelpMenu\&quot; action=\&quot;HelpMenuAction\&quot;&gt;&quot; \</diff>
      <filename>hardinfo2/uidefs.h</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fea14ed5d2088500649c1a1350a407922bac253c</id>
    </parent>
  </parents>
  <author>
    <name>Leandro A. F. Pereira</name>
    <email>leandro@hardinfo.org</email>
  </author>
  <url>http://github.com/lpereira/hardinfo/commit/97084a46bd22f65cb4e7f8038297b5a1a1c7515c</url>
  <id>97084a46bd22f65cb4e7f8038297b5a1a1c7515c</id>
  <committed-date>2009-05-30T07:33:34-07:00</committed-date>
  <authored-date>2009-05-30T07:33:34-07:00</authored-date>
  <message>Add a label to the status bar to show if HardInfo is in remote or local mode</message>
  <tree>1ada2c985a81b22990fa0639bfb5cd49d1cbbf56</tree>
  <committer>
    <name>Leandro A. F. Pereira</name>
    <email>leandro@hardinfo.org</email>
  </committer>
</commit>
