Greets,

I'm trying to force myself to use rpmdrake instead of urpmi but there is
one thing that annoys the snot out of me. Even though I only have one
media source defined, it still shows me a dialog window where I have to
check the only toggle box displayed in order to do the update. So I
wrote a quick patch that will make rpmdrake skip the dialog and head
straight to the updating when only one media source is defined.

Please consider for inclusion in rpmdrake. Thanks!

-- 

Steve Fox
http://k-lug.org
"When i think of the OpenBSD commiters, I picture the two old muppets
that 
sit in the theater and gripe at everyone" - mrx, on BlueNet
diff -ruN rpmdrake-1.4/media.c rpmdrake-1.4.mine/media.c
--- rpmdrake-1.4/media.c	Thu Mar  7 08:55:51 2002
+++ rpmdrake-1.4.mine/media.c	Fri Mar 22 16:43:44 2002
@@ -1594,28 +1594,36 @@
   media_struct       *medium;
   gint                ret_val;
 
-  dialog = gtk_mdk_dialog_new(GTK_DIALOG_OK_CANCEL,
-                              NONE_ICON,
-                              _("Sources to update"),
-                              _("Please choose the sources\nyou want to update:"));
-  gtk_mdk_dialog_set_parent(GTK_MDK_DIALOG(dialog), GTK_WINDOW(MainWindow));
-  gtk_box_pack_start_defaults(GTK_BOX(GTK_DIALOG(dialog)->vbox),
-                              gtk_hseparator_new());
-  for (tmp = all_medias ; tmp ; tmp = g_list_next(tmp) )
+  if (g_list_length(all_medias) == 1)
   {
-    medium = tmp->data;
-    medium->modified = 0;
-    check = gtk_check_button_new_with_label(medium->name);
-    gtk_box_pack_start_defaults(GTK_BOX(GTK_DIALOG(dialog)->vbox), check);
-
-    gtk_signal_connect(GTK_OBJECT(check), "toggled",
-                       (GtkSignalFunc)media_to_update_toggle,
-                       medium);
+	  /* medium->modified = TRUE; */
+	  ret_val = 0;
+  }
+  else
+  {
+    dialog = gtk_mdk_dialog_new(GTK_DIALOG_OK_CANCEL,
+                                NONE_ICON,
+                                _("Sources to update"),
+                                _("Please choose the sources\nyou want to update:"));
+    gtk_mdk_dialog_set_parent(GTK_MDK_DIALOG(dialog), GTK_WINDOW(MainWindow));
+    gtk_box_pack_start_defaults(GTK_BOX(GTK_DIALOG(dialog)->vbox),
+                                gtk_hseparator_new());
+    for (tmp = all_medias ; tmp ; tmp = g_list_next(tmp) )
+    {
+      medium = tmp->data;
+      medium->modified = 0;
+      check = gtk_check_button_new_with_label(medium->name);
+      gtk_box_pack_start_defaults(GTK_BOX(GTK_DIALOG(dialog)->vbox), check);
+  
+      gtk_signal_connect(GTK_OBJECT(check), "toggled",
+                         (GtkSignalFunc)media_to_update_toggle,
+                         medium);
+    }
+  
+    gtk_widget_show_all(dialog);
+  
+    ret_val = gtk_mdk_dialog_run(GTK_MDK_DIALOG(dialog));
   }
-
-  gtk_widget_show_all(dialog);
-
-  ret_val = gtk_mdk_dialog_run(GTK_MDK_DIALOG(dialog));
 
   if (ret_val == 0)
     return update_all_modified_media(MainWindow);

Reply via email to