[Gurlchecker-commits] r752 - in trunk: . src ui

esaracco at users.labs.libre-entreprise.org esaracco at users.labs.libre-entreprise.org
Wed Jan 27 08:35:14 CET 2010


Author: esaracco
Date: 2010-01-27 07:35:13 +0000 (Wed, 27 Jan 2010)
New Revision: 752

Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/src/application.c
   trunk/src/check.c
   trunk/src/project.c
   trunk/ui/gurlchecker.glade
Log:
        * GUI:

          - More coherent GUI for scan check options management.

        * URL parser:

          - Fixed a problem with chrooted scan.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-01-27 05:39:06 UTC (rev 751)
+++ trunk/ChangeLog	2010-01-27 07:35:13 UTC (rev 752)
@@ -1,3 +1,13 @@
+2010-01-27 Emmanuel Saracco <esaracco at users.labs.libre-entreprise.org>
+
+	* GUI:
+
+	  - More coherent GUI for scan check options management.
+
+	* URL parser:
+
+	  - Fixed a problem with chrooted scan.
+
 2010-01-26 Emmanuel Saracco <esaracco at users.labs.libre-entreprise.org>
 
 	* URL parser:

Modified: trunk/configure.in
===================================================================
--- trunk/configure.in	2010-01-27 05:39:06 UTC (rev 751)
+++ trunk/configure.in	2010-01-27 07:35:13 UTC (rev 752)
@@ -2,7 +2,7 @@
 AC_PREREQ(2.54)
 
 AC_INIT(configure.in)
-AM_INIT_AUTOMAKE(gurlchecker, 0.11.2svn2010012603)
+AM_INIT_AUTOMAKE(gurlchecker, 0.11.2svn2010012700)
 AM_CONFIG_HEADER(config.h)
 AC_CONFIG_MACRO_DIR([m4])
 

Modified: trunk/src/application.c
===================================================================
--- trunk/src/application.c	2010-01-27 05:39:06 UTC (rev 751)
+++ trunk/src/application.c	2010-01-27 07:35:13 UTC (rev 752)
@@ -2465,11 +2465,26 @@
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
 				uc_project_get_dump_properties ());
 
-  /* networking depth level */
+  // Networking depth level
   widget = WGET ("sd_url_depth_level");
   gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget),
 			     (gdouble) uc_project_get_depth_level ());
 
+  // Ignore URL args?
+  widget = WGET ("sd_no_urls_args");
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
+                                uc_project_get_no_urls_args ());
+
+  // Only check given directory and its subdirectories?
+  widget = WGET ("sd_check_chroot");
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
+                                uc_project_get_check_chroot ());
+
+  // Do not check external links?
+  widget = WGET ("sd_limit_local");
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
+                                uc_project_get_limit_local ());
+
   /* retrieve images content */
   widget = WGET ("sd_images_content");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
@@ -2567,45 +2582,41 @@
   /* E-Mail check */
   widget = WGET ("sd_check_email_address");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
-				(gboolean) uc_project_get_proto_mailto ());
+				uc_project_get_proto_mailto ());
 
   /* warn for cookies */
   widget = WGET ("sd_check_cookies_warn_added");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
-				(gboolean)
 				uc_project_get_cookies_warn_added ());
   widget = WGET ("sd_check_cookies_warn_updated");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
-				(gboolean)
 				uc_project_get_cookies_warn_updated ());
   widget = WGET ("sd_check_cookies_warn_deleted");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
-				(gboolean)
 				uc_project_get_cookies_warn_deleted ());
 
   /* E-Mail MX check */
   widget = WGET ("sd_check_email_mx");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
-				(gboolean)
 				uc_project_get_proto_mailto_check_mx ());
 
   gtk_widget_set_sensitive (GTK_WIDGET (widget),
-			    (gboolean) uc_project_get_proto_mailto ());
+			    uc_project_get_proto_mailto ());
 
   /* FTP check */
   widget = WGET ("sd_check_ftp_protocol");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
-				(gboolean) uc_project_get_proto_ftp ());
+				uc_project_get_proto_ftp ());
 
   widget = WGET ("sd_use_passive_ftp");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
-				(gboolean) uc_project_get_passive_ftp ());
+				uc_project_get_passive_ftp ());
 
   /* HTTPS check */
   widget = WGET ("sd_check_https_protocol");
 #ifdef ENABLE_GNUTLS
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
-				(gboolean) uc_project_get_proto_https ());
+				uc_project_get_proto_https ());
 #else
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
   WSENS ("sd_check_https_protocol", FALSE);
@@ -2740,11 +2751,26 @@
 				  gtk_toggle_button_get_active
 				  (GTK_TOGGLE_BUTTON (widget)));
 
-  /* networking depth level */
+  // Networking depth level
   widget = WGET ("sd_url_depth_level");
   uc_project_set_depth_level (gtk_spin_button_get_value_as_int
 			      (GTK_SPIN_BUTTON (widget)));
 
+  // Ignore URL args?
+  widget = WGET ("sd_no_urls_args");
+  uc_project_set_no_urls_args (
+    gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
+
+  // Only check given directory and its subdirectories?
+  widget = WGET ("sd_check_chroot");
+  uc_project_set_check_chroot (
+    gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
+
+  // Do not check external links?
+  widget = WGET ("sd_limit_local");
+  uc_project_set_limit_local (
+    gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
+
   /* retrieving images content */
   widget = WGET ("sd_images_content");
   uc_project_set_download_images_content ((guint)
@@ -3210,6 +3236,25 @@
 			(gnome_entry_gtk_entry (GNOME_ENTRY (widget))),
 			uc_project_get_url ());
 
+  // Do not retreive page content?
+  widget = WGET ("nwpd_speed_check");
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
+
+  // Ignore URL args?
+  widget = WGET ("nwpd_no_urls_args");
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
+                                uc_project_get_no_urls_args ());
+
+  // Only check given directory and its subdirectories?
+  widget = WGET ("nwpd_check_chroot");
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
+                                uc_project_get_check_chroot ());
+
+  // Do not check external links?
+  widget = WGET ("nwpd_limit_local");
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
+                                uc_project_get_limit_local ());
+
   gtk_widget_show_all (dialog);
 }
 
@@ -3529,9 +3574,8 @@
 
 		  /* ignore URLs arguments */
 		  widget = WGET ("nwpd_no_urls_args");
-		  uc_project_set_no_urls_args ((gboolean)
-					       gtk_toggle_button_get_active
-					       (GTK_TOGGLE_BUTTON (widget)));
+		  uc_project_set_no_urls_args (
+                    gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
 		}
 	      else
 		{
@@ -3590,10 +3634,7 @@
 
 	      uc_web_site_begin_check ();
 
-	      uc_project_set_no_urls_args (FALSE);
 	      uc_project_set_speed_check (FALSE);
-	      uc_project_set_check_chroot (FALSE);
-	      uc_project_set_limit_local (FALSE);
 
 	      /* restore original options for file protocol */
 	      if (uc_project_get_type () == UC_PROJECT_TYPE_LOCAL_FILE)

Modified: trunk/src/check.c
===================================================================
--- trunk/src/check.c	2010-01-27 05:39:06 UTC (rev 751)
+++ trunk/src/check.c	2010-01-27 07:35:13 UTC (rev 752)
@@ -2569,12 +2569,21 @@
   // If we chroot the check, initialize the directory to chroot in
   if (currentItem.is_first)
   {
+    gchar *dir = NULL;
+
+ 
     // Set project main hostname
     uc_project_set_current_host (prop->h_name);
 
     // Set main project chroot path
-    uc_project_set_chroot_path (
-      (uc_project_get_check_chroot ())? prop->path : NULL);
+    if (uc_project_get_check_chroot ())
+    {
+      dir = g_path_get_dirname (prop->path);
+      uc_project_set_chroot_path (dir);
+      g_free (dir), dir = NULL;
+    }
+    else
+      uc_project_set_chroot_path ("");
   }
 
   // If we are in chroot mode (just this directory and its subdirectories,

Modified: trunk/src/project.c
===================================================================
--- trunk/src/project.c	2010-01-27 05:39:06 UTC (rev 751)
+++ trunk/src/project.c	2010-01-27 07:35:13 UTC (rev 752)
@@ -1038,7 +1038,8 @@
   uc_project_xml_write_attribute (writer, "proto_ftp", NULL, 1, TRUE);
   uc_project_xml_write_attribute (writer, "passive_ftp", NULL, 1, TRUE);
   uc_project_xml_write_attribute (writer, "check_chroot", NULL, 0, TRUE);
-  uc_project_xml_write_attribute (writer, "limit_local", NULL, 0, TRUE);
+  uc_project_xml_write_attribute (writer, "limit_local", NULL, 1, TRUE);
+  uc_project_xml_write_attribute (writer, "no_urls_args", NULL, 1, TRUE);
   uc_project_xml_write_attribute (writer, "use_proxy", NULL,
 				  uc_project_get_use_proxy (), TRUE);
   uc_project_xml_write_attribute (writer, "proxy_host",
@@ -1200,6 +1201,8 @@
 				  uc_project_get_check_chroot (), TRUE);
   uc_project_xml_write_attribute (writer, "limit_local", NULL,
 				  uc_project_get_limit_local (), TRUE);
+  uc_project_xml_write_attribute (writer, "no_urls_args", NULL,
+				  uc_project_get_no_urls_args (), TRUE);
   uc_project_xml_write_attribute (writer, "use_proxy", NULL,
 				  uc_project_get_use_proxy (), TRUE);
   uc_project_xml_write_attribute (writer, "proxy_host",
@@ -3490,6 +3493,18 @@
 	      xmlFree (tmp), tmp = NULL;
 	    }
 
+	  if ((tmp = xmlGetProp (cur, BAD_CAST "no_urls_args")))
+	    {
+	      uc_project_set_no_urls_args (uc_utils_get_yesno ((gchar *) tmp));
+	      xmlFree (tmp), tmp = NULL;
+	    }
+
+	  if ((tmp = xmlGetProp (cur, BAD_CAST "speed_check")))
+	    {
+	      uc_project_set_speed_check (uc_utils_get_yesno ((gchar *) tmp));
+	      xmlFree (tmp), tmp = NULL;
+	    }
+
 	  if ((tmp = xmlGetProp (cur, BAD_CAST "use_proxy")))
 	    {
 	      uc_project_set_use_proxy (uc_utils_get_yesno ((gchar *) tmp));

Modified: trunk/ui/gurlchecker.glade
===================================================================
--- trunk/ui/gurlchecker.glade	2010-01-27 05:39:06 UTC (rev 751)
+++ trunk/ui/gurlchecker.glade	2010-01-27 07:35:13 UTC (rev 752)
@@ -62,6 +62,23 @@
               </packing>
             </child>
             <child>
+              <widget class="GtkCheckButton" id="nwpd_speed_check">
+                <property name="label" translatable="yes">Do not retrieve page content (speed up the check)</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="has_tooltip">True</property>
+                <property name="tooltip" translatable="yes">Flash option: check it to check only one page</property>
+                <property name="use_underline">True</property>
+                <property name="draw_indicator">True</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
               <widget class="GtkExpander" id="expander2">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
@@ -169,7 +186,7 @@
                 </child>
               </widget>
               <packing>
-                <property name="position">2</property>
+                <property name="position">3</property>
               </packing>
             </child>
             <child>
@@ -217,29 +234,12 @@
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkCheckButton" id="nwpd_speed_check">
-                            <property name="label" translatable="yes">Do not retrieve page content (speed up the check)</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="has_tooltip">True</property>
-                            <property name="tooltip" translatable="yes">Check this option to check only one page</property>
-                            <property name="use_underline">True</property>
-                            <property name="draw_indicator">True</property>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                        <child>
                           <widget class="GtkCheckButton" id="nwpd_check_chroot">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
                             <property name="has_tooltip">True</property>
-                            <property name="tooltip" translatable="yes">Uncheck this option to check external pages too</property>
+                            <property name="tooltip" translatable="yes">Check this option if you want to limit check to the given directory and its subdirectories on the given Web site</property>
                             <property name="draw_indicator">True</property>
                             <child>
                               <widget class="GtkAlignment" id="alignment9">
@@ -283,7 +283,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
-                            <property name="position">2</property>
+                            <property name="position">1</property>
                           </packing>
                         </child>
                         <child>
@@ -337,7 +337,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
-                            <property name="position">3</property>
+                            <property name="position">2</property>
                           </packing>
                         </child>
                       </widget>
@@ -358,7 +358,7 @@
                 </child>
               </widget>
               <packing>
-                <property name="position">3</property>
+                <property name="position">4</property>
               </packing>
             </child>
           </widget>
@@ -714,6 +714,131 @@
                         <property name="position">0</property>
                       </packing>
                     </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="sd_no_urls_args">
+                        <property name="label" translatable="yes">Ignore URLs arguments</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="tooltip" translatable="yes">Check this option to avoid some nasty infinite loops (when some arguments are randomly generated, for example)</property>
+                        <property name="use_underline">True</property>
+                        <property name="active">True</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="sd_check_chroot">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="tooltip" translatable="yes">Check this option if you want to limit check to the given directory and its subdirectories on the given Web site</property>
+                        <property name="draw_indicator">True</property>
+                        <child>
+                          <widget class="GtkAlignment" id="alignment9a">
+                            <property name="visible">True</property>
+                            <property name="xscale">0</property>
+                            <property name="yscale">0</property>
+                            <child>
+                              <widget class="GtkHBox" id="hbox12a">
+                                <property name="visible">True</property>
+                                <property name="spacing">2</property>
+                                <child>
+                                  <widget class="GtkImage" id="image303a">
+                                    <property name="visible">True</property>
+                                    <property name="stock">gtk-zoom-fit</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkLabel" id="label96a">
+                                    <property name="visible">True</property>
+                                    <property name="label" translatable="yes">Only check given directory and its subdirectories</property>
+                                    <property name="use_markup">True</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="wrap">True</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </widget>
+                            </child>
+                          </widget>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="sd_limit_local">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="tooltip" translatable="yes">Uncheck this option to check external links too</property>
+                        <property name="active">True</property>
+                        <property name="draw_indicator">True</property>
+                        <child>
+                          <widget class="GtkAlignment" id="alignment10a">
+                            <property name="visible">True</property>
+                            <property name="xscale">0</property>
+                            <property name="yscale">0</property>
+                            <child>
+                              <widget class="GtkHBox" id="hbox13a">
+                                <property name="visible">True</property>
+                                <property name="spacing">2</property>
+                                <child>
+                                  <widget class="GtkImage" id="image525a">
+                                    <property name="visible">True</property>
+                                    <property name="stock">gtk-zoom-fit</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkLabel" id="label100a">
+                                    <property name="visible">True</property>
+                                    <property name="label" translatable="yes">Only check local links</property>
+                                    <property name="use_markup">True</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="wrap">True</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </widget>
+                            </child>
+                          </widget>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">3</property>
+                      </packing>
+                    </child>
                   </widget>
                   <packing>
                     <property name="position">4</property>



More information about the Gurlchecker-commits mailing list