Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=gfpm.git;a=commitdiff;h=23d14e268d5c13f4f18c28a018ec320f5f636fab

commit 23d14e268d5c13f4f18c28a018ec320f5f636fab
Author: Priyank <priy...@frugalware.org>
Date:   Sun Mar 8 15:56:11 2009 +0530

gfpm-prefs: Disable MaxTries if user sets it to 0

diff --git a/data/gfpm.glade b/data/gfpm.glade
index 797b1d3..707f304 100644
--- a/data/gfpm.glade
+++ b/data/gfpm.glade
@@ -2771,6 +2771,35 @@
<placeholder/>
</child>
<child>
+                              <widget class="GtkLabel" id="label44">
+                                <property name="visible">True</property>
+                                <property 
name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                                <property name="xalign">0</property>
+                                <property name="yalign">0</property>
+                                <property name="label" translatable="yes">Log 
File Path</property>
+                              </widget>
+                              <packing>
+                                <property name="top_attach">1</property>
+                                <property name="bottom_attach">2</property>
+                                <property name="x_options">GTK_FILL</property>
+                                <property name="y_options"></property>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkCheckButton" 
id="prefs_enable_log_tgl">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property 
name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                                <property name="label" 
translatable="yes">Enable Logging</property>
+                                <property name="response_id">0</property>
+                                <property name="draw_indicator">True</property>
+                              </widget>
+                              <packing>
+                                <property name="x_options">GTK_FILL</property>
+                                <property name="y_options">GTK_FILL</property>
+                              </packing>
+                            </child>
+                            <child>
<widget class="GtkHBox" id="hbox22">
<property name="visible">True</property>
<property name="spacing">4</property>
@@ -2822,35 +2851,6 @@
<property name="bottom_attach">2</property>
</packing>
</child>
-                            <child>
-                              <widget class="GtkCheckButton" 
id="prefs_enable_log_tgl">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property 
name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="label" 
translatable="yes">Enable Logging</property>
-                                <property name="response_id">0</property>
-                                <property name="draw_indicator">True</property>
-                              </widget>
-                              <packing>
-                                <property name="x_options">GTK_FILL</property>
-                                <property name="y_options">GTK_FILL</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <widget class="GtkLabel" id="label44">
-                                <property name="visible">True</property>
-                                <property 
name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="xalign">0</property>
-                                <property name="yalign">0</property>
-                                <property name="label" translatable="yes">Log 
File Path</property>
-                              </widget>
-                              <packing>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
-                                <property name="x_options">GTK_FILL</property>
-                                <property name="y_options"></property>
-                              </packing>
-                            </child>
</widget>
</child>
</widget>
@@ -2892,34 +2892,34 @@
<property name="column_spacing">10</property>
<property name="row_spacing">5</property>
<child>
-                              <widget class="GtkHBox" id="hbox25">
+                              <widget class="GtkHBox" id="hbox27">
<property name="visible">True</property>
<property name="spacing">4</property>
<child>
-                                  <widget class="GtkEntry" 
id="prefs_cache_dir_path">
+                                  <widget class="GtkEntry" id="prefs_db_path">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK 
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</widget>
</child>
<child>
-                                  <widget class="GtkButton" 
id="prefs_cache_edit_btn">
+                                  <widget class="GtkButton" 
id="prefs_database_edit_btn">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="response_id">0</property>
<child>
-                                      <widget class="GtkHBox" id="hbox26">
+                                      <widget class="GtkHBox" id="hbox28">
<property name="visible">True</property>
<child>
-                                          <widget class="GtkImage" 
id="image16">
+                                          <widget class="GtkImage" 
id="image17">
<property name="visible">True</property>
<property name="xpad">2</property>
<property name="stock">gtk-edit</property>
</widget>
</child>
<child>
-                                          <widget class="GtkLabel" 
id="label51">
+                                          <widget class="GtkLabel" 
id="label54">
<property name="visible">True</property>
<property name="label" translatable="yes">Change</property>
</widget>
@@ -2939,67 +2939,65 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
</packing>
</child>
<child>
-                              <widget class="GtkLabel" id="label50">
+                              <widget class="GtkLabel" id="label53">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK 
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
-                                <property name="label" 
translatable="yes">Package cache</property>
+                                <property name="label" 
translatable="yes">Database</property>
</widget>
<packing>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
-                              <widget class="GtkLabel" id="label53">
+                              <widget class="GtkLabel" id="label50">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK 
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
-                                <property name="label" 
translatable="yes">Database</property>
+                                <property name="label" 
translatable="yes">Package cache</property>
</widget>
<packing>
+                                <property name="top_attach">1</property>
+                                <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
-                              <widget class="GtkHBox" id="hbox27">
+                              <widget class="GtkHBox" id="hbox25">
<property name="visible">True</property>
<property name="spacing">4</property>
<child>
-                                  <widget class="GtkEntry" id="prefs_db_path">
+                                  <widget class="GtkEntry" 
id="prefs_cache_dir_path">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK 
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</widget>
</child>
<child>
-                                  <widget class="GtkButton" 
id="prefs_database_edit_btn">
+                                  <widget class="GtkButton" 
id="prefs_cache_edit_btn">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="response_id">0</property>
<child>
-                                      <widget class="GtkHBox" id="hbox28">
+                                      <widget class="GtkHBox" id="hbox26">
<property name="visible">True</property>
<child>
-                                          <widget class="GtkImage" 
id="image17">
+                                          <widget class="GtkImage" 
id="image16">
<property name="visible">True</property>
<property name="xpad">2</property>
<property name="stock">gtk-edit</property>
</widget>
</child>
<child>
-                                          <widget class="GtkLabel" 
id="label54">
+                                          <widget class="GtkLabel" 
id="label51">
<property name="visible">True</property>
<property name="label" translatable="yes">Change</property>
</widget>
@@ -3019,6 +3017,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
+                                <property name="top_attach">1</property>
+                                <property name="bottom_attach">2</property>
</packing>
</child>
</widget>
@@ -3063,17 +3063,50 @@
<property name="column_spacing">13</property>
<property name="row_spacing">10</property>
<child>
-                              <widget class="GtkHBox" id="hbox30">
+                              <widget class="GtkLabel" id="label56">
+                                <property name="visible">True</property>
+                                <property name="xalign">0</property>
+                                <property name="label" 
translatable="yes">&lt;b&gt;Old Delay&lt;/b&gt;
+Issue a warning when you try to install a package, but the local package 
database hasn't been updated for specified number of days.</property>
+                                <property name="use_markup">True</property>
+                                <property name="wrap">True</property>
+                                <property name="width_chars">60</property>
+                                <property name="max_width_chars">0</property>
+                              </widget>
+                              <packing>
+                                <property name="top_attach">1</property>
+                                <property name="bottom_attach">2</property>
+                                <property name="x_options">GTK_FILL</property>
+                                <property name="y_options">GTK_FILL</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkLabel" id="label58">
+                                <property name="visible">True</property>
+                                <property name="xalign">0</property>
+                                <property name="label" 
translatable="yes">&lt;b&gt;Upgrade Delay&lt;/b&gt;
+Upgrade only the packages that are specified number of days old while 
performing a system upgrade.</property>
+                                <property name="use_markup">True</property>
+                                <property name="wrap">True</property>
+                                <property name="width_chars">60</property>
+                              </widget>
+                              <packing>
+                                <property name="x_options">GTK_FILL</property>
+                                <property name="y_options">GTK_FILL</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkHBox" id="hbox29">
<property name="visible">True</property>
<child>
-                                  <widget class="GtkSpinButton" 
id="prefs_upg_delay_spin">
+                                  <widget class="GtkSpinButton" 
id="prefs_old_delay_spin">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">0 0 100 1 10 10</property>
</widget>
</child>
<child>
-                                  <widget class="GtkLabel" id="label60">
+                                  <widget class="GtkLabel" id="label59">
<property name="visible">True</property>
<property name="xalign">0.10000000149011612</property>
<property name="xpad">4</property>
@@ -3089,20 +3122,22 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
+                                <property name="top_attach">1</property>
+                                <property name="bottom_attach">2</property>
</packing>
</child>
<child>
-                              <widget class="GtkHBox" id="hbox29">
+                              <widget class="GtkHBox" id="hbox30">
<property name="visible">True</property>
<child>
-                                  <widget class="GtkSpinButton" 
id="prefs_old_delay_spin">
+                                  <widget class="GtkSpinButton" 
id="prefs_upg_delay_spin">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">0 0 100 1 10 10</property>
</widget>
</child>
<child>
-                                  <widget class="GtkLabel" id="label59">
+                                  <widget class="GtkLabel" id="label60">
<property name="visible">True</property>
<property name="xalign">0.10000000149011612</property>
<property name="xpad">4</property>
@@ -3118,41 +3153,6 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <widget class="GtkLabel" id="label58">
-                                <property name="visible">True</property>
-                                <property name="xalign">0</property>
-                                <property name="label" 
translatable="yes">&lt;b&gt;Upgrade Delay&lt;/b&gt;
-Upgrade only the packages that are specified number of days old while 
performing a system upgrade.</property>
-                                <property name="use_markup">True</property>
-                                <property name="wrap">True</property>
-                                <property name="width_chars">60</property>
-                              </widget>
-                              <packing>
-                                <property name="x_options">GTK_FILL</property>
-                                <property name="y_options">GTK_FILL</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <widget class="GtkLabel" id="label56">
-                                <property name="visible">True</property>
-                                <property name="xalign">0</property>
-                                <property name="label" 
translatable="yes">&lt;b&gt;Old Delay&lt;/b&gt;
-Issue a warning when you try to install a package, but the local package 
database hasn't been updated for specified number of days.</property>
-                                <property name="use_markup">True</property>
-                                <property name="wrap">True</property>
-                                <property name="width_chars">60</property>
-                                <property name="max_width_chars">0</property>
-                              </widget>
-                              <packing>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
-                                <property name="x_options">GTK_FILL</property>
-                                <property name="y_options">GTK_FILL</property>
</packing>
</child>
</widget>
@@ -3435,13 +3435,17 @@ Issue a warning when you try to install a package, but 
the local package databas
<placeholder/>
</child>
<child>
-                              <widget class="GtkCheckButton" 
id="prefs_pasvftp_check">
+                              <widget class="GtkLabel" id="fiiia">
<property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="label" 
translatable="yes">Disable passive FTP connections</property>
-                                <property name="response_id">0</property>
-                                <property name="draw_indicator">True</property>
+                                <property name="xalign">0</property>
+                                <property name="label" 
translatable="yes">Maximum retries (in case of failure) (0 = 
disabled)</property>
</widget>
+                              <packing>
+                                <property name="top_attach">1</property>
+                                <property name="bottom_attach">2</property>
+                                <property name="x_options">GTK_FILL</property>
+                                <property name="y_options">GTK_FILL</property>
+                              </packing>
</child>
<child>
<widget class="GtkSpinButton" id="prefs_max_retries">
@@ -3459,17 +3463,13 @@ Issue a warning when you try to install a package, but 
the local package databas
</packing>
</child>
<child>
-                              <widget class="GtkLabel" id="fiiia">
+                              <widget class="GtkCheckButton" 
id="prefs_pasvftp_check">
<property name="visible">True</property>
-                                <property name="xalign">0</property>
-                                <property name="label" 
translatable="yes">Maximum retries (in case of failure)</property>
+                                <property name="can_focus">True</property>
+                                <property name="label" 
translatable="yes">Disable passive FTP connections</property>
+                                <property name="response_id">0</property>
+                                <property name="draw_indicator">True</property>
</widget>
-                              <packing>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
-                                <property name="x_options">GTK_FILL</property>
-                                <property name="y_options">GTK_FILL</property>
-                              </packing>
</child>
</widget>
</child>
@@ -3515,13 +3515,16 @@ Issue a warning when you try to install a package, but 
the local package databas
<placeholder/>
</child>
<child>
-                              <widget class="GtkCheckButton" 
id="prefs_proxy_enable_chk">
+                              <widget class="GtkEntry" 
id="prefs_proxy_server_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
-                                <property name="label" translatable="yes">Use 
proxy server</property>
-                                <property name="response_id">0</property>
-                                <property name="draw_indicator">True</property>
</widget>
+                              <packing>
+                                <property name="left_attach">1</property>
+                                <property name="right_attach">2</property>
+                                <property name="top_attach">1</property>
+                                <property name="bottom_attach">2</property>
+                              </packing>
</child>
<child>
<widget class="GtkLabel" id="label55">
@@ -3537,16 +3540,13 @@ Issue a warning when you try to install a package, but 
the local package databas
</packing>
</child>
<child>
-                              <widget class="GtkEntry" 
id="prefs_proxy_server_entry">
+                              <widget class="GtkCheckButton" 
id="prefs_proxy_enable_chk">
<property name="visible">True</property>
<property name="can_focus">True</property>
+                                <property name="label" translatable="yes">Use 
proxy server</property>
+                                <property name="response_id">0</property>
+                                <property name="draw_indicator">True</property>
</widget>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="right_attach">2</property>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
-                              </packing>
</child>
</widget>
</child>
diff --git a/src/gfpm-prefs.c b/src/gfpm-prefs.c
index 19a7a21..da0f8ea 100644
--- a/src/gfpm-prefs.c
+++ b/src/gfpm-prefs.c
@@ -387,7 +387,7 @@ gfpm_prefs_write_config (void)
fprintf (tp, "ProxyServer = %s\n", gfpm_prefs_proxy_server);
continue;
}
-                       if (!has_maxtries)
+                       if (!has_maxtries && (gfpm_prefs_max_tries > 0))
{
fprintf (tp, "MaxTries = %d\n", gfpm_prefs_max_tries);
continue;
@@ -469,7 +469,10 @@ gfpm_prefs_write_config (void)
else
if (g_str_has_prefix(line,"MaxTries"))
{
-                       fprintf (tp, "MaxTries = %d\n", gfpm_prefs_max_tries);
+                       if (gfpm_prefs_max_tries > 0)
+                               fprintf (tp, "MaxTries = %d\n", 
gfpm_prefs_max_tries);
+                       else
+                               fprintf (tp, "");
continue;
}
else
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to