Mailinglist Archive: yast-commit (1914 mails)

< Previous Next >
[yast-commit] r58558 - in /trunk/gtk: ChangeLog src/YGPackageSelector.cc src/ygtkzyppview.cc src/yzyppwrapper.cc src/yzyppwrapper.h
  • From: rpmcruz@xxxxxxxxxxxxxxxx
  • Date: Mon, 07 Sep 2009 05:49:13 -0000
  • Message-id: <E1MkX6I-0008MW-6A@xxxxxxxxxxxxxxxx>
Author: rpmcruz
Date: Mon Sep 7 07:49:13 2009
New Revision: 58558

URL: http://svn.opensuse.org/viewcvs/yast?rev=58558&view=rev
Log:
* src/yzyppwrapper.h/cc: added severity() description
to Package structure.

* src/YGPackageSelector.cc: split online_update list by
severity.

* src/ygtkzyppview.cc: bug fix: show "applies to" list.

Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/YGPackageSelector.cc
trunk/gtk/src/ygtkzyppview.cc
trunk/gtk/src/yzyppwrapper.cc
trunk/gtk/src/yzyppwrapper.h

Modified: trunk/gtk/ChangeLog
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=58558&r1=58557&r2=58558&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Mon Sep 7 07:49:13 2009
@@ -1,5 +1,15 @@
2009-09-06 Ricardo Cruz <rpmcruz@xxxxxxxxxxxxxxxxxxx>

+ * src/yzyppwrapper.h/cc: added severity() description
+ to Package structure.
+
+ * src/YGPackageSelector.cc: split online_update list by
+ severity.
+
+ * src/ygtkzyppview.cc: bug fix: show "applies to" list.
+
+2009-09-06 Ricardo Cruz <rpmcruz@xxxxxxxxxxxxxxxxxxx>
+
* src/YGTable.cc: bug fix 513085: block selection was too
ambitious.


Modified: trunk/gtk/src/YGPackageSelector.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGPackageSelector.cc?rev=58558&r1=58557&r2=58558&view=diff
==============================================================================
--- trunk/gtk/src/YGPackageSelector.cc (original)
+++ trunk/gtk/src/YGPackageSelector.cc Mon Sep 7 07:49:13 2009
@@ -699,15 +699,14 @@
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (m_radio[0]),
TRUE);
GtkRadioButton *radiob = GTK_RADIO_BUTTON (m_radio[0]);
m_radio[1] = gtk_radio_button_new_with_label_from_widget
(radiob, _("Description"));
- m_radio[2] = gtk_radio_button_new_with_label_from_widget
(radiob, _("File name"));
- gtk_widget_set_tooltip_text (m_radio[2],
find_entry_file_tooltip);
- if (m_onlineUpdate)
- m_radio[3] = NULL;
- else
+ if (!onlineUpdate) {
+ m_radio[2] =
gtk_radio_button_new_with_label_from_widget (radiob, _("File name"));
+ gtk_widget_set_tooltip_text (m_radio[2],
find_entry_file_tooltip);
m_radio[3] =
gtk_radio_button_new_with_label_from_widget (radiob, _("Author"));
- m_radio[4] = gtk_radio_button_new_with_label_from_widget
(radiob, _("Novelty (in days)"));
- g_signal_connect (G_OBJECT (m_radio[4]), "toggled", G_CALLBACK
(novelty_toggled_cb), this);
- gtk_widget_set_tooltip_markup (m_radio[4],
find_entry_novelty_tooltip);
+ m_radio[4] =
gtk_radio_button_new_with_label_from_widget (radiob, _("Novelty (in days)"));
+ g_signal_connect (G_OBJECT (m_radio[4]), "toggled",
G_CALLBACK (novelty_toggled_cb), this);
+ gtk_widget_set_tooltip_markup (m_radio[4],
find_entry_novelty_tooltip);
+ }
for (int i = 0; i < 5; i++)
if (m_radio [i])
gtk_box_pack_start (GTK_BOX (radio_box),
m_radio[i], FALSE, TRUE, 0);
@@ -868,12 +867,14 @@
_("Filter by name & summary"), GTK_STOCK_FIND, NULL);
ygtk_find_entry_insert_item (YGTK_FIND_ENTRY (m_name),
_("Filter by description"), GTK_STOCK_EDIT, NULL);
- ygtk_find_entry_insert_item (YGTK_FIND_ENTRY (m_name),
- _("Filter by file"), GTK_STOCK_OPEN,
find_entry_file_tooltip);
- ygtk_find_entry_insert_item (YGTK_FIND_ENTRY (m_name),
- _("Filter by author"), GTK_STOCK_ABOUT, NULL);
- ygtk_find_entry_insert_item (YGTK_FIND_ENTRY (m_name),
_("Filter by novelty (in days)"),
- GTK_STOCK_NEW, find_entry_novelty_tooltip);
+ if (!onlineUpdate) {
+ ygtk_find_entry_insert_item (YGTK_FIND_ENTRY (m_name),
+ _("Filter by file"), GTK_STOCK_OPEN,
find_entry_file_tooltip);
+ ygtk_find_entry_insert_item (YGTK_FIND_ENTRY (m_name),
+ _("Filter by author"), GTK_STOCK_ABOUT, NULL);
+ ygtk_find_entry_insert_item (YGTK_FIND_ENTRY (m_name),
_("Filter by novelty (in days)"),
+ GTK_STOCK_NEW, find_entry_novelty_tooltip);
+ }
g_signal_connect (G_OBJECT (m_name), "changed",
G_CALLBACK (name_changed_cb), this);
g_signal_connect (G_OBJECT (m_name), "menu-item-selected",
@@ -1119,7 +1120,10 @@
appendPage (0, _("_Install"), GTK_STOCK_ADD);
if (!onlineUpdate)
appendPage (1, _("_Upgrade"), GTK_STOCK_GO_UP);
- appendPage (2, _("_Remove"), GTK_STOCK_REMOVE);
+ if (!onlineUpdate)
+ appendPage (2, _("_Remove"), GTK_STOCK_REMOVE);
+ else
+ appendPage (2, _("_System"), GTK_STOCK_HARDDISK);
if (!onlineUpdate)
appendPage (3, _("_Undo"), GTK_STOCK_UNDO);

@@ -1244,10 +1248,21 @@
default: break;
}
Ypp::PkgQuery list (m_pool, query);
- const char *applyAll = NULL;
- if (!m_onlineUpdate && n == 1)
- applyAll = _("Upgrade All");
- view->setList (list, applyAll);
+ if (!m_onlineUpdate) {
+ const char *applyAll = NULL;
+ if (!m_onlineUpdate && n == 1)
+ applyAll = _("Upgrade All");
+ view->setList (list, applyAll);
+ }
+ else {
+ for (int i = 0; i < 6; i++) {
+ Ypp::PkgQuery::Query *query =
new Ypp::PkgQuery::Query();
+ query->setSeverity (i);
+ Ypp::PkgQuery severity_list
(list, query);
+ std::string str
(Ypp::Package::severityStr (i));
+ view->appendList (str.c_str(),
severity_list, NULL);
+ }
+ }
}
}

@@ -1328,7 +1343,8 @@
case 2: col = ZyppModel::TO_REMOVE_COLUMN;
break;
}
YGtkPackageView *view = ygtk_package_view_new (FALSE);
- view->appendCheckColumn (col);
+ if (!m_onlineUpdate || nb == 0)
+ view->appendCheckColumn (col);
int nameSize = (col == ZyppModel::TO_UPGRADE_COLUMN) ?
-1 : 150;
view->appendTextColumn (_("Name"),
ZyppModel::NAME_COLUMN, nameSize);
if (col == ZyppModel::TO_UPGRADE_COLUMN) {

Modified: trunk/gtk/src/ygtkzyppview.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkzyppview.cc?rev=58558&r1=58557&r2=58558&view=diff
==============================================================================
--- trunk/gtk/src/ygtkzyppview.cc (original)
+++ trunk/gtk/src/ygtkzyppview.cc Mon Sep 7 07:49:13 2009
@@ -491,9 +491,11 @@
case ZyppModel::TO_MODIFY_COLUMN:
g_value_set_boolean (value,
package->toModify());
break;
- case ZyppModel::SENSITIVE_COLUMN:
- g_value_set_boolean (value,
!package->isLocked());
+ case ZyppModel::SENSITIVE_COLUMN: {
+ bool sensitive = !package->isLocked();
+ g_value_set_boolean (value, sensitive);
break;
+ }
/*
case ZyppModel::STYLE_COLUMN: {
PangoStyle style = PANGO_STYLE_NORMAL;
@@ -1460,6 +1462,8 @@
Ypp::PkgQuery::Query *query = new
Ypp::PkgQuery::Query();
query->addCollection (package);
m_contents->setList (Ypp::PkgQuery
(Ypp::Package::PACKAGE_TYPE, query), 0);
+ gtk_widget_show (gtk_widget_get_ancestor (
+ GTK_WIDGET (m_contents),
GTK_TYPE_EXPANDER));
}

gtk_image_clear (GTK_IMAGE (m_icon));

Modified: trunk/gtk/src/yzyppwrapper.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/yzyppwrapper.cc?rev=58558&r1=58557&r2=58558&view=diff
==============================================================================
--- trunk/gtk/src/yzyppwrapper.cc (original)
+++ trunk/gtk/src/yzyppwrapper.cc Mon Sep 7 07:49:13 2009
@@ -244,6 +244,7 @@
virtual bool isSuggested() const { return false; }
virtual int buildAge() const { return 0; }
virtual bool isUnsupported() const { return false; }
+ virtual int severity() const { return 0; }

virtual std::string provides (bool rich) const { return ""; }
virtual std::string requires (bool rich) const { return ""; }
@@ -310,6 +311,22 @@
int Ypp::Package::buildAge() const { return impl->buildAge(); }
bool Ypp::Package::isUnsupported() const { return
impl->isUnsupported(); }

+int Ypp::Package::severity() const { return impl->severity(); }
+
+std::string Ypp::Package::severityStr (int id)
+{
+ switch (id) {
+ case 0: return _("Security");
+ case 1: return _("Recommended");
+ case 2: return "YaST";
+ case 3: return _("Documentation");
+ case 4: return _("Optional");
+ case 5: default: break;
+ }
+ return _("Other");
+}
+
+
std::string Ypp::Package::provides (bool rich) const { return impl->provides
(rich); }
std::string Ypp::Package::requires (bool rich) const { return impl->requires
(rich); }

@@ -566,6 +583,11 @@
text += _("the system will have to be
restarted in order for "
"this patch to take effect.");
}
+ if (patch->reloginSuggested()) {
+ text += br + br + "<b>" + _("Relogin
required: ") + "</b>";
+ text += _("you must logout and login
again for "
+ "this patch to take effect.");
+ }
if (patch->referencesBegin() !=
patch->referencesEnd()) {
text += br + br +
"<b>Bugzilla:</b><ul>";
for (zypp::Patch::ReferenceIterator it
= patch->referencesBegin();
@@ -845,6 +867,19 @@
#endif
}

+ virtual int severity() const
+ {
+ ZyppObject object = m_sel->theObj();
+ ZyppPatch patch = tryCastToZyppPatch (object);
+ if (patch->category() == "security") return 0;
+ if (patch->category() == "recommended") return 1;
+ if (patch->category() == "yast") return 2;
+ if (patch->category() == "document") return 3;
+ if (patch->category() == "optional") return 4;
+ //if (patch->category() == "other")
+ return 5;
+ }
+
virtual std::string provides (bool rich) const
{
std::string text;
@@ -1072,7 +1107,7 @@
}

virtual bool canLock() { return type != Ypp::Package::PATTERN_TYPE; }
- virtual bool canRemove() { return type != Ypp::Package::PATTERN_TYPE; }
+ virtual bool canRemove() { return type == Ypp::Package::PACKAGE_TYPE; }

virtual void lock (bool lock)
{
@@ -1417,6 +1452,10 @@
str = "YaST";
else if (patch->category() ==
"document")
str =
_("Documentation");
+ else if (patch->category() ==
"optional")
+ str = _("Optional");
+ else if (patch->category() ==
"other")
+ str = _("Other");
#endif
category = addCategory (type,
str, "");
break;
@@ -1818,12 +1857,11 @@
Keys <Node *> categories, categories2;
Keys <const Package *> collections;
Keys <const Repository *> repositories;
- Key <bool> isInstalled;
- Key <bool> hasUpgrade;
- Key <bool> toModify, toInstall, toRemove;
+ Key <bool> isInstalled, hasUpgrade, toModify, toInstall, toRemove;
Key <bool> isRecommended, isSuggested;
Key <int> buildAge;
Key <bool> isUnsupported;
+ Key <int> severity;
bool clear;
Ypp::Package *highlight;

@@ -1887,6 +1925,8 @@
}
if (match && isUnsupported.defined)
match = isUnsupported.is (package->isUnsupported());
+ if (match && severity.defined)
+ match = severity.is (package->severity());
if (match && names.defined) {
const std::list <std::string> &values = names.values;
std::list <std::string>::const_iterator it;
@@ -2027,6 +2067,8 @@
{ impl->buildAge.set (value); }
void Ypp::PkgQuery::Query::setIsUnsupported (bool value)
{ impl->isUnsupported.set (value); }
+void Ypp::PkgQuery::Query::setSeverity (int value)
+{ impl->severity.set (value); }
void Ypp::PkgQuery::Query::setClear()
{ impl->clear = true; }


Modified: trunk/gtk/src/yzyppwrapper.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/yzyppwrapper.h?rev=58558&r1=58557&r2=58558&view=diff
==============================================================================
--- trunk/gtk/src/yzyppwrapper.h (original)
+++ trunk/gtk/src/yzyppwrapper.h Mon Sep 7 07:49:13 2009
@@ -66,6 +66,8 @@
bool isSuggested() const;
int buildAge() const; // if < 0 , unsupported or error
bool isUnsupported() const;
+ int severity() const;
+ static std::string severityStr (int id);

std::string provides (bool rich) const;
std::string requires (bool rich) const;
@@ -190,6 +192,7 @@
void setIsSuggested (bool suggested);
void setBuildAge (int days);
void setIsUnsupported (bool unsupported);
+ void setSeverity (int severity);
void setClear();

~Query();

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages