upgrade to 0.6.2 from 0.5.1 on ubuntu breaks my wep access

2006-05-17 Thread Karl H. Beckers
Hi all,

just upgraded to 0.6.2 after my 0.5.1 applet didn't show my vpn
connections anymore.

Now, I see the vpn connections in the menu again, but nm doesn't seem to
be able to connect to my WEP enabled WLAN.

First I was prompted to enter my keyring password, then prompted for the
WEP key as often as I tried the various permutations of options here.

I have a hex key which I can use perfectly well with
"iwconfig eth1 key open . "

Anything obvious I'm missing or tips about where to look?

TIA,

Karl.

___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Re: Use NetworkManager to connect with a Vodafone Connect Card

2006-01-14 Thread Karl H. Beckers

> sorry, but I wasn't use linux with pppd and I don't know how can I do
> this?
> 
> use a UP and DOWN button is too easy .. ehehehh
> what script I put and whereto put NM use my card?

Hi there,
this is very much dependent on your distribution.
NM uses various backends for the various distros and tries to use
whatever their distributions use natively.

For instance, on debianesque systems you should be able to connect
through NM if you've configured your system so that you're also able to
connect using "ifup ppp0".

Thus you will need to consult your distro's documentation.

However, I was trying to do just that recently and have not been able to
use NM even if ifup ppp0 on the command line works and NM apparently
does the same thing ... dunno why.

I'd love to hear success stories about dial-up connections, esp. around
BT and GPRS.

Cheers,

Karl.

___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


patch update 1.1, was: Re: draw applet without theme

2006-01-05 Thread Karl H. Beckers
Hi all,

on a hint from Predatory Kangaroo (nice name btw.) I've mananged to make
the left-click menu with my patch behave a little more like it does in
the original version.

In other words:
The patch now looks at the position of the applet. If it's in the upper
half of the screen, it will position the menu below the applet. If it's
in the lower half, it will try to position the menu above the applet. In
both cases will it try to align the menu's left edge with the applet's.

Of course this may all not work because there may not be enough space
for the menu in the determined position. In this case the menu will be
moved to fit on screen automatically by GTK as required ... that can
probably be regarded as standard behaviour and as desirable.

The other thing is that positioning relies on getting the menu height
with gtk_widget_size_requisition. This seems to work decently for me
here (though it causes segfaults for P.K.). However, I also remember
having encountered problems elsewhere because gtk_widget_size_request
returns the widget's DESIRED dimensions. Now, the dimensions actually
allocated may be quite different. Don't think this is problematic
because it will worst case make the positioning above the applet a
little inaccurate. I'm just elaborating in case somebody has an idea for
determining the menu's size accurately and deterministically before
actually showing it.

If you also experience segfaults with this version, go back to the
previous one and leave positioning to GTK. On my ubuntu breezy machine
it works alright.

Karl.


--- gnome/applet/applet.c   2005-10-18 16:51:22.0 +0200
+++ gnome/applet/applet.c.khb   2006-01-05 21:06:21.0 +0100
@@ -1948,7 +1948,34 @@
  * Pop up the wireless networks menu
  *
  */
-static void nmwa_dropdown_menu_show_cb (GtkWidget *menu, NMWirelessApplet 
*applet)
+void position_popup_menu (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, 
gpointer user_data)
+{
+   GtkWidget *applet;
+   
+   applet = GTK_WIDGET(user_data);
+   g_assert (applet);
+   g_assert (x);
+   g_assert (y);
+
+   *x = *y = 0;
+   gdk_window_get_origin (GDK_WINDOW (applet->window), x, y);
+
+   if ( *y + applet->allocation.height / 2 > 
+   gdk_screen_get_height( gtk_widget_get_screen( 
GTK_WIDGET( menu ))) / 2 ) {
+   
+   GtkRequisition size;
+
+   // the following will not necessarily give the correct size of 
the menu as it has
+   // not been rendered yet, but it's prolly the best we can get
+   gtk_widget_size_request( GTK_WIDGET( menu ), &size );
+   *y -= size.height;
+   } else {
+   *y += applet->allocation.height;
+   }
+   *push_in = TRUE;
+}
+
+static void nmwa_dropdown_menu_show_cb (GtkWidget *menu, NMWirelessApplet 
*applet, GdkEventButton *event)
 {
g_return_if_fail (menu != NULL);
g_return_if_fail (applet != NULL);
@@ -1961,7 +1988,9 @@
{
nmwa_dropdown_menu_clear (applet->dropdown_menu);
nmwa_dropdown_menu_populate (applet->dropdown_menu, applet);
-   gtk_widget_show_all (applet->dropdown_menu);
+
+   gtk_menu_popup (GTK_MENU (applet->dropdown_menu), NULL, NULL, 
position_popup_menu, applet,
+event->button, event->time);
}
 
nmi_dbus_signal_user_interface_activated (applet->connection);
@@ -1973,7 +2002,7 @@
  * Create the applet's dropdown menu
  *
  */
-static GtkWidget *nmwa_dropdown_menu_create (GtkMenuItem *parent, 
NMWirelessApplet *applet)
+static GtkWidget *nmwa_dropdown_menu_create (GtkWidget *parent, 
NMWirelessApplet *applet)
 {
GtkWidget   *menu;
 
@@ -1982,8 +2011,6 @@
 
menu = gtk_menu_new ();
gtk_container_set_border_width (GTK_CONTAINER (menu), 0);
-   gtk_menu_item_set_submenu (GTK_MENU_ITEM (parent), menu);
-   g_signal_connect (menu, "show", G_CALLBACK 
(nmwa_dropdown_menu_show_cb), applet);
 
return menu;
 }
@@ -2101,7 +2128,7 @@
if (applet->top_menu_item)
{
gtk_menu_item_remove_submenu (GTK_MENU_ITEM 
(applet->top_menu_item));
-   applet->dropdown_menu = nmwa_dropdown_menu_create 
(GTK_MENU_ITEM (applet->top_menu_item), applet);
+   applet->dropdown_menu = nmwa_dropdown_menu_create (GTK_WIDGET 
(applet->top_menu_item), applet);
}
 }
 
@@ -2117,9 +2144,14 @@
 
g_return_val_if_fail (applet != NULL, FALSE);
 
-   if (event->button != 1)
g_signal_stop_emission_by_name (widget, "button_press_event");
 
+   if (event->button == 1)
+   {
+   nmwa_dropdown_menu_show_cb(applet->dropdown_menu, applet, event 
);
+   return (TRUE);
+   }
+
if (event->button == 3)
{
nmwa_context_menu_update (applet);
@@ -2140,31 +2172,19 @@
  */
 static void nmwa_setup_widgets (NMWirelessApplet *

dialup oddity on debian (ubuntu)

2006-01-05 Thread Karl H. Beckers
Hi all,

am trying to get nm to start a dialup connection.
I have my mobile phone connected in such a way that doing the following
will do what I want:
"sudo ifup ppp0"

Now, from looking at the code and the daemon.log it seems that nm does
just that. I even created a wrapper script to call ifup and see what
it's doing like this:
[EMAIL PROTECTED]:~$ more /sbin/ifup
#!/bin/bash
echo "ifup: [EMAIL PROTECTED]" >> /tmp/ifup.out
echo "EUID: ${EUID}" >> /tmp/ifup.out
/ifup [EMAIL PROTECTED]
echo "result: ${?}" >> /tmp/ifup.out

this yields:
ifup: ppp0
EUID: 0
result: 0
ifup: ppp0
EUID: 0
result: 0
ifup: ppp0
EUID: 0
result: 0

And I can see no difference between me doing it on the command line and
nm doing it, not in /var/log/messages, ...daemon.log, or syslog either.

Any ideas what else to look at?

TIA,

Karl.


___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: draw applet without theme

2006-01-03 Thread Karl H. Beckers
Hmm,
interesting ...

smth. like this works for me:
void position_popup_menu (GtkMenu *menu, gint *x, gint *y, gboolean
*push_in, gpointer user_data)
{
GtkWidget *applet;

applet = GTK_WIDGET(user_data);
g_assert (applet);
g_assert (x);
g_assert (y);

gdk_window_get_origin (GDK_WINDOW (applet->window), x, y);
*y += applet->allocation.height;
}
...
and then using that in the popup
gtk_menu_popup (GTK_MENU (applet->dropdown_menu), NULL, NULL,
position_popup_menu, applet, event->button, event->time);

HOWEVER:
I'm wondering how much that'll be worth.
This does not address that other people might not have the applet in a
panel at the top of the screen. The above algo always puts the menu below
the applet. Now, while GTK does not seem to put the menu off-screen in a
horizontal direction (I'm setting x, but with my panel there's not enough
space right of the applet and the menu gets moved to the left) it does
paint it off-screen vertically (or not paint it at all perhaps). If I move
the panel to the bottom of the screen, the above will not show the menu
where not meddling with positioning will let GTK (or metacity, or whoever)
do smth. smart. Have the impression you wouldn't reimplement that
smartness.

Karl.




On Wed, December 28, 2005 12:39 pm, Predatory Kangaroo said:
> I just noticed a useful tidbit for you, then... I was hacking on
gnome-power-manager and noticed that the Notification tooltip is aligned
exactly to the icon in the tray.
>
> It does this by embedding an image in a libegg tray widget, then finding
the
> desired x and y positions of the tooltip by using the following code (taken
> from src/gmp-common.c:73)
>
> gboolean
> get_widget_position (GtkWidget *widget, gint *x, gint *y)
> {
> GdkPixbuf* pixbuf = NULL;
>
> /* assertion checks */
> g_assert (widget);
> g_assert (x);
> g_assert (y);
>
> gdk_window_get_origin (GDK_WINDOW (widget->window), x, y);
pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (widget));
> *x += (gdk_pixbuf_get_width (pixbuf) / 2);
> *y += gdk_pixbuf_get_height (pixbuf);
> g_debug ("widget position x=%i, y=%i", *x, *y);
> return TRUE;
> }
>
> Altering that to remove the x offset (we don't need the tooltip aligned
to the center of the icon, as the notification item does) should provide
the desired effect.




___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: draw applet without theme

2005-12-16 Thread Karl H. Beckers
Am Donnerstag, den 15.12.2005, 18:35 -0500 schrieb Dan Williams:
> On Thu, 2005-12-15 at 18:09 -0500, Robert Love wrote:
> > On Thu, 2005-12-15 at 22:31 +, Antony Mee wrote:
> > > I'm using a fairly standard "Simple" theme and I see a very slightly 
> > > darker grey (relative to the notification area) in the background  of 
> > > the nm-applet icon when deactivated. It is very subtle, to the point of 
> > > making me wonder if it's an illusion.  I never found out why when I went 
> > > poking around the code but maybe that is a menu bar artefact too? Anyone 
> > > else see that?
> > 
> > Most of us  ;-)
> > 
> > Many themes draw a small gradient on the button of menu items, to set
> > the menu apart from the surrounding UI.  NM embeds its tray icon in a
> > menu (to get menu-like behavior -- see Dan's earlier email) and thus
> > your theme's gradient is drawn.
> > 
> > As Dan said, we'd like to get rid of the gradient, but want to keep the
> > menu-like behavior.
> 
> Really, just the slightly extended highlight area.  Perhaps sticking an
> alignment in the top-level applet widget, and setting padding on it?  As
> it stands, the applet's actual area is about 20x20.  It should be padded
> to be about 32x22 somehow.  I tried, but GTK+ made me angry.  Likely I
> just need to as Owen or Jonathan or somebody.
> 
> Dan
> 
> 

Hi all,
came up with the approach of using a image in an eventbox instead of the
menuitem. Then I made the left click menu another popup menu.

this means: the left click menu is positioned according to the mouse
pointer (haven't yet found a clever way of finding the absolute position
of an applet in the tray ... otherwise I'd position the menu to mimick a
normal menu) ... also I've not tried to mimick the highlighting or set
the width to 32 pixels (which is of couse easy to do)... I actually like
it when I can conserve space in a panel.

Feedback welcome, the patch is against 5.1

Karl.



--- NetworkManager-0.5.1/gnome/applet/applet.c  2005-10-18 16:51:22.0 
+0200
+++ NetworkManager-0.5.1/gnome/applet/applet.c.khb  2005-12-16 
23:45:45.0 +0100
@@ -1948,7 +1948,7 @@
  * Pop up the wireless networks menu
  *
  */
-static void nmwa_dropdown_menu_show_cb (GtkWidget *menu, NMWirelessApplet 
*applet)
+static void nmwa_dropdown_menu_show_cb (GtkWidget *menu, NMWirelessApplet 
*applet, GdkEventButton *event)
 {
g_return_if_fail (menu != NULL);
g_return_if_fail (applet != NULL);
@@ -1961,7 +1961,9 @@
{
nmwa_dropdown_menu_clear (applet->dropdown_menu);
nmwa_dropdown_menu_populate (applet->dropdown_menu, applet);
-   gtk_widget_show_all (applet->dropdown_menu);
+
+   gtk_menu_popup (GTK_MENU (applet->dropdown_menu), NULL, NULL, 
NULL, NULL,
+event->button, event->time);
}
 
nmi_dbus_signal_user_interface_activated (applet->connection);
@@ -1973,7 +1975,7 @@
  * Create the applet's dropdown menu
  *
  */
-static GtkWidget *nmwa_dropdown_menu_create (GtkMenuItem *parent, 
NMWirelessApplet *applet)
+static GtkWidget *nmwa_dropdown_menu_create (GtkWidget *parent, 
NMWirelessApplet *applet)
 {
GtkWidget   *menu;
 
@@ -1982,8 +1984,6 @@
 
menu = gtk_menu_new ();
gtk_container_set_border_width (GTK_CONTAINER (menu), 0);
-   gtk_menu_item_set_submenu (GTK_MENU_ITEM (parent), menu);
-   g_signal_connect (menu, "show", G_CALLBACK 
(nmwa_dropdown_menu_show_cb), applet);
 
return menu;
 }
@@ -2101,7 +2101,7 @@
if (applet->top_menu_item)
{
gtk_menu_item_remove_submenu (GTK_MENU_ITEM 
(applet->top_menu_item));
-   applet->dropdown_menu = nmwa_dropdown_menu_create 
(GTK_MENU_ITEM (applet->top_menu_item), applet);
+   applet->dropdown_menu = nmwa_dropdown_menu_create (GTK_WIDGET 
(applet->top_menu_item), applet);
}
 }
 
@@ -2117,9 +2117,14 @@
 
g_return_val_if_fail (applet != NULL, FALSE);
 
-   if (event->button != 1)
g_signal_stop_emission_by_name (widget, "button_press_event");
 
+   if (event->button == 1)
+   {
+   nmwa_dropdown_menu_show_cb(applet->dropdown_menu, applet, event 
);
+   return (TRUE);
+   }
+
if (event->button == 3)
{
nmwa_context_menu_update (applet);
@@ -2140,31 +2145,19 @@
  */
 static void nmwa_setup_widgets (NMWirelessApplet *applet)
 {
-   GtkWidget  *menu_bar;
-
-   /* Event box for tooltips */
+   /* Event box not just for tooltips */
applet->event_box = gtk_event_box_new ();
gtk_container_set_border_width (GTK_CONTAINER (applet->event_box), 0);
 
-   menu_bar = gtk_menu_bar_new ();
-
-   applet->top_menu_item = gtk_menu_item_new();
-   gtk_widget_set_name (applet->top_menu_item, "ToplevelMenu");
-   gtk_container_set_border_width (GTK_CONTAINER (applet->top_menu_item), 
0);
-   g_signal_conne

draw applet without theme

2005-12-15 Thread Karl H. Beckers
Hi folks,

thanks for Network Manager ... very cool for my laptop esp. with vpnc
support I've finally dumped the Cisco client.


Some minor thing I'd like to remove for myself:
The applet draws a menubar with a menuitem in it. With the theme I'm
using menubars have a sublte gradient on the lower end. Since the applet
appears in the notification area, however, this looks awkward.

I'd be thankful for a hint as to what functions I need to look for to
make the menubar/menuitem draw with a null theme ... or perhaps there's
a better way of forcing a transparent background like most other
notifications (which admittedly don't draw left click menus).

TIA,

Karl.


___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list