aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--gslapt.glade162
-rw-r--r--src/callbacks.c19
-rw-r--r--src/callbacks.h3
-rw-r--r--src/interface.c102
-rw-r--r--src/interface.h1
6 files changed, 289 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ca60c61..ee54207 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
-0.3.4 July 10, 2005
+0.3.4 July 17, 2005
+ * added dialog asking to update package cache when sources are modified
* updated pkg target to follow PKGDIR if set, or ./pkg/ by default
* use AC_CANONICAL_HOST for arch detection in configure.in
* disable unmark all menu option if nothing is currently marked
diff --git a/gslapt.glade b/gslapt.glade
index 07b80fc..926a16e 100644
--- a/gslapt.glade
+++ b/gslapt.glade
@@ -3882,4 +3882,166 @@ http://software.jaos.org/#gslapt&lt;/span&gt;</property>
</child>
</widget>
+<widget class="GtkDialog" id="repositories_changed">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Repositories changed</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="icon">gslapt.png</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="has_separator">True</property>
+
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox5">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area5">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+ <child>
+ <widget class="GtkButton" id="button5">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-no</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-9</property>
+ <signal name="clicked" handler="gtk_widget_destroy" object="repositories_changed" last_modification_time="Sun, 17 Jul 2005 23:31:44 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="button6">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-yes</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-8</property>
+ <signal name="clicked" handler="repositories_changed_callback" object="repositories_changed" last_modification_time="Sun, 17 Jul 2005 23:32:22 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox107">
+ <property name="border_width">2</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkImage" id="image982">
+ <property name="visible">True</property>
+ <property name="stock">gtk-dialog-info</property>
+ <property name="icon_size">6</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.20000000298</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">6</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox70">
+ <property name="border_width">6</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label274">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;span size=&quot;large&quot; weight=&quot;bold&quot;&gt;Repositories changed&lt;/span&gt;</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">6</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label275">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">You need to reload the package list from the sources you have listed. Do you want to do this now?</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">True</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">6</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">6</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
</glade-interface>
diff --git a/src/callbacks.c b/src/callbacks.c
index 02a164d..8ed178f 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -37,6 +37,7 @@ extern transaction_t *trans;
static GtkWidget *progress_window;
static guint _cancelled = 0;
+static gboolean sources_modified = FALSE;
static guint pending_trans_context_id = 0;
static int disk_space(int space_needed);
static gboolean pkg_action_popup_menu(GtkTreeView *treeview, gpointer data);
@@ -1887,6 +1888,7 @@ void preferences_sources_add (GtkWidget *w, gpointer user_data)
g_list_free(columns);
build_sources_treeviewlist((GtkWidget *)source_tree);
+ sources_modified = TRUE;
}
@@ -1946,6 +1948,7 @@ void preferences_sources_remove (GtkWidget *w, gpointer user_data)
g_free(source);
build_sources_treeviewlist((GtkWidget *)source_tree);
+ sources_modified = TRUE;
}
}
@@ -1970,6 +1973,13 @@ void preferences_on_ok_clicked (GtkWidget *w, gpointer user_data)
}
gtk_widget_destroy(w);
+
+ /* TODO add a dialog to resync package sources */
+ if (sources_modified == TRUE) {
+ sources_modified = FALSE;
+ GtkWidget *rc = create_repositories_changed();
+ gtk_widget_show(rc);
+ }
}
@@ -2820,3 +2830,12 @@ GtkEntryCompletion *build_search_completions (void)
return completion;
}
+
+void repositories_changed_callback (GtkWidget *repositories_changed,
+ gpointer user_data)
+{
+ gtk_widget_destroy(GTK_WIDGET(repositories_changed));
+ g_signal_emit_by_name(lookup_widget(gslapt,"action_bar_update_button"),
+ "clicked");
+}
+
diff --git a/src/callbacks.h b/src/callbacks.h
index afb265a..e1aee3e 100644
--- a/src/callbacks.h
+++ b/src/callbacks.h
@@ -78,3 +78,6 @@ void on_unmark_all1_activate (GtkMenuItem *menuitem, gpointer user_data);
GtkEntryCompletion *build_search_completions (void);
+
+void repositories_changed_callback (GtkWidget *repositories_changed,
+ gpointer user_data);
diff --git a/src/interface.c b/src/interface.c
index 0d064f6..a25cfdf 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -2142,3 +2142,105 @@ create_pkgtools_progress_window (void)
return pkgtools_progress_window;
}
+GtkWidget*
+create_repositories_changed (void)
+{
+ GtkWidget *repositories_changed;
+ GdkPixbuf *repositories_changed_icon_pixbuf;
+ GtkWidget *dialog_vbox5;
+ GtkWidget *hbox107;
+ GtkWidget *image982;
+ GtkWidget *vbox70;
+ GtkWidget *label274;
+ GtkWidget *label275;
+ GtkWidget *dialog_action_area5;
+ GtkWidget *button5;
+ GtkWidget *button6;
+
+ repositories_changed = gtk_dialog_new ();
+ gtk_widget_set_name (repositories_changed, "repositories_changed");
+ gtk_window_set_title (GTK_WINDOW (repositories_changed), _("Repositories changed"));
+ repositories_changed_icon_pixbuf = create_pixbuf ("gslapt.png");
+ if (repositories_changed_icon_pixbuf)
+ {
+ gtk_window_set_icon (GTK_WINDOW (repositories_changed), repositories_changed_icon_pixbuf);
+ gdk_pixbuf_unref (repositories_changed_icon_pixbuf);
+ }
+ gtk_window_set_type_hint (GTK_WINDOW (repositories_changed), GDK_WINDOW_TYPE_HINT_DIALOG);
+
+ dialog_vbox5 = GTK_DIALOG (repositories_changed)->vbox;
+ gtk_widget_set_name (dialog_vbox5, "dialog_vbox5");
+ gtk_widget_show (dialog_vbox5);
+
+ hbox107 = gtk_hbox_new (FALSE, 6);
+ gtk_widget_set_name (hbox107, "hbox107");
+ gtk_widget_show (hbox107);
+ gtk_box_pack_start (GTK_BOX (dialog_vbox5), hbox107, TRUE, TRUE, 6);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox107), 2);
+
+ image982 = gtk_image_new_from_stock ("gtk-dialog-info", GTK_ICON_SIZE_DIALOG);
+ gtk_widget_set_name (image982, "image982");
+ gtk_widget_show (image982);
+ gtk_box_pack_start (GTK_BOX (hbox107), image982, TRUE, TRUE, 6);
+ gtk_misc_set_alignment (GTK_MISC (image982), 0.5, 0.2);
+
+ vbox70 = gtk_vbox_new (FALSE, 6);
+ gtk_widget_set_name (vbox70, "vbox70");
+ gtk_widget_show (vbox70);
+ gtk_box_pack_start (GTK_BOX (hbox107), vbox70, TRUE, TRUE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox70), 6);
+
+ label274 = gtk_label_new (_("<span size=\"large\" weight=\"bold\">Repositories changed</span>"));
+ gtk_widget_set_name (label274, "label274");
+ gtk_widget_show (label274);
+ gtk_box_pack_start (GTK_BOX (vbox70), label274, FALSE, FALSE, 6);
+ gtk_label_set_use_markup (GTK_LABEL (label274), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label274), 0, 0.5);
+
+ label275 = gtk_label_new (_("You need to reload the package list from the sources you have listed. Do you want to do this now?"));
+ gtk_widget_set_name (label275, "label275");
+ gtk_widget_show (label275);
+ gtk_box_pack_start (GTK_BOX (vbox70), label275, TRUE, TRUE, 6);
+ gtk_label_set_use_markup (GTK_LABEL (label275), TRUE);
+ gtk_label_set_line_wrap (GTK_LABEL (label275), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label275), 0, 0);
+
+ dialog_action_area5 = GTK_DIALOG (repositories_changed)->action_area;
+ gtk_widget_set_name (dialog_action_area5, "dialog_action_area5");
+ gtk_widget_show (dialog_action_area5);
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area5), GTK_BUTTONBOX_END);
+
+ button5 = gtk_button_new_from_stock ("gtk-no");
+ gtk_widget_set_name (button5, "button5");
+ gtk_widget_show (button5);
+ gtk_dialog_add_action_widget (GTK_DIALOG (repositories_changed), button5, GTK_RESPONSE_NO);
+ GTK_WIDGET_SET_FLAGS (button5, GTK_CAN_DEFAULT);
+
+ button6 = gtk_button_new_from_stock ("gtk-yes");
+ gtk_widget_set_name (button6, "button6");
+ gtk_widget_show (button6);
+ gtk_dialog_add_action_widget (GTK_DIALOG (repositories_changed), button6, GTK_RESPONSE_YES);
+ GTK_WIDGET_SET_FLAGS (button6, GTK_CAN_DEFAULT);
+
+ g_signal_connect_swapped ((gpointer) button5, "clicked",
+ G_CALLBACK (gtk_widget_destroy),
+ GTK_OBJECT (repositories_changed));
+ g_signal_connect_swapped ((gpointer) button6, "clicked",
+ G_CALLBACK (repositories_changed_callback),
+ GTK_OBJECT (repositories_changed));
+
+ /* Store pointers to all widgets, for use by lookup_widget(). */
+ GLADE_HOOKUP_OBJECT_NO_REF (repositories_changed, repositories_changed, "repositories_changed");
+ GLADE_HOOKUP_OBJECT_NO_REF (repositories_changed, dialog_vbox5, "dialog_vbox5");
+ GLADE_HOOKUP_OBJECT (repositories_changed, hbox107, "hbox107");
+ GLADE_HOOKUP_OBJECT (repositories_changed, image982, "image982");
+ GLADE_HOOKUP_OBJECT (repositories_changed, vbox70, "vbox70");
+ GLADE_HOOKUP_OBJECT (repositories_changed, label274, "label274");
+ GLADE_HOOKUP_OBJECT (repositories_changed, label275, "label275");
+ GLADE_HOOKUP_OBJECT_NO_REF (repositories_changed, dialog_action_area5, "dialog_action_area5");
+ GLADE_HOOKUP_OBJECT (repositories_changed, button5, "button5");
+ GLADE_HOOKUP_OBJECT (repositories_changed, button6, "button6");
+
+ return repositories_changed;
+}
+
diff --git a/src/interface.h b/src/interface.h
index 74776b4..e98423f 100644
--- a/src/interface.h
+++ b/src/interface.h
@@ -10,3 +10,4 @@ GtkWidget* create_about (void);
GtkWidget* create_notification (void);
GtkWidget* create_icon_legend (void);
GtkWidget* create_pkgtools_progress_window (void);
+GtkWidget* create_repositories_changed (void);