Hello community,
here is the log from the commit of package kupdateapplet for openSUSE:Factory
checked in at Fri Mar 19 09:53:12 CET 2010.
--------
--- KDE/kupdateapplet/kupdateapplet.changes 2010-02-22 16:36:09.000000000 +0100
+++ /mounts/work_src_done/STABLE/kupdateapplet/kupdateapplet.changes 2010-02-26 02:32:32.000000000 +0100
@@ -1,0 +2,11 @@
+Fri Feb 26 01:30:27 UTC 2010 - amolagodbole@gmail.com
+
+- port from KSystemTrayIcon to KStatusNotifierItem
+- fixed bnc #545517: notifications should pop up from systray
+ ...code copied over from KMix applet code, needs kde 4.4
+- fixed bnc #543124: kupdateapplet shows available updates instead of update progress when "Always show detailed view" is enabled
+- added feature: show number of available updates on detailed view tab labels
+- fixed bug: show upgrades tab by default in detailed view when upgrades are available but no patches are available
+
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
kupdateapplet-0.9.9-systraynotificationfix.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kupdateapplet.spec ++++++
--- /var/tmp/diff_new_pack.nBx7cK/_old 2010-03-19 09:52:38.000000000 +0100
+++ /var/tmp/diff_new_pack.nBx7cK/_new 2010-03-19 09:52:38.000000000 +0100
@@ -24,10 +24,11 @@
Group: System/Management
Summary: openSUSE System Updater Applet (KDE4)
Version: 0.9.9
-Release: 1
+Release: 2
Url: http://en.opensuse.org/KDE_Updater_Applet
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: %{name}-%{version}.tar.bz2
+Patch0: kupdateapplet-0.9.9-systraynotificationfix.patch
Requires: kupdateapplet-plugin = 0.9.9
Requires: oxygen-icon-theme
Requires: PolicyKit-kde
@@ -58,6 +59,7 @@
%prep
%setup -q -n %{name}-%{version}
+%patch0 -p1
%build
%cmake_kde4 -d build
@@ -140,6 +142,6 @@
%_libdir/kde4/kupdateapplet_zypp.so
/usr/share/kde4/services/kupdateapplet_zypp.desktop
-
############################
+
%changelog
++++++ kupdateapplet-0.9.9-systraynotificationfix.patch ++++++
diff -uNr kupdateapplet-0.9.9/src/mainwindow.cpp kupdateapplet-0.9.9_new/src/mainwindow.cpp
--- kupdateapplet-0.9.9/src/mainwindow.cpp 2010-02-23 08:50:18.000000000 -0500
+++ kupdateapplet-0.9.9_new/src/mainwindow.cpp 2010-02-25 19:04:04.926370758 -0500
@@ -50,7 +50,7 @@
#include "updater.h"
#include "trayicon.h"
#include "configwidget.h"
-#include "ksystemtrayicon.h"
+#include "kstatusnotifieritem.h"
#include "logics.h"
#include "updater.h"
@@ -307,17 +307,17 @@
tabwidget->removeTab(tabwidget->indexOf(packageWidget));
tabwidget->removeTab(tabwidget->indexOf(patchWidget));
- tabwidget->addTab( patchWidget, i18n( "Patches" ) );
- tabwidget->addTab( packageWidget, i18n( "Upgrades" ) );
- tabwidget->setCurrentIndex( 1 );
- tabwidget->setCurrentIndex( 0 );
+ tabwidget->addTab( patchWidget, i18n( "Patches (" ) + i18n( QString::number( patchList->topLevelItemCount() ).toUtf8().constData() ) + i18n( ")" ) );
+ tabwidget->addTab( packageWidget, i18n( "Upgrades (" ) + i18n( QString::number( packageList->topLevelItemCount() ).toUtf8().constData() ) + i18n( ")" ) );
+
+ if ( ( patchList->topLevelItemCount() == 0 ) && ( packageList->topLevelItemCount() != 0 ) ) tabwidget->setCurrentWidget( packageWidget );
}
else
{
tabwidget->removeTab(tabwidget->indexOf(packageWidget));
tabwidget->removeTab(tabwidget->indexOf(patchWidget));
- tabwidget->addTab( patchWidget, i18n( "Patches" ) );
+ tabwidget->addTab( patchWidget, i18n( "Patches (" ) + i18n( QString::number( patchList->topLevelItemCount() ).toUtf8().constData() ) + i18n( ")" ) );
}
}
diff -uNr kupdateapplet-0.9.9/src/mainwindow.h kupdateapplet-0.9.9_new/src/mainwindow.h
--- kupdateapplet-0.9.9/src/mainwindow.h 2010-02-23 08:50:18.000000000 -0500
+++ kupdateapplet-0.9.9_new/src/mainwindow.h 2010-02-25 19:04:41.714371631 -0500
@@ -27,7 +27,7 @@
#include <QLabel>
#include <QTabWidget>
-#include <KSystemTrayIcon>
+#include <KStatusNotifierItem>
#include <KXmlGuiWindow>
#include <KConfigDialog>
diff -uNr kupdateapplet-0.9.9/src/trayicon.cpp kupdateapplet-0.9.9_new/src/trayicon.cpp
--- kupdateapplet-0.9.9/src/trayicon.cpp 2010-02-23 08:50:18.000000000 -0500
+++ kupdateapplet-0.9.9_new/src/trayicon.cpp 2010-02-25 19:09:59.529370849 -0500
@@ -21,7 +21,7 @@
#include <QLabel>
-#include <QMenu>
+#include <KMenu>
#include <QMouseEvent>
#include
#include
@@ -41,16 +41,13 @@
TrayIcon::TrayIcon( Logics* l )
- : KSystemTrayIcon( 0 )
+ : KStatusNotifierItem( 0 )
, logics( l )
{
kDebug() << "loading tray..." << endl;
- setIcon( KIconLoader::global()->loadIcon( TRAY_ICON_GREEN, KIconLoader::Panel ) );
-
- connect(this, SIGNAL( activated( QSystemTrayIcon::ActivationReason ) ),
- this, SLOT( trayActivated( QSystemTrayIcon::ActivationReason ) ) );
+ setIconByPixmap( KIconLoader::global()->loadIcon( TRAY_ICON_GREEN, KIconLoader::Panel ) );
// add menu items to tray icon menu
_edit_sources_action = new KAction( i18n( "Add/Remove Update Sources..." ), 0 );
@@ -70,7 +67,7 @@
connect( _start_distroupgrade_action, SIGNAL( triggered() ),
this, SLOT( slotStartDistroUpgrade() ) );
- QMenu* cm = this->contextMenu();
+ KMenu* cm = this->contextMenu();
cm->addAction( _edit_sources_action );
cm->addAction( _configure_applet_action );
cm->addAction( _check_updates_action );
@@ -79,7 +76,6 @@
slotStateChanged();
- show();
}
@@ -124,28 +120,33 @@
{
case APPLET_CHECKING:
_check_updates_action->setEnabled( false );
- setIcon( KIconLoader::global()->loadIcon( TRAY_ICON_CHECKING, KIconLoader::Panel ) );
- setToolTip( i18n( "Checking for updates..." ) );
+ setIconByPixmap( KIconLoader::global()->loadIcon( TRAY_ICON_CHECKING, KIconLoader::Panel ) );
+ setToolTip( iconPixmap(), i18n( "Checking for updates..." ), "" );
+ setStatus(KStatusNotifierItem::Active);
break;
case APPLET_PROBLEM:
- setIcon( KIconLoader::global()->loadIcon( "dialog-warning", KIconLoader::Panel ) );
- setToolTip( "<qt>" + i18n( "Error:\n" ) + logics->stateDescription() + "</qt>" );
+ setIconByPixmap( KIconLoader::global()->loadIcon( "dialog-warning", KIconLoader::Panel ) );
+ setToolTip( iconPixmap(), "<qt>" + i18n( "Error:\n" ) + logics->stateDescription() + "</qt>", "" );
+ setStatus(KStatusNotifierItem::NeedsAttention);
break;
case APPLET_NO_UPDATES:
- setIcon( KIconLoader::global()->loadIcon( TRAY_ICON_GREEN, KIconLoader::Panel ) );
- setToolTip( i18n( "No Updates Available" ) );
+ setIconByPixmap( KIconLoader::global()->loadIcon( TRAY_ICON_GREEN, KIconLoader::Panel ) );
+ setToolTip( iconPixmap(), i18n( "No Updates Available" ), "" );
+ setStatus(KStatusNotifierItem::Passive);
break;
case APPLET_UPDATES:
- setToolTip( i18n( "New software updates are available." ) );
- setIcon( KIconLoader::global()->loadIcon( TRAY_ICON_YELLOW, KIconLoader::Panel ) );
+ setIconByPixmap( KIconLoader::global()->loadIcon( TRAY_ICON_YELLOW, KIconLoader::Panel ) );
+ setToolTip( iconPixmap(), i18n( "New software updates are available." ), "" );
+ setStatus(KStatusNotifierItem::Active);
break;
case APPLET_ONLY_OPTIONAL_UPDATES:
- setToolTip( i18n( "New software updates are available." ) );
- setIcon( KIconLoader::global()->loadIcon( TRAY_ICON_OPTIONAL, KIconLoader::Panel ) );
+ setIconByPixmap( KIconLoader::global()->loadIcon( TRAY_ICON_OPTIONAL, KIconLoader::Panel ) );
+ setToolTip( iconPixmap(), i18n( "New software updates are available." ), "" );
+ setStatus(KStatusNotifierItem::Active);
break;
case APPLET_NO_NETWORK:
@@ -154,45 +155,44 @@
case APPLET_SYSTEM_BUSY_WHILE_CHECK:
case APPLET_SYSTEM_BUSY_WHILE_INSTALL:
_check_updates_action->setEnabled( false );
- setToolTip( i18n( "Unable to check whether updates are available." ) );
- setIcon( KIconLoader::global()->loadIcon( TRAY_ICON_GRAY, KIconLoader::Panel ) );
+ setIconByPixmap( KIconLoader::global()->loadIcon( TRAY_ICON_GRAY, KIconLoader::Panel ) );
+ setToolTip( iconPixmap(), i18n( "Unable to check whether updates are available." ), "" );
+ setStatus(KStatusNotifierItem::Active);
break;
case APPLET_PKGMGR_UPDATES:
case APPLET_CRITICAL_UPDATES:
- setToolTip( i18n( "New software updates are available." ) );
- setIcon( KIconLoader::global()->loadIcon( TRAY_ICON_RED, KIconLoader::Panel ) );
+ setIconByPixmap( KIconLoader::global()->loadIcon( TRAY_ICON_RED, KIconLoader::Panel ) );
+ setToolTip( iconPixmap(), i18n( "New software updates are available." ), "" );
+ setStatus(KStatusNotifierItem::NeedsAttention);
break;
case APPLET_INSTALLING:
_check_updates_action->setEnabled( false );
- setIcon( KIconLoader::global()->loadIcon( TRAY_ICON_INSTALLING, KIconLoader::Panel ) );
- setToolTip( i18n( "Updating..." ) );
+ setIconByPixmap( KIconLoader::global()->loadIcon( TRAY_ICON_INSTALLING, KIconLoader::Panel ) );
+ setToolTip( iconPixmap(), i18n( "Updating..." ), "" );
+ setStatus(KStatusNotifierItem::Active);
break;
case APPLET_NO_UPDATE_REPO:
- setToolTip( i18n( "Unable to check whether updates are available." ) );
- setIcon( KIconLoader::global()->loadIcon( TRAY_ICON_NO_UPDATE_REPO, KIconLoader::Panel ) );
+ setIconByPixmap( KIconLoader::global()->loadIcon( TRAY_ICON_NO_UPDATE_REPO, KIconLoader::Panel ) );
+ setToolTip( iconPixmap(), i18n( "Unable to check whether updates are available." ), "" );
+ setStatus(KStatusNotifierItem::Active);
break;
case APPLET_NEW_HARDWARE:
- setToolTip( i18n( "New hardware has been attached." ) );
- setIcon( KIconLoader::global()->loadIcon( TRAY_ICON_HARDWARE, KIconLoader::Panel ) );
- break;
+ setIconByPixmap( KIconLoader::global()->loadIcon( TRAY_ICON_HARDWARE, KIconLoader::Panel ) );
+ setToolTip( iconPixmap(), i18n( "New hardware has been attached." ), "" );
+ setStatus(KStatusNotifierItem::NeedsAttention);
+ break;
default:
- setToolTip( QString() );
+ setToolTip("", "", "");
+ setStatus(KStatusNotifierItem::Passive);
break;
}
}
-void TrayIcon::trayActivated( ActivationReason reason )
-{
- if ( reason == QSystemTrayIcon::Trigger )
- emit trayClicked();
-}
-
-
#include "trayicon.moc"
// vim:tabstop=2:noet:sw=2
diff -uNr kupdateapplet-0.9.9/src/trayicon.h kupdateapplet-0.9.9_new/src/trayicon.h
--- kupdateapplet-0.9.9/src/trayicon.h 2010-02-23 08:50:18.000000000 -0500
+++ kupdateapplet-0.9.9_new/src/trayicon.h 2010-02-25 19:11:01.376121400 -0500
@@ -24,13 +24,13 @@
#define _TRAY_ICON_H_
#include <QMouseEvent>
-#include
+#include
#include "kupdateapplet_export.h"
class Logics;
class KAction;
-class KUPDATEAPPLET_EXPORT TrayIcon : public KSystemTrayIcon
+class KUPDATEAPPLET_EXPORT TrayIcon : public KStatusNotifierItem
{
Q_OBJECT
@@ -39,7 +39,6 @@
~TrayIcon();
private slots:
- void trayActivated(QSystemTrayIcon::ActivationReason);
void slotConfigurePlugin();
void slotConfigureApplet();
void slotCheck();
@@ -63,7 +62,6 @@
void moveEvent(QMoveEvent* event);
signals:
- void trayClicked();
};
diff -uNr kupdateapplet-0.9.9/src/updaterapplication.cpp kupdateapplet-0.9.9_new/src/updaterapplication.cpp
--- kupdateapplet-0.9.9/src/updaterapplication.cpp 2010-02-23 08:50:18.000000000 -0500
+++ kupdateapplet-0.9.9_new/src/updaterapplication.cpp 2010-02-25 19:16:17.729120910 -0500
@@ -25,8 +25,10 @@
#include
#include
#include
+#include
#include
#include
+#include <QDesktopWidget>
#include "notification.h"
#include "trayicon.h"
@@ -72,7 +74,7 @@
_main, SLOT( slotGotDescription( const QString&, int ) ));
- // connect simplie view
+ // connect simple view
connect ( _logics, SIGNAL( selectionChanged() ),
_simple, SLOT( slotSelectionChanged()));
connect ( _logics, SIGNAL( stateChanged() ),
@@ -99,8 +101,8 @@
_notify, SLOT( slotSystemProfile() ));
// connect tray icon
- connect ( _tray, SIGNAL( trayClicked() ) ,
- this, SLOT( slotTrayClicked() ));
+ connect ( _tray, SIGNAL( activateRequested (bool, const QPoint&) ) ,
++ this, SLOT( slotTrayClicked(bool, const QPoint&) ));
connect ( _logics, SIGNAL( stateChanged() ),
_tray, SLOT( slotStateChanged() ));
@@ -330,9 +332,9 @@
}
-void UpdaterApplication::slotTrayClicked()
+void UpdaterApplication::slotTrayClicked(bool active, const QPoint &pos)
{
- // logic for showing and hinding the view
+ // logic for showing and hiding the view
if (_main->isVisible() || _simple->isVisible() )
{
@@ -340,18 +342,79 @@
_simple->hide();
return;
}
-
- // if no update repo is defined don't show detailed view but simple view
- if ( _logics->state() == APPLET_NO_UPDATE_REPO )
+
+ if ( UpdaterSettings::self()->noSimpleView() &&
+ ( ( _logics->state() == APPLET_UPDATES) || ( _logics->state() == APPLET_CRITICAL_UPDATES) ||
+ ( _logics->state() == APPLET_PKGMGR_UPDATES) || ( _logics->state() == APPLET_ONLY_OPTIONAL_UPDATES) ) )
{
- _simple->show();
- return;
- }
+ _main->adjustSize();
+ int h = _main->height();
+ int x = pos.x() - _main->width()/2;
+ int y = pos.y() - h;
+
+ if ( y < 0 )
+ {
+ y = pos.y();
+ }
+
+ _main->move(x, y); // so that the mouse is outside of the widget
+ kDebug() << "moving to" << _main->size() << x << y;
+
+ // Now handle Multihead displays. And also make sure that the dialog is not moved out-of-the screen on the right
+ const QDesktopWidget* vdesktop = QApplication::desktop();
+ const QRect& vScreenSize = vdesktop->screenGeometry(_main);
+
+ if ( (x+_main->width()) > (vScreenSize.width() + vScreenSize.x()) )
+ {
+ // move horizontally, so that it is completely visible
+ _main->move(vScreenSize.width() + vScreenSize.x() - _main->width() -1 , y);
+ }
+ else if ( x < vScreenSize.x() )
+ {
+ // horizontally out-of bound
+ _main->move(vScreenSize.x(), y);
+ }
+ // the above stuff could also be implemented vertically
+
+ KWindowSystem::setState( _main->winId(), NET::KeepAbove);
- if ( UpdaterSettings::self()->noSimpleView() )
_main->show();
+ }
else
+ {
+ _simple->adjustSize();
+ int h = _simple->height();
+ int x = pos.x() - _simple->width()/2;
+ int y = pos.y() - h;
+
+ if ( y < 0 )
+ {
+ y = pos.y();
+ }
+
+ _simple->move(x, y); // so that the mouse is outside of the widget
+ kDebug() << "moving to" << _simple->size() << x << y;
+
+ // Now handle Multihead displays. And also make sure that the dialog is not moved out-of-the screen on the right
+ const QDesktopWidget* vdesktop = QApplication::desktop();
+ const QRect& vScreenSize = vdesktop->screenGeometry(_simple);
+
+ if ( (x+_simple->width()) > (vScreenSize.width() + vScreenSize.x()) )
+ {
+ // move horizontally, so that it is completely visible
+ _simple->move(vScreenSize.width() + vScreenSize.x() - _simple->width() -1 , y);
+ }
+ else if ( x < vScreenSize.x() )
+ {
+ // horizontally out-of bound
+ _simple->move(vScreenSize.x(), y);
+ }
+ // the above stuff could also be implemented vertically
+
+ KWindowSystem::setState( _simple->winId(), NET::KeepAbove);
+
_simple->show();
+ }
}
#include "updaterapplication.moc"
diff -uNr kupdateapplet-0.9.9/src/updaterapplication.h kupdateapplet-0.9.9_new/src/updaterapplication.h
--- kupdateapplet-0.9.9/src/updaterapplication.h 2010-02-23 08:50:18.000000000 -0500
+++ kupdateapplet-0.9.9_new/src/updaterapplication.h 2010-02-25 19:16:38.233370840 -0500
@@ -72,7 +72,7 @@
void slotConfigChanged();
private slots:
- void slotTrayClicked();
+ void slotTrayClicked(bool, const QPoint&);
};
diff -uNr kupdateapplet-0.9.9/src/updater.h kupdateapplet-0.9.9_new/src/updater.h
--- kupdateapplet-0.9.9/src/updater.h 2010-02-23 08:50:18.000000000 -0500
+++ kupdateapplet-0.9.9_new/src/updater.h 2010-02-25 19:16:55.928121337 -0500
@@ -30,7 +30,7 @@
#include
#include "constants.h"
-#include "ksystemtrayicon.h"
+#include "kstatusnotifieritem.h"
#include "updatererror.h"
/**
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org