Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] VPN menu #3

Closed
nbvcxz opened this issue May 15, 2016 · 20 comments
Closed

[Request] VPN menu #3

nbvcxz opened this issue May 15, 2016 · 20 comments

Comments

@nbvcxz
Copy link

nbvcxz commented May 15, 2016

As nm-tray is great small piece of software, please keep in mind to add the vpn feature for this eg. start stop preconfigured vpn (as already in gtk version). (thumbsup) #

@palinek
Copy link
Owner

palinek commented May 16, 2016

Fair request, but as you can see nm-tray is still in some kind of "proof of concept" phase and there are many other "core" things to do/polish. So I think the VPN stuff will not be added in soon future.

@nbvcxz
Copy link
Author

nbvcxz commented May 16, 2016

In fact it's quite nice working as "proof of concept". I just started using it and it's ok. Know you have the schedule for features, but try to include VPN after most important features.

@palinek
Copy link
Owner

palinek commented Sep 12, 2016

vpn feature for this eg. start stop preconfigured vpn (as already in gtk version)

@nbvcxz I don't use VPNs configured by NetworkManager... but do you have a preconfigured VPN connection? Did you try to activate it by (double)clicking on the treeview "All information" in "Debug information" dialog?

@nbvcxz
Copy link
Author

nbvcxz commented Sep 16, 2016

I got preconfigured (with NetwokManager) and saved VPN connection setup. It is visible in Debug information → All information → connection(s), but double clicking at it has no action (single or any other too). When I am connected to VPN it is "connection list" (left click on tray icon) at the top of available wifi networks. Clicking it disconnects as supposed to be.

@palinek
Copy link
Owner

palinek commented Oct 2, 2017

@nbvcxz can you try the same procedure as above with the ef92c06? Does it make any change?

@palinek
Copy link
Owner

palinek commented Oct 5, 2017

I believe, this is fixed in current master. If not, please, reopen ...

@palinek palinek closed this as completed Oct 5, 2017
@nbvcxz
Copy link
Author

nbvcxz commented Oct 5, 2017

Sorry for very late answer. I just now have been able to compile and test the latest code. So now it is quite fine (not perfect, but enough to use it). The VPN connections are displayed in the list. The one drawback is: the connection list is wrapped into 2 columns and it is placed right-top of display. But the functionality is OK. Summarizing: confirmed VPN menu works !!

@palinek
Copy link
Owner

palinek commented Oct 5, 2017

@nbvcxz Great...thanks for testing.

The one drawback is: the connection list is wrapped into 2 columns

All the "menu lists" (active connections, wifis, connections) show up to 10 (hardcoded) items... Is this too much? Or should we make that configurable?

@nbvcxz
Copy link
Author

nbvcxz commented Oct 5, 2017

Looks a bit odd here, but works fine. ;)
nm-tray_menu

@nbvcxz
Copy link
Author

nbvcxz commented Oct 5, 2017

Seems it looks fine with lower number of Wifi items in menu. Here at another laptop:
nm-tray_menu_breeze
But also with another qt-theme (kvantum), gtk: breeze-gtk and LXQT Plasma theme. It can also make a difference.
And last thing: great work - you created fully functional and nice replacement for network-manager-applet in pure QT5 !!

@palinek
Copy link
Owner

palinek commented Oct 5, 2017

Huh... it seems like some Qt style engines (like kvantum here) aren't using/painting the text of menu separators.

@tsujan can you, please, have a look on this? Should/must the style engine use the text of "separator" QAction in QMenu?

@tsujan
Copy link

tsujan commented Oct 5, 2017

@palinek I haven't seen a Qt style engine that shows the text of a menu separator. Kvantum can draw a separator but just shows an empty space if the separator SVG element isn't present (that's the case in all themes that come with Kvantum -- menus are more elegant with spaces instead of separators, IMO).

All Qt styles show menu titles though (as in LXQt Panel right-click menu or some KDE menus).

@tsujan
Copy link

tsujan commented Oct 5, 2017

BTW, a menu title is a toolbutton whose parent is the menu. isDown() is true for it and its toolButtonStyle() is Qt::ToolButtonTextBesideIcon.

@palinek
Copy link
Owner

palinek commented Oct 6, 2017

I haven't seen a Qt style engine that shows the text of a menu separator.

Funny...I just tested the fusion & breeze and both were painting the text.

@palinek
Copy link
Owner

palinek commented Oct 6, 2017

Heh... my mistake.... I wrote about separator... but thought of a section QAction *QMenu::addSection(const QString &text)

But as the doc says The rendering of the hint is style and platform dependent. Widget styles can use the text information in the rendering for sections, or can choose to ignore it and render sections like simple separators. .... I need to use something else to force painting the text.

@tsujan
Copy link

tsujan commented Oct 6, 2017

I need to use something else to force painting the text.

There are various ways to do so. For example:

    QLabel *l = new QLabel("<center><b><i>A Title</i></b></center>");
    QWidgetAction *sep = new QWidgetAction(myMenu);
    sep->setDefaultWidget(l);
    myMenu->insertAction(thisItem, sep);

Which results in something like this:

menu_title

@nbvcxz
Copy link
Author

nbvcxz commented Oct 7, 2017

Just to confirm - now r67.443b117-1 everything looks fine. Great work !! And IMO it's time for 1.00 release as it is fully functional now.

@baptx
Copy link

baptx commented Oct 22, 2018

Is it normal that it is not possible to add a VPN using nm-tray (it is not listed in "Edit connections" when we click on "Add" so we have to use nm-connection-editor) and to connect to a VPN using nm-tray, the program nm-applet has to run in background?
By the way, is there a Qt graphical interface planned to edit connections? At the moment when we click on "Edit connections", a terminal-based interface nmtui is called, which is less user-friendly.
I tested on Lubuntu 18.10, it comes with nm-tray version 0.4.1.

@palinek
Copy link
Owner

palinek commented Oct 23, 2018

it is not listed in "Edit connections" when we click on "Add" so we have to use nm-connection-editor

As you stated later, nm-tray doesn't have the ability to edit connections, it uses external program (the external command can be configured in $XDG_HOME/nm-tray/nm-tray.conf). So if you are lacking any functionality in the external tool, please, report it there.

the program nm-applet has to run in background?

No it doesn't need to be run.

By the way, is there a Qt graphical interface planned to edit connections?

There is an open issue about that -> #23

@wxl
Copy link

wxl commented Feb 3, 2020

Just wanted to add a little note to that last comment that the external command can be configured in $XDG_CONFIG_{DIRS,HOME}/nm-tray/nm-tray.conf since QSettings is being used and since it uses these dirs by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants