Merge branch 'master' into 1.0
[dcpomatic.git] / src / wx / wx_util.cc
index bf78ff4d7029c1e3acf38f6a6c8ff28574ea362b..e0d7d843ff51fb31f06881592e670f3adab6dbce 100644 (file)
@@ -43,6 +43,14 @@ add_label_to_sizer (wxSizer* s, wxWindow* p, wxString t, int prop)
        return m;
 }
 
+wxStaticText *
+add_label_to_grid_bag_sizer (wxGridBagSizer* s, wxWindow* p, wxString t, wxGBPosition pos, wxGBSpan span)
+{
+       wxStaticText* m = new wxStaticText (p, wxID_ANY, t);
+       s->Add (m, pos, span, wxALIGN_CENTER_VERTICAL | wxALL, 6);
+       return m;
+}
+
 /** Pop up an error dialogue box.
  *  @param parent Parent.
  *  @param m Message.
@@ -50,11 +58,21 @@ add_label_to_sizer (wxSizer* s, wxWindow* p, wxString t, int prop)
 void
 error_dialog (wxWindow* parent, wxString m)
 {
-       wxMessageDialog* d = new wxMessageDialog (parent, m, _("DVD-o-matic"), wxOK);
+       wxMessageDialog* d = new wxMessageDialog (parent, m, _("DCP-o-matic"), wxOK);
        d->ShowModal ();
        d->Destroy ();
 }
 
+bool
+confirm_dialog (wxWindow* parent, wxString m)
+{
+       wxMessageDialog* d = new wxMessageDialog (parent, m, _("DVD-o-matic"), wxYES_NO | wxICON_QUESTION);
+       int const r = d->ShowModal ();
+       d->Destroy ();
+       return r == wxID_YES;
+}
+       
+
 /** @param s wxWidgets string.
  *  @return Corresponding STL string.
  */