Mailinglist Archive: yast-commit (1771 mails)

< Previous Next >
[yast-commit] r58484 - in /trunk/gtk: ChangeLog src/ygtkzyppview.cc src/yzyppwrapper.cc src/yzyppwrapper.h
  • From: rpmcruz@xxxxxxxxxxxxxxxx
  • Date: Thu, 03 Sep 2009 03:17:20 -0000
  • Message-id: <E1Mj2p6-0006ql-Fy@xxxxxxxxxxxxxxxx>
Author: rpmcruz
Date: Thu Sep 3 05:17:19 2009
New Revision: 58484

URL: http://svn.opensuse.org/viewcvs/yast?rev=58484&view=rev
Log:
* src/yzyppwrapper.h/.c: added canRemove() property to
packages, and extended PkgList.

* src/yzyppview.cc: bug fix 489016: don't show lock&remove
buttons for patterns.

Modified:
trunk/gtk/ChangeLog
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=58484&r1=58483&r2=58484&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Thu Sep 3 05:17:19 2009
@@ -39,6 +39,12 @@
* src/ygtkwizard.c: use stock image for help button: copes
with style change.

+ * src/yzyppwrapper.h/.c: added canRemove() property to
+ packages, and extended PkgList.
+
+ * src/yzyppview.cc: bug fix 489016: don't show lock&remove
+ buttons for patterns.
+
2009-08-29 Ricardo Cruz <rpmcruz@xxxxxxxxxxxxxxxxxxx>

* src/yzyppwrapper.h/.cc: split up Package::support()

Modified: trunk/gtk/src/ygtkzyppview.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkzyppview.cc?rev=58484&r1=58483&r2=58484&view=diff
==============================================================================
--- trunk/gtk/src/ygtkzyppview.cc (original)
+++ trunk/gtk/src/ygtkzyppview.cc Thu Sep 3 05:17:19 2009
@@ -793,7 +793,7 @@
if (packages.upgradable())
inner::appendItem (menu, _("_Upgrade"), 0,
GTK_STOCK_GOTO_TOP,
!locked, inner::install_cb, this),
empty = false;
- if (packages.installed())
+ if (packages.installed() && packages.canRemove())
inner::appendItem (menu, _("_Remove"), 0,
GTK_STOCK_DELETE,
!locked, inner::remove_cb, this),
empty = false;
if (packages.modified())

Modified: trunk/gtk/src/yzyppwrapper.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/yzyppwrapper.cc?rev=58484&r1=58483&r2=58484&view=diff
==============================================================================
--- trunk/gtk/src/yzyppwrapper.cc (original)
+++ trunk/gtk/src/yzyppwrapper.cc Thu Sep 3 05:17:19 2009
@@ -264,6 +264,7 @@
virtual void remove() = 0;
virtual void undo() = 0;
virtual bool canLock() = 0;
+ virtual bool canRemove() = 0;
virtual void lock (bool lock) = 0;

// internal: did the resolver touch it
@@ -356,6 +357,8 @@

bool Ypp::Package::canLock() { return impl->canLock(); }

+bool Ypp::Package::canRemove() { return impl->canRemove(); }
+
void Ypp::Package::lock (bool lock)
{
impl->lock (lock);
@@ -1062,7 +1065,9 @@
m_sel->setStatus (status);
}

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

virtual void lock (bool lock)
{
@@ -1284,8 +1289,10 @@
install (0);
}

- virtual bool canLock() { return false; }
virtual void lock (bool lock) {}
+
+ virtual bool canRemove() { return true; }
+ virtual bool canLock() { return false; }
};

// Packages Factory
@@ -1419,7 +1426,8 @@
PkgList::Listener *listener;
std::vector <Ypp::Package *> pool;
guint inited : 2, _allInstalled : 2, _allNotInstalled : 2, _allUpgradable : 2,
- _allModified : 2, _allLocked : 2, _allUnlocked : 2, _allCanLock : 2;
+ _allModified : 2, _allLocked : 2, _allUnlocked : 2, _allCanLock : 2,
+ _allCanRemove : 2;
int refcount;

int _id; // DEBUG: TEMP
@@ -1463,7 +1471,7 @@
inited = true;
if (!pool.empty()) {
_allInstalled = _allNotInstalled = _allUpgradable =
_allModified =
- _allLocked = _allUnlocked = _allCanLock = true;
+ _allLocked = _allUnlocked = _allCanLock =
_allCanRemove = true;
for (unsigned int i = 0; i < pool.size(); i++) {
Package *pkg = pool[i];
if (!pkg->isInstalled()) {
@@ -1487,11 +1495,13 @@
_allLocked = false;
if (!pkg->canLock())
_allCanLock = false;
+ if (!pkg->canRemove())
+ _allCanRemove = false;
}
}
else
_allInstalled = _allNotInstalled = _allUpgradable =
_allModified =
- _allLocked = _allUnlocked = _allCanLock = false;
+ _allLocked = _allUnlocked = _allCanLock =
_allCanRemove = false;
}

// Ypp callback
@@ -1651,6 +1661,9 @@
bool Ypp::PkgList::canLock() const
{ impl->buildProps(); return impl->_allCanLock; }

+bool Ypp::PkgList::canRemove() const
+{ impl->buildProps(); return impl->_allCanRemove; }
+
void Ypp::PkgList::refreshProps()
{ impl->inited = 0; }


Modified: trunk/gtk/src/yzyppwrapper.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/yzyppwrapper.h?rev=58484&r1=58483&r2=58484&view=diff
==============================================================================
--- trunk/gtk/src/yzyppwrapper.h (original)
+++ trunk/gtk/src/yzyppwrapper.h Thu Sep 3 05:17:19 2009
@@ -96,9 +96,11 @@
// null for most recent
version
void remove();
void undo();
- bool canLock();
void lock (bool lock);

+ bool canRemove();
+ bool canLock();
+
struct Impl;
Impl *impl;
Package (Impl *impl);
@@ -138,6 +140,7 @@
bool modified() const;
bool locked() const;
bool unlocked() const;
+ bool canRemove() const;
bool canLock() const;
void refreshProps();


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

< Previous Next >
This Thread
  • No further messages