[gnome-commander] Fixed problem with editing connections to Windows network
- From: Piotr Eljasiak <epiotr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-commander] Fixed problem with editing connections to Windows network
- Date: Sun, 17 Jan 2010 18:57:56 +0000 (UTC)
commit 9047fcf09618a3ad97eb1b36d7d3eba7a88bb4bc
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Sun Jan 17 19:42:59 2010 +0100
Fixed problem with editing connections to Windows network
NEWS | 1 +
doc/C/gnome-commander.xml | 3 +++
src/gnome-cmd-con-dialog.cc | 40 ++++++++++++++++++++++++++++++++++++----
3 files changed, 40 insertions(+), 4 deletions(-)
---
diff --git a/NEWS b/NEWS
index 518969f..f6c6107 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,7 @@ gnome-commander 1.2.8.5
Bug fixes:
* Fixed problem #604558 (cursor lost/placed in wrong position)
* Fixed problem #604904 (build error on OpenSolaris)
+ * Fixed problem with editing connections to Windows network
* Fixed problem with nonexistent user actions
diff --git a/doc/C/gnome-commander.xml b/doc/C/gnome-commander.xml
index 2f05127..0d68c98 100644
--- a/doc/C/gnome-commander.xml
+++ b/doc/C/gnome-commander.xml
@@ -6053,6 +6053,9 @@
<para>Fixed problem #604904 (build error on OpenSolaris)</para>
</listitem>
<listitem>
+ <para>Fixed problem with editing connections to Windows network</para>
+ </listitem>
+ <listitem>
<para>Fixed problem with nonexistent user actions</para>
</listitem>
</itemizedlist>
diff --git a/src/gnome-cmd-con-dialog.cc b/src/gnome-cmd-con-dialog.cc
index 31b9212..3db7399 100644
--- a/src/gnome-cmd-con-dialog.cc
+++ b/src/gnome-cmd-con-dialog.cc
@@ -624,10 +624,42 @@ gboolean gnome_cmd_connect_dialog_edit (GnomeCmdConFtp *server)
gtk_entry_set_text (GTK_ENTRY (conndlg->priv->uri_entry), con->uri);
gtk_entry_set_text (GTK_ENTRY (conndlg->priv->server_entry), gnome_vfs_uri_get_host_name (uri));
- // gtk_entry_set_text (GTK_ENTRY (conndlg->priv->share_entry), ???);
- gtk_entry_set_text (GTK_ENTRY (conndlg->priv->folder_entry), gnome_vfs_uri_get_path (uri));
- // gtk_entry_set_text (GTK_ENTRY (conndlg->priv->domain_entry), ???);
- gtk_entry_set_text (GTK_ENTRY (conndlg->priv->user_entry), gnome_vfs_uri_get_user_name (uri));
+
+ const gchar *path = gnome_vfs_uri_get_path (uri);
+ const gchar *user_name = gnome_vfs_uri_get_user_name (uri);
+
+ if (con->method==CON_SMB)
+ {
+ gchar **a = g_strsplit (path, "/", 3);
+
+ if (g_strv_length (a) > 2)
+ {
+ gtk_entry_set_text (GTK_ENTRY (conndlg->priv->share_entry), a[1]);
+ gtk_entry_set_text (GTK_ENTRY (conndlg->priv->folder_entry), a[2]);
+ }
+ else
+ gtk_entry_set_text (GTK_ENTRY (conndlg->priv->folder_entry), path);
+
+ g_strfreev(a);
+
+ a = g_strsplit (user_name, ";", 2);
+
+ if (g_strv_length (a) > 1)
+ {
+ gtk_entry_set_text (GTK_ENTRY (conndlg->priv->domain_entry), a[0]);
+ gtk_entry_set_text (GTK_ENTRY (conndlg->priv->user_entry), a[1]);
+ }
+ else
+ gtk_entry_set_text (GTK_ENTRY (conndlg->priv->user_entry), user_name);
+
+ g_strfreev(a);
+ }
+ else
+ {
+ gtk_entry_set_text (GTK_ENTRY (conndlg->priv->folder_entry), path);
+ gtk_entry_set_text (GTK_ENTRY (conndlg->priv->user_entry), user_name);
+ }
+
gtk_entry_set_text (GTK_ENTRY (conndlg->priv->password_entry), gnome_vfs_uri_get_password (uri));
guint port = gnome_vfs_uri_get_host_port (uri);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]