mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-09 09:39:53 +00:00
Add missing confirmation dialog for deleting map notes
This commit is contained in:
parent
6e2673daf3
commit
271c921cf8
@ -13,12 +13,15 @@ namespace MWGui
|
||||
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &ConfirmationDialog::onOkButtonClicked);
|
||||
}
|
||||
|
||||
void ConfirmationDialog::open(const std::string& message)
|
||||
void ConfirmationDialog::open(const std::string& message, const std::string& confirmMessage, const std::string& cancelMessage)
|
||||
{
|
||||
setVisible(true);
|
||||
|
||||
mMessage->setCaptionWithReplacing(message);
|
||||
|
||||
mCancelButton->setCaptionWithReplacing(cancelMessage);
|
||||
mOkButton->setCaptionWithReplacing(confirmMessage);
|
||||
|
||||
int height = mMessage->getTextSize().height + 72;
|
||||
|
||||
mMainWidget->setSize(mMainWidget->getWidth(), height);
|
||||
|
@ -9,7 +9,7 @@ namespace MWGui
|
||||
{
|
||||
public:
|
||||
ConfirmationDialog();
|
||||
void open(const std::string& message);
|
||||
void open(const std::string& message, const std::string& confirmMessage="#{sOk}", const std::string& cancelMessage="#{sCancel}");
|
||||
virtual void exit();
|
||||
|
||||
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "../components/esm/globalmap.hpp"
|
||||
|
||||
#include "widgets.hpp"
|
||||
#include "confirmationdialog.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
@ -567,6 +568,15 @@ namespace MWGui
|
||||
}
|
||||
|
||||
void MapWindow::onNoteEditDelete()
|
||||
{
|
||||
ConfirmationDialog* confirmation = MWBase::Environment::get().getWindowManager()->getConfirmationDialog();
|
||||
confirmation->open("#{sDeleteNote}", "#{sYes}", "#{sNo}");
|
||||
confirmation->eventCancelClicked.clear();
|
||||
confirmation->eventOkClicked.clear();
|
||||
confirmation->eventOkClicked += MyGUI::newDelegate(this, &MapWindow::onNoteEditDeleteConfirm);
|
||||
}
|
||||
|
||||
void MapWindow::onNoteEditDeleteConfirm()
|
||||
{
|
||||
mCustomMarkers.deleteMarker(mEditingMarker);
|
||||
|
||||
|
@ -198,6 +198,7 @@ namespace MWGui
|
||||
void onMapDoubleClicked(MyGUI::Widget* sender);
|
||||
void onNoteEditOk();
|
||||
void onNoteEditDelete();
|
||||
void onNoteEditDeleteConfirm();
|
||||
void onNoteDoubleClicked(MyGUI::Widget* sender);
|
||||
void globalMapUpdatePlayer();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user