/*
- Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
*/
+
+#include "static_text.h"
#include "try_unmount_dialog.h"
#include "wx_util.h"
-#include "static_text.h"
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
#include <wx/wx.h>
+LIBDCP_ENABLE_WARNINGS
+
+
+static int constexpr width = 300;
+
TryUnmountDialog::TryUnmountDialog (wxWindow* parent, wxString description)
: wxDialog (parent, wxID_ANY, _("DCP-o-matic Disk Writer"))
{
- wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
- wxStaticText* text = new StaticText (this, wxString::Format(_("The drive %s is mounted.\nIt must be unmounted before DCP-o-matic can write to it. Should DCP-o-matic try to unmount it now?"), description));
+ auto sizer = new wxBoxSizer (wxVERTICAL);
+ auto text = new StaticText (this, wxEmptyString, wxDefaultPosition, wxSize(width, -1));
sizer->Add (text, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
- wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
+ text->SetLabelMarkup (
+ wxString::Format(_("The drive <b>%s</b> is mounted.\n\nIt must be unmounted before DCP-o-matic can write to it.\n\nShould DCP-o-matic try to unmount it now?"), description)
+ );
+ text->Wrap(width);
+
+ auto buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
if (buttons) {
sizer->Add(buttons, wxSizerFlags().Expand().DoubleBorder());
}