Update to 1.2 git snapshot

Add libnma subpackages
Add support for libnm-based properties plugins
This commit is contained in:
Lubomir Rintel 2015-07-15 17:56:07 +02:00
parent 195c54ef2c
commit 767e9be178
5 changed files with 62 additions and 249 deletions

1
.gitignore vendored
View File

@ -23,3 +23,4 @@
/network-manager-applet-1.0.4.git20160702.25368df.tar.bz2
/network-manager-applet-1.0.4.tar.xz
/network-manager-applet-1.0.6.tar.xz
/network-manager-applet-1.2.0.tar.xz

View File

@ -1,40 +1,32 @@
%define gtk3_version 3.0.1
%define glib2_version 2.32.0
%define dbus_version 1.4
%define dbus_glib_version 0.100
%define nm_version 1:1.0.0
%define obsoletes_ver 1:0.9.7
%define snapshot %{nil}
%define realversion 1.0.6
%define snapshot .20150903git807cbdf
Name: network-manager-applet
Summary: A network control and status applet for NetworkManager
Version: %{realversion}
Release: 4%{snapshot}%{?dist}
Version: 1.2.0
Release: 0.1%{?snapshot}%{?dist}
Group: Applications/System
License: GPLv2+
URL: http://www.gnome.org/projects/NetworkManager/
Obsoletes: NetworkManager-gnome < %{obsoletes_ver}
Source: https://download.gnome.org/sources/network-manager-applet/1.0/%{name}-%{realversion}%{snapshot}.tar.xz
Source: https://download.gnome.org/sources/network-manager-applet/1.2/%{name}-%{version}.tar.xz
Patch0: nm-applet-no-notifications.patch
Patch1: rh1254043-applet-password-crash.patch
Patch2: rh1247885-tooltip-for-connect-button.patch
Requires: NetworkManager >= %{nm_version}
Requires: NetworkManager-glib >= %{nm_version}
Requires: libnm-gtk = %{version}-%{release}
Requires: dbus >= 1.4
Requires: dbus-glib >= 0.100
Requires: libnma%{?_isa} = %{version}-%{release}
Requires: libnotify >= 0.4.3
Requires: nm-connection-editor = %{version}-%{release}
BuildRequires: NetworkManager-devel >= %{nm_version}
BuildRequires: NetworkManager-glib-devel >= %{nm_version}
BuildRequires: NetworkManager-libnm-devel >= %{nm_version}
BuildRequires: ModemManager-glib-devel >= 1.0
BuildRequires: dbus-devel >= %{dbus_version}
BuildRequires: dbus-glib-devel >= %{dbus_glib_version}
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: gtk3-devel >= %{gtk3_version}
BuildRequires: libsecret-devel
@ -57,9 +49,7 @@ for use with NetworkManager.
%package -n nm-connection-editor
Summary: A network connection configuration editor for NetworkManager
Requires: NetworkManager-glib >= %{nm_version}
Requires: libnm-gtk = %{version}-%{release}
Requires: dbus >= 1.4
Requires: dbus-glib >= 0.94
Requires: libnma%{?_isa} = %{version}-%{release}
Requires(post): /usr/bin/gtk-update-icon-cache
%description -n nm-connection-editor
@ -90,14 +80,41 @@ Requires: pkgconfig
%description -n libnm-gtk-devel
This package contains private header and pkg-config files to be used only by
GNOME control center.
This package is obsoleted by libnma.
%package -n libnma
Summary: Private libraries for NetworkManager GUI support
Group: Development/Libraries
Requires: gtk3 >= %{gtk3_version}
Requires: mobile-broadband-provider-info >= 0.20090602
Obsoletes: NetworkManager-gtk < %{obsoletes_ver}
%description -n libnma
This package contains private libraries to be used only by nm-applet,
nm-connection editor, and the GNOME Control Center.
%package -n libnma-devel
Summary: Private header files for NetworkManager GUI support
Group: Development/Libraries
Requires: NetworkManager-devel >= %{nm_version}
Requires: NetworkManager-libnm-devel >= %{nm_version}
Obsoletes: NetworkManager-gtk-devel < %{obsoletes_ver}
Requires: libnma = %{version}-%{release}
Requires: gtk3-devel
Requires: pkgconfig
%description -n libnma-devel
This package contains private header and pkg-config files to be used only by
nm-applet, nm-connection-editor, and the GNOME control center.
This package deprecates libnm-gtk.
%prep
%setup -q -n network-manager-applet-%{realversion}
%setup -q
%patch0 -p1 -b .no-notifications
%patch1 -p1 -b .rh1254043-applet-password-crash
%patch2 -p1
%build
autoreconf -i -f
@ -157,7 +174,6 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || :
%files
%defattr(-,root,root,0755)
%doc COPYING NEWS AUTHORS README CONTRIBUTING
%dir %{_datadir}/nm-applet
%{_bindir}/nm-applet
%{_datadir}/applications/nm-applet.desktop
@ -177,6 +193,8 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || :
%{_datadir}/GConf/gsettings/nm-applet.convert
%{_sysconfdir}/xdg/autostart/nm-applet.desktop
%{_mandir}/man1/nm-applet*
%doc NEWS AUTHORS README CONTRIBUTING
%license COPYING
# Yes, lang files for the applet go in nm-connection-editor RPM since it
# is the RPM that everything else depends on
@ -211,7 +229,28 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || :
%{_libdir}/libnm-gtk.so
%{_datadir}/gir-1.0/NMGtk-1.0.gir
%files -n libnma
%defattr(-,root,root,0755)
%{_libdir}/libnma.so.*
%dir %{_datadir}/libnma
%{_datadir}/libnma/*.ui
%{_libdir}/girepository-1.0/NMA-1.0.typelib
%files -n libnma-devel
%defattr(-,root,root,0755)
%dir %{_includedir}/libnma
%{_includedir}/libnma/*.h
%{_libdir}/pkgconfig/libnma.pc
%{_libdir}/libnma.so
%{_datadir}/gir-1.0/NMA-1.0.gir
%changelog
* Thu Sep 3 2015 Lubomir Rintel <lkundrak@v3.sk> - 1.2.0-0.1.20150903git807cbdf
- Update to 1.2 git snapshot:
- Add libnma subpackages
- Add support for libnm-based properties plugins
* Wed Sep 2 2015 Thomas Haller <thaller@redhat.com> - 1.0.6-4
- show tooltip when connect button is disabled due to invalid connection (rh #1247885)

View File

@ -1,147 +0,0 @@
From 065c32650a324527d56b810ac3eafb4638868f2a Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Tue, 1 Sep 2015 15:40:15 +0200
Subject: [PATCH 1/1] wifi-dialog: add tooltip to password dialog to help with
disabled "Connect" button
If the connection is invalid, the "Connect" button in the Wi-Fi password
dialog stays disabled and makes it hard for the user to understand the
reason.
Especially when connecting to certain EAP-typed Wi-Fi connections, the
connection might have no CA certificate set. However, if the connection
was not previously edited with nm-connection-editor, the connection is
considered invalid by nm-applet because "No CA certificate is required"
is unchecked.
As this flag is only stored in the gsetting of the user, NetworkManager
and nm-applet disagree about whether the connection is valid.
Add a tooltip to the connect button to indicate to the user that the
connection must be modified first.
Steps to reproduce:
- create a Wi-Fi connection of type EAP (PEAP, TLS, or TTLS) outside
of nm-applet/nm-connection-editor. Or alternatively, clear the
gsettings entry with:
dconf reset -f /org/gnome/nm-applet/eap/
- try to connect to the Wi-Fi. Note that the "Connect" button of the
password dialog is diabled (just like the "Save" button in nm-ce).
https://bugzilla.gnome.org/show_bug.cgi?id=754172
https://bugzilla.redhat.com/show_bug.cgi?id=1247885
(cherry picked from commit 53e801f362fefa52d0f538f530be91c8140e5e7b)
(cherry picked from commit 74759ef83d4db81156abe33b4e500fb0fa59e8d3)
---
src/libnm-gtk/nm-wifi-dialog.c | 45 ++++++++++++++++++++++++++++++++++--------
1 file changed, 37 insertions(+), 8 deletions(-)
diff --git a/src/libnm-gtk/nm-wifi-dialog.c b/src/libnm-gtk/nm-wifi-dialog.c
index ace323b..48310b0 100644
--- a/src/libnm-gtk/nm-wifi-dialog.c
+++ b/src/libnm-gtk/nm-wifi-dialog.c
@@ -67,6 +67,7 @@ typedef struct {
GtkTreeModel *connection_model;
GtkSizeGroup *group;
GtkWidget *sec_combo;
+ GtkWidget *ok_response_button;
gboolean network_name_focus;
@@ -125,6 +126,32 @@ size_group_clear (GtkSizeGroup *group)
}
static void
+_set_response_sensitive (NMAWifiDialog *self,
+ int response_id,
+ gboolean is_sensitive)
+{
+ switch (response_id) {
+ case GTK_RESPONSE_CANCEL:
+ case GTK_RESPONSE_OK:
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (self), response_id, is_sensitive);
+
+ if (response_id == GTK_RESPONSE_OK) {
+ NMAWifiDialogPrivate *priv = NMA_WIFI_DIALOG_GET_PRIVATE (self);
+
+ if (priv->ok_response_button) {
+ gtk_widget_set_tooltip_text (priv->ok_response_button,
+ is_sensitive
+ ? _("Click to connect")
+ : _("Either a password is missing or the connection is invalid. In the latter case, you have to edit the connection with nm-connection-editor first"));
+ }
+ }
+ break;
+ default:
+ g_return_if_reached ();
+ }
+}
+
+static void
size_group_add_permanent (GtkSizeGroup *group,
GtkBuilder *builder)
{
@@ -273,7 +300,7 @@ stuff_changed_cb (WirelessSecurity *sec, gpointer user_data)
if (priv->secrets_info)
valid = FALSE;
- gtk_dialog_set_response_sensitive (GTK_DIALOG (self), GTK_RESPONSE_OK, valid);
+ _set_response_sensitive (self, GTK_RESPONSE_OK, valid);
}
static void
@@ -315,7 +342,7 @@ out:
if (priv->secrets_info)
valid = FALSE;
- gtk_dialog_set_response_sensitive (GTK_DIALOG (self), GTK_RESPONSE_OK, valid);
+ _set_response_sensitive (self, GTK_RESPONSE_OK, valid);
}
static void
@@ -752,8 +779,8 @@ get_secrets_cb (NMRemoteConnection *connection,
/* Buttons should only be re-enabled if this secrets response is the
* in-progress one.
*/
- gtk_dialog_set_response_sensitive (GTK_DIALOG (info->self), GTK_RESPONSE_CANCEL, TRUE);
- gtk_dialog_set_response_sensitive (GTK_DIALOG (info->self), GTK_RESPONSE_OK, TRUE);
+ _set_response_sensitive (info->self, GTK_RESPONSE_CANCEL, TRUE);
+ _set_response_sensitive (info->self, GTK_RESPONSE_OK, TRUE);
}
if (error) {
@@ -984,8 +1011,8 @@ security_combo_init (NMAWifiDialog *self, gboolean secrets_only)
/* Desensitize the dialog's buttons while we wait for the secrets
* operation to complete.
*/
- gtk_dialog_set_response_sensitive (GTK_DIALOG (self), GTK_RESPONSE_OK, FALSE);
- gtk_dialog_set_response_sensitive (GTK_DIALOG (self), GTK_RESPONSE_CANCEL, FALSE);
+ _set_response_sensitive (self, GTK_RESPONSE_OK, FALSE);
+ _set_response_sensitive (self, GTK_RESPONSE_CANCEL, FALSE);
info = g_malloc0 (sizeof (GetSecretsInfo));
info->self = self;
@@ -1054,8 +1081,10 @@ internal_init (NMAWifiDialog *self,
gtk_widget_show (widget);
gtk_dialog_add_action_widget (GTK_DIALOG (self), widget, GTK_RESPONSE_OK);
- } else
+ } else {
widget = gtk_dialog_add_button (GTK_DIALOG (self), GTK_STOCK_CONNECT, GTK_RESPONSE_OK);
+ priv->ok_response_button = widget;
+ }
gtk_box_set_child_packing (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (self))), widget,
FALSE, TRUE, 0, GTK_PACK_END);
@@ -1087,7 +1116,7 @@ internal_init (NMAWifiDialog *self,
priv->network_name_focus = TRUE;
}
- gtk_dialog_set_response_sensitive (GTK_DIALOG (self), GTK_RESPONSE_OK, FALSE);
+ _set_response_sensitive (self, GTK_RESPONSE_OK, FALSE);
if (!device_combo_init (self, specific_device)) {
g_warning ("No Wi-Fi devices available.");
--
2.4.3

View File

@ -1,80 +0,0 @@
From 6ee38dd8fb792a944ea597c9eba21f382d9c4836 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
Date: Mon, 31 Aug 2015 15:42:13 +0200
Subject: [PATCH] libnm-gtk: fix a possible crash on widgets destroy (rh
#1254043)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
https://bugzilla.redhat.com/show_bug.cgi?id=1254043
(cherry picked from commit 0d0e84316f5db87b4909f09060c596dfe48a69e7)
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
src/libnm-gtk/nm-ui-utils.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/src/libnm-gtk/nm-ui-utils.c b/src/libnm-gtk/nm-ui-utils.c
index 9119deb..138bbea 100644
--- a/src/libnm-gtk/nm-ui-utils.c
+++ b/src/libnm-gtk/nm-ui-utils.c
@@ -730,13 +730,13 @@ typedef struct {
} PopupMenuItemInfo;
static void
-popup_menu_item_info_destroy (gpointer data)
+popup_menu_item_info_destroy (gpointer data, GClosure *closure)
{
PopupMenuItemInfo *info = (PopupMenuItemInfo *) data;
if (info->setting)
g_object_unref (info->setting);
- g_slice_free (PopupMenuItemInfo, data);
+ g_slice_free (PopupMenuItemInfo, info);
}
static void
@@ -824,11 +824,8 @@ nma_utils_setup_password_storage (GtkWidget *passwd_entry,
if (with_not_required)
gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), item[3]);
- if (setting)
- g_object_ref (setting);
-
info = g_slice_new0 (PopupMenuItemInfo);
- info->setting = setting;
+ info->setting = setting ? g_object_ref (setting) : NULL;
info->password_flags_name = password_flags_name;
info->item_number = ITEM_STORAGE_USER;
info->passwd_entry = passwd_entry;
@@ -838,7 +835,7 @@ nma_utils_setup_password_storage (GtkWidget *passwd_entry,
(GClosureNotify) popup_menu_item_info_destroy, 0);
info = g_slice_new0 (PopupMenuItemInfo);
- info->setting = setting;
+ info->setting = setting ? g_object_ref (setting) : NULL;
info->password_flags_name = password_flags_name;
info->item_number = ITEM_STORAGE_SYSTEM;
info->passwd_entry = passwd_entry;
@@ -848,7 +845,7 @@ nma_utils_setup_password_storage (GtkWidget *passwd_entry,
(GClosureNotify) popup_menu_item_info_destroy, 0);
info = g_slice_new0 (PopupMenuItemInfo);
- info->setting = setting;
+ info->setting = setting ? g_object_ref (setting) : NULL;
info->password_flags_name = password_flags_name;
info->item_number = ITEM_STORAGE_ASK;
info->passwd_entry = passwd_entry;
@@ -860,7 +857,7 @@ nma_utils_setup_password_storage (GtkWidget *passwd_entry,
if (with_not_required) {
info = g_slice_new0 (PopupMenuItemInfo);
- info->setting = setting;
+ info->setting = setting ? g_object_ref (setting) : NULL;
info->password_flags_name = password_flags_name;
info->item_number = ITEM_STORAGE_UNUSED;
info->passwd_entry = passwd_entry;
--
2.1.0

View File

@ -1 +1 @@
dbdead7c5838e422d4b80565b7657a2a network-manager-applet-1.0.6.tar.xz
eff6f0f4b2505ced877e1e6c2e49065a network-manager-applet-1.2.0.tar.xz