Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NetworkManager-l2tp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CeRiAl
NetworkManager-l2tp
Commits
06c2ffd8
Commit
06c2ffd8
authored
Jan 19, 2012
by
Сергей Прохоров
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update UI equal to nm-pptp 0.9.0
parent
eacea0ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
447 additions
and
422 deletions
+447
-422
nm-l2tp-dialog.ui
properties/nm-l2tp-dialog.ui
+270
-289
nm-l2tp.c
properties/nm-l2tp.c
+177
-133
No files found.
properties/nm-l2tp-dialog.ui
View file @
06c2ffd8
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<interface>
<requires
lib=
"gtk+"
version=
"2.16"
/>
<requires
lib=
"gtk+"
version=
"2.16"
/>
<!-- interface-naming-policy project-wide -->
<object
class=
"GtkDialog"
id=
"l2tp-advanced-dialog"
>
<object
class=
"GtkDialog"
id=
"l2tp-advanced-dialog"
>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"border_width"
>
5
</property>
<property
name=
"border_width"
>
5
</property>
...
@@ -12,12 +11,12 @@
...
@@ -12,12 +11,12 @@
<property
name=
"type_hint"
>
dialog
</property>
<property
name=
"type_hint"
>
dialog
</property>
<property
name=
"skip_pager_hint"
>
True
</property>
<property
name=
"skip_pager_hint"
>
True
</property>
<child
internal-child=
"vbox"
>
<child
internal-child=
"vbox"
>
<object
class=
"Gtk
V
Box"
id=
"dialog-vbox3"
>
<object
class=
"GtkBox"
id=
"dialog-vbox3"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"spacing"
>
2
</property>
<property
name=
"spacing"
>
2
</property>
<child
internal-child=
"action_area"
>
<child
internal-child=
"action_area"
>
<object
class=
"Gtk
H
ButtonBox"
id=
"dialog-action_area3"
>
<object
class=
"GtkButtonBox"
id=
"dialog-action_area3"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"layout_style"
>
end
</property>
<property
name=
"layout_style"
>
end
</property>
...
@@ -112,13 +111,15 @@
...
@@ -112,13 +111,15 @@
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"hscrollbar_policy"
>
never
</property>
<property
name=
"hscrollbar_policy"
>
never
</property>
<property
name=
"vscrollbar_policy"
>
automatic
</property>
<property
name=
"shadow_type"
>
in
</property>
<property
name=
"shadow_type"
>
in
</property>
<child>
<child>
<object
class=
"GtkTreeView"
id=
"ppp_auth_methods"
>
<object
class=
"GtkTreeView"
id=
"ppp_auth_methods"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"headers_visible"
>
False
</property>
<property
name=
"headers_visible"
>
False
</property>
<child
internal-child=
"selection"
>
<object
class=
"GtkTreeSelection"
id=
"treeview-selection1"
/>
</child>
</object>
</object>
</child>
</child>
</object>
</object>
...
@@ -450,12 +451,12 @@
...
@@ -450,12 +451,12 @@
<property
name=
"type_hint"
>
dialog
</property>
<property
name=
"type_hint"
>
dialog
</property>
<property
name=
"skip_pager_hint"
>
True
</property>
<property
name=
"skip_pager_hint"
>
True
</property>
<child
internal-child=
"vbox"
>
<child
internal-child=
"vbox"
>
<object
class=
"Gtk
V
Box"
id=
"dialog-vbox2"
>
<object
class=
"GtkBox"
id=
"dialog-vbox2"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"spacing"
>
2
</property>
<property
name=
"spacing"
>
2
</property>
<child
internal-child=
"action_area"
>
<child
internal-child=
"action_area"
>
<object
class=
"Gtk
H
ButtonBox"
id=
"dialog-action_area2"
>
<object
class=
"GtkButtonBox"
id=
"dialog-action_area2"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"layout_style"
>
end
</property>
<property
name=
"layout_style"
>
end
</property>
...
@@ -563,8 +564,6 @@
...
@@ -563,8 +564,6 @@
<property
name=
"invisible_char"
>
●
</property>
<property
name=
"invisible_char"
>
●
</property>
<property
name=
"primary_icon_activatable"
>
False
</property>
<property
name=
"primary_icon_activatable"
>
False
</property>
<property
name=
"secondary_icon_activatable"
>
False
</property>
<property
name=
"secondary_icon_activatable"
>
False
</property>
<property
name=
"primary_icon_sensitive"
>
True
</property>
<property
name=
"secondary_icon_sensitive"
>
True
</property>
</object>
</object>
<packing>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"left_attach"
>
1
</property>
...
@@ -579,8 +578,6 @@
...
@@ -579,8 +578,6 @@
<property
name=
"invisible_char"
>
●
</property>
<property
name=
"invisible_char"
>
●
</property>
<property
name=
"primary_icon_activatable"
>
False
</property>
<property
name=
"primary_icon_activatable"
>
False
</property>
<property
name=
"secondary_icon_activatable"
>
False
</property>
<property
name=
"secondary_icon_activatable"
>
False
</property>
<property
name=
"primary_icon_sensitive"
>
True
</property>
<property
name=
"secondary_icon_sensitive"
>
True
</property>
</object>
</object>
<packing>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"left_attach"
>
1
</property>
...
@@ -598,8 +595,6 @@
...
@@ -598,8 +595,6 @@
<property
name=
"invisible_char"
>
●
</property>
<property
name=
"invisible_char"
>
●
</property>
<property
name=
"primary_icon_activatable"
>
False
</property>
<property
name=
"primary_icon_activatable"
>
False
</property>
<property
name=
"secondary_icon_activatable"
>
False
</property>
<property
name=
"secondary_icon_activatable"
>
False
</property>
<property
name=
"primary_icon_sensitive"
>
True
</property>
<property
name=
"secondary_icon_sensitive"
>
True
</property>
</object>
</object>
<packing>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"left_attach"
>
1
</property>
...
@@ -623,362 +618,348 @@
...
@@ -623,362 +618,348 @@
<action-widget
response=
"-5"
>
ipsec_ok_button
</action-widget>
<action-widget
response=
"-5"
>
ipsec_ok_button
</action-widget>
</action-widgets>
</action-widgets>
</object>
</object>
<object
class=
"GtkWindow"
id=
"l2tp-widget"
>
<object
class=
"GtkVBox"
id=
"l2tp-vbox"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"title"
translatable=
"yes"
>
window1
</property>
<property
name=
"border_width"
>
12
</property>
<property
name=
"spacing"
>
16
</property>
<child>
<child>
<object
class=
"GtkVBox"
id=
"
l2tp-vbox
"
>
<object
class=
"GtkVBox"
id=
"
vbox8
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"border_width"
>
12
</property>
<property
name=
"spacing"
>
6
</property>
<property
name=
"spacing"
>
16
</property>
<child>
<child>
<object
class=
"Gtk
VBox"
id=
"vbox8
"
>
<object
class=
"Gtk
Label"
id=
"label22
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"
spacing"
>
6
</property>
<property
name=
"
xalign"
>
0
</property>
<
child
>
<
property
name=
"label"
translatable=
"yes"
>
<
b
>
General
<
/b
>
</property
>
<object
class=
"GtkLabel"
id=
"label22"
>
<property
name=
"use_markup"
>
True
</property
>
<property
name=
"visible"
>
True
</property
>
</object
>
<property
name=
"can_focus"
>
False
</property
>
<packing
>
<property
name=
"xalign"
>
0
</property>
<property
name=
"expand"
>
False
</property>
<property
name=
"label"
translatable=
"yes"
>
<
b
>
General
<
/b
>
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"use_markup"
>
True
</property>
<property
name=
"position"
>
0
</property>
</object
>
</packing
>
<packing
>
</child
>
<property
name=
"expand"
>
False
</property
>
<child
>
<property
name=
"fill"
>
False
</property
>
<object
class=
"GtkAlignment"
id=
"alignment8"
>
<property
name=
"position"
>
0
</property>
<property
name=
"visible"
>
True
</property>
</packing
>
<property
name=
"can_focus"
>
False
</property
>
<
/child
>
<
property
name=
"left_padding"
>
12
</property
>
<child>
<child>
<object
class=
"Gtk
Alignment"
id=
"alignment8
"
>
<object
class=
"Gtk
Table"
id=
"table2
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"left_padding"
>
12
</property>
<property
name=
"n_columns"
>
2
</property>
<property
name=
"column_spacing"
>
12
</property>
<property
name=
"row_spacing"
>
6
</property>
<child>
<object
class=
"GtkEntry"
id=
"gateway_entry"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"primary_icon_activatable"
>
False
</property>
<property
name=
"secondary_icon_activatable"
>
False
</property>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"right_attach"
>
2
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<child>
<object
class=
"Gtk
Table"
id=
"table2
"
>
<object
class=
"Gtk
Label"
id=
"label23
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"n_columns"
>
2
</property>
<property
name=
"xalign"
>
0
</property>
<property
name=
"column_spacing"
>
12
</property>
<property
name=
"label"
translatable=
"yes"
>
_Gateway:
</property>
<property
name=
"row_spacing"
>
6
</property>
<property
name=
"use_underline"
>
True
</property>
<child>
<property
name=
"mnemonic_widget"
>
gateway_entry
</property>
<object
class=
"GtkEntry"
id=
"gateway_entry"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"primary_icon_activatable"
>
False
</property>
<property
name=
"secondary_icon_activatable"
>
False
</property>
<property
name=
"primary_icon_sensitive"
>
True
</property>
<property
name=
"secondary_icon_sensitive"
>
True
</property>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"right_attach"
>
2
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"label23"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"xalign"
>
0
</property>
<property
name=
"label"
translatable=
"yes"
>
_Gateway:
</property>
<property
name=
"use_underline"
>
True
</property>
<property
name=
"mnemonic_widget"
>
gateway_entry
</property>
</object>
<packing>
<property
name=
"x_options"
>
GTK_SHRINK | GTK_FILL
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
</object>
</object>
<packing>
<property
name=
"x_options"
>
GTK_SHRINK | GTK_FILL
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
</child>
</object>
</object>
<packing>
<property
name=
"expand"
>
True
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
</child>
</object>
</object>
<packing>
<packing>
<property
name=
"expand"
>
Fals
e
</property>
<property
name=
"expand"
>
Tru
e
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkVBox"
id=
"vbox11"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"spacing"
>
6
</property>
<child>
<object
class=
"GtkLabel"
id=
"label25"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"xalign"
>
0
</property>
<property
name=
"label"
translatable=
"yes"
>
<
b
>
Optional
<
/b
>
</property>
<property
name=
"use_markup"
>
True
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
0
</property>
<property
name=
"position"
>
0
</property>
</packing>
</packing>
</child>
</child>
<child>
<child>
<object
class=
"Gtk
VBox"
id=
"vbox11
"
>
<object
class=
"Gtk
Alignment"
id=
"alignment9
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"
spacing"
>
6
</property>
<property
name=
"
left_padding"
>
12
</property>
<child>
<child>
<object
class=
"Gtk
Label"
id=
"label25
"
>
<object
class=
"Gtk
Table"
id=
"table3
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"xalign"
>
0
</property>
<property
name=
"n_rows"
>
4
</property>
<property
name=
"label"
translatable=
"yes"
>
<
b
>
Optional
<
/b
>
</property>
<property
name=
"n_columns"
>
2
</property>
<property
name=
"use_markup"
>
True
</property>
<property
name=
"column_spacing"
>
12
</property>
<property
name=
"row_spacing"
>
6
</property>
<child>
<object
class=
"GtkEntry"
id=
"domain_entry"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"primary_icon_activatable"
>
False
</property>
<property
name=
"secondary_icon_activatable"
>
False
</property>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"right_attach"
>
2
</property>
<property
name=
"top_attach"
>
3
</property>
<property
name=
"bottom_attach"
>
4
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"label27"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"xalign"
>
0
</property>
<property
name=
"label"
translatable=
"yes"
>
NT Domain:
</property>
</object>
<packing>
<property
name=
"top_attach"
>
3
</property>
<property
name=
"bottom_attach"
>
4
</property>
<property
name=
"x_options"
>
GTK_SHRINK | GTK_FILL
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<object
class=
"GtkCheckButton"
id=
"show_passwords_checkbutton"
>
<property
name=
"label"
translatable=
"yes"
>
Show password
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
False
</property>
<property
name=
"use_action_appearance"
>
False
</property>
<property
name=
"draw_indicator"
>
True
</property>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"right_attach"
>
2
</property>
<property
name=
"top_attach"
>
2
</property>
<property
name=
"bottom_attach"
>
3
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<object
class=
"GtkEntry"
id=
"user_password_entry"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"visibility"
>
False
</property>
<property
name=
"primary_icon_activatable"
>
False
</property>
<property
name=
"secondary_icon_activatable"
>
False
</property>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"right_attach"
>
2
</property>
<property
name=
"top_attach"
>
1
</property>
<property
name=
"bottom_attach"
>
2
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"label3"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"xalign"
>
0
</property>
<property
name=
"label"
translatable=
"yes"
>
Password:
</property>
</object>
<packing>
<property
name=
"top_attach"
>
1
</property>
<property
name=
"bottom_attach"
>
2
</property>
<property
name=
"x_options"
>
GTK_SHRINK | GTK_FILL
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<object
class=
"GtkEntry"
id=
"user_entry"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"primary_icon_activatable"
>
False
</property>
<property
name=
"secondary_icon_activatable"
>
False
</property>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"right_attach"
>
2
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"label26"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"xalign"
>
0
</property>
<property
name=
"label"
translatable=
"yes"
>
User name:
</property>
</object>
<packing>
<property
name=
"x_options"
>
GTK_SHRINK | GTK_FILL
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
</child>
</object>
<packing>
<property
name=
"expand"
>
True
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
<child>
<object
class=
"GtkAlignment"
id=
"alignment1"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"xalign"
>
1
</property>
<property
name=
"xscale"
>
0
</property>
<child>
<object
class=
"GtkHBox"
id=
"hbox1"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<child>
<child>
<object
class=
"Gtk
Alignment"
id=
"alignment9
"
>
<object
class=
"Gtk
Button"
id=
"ipsec_button
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"left_padding"
>
12
</property>
<property
name=
"receives_default"
>
True
</property>
<property
name=
"use_action_appearance"
>
False
</property>
<child>
<child>
<object
class=
"Gtk
Table"
id=
"table
3"
>
<object
class=
"Gtk
HBox"
id=
"hbox
3"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"n_rows"
>
4
</property>
<property
name=
"spacing"
>
6
</property>
<property
name=
"n_columns"
>
2
</property>
<property
name=
"column_spacing"
>
12
</property>
<property
name=
"row_spacing"
>
6
</property>
<child>
<object
class=
"GtkEntry"
id=
"domain_entry"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"primary_icon_activatable"
>
False
</property>
<property
name=
"secondary_icon_activatable"
>
False
</property>
<property
name=
"primary_icon_sensitive"
>
True
</property>
<property
name=
"secondary_icon_sensitive"
>
True
</property>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"right_attach"
>
2
</property>
<property
name=
"top_attach"
>
3
</property>
<property
name=
"bottom_attach"
>
4
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<child>
<object
class=
"Gtk
Label"
id=
"label27
"
>
<object
class=
"Gtk
Image"
id=
"image2
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"xalign"
>
0
</property>
<property
name=
"stock"
>
gtk-preferences
</property>
<property
name=
"label"
translatable=
"yes"
>
NT Domain:
</property>
</object>
<packing>
<property
name=
"top_attach"
>
3
</property>
<property
name=
"bottom_attach"
>
4
</property>
<property
name=
"x_options"
>
GTK_SHRINK | GTK_FILL
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<object
class=
"GtkCheckButton"
id=
"show_passwords_checkbutton"
>
<property
name=
"label"
translatable=
"yes"
>
Show password
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
False
</property>
<property
name=
"use_action_appearance"
>
False
</property>
<property
name=
"draw_indicator"
>
True
</property>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"right_attach"
>
2
</property>
<property
name=
"top_attach"
>
2
</property>
<property
name=
"bottom_attach"
>
3
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<object
class=
"GtkEntry"
id=
"user_password_entry"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"visibility"
>
False
</property>
<property
name=
"primary_icon_activatable"
>
False
</property>
<property
name=
"secondary_icon_activatable"
>
False
</property>
<property
name=
"primary_icon_sensitive"
>
True
</property>
<property
name=
"secondary_icon_sensitive"
>
True
</property>
</object>
</object>
<packing>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"expand"
>
False
</property>
<property
name=
"right_attach"
>
2
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"top_attach"
>
1
</property>
<property
name=
"position"
>
0
</property>
<property
name=
"bottom_attach"
>
2
</property>
<property
name=
"y_options"
></property>
</packing>
</packing>
</child>
</child>
<child>
<child>
<object
class=
"GtkLabel"
id=
"label
3
"
>
<object
class=
"GtkLabel"
id=
"label
5
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"xalign"
>
0
</property>
<property
name=
"label"
translatable=
"yes"
>
_IPsec Settings...
</property>
<property
name=
"label"
translatable=
"yes"
>
Password:
</property>
<property
name=
"use_markup"
>
True
</property>
</object>
<property
name=
"use_underline"
>
True
</property>
<packing>
<property
name=
"top_attach"
>
1
</property>
<property
name=
"bottom_attach"
>
2
</property>
<property
name=
"x_options"
>
GTK_SHRINK | GTK_FILL
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<object
class=
"GtkEntry"
id=
"user_entry"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"primary_icon_activatable"
>
False
</property>
<property
name=
"secondary_icon_activatable"
>
False
</property>
<property
name=
"primary_icon_sensitive"
>
True
</property>
<property
name=
"secondary_icon_sensitive"
>
True
</property>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"right_attach"
>
2
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"label26"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"xalign"
>
0
</property>
<property
name=
"label"
translatable=
"yes"
>
User name:
</property>
</object>
</object>
<packing>
<packing>
<property
name=
"x_options"
>
GTK_SHRINK | GTK_FILL
</property>
<property
name=
"expand"
>
False
</property>
<property
name=
"y_options"
></property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
1
</property>
</packing>
</packing>
</child>
</child>
<child>
<placeholder/>
</child>
</object>
</object>
</child>
</child>
</object>
</object>
<packing>
<packing>
<property
name=
"expand"
>
True
</property>
<property
name=
"expand"
>
True
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
<property
name=
"position"
>
0
</property>
</packing>
</packing>
</child>
</child>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
<child>
<object
class=
"GtkAlignment"
id=
"alignment1"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"xalign"
>
1
</property>
<property
name=
"xscale"
>
0
</property>
<child>
<child>
<object
class=
"Gtk
HBox"
id=
"hbox1
"
>
<object
class=
"Gtk
Button"
id=
"advanced_button
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
True
</property>
<property
name=
"use_action_appearance"
>
False
</property>
<child>
<child>
<object
class=
"Gtk
Button"
id=
"ipsec_button
"
>
<object
class=
"Gtk
HBox"
id=
"hbox4
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"receives_default"
>
True
</property>
<property
name=
"spacing"
>
6
</property>
<property
name=
"use_action_appearance"
>
False
</property>
<child>
<child>
<object
class=
"Gtk
HBox"
id=
"hbox3
"
>
<object
class=
"Gtk
Image"
id=
"image1
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"spacing"
>
6
</property>
<property
name=
"stock"
>
gtk-preferences
</property>
<child>
<object
class=
"GtkImage"
id=
"image2"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"stock"
>
gtk-preferences
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"label5"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"label"
translatable=
"yes"
>
_IPsec Settings...
</property>
<property
name=
"use_markup"
>
True
</property>
<property
name=
"use_underline"
>
True
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
</object>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
</child>
</object>
<packing>
<property
name=
"expand"
>
True
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkButton"
id=
"advanced_button"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
True
</property>
<property
name=
"use_action_appearance"
>
False
</property>
<child>
<child>
<object
class=
"Gtk
HBox"
id=
"hbox4
"
>
<object
class=
"Gtk
Label"
id=
"label6
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"spacing"
>
6
</property>
<property
name=
"label"
translatable=
"yes"
>
PPP Se_ttings...
</property>
<child>
<property
name=
"use_markup"
>
True
</property>
<object
class=
"GtkImage"
id=
"image1"
>
<property
name=
"use_underline"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"stock"
>
gtk-preferences
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"label6"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"label"
translatable=
"yes"
>
PPP Se_ttings...
</property>
<property
name=
"use_markup"
>
True
</property>
<property
name=
"use_underline"
>
True
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
</object>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
</child>
</object>
</object>
<packing>
<property
name=
"expand"
>
True
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
</child>
</object>
</object>
<packing>
<property
name=
"expand"
>
True
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
</child>
</object>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"pack_type"
>
end
</property>
<property
name=
"position"
>
2
</property>
</packing>
</child>
</child>
</object>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"pack_type"
>
end
</property>
<property
name=
"position"
>
2
</property>
</packing>
</child>
</child>
</object>
</object>
<object
class=
"GtkListStore"
id=
"model1"
>
<object
class=
"GtkListStore"
id=
"model1"
>
...
...
properties/nm-l2tp.c
View file @
06c2ffd8
...
@@ -40,8 +40,7 @@
...
@@ -40,8 +40,7 @@
#include <nm-setting-connection.h>
#include <nm-setting-connection.h>
#include <nm-setting-ip4-config.h>
#include <nm-setting-ip4-config.h>
#include "../src/nm-l2tp-service.h"
#include "src/nm-l2tp-service.h"
#include "../common-gnome/keyring-helpers.h"
#include "nm-l2tp.h"
#include "nm-l2tp.h"
#include "import-export.h"
#include "import-export.h"
#include "advanced-dialog.h"
#include "advanced-dialog.h"
...
@@ -80,6 +79,7 @@ typedef struct {
...
@@ -80,6 +79,7 @@ typedef struct {
gboolean
window_added
;
gboolean
window_added
;
GHashTable
*
advanced
;
GHashTable
*
advanced
;
GHashTable
*
ipsec
;
GHashTable
*
ipsec
;
gboolean
new_connection
;
}
L2tpPluginUiWidgetPrivate
;
}
L2tpPluginUiWidgetPrivate
;
...
@@ -218,10 +218,11 @@ advanced_button_clicked_cb (GtkWidget *button, gpointer user_data)
...
@@ -218,10 +218,11 @@ advanced_button_clicked_cb (GtkWidget *button, gpointer user_data)
{
{
L2tpPluginUiWidget
*
self
=
L2TP_PLUGIN_UI_WIDGET
(
user_data
);
L2tpPluginUiWidget
*
self
=
L2TP_PLUGIN_UI_WIDGET
(
user_data
);
L2tpPluginUiWidgetPrivate
*
priv
=
L2TP_PLUGIN_UI_WIDGET_GET_PRIVATE
(
self
);
L2tpPluginUiWidgetPrivate
*
priv
=
L2TP_PLUGIN_UI_WIDGET_GET_PRIVATE
(
self
);
GtkWidget
*
dialog
,
*
toplevel
;
GtkWidget
*
dialog
;
GtkWindow
*
toplevel
;
toplevel
=
gtk_widget_get_toplevel
(
priv
->
widget
);
toplevel
=
gtk_widget_get_toplevel
(
priv
->
widget
);
g_return_if_fail
(
GTK_WIDGET_TOPLEVEL
(
toplevel
));
g_return_if_fail
(
gtk_widget_is_toplevel
(
toplevel
));
dialog
=
advanced_dialog_new
(
priv
->
advanced
);
dialog
=
advanced_dialog_new
(
priv
->
advanced
);
if
(
!
dialog
)
{
if
(
!
dialog
)
{
...
@@ -247,10 +248,11 @@ ipsec_button_clicked_cb (GtkWidget *button, gpointer user_data)
...
@@ -247,10 +248,11 @@ ipsec_button_clicked_cb (GtkWidget *button, gpointer user_data)
{
{
L2tpPluginUiWidget
*
self
=
L2TP_PLUGIN_UI_WIDGET
(
user_data
);
L2tpPluginUiWidget
*
self
=
L2TP_PLUGIN_UI_WIDGET
(
user_data
);
L2tpPluginUiWidgetPrivate
*
priv
=
L2TP_PLUGIN_UI_WIDGET_GET_PRIVATE
(
self
);
L2tpPluginUiWidgetPrivate
*
priv
=
L2TP_PLUGIN_UI_WIDGET_GET_PRIVATE
(
self
);
GtkWidget
*
dialog
,
*
toplevel
;
GtkWidget
*
dialog
;
GtkWindow
*
toplevel
;
toplevel
=
gtk_widget_get_toplevel
(
priv
->
widget
);
toplevel
=
gtk_widget_get_toplevel
(
priv
->
widget
);
g_return_if_fail
(
GTK_WIDGET_TOPLEVEL
(
toplevel
));
g_return_if_fail
(
gtk_widget_is_toplevel
(
toplevel
));
dialog
=
ipsec_dialog_new
(
priv
->
ipsec
);
dialog
=
ipsec_dialog_new
(
priv
->
ipsec
);
if
(
!
dialog
)
{
if
(
!
dialog
)
{
...
@@ -286,65 +288,65 @@ show_toggled_cb (GtkCheckButton *button, L2tpPluginUiWidget *self)
...
@@ -286,65 +288,65 @@ show_toggled_cb (GtkCheckButton *button, L2tpPluginUiWidget *self)
gtk_entry_set_visibility
(
GTK_ENTRY
(
widget
),
visible
);
gtk_entry_set_visibility
(
GTK_ENTRY
(
widget
),
visible
);
}
}
static
GtkWidget
*
/* static GtkWidget * */
fill_password
(
GtkBuilder
*
builder
,
/* fill_password (GtkBuilder *builder, */
const
char
*
widget_name
,
/* const char *widget_name, */
NMConnection
*
connection
,
/* NMConnection *connection, */
const
char
*
password_type
)
/* const char *password_type) */
{
/* { */
GtkWidget
*
widget
=
NULL
;
/* GtkWidget *widget = NULL; */
gchar
*
password
=
NULL
;
/* gchar *password = NULL; */
NMSettingVPN
*
s_vpn
;
/* NMSettingVPN *s_vpn; */
gboolean
unused
;
/* gboolean unused; */
widget
=
GTK_WIDGET
(
gtk_builder_get_object
(
builder
,
widget_name
));
/* widget = GTK_WIDGET (gtk_builder_get_object (builder, widget_name)); */
g_assert
(
widget
);
/* g_assert (widget); */
if
(
!
connection
)
/* if (!connection) */
return
widget
;
/* return widget; */
/* Try the connection first
*/
/* /\* Try the connection first *\/
*/
s_vpn
=
(
NMSettingVPN
*
)
nm_connection_get_setting
(
connection
,
NM_TYPE_SETTING_VPN
);
/* s_vpn = (NMSettingVPN *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN); */
if
(
s_vpn
)
{
/* if (s_vpn) { */
const
gchar
*
tmp
=
NULL
;
/* const gchar *tmp = NULL; */
tmp
=
nm_setting_vpn_get_secret
(
s_vpn
,
password_type
);
/* tmp = nm_setting_vpn_get_secret (s_vpn, password_type); */
if
(
tmp
)
/* if (tmp) */
password
=
gnome_keyring_memory_strdup
(
tmp
);
/* password = gnome_keyring_memory_strdup (tmp); */
}
/* } */
if
(
!
password
)
{
/* if (!password) { */
password
=
keyring_helpers_lookup_secret
(
nm_connection_get_uuid
(
connection
),
/* password = keyring_helpers_lookup_secret (nm_connection_get_uuid (connection), */
password_type
,
/* password_type, */
&
unused
);
/* &unused); */
}
/* } */
if
(
password
)
{
/* if (password) { */
gtk_entry_set_text
(
GTK_ENTRY
(
widget
),
password
);
/* gtk_entry_set_text (GTK_ENTRY (widget), password); */
gnome_keyring_memory_free
(
password
);
/* gnome_keyring_memory_free (password); */
}
/* } */
return
widget
;
/* return widget; */
}
/* } */
static
void
/* static void */
fill_vpn_passwords
(
GtkBuilder
*
builder
,
/* fill_vpn_passwords (GtkBuilder *builder, */
GtkSizeGroup
*
group
,
/* GtkSizeGroup *group, */
NMConnection
*
connection
,
/* NMConnection *connection, */
ChangedCallback
changed_cb
,
/* ChangedCallback changed_cb, */
gpointer
user_data
)
/* gpointer user_data) */
{
/* { */
GtkWidget
*
w
=
NULL
;
/* GtkWidget *w = NULL; */
w
=
fill_password
(
builder
,
"user_password_entry"
,
connection
,
NM_L2TP_KEY_PASSWORD
);
/* w = fill_password (builder, "user_password_entry", connection, NM_L2TP_KEY_PASSWORD); */
if
(
w
)
{
/* if (w) { */
gtk_size_group_add_widget
(
group
,
w
);
/* gtk_size_group_add_widget (group, w); */
g_signal_connect
(
w
,
"changed"
,
G_CALLBACK
(
changed_cb
),
user_data
);
/* g_signal_connect (w, "changed", G_CALLBACK (changed_cb), user_data); */
}
else
{
/* } else { */
g_error
(
"No userbuilder in GtkBuilder file!"
);
/* g_error ("No userbuilder in GtkBuilder file!"); */
}
/* } */
}
/* } */
static
gboolean
static
gboolean
init_plugin_ui
(
L2tpPluginUiWidget
*
self
,
NMConnection
*
connection
,
GError
**
error
)
init_plugin_ui
(
L2tpPluginUiWidget
*
self
,
NMConnection
*
connection
,
GError
**
error
)
...
@@ -353,6 +355,7 @@ init_plugin_ui (L2tpPluginUiWidget *self, NMConnection *connection, GError **err
...
@@ -353,6 +355,7 @@ init_plugin_ui (L2tpPluginUiWidget *self, NMConnection *connection, GError **err
NMSettingVPN
*
s_vpn
;
NMSettingVPN
*
s_vpn
;
GtkWidget
*
widget
;
GtkWidget
*
widget
;
const
char
*
value
;
const
char
*
value
;
NMSettingSecretFlags
pw_flags
=
NM_SETTING_SECRET_FLAG_NONE
;
s_vpn
=
(
NMSettingVPN
*
)
nm_connection_get_setting
(
connection
,
NM_TYPE_SETTING_VPN
);
s_vpn
=
(
NMSettingVPN
*
)
nm_connection_get_setting
(
connection
,
NM_TYPE_SETTING_VPN
);
...
@@ -403,7 +406,23 @@ init_plugin_ui (L2tpPluginUiWidget *self, NMConnection *connection, GError **err
...
@@ -403,7 +406,23 @@ init_plugin_ui (L2tpPluginUiWidget *self, NMConnection *connection, GError **err
(
GCallback
)
show_toggled_cb
,
(
GCallback
)
show_toggled_cb
,
self
);
self
);
fill_vpn_passwords
(
priv
->
builder
,
priv
->
group
,
connection
,
stuff_changed_cb
,
self
);
widget
=
(
GtkWidget
*
)
gtk_builder_get_object
(
priv
->
builder
,
"user_password_entry"
);
g_assert
(
widget
);
gtk_size_group_add_widget
(
priv
->
group
,
widget
);
if
(
s_vpn
)
{
value
=
nm_setting_vpn_get_secret
(
s_vpn
,
NM_L2TP_KEY_PASSWORD
);
if
(
value
)
gtk_entry_set_text
(
GTK_ENTRY
(
widget
),
value
);
/* Default to agent-owned for new connections */
if
(
priv
->
new_connection
)
pw_flags
=
NM_SETTING_SECRET_FLAG_AGENT_OWNED
;
else
nm_setting_get_secret_flags
(
NM_SETTING
(
s_vpn
),
NM_L2TP_KEY_PASSWORD
,
&
pw_flags
,
NULL
);
g_object_set_data
(
G_OBJECT
(
widget
),
"flags"
,
GUINT_TO_POINTER
(
pw_flags
));
}
g_signal_connect
(
widget
,
"changed"
,
G_CALLBACK
(
stuff_changed_cb
),
self
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -436,6 +455,7 @@ update_connection (NMVpnPluginUiWidgetInterface *iface,
...
@@ -436,6 +455,7 @@ update_connection (NMVpnPluginUiWidgetInterface *iface,
GtkWidget
*
widget
;
GtkWidget
*
widget
;
const
char
*
str
;
const
char
*
str
;
gboolean
valid
=
FALSE
;
gboolean
valid
=
FALSE
;
NMSettingSecretFlags
pw_flags
;
if
(
!
check_validity
(
self
,
error
))
if
(
!
check_validity
(
self
,
error
))
return
FALSE
;
return
FALSE
;
...
@@ -455,6 +475,16 @@ update_connection (NMVpnPluginUiWidgetInterface *iface,
...
@@ -455,6 +475,16 @@ update_connection (NMVpnPluginUiWidgetInterface *iface,
if
(
str
&&
strlen
(
str
))
if
(
str
&&
strlen
(
str
))
nm_setting_vpn_add_data_item
(
s_vpn
,
NM_L2TP_KEY_USER
,
str
);
nm_setting_vpn_add_data_item
(
s_vpn
,
NM_L2TP_KEY_USER
,
str
);
/* User password */
widget
=
GTK_WIDGET
(
gtk_builder_get_object
(
priv
->
builder
,
"user_password_entry"
));
str
=
gtk_entry_get_text
(
GTK_ENTRY
(
widget
));
if
(
str
&&
strlen
(
str
))
nm_setting_vpn_add_secret
(
s_vpn
,
NM_L2TP_KEY_PASSWORD
,
str
);
/* And password flags */
pw_flags
=
GPOINTER_TO_UINT
(
g_object_get_data
(
G_OBJECT
(
widget
),
"flags"
));
nm_setting_set_secret_flags
(
NM_SETTING
(
s_vpn
),
NM_L2TP_KEY_PASSWORD
,
pw_flags
,
NULL
);
/* Domain */
/* Domain */
widget
=
GTK_WIDGET
(
gtk_builder_get_object
(
priv
->
builder
,
"domain_entry"
));
widget
=
GTK_WIDGET
(
gtk_builder_get_object
(
priv
->
builder
,
"domain_entry"
));
str
=
gtk_entry_get_text
(
GTK_ENTRY
(
widget
));
str
=
gtk_entry_get_text
(
GTK_ENTRY
(
widget
));
...
@@ -472,41 +502,50 @@ update_connection (NMVpnPluginUiWidgetInterface *iface,
...
@@ -472,41 +502,50 @@ update_connection (NMVpnPluginUiWidgetInterface *iface,
return
valid
;
return
valid
;
}
}
static
gboolean
/* static gboolean */
save_secrets
(
NMVpnPluginUiWidgetInterface
*
iface
,
/* save_secrets (NMVpnPluginUiWidgetInterface *iface, */
NMConnection
*
connection
,
/* NMConnection *connection, */
GError
**
error
)
/* GError **error) */
{
/* { */
L2tpPluginUiWidget
*
self
=
L2TP_PLUGIN_UI_WIDGET
(
iface
);
/* L2tpPluginUiWidget *self = L2TP_PLUGIN_UI_WIDGET (iface); */
L2tpPluginUiWidgetPrivate
*
priv
=
L2TP_PLUGIN_UI_WIDGET_GET_PRIVATE
(
self
);
/* L2tpPluginUiWidgetPrivate *priv = L2TP_PLUGIN_UI_WIDGET_GET_PRIVATE (self); */
GnomeKeyringResult
ret
;
/* GnomeKeyringResult ret; */
NMSettingConnection
*
s_con
;
/* NMSettingConnection *s_con; */
GtkWidget
*
widget
;
/* GtkWidget *widget; */
const
char
*
str
,
*
uuid
,
*
id
;
/* const char *str, *uuid, *id; */
s_con
=
(
NMSettingConnection
*
)
nm_connection_get_setting
(
connection
,
NM_TYPE_SETTING_CONNECTION
);
/* s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); */
if
(
!
s_con
)
{
/* if (!s_con) { */
g_set_error
(
error
,
/* g_set_error (error, */
L2TP_PLUGIN_UI_ERROR
,
/* L2TP_PLUGIN_UI_ERROR, */
L2TP_PLUGIN_UI_ERROR_INVALID_CONNECTION
,
/* L2TP_PLUGIN_UI_ERROR_INVALID_CONNECTION, */
"missing 'connection' setting"
);
/* "missing 'connection' setting"); */
return
FALSE
;
/* return FALSE; */
}
/* } */
/* id = nm_setting_connection_get_id (s_con); */
/* uuid = nm_setting_connection_get_uuid (s_con); */
/* widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "user_password_entry")); */
/* g_assert (widget); */
/* str = gtk_entry_get_text (GTK_ENTRY (widget)); */
/* if (str && strlen (str)) { */
/* ret = keyring_helpers_save_secret (uuid, id, NULL, NM_L2TP_KEY_PASSWORD, str); */
/* if (ret != GNOME_KEYRING_RESULT_OK) */
/* g_warning ("%s: failed to save user password to keyring.", __func__); */
/* } else */
/* keyring_helpers_delete_secret (uuid, NM_L2TP_KEY_PASSWORD); */
/* return TRUE; */
/* } */
id
=
nm_setting_connection_get_id
(
s_con
);
static
void
uuid
=
nm_setting_connection_get_uuid
(
s_con
);
is_new_func
(
const
char
*
key
,
const
char
*
value
,
gpointer
user_data
)
{
widget
=
GTK_WIDGET
(
gtk_builder_get_object
(
priv
->
builder
,
"user_password_entry"
));
gboolean
*
is_new
=
user_data
;
g_assert
(
widget
);
str
=
gtk_entry_get_text
(
GTK_ENTRY
(
widget
));
if
(
str
&&
strlen
(
str
))
{
ret
=
keyring_helpers_save_secret
(
uuid
,
id
,
NULL
,
NM_L2TP_KEY_PASSWORD
,
str
);
if
(
ret
!=
GNOME_KEYRING_RESULT_OK
)
g_warning
(
"%s: failed to save user password to keyring."
,
__func__
);
}
else
keyring_helpers_delete_secret
(
uuid
,
NM_L2TP_KEY_PASSWORD
);
return
TRUE
;
/* If there are any VPN data items the connection isn't new */
*
is_new
=
FALSE
;
}
}
static
NMVpnPluginUiWidgetInterface
*
static
NMVpnPluginUiWidgetInterface
*
...
@@ -514,7 +553,9 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
...
@@ -514,7 +553,9 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
{
{
NMVpnPluginUiWidgetInterface
*
object
;
NMVpnPluginUiWidgetInterface
*
object
;
L2tpPluginUiWidgetPrivate
*
priv
;
L2tpPluginUiWidgetPrivate
*
priv
;
char
*
ui_file
;;
char
*
ui_file
;
gboolean
new
=
TRUE
;
NMSettingVPN
*
s_vpn
;
if
(
error
)
if
(
error
)
g_return_val_if_fail
(
*
error
==
NULL
,
NULL
);
g_return_val_if_fail
(
*
error
==
NULL
,
NULL
);
...
@@ -530,6 +571,8 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
...
@@ -530,6 +571,8 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
ui_file
=
g_strdup_printf
(
"%s/%s"
,
UIDIR
,
"nm-l2tp-dialog.ui"
);
ui_file
=
g_strdup_printf
(
"%s/%s"
,
UIDIR
,
"nm-l2tp-dialog.ui"
);
priv
->
builder
=
gtk_builder_new
();
priv
->
builder
=
gtk_builder_new
();
gtk_builder_set_translation_domain
(
priv
->
builder
,
GETTEXT_PACKAGE
);
if
(
!
gtk_builder_add_from_file
(
priv
->
builder
,
ui_file
,
error
))
{
if
(
!
gtk_builder_add_from_file
(
priv
->
builder
,
ui_file
,
error
))
{
g_warning
(
"Couldn't load builder file: %s"
,
g_warning
(
"Couldn't load builder file: %s"
,
error
&&
*
error
?
(
*
error
)
->
message
:
"(unknown)"
);
error
&&
*
error
?
(
*
error
)
->
message
:
"(unknown)"
);
...
@@ -537,15 +580,11 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
...
@@ -537,15 +580,11 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
g_set_error
(
error
,
L2TP_PLUGIN_UI_ERROR
,
0
,
g_set_error
(
error
,
L2TP_PLUGIN_UI_ERROR
,
0
,
"could not load required resources at %s"
,
ui_file
);
"could not load required resources at %s"
,
ui_file
);
g_free
(
ui_file
);
g_free
(
ui_file
);
g_object_unref
(
object
);
g_object_unref
(
object
);
return
NULL
;
return
NULL
;
}
}
g_free
(
ui_file
);
g_free
(
ui_file
);
gtk_builder_set_translation_domain
(
priv
->
builder
,
GETTEXT_PACKAGE
);
priv
->
widget
=
GTK_WIDGET
(
gtk_builder_get_object
(
priv
->
builder
,
"l2tp-vbox"
));
priv
->
widget
=
GTK_WIDGET
(
gtk_builder_get_object
(
priv
->
builder
,
"l2tp-vbox"
));
if
(
!
priv
->
widget
)
{
if
(
!
priv
->
widget
)
{
g_set_error
(
error
,
L2TP_PLUGIN_UI_ERROR
,
0
,
"could not load UI widget"
);
g_set_error
(
error
,
L2TP_PLUGIN_UI_ERROR
,
0
,
"could not load UI widget"
);
...
@@ -556,6 +595,11 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
...
@@ -556,6 +595,11 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
priv
->
window_group
=
gtk_window_group_new
();
priv
->
window_group
=
gtk_window_group_new
();
s_vpn
=
nm_connection_get_setting_vpn
(
connection
);
if
(
s_vpn
)
nm_setting_vpn_foreach_data_item
(
s_vpn
,
is_new_func
,
&
new
);
priv
->
new_connection
=
new
;
if
(
!
init_plugin_ui
(
L2TP_PLUGIN_UI_WIDGET
(
object
),
connection
,
error
))
{
if
(
!
init_plugin_ui
(
L2TP_PLUGIN_UI_WIDGET
(
object
),
connection
,
error
))
{
g_object_unref
(
object
);
g_object_unref
(
object
);
return
NULL
;
return
NULL
;
...
@@ -591,7 +635,7 @@ dispose (GObject *object)
...
@@ -591,7 +635,7 @@ dispose (GObject *object)
g_object_unref
(
priv
->
widget
);
g_object_unref
(
priv
->
widget
);
if
(
priv
->
builder
)
if
(
priv
->
builder
)
g_object_unref
(
priv
->
builder
);
g_object_unref
(
priv
->
builder
);
if
(
priv
->
advanced
)
if
(
priv
->
advanced
)
g_hash_table_destroy
(
priv
->
advanced
);
g_hash_table_destroy
(
priv
->
advanced
);
...
@@ -623,33 +667,33 @@ l2tp_plugin_ui_widget_interface_init (NMVpnPluginUiWidgetInterface *iface_class)
...
@@ -623,33 +667,33 @@ l2tp_plugin_ui_widget_interface_init (NMVpnPluginUiWidgetInterface *iface_class)
/* interface implementation */
/* interface implementation */
iface_class
->
get_widget
=
get_widget
;
iface_class
->
get_widget
=
get_widget
;
iface_class
->
update_connection
=
update_connection
;
iface_class
->
update_connection
=
update_connection
;
iface_class
->
save_secrets
=
save_secrets
;
//
iface_class->save_secrets = save_secrets;
}
}
static
gboolean
/* static gboolean */
delete_connection
(
NMVpnPluginUiInterface
*
iface
,
/* delete_connection (NMVpnPluginUiInterface *iface, */
NMConnection
*
connection
,
/* NMConnection *connection, */
GError
**
error
)
/* GError **error) */
{
/* { */
NMSettingConnection
*
s_con
=
NULL
;
/* NMSettingConnection *s_con = NULL; */
const
char
*
uuid
;
/* const char *uuid; */
/* Remove any secrets in the keyring associated with this connection's UUID
*/
/* /\* Remove any secrets in the keyring associated with this connection's UUID *\/
*/
s_con
=
(
NMSettingConnection
*
)
nm_connection_get_setting
(
connection
,
/* s_con = (NMSettingConnection *) nm_connection_get_setting (connection, */
NM_TYPE_SETTING_CONNECTION
);
/* NM_TYPE_SETTING_CONNECTION); */
if
(
!
s_con
)
{
/* if (!s_con) { */
g_set_error
(
error
,
/* g_set_error (error, */
L2TP_PLUGIN_UI_ERROR
,
/* L2TP_PLUGIN_UI_ERROR, */
L2TP_PLUGIN_UI_ERROR_INVALID_CONNECTION
,
/* L2TP_PLUGIN_UI_ERROR_INVALID_CONNECTION, */
"missing 'connection' setting"
);
/* "missing 'connection' setting"); */
return
FALSE
;
/* return FALSE; */
}
/* } */
uuid
=
nm_setting_connection_get_uuid
(
s_con
);
/* uuid = nm_setting_connection_get_uuid (s_con); */
keyring_helpers_delete_secret
(
uuid
,
NM_L2TP_KEY_PASSWORD
);
/* keyring_helpers_delete_secret (uuid, NM_L2TP_KEY_PASSWORD); */
return
TRUE
;
/* return TRUE; */
}
/* } */
static
NMConnection
*
static
NMConnection
*
import
(
NMVpnPluginUiInterface
*
iface
,
const
char
*
path
,
GError
**
error
)
import
(
NMVpnPluginUiInterface
*
iface
,
const
char
*
path
,
GError
**
error
)
...
@@ -789,7 +833,7 @@ l2tp_plugin_ui_interface_init (NMVpnPluginUiInterface *iface_class)
...
@@ -789,7 +833,7 @@ l2tp_plugin_ui_interface_init (NMVpnPluginUiInterface *iface_class)
iface_class
->
import_from_file
=
import
;
iface_class
->
import_from_file
=
import
;
iface_class
->
export_to_file
=
export
;
iface_class
->
export_to_file
=
export
;
iface_class
->
get_suggested_name
=
get_suggested_name
;
iface_class
->
get_suggested_name
=
get_suggested_name
;
iface_class
->
delete_connection
=
delete_connection
;
/* iface_class->delete_connection = delete_connection; */
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment