[Xfce4-commits] [panel-plugins/xfce4-weather-plugin] 09/25: Fix usage of XfceTitledDialog
noreply at xfce.org
noreply at xfce.org
Mon Sep 17 00:14:06 CEST 2018
This is an automated email from the git hooks/post-receive script.
b l u e s a b r e 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 panel-plugins/xfce4-weather-plugin.
commit 8ce6b8c359eb30b0f7772462501be199565bdab9
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Sun Sep 9 21:30:21 2018 -0400
Fix usage of XfceTitledDialog
---
panel-plugin/weather-config.ui | 94 ++++++++++++++++++++++--------------------
panel-plugin/weather.c | 5 +++
2 files changed, 54 insertions(+), 45 deletions(-)
diff --git a/panel-plugin/weather-config.ui b/panel-plugin/weather-config.ui
index ea75c16..40e4477 100644
--- a/panel-plugin/weather-config.ui
+++ b/panel-plugin/weather-config.ui
@@ -2,6 +2,7 @@
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
+ <requires lib="libxfce4ui-2" version="4.12"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">1</property>
<property name="upper">10</property>
@@ -63,7 +64,7 @@
<property name="icon_name">down</property>
</object>
<object class="GtkListStore" id="liststore1"/>
- <object class="GtkDialog" id="dialog">
+ <object class="XfceTitledDialog" id="dialog">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Weather Update</property>
<property name="default_width">430</property>
@@ -71,9 +72,7 @@
<property name="destroy_with_parent">True</property>
<property name="icon_name">xfce4-weather</property>
<property name="type_hint">dialog</property>
- <child>
- <placeholder/>
- </child>
+ <property name="subtitle" translatable="yes">Preferences</property>
<child internal-child="vbox">
<object class="GtkBox" id="box1">
<property name="can_focus">False</property>
@@ -212,7 +211,7 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
- <property name="width">3</property>
+ <property name="width">2</property>
</packing>
</child>
<child>
@@ -229,33 +228,7 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
- <property name="width">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="text_loc_name">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip_text" translatable="yes">Change the name for the location to your liking. It is used for display and does not affect the location parameters in any way.</property>
- <property name="hexpand">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button_loc_change">
- <property name="label" translatable="yes">Change...</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Search for a new location and auto-detect its parameters.</property>
- <property name="image">image1</property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
+ <property name="width">2</property>
</packing>
</child>
<child>
@@ -294,7 +267,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
- <property name="width">2</property>
</packing>
</child>
<child>
@@ -333,7 +305,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
- <property name="width">2</property>
</packing>
</child>
<child>
@@ -375,7 +346,6 @@ Altitude is given in meters above sea level, or alternatively in feet by changin
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
- <property name="width">2</property>
</packing>
</child>
<child>
@@ -388,25 +358,59 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
- <property name="width">2</property>
</packing>
</child>
<child>
- <object class="GtkSpinner" id="update_spinner">
+ <object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkEntry" id="text_loc_name">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">Change the name for the location to your liking. It is used for display and does not affect the location parameters in any way.</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_loc_change">
+ <property name="label" translatable="yes">Change...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes">Search for a new location and auto-detect its parameters.</property>
+ <property name="image">image1</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinner" id="update_spinner">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">7</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
</object>
</child>
<child type="tab">
diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 43c5680..2159b2e 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -1641,6 +1641,9 @@ xfceweather_create_options(XfcePanelPlugin *plugin,
xfce_panel_plugin_block_menu(plugin);
+ if (xfce_titled_dialog_get_type () == 0)
+ return FALSE;
+
builder = gtk_builder_new ();
if (gtk_builder_add_from_string (builder, weather_config_ui,
weather_config_ui_length, &error) != 0)
@@ -1655,6 +1658,8 @@ xfceweather_create_options(XfcePanelPlugin *plugin,
gtk_widget_show_all (GTK_WIDGET (dlg));
response = gtk_dialog_run(GTK_DIALOG (dlg));
xfceweather_dialog_response(dlg, response, dialog);
+ } else {
+ g_warning ("Failed to load dialog: %s", error->message);
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list