summaryrefslogtreecommitdiff
path: root/nautilus-installer
diff options
context:
space:
mode:
authorRobey Pointer <robey@src.gnome.org>2000-11-22 06:36:03 +0000
committerRobey Pointer <robey@src.gnome.org>2000-11-22 06:36:03 +0000
commit710e92609e2f8b36a166f9e15f21de1d5c4d1e10 (patch)
tree553362652579ba2c8c30bbe17efdd9135dd86288 /nautilus-installer
parente31b0b9276f9a09978752e27c0eb47a7c8d22b6c (diff)
downloadnautilus-710e92609e2f8b36a166f9e15f21de1d5c4d1e10.tar.gz
Add hack to let us ask for only the package names of items in the problem
* components/services/install/lib/eazel-install-problem.c: (eazel_install_problem_case_to_string), (eazel_install_problem_case_foreach_to_string), (eazel_install_problem_case_foreach_to_package_names), (eazel_install_problem_cases_to_package_names), (eazel_install_problem_find_dominant_problem_type): * components/services/install/lib/eazel-install-problem.h: Add hack to let us ask for only the package names of items in the problem list (and only those that need to be uninstalled). This lets us build up a special bullet list for the "update not found" installer panel. * nautilus-installer/src/callbacks.c: (begin_install), (prep_retry): * nautilus-installer/src/installer.c: (remove_problems_timer), (jump_to_retry_page), (toggle_button_lock), (toggle_button_toggled), (eazel_installer_set_default_texts): Fix up the "update not found" panel to match a reasonable UI, and fix some bugs that caused it to go straight into another (extremely confusing) panel that suggested you ignore "all problems" and then listed no problems. * nautilus-installer/src/Makefile.am: * nautilus-installer/src/support.c: * nautilus-installer/src/support.h: Remove the unused support.c from the Makefile, and mark the files as unused so that a more adventurous soul can cvs remove them soon.
Diffstat (limited to 'nautilus-installer')
-rw-r--r--nautilus-installer/src/Makefile.am1
-rw-r--r--nautilus-installer/src/callbacks.c17
-rw-r--r--nautilus-installer/src/installer.c122
-rw-r--r--nautilus-installer/src/support.c1
-rw-r--r--nautilus-installer/src/support.h1
5 files changed, 93 insertions, 49 deletions
diff --git a/nautilus-installer/src/Makefile.am b/nautilus-installer/src/Makefile.am
index fc256239d..3e9609b31 100644
--- a/nautilus-installer/src/Makefile.am
+++ b/nautilus-installer/src/Makefile.am
@@ -22,7 +22,6 @@ bin_PROGRAMS = eazel-installer
eazel_installer_SOURCES = \
main.c \
- support.c support.h \
callbacks.c callbacks.h \
proxy.c proxy.h \
installer.c installer.h
diff --git a/nautilus-installer/src/callbacks.c b/nautilus-installer/src/callbacks.c
index 6348fd015..a6a754b70 100644
--- a/nautilus-installer/src/callbacks.c
+++ b/nautilus-installer/src/callbacks.c
@@ -55,7 +55,7 @@ begin_install (EazelInstaller *installer)
druid = GNOME_DRUID (gtk_object_get_data (GTK_OBJECT (window), "druid"));
- gnome_druid_set_buttons_sensitive(druid,FALSE,FALSE,TRUE);
+ gnome_druid_set_buttons_sensitive(druid, FALSE, FALSE, TRUE);
/* First time ? If so, check which categories were marked */
if (installer->install_categories == NULL) {
@@ -89,13 +89,14 @@ begin_install (EazelInstaller *installer)
NULL);
eazel_installer_post_install (installer);
/* return TRUE; */
- } else
- if (installer->successful && installer->install_categories) {
- eazel_installer_do_install (installer, installer->install_categories, FALSE);
- eazel_installer_post_install (installer);
- }
+ } else {
+ if (installer->successful && installer->install_categories) {
+ eazel_installer_do_install (installer, installer->install_categories, FALSE);
+ eazel_installer_post_install (installer);
+ }
- gnome_druid_set_buttons_sensitive(druid, FALSE, TRUE, TRUE);
+ gnome_druid_set_buttons_sensitive(druid, FALSE, TRUE, TRUE);
+ }
/* FALSE means remove this source */
return FALSE;
@@ -142,5 +143,5 @@ prep_retry (GnomeDruidPage *gnomedruidpage,
GtkWidget *druid,
EazelInstaller *installer)
{
- gnome_druid_set_buttons_sensitive (GNOME_DRUID (druid), FALSE, TRUE, TRUE);
+ gnome_druid_set_buttons_sensitive (GNOME_DRUID (druid), FALSE, installer->uninstalling ? FALSE : TRUE, TRUE);
}
diff --git a/nautilus-installer/src/installer.c b/nautilus-installer/src/installer.c
index 661cc1259..227efc8f2 100644
--- a/nautilus-installer/src/installer.c
+++ b/nautilus-installer/src/installer.c
@@ -113,11 +113,6 @@ typedef struct {
"are items involved that might be important to you, we thought we'd\n" \
"check first.")
#define D_RETRY_TITLE _("Just so you know...")
-#define D_EVIL_RETRY_LABEL _("A serious problem has been encountered, but we think we can\n" \
- "fix it. We would like to try the following actions, but since it might\n" \
- "have undesireable side effects, you might want to skip to an install\n" \
- "where file conflicts are ignored. If not, just press next...")
-#define D_EVIL_RETRY_TITLE _("Serious problem encountered....")
#define D_SPLASH_TITLE _("Welcome to the Eazel Installer!")
#define D_FINISHED_TITLE _("Congratulations!")
@@ -144,6 +139,15 @@ typedef struct {
#define D_ERROR_RED_HAT_7_NOT_SUPPORTED _("Sorry, but this preview installer won't work for Red Hat\n" \
"Linux 7.x systems.")
+#define D_EVIL_RETRY_TITLE _("Update not found")
+#define D_EVIL_RETRY_LABEL _("There doesn't appear to be a new version of any of the following\n" \
+ "packages. Your current versions may still work, but if you would\n" \
+ "like us to remove these packages for you, we can.")
+#define D_EVIL_RETRY_LABEL_S _("There doesn't appear to be a new version of this package. Your\n" \
+ "current version may still work, but if you like us to remove this\n" \
+ "package for you, we can.")
+
+
#define NAUTILUS_INSTALLER_RELEASE
enum {
@@ -165,6 +169,7 @@ enum {
WHAT_TO_INSTALL_LABEL_SINGLE,
RETRY_LABEL,
EVIL_RETRY_LABEL,
+ EVIL_RETRY_LABEL_S,
ERROR_TITLE,
RETRY_TITLE,
@@ -745,6 +750,13 @@ skip_over_remove_problems (GtkWidget *widget,
jump_to_retry_page (installer);
}
+static gboolean
+remove_problems_timer (EazelInstaller *installer)
+{
+ skip_over_remove_problems (NULL, installer);
+ return FALSE;
+}
+
/* give the user an opportunity to retry the install, with new info */
static void
jump_to_retry_page (EazelInstaller *installer)
@@ -759,6 +771,7 @@ jump_to_retry_page (EazelInstaller *installer)
GList *iter;
GList *problems_as_strings;
EazelInstallProblemEnum p;
+ int problem_count;
g_message ("jump_to_retry_page");
@@ -778,17 +791,14 @@ jump_to_retry_page (EazelInstaller *installer)
gtk_widget_show (vbox);
nautilus_druid_page_eazel_put_widget (NAUTILUS_DRUID_PAGE_EAZEL (retry_page), vbox);
- switch (p) {
- case EI_PROBLEM_REMOVE:
- case EI_PROBLEM_FORCE_REMOVE:
- case EI_PROBLEM_CASCADE_REMOVE:
+ if ((p == EI_PROBLEM_REMOVE) ||
+ (p == EI_PROBLEM_FORCE_REMOVE) ||
+ (p == EI_PROBLEM_CASCADE_REMOVE)) {
title = gtk_label_new_with_font (text_labels [EVIL_RETRY_TITLE], FONT_TITLE);
installer->uninstalling = TRUE;
- break;
- default:
+ } else {
title = gtk_label_new_with_font (text_labels [RETRY_TITLE], FONT_TITLE);
installer->uninstalling = FALSE;
- break;
}
gtk_label_set_justify (GTK_LABEL (title), GTK_JUSTIFY_LEFT);
@@ -803,15 +813,20 @@ jump_to_retry_page (EazelInstaller *installer)
add_padding_to_box (vbox, 0, 20);
- switch (p) {
- case EI_PROBLEM_REMOVE:
- case EI_PROBLEM_FORCE_REMOVE:
- case EI_PROBLEM_CASCADE_REMOVE:
- label = gtk_label_new (text_labels [EVIL_RETRY_LABEL]);
- break;
- default:
+ if (installer->uninstalling) {
+ problems_as_strings = eazel_install_problem_cases_to_package_names (installer->problem,
+ installer->problems);
+ problem_count = g_list_length (problems_as_strings);
+ if (problem_count == 1) {
+ label = gtk_label_new (text_labels [EVIL_RETRY_LABEL_S]);
+ } else {
+ label = gtk_label_new (text_labels [EVIL_RETRY_LABEL]);
+ }
+ } else {
+ problems_as_strings = eazel_install_problem_cases_to_string (installer->problem,
+ installer->problems);
+ problem_count = g_list_length (problems_as_strings);
label = gtk_label_new (text_labels [RETRY_LABEL]);
- break;
}
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
@@ -824,8 +839,6 @@ jump_to_retry_page (EazelInstaller *installer)
add_padding_to_box (vbox, 0, 15);
- problems_as_strings = eazel_install_problem_cases_to_string (installer->problem,
- installer->problems);
for (iter = problems_as_strings; iter != NULL; iter = g_list_next (iter)) {
add_bullet_point_to_vbox (vbox, (char*)(iter->data));
g_free (iter->data);
@@ -861,44 +874,72 @@ jump_to_retry_page (EazelInstaller *installer)
add_padding_to_box (vbox, 0, 15);
- switch (p) {
- case EI_PROBLEM_REMOVE:
- case EI_PROBLEM_FORCE_REMOVE:
- case EI_PROBLEM_CASCADE_REMOVE:
+ if (installer->uninstalling) {
g_message ("ranglebær");
hbox = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox);
- button = gtk_button_new_with_label ("Ignore file conflicts");
- gtk_widget_set_name (button, "ignore_conflicts_button");
+ label = gtk_label_new ("");
+ gtk_widget_show (label);
+ gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
+
+ if (problem_count == 1) {
+ button = gtk_button_new_with_label (_("Remove this package"));
+ } else {
+ button = gtk_button_new_with_label (_("Remove these packages"));
+ }
+ gtk_widget_set_name (button, "remove_button");
+ gtk_signal_connect (GTK_OBJECT (button), "clicked",
+ GTK_SIGNAL_FUNC (start_over_callback),
+ installer);
+ gtk_widget_show (button);
+ gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
+
+ add_padding_to_box (hbox, 10, 0);
+
+ if (problem_count == 1) {
+ button = gtk_button_new_with_label (_("Keep this package"));
+ } else {
+ button = gtk_button_new_with_label (_("Keep these packages"));
+ }
+ gtk_widget_set_name (button, "ignore_button");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (skip_over_remove_problems),
installer);
gtk_widget_show (button);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
+ add_padding_to_box (hbox, 90, 0);
+
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
- break;
- default:
- break;
- }
+ }
gtk_signal_connect (GTK_OBJECT (retry_page), "prepare",
GTK_SIGNAL_FUNC (prep_retry),
installer);
- gtk_signal_connect (GTK_OBJECT (retry_page), "next",
- GTK_SIGNAL_FUNC (start_over_callback),
- installer);
+ if (! installer->uninstalling) {
+ gtk_signal_connect (GTK_OBJECT (retry_page), "next",
+ GTK_SIGNAL_FUNC (start_over_callback),
+ installer);
+ }
gtk_signal_connect (GTK_OBJECT (retry_page), "cancel",
GTK_SIGNAL_FUNC (dont_start_over_callback),
installer);
gnome_druid_set_page (installer->druid, GNOME_DRUID_PAGE (retry_page));
- /* user may want to not be bothered */
- if (installer_dont_ask_questions) {
+ /* user may want to not be bothered --
+ * or, we may have just asked them a question and they answered that they wanted to ignore, so we should
+ * respect their wishes. UTTER HACK! i will kill this madness in the new xml scheme.
+ */
+ if (installer_dont_ask_questions || (problem_count == 1 && p == EI_PROBLEM_CONTINUE_WITH_FORCE)) {
log_debug ("skipping the question page; moving to the next round");
- gtk_timeout_add (0, (GtkFunction)start_over_timer, installer);
+ if (installer->uninstalling) {
+ /* assume they want to ignore conflicts */
+ gtk_timeout_add (0, (GtkFunction)remove_problems_timer, installer);
+ } else {
+ gtk_timeout_add (0, (GtkFunction)start_over_timer, installer);
+ }
}
}
@@ -1432,7 +1473,7 @@ toggle_button_lock (EazelInstaller *installer, char *name, gboolean lock)
GtkWidget *label;
char *temp;
- button = lookup_widget (installer->window, name);
+ button = gtk_object_get_data (GTK_OBJECT (installer->window), name);
temp = g_strdup_printf ("%s/label", gtk_widget_get_name (GTK_WIDGET (button)));
label = gtk_object_get_data (GTK_OBJECT (installer->window), name);
g_free (temp);
@@ -1473,7 +1514,7 @@ toggle_button_toggled (GtkToggleButton *button,
if (category->exclusive && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) {
for (iterator = installer->categories; iterator; iterator = iterator->next) {
category2 = (CategoryData *)(iterator->data);
- other_button = lookup_widget (installer->window, category2->name);
+ other_button = gtk_object_get_data (GTK_OBJECT (installer->window), category2->name);
if (other_button && (category != category2)) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (other_button), FALSE);
}
@@ -1918,6 +1959,7 @@ eazel_installer_set_default_texts (EazelInstaller *installer)
text_labels [WHAT_TO_INSTALL_LABEL_SINGLE] = g_strdup (D_WHAT_TO_INSTALL_LABEL_SINGLE);
text_labels [RETRY_LABEL] = g_strdup (D_RETRY_LABEL);
text_labels [EVIL_RETRY_LABEL] = g_strdup (D_EVIL_RETRY_LABEL);
+ text_labels [EVIL_RETRY_LABEL_S] = g_strdup (D_EVIL_RETRY_LABEL_S);
text_labels [INFO_EAZEL_HACKING_TEXT] = g_strdup (D_INFO_EAZEL_HACKING_TEXT);
text_labels [INFO_EAZEL_HACKING_TITLE] = g_strdup (D_INFO_EAZEL_HACKING_TITLE);
}
diff --git a/nautilus-installer/src/support.c b/nautilus-installer/src/support.c
index fcf404ae1..ee7d2a951 100644
--- a/nautilus-installer/src/support.c
+++ b/nautilus-installer/src/support.c
@@ -1,5 +1,6 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
+ * NOTHING USES THIS FILE ANYMORE.
*/
#ifdef HAVE_CONFIG_H
diff --git a/nautilus-installer/src/support.h b/nautilus-installer/src/support.h
index 34652b068..16d7b6765 100644
--- a/nautilus-installer/src/support.h
+++ b/nautilus-installer/src/support.h
@@ -1,5 +1,6 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
+ * NOTHING USES THIS FILE ANYMORE.
*/
#include <gnome.h>