mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 11:00:18 +01:00
tui/edit-connection-list: add routine to recommit connections in a list
This is useful when master connections are saved potentially influencing how slave connections are serialized.
This commit is contained in:
parent
b47340fd3f
commit
8fce72360e
2 changed files with 29 additions and 0 deletions
|
|
@ -319,6 +319,33 @@ listbox_activated (NmtNewtWidget *listbox, gpointer list)
|
|||
edit_clicked (NMT_NEWT_BUTTON (priv->edit), list);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
connection_saved (GObject *conn,
|
||||
GAsyncResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
nm_remote_connection_save_finish (NM_REMOTE_CONNECTION (conn), result, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
nmt_edit_connection_list_recommit (NmtEditConnectionList *list)
|
||||
{
|
||||
NmtEditConnectionListPrivate *priv = NMT_EDIT_CONNECTION_LIST_GET_PRIVATE (list);
|
||||
NMConnection *conn;
|
||||
GSList *iter;
|
||||
|
||||
for (iter = priv->connections; iter; iter = iter->next) {
|
||||
conn = iter->data;
|
||||
|
||||
if ( NM_IS_REMOTE_CONNECTION (conn)
|
||||
&& (nm_remote_connection_get_unsaved (NM_REMOTE_CONNECTION (conn)) == FALSE)) {
|
||||
nm_remote_connection_save_async (NM_REMOTE_CONNECTION (conn),
|
||||
NULL, connection_saved, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
nmt_edit_connection_list_finalize (GObject *object)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -52,4 +52,6 @@ typedef gboolean (*NmtEditConnectionListFilter) (NmtEditConnectionList *list,
|
|||
NMConnection *connection,
|
||||
gpointer user_data);
|
||||
|
||||
void nmt_edit_connection_list_recommit (NmtEditConnectionList *list);
|
||||
|
||||
#endif /* NMT_EDIT_CONNECTION_LIST_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue