Disabling Vala code that does not compile in Centos 6.9
[moonshot-ui.git] / src / moonshot-warning-dialog.vala
index 72233a4..3471377 100644 (file)
@@ -61,7 +61,7 @@ class WarningDialog
                                                      Gtk.DialogFlags.DESTROY_WITH_PARENT,
                                                      Gtk.MessageType.WARNING,
                                                      Gtk.ButtonsType.YES_NO,
-                                                     "");
+                                                     "%s", "");
 
         var content_area = dialog.get_content_area();
         CheckButton remember_checkbutton = null;
@@ -75,14 +75,10 @@ class WarningDialog
             remember_checkbutton.set_receives_default(false);
             Container action_area = (Container) dialog.get_action_area();
 
-            // This is awful, because it assumes the Yes button is first in the
-            // children (and for that matter, it assumes there are no intermediate
-            // containers.) But searching for "Yes" in the widget text would
-            // cause localization problems.
-            // TODO: Rewrite to use Dialog instead of MessageDialog?
-            var yes_button = action_area.get_children().first().data;
-            yes_button.grab_default();
-            yes_button.grab_focus();
+           //!! dialog.get_widget_for_response is not available on Centos 6
+            // Button yes_button = (Button) dialog.get_widget_for_response(ResponseType.YES);
+           //             yes_button.grab_default();
+           //            yes_button.grab_focus();
 
 // Not sure if 0.26 is the minimum for MessageDialog.get_message_area. 0.16 sure isn't :-(
 #if VALA_0_26
@@ -98,10 +94,10 @@ class WarningDialog
 
         // dialog.set_modal(true);
         dialog.set_title(_("Warning"));
-        dialog.modify_bg(StateType.NORMAL, white);
+        set_bg_color(dialog);
 
         // ((Box) content_area).set_spacing(12);
-        content_area.modify_bg(StateType.NORMAL, white);
+        set_bg_color(content_area);
 
         content_area.show_all();