Author: rpmcruz
Date: Fri Jan 11 08:55:48 2008
New Revision: 43550
URL: http://svn.opensuse.org/viewcvs/yast?rev=43550&view=rev
Log:
* src/yzyppwrapper.cc (Query): status attributes are inclusive
(somewhat inconsistent with the rest of the fields... -- we may want
to unit them in one field, or add proper query conditions).
* src/YGPackageSelector.cc (Filters): show upgrades also on Available
for patches (another inconsistency -- with regard to the packager -- but
should be intuitive).
* src/YGPackageSelector (resolver stuff): polishing with regard to long
strings.
Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/YGPackageSelector.cc
trunk/gtk/src/ygtkwizard.c
trunk/gtk/src/yzyppwrapper.cc
Modified: trunk/gtk/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=43550&r1=43549&r2=43550&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Fri Jan 11 08:55:48 2008
@@ -12,6 +12,17 @@
* src/YGUtils.cc: got rid of strcmp and contains. To use library
equivalents.
+ * src/yzyppwrapper.cc (Query): status attributes are inclusive
+ (somewhat inconsistent with the rest of the fields... -- we may want
+ to unit them in one field, or add proper query conditions).
+
+ * src/YGPackageSelector.cc (Filters): show upgrades also on Available
+ for patches (another inconsistency -- with regard to the packager -- but
+ should be intuitive).
+
+ * src/YGPackageSelector (resolver stuff): polishing with regard to long
+ strings.
+
2007-01-08 Ricardo Cruz
* src/YGUI.h/cc: keep up with libyui: file dialogs moved to YApplication.
Modified: trunk/gtk/src/YGPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGPackageSelector.cc?rev=43550&r1=43549&r2=43550&view=diff
==============================================================================
--- trunk/gtk/src/YGPackageSelector.cc (original)
+++ trunk/gtk/src/YGPackageSelector.cc Fri Jan 11 08:55:48 2008
@@ -302,10 +302,16 @@
void modified (Ypp::Package *package)
{
std::string text;
- if (package->isInstalled() && package->toInstall())
- text = "upgrade";
- else if (package->toInstall())
- text = "install";
+ if (package->toInstall()) {
+ if (package->isInstalled())
+ text = "upgrade";
+ else {
+ if (package->type() == Ypp::Package::PATCH_TYPE)
+ text = "patch";
+ else
+ text = "install";
+ }
+ }
else
text = "remove";
text += " " + package->name();
@@ -924,10 +930,21 @@
switch (m_statuses->getActive())
{
- case StatusButtons::AVAILABLE: query->setIsInstalled (false); break;
- case StatusButtons::UPGRADE: query->setHasUpgrade (true); break;
- case StatusButtons::INSTALLED: query->setIsInstalled (true); break;
- case StatusButtons::ALL: break;
+ case StatusButtons::AVAILABLE:
+ if (m_updateMode)
+ // special pane for patches upgrades makes little sense, so
+ // we instead list them together with availables
+ query->setHasUpgrade (true);
+ query->setIsInstalled (false);
+ break;
+ case StatusButtons::UPGRADE:
+ query->setHasUpgrade (true);
+ break;
+ case StatusButtons::INSTALLED:
+ query->setIsInstalled (true);
+ break;
+ case StatusButtons::ALL:
+ break;
}
m_collection->writeQuery (query);
@@ -1767,6 +1784,13 @@
}
return FALSE;
}
+ static void truncate (std::string &str, int size)
+ {
+ if (str.size() > size) {
+ str.erase (size-3);
+ str += "...";
+ }
+ }
};
// model
@@ -1774,6 +1798,7 @@
G_TYPE_STRING, G_TYPE_INT, G_TYPE_POINTER, G_TYPE_STRING);
for (std::list ::iterator it = problems.begin();
it != problems.end(); it++) {
+ inner::truncate ((*it)->details, 800);
GtkTreeIter problem_iter;
gtk_tree_store_append (store, &problem_iter, NULL);
gtk_tree_store_set (store, &problem_iter, SHOW_TOGGLE_COL, FALSE,
@@ -1783,6 +1808,7 @@
for (int i = 0; (*it)->getSolution (i); i++) {
Ypp::Problem::Solution *solution = (*it)->getSolution (i);
+ inner::truncate (solution->details, 800);
GtkTreeIter solution_iter;
const gchar *tooltip_text = solution->details.c_str();
if (solution->details.empty())
@@ -1823,6 +1849,7 @@
"visible", SHOW_TOGGLE_COL, "active", ACTIVE_TOGGLE_COL, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (view), column);
renderer = gtk_cell_renderer_text_new();
+ g_object_set (G_OBJECT (renderer), "wrap-width", 400, NULL);
column = gtk_tree_view_column_new_with_attributes ("", renderer,
"text", TEXT_COL, "weight", WEIGHT_TEXT_COL, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (view), column);
Modified: trunk/gtk/src/ygtkwizard.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkwizard.c?rev=43550&r1=43549&r2=43550&view=diff
==============================================================================
--- trunk/gtk/src/ygtkwizard.c (original)
+++ trunk/gtk/src/ygtkwizard.c Fri Jan 11 08:55:48 2008
@@ -292,7 +292,7 @@
ygtk_help_dialog_set_text (YGTK_HELP_DIALOG (wizard->m_help_dialog),
wizard->m_help);
}
- gtk_widget_show (wizard->m_help_dialog);
+ gtk_window_present (GTK_WINDOW (wizard->m_help_dialog));
}
static void help_button_clicked_cb (GtkWidget *button, YGtkWizard *wizard)
Modified: trunk/gtk/src/yzyppwrapper.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/yzyppwrapper.cc?rev=43550&r1=43549&r2=43550&view=diff
==============================================================================
--- trunk/gtk/src/yzyppwrapper.cc (original)
+++ trunk/gtk/src/yzyppwrapper.cc Fri Jan 11 08:55:48 2008
@@ -774,10 +774,15 @@
bool match = true;
if (match && types.defined)
match = types.is (package->type());
- if (match && isInstalled.defined)
- match = isInstalled.is (package->isInstalled());
- if (match && hasUpgrade.defined)
- match = hasUpgrade.is (package->hasUpgrade());
+ if (match && (isInstalled.defined || hasUpgrade.defined)) {
+ // only one of the specified status must match
+ bool status_match = false;
+ if (isInstalled.defined)
+ status_match = isInstalled.is (package->isInstalled());
+ if (!status_match && hasUpgrade.defined)
+ status_match = hasUpgrade.is (package->hasUpgrade());
+ match = status_match;
+ }
if (match && isModified.defined)
match = isModified.is (package->isModified());
if (match && names.defined) {
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org