aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2008-12-03 05:41:59 +0000
committerJason Woodward2008-12-03 05:41:59 +0000
commit83342864a06bb176cea08c01f5d41edb163a54d3 (patch)
tree209a933b8da279679096d8cb839f3774fe40e6c5
parent1c200c94b57b14743b1474dc8c516294365d0429 (diff)
downloadgslapt-83342864a06bb176cea08c01f5d41edb163a54d3.tar.gz
print package priority in the details. properly assign priority when fetching package data
-rw-r--r--ChangeLog2
-rw-r--r--gslapt.glade140
-rw-r--r--src/callbacks.c10
-rw-r--r--src/interface.c78
4 files changed, 162 insertions, 68 deletions
diff --git a/ChangeLog b/ChangeLog
index 7f925b3..482033a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,5 @@
-0.5.0 Nov 30, 2008
+0.5.0 Dec 03, 2008
* added priority to source management
* modified source management to use a new window for adding and editing
the source.
diff --git a/gslapt.glade b/gslapt.glade
index 7493108..5f3c316 100644
--- a/gslapt.glade
+++ b/gslapt.glade
@@ -1689,7 +1689,7 @@
<child>
<widget class="GtkTable" id="table2">
<property name="visible">True</property>
- <property name="n_rows">6</property>
+ <property name="n_rows">7</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
@@ -1753,9 +1753,9 @@
</child>
<child>
- <widget class="GtkLabel" id="label244">
+ <widget class="GtkLabel" id="label250">
<property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Location:&lt;/b&gt;</property>
+ <property name="label" translatable="yes">&lt;b&gt;Status:&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1773,23 +1773,50 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="pkg_info_location">
+ <widget class="GtkLabel" id="label227">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Description:&lt;/b&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="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="pkg_info_description">
<property name="visible">True</property>
- <property name="can_focus">True</property>
<property name="label" translatable="yes"></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">True</property>
+ <property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
@@ -1802,17 +1829,17 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label250">
+ <widget class="GtkLabel" id="label273">
<property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Status:&lt;/b&gt;</property>
+ <property name="label" translatable="yes">&lt;b&gt;Version:&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1830,22 +1857,23 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label227">
+ <widget class="GtkLabel" id="pkg_info_version">
<property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Description:&lt;/b&gt;</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes"></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="selectable">True</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
@@ -1856,17 +1884,17 @@
<property name="angle">0</property>
</widget>
<packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="pkg_info_description">
+ <widget class="GtkLabel" id="pkg_info_status">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
@@ -1886,17 +1914,17 @@
<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>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label273">
+ <widget class="GtkLabel" id="label291">
<property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Version:&lt;/b&gt;</property>
+ <property name="label" translatable="yes">&lt;b&gt;Source:&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1914,15 +1942,15 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="pkg_info_version">
+ <widget class="GtkLabel" id="pkg_info_source">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes"></property>
@@ -1943,17 +1971,17 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="pkg_info_status">
+ <widget class="GtkLabel" id="label298">
<property name="visible">True</property>
- <property name="label" translatable="yes"></property>
+ <property name="label" translatable="yes">&lt;b&gt;Priority:&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1969,19 +1997,47 @@
<property name="angle">0</property>
</widget>
<packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="pkg_info_priority">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</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="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label291">
+ <widget class="GtkLabel" id="label244">
<property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Source:&lt;/b&gt;</property>
+ <property name="label" translatable="yes">&lt;b&gt;Location:&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1999,15 +2055,15 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="pkg_info_source">
+ <widget class="GtkLabel" id="pkg_info_location">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes"></property>
@@ -2028,8 +2084,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
diff --git a/src/callbacks.c b/src/callbacks.c
index c1f0885..2e381cc 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -737,6 +737,7 @@ static void fillin_pkg_details (slapt_pkg_info_t *pkg)
slapt_pkg_info_t *latest_pkg = slapt_get_newest_pkg(all,pkg->name);
slapt_pkg_info_t *installed_pkg = slapt_get_newest_pkg(installed,pkg->name);
char *clean_desc = NULL, *changelog = NULL;
+ const char *priority_str = NULL;
/* set package details */
gtk_label_set_text(GTK_LABEL(lookup_widget(gslapt,"pkg_info_name")),pkg->name);
@@ -751,6 +752,10 @@ static void fillin_pkg_details (slapt_pkg_info_t *pkg)
gtk_label_set_text(GTK_LABEL(lookup_widget(gslapt,"pkg_info_description")),"");
}
+ priority_str = slapt_priority_to_str(pkg->priority);
+ fprintf(stderr,"%s\n", priority_str);
+ gtk_label_set_text(GTK_LABEL(lookup_widget(gslapt,"pkg_info_priority")),priority_str);
+
/* dependency information tab */
store = gtk_tree_store_new(1,G_TYPE_STRING);
@@ -1013,6 +1018,7 @@ static void get_package_data (void)
FILE *tmp_signature_f = NULL;
#endif
unsigned int compressed = 0;
+ SLAPT_PRIORITY_T source_priority = global_config->sources->src[i]->priority;
if (global_config->sources->src[i]->disabled == SLAPT_TRUE)
continue;
@@ -1260,6 +1266,8 @@ static void get_package_data (void)
strlen(available_pkgs->pkgs[pkg_i]->mirror) == 0) {
available_pkgs->pkgs[pkg_i]->mirror = strdup(global_config->sources->src[i]->url);
}
+ /* set the priority of the package based on the source */
+ available_pkgs->pkgs[pkg_i]->priority = source_priority;
slapt_add_pkg_to_pkg_list(new_pkgs,available_pkgs->pkgs[pkg_i]);
}
@@ -1282,6 +1290,8 @@ static void get_package_data (void)
strlen(patch_pkgs->pkgs[pkg_i]->mirror) == 0) {
patch_pkgs->pkgs[pkg_i]->mirror = strdup(global_config->sources->src[i]->url);
}
+ /* set the priority of the package based on the source, plus 1 for the patch priority */
+ patch_pkgs->pkgs[pkg_i]->priority = source_priority + 1;
slapt_add_pkg_to_pkg_list(new_pkgs,patch_pkgs->pkgs[pkg_i]);
}
diff --git a/src/interface.c b/src/interface.c
index 6ecac8a..2b204e1 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -593,8 +593,6 @@ create_gslapt (void)
GtkWidget *table2;
GtkWidget *label226;
GtkWidget *pkg_info_name;
- GtkWidget *label244;
- GtkWidget *pkg_info_location;
GtkWidget *label250;
GtkWidget *label227;
GtkWidget *pkg_info_description;
@@ -603,6 +601,10 @@ create_gslapt (void)
GtkWidget *pkg_info_status;
GtkWidget *label291;
GtkWidget *pkg_info_source;
+ GtkWidget *label298;
+ GtkWidget *pkg_info_priority;
+ GtkWidget *label244;
+ GtkWidget *pkg_info_location;
GtkWidget *vbox67;
GtkWidget *label272;
GtkWidget *hbox106;
@@ -1087,7 +1089,7 @@ create_gslapt (void)
gtk_container_add (GTK_CONTAINER (viewport1), vbox63);
gtk_container_set_border_width (GTK_CONTAINER (vbox63), 6);
- table2 = gtk_table_new (6, 2, FALSE);
+ table2 = gtk_table_new (7, 2, FALSE);
gtk_widget_set_name (table2, "table2");
gtk_widget_show (table2);
gtk_box_pack_start (GTK_BOX (vbox63), table2, FALSE, FALSE, 0);
@@ -1114,26 +1116,6 @@ create_gslapt (void)
gtk_label_set_selectable (GTK_LABEL (pkg_info_name), TRUE);
gtk_misc_set_alignment (GTK_MISC (pkg_info_name), 0, 0.5);
- label244 = gtk_label_new (_("<b>Location:</b>"));
- gtk_widget_set_name (label244, "label244");
- gtk_widget_show (label244);
- gtk_table_attach (GTK_TABLE (table2), label244, 0, 1, 3, 4,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_label_set_use_markup (GTK_LABEL (label244), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label244), 0, 0.5);
-
- pkg_info_location = gtk_label_new ("");
- gtk_widget_set_name (pkg_info_location, "pkg_info_location");
- gtk_widget_show (pkg_info_location);
- gtk_table_attach (GTK_TABLE (table2), pkg_info_location, 1, 2, 3, 4,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- GTK_WIDGET_SET_FLAGS (pkg_info_location, GTK_CAN_FOCUS);
- gtk_label_set_use_markup (GTK_LABEL (pkg_info_location), TRUE);
- gtk_label_set_selectable (GTK_LABEL (pkg_info_location), TRUE);
- gtk_misc_set_alignment (GTK_MISC (pkg_info_location), 0, 0.5);
-
label250 = gtk_label_new (_("<b>Status:</b>"));
gtk_widget_set_name (label250, "label250");
gtk_widget_show (label250);
@@ -1210,6 +1192,43 @@ create_gslapt (void)
gtk_label_set_selectable (GTK_LABEL (pkg_info_source), TRUE);
gtk_misc_set_alignment (GTK_MISC (pkg_info_source), 0, 0.5);
+ label298 = gtk_label_new (_("<b>Priority:</b>"));
+ gtk_widget_set_name (label298, "label298");
+ gtk_widget_show (label298);
+ gtk_table_attach (GTK_TABLE (table2), label298, 0, 1, 6, 7,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_label_set_use_markup (GTK_LABEL (label298), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label298), 0, 0.5);
+
+ pkg_info_priority = gtk_label_new ("");
+ gtk_widget_set_name (pkg_info_priority, "pkg_info_priority");
+ gtk_widget_show (pkg_info_priority);
+ gtk_table_attach (GTK_TABLE (table2), pkg_info_priority, 1, 2, 6, 7,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (pkg_info_priority), 0, 0.5);
+
+ label244 = gtk_label_new (_("<b>Location:</b>"));
+ gtk_widget_set_name (label244, "label244");
+ gtk_widget_show (label244);
+ gtk_table_attach (GTK_TABLE (table2), label244, 0, 1, 3, 4,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_label_set_use_markup (GTK_LABEL (label244), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label244), 0, 0.5);
+
+ pkg_info_location = gtk_label_new ("");
+ gtk_widget_set_name (pkg_info_location, "pkg_info_location");
+ gtk_widget_show (pkg_info_location);
+ gtk_table_attach (GTK_TABLE (table2), pkg_info_location, 1, 2, 3, 4,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ GTK_WIDGET_SET_FLAGS (pkg_info_location, GTK_CAN_FOCUS);
+ gtk_label_set_use_markup (GTK_LABEL (pkg_info_location), TRUE);
+ gtk_label_set_selectable (GTK_LABEL (pkg_info_location), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (pkg_info_location), 0, 0.5);
+
vbox67 = gtk_vbox_new (FALSE, 0);
gtk_widget_set_name (vbox67, "vbox67");
gtk_widget_show (vbox67);
@@ -1597,8 +1616,6 @@ create_gslapt (void)
GLADE_HOOKUP_OBJECT (gslapt, table2, "table2");
GLADE_HOOKUP_OBJECT (gslapt, label226, "label226");
GLADE_HOOKUP_OBJECT (gslapt, pkg_info_name, "pkg_info_name");
- GLADE_HOOKUP_OBJECT (gslapt, label244, "label244");
- GLADE_HOOKUP_OBJECT (gslapt, pkg_info_location, "pkg_info_location");
GLADE_HOOKUP_OBJECT (gslapt, label250, "label250");
GLADE_HOOKUP_OBJECT (gslapt, label227, "label227");
GLADE_HOOKUP_OBJECT (gslapt, pkg_info_description, "pkg_info_description");
@@ -1607,6 +1624,10 @@ create_gslapt (void)
GLADE_HOOKUP_OBJECT (gslapt, pkg_info_status, "pkg_info_status");
GLADE_HOOKUP_OBJECT (gslapt, label291, "label291");
GLADE_HOOKUP_OBJECT (gslapt, pkg_info_source, "pkg_info_source");
+ GLADE_HOOKUP_OBJECT (gslapt, label298, "label298");
+ GLADE_HOOKUP_OBJECT (gslapt, pkg_info_priority, "pkg_info_priority");
+ GLADE_HOOKUP_OBJECT (gslapt, label244, "label244");
+ GLADE_HOOKUP_OBJECT (gslapt, pkg_info_location, "pkg_info_location");
GLADE_HOOKUP_OBJECT (gslapt, vbox67, "vbox67");
GLADE_HOOKUP_OBJECT (gslapt, label272, "label272");
GLADE_HOOKUP_OBJECT (gslapt, hbox106, "hbox106");
@@ -2819,6 +2840,7 @@ create_changelog_window (void)
GdkPixbuf *changelog_window_icon_pixbuf;
GtkWidget *vbox78;
GtkWidget *changelog_notebook;
+ GtkWidget *label296;
GtkWidget *hbuttonbox3;
GtkWidget *button12;
@@ -2843,6 +2865,11 @@ create_changelog_window (void)
gtk_widget_show (changelog_notebook);
gtk_box_pack_start (GTK_BOX (vbox78), changelog_notebook, TRUE, TRUE, 6);
+ label296 = gtk_label_new ("");
+ gtk_widget_set_name (label296, "label296");
+ gtk_widget_show (label296);
+ gtk_notebook_set_tab_label (GTK_NOTEBOOK (changelog_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (changelog_notebook), 0), label296);
+
hbuttonbox3 = gtk_hbutton_box_new ();
gtk_widget_set_name (hbuttonbox3, "hbuttonbox3");
gtk_widget_show (hbuttonbox3);
@@ -2866,6 +2893,7 @@ create_changelog_window (void)
GLADE_HOOKUP_OBJECT_NO_REF (changelog_window, changelog_window, "changelog_window");
GLADE_HOOKUP_OBJECT (changelog_window, vbox78, "vbox78");
GLADE_HOOKUP_OBJECT (changelog_window, changelog_notebook, "changelog_notebook");
+ GLADE_HOOKUP_OBJECT (changelog_window, label296, "label296");
GLADE_HOOKUP_OBJECT (changelog_window, hbuttonbox3, "hbuttonbox3");
GLADE_HOOKUP_OBJECT (changelog_window, button12, "button12");