[Goodies-commits] r6632 - in thunar-shares-plugin/trunk: . libshares po thunar-plugin

Daniel Morales danielm at xfce.org
Mon Feb 2 20:39:39 CET 2009


Author: danielm
Date: 2009-02-02 19:39:39 +0000 (Mon, 02 Feb 2009)
New Revision: 6632

Modified:
   thunar-shares-plugin/trunk/ChangeLog
   thunar-shares-plugin/trunk/TODO
   thunar-shares-plugin/trunk/libshares/shares.c
   thunar-shares-plugin/trunk/po/thunar-shares-plugin.pot
   thunar-shares-plugin/trunk/thunar-plugin/tsp-admin-editor.c
   thunar-shares-plugin/trunk/thunar-plugin/tsp-admin.c
   thunar-shares-plugin/trunk/thunar-plugin/tsp-page.c
Log:
	* libshares/shares.c:
	* thunar-plugin/tsp-page.c:
	* thunar-plugin/tsp-admin.c: Do not display error message in dialogs,
	let's display that errors on a embed label.
	* thunar-plugin/tsp-admin-editor.c: Fixed message string.
	* po/thunar-shares-plugin.pot: Bring back the POT file. 

Modified: thunar-shares-plugin/trunk/ChangeLog
===================================================================
--- thunar-shares-plugin/trunk/ChangeLog	2009-02-02 10:20:04 UTC (rev 6631)
+++ thunar-shares-plugin/trunk/ChangeLog	2009-02-02 19:39:39 UTC (rev 6632)
@@ -1,3 +1,12 @@
+2009-02-02	Daniel Morales <daniel at daniel.com.uy>
+
+	* libshares/shares.c:
+	* thunar-plugin/tsp-page.c:
+	* thunar-plugin/tsp-admin.c: Do not display error message in dialogs,
+	let's display that errors on a embed label.
+	* thunar-plugin/tsp-admin-editor.c: Fixed message string.
+	* po/thunar-shares-plugin.pot: Bring back the POT file.
+
 2009-01-27	Daniel Morales <daniel at daniel.com.uy>
 
 	* INSTALL: new autotools INSTALL file.

Modified: thunar-shares-plugin/trunk/TODO
===================================================================
--- thunar-shares-plugin/trunk/TODO	2009-02-02 10:20:04 UTC (rev 6631)
+++ thunar-shares-plugin/trunk/TODO	2009-02-02 19:39:39 UTC (rev 6632)
@@ -3,14 +3,20 @@
 
   * Add emblems to shared folders (Thunar doesn't allow to add/remove
     emblembs from plugins yet).
-    - Maybe we can use tdb: ${HOME}/.cache/Thunar/metafile.tdb
 
   * Maybe some help button at shares-admin dialog.
 
   * We need to review the permissions hierarchy check:
     (libshares/libshares-util.c: tsp_check_perms)
 
-MILESTONE 0.20
-=======================================================================
+  * Review que pasa cuando una carpeta es borrada.
 
-  * Review/update if necesary: libshares/shares.[ch]. And port changes.
+  * Review multi usuario. Crear una carpeta compartida. Crear otro usuario,
+  probar todo eso.
+  
+  * Checkeo de owner_only (?).
+  
+  * Y errores mejor en tab_page. Sobretodo porque va mostrar siempre ese
+  mensaje cuando no se pueda compartir.
+  
+  * Revisar dialogo modal de shares admin

Modified: thunar-shares-plugin/trunk/libshares/shares.c
===================================================================
--- thunar-shares-plugin/trunk/libshares/shares.c	2009-02-02 10:20:04 UTC (rev 6631)
+++ thunar-shares-plugin/trunk/libshares/shares.c	2009-02-02 19:39:39 UTC (rev 6632)
@@ -506,8 +506,6 @@
 	if (refresh_timestamp_update_counter == 0) {
 		time_t new_timestamp;
 
-		refresh_timestamp_update_counter = NUM_CALLS_BETWEEN_TIMESTAMP_UPDATES;
-
 		new_timestamp = time (NULL);
 		if (new_timestamp - refresh_timestamp > TIMESTAMP_THRESHOLD) {
 #ifdef G_ENABLE_DEBUG
@@ -517,7 +515,12 @@
 		} else
 			retval = TRUE;
 
-		refresh_timestamp = new_timestamp;
+		if (retval)
+		{
+			refresh_timestamp = new_timestamp;
+			
+			refresh_timestamp_update_counter = NUM_CALLS_BETWEEN_TIMESTAMP_UPDATES;
+		}
 	} else {
 		refresh_timestamp_update_counter--;
 		retval = TRUE;

Modified: thunar-shares-plugin/trunk/po/thunar-shares-plugin.pot
===================================================================
--- thunar-shares-plugin/trunk/po/thunar-shares-plugin.pot	2009-02-02 10:20:04 UTC (rev 6631)
+++ thunar-shares-plugin/trunk/po/thunar-shares-plugin.pot	2009-02-02 19:39:39 UTC (rev 6632)
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-07-22 20:50-0300\n"
+"POT-Creation-Date: 2009-02-02 16:52-0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
@@ -16,155 +16,174 @@
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: ../libshares/libshares-util.c:111
+#: ../libshares/libshares-util.c:163
 msgid "Please, write a name."
 msgstr ""
 
-#: ../libshares/libshares-util.c:162 ../data/dialogs.xml.h:1
-#: ../data/thunar-page.xml.h:4
+#. Warn the user
+#: ../libshares/libshares-util.c:171
+msgid ""
+"Share name too long. Some old clients may have problems to access it, "
+"continue anyway?"
+msgstr ""
+
+#: ../libshares/libshares-util.c:184
+#, c-format
+msgid "Error while getting share information: %s"
+msgstr ""
+
+#: ../libshares/libshares-util.c:194
+msgid "Another share has the same name"
+msgstr ""
+
+#: ../libshares/libshares-util.c:254
 msgid "Cannot modify the share:"
 msgstr ""
 
-#: ../libshares/libshares-util.c:232
+#: ../libshares/libshares-util.c:349
+msgid ""
+"Thunar needs to add some permissions to your folder in order to share it. Do "
+"you agree?"
+msgstr ""
+
+#: ../libshares/libshares-util.c:390
 msgid "Error when changing folder permissions."
 msgstr ""
 
-#: ../libshares/shares.c:146
+#: ../libshares/shares.c:153
 #, c-format
 msgid "%s %s %s returned with signal %d"
 msgstr ""
 
-#: ../libshares/shares.c:155
+#: ../libshares/shares.c:162
 #, c-format
 msgid "%s %s %s failed for an unknown reason"
 msgstr ""
 
-#: ../libshares/shares.c:175
+#: ../libshares/shares.c:183
 #, c-format
 msgid "'net usershare' returned error %d: %s"
 msgstr ""
 
-#: ../libshares/shares.c:177
+#: ../libshares/shares.c:185
 #, c-format
 msgid "'net usershare' returned error %d"
 msgstr ""
 
-#: ../libshares/shares.c:208
+#: ../libshares/shares.c:219
 #, c-format
 msgid "the output of 'net usershare' is not in valid UTF-8 encoding"
 msgstr ""
 
-#: ../libshares/shares.c:463 ../libshares/shares.c:636
+#: ../libshares/shares.c:478 ../libshares/shares.c:658
 #, c-format
 msgid "Failed"
 msgstr ""
 
-#: ../libshares/shares.c:571
+#: ../libshares/shares.c:593
 #, c-format
 msgid "Samba's testparm returned with signal %d"
 msgstr ""
 
-#: ../libshares/shares.c:577
+#: ../libshares/shares.c:599
 #, c-format
 msgid "Samba's testparm failed for an unknown reason"
 msgstr ""
 
-#: ../libshares/shares.c:592
+#: ../libshares/shares.c:614
 #, c-format
 msgid "Samba's testparm returned error %d: %s"
 msgstr ""
 
-#: ../libshares/shares.c:594
+#: ../libshares/shares.c:616
 #, c-format
 msgid "Samba's testparm returned error %d"
 msgstr ""
 
-#: ../libshares/shares.c:701
+#: ../libshares/shares.c:729
 #, c-format
 msgid "Cannot remove the share for path %s: that path is not shared"
 msgstr ""
 
-#: ../libshares/shares.c:747
+#: ../libshares/shares.c:782
 #, c-format
 msgid ""
 "Cannot change the path of an existing share; please remove the old share "
 "first and add a new one"
 msgstr ""
 
-#: ../thunar-plugin/tsp-admin-editor.c:174
-msgid "Thunar - Add a share"
+#. Dialog setup
+#: ../thunar-plugin/tsp-admin.c:111
+msgid "Thunar - Manage Shared Folders"
 msgstr ""
 
-#: ../thunar-plugin/tsp-admin-editor.c:196
-msgid "Thunar - Edit share"
+#: ../thunar-plugin/tsp-admin.c:341 ../thunar-plugin/tsp-page.c:397
+msgid ""
+"You may need to install Samba, check your user permissions(usershares group) "
+"and re-login.\n"
+"<b>More info:</b> <u>http://thunar-shares.googlecode.com/</u>"
 msgstr ""
 
-#: ../thunar-plugin/tsp-page.c:229
-msgid "Share"
+#. Dialog setup
+#: ../thunar-plugin/tsp-admin-editor.c:95
+msgid "Thunar - Add a share"
 msgstr ""
 
-#: ../thunar-plugin/tsp-prefs-provider.c:99
-msgid "Manage shared folders..."
+#. Folder chooser
+#: ../thunar-plugin/tsp-admin-editor.c:112
+msgid "Folder:"
 msgstr ""
 
-#: ../thunar-plugin/tsp-prefs-provider.c:100
-msgid "Add, edit and remove shared folders"
+#. Name
+#: ../thunar-plugin/tsp-admin-editor.c:121
+msgid "Share name:"
 msgstr ""
 
-#: ../data/admin-dialog-editor.xml.h:1
-msgid "<b>Comments:</b>"
+#. Write access
+#: ../thunar-plugin/tsp-admin-editor.c:130 ../thunar-plugin/tsp-page.c:184
+msgid "Allow others users to write in this folder"
 msgstr ""
 
-#: ../data/admin-dialog-editor.xml.h:2
-msgid "<b>Folder:</b>"
-msgstr ""
-
-#: ../data/admin-dialog-editor.xml.h:3
-msgid "<b>Share name:</b>"
-msgstr ""
-
-#: ../data/admin-dialog-editor.xml.h:4 ../data/thunar-page.xml.h:2
+#. Guests access
+#. Guest access
+#: ../thunar-plugin/tsp-admin-editor.c:134 ../thunar-plugin/tsp-page.c:189
 msgid "Allow Guest access"
 msgstr ""
 
-#: ../data/admin-dialog-editor.xml.h:5
-msgid "Allow other users to write in this folder"
+#. Comments
+#: ../thunar-plugin/tsp-admin-editor.c:138 ../thunar-plugin/tsp-page.c:197
+msgid "Comments:"
 msgstr ""
 
-#: ../data/admin-dialog.xml.h:1
-msgid "Thunar - Manage Shared Folders"
+#: ../thunar-plugin/tsp-admin-editor.c:243
+msgid "Thunar - Edit share"
 msgstr ""
 
-#: ../data/dialogs.xml.h:2 ../data/thunar-page.xml.h:8
-msgid "Thunar Shares Error"
+#: ../thunar-plugin/tsp-admin-editor.c:251
+msgid "There was an error while getting the sharing information"
 msgstr ""
 
-#: ../data/dialogs.xml.h:3 ../data/thunar-page.xml.h:9
-msgid "Thunar Shares Question"
+#: ../thunar-plugin/tsp-page.c:156
+msgid "<b>Folder Sharing</b>"
 msgstr ""
 
-#: ../data/dialogs.xml.h:4 ../data/thunar-page.xml.h:10
-msgid ""
-"Thunar needs to add some permissions to your folder in order to share it. Do "
-"you agree?"
+#. Share check button
+#: ../thunar-plugin/tsp-page.c:166
+msgid "Share this folder"
 msgstr ""
 
-#: ../data/thunar-page.xml.h:1
-msgid "<b>Folder Sharing</b>"
+#: ../thunar-plugin/tsp-page.c:174
+msgid "Share Name:"
 msgstr ""
 
-#: ../data/thunar-page.xml.h:3
-msgid "Allow others users to write in this folder"
+#: ../thunar-plugin/tsp-page.c:299
+msgid "Share"
 msgstr ""
 
-#: ../data/thunar-page.xml.h:5
-msgid "Comments:"
+#: ../thunar-plugin/tsp-provider.c:129
+msgid "Manage shared folders..."
 msgstr ""
 
-#: ../data/thunar-page.xml.h:6
-msgid "Share Name:"
+#: ../thunar-plugin/tsp-provider.c:130
+msgid "Add, edit and remove shared folders"
 msgstr ""
-
-#: ../data/thunar-page.xml.h:7
-msgid "Share this folder"
-msgstr ""

Modified: thunar-shares-plugin/trunk/thunar-plugin/tsp-admin-editor.c
===================================================================
--- thunar-shares-plugin/trunk/thunar-plugin/tsp-admin-editor.c	2009-02-02 10:20:04 UTC (rev 6631)
+++ thunar-shares-plugin/trunk/thunar-plugin/tsp-admin-editor.c	2009-02-02 19:39:39 UTC (rev 6632)
@@ -248,7 +248,7 @@
   /* Check error */
   if (!result)
   {
-    libshares_show_error (_("There was an error while listing shares"), error->message);
+    libshares_show_error (_("There was an error while getting the sharing information"), error->message);
     g_error_free (error);
   }
 

Modified: thunar-shares-plugin/trunk/thunar-plugin/tsp-admin.c
===================================================================
--- thunar-shares-plugin/trunk/thunar-plugin/tsp-admin.c	2009-02-02 10:20:04 UTC (rev 6631)
+++ thunar-shares-plugin/trunk/thunar-plugin/tsp-admin.c	2009-02-02 19:39:39 UTC (rev 6632)
@@ -71,8 +71,11 @@
   GtkDialog   __parent__;
   
   GtkWidget  *share_list;
+  GtkWidget  *share_add;
   GtkWidget  *share_edit;
   GtkWidget  *share_remove;
+
+  GtkWidget  *label_status;
 };
 
 THUNARX_DEFINE_TYPE (TspAdminManager, tsp_admin_manager, GTK_TYPE_DIALOG);
@@ -162,9 +165,9 @@
   gtk_button_box_set_layout (GTK_BUTTON_BOX (buttonbox), GTK_BUTTONBOX_START);
   gtk_box_pack_start (GTK_BOX (hbox), buttonbox, FALSE, FALSE, 0);
   
-  widget = gtk_button_new_from_stock (GTK_STOCK_ADD);
-  g_signal_connect (G_OBJECT (widget), "clicked", G_CALLBACK (tsp_admin_manager_add_cb), manager);
-  gtk_container_add (GTK_CONTAINER (buttonbox), widget);
+  manager->share_add = gtk_button_new_from_stock (GTK_STOCK_ADD);
+  g_signal_connect (G_OBJECT (manager->share_add), "clicked", G_CALLBACK (tsp_admin_manager_add_cb), manager);
+  gtk_container_add (GTK_CONTAINER (buttonbox), manager->share_add);
   
   manager->share_edit = gtk_button_new_from_stock (GTK_STOCK_EDIT);
   g_signal_connect (G_OBJECT (manager->share_edit), "clicked", G_CALLBACK (tsp_admin_manager_edit_cb), manager);
@@ -173,7 +176,15 @@
   manager->share_remove = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
   g_signal_connect (G_OBJECT (manager->share_remove), "clicked", G_CALLBACK (tsp_admin_manager_remove_cb), manager);
   gtk_container_add (GTK_CONTAINER (buttonbox), manager->share_remove);
-  
+
+  /* Status label */
+  manager->label_status = gtk_label_new (NULL);
+  gtk_label_set_use_markup (GTK_LABEL (manager->label_status), TRUE);
+  gtk_label_set_line_wrap (GTK_LABEL (manager->label_status), TRUE);
+  gtk_misc_set_alignment (GTK_MISC (manager->label_status ), 0.0f, 0.50f);
+  gtk_misc_set_padding (GTK_MISC (manager->label_status), 5, 0);
+  gtk_box_pack_start (GTK_BOX (vbox), manager->label_status, FALSE, FALSE, 5);
+
   /* Disable edit and remove buttons */
   gtk_widget_set_sensitive (manager->share_edit, FALSE);
   gtk_widget_set_sensitive (manager->share_remove, FALSE);
@@ -181,6 +192,9 @@
   /* Let's show all ;) */
   gtk_widget_show_all (vbox);
 
+  /* Hide status label */
+  gtk_widget_hide (manager->label_status);
+
   /* Load shares */
   tsp_admin_manager_reload_shares (manager);
 }
@@ -323,7 +337,20 @@
   /* Check error */
   if (!result)
   {
-    libshares_show_error (_("There was an error while listing shares"), error->message);
+    gchar *errormsg = g_strdup_printf ("<span color='red'>%s</span>",
+                                     _("You may need to install Samba, check your "
+                                       "user permissions(usershares group) and re-login."
+                                       "\n<b>More info:</b> <u>http://thunar-shares.googlecode.com/</u>"));
+
+    gtk_label_set_markup (GTK_LABEL (manager->label_status), errormsg);
+    gtk_widget_show (manager->label_status);
+
+    gtk_widget_set_sensitive (manager->share_add, FALSE);
+    gtk_widget_set_sensitive (manager->share_edit, FALSE);
+    gtk_widget_set_sensitive (manager->share_remove, FALSE);
+    gtk_widget_set_sensitive (manager->share_list, FALSE);
+
+    g_free (errormsg);
     g_error_free (error);
   }
 

Modified: thunar-shares-plugin/trunk/thunar-plugin/tsp-page.c
===================================================================
--- thunar-shares-plugin/trunk/thunar-plugin/tsp-page.c	2009-02-02 10:20:04 UTC (rev 6631)
+++ thunar-shares-plugin/trunk/thunar-plugin/tsp-page.c	2009-02-02 19:39:39 UTC (rev 6632)
@@ -68,6 +68,8 @@
                                     TspPage         *tsp_page);
 static void tsp_page_sensibility   (TspPage         *tsp_page,
                                     gboolean         sens);
+static void tsp_page_set_error     (TspPage         *tsp_page,
+                                    const char      *msg);
 
 static gboolean tsp_check_changes  (TspPage         *page);
 
@@ -214,6 +216,7 @@
   /* Status label */
   page->label_status = gtk_label_new (NULL);
   gtk_label_set_use_markup (GTK_LABEL (page->label_status), TRUE);
+  gtk_label_set_line_wrap (GTK_LABEL (page->label_status), TRUE);
   gtk_misc_set_alignment (GTK_MISC (page->label_status ), 0.0f, 0.50f);
   gtk_misc_set_padding (GTK_MISC (page->label_status), 5, 0);
   gtk_box_pack_start (GTK_BOX (vbox1), page->label_status, FALSE, FALSE, 5);
@@ -384,11 +387,20 @@
 
   result = shares_get_share_info_for_path (file_local, &share_info, &error);
 
+  /* Free some memory */
+  g_free (uri);
+  g_free (file_local);
+
   /* Check error */
   if (!result)
   {
-    libshares_show_error (_("There was an error while getting the sharing information"), error->message);
+    tsp_page_set_error (tsp_page, _("You may need to install Samba, check your "
+                                  "user permissions(usershares group) and re-login."
+                                  "\n<b>More info:</b> <u>http://thunar-shares.googlecode.com/</u>"));
+ 
     g_error_free (error);
+    
+    return;
   }
 
   /* Check if shared */
@@ -408,9 +420,6 @@
     tsp_update_default (tsp_page, NULL);
     tsp_page_sensibility (tsp_page, FALSE);
   }
-
-  g_free (uri);
-  g_free (file_local);
 }
 
 /* Share name changed */
@@ -524,6 +533,20 @@
   g_free (local_file);
 }
 
+static void
+tsp_page_set_error (TspPage    *tsp_page,
+                    const char *msg)
+{
+  gchar *errormsg = g_strdup_printf ("<span color='red'>%s</span>", msg);
+
+  gtk_label_set_markup (GTK_LABEL (tsp_page->label_status), errormsg);
+  tsp_page_sensibility (tsp_page, FALSE);
+  tsp_update_default (tsp_page, NULL);
+  gtk_widget_set_sensitive (tsp_page->cb_share_folder, FALSE);
+  g_free (errormsg);
+}
+
+
 /* Disable ore enable widgets when 'share folder' is toggled */
 static void
 tsp_page_sensibility (TspPage  *tsp_page,




More information about the Goodies-commits mailing list