6955
|
1 |
--- gnome-system-tools-2.13.2/src/shares/share-export.c-orig 2006-03-03 16:16:05.157378000 +0000
|
|
2 |
+++ gnome-system-tools-2.13.2/src/shares/share-export.c 2006-03-03 16:16:26.132960000 +0000
|
|
3 |
@@ -181,5 +181,5 @@
|
|
4 |
if (GST_SHARE_GET_CLASS (share)->get_xml == NULL)
|
|
5 |
return;
|
|
6 |
|
|
7 |
- return GST_SHARE_GET_CLASS (share)->get_xml (share, parent);
|
|
8 |
+ GST_SHARE_GET_CLASS (share)->get_xml (share, parent);
|
|
9 |
}
|
8436
|
10 |
|
|
11 |
diff -u gnome-system-tools-2.14.0/src/shares/callbacks.c-orig gnome-system-tools-2.14.0/src/shares/callbacks.c
|
|
12 |
--- gnome-system-tools-2.14.0/src/shares/callbacks.c-orig 2005-08-08 20:00:03.000000000 +0100
|
|
13 |
+++ gnome-system-tools-2.14.0/src/shares/callbacks.c 2006-10-23 15:31:55.258228000 +0100
|
|
14 |
@@ -128,7 +128,7 @@
|
|
15 |
path = g_strdup (gnome_vfs_uri_get_path (uris->data));
|
|
16 |
|
|
17 |
if (g_file_test (path, G_FILE_TEST_IS_DIR)) {
|
|
18 |
- share_settings_dialog_run (path, FALSE);
|
|
19 |
+ share_settings_dialog_run (path, ANY_SHARE, FALSE);
|
|
20 |
gtk_drag_finish (context, TRUE, FALSE, time);
|
|
21 |
} else {
|
|
22 |
gtk_drag_finish (context, FALSE, FALSE, time);
|
|
23 |
@@ -143,7 +143,7 @@
|
|
24 |
void
|
|
25 |
on_add_share_clicked (GtkWidget *widget, gpointer data)
|
|
26 |
{
|
|
27 |
- share_settings_dialog_run (NULL, FALSE);
|
|
28 |
+ share_settings_dialog_run (NULL, ANY_SHARE, FALSE);
|
|
29 |
}
|
|
30 |
|
|
31 |
void
|
|
32 |
@@ -154,6 +154,7 @@
|
|
33 |
GtkTreeModel *model;
|
|
34 |
GtkTreeIter iter;
|
|
35 |
gchar *path;
|
|
36 |
+ gint share_type;
|
|
37 |
|
|
38 |
table = gst_dialog_get_widget (tool->main_dialog, "shares_table");
|
|
39 |
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (table));
|
|
40 |
@@ -161,9 +162,9 @@
|
|
41 |
if (!gtk_tree_selection_get_selected (selection, &model, &iter))
|
|
42 |
return;
|
|
43 |
|
|
44 |
- gtk_tree_model_get (model, &iter, COL_PATH, &path, -1);
|
|
45 |
+ gtk_tree_model_get (model, &iter, COL_PATH, &path, COL_SHARETYPE, &share_type, -1);
|
|
46 |
|
|
47 |
- share_settings_dialog_run (path, FALSE);
|
|
48 |
+ share_settings_dialog_run (path, share_type, FALSE);
|
|
49 |
g_free (path);
|
|
50 |
}
|
|
51 |
|
|
52 |
|
|
53 |
diff -u gnome-system-tools-2.14.0/src/shares/main.c-orig gnome-system-tools-2.14.0/src/shares/main.c
|
|
54 |
--- gnome-system-tools-2.14.0/src/shares/main.c-orig 2005-08-08 20:00:03.000000000 +0100
|
|
55 |
+++ gnome-system-tools-2.14.0/src/shares/main.c 2006-10-23 15:31:55.362018000 +0100
|
|
56 |
@@ -70,7 +70,7 @@
|
|
57 |
init_standalone_dialog (const gchar *path)
|
|
58 |
{
|
|
59 |
gst_tool_main_with_hidden_dialog (tool, TRUE);
|
|
60 |
- share_settings_dialog_run (path, TRUE);
|
|
61 |
+ share_settings_dialog_run (path, ANY_SHARE, TRUE);
|
|
62 |
}
|
|
63 |
|
|
64 |
void
|
|
65 |
|
|
66 |
diff -u gnome-system-tools-2.14.0/src/shares/share-export-nfs.c-orig gnome-system-tools-2.14.0/src/shares/share-export-nfs.c
|
8543
|
67 |
--- gnome-system-tools-2.14.0/src/shares/share-export-nfs.c-orig 2006-11-13 13:30:16.525878000 +0800
|
|
68 |
+++ gnome-system-tools-2.14.0/src/shares/share-export-nfs.c 2006-11-13 13:13:57.350210000 +0800
|
8436
|
69 |
@@ -137,9 +137,10 @@
|
|
70 |
GstShareNFS *share;
|
|
71 |
|
|
72 |
share = g_object_new (GST_TYPE_SHARE_NFS,
|
|
73 |
- "share-path", path,
|
|
74 |
NULL);
|
|
75 |
|
|
76 |
+ gst_share_set_path (GST_SHARE (share), path);
|
|
77 |
+
|
|
78 |
return share;
|
|
79 |
}
|
|
80 |
|
8543
|
81 |
@@ -173,7 +174,6 @@
|
|
82 |
}
|
|
83 |
|
|
84 |
g_free (path);
|
|
85 |
- g_free (type);
|
|
86 |
|
|
87 |
return share;
|
|
88 |
}
|
8436
|
89 |
|
|
90 |
diff -u gnome-system-tools-2.14.0/src/shares/share-settings.c-orig gnome-system-tools-2.14.0/src/shares/share-settings.c
|
8543
|
91 |
--- gnome-system-tools-2.14.0/src/shares/share-settings.c-orig 2006-11-13 13:31:05.341437000 +0800
|
|
92 |
+++ gnome-system-tools-2.14.0/src/shares/share-settings.c 2006-11-13 13:26:19.086675000 +0800
|
|
93 |
@@ -244,7 +244,7 @@
|
|
94 |
gint flags = 0;
|
|
95 |
|
|
96 |
widget = gst_dialog_get_widget (tool->main_dialog, "share_path");
|
|
97 |
- path = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (widget));
|
|
98 |
+ path = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
|
|
99 |
|
|
100 |
widget = gst_dialog_get_widget (tool->main_dialog, "share_smb_name");
|
|
101 |
name = gtk_entry_get_text (GTK_ENTRY (widget));
|
|
102 |
@@ -274,7 +274,7 @@
|
|
103 |
GstShareNFS *share;
|
|
104 |
|
|
105 |
widget = gst_dialog_get_widget (tool->main_dialog, "share_path");
|
|
106 |
- path = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (widget));
|
|
107 |
+ path = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
|
|
108 |
|
|
109 |
share = gst_share_nfs_new (path);
|
|
110 |
nfs_acl_table_insert_elements (share);
|
8436
|
111 |
@@ -334,7 +334,7 @@
|
|
112 |
}
|
|
113 |
|
|
114 |
void
|
|
115 |
-share_settings_dialog_run (const gchar *path, gboolean standalone)
|
|
116 |
+share_settings_dialog_run (const gchar *path, gint share_type, gboolean standalone)
|
|
117 |
{
|
|
118 |
GtkWidget *dialog;
|
|
119 |
gint response;
|
|
120 |
@@ -346,7 +346,7 @@
|
|
121 |
dialog = share_settings_prepare_dialog (path, standalone);
|
|
122 |
|
|
123 |
/* check whether the path already exists */
|
|
124 |
- path_exists = table_get_iter_with_path (path, &iter);
|
|
125 |
+ path_exists = table_get_iter_with_path (path, share_type, &iter);
|
|
126 |
|
|
127 |
if (path_exists) {
|
|
128 |
share = table_get_share_at_iter (&iter);
|
|
129 |
|
|
130 |
diff -u gnome-system-tools-2.14.0/src/shares/share-settings.h-orig gnome-system-tools-2.14.0/src/shares/share-settings.h
|
|
131 |
--- gnome-system-tools-2.14.0/src/shares/share-settings.h-orig 2005-04-06 23:21:44.000000000 +0100
|
|
132 |
+++ gnome-system-tools-2.14.0/src/shares/share-settings.h 2006-10-23 15:31:55.555242000 +0100
|
|
133 |
@@ -33,7 +33,7 @@
|
|
134 |
SHARE_THROUGH_NFS
|
|
135 |
};
|
|
136 |
|
|
137 |
-void share_settings_dialog_run (const gchar*, gboolean);
|
|
138 |
+void share_settings_dialog_run (const gchar*, gint, gboolean);
|
|
139 |
void share_settings_create_combo (void);
|
|
140 |
gboolean share_settings_validate (void);
|
|
141 |
|
|
142 |
|
|
143 |
diff -u gnome-system-tools-2.14.0/src/shares/table.c-orig gnome-system-tools-2.14.0/src/shares/table.c
|
|
144 |
--- gnome-system-tools-2.14.0/src/shares/table.c-orig 2005-08-08 20:00:03.000000000 +0100
|
|
145 |
+++ gnome-system-tools-2.14.0/src/shares/table.c 2006-10-23 15:31:55.679417000 +0100
|
|
146 |
@@ -85,7 +85,8 @@
|
|
147 |
store = gtk_list_store_new (COL_LAST,
|
|
148 |
GDK_TYPE_PIXBUF,
|
|
149 |
G_TYPE_STRING,
|
|
150 |
- G_TYPE_OBJECT);
|
|
151 |
+ G_TYPE_OBJECT,
|
|
152 |
+ G_TYPE_INT);
|
|
153 |
|
|
154 |
return GTK_TREE_MODEL (store);
|
|
155 |
}
|
|
156 |
@@ -185,6 +186,7 @@
|
|
157 |
GtkWidget *table = gst_dialog_get_widget (tool->main_dialog, "shares_table");
|
|
158 |
GtkTreeModel *model;
|
|
159 |
GdkPixbuf *pixbuf = NULL;
|
|
160 |
+ gint share_type = ANY_SHARE;
|
|
161 |
|
|
162 |
g_return_if_fail (share != NULL);
|
|
163 |
g_return_if_fail (GST_IS_SHARE (share));
|
|
164 |
@@ -195,17 +197,20 @@
|
|
165 |
pixbuf = gtk_icon_theme_load_icon (icon_theme,
|
|
166 |
"gnome-fs-smb",
|
|
167 |
48, 0, NULL);
|
|
168 |
+ share_type = SMB_SHARE;
|
|
169 |
} else if (GST_IS_SHARE_NFS (share)) {
|
|
170 |
pixbuf = gtk_icon_theme_load_icon (icon_theme,
|
|
171 |
"gnome-fs-nfs",
|
|
172 |
48, 0, NULL);
|
|
173 |
+ share_type = NFS_SHARE;
|
|
174 |
}
|
|
175 |
|
|
176 |
gtk_list_store_set (GTK_LIST_STORE (model),
|
|
177 |
iter,
|
|
178 |
- 0, pixbuf,
|
|
179 |
- 1, gst_share_get_path (share),
|
|
180 |
- 2, share,
|
|
181 |
+ COL_PIXBUF, pixbuf,
|
|
182 |
+ COL_PATH, gst_share_get_path (share),
|
|
183 |
+ COL_POINTER, share,
|
|
184 |
+ COL_SHARETYPE, share_type,
|
|
185 |
-1);
|
|
186 |
|
|
187 |
g_object_unref (share);
|
|
188 |
@@ -241,12 +246,13 @@
|
|
189 |
}
|
|
190 |
|
|
191 |
gboolean
|
|
192 |
-table_get_iter_with_path (const gchar *path, GtkTreeIter *iter)
|
|
193 |
+table_get_iter_with_path (const gchar *path, gint share_type, GtkTreeIter *iter)
|
|
194 |
{
|
|
195 |
GtkWidget *table = gst_dialog_get_widget (tool->main_dialog, "shares_table");
|
|
196 |
GtkTreeModel *model;
|
|
197 |
gboolean valid, found;
|
|
198 |
gchar *iter_path;
|
|
199 |
+ gint iter_share_type;
|
|
200 |
|
|
201 |
if (!path)
|
|
202 |
return FALSE;
|
|
203 |
@@ -258,9 +264,11 @@
|
|
204 |
while (valid) {
|
|
205 |
gtk_tree_model_get (model, iter,
|
|
206 |
COL_PATH, &iter_path,
|
|
207 |
+ COL_SHARETYPE, &iter_share_type,
|
|
208 |
-1);
|
|
209 |
|
|
210 |
- if (strcmp (iter_path, path) == 0) {
|
|
211 |
+ if (strcmp (iter_path, path) == 0 &&
|
|
212 |
+ ( iter_share_type == share_type || iter_share_type == ANY_SHARE ) ) {
|
|
213 |
found = TRUE;
|
|
214 |
valid = FALSE;
|
|
215 |
} else
|
|
216 |
|
|
217 |
diff -u gnome-system-tools-2.14.0/src/shares/table.h-orig gnome-system-tools-2.14.0/src/shares/table.h
|
|
218 |
--- gnome-system-tools-2.14.0/src/shares/table.h-orig 2004-09-20 16:30:44.000000000 +0100
|
|
219 |
+++ gnome-system-tools-2.14.0/src/shares/table.h 2006-10-23 15:31:55.698077000 +0100
|
|
220 |
@@ -30,17 +30,24 @@
|
|
221 |
COL_PIXBUF,
|
|
222 |
COL_PATH,
|
|
223 |
COL_POINTER,
|
|
224 |
+ COL_SHARETYPE,
|
|
225 |
COL_LAST
|
|
226 |
};
|
|
227 |
|
|
228 |
enum {
|
|
229 |
+ ANY_SHARE,
|
|
230 |
+ SMB_SHARE,
|
|
231 |
+ NFS_SHARE
|
|
232 |
+};
|
|
233 |
+
|
|
234 |
+enum {
|
|
235 |
SHARES_DND_URI_LIST
|
|
236 |
};
|
|
237 |
|
|
238 |
void table_create (void);
|
|
239 |
void table_add_share_from_node (xmlNodePtr);
|
|
240 |
void table_add_share (GstShare*);
|
|
241 |
-gboolean table_get_iter_with_path (const gchar*, GtkTreeIter*);
|
|
242 |
+gboolean table_get_iter_with_path (const gchar*, gint, GtkTreeIter*);
|
|
243 |
GstShare* table_get_share_at_iter (GtkTreeIter*);
|
|
244 |
void table_modify_share_at_iter (GtkTreeIter*, GstShare*);
|
|
245 |
void table_delete_share_at_iter (GtkTreeIter*);
|
|
246 |
|