[Xfce4-commits] [xfce/xfce4-settings] 52/67: display: Add setting whether to auto-enable profiles
noreply at xfce.org
noreply at xfce.org
Sat Sep 22 11:23:43 CEST 2018
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfce4-settings.
commit 2ed22ff003998bc286f384e2d3e3f74c3b9f3d14
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Sat Sep 1 23:20:52 2018 +0200
display: Add setting whether to auto-enable profiles
---
dialogs/display-settings/display-dialog.glade | 134 +++++++++++++++++---------
dialogs/display-settings/main.c | 35 ++++---
2 files changed, 111 insertions(+), 58 deletions(-)
diff --git a/dialogs/display-settings/display-dialog.glade b/dialogs/display-settings/display-dialog.glade
index ca733e1..89e1e4d 100644
--- a/dialogs/display-settings/display-dialog.glade
+++ b/dialogs/display-settings/display-dialog.glade
@@ -413,59 +413,18 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="minimal-autoshow">
- <property name="label" translatable="yes">Configure _new displays when connected</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="margin_left">12</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
- <property name="width">2</property>
- </packing>
- </child>
- <child>
<object class="GtkLabel" id="label-profile1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_top">12</property>
- <property name="label" translatable="yes"><b>Further settings</b></property>
+ <property name="label" translatable="yes"><b>Connecting Displays</b></property>
<property name="use_markup">True</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_left">12</property>
- <property name="label" translatable="yes">Show popup windows to identify displays</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">5</property>
- </packing>
- </child>
- <child>
- <object class="GtkSwitch" id="identify-displays">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="halign">end</property>
- <property name="valign">center</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">5</property>
+ <property name="top_attach">2</property>
</packing>
</child>
<child>
@@ -584,7 +543,94 @@
</packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="label" translatable="yes">Automatically enable profiles when new display is connected</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSwitch" id="auto-enable-profiles">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="halign">end</property>
+ <property name="valign">center</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="label" translatable="yes">Configure new displays when connected</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSwitch" id="minimal-autoshow">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="halign">end</property>
+ <property name="valign">center</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="label" translatable="yes">Show popup windows to identify displays</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSwitch" id="identify-displays">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="halign">end</property>
+ <property name="valign">center</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label-profile2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="margin_top">12</property>
+ <property name="label" translatable="yes"><b>Identifying Displays</b></property>
+ <property name="use_markup">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">5</property>
+ </packing>
</child>
<child>
<placeholder/>
diff --git a/dialogs/display-settings/main.c b/dialogs/display-settings/main.c
index 7356b29..8128689 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -1820,7 +1820,11 @@ display_settings_dialog_new (GtkBuilder *builder)
apply_button = GTK_WIDGET (gtk_builder_get_object (builder, "apply"));
g_signal_connect (G_OBJECT (apply_button), "clicked", G_CALLBACK (display_setting_apply), builder);
- gtk_widget_set_sensitive(apply_button, FALSE);
+ gtk_widget_set_sensitive (apply_button, FALSE);
+
+ check = gtk_builder_get_object (builder, "auto-enable-profiles");
+ xfconf_g_property_bind (display_channel, "/AutoEnableProfiles", G_TYPE_BOOLEAN, check,
+ "active");
button = GTK_WIDGET (gtk_builder_get_object (builder, "button-profile-save"));
gtk_widget_set_sensitive (button, FALSE);
@@ -3523,21 +3527,24 @@ display_settings_show_minimal_dialog (GdkDisplay *display)
g_signal_connect_swapped (app, "activate", G_CALLBACK (gtk_window_present), dialog);
/* Auto-apply the first profile in the list */
- GObject *profile_box;
- profile_box = gtk_builder_get_object (builder, "profile-box");
- if (GTK_IS_CONTAINER (profile_box))
+ if (xfconf_channel_get_bool (display_channel, "/AutoEnableProfiles", TRUE))
{
- GList *children = NULL;
- GList *current;
-
- children = gtk_container_get_children (GTK_CONTAINER (profile_box));
- current = g_list_first (children);
- while (current)
+ GObject *profile_box;
+ profile_box = gtk_builder_get_object (builder, "profile-box");
+ if (GTK_IS_CONTAINER (profile_box))
{
- GtkWidget* widget = GTK_WIDGET (children->data);
- if (widget != NULL) {
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
- break;
+ GList *children = NULL;
+ GList *current;
+
+ children = gtk_container_get_children (GTK_CONTAINER (profile_box));
+ current = g_list_first (children);
+ while (current)
+ {
+ GtkWidget* widget = GTK_WIDGET (children->data);
+ if (widget != NULL) {
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
+ break;
+ }
}
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list