Skip to content

Commit

Permalink
Put the dialog box headers in order (#9301)
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-derevenetz authored Nov 28, 2024
1 parent b0d1ddd commit e5e0b88
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/fheroes2/dialog/dialog_selectfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ namespace
msg.append( "\n\n" );
msg.append( System::GetBasename( listbox.GetCurrent().filename ) );

if ( Dialog::YES == fheroes2::showStandardTextMessage( _( "Warning!" ), msg, Dialog::YES | Dialog::NO ) ) {
if ( Dialog::YES == fheroes2::showStandardTextMessage( _( "Warning" ), msg, Dialog::YES | Dialog::NO ) ) {
System::Unlink( listbox.GetCurrent().filename );
listbox.RemoveSelected();

Expand Down
14 changes: 7 additions & 7 deletions src/fheroes2/editor/editor_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1759,12 +1759,12 @@ namespace Interface
bool EditorInterface::loadMap( const std::string & filePath )
{
if ( !Maps::Map_Format::loadMap( filePath, _mapFormat ) ) {
fheroes2::showStandardTextMessage( _( "Warning!" ), "Failed to load the map.", Dialog::OK );
fheroes2::showStandardTextMessage( _( "Error" ), "Failed to load the map.", Dialog::OK );
return false;
}

if ( !Maps::readMapInEditor( _mapFormat ) ) {
fheroes2::showStandardTextMessage( _( "Warning!" ), "Failed to read the map.", Dialog::OK );
fheroes2::showStandardTextMessage( _( "Error" ), "Failed to read the map.", Dialog::OK );
return false;
}

Expand All @@ -1785,20 +1785,20 @@ namespace Interface
void EditorInterface::saveMapToFile()
{
if ( !Maps::updateMapPlayers( _mapFormat ) ) {
fheroes2::showStandardTextMessage( _( "Warning!" ), _( "The map is corrupted." ), Dialog::OK );
fheroes2::showStandardTextMessage( _( "Error" ), _( "The map is corrupted." ), Dialog::OK );
return;
}

const std::string dataPath = System::GetDataDirectory( "fheroes2" );
if ( dataPath.empty() ) {
fheroes2::showStandardTextMessage( _( "Warning!" ), _( "Unable to locate data directory to save the map." ), Dialog::OK );
fheroes2::showStandardTextMessage( _( "Error" ), _( "Unable to locate data directory to save the map." ), Dialog::OK );
return;
}

std::string mapDirectory = System::concatPath( dataPath, "maps" );

if ( !System::IsDirectory( mapDirectory ) && !System::MakeDirectory( mapDirectory ) ) {
fheroes2::showStandardTextMessage( _( "Warning!" ), _( "Unable to create a directory to save the map." ), Dialog::OK );
fheroes2::showStandardTextMessage( _( "Error" ), _( "Unable to create a directory to save the map." ), Dialog::OK );
return;
}

Expand All @@ -1807,7 +1807,7 @@ namespace Interface
std::string correctedMapDirectory;

if ( !System::GetCaseInsensitivePath( mapDirectory, correctedMapDirectory ) ) {
fheroes2::showStandardTextMessage( _( "Warning!" ), _( "Unable to locate a directory to save the map." ), Dialog::OK );
fheroes2::showStandardTextMessage( _( "Error" ), _( "Unable to locate a directory to save the map." ), Dialog::OK );
return;
}

Expand Down Expand Up @@ -1849,7 +1849,7 @@ namespace Interface
return;
}

fheroes2::showStandardTextMessage( _( "Warning!" ), _( "Failed to save the map." ), Dialog::OK );
fheroes2::showStandardTextMessage( _( "Error" ), _( "Failed to save the map." ), Dialog::OK );
}

void EditorInterface::openMapSpecificationsDialog()
Expand Down
2 changes: 1 addition & 1 deletion src/fheroes2/editor/editor_mainmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ namespace

void showWIPInfo()
{
fheroes2::showStandardTextMessage( _( "Warning!" ), "The Map Editor is still in development. This function is not available yet.", Dialog::OK );
fheroes2::showStandardTextMessage( _( "Warning" ), "The Map Editor is still in development. This function is not available yet.", Dialog::OK );
}

Maps::MapSize selectMapSize()
Expand Down
2 changes: 1 addition & 1 deletion src/fheroes2/editor/editor_save_map_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ namespace Editor
msg.append( "\n\n" );
msg.append( System::GetBasename( listbox.GetCurrent().filename ) );

if ( Dialog::YES == fheroes2::showStandardTextMessage( _( "Warning!" ), msg, Dialog::YES | Dialog::NO ) ) {
if ( Dialog::YES == fheroes2::showStandardTextMessage( _( "Warning" ), msg, Dialog::YES | Dialog::NO ) ) {
System::Unlink( listbox.GetCurrent().filename );
listbox.RemoveSelected();

Expand Down
4 changes: 2 additions & 2 deletions src/fheroes2/game/game_newgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ namespace

void showMissingVideoFilesWindow()
{
fheroes2::showStandardTextMessage( _( "Warning!" ),
fheroes2::showStandardTextMessage( _( "Warning" ),
_( "The required video files for the campaign selection window are missing. "
"Please make sure that all necessary files are present in the system." ),
Dialog::OK );
Expand Down Expand Up @@ -557,7 +557,7 @@ fheroes2::GameMode Game::NewGame( const bool isProbablyDemoVersion )
LocalEvent & le = LocalEvent::Get();

if ( isProbablyDemoVersion ) {
fheroes2::showStandardTextMessage( _( "Warning!" ),
fheroes2::showStandardTextMessage( _( "Warning" ),
_( "fheroes2 needs data files from the original Heroes of Might and Magic II to operate. "
"You appear to be using the demo version of Heroes of Might and Magic II for this purpose. "
"Please note that only one scenario will be available in this setup." ),
Expand Down
4 changes: 2 additions & 2 deletions src/fheroes2/gui/ui_keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ namespace fheroes2
break;
case DialogAction::Close: {
const auto handleInvalidValue = [&action]() {
showStandardTextMessage( _( "Warning" ), _( "The entered value is invalid." ), Dialog::OK );
showStandardTextMessage( _( "Error" ), _( "The entered value is invalid." ), Dialog::OK );

action = DialogAction::DoNothing;
};
Expand All @@ -872,7 +872,7 @@ namespace fheroes2
StringReplace( errorMessage, "%{minValue}", minValue );
StringReplace( errorMessage, "%{maxValue}", maxValue );

showStandardTextMessage( _( "Warning" ), std::move( errorMessage ), Dialog::OK );
showStandardTextMessage( _( "Error" ), std::move( errorMessage ), Dialog::OK );

action = DialogAction::DoNothing;
};
Expand Down

0 comments on commit e5e0b88

Please sign in to comment.