Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
Settings
Commits
4494045c
Commit
4494045c
authored
Sep 17, 2013
by
Rui Matos
Committed by
Bastien Nocera
Oct 01, 2013
Browse files
power: Don't leak a dialog
https://bugzilla.gnome.org/show_bug.cgi?id=708286
parent
9288bbbf
Changes
1
Show whitespace changes
Inline
Side-by-side
panels/power/cc-power-panel.c
View file @
4494045c
...
...
@@ -68,6 +68,7 @@ struct _CcPowerPanelPrivate
GSettings
*
session_settings
;
GCancellable
*
cancellable
;
GtkBuilder
*
builder
;
GtkWidget
*
automatic_suspend_dialog
;
UpClient
*
up_client
;
GDBusProxy
*
screen_proxy
;
GDBusProxy
*
kbd_proxy
;
...
...
@@ -137,6 +138,7 @@ cc_power_panel_dispose (GObject *object)
g_object_unref
(
priv
->
cancellable
);
priv
->
cancellable
=
NULL
;
}
g_clear_pointer
(
&
priv
->
automatic_suspend_dialog
,
gtk_widget_destroy
);
g_clear_object
(
&
priv
->
builder
);
g_clear_object
(
&
priv
->
screen_proxy
);
g_clear_object
(
&
priv
->
kbd_proxy
);
...
...
@@ -1772,7 +1774,7 @@ activate_row (CcPowerPanel *self,
if
(
row
==
GTK_LIST_BOX_ROW
(
priv
->
automatic_suspend_row
))
{
w
=
WID
(
priv
->
builder
,
"
automatic_suspend_dialog
"
)
;
w
=
priv
->
automatic_suspend_dialog
;
toplevel
=
gtk_widget_get_toplevel
(
GTK_WIDGET
(
self
));
gtk_window_set_transient_for
(
GTK_WINDOW
(
w
),
GTK_WINDOW
(
toplevel
));
gtk_window_set_modal
(
GTK_WINDOW
(
w
),
TRUE
);
...
...
@@ -1983,7 +1985,7 @@ add_automatic_suspend_section (CcPowerPanel *self)
gtk_size_group_add_widget
(
priv
->
row_sizegroup
,
row
);
gtk_widget_show_all
(
widget
);
dialog
=
WID
(
priv
->
builder
,
"
automatic_suspend_dialog
"
)
;
dialog
=
priv
->
automatic_suspend_dialog
;
sw
=
WID
(
priv
->
builder
,
"automatic_suspend_close"
);
g_signal_connect_swapped
(
sw
,
"clicked"
,
G_CALLBACK
(
gtk_widget_hide
),
dialog
);
g_signal_connect
(
dialog
,
"delete-event"
,
G_CALLBACK
(
gtk_widget_hide_on_delete
),
NULL
);
...
...
@@ -2180,6 +2182,8 @@ cc_power_panel_init (CcPowerPanel *self)
return
;
}
priv
->
automatic_suspend_dialog
=
WID
(
priv
->
builder
,
"automatic_suspend_dialog"
);
priv
->
cancellable
=
g_cancellable_new
();
g_dbus_proxy_new_for_bus
(
G_BUS_TYPE_SESSION
,
...
...
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