(svn r27653) -Fix(r27647): Rename FileOperation enum and values to SaveLoadOperation to avoid nameclash with windows compiler toolkit.
This commit is contained in:
@@ -229,7 +229,7 @@ struct SaveLoadWindow : public Window {
|
||||
private:
|
||||
QueryString filename_editbox; ///< Filename editbox.
|
||||
AbstractFileType abstract_filetype; /// Type of file to select.
|
||||
FileOperation fop; ///< File operation to perform.
|
||||
SaveLoadOperation fop; ///< File operation to perform.
|
||||
FileList fios_items; ///< Save game list.
|
||||
FiosItem o_dir;
|
||||
const FiosItem *selected; ///< Selected game in #fios_items, or \c NULL.
|
||||
@@ -243,13 +243,13 @@ public:
|
||||
this->filename_editbox.text.UpdateSize();
|
||||
}
|
||||
|
||||
SaveLoadWindow(WindowDesc *desc, AbstractFileType abstract_filetype, FileOperation fop)
|
||||
SaveLoadWindow(WindowDesc *desc, AbstractFileType abstract_filetype, SaveLoadOperation fop)
|
||||
: Window(desc), filename_editbox(64), abstract_filetype(abstract_filetype), fop(fop)
|
||||
{
|
||||
assert(this->fop == FOP_SAVE || this->fop == FOP_LOAD);
|
||||
assert(this->fop == SLO_SAVE || this->fop == SLO_LOAD);
|
||||
|
||||
/* For saving, construct an initial file name. */
|
||||
if (this->fop == FOP_SAVE) {
|
||||
if (this->fop == SLO_SAVE) {
|
||||
switch (this->abstract_filetype) {
|
||||
case FT_SAVEGAME:
|
||||
this->GenerateFileName();
|
||||
@@ -268,7 +268,7 @@ public:
|
||||
this->filename_editbox.ok_button = WID_SL_SAVE_GAME;
|
||||
|
||||
this->CreateNestedTree(true);
|
||||
if (this->fop == FOP_LOAD && this->abstract_filetype == FT_SAVEGAME) {
|
||||
if (this->fop == SLO_LOAD && this->abstract_filetype == FT_SAVEGAME) {
|
||||
this->GetWidget<NWidgetStacked>(WID_SL_CONTENT_DOWNLOAD_SEL)->SetDisplayedPlane(SZSP_HORIZONTAL);
|
||||
}
|
||||
|
||||
@@ -276,15 +276,15 @@ public:
|
||||
StringID caption_string;
|
||||
switch (this->abstract_filetype) {
|
||||
case FT_SAVEGAME:
|
||||
caption_string = (this->fop == FOP_SAVE) ? STR_SAVELOAD_SAVE_CAPTION : STR_SAVELOAD_LOAD_CAPTION;
|
||||
caption_string = (this->fop == SLO_SAVE) ? STR_SAVELOAD_SAVE_CAPTION : STR_SAVELOAD_LOAD_CAPTION;
|
||||
break;
|
||||
|
||||
case FT_SCENARIO:
|
||||
caption_string = (this->fop == FOP_SAVE) ? STR_SAVELOAD_SAVE_SCENARIO : STR_SAVELOAD_LOAD_SCENARIO;
|
||||
caption_string = (this->fop == SLO_SAVE) ? STR_SAVELOAD_SAVE_SCENARIO : STR_SAVELOAD_LOAD_SCENARIO;
|
||||
break;
|
||||
|
||||
case FT_HEIGHTMAP:
|
||||
caption_string = (this->fop == FOP_SAVE) ? STR_SAVELOAD_SAVE_HEIGHTMAP : STR_SAVELOAD_LOAD_HEIGHTMAP;
|
||||
caption_string = (this->fop == SLO_SAVE) ? STR_SAVELOAD_SAVE_HEIGHTMAP : STR_SAVELOAD_LOAD_HEIGHTMAP;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -328,7 +328,7 @@ public:
|
||||
}
|
||||
|
||||
/* Focus the edit box by default in the save windows */
|
||||
if (this->fop == FOP_SAVE) this->SetFocusedWidget(WID_SL_SAVE_OSK_TITLE);
|
||||
if (this->fop == SLO_SAVE) this->SetFocusedWidget(WID_SL_SAVE_OSK_TITLE);
|
||||
}
|
||||
|
||||
virtual ~SaveLoadWindow()
|
||||
@@ -438,7 +438,7 @@ public:
|
||||
}
|
||||
|
||||
/* Hide the NewGRF stuff when saving. We also hide the button. */
|
||||
if (this->fop == FOP_LOAD && (this->abstract_filetype == FT_SAVEGAME || this->abstract_filetype == FT_SCENARIO)) {
|
||||
if (this->fop == SLO_LOAD && (this->abstract_filetype == FT_SAVEGAME || this->abstract_filetype == FT_SCENARIO)) {
|
||||
y += WD_PAR_VSEP_NORMAL;
|
||||
if (y > y_max) break;
|
||||
|
||||
@@ -583,19 +583,19 @@ public:
|
||||
|
||||
if (GetDetailedFileType(file->type) == DFT_GAME_FILE) {
|
||||
/* Other detailed file types cannot be checked before. */
|
||||
SaveOrLoad(name, FOP_CHECK, DFT_GAME_FILE, NO_DIRECTORY, false);
|
||||
SaveOrLoad(name, SLO_CHECK, DFT_GAME_FILE, NO_DIRECTORY, false);
|
||||
}
|
||||
|
||||
this->InvalidateData(1);
|
||||
}
|
||||
if (this->fop == FOP_SAVE) {
|
||||
if (this->fop == SLO_SAVE) {
|
||||
/* Copy clicked name to editbox */
|
||||
this->filename_editbox.text.Assign(file->title);
|
||||
this->SetWidgetDirty(WID_SL_SAVE_OSK_TITLE);
|
||||
}
|
||||
} else if (!_load_check_data.HasErrors()) {
|
||||
this->selected = file;
|
||||
if (this->fop == FOP_LOAD) {
|
||||
if (this->fop == SLO_LOAD) {
|
||||
if (this->abstract_filetype == FT_SAVEGAME || this->abstract_filetype == FT_SCENARIO) {
|
||||
this->OnClick(pt, WID_SL_LOAD_BUTTON, 1);
|
||||
} else {
|
||||
@@ -621,7 +621,7 @@ public:
|
||||
ShowErrorMessage(STR_NETWORK_ERROR_NOTAVAILABLE, INVALID_STRING_ID, WL_ERROR);
|
||||
} else {
|
||||
#if defined(ENABLE_NETWORK)
|
||||
assert(this->fop == FOP_LOAD);
|
||||
assert(this->fop == SLO_LOAD);
|
||||
switch (this->abstract_filetype) {
|
||||
default: NOT_REACHED();
|
||||
case FT_SCENARIO: ShowNetworkContentListWindow(NULL, CONTENT_TYPE_SCENARIO); break;
|
||||
@@ -654,7 +654,7 @@ public:
|
||||
virtual void OnTimeout()
|
||||
{
|
||||
/* Widgets WID_SL_DELETE_SELECTION and WID_SL_SAVE_GAME only exist when saving to a file. */
|
||||
if (this->fop != FOP_SAVE) return;
|
||||
if (this->fop != SLO_SAVE) return;
|
||||
|
||||
if (this->IsWidgetLowered(WID_SL_DELETE_SELECTION)) { // Delete button clicked
|
||||
if (!FiosDelete(this->filename_editbox.text.buf)) {
|
||||
@@ -707,7 +707,7 @@ public:
|
||||
/* Selection changes */
|
||||
if (!gui_scope) break;
|
||||
|
||||
if (this->fop != FOP_LOAD) break;
|
||||
if (this->fop != SLO_LOAD) break;
|
||||
|
||||
switch (this->abstract_filetype) {
|
||||
case FT_HEIGHTMAP:
|
||||
@@ -764,12 +764,12 @@ static WindowDesc _save_dialog_desc(
|
||||
* @param abstract_filetype Kind of file to handle.
|
||||
* @param fop File operation to perform (load or save).
|
||||
*/
|
||||
void ShowSaveLoadDialog(AbstractFileType abstract_filetype, FileOperation fop)
|
||||
void ShowSaveLoadDialog(AbstractFileType abstract_filetype, SaveLoadOperation fop)
|
||||
{
|
||||
DeleteWindowById(WC_SAVELOAD, 0);
|
||||
|
||||
WindowDesc *sld;
|
||||
if (fop == FOP_SAVE) {
|
||||
if (fop == SLO_SAVE) {
|
||||
sld = &_save_dialog_desc;
|
||||
} else {
|
||||
/* Dialogue for loading a file. */
|
||||
|
Reference in New Issue
Block a user