MsgDialog: Add SetMsg() for changing main text

This commit is contained in:
VelocityRa 2017-12-24 02:34:48 +02:00 committed by Nekotekina
parent d64e79bd9f
commit 7c64c2f703
3 changed files with 10 additions and 0 deletions

View file

@ -84,6 +84,7 @@ public:
virtual ~MsgDialogBase();
virtual void Create(const std::string& msg) = 0;
virtual void CreateOsk(const std::string& msg, char16_t* osk_text, u32 charlimit) = 0;
virtual void SetMsg(const std::string& msg) = 0;
virtual void ProgressBarSetMsg(u32 progressBarIndex, const std::string& msg) = 0;
virtual void ProgressBarReset(u32 progressBarIndex) = 0;
virtual void ProgressBarInc(u32 progressBarIndex, u32 delta) = 0;

View file

@ -339,6 +339,14 @@ msg_dialog_frame::~msg_dialog_frame()
}
}
void msg_dialog_frame::SetMsg(const std::string& msg)
{
if (m_dialog)
{
m_text->setText(qstr(msg));
}
}
void msg_dialog_frame::ProgressBarSetMsg(u32 index, const std::string& msg)
{
if (m_dialog)

View file

@ -63,6 +63,7 @@ public:
~msg_dialog_frame();
virtual void Create(const std::string& msg) override;
virtual void CreateOsk(const std::string& msg, char16_t* osk_text, u32 charlimit) override;
virtual void SetMsg(const std::string& msg) override;
virtual void ProgressBarSetMsg(u32 progressBarIndex, const std::string& msg) override;
virtual void ProgressBarReset(u32 progressBarIndex) override;
virtual void ProgressBarInc(u32 progressBarIndex, u32 delta) override;