[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/sysadmin/ept
From:       Peter Rockai <me () mornfall ! net>
Date:       2005-08-05 11:39:16
Message-ID: 1123241956.039581.4653.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 443214 by mornfall:

Merge from nevrast:
 r375@nevrast:  mornfall | 2005-08-05 13:14:57 +0200
 Add Quit action. We now actually have features kynaptic doesn't ;-).

 r374@nevrast:  mornfall | 2005-08-05 13:14:25 +0200
 Improved the lister tooltip.

 _M            trunk/playground/sysadmin/ept (directory)  
 M  +36 -11    libept/lister.cpp  
 M  +2 -0      libept/lister.h  
 M  +2 -0      testing-ui/app.cpp  
 M  +2 -2      testing-ui/ept-testing-uiui.rc  


** trunk/playground/sysadmin/ept #property changes
Name: svk:merge
   + e5ad508d-cdfc-0310-88ec-f8945a0f1aa7:/trunk/playground/sysadmin/ept:1764
--- trunk/playground/sysadmin/ept/libept/lister.cpp #443213:443214
@@ -137,6 +137,42 @@
     return "undef!";
 }
 
+QString ListerTooltip::format( const QString &what, const QString &txt, bool nobr )
+{
+    QString ret = "<b>" + what + "</b>&nbsp;" + (nobr ? "<nobr>" : "")
+                  + txt + (nobr ? "</nobr>" : "") + "<br>";
+    return ret;
+}
+
+void ListerTooltip::maybeTip (const QPoint &pt)
+{
+    if (! m_parent)
+        return;
+    kdDebug() << "ListTreeWidgetTooltip::maybeTip ()" << endl;
+    ListerItem *x = dynamic_cast<ListerItem *>( m_parent->itemAt( pt ) );
+    if (! x)
+        return;
+    QString str = "<qt>";
+    QString descr, cand, cur;
+    descr = cand = cur = "<i>Not available</i>";
+    entity::Package p( x->entity() );
+    try {
+        descr = p.shortDescription();
+    } catch (...) {}
+    try {
+        cand = p.candidateVersion().versionString();
+    } catch (...) {}
+    try {
+        cur = p.currentVersion().versionString();
+    } catch (...) {}
+    str += format( "Package:", p.name() );
+    str += format( "Description:", descr );
+    str += format( "Current Version:", cur );
+    str += format( "Candidate Version:", cand );
+    str.append ("</qt>");
+    tip( m_parent->itemRect( x ), str );
+}
+
 #if 0
 void ListTreeWidget::forwardSelectionChanged (QListViewItem *i)
 {
@@ -178,17 +214,6 @@
     m_actor -> executeAction (m_actions [i]);
 }
 
-void ListTreeWidgetTooltip::maybeTip (const QPoint &p)
-{
-    if (! m_parent)
-        return;
-    // std::cerr << "ListTreeWidgetTooltip::maybeTip ()" << std::endl;
-    KListViewItemCustom *i = dynamic_cast <KListViewItemCustom *> (m_parent->
-            itemAt (p));
-    /* XXX if (i)
-        tip (m_parent -> itemRect (i), TreeView::cElemTooltip (**(i -> m_treeNode))); */
-}
 #endif
-void ListerTooltip::maybeTip (const QPoint &p) {}
 
 #include "lister.moc"
--- trunk/playground/sysadmin/ept/libept/lister.h #443213:443214
@@ -69,6 +69,7 @@
     ListerTooltip (QWidget *v, Lister *p) : QToolTip (v, 0), m_parent (p) {};
 protected:
     virtual void maybeTip (const QPoint &p);
+    QString format( const QString &, const QString &, bool = true );
     Lister *m_parent;
 };
 
@@ -83,6 +84,7 @@
         {}
     virtual ~ListerItem() {}
     virtual QString text( int column ) const;
+    entity::Entity entity() { return m_item; }
 protected:
     entity::Entity m_item;
 };
--- trunk/playground/sysadmin/ept/testing-ui/app.cpp #443213:443214
@@ -1,6 +1,7 @@
 #include <klocale.h>
 #include <kmessagebox.h>
 #include <kaction.h>
+#include <kapplication.h>
 
 #include <apt-front/manager.h>
 #include <apt-front/init.h>
@@ -33,6 +34,7 @@
     new KAction( i18n( "Update Cache" ), "cache_update",
                  0, this, SLOT( cacheUpdate() ), actionCollection(),
                  "cache_update" );
+    KStdAction::quit( kapp, SLOT( quit() ), actionCollection() );
 }
 
 void TestApp::cacheUpdate() {
--- trunk/playground/sysadmin/ept/testing-ui/ept-testing-uiui.rc #443213:443214
@@ -1,8 +1,8 @@
 <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
 <kpartgui version="6" name="ept-testing-ui">
 <MenuBar>
-<Menu name="cache">
-<text>&amp;Cache</text>
+<Menu name="file">
+<text>&amp;Ept</text>
 <Action name="cache_update" />
 </Menu>
 </MenuBar>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic