From 51921552536d2fbc56c8cdaf682da038e26a168c Mon Sep 17 00:00:00 2001 From: yexo Date: Mon, 13 Aug 2012 18:52:47 +0000 Subject: (svn r24467) -Codechange [FS#5236]: make textfile window class slightly more general (LordAro) --- src/ai/ai_gui.cpp | 2 -- src/newgrf_gui.cpp | 2 -- src/settings_gui.cpp | 2 -- src/textfile_gui.cpp | 1 + 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index f0cdf8d3d..3f75f7d90 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -646,8 +646,6 @@ struct ScriptTextfileWindow : public TextfileWindow { ScriptTextfileWindow(TextfileType file_type, CompanyID slot) : TextfileWindow(file_type), slot(slot) { - this->GetWidget(WID_TF_CAPTION)->SetDataTip(STR_TEXTFILE_README_CAPTION + file_type, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS); - const char *textfile = GetConfig(slot)->GetTextfile(file_type, slot); this->LoadTextfile(textfile, (slot == OWNER_DEITY) ? GAME_DIR : AI_DIR); } diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index f832454e6..5b9927b9d 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -542,8 +542,6 @@ struct NewGRFTextfileWindow : public TextfileWindow { NewGRFTextfileWindow(TextfileType file_type, const GRFConfig *c) : TextfileWindow(file_type), grf_config(c) { - this->GetWidget(WID_TF_CAPTION)->SetDataTip(STR_TEXTFILE_README_CAPTION + file_type, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS); - const char *textfile = this->grf_config->GetTextfile(file_type); this->LoadTextfile(textfile, NEWGRF_DIR); } diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 8c30135bb..8cfda047a 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -127,8 +127,6 @@ struct BaseSetTextfileWindow : public TextfileWindow { BaseSetTextfileWindow(TextfileType file_type, const TBaseSet* baseset, StringID content_type) : TextfileWindow(file_type), baseset(baseset), content_type(content_type) { - this->GetWidget(WID_TF_CAPTION)->SetDataTip(STR_TEXTFILE_README_CAPTION + file_type, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS); - const char *textfile = this->baseset->GetTextfile(file_type); this->LoadTextfile(textfile, BASESET_DIR); } diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp index 3a4954323..43e5f865c 100644 --- a/src/textfile_gui.cpp +++ b/src/textfile_gui.cpp @@ -55,6 +55,7 @@ TextfileWindow::TextfileWindow(TextfileType file_type) : Window(), file_type(fil this->vscroll = this->GetScrollbar(WID_TF_VSCROLLBAR); this->hscroll = this->GetScrollbar(WID_TF_HSCROLLBAR); this->FinishInitNested(&_textfile_desc); + this->GetWidget(WID_TF_CAPTION)->SetDataTip(STR_TEXTFILE_README_CAPTION + file_type, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS); } /* virtual */ TextfileWindow::~TextfileWindow() -- cgit v1.2.3-70-g09d2