patch: notify about network connction failure

Timo Hoenig thoenig at suse.de
Tue Jan 9 12:06:13 CET 2007


Hi Helmut,

On Tue, 2007-01-09 at 11:53 +0100, Helmut Schaa wrote:

> this patch adds handling for the activation stage NM_ACT_STAGE_FAILED and 
> it adds nice icons to the activation notify dialog. 
> Timo, any concerns?

Please see my inline comments below.

> Index: knetworkmanager-notify.h
> ===================================================================
> --- knetworkmanager-notify.h    (Revision 613233)
> +++ knetworkmanager-notify.h    (Arbeitskopie)
> @@ -92,6 +92,8 @@
>  
>         public slots:
>           void updateActivationStage ();
> +         void connectionFailure (QString&, QString& );

If the parameters are not used (yet) we should probably have
connectionFailure (void) for now and add them only when required.

> +         void done();
>  
>         private:
>           Device* _dev;
> Index: knetworkmanager-notify.cpp
> ===================================================================
> --- knetworkmanager-notify.cpp  (Revision 613233)
> +++ knetworkmanager-notify.cpp  (Arbeitskopie)
> @@ -200,6 +200,7 @@
>         QWidget* mainWid = this;
>         _activationWidget = new ActivationWidget (mainWid, "activationwidget");
>         _activationWidget->lblActivationCaption->setText (i18n ("Activating VPN Connection"));
> +       _activationWidget->lblPixmap->setPixmap(SmallIcon("encrypted", QIconSet::Automatic));
>         _activationWidget->lblActivation->setText (_vpnConnection->getName ());
>         _activationWidget->pbarActivationStage->setTotalSteps (5);
>         _activationWidget->lblActivationStage->setText (QString::null);
> @@ -304,14 +305,15 @@
>                 goto stage_pending;
>         }
>  
> -       if (progress == (int) NM_ACT_STAGE_ACTIVATED) {
> -//              TODO should we do something? 
> -//             printf ("notify::NM_ACT_STAGE_ACTIVATED\n");
> -       } else if (progress == (int) NM_ACT_STAGE_FAILED) {
> +       if (progress == NM_ACT_STAGE_FAILED)
> +       {
> +               QString temp("");
> +               connectionFailure(temp, temp);

See above.

> +               goto stage_pending;
> +       }
> +
> +       if (progress == (int) NM_ACT_STAGE_CANCELLED) {
>  //              TODO some warning 
> -//             printf ("notify::NM_ACT_STAGE_FAILED\n");
> -       } else if (progress == (int) NM_ACT_STAGE_CANCELLED) {
> -//              TODO some warning 
>  //             printf ("notify::NM_ACT_STAGE_CANCELLED\n");
>         }
>  
> @@ -323,6 +325,45 @@
>         return;
>  }
>  
> +void
> +ActivationStageNotifyNetwork::connectionFailure(QString& member, QString& err_msg)
> +{
> +       QString title;
> +       QString desc;
> +       QString details = err_msg;
> +       
> +       title = i18n("Connection Failure");
> +       desc = i18n("Could not start the the network connection for device \"%1\".").arg(_dev->getInterface());

Typos (the the); probably we should use:

For wireless networks:

"Could not connect to the network $ESSID due to a authentication
failure."

(I think it is not necessary to mention the device for wireless
networks)

For wired networks:

"Could not connect to the network using device $DEVICE."

<snip>

The rest looks fine to me.

Thanks,

   Timo



More information about the kde-networkmanager mailing list