updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / knetworkmanager / pretty-notification.patch
blob756315802ed4dac8e4d7b1e2c4b80d27d6fd8b1c
1 Index: knetworkmanager/src/knetworkmanager-vpn.cpp
2 ===================================================================
3 --- knetworkmanager/src/knetworkmanager-vpn.cpp (Revision 606432)
4 +++ knetworkmanager/src/knetworkmanager-vpn.cpp (Revision 606738)
5 @@ -123,6 +123,12 @@
6 emit activationStateChanged ();
9 +void
10 +VPNConnection::setVPNConnectionFailure(QString& member, QString& err_msg)
12 + emit connectionFailure(member, err_msg);
15 QString
16 VPNConnection::getAuthHelper () const
18 Index: knetworkmanager/src/knetworkmanager-notify.h
19 ===================================================================
20 --- knetworkmanager/src/knetworkmanager-notify.h (Revision 606432)
21 +++ knetworkmanager/src/knetworkmanager-notify.h (Revision 606738)
22 @@ -4,7 +4,8 @@
24 * Copyright (C) 2005, 2006 Novell, Inc.
26 - * Author: Timo Hoenig <thoenig@suse.de>, <thoenig@nouse.net>
27 + * Authors: Timo Hoenig <thoenig@suse.de>, <thoenig@nouse.net>
28 + * Helmut Schaa <hschaa@suse.de>, <helmut.schaa@gmx.de>
30 * This program is free software; you can redistribute it and/or modify
31 * it under the terms of the GNU General Public License as published by
32 @@ -30,15 +31,20 @@
33 #include "knetworkmanager.h"
35 class ActivationWidget;
36 +class ErrorMessageWidget;
38 -class ActivationStageNotify : public KDialogBase
39 +class ActivationStageNotify : public QWidget
41 Q_OBJECT
43 public:
44 - ActivationStageNotify (QWidget * parent = 0, const char *name = 0, bool modal = FALSE, WFlags fl = 0, KNetworkManager* ctx = NULL);
45 + ActivationStageNotify (QWidget * parent = 0, const char *name = 0, WFlags fl = 0, KNetworkManager* ctx = NULL);
46 ~ActivationStageNotify ();
47 + void setAnchor(const QPoint&);
49 + private:
50 + void updateMask();
52 private slots:
53 void destroyActivationStage ();
55 @@ -46,6 +52,14 @@
57 KNetworkManager* _ctx;
58 ActivationWidget* _activationWidget;
59 + QPoint _anchor;
60 + ErrorMessageWidget* _errorWidget;
61 + bool _bottom;
62 + bool _right;
64 + void getArrowPoints(QPointArray&);
65 + void paintEvent(QPaintEvent*);
66 + void mousePressEvent(QMouseEvent*);
69 class ActivationStageNotifyVPN : public ActivationStageNotify
70 @@ -58,6 +72,8 @@
72 public slots:
73 void updateActivationStage ();
74 + void connectionFailure (QString&, QString& );
75 + void done();
77 private:
79 Index: knetworkmanager/src/knetworkmanager-tray.h
80 ===================================================================
81 --- knetworkmanager/src/knetworkmanager-tray.h (Revision 606432)
82 +++ knetworkmanager/src/knetworkmanager-tray.h (Revision 606738)
83 @@ -62,7 +62,6 @@
84 #define NUM_CONNECTING_STAGES 3
85 #define NUM_CONNECTING_FRAMES 11
88 class WirelessNetworkItem : public QCustomMenuItem
90 public:
91 @@ -129,10 +128,13 @@
92 void mouseMoveEvent (QMouseEvent* e);
93 void mousePressEvent (QMouseEvent* e);
95 + QPoint getAnchor (void) const;
97 void loadIcons();
98 void drawContents (QPainter *p);
99 QPixmap updateForState( NMState state );
100 QPixmap pixmapForStage();
103 signals:
104 void userInteraction (void);
105 @@ -209,6 +211,8 @@
106 QPixmap m_wireless75;
107 QPixmap m_wireless100;
108 QPixmap m_background;
110 + QPoint _anchor;
113 #endif /* KNETWORKMANAGER_TRAY_H */
114 Index: knetworkmanager/src/activation.ui
115 ===================================================================
116 --- knetworkmanager/src/activation.ui (Revision 606432)
117 +++ knetworkmanager/src/activation.ui (Revision 606738)
118 @@ -8,62 +8,67 @@
119 <rect>
120 <x>0</x>
121 <y>0</y>
122 - <width>392</width>
123 - <height>95</height>
124 + <width>312</width>
125 + <height>104</height>
126 </rect>
127 </property>
128 <property name="caption">
129 <string>activationwidget</string>
130 </property>
131 - <grid>
132 + <vbox>
133 <property name="name">
134 <cstring>unnamed</cstring>
135 </property>
136 <property name="margin">
137 <number>0</number>
138 </property>
139 - <widget class="QGroupBox" row="0" column="0">
140 + <widget class="QLabel">
141 <property name="name">
142 - <cstring>groupActivation</cstring>
143 + <cstring>lblActivationCaption</cstring>
144 </property>
145 - <property name="margin">
146 - <number>0</number>
147 + <property name="font">
148 + <font>
149 + <bold>1</bold>
150 + </font>
151 </property>
152 - <property name="midLineWidth">
153 - <number>0</number>
154 + <property name="text">
155 + <string>lblActivationCaption</string>
156 </property>
157 - <property name="title">
158 - <string>groupActivation</string>
159 + </widget>
160 + <widget class="QLabel">
161 + <property name="name">
162 + <cstring>lblActivation</cstring>
163 </property>
164 - <grid>
165 - <property name="name">
166 - <cstring>unnamed</cstring>
167 - </property>
168 - <widget class="KProgress" row="2" column="0">
169 - <property name="name">
170 - <cstring>pbarActivationStage</cstring>
171 - </property>
172 - </widget>
173 - <widget class="QLabel" row="0" column="0">
174 - <property name="name">
175 - <cstring>lblActivation</cstring>
176 - </property>
177 - <property name="text">
178 - <string>lblActivation</string>
179 - </property>
180 - </widget>
181 - <widget class="QLabel" row="3" column="0">
182 - <property name="name">
183 - <cstring>lblActivationStage</cstring>
184 - </property>
185 - <property name="text">
186 - <string>lblActivationStage</string>
187 - </property>
188 - </widget>
189 - </grid>
190 + <property name="text">
191 + <string>lblActivation</string>
192 + </property>
193 </widget>
194 - </grid>
195 + <widget class="KProgress">
196 + <property name="name">
197 + <cstring>pbarActivationStage</cstring>
198 + </property>
199 + <property name="maximumSize">
200 + <size>
201 + <width>32767</width>
202 + <height>20</height>
203 + </size>
204 + </property>
205 + <property name="percentageVisible">
206 + <bool>true</bool>
207 + </property>
208 + </widget>
209 + <widget class="QLabel">
210 + <property name="name">
211 + <cstring>lblActivationStage</cstring>
212 + </property>
213 + <property name="text">
214 + <string>lblActivationStage</string>
215 + </property>
216 + </widget>
217 + </vbox>
218 </widget>
219 +<customwidgets>
220 +</customwidgets>
221 <layoutdefaults spacing="6" margin="11"/>
222 <includehints>
223 <includehint>kprogress.h</includehint>
224 Index: knetworkmanager/src/knetworkmanager-notify.cpp
225 ===================================================================
226 --- knetworkmanager/src/knetworkmanager-notify.cpp (Revision 606432)
227 +++ knetworkmanager/src/knetworkmanager-notify.cpp (Revision 606738)
228 @@ -1,10 +1,11 @@
229 /***************************************************************************
231 - * knetworkmanager-notify.cpp - A NetworkManager frontend for KDE
232 + * knetworkmanager-notify.cpp - A NetworkManager frontend for KDE
234 * Copyright (C) 2005, 2006 Novell, Inc.
236 * Author: Timo Hoenig <thoenig@suse.de>, <thoenig@nouse.net>
237 + * Helmut Schaa <hschaa@suse.de>, <helmut.schaa@gmx.de>
239 * This program is free software; you can redistribute it and/or modify
240 * it under the terms of the GNU General Public License as published by
241 @@ -15,7 +16,7 @@
242 * but WITHOUT ANY WARRANTY; without even the implied warranty of
243 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
244 * GNU General Public License for more details.
245 - *
247 * You should have received a copy of the GNU General Public License
248 * along with this program; if not, write to the Free Software
249 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
250 @@ -25,14 +26,23 @@
251 #include <qvariant.h>
252 #include <qpushbutton.h>
253 #include <qlabel.h>
254 -#include <qgroupbox.h>
255 +#include <qgroupbox.h>
256 #include <kprogress.h>
257 #include <qtooltip.h>
258 #include <qwhatsthis.h>
259 #include <klocale.h>
260 +#include <qmessagebox.h>
261 +#include <kactivelabel.h>
262 +#include <kpushbutton.h>
263 +#include <kglobalsettings.h>
264 +#include <qpointarray.h>
265 +#include <qlayout.h>
266 +#include <qpainter.h>
267 +#include <qbitmap.h>
269 #include "knetworkmanager-notify.h"
270 #include "activation.h"
271 +#include "errormsg.h"
273 class DeviceStore;
275 @@ -44,11 +54,14 @@
276 State* state = _ctx->getState ();
277 int progress;
278 QString stage;
280 /* close dialog if NetworkManager is not running*/
281 if (state->isNetworkManagerRunning () == false)
282 goto done;
284 + /* if we have an unclosed error let it unchanged */
285 + if (_errorWidget != NULL)
286 + goto stage_pending;
288 switch (progress = _vpnConnection->getActivationStage ()) {
289 case NM_VPN_ACT_STAGE_PREPARE:
291 @@ -70,21 +83,41 @@
292 stage = i18n("Successfully connected.");
293 break;
295 + case NM_VPN_ACT_STAGE_DISCONNECTED:
296 + case NM_VPN_ACT_STAGE_FAILED:
297 + stage = i18n("Failed.");
298 + break;
300 + case NM_VPN_ACT_STAGE_CANCELED:
301 default:
303 goto done;
307 + if (progress == NM_VPN_ACT_STAGE_FAILED | progress == NM_VPN_ACT_STAGE_DISCONNECTED)
309 + QString temp("");
310 + connectionFailure(temp, temp);
311 + goto stage_pending;
314 _activationWidget->pbarActivationStage->setProgress (progress);
315 _activationWidget->lblActivationStage->setText (i18n("Activation stage: %1.").arg(stage));
317 - if (progress == NM_VPN_ACT_STAGE_FAILED || progress == NM_VPN_ACT_STAGE_CANCELED)
318 - goto done;
319 + this->resize(minimumSizeHint());
321 if (progress < NM_VPN_ACT_STAGE_ACTIVATED)
322 goto stage_pending;
325 + if (progress == NM_VPN_ACT_STAGE_ACTIVATED) {
326 + // close us in 1 sec
327 + QTimer* timer = new QTimer(this);
328 + connect(timer, SIGNAL(timeout()), this, SLOT(done()));
329 + timer->start(1000, true);
330 + goto stage_pending;
333 done:
334 delete (this);
336 @@ -93,8 +126,69 @@
337 return;
340 +void
341 +ActivationStageNotifyVPN::done()
343 + delete (this);
346 +void
347 +ActivationStageNotifyVPN::connectionFailure(QString& member, QString& err_msg)
349 + QString title;
350 + QString desc;
351 + QString details = err_msg;
353 + if (member == NM_DBUS_VPN_SIGNAL_LOGIN_FAILED) {
354 + title = i18n("VPN Login Failure");
355 + desc = i18n("Could not start the VPN connection '%1' due to a login failure.").arg(_vpnConnection->getName());
357 + else if (member == NM_DBUS_VPN_SIGNAL_LAUNCH_FAILED) {
358 + title = i18n("VPN Start Failure");
359 + desc = i18n("Could not start the VPN connection '%1' due to a failure launching the VPN program.").arg(_vpnConnection->getName());
361 + else if (member == NM_DBUS_VPN_SIGNAL_CONNECT_FAILED) {
362 + title = i18n("VPN Connect Failure");
363 + desc = i18n("Could not start the VPN connection '%1' due to a connection error.").arg(_vpnConnection->getName());
365 + else if (member == NM_DBUS_VPN_SIGNAL_VPN_CONFIG_BAD) {
366 + title = i18n("VPN Configuration Error");
367 + desc = i18n("The VPN connection '%1' was not correctly configured.").arg(_vpnConnection->getName());
369 + else if (member == NM_DBUS_VPN_SIGNAL_IP_CONFIG_BAD) {
370 + title = i18n("VPN Connect Failure");
371 + desc = i18n("Could not start the VPN connection '%1' because the VPN server did not return an adequate network configuration.").arg(_vpnConnection->getName());
373 + else {
374 + title = i18n("VPN Failure");
375 + desc = i18n("Could not start the VPN connection %1.").arg(_vpnConnection->getName());
378 + _activationWidget->hide();
380 + // we need an errorwidget to show the error message
381 + if (_errorWidget == NULL)
382 + _errorWidget = new ErrorMessageWidget(this);
384 + _errorWidget->setCaption(title);
385 + _errorWidget->labelTitle->setText(title);
386 + _errorWidget->labelMessage->setText(desc + "\n" + err_msg);
387 + _errorWidget->labelPixmap->setPixmap(KGlobal::instance()->iconLoader()->loadIcon("messagebox_critical", KIcon::Small, 32));
388 + _errorWidget->pushOK->setIconSet(SmallIcon("button_ok", QIconSet::Automatic));
390 + // close us when ok is pressed
391 + connect(_errorWidget->pushOK, SIGNAL(clicked()), this, SLOT(done()));
392 + _errorWidget->show();
394 + // resize so the message fits in our widget
395 + this->resize(minimumSizeHint());
397 + // show if we are hidden
398 + this->show();
401 ActivationStageNotifyVPN::ActivationStageNotifyVPN (QWidget* parent, const char* name, bool modal, WFlags fl, KNetworkManager* ctx, VPNConnection* vpnConnection)
402 - : ActivationStageNotify (parent, name, modal, fl, ctx)
403 + : ActivationStageNotify (parent, name, fl, ctx)
405 QString info;
407 @@ -103,9 +197,9 @@
409 _vpnConnection = vpnConnection;
411 - QWidget* mainWid = mainWidget ();
412 + QWidget* mainWid = this;
413 _activationWidget = new ActivationWidget (mainWid, "activationwidget");
414 - _activationWidget->groupActivation->setTitle (i18n ("Activating VPN Connection"));
415 + _activationWidget->lblActivationCaption->setText (i18n ("Activating VPN Connection"));
416 _activationWidget->lblActivation->setText (_vpnConnection->getName ());
417 _activationWidget->pbarActivationStage->setTotalSteps (5);
418 _activationWidget->lblActivationStage->setText (QString::null);
419 @@ -115,7 +209,9 @@
421 connect (vpnConnection, SIGNAL (activationStateChanged ()),
422 this, SLOT (updateActivationStage ()));
423 - this->show ();
425 + connect (vpnConnection, SIGNAL (connectionFailure(QString&, QString&)), this, SLOT(connectionFailure(QString&, QString&)));
426 + this->resize(minimumSizeHint());
429 ActivationStageNotifyVPN::~ActivationStageNotifyVPN ()
430 @@ -199,6 +295,15 @@
431 if (progress < NM_ACT_STAGE_ACTIVATED)
432 goto stage_pending;
434 + if (progress == NM_ACT_STAGE_ACTIVATED)
436 + // close us in 1 second
437 + QTimer* timer = new QTimer(this);
438 + connect(timer, SIGNAL(timeout()), this, SLOT(close()));
439 + timer->start(1000, true);
440 + goto stage_pending;
443 if (progress == (int) NM_ACT_STAGE_ACTIVATED) {
444 // TODO should we do something?
445 // printf ("notify::NM_ACT_STAGE_ACTIVATED\n");
446 @@ -220,22 +325,22 @@
449 ActivationStageNotifyNetwork::ActivationStageNotifyNetwork (const QString & essid, QWidget* parent, const char* name, bool modal, WFlags fl, KNetworkManager* ctx, Device* dev )
450 - : ActivationStageNotify (parent, name, modal, fl, ctx), _essid( essid )
451 + : ActivationStageNotify (parent, name, fl, ctx), _essid( essid )
453 QString info;
455 _dev = dev;
457 - QWidget* mainWid = mainWidget ();
458 + QWidget* mainWid = this;
459 _activationWidget = new ActivationWidget (mainWid, "activationwidget");
460 if (_dev )
462 if ( _essid.isEmpty() ) {
463 - _activationWidget->groupActivation->setTitle (i18n ("Activating Network Connection"));
464 + _activationWidget->lblActivationCaption->setText (i18n ("Activating Network Connection"));
465 if ((info = _dev->getVendor () + " " + _dev->getProduct ()) == " ")
466 info = _dev->getInterface ();
467 } else {
468 - _activationWidget->groupActivation->setTitle (i18n ("Activating Wireless Network Connection"));
469 + _activationWidget->lblActivationCaption->setText (i18n ("Activating Wireless Network Connection"));
470 info = _essid;
471 info += " (" + _dev->getInterface () + ")";
473 @@ -249,9 +354,9 @@
474 this, SLOT (destroyActivationStage ()));
476 connect (_ctx->getDeviceStore (), SIGNAL (deviceStoreChanged (DeviceStore*)),
477 - this, SLOT (updateActivationStage ()));
478 + this, SLOT (updateActivationStage ()));
480 - this->show ();
481 + resize(minimumSizeHint());
484 ActivationStageNotifyNetwork::~ActivationStageNotifyNetwork ()
485 @@ -267,17 +372,23 @@
486 close ();
489 -ActivationStageNotify::ActivationStageNotify (QWidget* parent, const char* name, bool modal, WFlags /* fl */, KNetworkManager* ctx)
490 - : KDialogBase (parent, name, modal, "Activation", 0 /* KDialogBase::Help|KDialogBase::Ok|KDialogBase::Cancel */, KDialogBase::NoDefault, false)
491 +ActivationStageNotify::ActivationStageNotify (QWidget* parent, const char* name/*, bool modal,*/, WFlags fl , KNetworkManager* ctx)
492 + : QWidget (NULL, name, WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM)
494 _ctx = ctx;
495 + _errorWidget = NULL;
496 if (!name)
497 setName ("ActivationStageNotify");
499 setCaption (i18n("Activation"));
500 - makeVBoxMainWidget ();
501 - resize (QSize (370, 0));
503 + QHBoxLayout* layout = new QHBoxLayout( this, 20 );
504 + layout->setAutoAdd(true);
505 clearWState (WState_Polished);
506 + setPalette(QToolTip::palette());
507 + setAutoMask(true);
509 + resize(minimumSizeHint());
512 ActivationStageNotify::~ActivationStageNotify ()
513 @@ -285,4 +396,72 @@
517 +void ActivationStageNotify::mousePressEvent(QMouseEvent* /*me*/)
519 + if (_errorWidget != NULL)
520 + /* if we display an error and the user clicked us he wants
521 + the error to go away -> delete */
522 + delete this;
523 + else
524 + /* if we have only normal state reporting and the user
525 + clicked us he doesnt want to see the state changes but
526 + maybe he wants o be notified when an error occurs */
527 + this->hide();
530 +void ActivationStageNotify::getArrowPoints(QPointArray& arrow)
532 + arrow.resize(3);
533 + arrow.setPoint(0, QPoint(_right ? width() - 10 : 10,
534 + _bottom ? height() - 20 : 20));
535 + arrow.setPoint(1, QPoint(_right ? width() : 0, _bottom ? height() : 0));
536 + arrow.setPoint(2, QPoint(_right ? width() - 20 : 20,
537 + _bottom ? height() - 10 : 10));
540 +void ActivationStageNotify::paintEvent(QPaintEvent* pe)
542 + QPainter paint(this);
543 + paint.drawRoundRect(10,10,width()-20, height()-20, 1600/width(), 1600/height());
545 + QPointArray arrow;
546 + getArrowPoints(arrow);
548 + paint.setPen(this->backgroundColor());
549 + paint.setBrush(this->backgroundColor());
550 + paint.drawPolygon(arrow);
552 + paint.setPen(Qt::black);
553 + paint.drawPolyline(arrow);
556 +void ActivationStageNotify::setAnchor(const QPoint &anchor)
558 + _anchor = anchor;
559 + updateMask();
562 +// Based on work of Kopete (http://kopete.kde.org)
563 +void ActivationStageNotify::updateMask()
565 + QRect deskRect = KGlobalSettings::desktopGeometry(_anchor);
566 + _bottom = (_anchor.y() + height()) > ((deskRect.y() + deskRect.height()-48));
567 + _right = (_anchor.x() + width()) > ((deskRect.x() + deskRect.width()-48));
569 + QPointArray arrow;
570 + getArrowPoints(arrow);
572 + QBitmap mask(width(), height());
573 + QPainter maskPainter(&mask);
574 + mask.fill(Qt::black);
575 + maskPainter.setBrush(Qt::white);
576 + maskPainter.setPen(Qt::white);
577 + maskPainter.drawRoundRect(10, 10, mask.rect().width()- 20, mask.rect().height()-20, 1600 / mask.rect().width(), 1600 / mask.rect().height());
578 + maskPainter.drawPolygon(arrow);
579 + setMask(mask);
581 + move( _right ? _anchor.x() - width() - 10 : ( _anchor.x() + 10 < 0 ? 0 : _anchor.x() + 10 ),
582 + _bottom ? _anchor.y() - height() - 10 : ( _anchor.y() + 10 < 0 ? 0 : _anchor.y() + 10 ) );
585 #include "knetworkmanager-notify.moc"
586 Index: knetworkmanager/src/knetworkmanager-dialogfab.cpp
587 ===================================================================
588 --- knetworkmanager/src/knetworkmanager-dialogfab.cpp (Revision 606432)
589 +++ knetworkmanager/src/knetworkmanager-dialogfab.cpp (Revision 606738)
590 @@ -57,6 +57,8 @@
591 emit sendPassphrase (_net);
593 notify = new ActivationStageNotifyNetwork (_net->getEssid(), _ctx->getTray (), "ActivationStageNotify", false, 0, _ctx, _dev );
594 + notify->setAnchor(_ctx->getTray()->getAnchor());
595 + notify->show();
596 KDialogBase::slotOk();
599 @@ -238,7 +240,9 @@
600 emit activateNetwork (_net, _dev);
602 ActivationStageNotifyNetwork* notify = NULL;
603 - notify = new ActivationStageNotifyNetwork ( _net->getEssid(), this, "ActivationStageNotify", true, 0, _ctx, _dev );
604 + notify = new ActivationStageNotifyNetwork ( _net->getEssid(), _ctx->getTray(), "ActivationStageNotify", true, 0, _ctx, _dev );
605 + notify->setAnchor(_ctx->getTray()->getAnchor());
606 + notify->show();
607 KDialogBase::slotOk();
610 Index: knetworkmanager/src/knetworkmanager-vpn.h
611 ===================================================================
612 --- knetworkmanager/src/knetworkmanager-vpn.h (Revision 606432)
613 +++ knetworkmanager/src/knetworkmanager-vpn.h (Revision 606738)
614 @@ -53,6 +53,7 @@
615 void addPasswords (const QStringList &);
616 void setActivationStage (NMVPNActStage);
617 void setAuthHelper (const QString &);
618 + void setVPNConnectionFailure (QString&, QString&);
620 QString getName (void) const;
621 QString getServiceName (void) const;
622 @@ -67,6 +68,7 @@
624 signals:
625 void activationStateChanged (void);
626 + void connectionFailure(QString&, QString&);
628 private:
629 QString _name;
630 @@ -82,7 +84,7 @@
631 class VPNConnectionHandler : public QObject
633 Q_OBJECT
636 public:
637 VPNConnectionHandler ( QObject * parent = 0, const char * name = 0, VPNConnection* = 0);
638 ~VPNConnectionHandler ();
639 @@ -116,7 +118,7 @@
640 VPNList* getVPNList (void);
641 bool isActive (void);
642 bool isAvailable (void);
645 void push (KNetworkManager*);
647 private:
648 Index: knetworkmanager/src/knetworkmanager-tray.cpp
649 ===================================================================
650 --- knetworkmanager/src/knetworkmanager-tray.cpp (Revision 606432)
651 +++ knetworkmanager/src/knetworkmanager-tray.cpp (Revision 606738)
652 @@ -447,6 +447,8 @@
653 /* destroy an activation stage notify dialogs and create a new one */
654 emit destroyActivationStage ();
655 notify = new ActivationStageNotifyNetwork ( net ? net->getEssid() : QString::null, this, "ActivationStageNotify", false, 0, _ctx, dev );
656 + notify->setAnchor(_anchor);
657 + notify->show();
660 void
661 @@ -463,6 +465,8 @@
662 /* destroy an activation stage notify dialogs and create a new one */
663 emit destroyActivationStage ();
664 notify = new ActivationStageNotifyVPN (this, "ActivationStageNotify", false, 0, _ctx, vpnConnection);
665 + notify->setAnchor(_anchor);
666 + notify->show();
669 void
670 @@ -801,9 +805,10 @@
674 -void Tray::mouseMoveEvent (QMouseEvent * /* e */)
675 +void Tray::mouseMoveEvent (QMouseEvent * e)
677 userInteraction ();
678 + _anchor = e->globalPos();
681 void Tray::mousePressEvent( QMouseEvent *e )
682 @@ -1014,6 +1019,12 @@
683 KNotifyClient::event( winId(), "knm-nm-network-gone", i18n("Wireless network %1 disappeared").arg( net->getEssid() ) );
686 +QPoint
687 +Tray::getAnchor() const
689 + return _anchor;
692 void
693 Tray::push (KNetworkManager* ctx)
695 Index: knetworkmanager/src/Makefile.am
696 ===================================================================
697 --- knetworkmanager/src/Makefile.am (Revision 606432)
698 +++ knetworkmanager/src/Makefile.am (Revision 606738)
699 @@ -35,7 +35,7 @@
700 knetworkmanager-state.cpp knetworkmanager-state_dbus.cpp knetworkmanager-storage.cpp \
701 knetworkmanager-synchronizer.cpp knetworkmanager-dialup.cpp settings.kcfgc knetworkmanager-encryption.cpp \
702 knetworkmanager-tray.cpp activation.ui cryptowidget.ui networkchoicewidget.ui networklabelwidget.ui \
703 - knetworkmanager-ui-networklistview.cpp \
704 + knetworkmanager-ui-networklistview.cpp errormsg.ui \
705 knetworkmanager-vpn.cpp knetworkmanager-vpn_dbus.cpp
708 Index: knetworkmanager/src/errormsg.ui
709 ===================================================================
710 --- knetworkmanager/src/errormsg.ui (Revision 0)
711 +++ knetworkmanager/src/errormsg.ui (Revision 606752)
712 @@ -0,0 +1,106 @@
713 +<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
714 +<class>ErrorMessageWidget</class>
715 +<widget class="QWidget">
716 + <property name="name">
717 + <cstring>ErrorMessageWidget</cstring>
718 + </property>
719 + <property name="geometry">
720 + <rect>
721 + <x>0</x>
722 + <y>0</y>
723 + <width>215</width>
724 + <height>104</height>
725 + </rect>
726 + </property>
727 + <grid>
728 + <property name="name">
729 + <cstring>unnamed</cstring>
730 + </property>
731 + <widget class="KPushButton" row="2" column="2">
732 + <property name="name">
733 + <cstring>pushOK</cstring>
734 + </property>
735 + <property name="text">
736 + <string>OK</string>
737 + </property>
738 + </widget>
739 + <widget class="QLabel" row="1" column="1" rowspan="1" colspan="2">
740 + <property name="name">
741 + <cstring>labelMessage</cstring>
742 + </property>
743 + <property name="sizePolicy">
744 + <sizepolicy>
745 + <hsizetype>7</hsizetype>
746 + <vsizetype>7</vsizetype>
747 + <horstretch>0</horstretch>
748 + <verstretch>0</verstretch>
749 + </sizepolicy>
750 + </property>
751 + <property name="text">
752 + <string>Error Message</string>
753 + </property>
754 + <property name="alignment">
755 + <set>AlignVCenter</set>
756 + </property>
757 + </widget>
758 + <widget class="QLabel" row="0" column="1" rowspan="1" colspan="2">
759 + <property name="name">
760 + <cstring>labelTitle</cstring>
761 + </property>
762 + <property name="font">
763 + <font>
764 + <bold>1</bold>
765 + </font>
766 + </property>
767 + <property name="text">
768 + <string>Error Title</string>
769 + </property>
770 + </widget>
771 + <spacer row="2" column="1">
772 + <property name="name">
773 + <cstring>spacer1</cstring>
774 + </property>
775 + <property name="orientation">
776 + <enum>Horizontal</enum>
777 + </property>
778 + <property name="sizeType">
779 + <enum>Expanding</enum>
780 + </property>
781 + <property name="sizeHint">
782 + <size>
783 + <width>80</width>
784 + <height>20</height>
785 + </size>
786 + </property>
787 + </spacer>
788 + <widget class="QLabel" row="0" column="0" rowspan="3" colspan="1">
789 + <property name="name">
790 + <cstring>labelPixmap</cstring>
791 + </property>
792 + <property name="text">
793 + <string></string>
794 + </property>
795 + <property name="scaledContents">
796 + <bool>false</bool>
797 + </property>
798 + </widget>
799 + </grid>
800 +</widget>
801 +<customwidgets>
802 +</customwidgets>
803 +<connections>
804 + <connection>
805 + <sender>pushOK</sender>
806 + <signal>clicked()</signal>
807 + <receiver>ErrorMessageWidget</receiver>
808 + <slot>close()</slot>
809 + </connection>
810 +</connections>
811 +<tabstops>
812 + <tabstop>pushOK</tabstop>
813 +</tabstops>
814 +<layoutdefaults spacing="6" margin="11"/>
815 +<includehints>
816 + <includehint>kpushbutton.h</includehint>
817 +</includehints>
818 +</UI>