Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xfce4-power-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xfce
xfce4-power-manager
Commits
469cc1e9
Commit
469cc1e9
authored
7 years ago
by
Simon Steinbeiss
Browse files
Options
Downloads
Patches
Plain Diff
panel-plugin: Handle out-of-bounds values of show-panel-label in config dialog
parent
e319a493
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
panel-plugins/power-manager-plugin/xfce/xfce-power-manager-plugin.c
+8
-4
8 additions, 4 deletions
...ins/power-manager-plugin/xfce/xfce-power-manager-plugin.c
with
8 additions
and
4 deletions
panel-plugins/power-manager-plugin/xfce/xfce-power-manager-plugin.c
+
8
−
4
View file @
469cc1e9
...
...
@@ -85,7 +85,7 @@ power_manager_plugin_configure_response (GtkWidget *dialog,
}
}
/* Update
xfcon
f property i
f
c
ombobox selection is
change
d
*/
/* Update
combo i
f property i
n
c
hannel
change
s
*/
static
void
power_manager_plugin_panel_label_changed
(
XfconfChannel
*
channel
,
const
gchar
*
property
,
...
...
@@ -99,6 +99,10 @@ power_manager_plugin_panel_label_changed (XfconfChannel *channel,
list_store
=
GTK_LIST_STORE
(
gtk_combo_box_get_model
(
GTK_COMBO_BOX
(
combo
)));
current_setting
=
g_value_get_int
(
value
);
/* If the value set in xfconf is invalid, treat it like 0 aka "None" */
if
(
current_setting
<
0
||
current_setting
>
3
)
current_setting
=
0
;
for
(
gtk_tree_model_get_iter_first
(
GTK_TREE_MODEL
(
list_store
),
&
iter
);
gtk_list_store_iter_is_valid
(
list_store
,
&
iter
);
...
...
@@ -111,7 +115,7 @@ power_manager_plugin_panel_label_changed (XfconfChannel *channel,
}
}
/* Update
combo i
f property i
n
c
hannel
change
s
*/
/* Update
xfcon
f property i
f
c
ombobox selection is
change
d
*/
static
void
power_manager_plugin_combo_changed
(
GtkComboBox
*
combo
,
gpointer
user_data
)
...
...
@@ -121,13 +125,13 @@ power_manager_plugin_combo_changed (GtkComboBox *combo,
GtkTreeIter
iter
;
int
show_panel_label
;
if
(
!
gtk_combo_box_get_active_iter
(
combo
,
&
iter
))
if
(
!
gtk_combo_box_get_active_iter
(
combo
,
&
iter
))
return
;
model
=
gtk_combo_box_get_model
(
combo
);
gtk_tree_model_get
(
model
,
&
iter
,
0
,
&
show_panel_label
,
-
1
);
xfconf_channel_set_int
(
channel
,
PROPERTIES_PREFIX
SHOW_PANEL_LABEL
,
show_panel_label
);
xfconf_channel_set_int
(
channel
,
PROPERTIES_PREFIX
SHOW_PANEL_LABEL
,
show_panel_label
);
}
void
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment