From 43aa8e6bedff642ba584c447c03886c1f0c52aac Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 24 Dec 2017 00:35:44 +0300 Subject: Remove default parameter from staticbrowserbox. --- src/gui/popups/popupmenu.cpp | 87 +++++++++++++++++++++--------------- src/gui/popups/speechbubble.cpp | 3 +- src/gui/widgets/desktop.cpp | 6 ++- src/gui/widgets/staticbrowserbox.cpp | 3 +- src/gui/widgets/staticbrowserbox.h | 2 +- src/gui/windows/didyouknowwindow.cpp | 2 +- src/gui/windows/helpwindow.cpp | 5 ++- src/gui/windows/serverinfowindow.cpp | 18 +++++--- src/gui/windows/updaterwindow.cpp | 23 +++++----- src/gui/windows/whoisonline.cpp | 14 +++--- 10 files changed, 95 insertions(+), 68 deletions(-) diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 802586f4c..237443230 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -220,7 +220,8 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being) const std::string &name = mName; if (being->getType() != ActorType::SkillUnit) { - mBrowserBox->addRow(name + being->getGenderSignWithSpace()); + mBrowserBox->addRow(name + being->getGenderSignWithSpace(), + false); } switch (being->getType()) @@ -274,7 +275,8 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being) "@@guild-pos|%s >@@", // TRANSLATORS: popup menu item // TRANSLATORS: change player position in guild - _("Change pos in guild"))); + _("Change pos in guild")), + false); } } } @@ -290,7 +292,8 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being) "@@guild-pos|%s >@@", // TRANSLATORS: popup menu item // TRANSLATORS: change player position in guild - _("Change pos in guild"))); + _("Change pos in guild")), + false); } } else @@ -488,7 +491,8 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being) mBrowserBox->addRow(strprintf("%s, %d (%s)", name.c_str(), CAST_S32(being->getSubType()), - creatorName.c_str())); + creatorName.c_str()), + false); break; } case ActorType::Avatar: @@ -568,7 +572,7 @@ void PopupMenu::showPopup(const int x, const int y, mY = y; mBrowserBox->clearRows(); // TRANSLATORS: popup menu header - mBrowserBox->addRow(_("Players")); + mBrowserBox->addRow(_("Players"), false); FOR_EACH (STD_VECTOR::const_iterator, it, beings) { const Being *const being = dynamic_cast(*it); @@ -577,7 +581,8 @@ void PopupMenu::showPopup(const int x, const int y, { mBrowserBox->addRow(strprintf("@@player_%u|%s >@@", CAST_U32(being->getId()), (being->getName() - + being->getGenderSignWithSpace()).c_str())); + + being->getGenderSignWithSpace()).c_str()), + false); } else if (actor->getType() == ActorType::FloorItem) { @@ -585,7 +590,8 @@ void PopupMenu::showPopup(const int x, const int y, = static_cast(actor); mBrowserBox->addRow(strprintf("@@flooritem_%u|%s >@@", CAST_U32(actor->getId()), - floorItem->getName().c_str())); + floorItem->getName().c_str()), + false); } } mBrowserBox->addSeparator("##3---"); @@ -611,7 +617,7 @@ void PopupMenu::showPlayerPopup(const std::string &nick) const std::string &name = mName; - mBrowserBox->addRow(name); + mBrowserBox->addRow(name, false); // TRANSLATORS: popup menu item // TRANSLATORS: send whisper to player @@ -673,7 +679,8 @@ void PopupMenu::showPlayerPopup(const std::string &nick) mBrowserBox->addRow(strprintf( // TRANSLATORS: popup menu item // TRANSLATORS: change player position in guild - "@@guild-pos|%s >@@", _("Change pos in guild"))); + "@@guild-pos|%s >@@", _("Change pos in guild")), + false); } } else @@ -722,7 +729,7 @@ void PopupMenu::showPopup(const int x, const int y, mName = name; mExtName = name; - mBrowserBox->addRow(name); + mBrowserBox->addRow(name, false); if (config.getBoolValue("enablePickupFilter")) { @@ -770,7 +777,7 @@ void PopupMenu::showPopup(const int x, const int y, MapItem *const mapItem) mBrowserBox->clearRows(); // TRANSLATORS: popup menu header - mBrowserBox->addRow(_("Map Item")); + mBrowserBox->addRow(_("Map Item"), false); // TRANSLATORS: popup menu item // TRANSLATORS: rename map item mBrowserBox->addRow("rename map", _("Rename")); @@ -807,7 +814,7 @@ void PopupMenu::showMapPopup(const int x, const int y, mBrowserBox->clearRows(); // TRANSLATORS: popup menu header - mBrowserBox->addRow(_("Map Item")); + mBrowserBox->addRow(_("Map Item"), false); if (isAllowCommand(ServerCommandType::slide)) { @@ -851,7 +858,7 @@ void PopupMenu::showOutfitsWindowPopup(const int x, const int y) mBrowserBox->clearRows(); // TRANSLATORS: popup menu header - mBrowserBox->addRow(_("Outfits")); + mBrowserBox->addRow(_("Outfits"), false); // TRANSLATORS: popup menu item // TRANSLATORS: copy selected outfit to chat input mBrowserBox->addRow("/outfittochat", _("Add to chat")); @@ -889,7 +896,7 @@ void PopupMenu::showSpellPopup(const int x, const int y, mY = y; // TRANSLATORS: popup menu header - mBrowserBox->addRow(_("Spells")); + mBrowserBox->addRow(_("Spells"), false); // TRANSLATORS: popup menu item // TRANSLATORS: edit selected spell mBrowserBox->addRow("edit spell", _("Edit spell")); @@ -1043,7 +1050,8 @@ void PopupMenu::showChatPopup(const int x, const int y, ChatTab *const tab) mBrowserBox->addRow(strprintf("@@guild-pos|%s >@@", // TRANSLATORS: popup menu item // TRANSLATORS: change player position in guild - _("Change pos in guild"))); + _("Change pos in guild")), + false); } } } @@ -1109,7 +1117,7 @@ void PopupMenu::showChangePos(const int x, const int y) initPopup(); mBrowserBox->clearRows(); // TRANSLATORS: popup menu header - mBrowserBox->addRow(_("Change guild position")); + mBrowserBox->addRow(_("Change guild position"), false); if (localPlayer == nullptr) return; @@ -1123,7 +1131,8 @@ void PopupMenu::showChangePos(const int x, const int y) FOR_EACH (PositionsMap::const_iterator, itr, map) { mBrowserBox->addRow(strprintf("@@guild-pos-%u|%s@@", - itr->first, itr->second.c_str())); + itr->first, itr->second.c_str()), + false); } // TRANSLATORS: popup menu item // TRANSLATORS: close menu @@ -1160,7 +1169,7 @@ void PopupMenu::showWindowPopup(Window *const window) mCallerWindow = window; mBrowserBox->clearRows(); // TRANSLATORS: popup menu header - mBrowserBox->addRow(_("window")); + mBrowserBox->addRow(_("window"), false); addWindowMenu(window); @@ -1208,7 +1217,7 @@ void PopupMenu::showEmoteType() mBrowserBox->clearRows(); // TRANSLATORS: popup menu header - mBrowserBox->addRow(_("Show emotes for:")); + mBrowserBox->addRow(_("Show emotes for:"), false); // TRANSLATORS: popup menu item // TRANSLATORS: show emotes for player @@ -1910,14 +1919,16 @@ void PopupMenu::showPopup(const int x, const int y, Button *const button) mBrowserBox->addRow(strprintf("@@hide button_%s|%s %s (%s)@@", // TRANSLATORS: popup menu item btn->getActionEventId().c_str(), _("Hide"), - btn->getDescription().c_str(), btn->getCaption().c_str())); + btn->getDescription().c_str(), btn->getCaption().c_str()), + false); } else { mBrowserBox->addRow(strprintf("@@show button_%s|%s %s (%s)@@", // TRANSLATORS: popup menu item btn->getActionEventId().c_str(), _("Show"), - btn->getDescription().c_str(), btn->getCaption().c_str())); + btn->getDescription().c_str(), btn->getCaption().c_str()), + false); } } mBrowserBox->addSeparator("##3---"); @@ -1973,14 +1984,16 @@ void PopupMenu::showPopup(const int x, const int y, const ProgressBar *const b) mBrowserBox->addRow(strprintf("@@hide bar_%s|%s %s@@", // TRANSLATORS: popup menu item bar->getActionEventId().c_str(), _("Hide"), - bar->getId().c_str())); + bar->getId().c_str()), + false); } else { mBrowserBox->addRow(strprintf("@@show bar_%s|%s %s@@", // TRANSLATORS: popup menu item bar->getActionEventId().c_str(), _("Show"), - bar->getId().c_str())); + bar->getId().c_str()), + false); } } @@ -2020,11 +2033,11 @@ void PopupMenu::showAttackMonsterPopup(const int x, const int y, if (name.empty()) { // TRANSLATORS: popup menu header - mBrowserBox->addRow(_("(default)")); + mBrowserBox->addRow(_("(default)"), false); } else { - mBrowserBox->addRow(name); + mBrowserBox->addRow(name, false); } switch (type) { @@ -2103,11 +2116,11 @@ void PopupMenu::showPickupItemPopup(const int x, const int y, if (name.empty()) { // TRANSLATORS: popup menu header - mBrowserBox->addRow(_("(default)")); + mBrowserBox->addRow(_("(default)"), false); } else { - mBrowserBox->addRow(name); + mBrowserBox->addRow(name, false); } // TRANSLATORS: popup menu item @@ -2207,7 +2220,7 @@ void PopupMenu::showWindowsPopup() mBrowserBox->clearRows(); const STD_VECTOR &names = windowMenu->getButtonTexts(); // TRANSLATORS: popup menu header - mBrowserBox->addRow(_("Show window")); + mBrowserBox->addRow(_("Show window"), false); FOR_EACH (STD_VECTOR::const_iterator, it, names) { @@ -2261,7 +2274,7 @@ void PopupMenu::showSkillPopup(const SkillInfo *const info) mBrowserBox->clearRows(); // TRANSLATORS: popup menu header - mBrowserBox->addRow(_("Skill")); + mBrowserBox->addRow(_("Skill"), false); mBrowserBox->addRow("/addskillshortcut 'ITEMID'", // TRANSLATORS: popup menu item // TRANSLATORS: add skill to shortcurs tab @@ -2309,13 +2322,13 @@ void PopupMenu::showSkillOffsetPopup(const SkillInfo *const info, if (isOffsetX) { // TRANSLATORS: popup menu header - mBrowserBox->addRow(_("Skill cast offset by x")); + mBrowserBox->addRow(_("Skill cast offset by x"), false); letter = 'x'; } else { // TRANSLATORS: popup menu header - mBrowserBox->addRow(_("Skill cast offset by y")); + mBrowserBox->addRow(_("Skill cast offset by y"), false); letter = 'y'; } for (int f = -9; f <= 9; f ++) @@ -2357,7 +2370,7 @@ void PopupMenu::showSkillLevelPopup(const SkillInfo *const info) mBrowserBox->clearRows(); // TRANSLATORS: popup menu item // TRANSLATORS: skill level header - mBrowserBox->addRow(_("Select skill level")); + mBrowserBox->addRow(_("Select skill level"), false); for (int f = 1; f <= mItemIndex; f ++) { mBrowserBox->addRow(strprintf("/selectskilllevel %d %d", mItemId, f), @@ -2396,7 +2409,7 @@ void PopupMenu::showSkillTypePopup(const SkillInfo *const info) // TRANSLATORS: popup menu item // TRANSLATORS: skill cast type header - mBrowserBox->addRow(_("Select skill cast type")); + mBrowserBox->addRow(_("Select skill cast type"), false); mBrowserBox->addRow(strprintf("/selectskilltype %d 0", mItemId), // TRANSLATORS: popup menu item // TRANSLATORS: skill cast type @@ -2886,7 +2899,8 @@ void PopupMenu::showPlayerMenu() mBrowserBox->clearRows(); // TRANSLATORS: popup menu header mBrowserBox->addRow(strprintf(_("Show %s"), - mName.c_str())); + mName.c_str()), + false); if (isAllowCommand(ServerCommandType::accinfo)) { // TRANSLATORS: popup menu item @@ -3157,7 +3171,8 @@ void PopupMenu::showMuteCommands() mBrowserBox->clearRows(); // TRANSLATORS: popup menu header mBrowserBox->addRow(strprintf(_("Mute %s"), - mName.c_str())); + mName.c_str()), + false); if (mBeingId != BeingId_zero && Net::getNetworkType() != ServerType::TMWATHENA && isAllowCommand(ServerCommandType::mute)) @@ -3381,7 +3396,7 @@ void PopupMenu::showGMPopup(const std::string &name) { mBrowserBox->clearRows(); // TRANSLATORS: popup menu header - mBrowserBox->addRow(_("GM commands")); + mBrowserBox->addRow(_("GM commands"), false); if (localPlayer->isGM()) { switch (mType) diff --git a/src/gui/popups/speechbubble.cpp b/src/gui/popups/speechbubble.cpp index 1ae67fb99..f4c74cfae 100644 --- a/src/gui/popups/speechbubble.cpp +++ b/src/gui/popups/speechbubble.cpp @@ -78,7 +78,8 @@ void SpeechBubble::setText(const std::string &text, const bool showName) int width = mCaption->getWidth(); mSpeechBox->clearRows(); - mSpeechBox->addRow(text); + mSpeechBox->addRow(text, + false); mSpeechBox->updateHeight(); const int speechWidth = mSpeechBox->getWidth(); diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index 87eb14c48..f028dec29 100644 --- a/src/gui/widgets/desktop.cpp +++ b/src/gui/widgets/desktop.cpp @@ -73,12 +73,14 @@ Desktop::Desktop(const Widget2 *const widget) : const std::string appName = branding.getValue("appName", std::string()); if (appName.empty()) { - mVersionLabel->addRow(FULL_VERSION); + mVersionLabel->addRow(FULL_VERSION, + false); } else { mVersionLabel->addRow(strprintf("%s (%s)", FULL_VERSION, - appName.c_str())); + appName.c_str()), + false); } mVersionLabel->addRow("copyright", "(C) ManaPlus developers, http://manaplus.org"); diff --git a/src/gui/widgets/staticbrowserbox.cpp b/src/gui/widgets/staticbrowserbox.cpp index de0d787a7..38e936579 100644 --- a/src/gui/widgets/staticbrowserbox.cpp +++ b/src/gui/widgets/staticbrowserbox.cpp @@ -291,7 +291,8 @@ void StaticBrowserBox::addRow(const std::string &cmd, const char *const text) { addRow(strprintf("@@%s|%s@@", encodeLinkText(cmd).c_str(), - encodeLinkText(text).c_str())); + encodeLinkText(text).c_str()), + false); } void StaticBrowserBox::addImage(const std::string &path) diff --git a/src/gui/widgets/staticbrowserbox.h b/src/gui/widgets/staticbrowserbox.h index ff5862577..452bea681 100644 --- a/src/gui/widgets/staticbrowserbox.h +++ b/src/gui/widgets/staticbrowserbox.h @@ -78,7 +78,7 @@ class StaticBrowserBox final : public Widget, * Adds a text row to the browser. */ void addRow(const std::string &row, - const bool atTop = false); + const bool atTop); /** * Adds a menu line to the browser. diff --git a/src/gui/windows/didyouknowwindow.cpp b/src/gui/windows/didyouknowwindow.cpp index f6bf36ac6..64f08a323 100644 --- a/src/gui/windows/didyouknowwindow.cpp +++ b/src/gui/windows/didyouknowwindow.cpp @@ -176,7 +176,7 @@ void DidYouKnowWindow::loadFile(const int num) translator, lines); for (size_t i = 0, sz = lines.size(); i < sz; ++i) - mBrowserBox->addRow(lines[i]); + mBrowserBox->addRow(lines[i], false); } void DidYouKnowWindow::setVisible(Visible visible) diff --git a/src/gui/windows/helpwindow.cpp b/src/gui/windows/helpwindow.cpp index 44203d46d..2823c6da9 100644 --- a/src/gui/windows/helpwindow.cpp +++ b/src/gui/windows/helpwindow.cpp @@ -157,7 +157,7 @@ void HelpWindow::loadFile(std::string file) translator, lines); for (size_t i = 0, sz = lines.size(); i < sz; ++i) - mBrowserBox->addRow(lines[i]); + mBrowserBox->addRow(lines[i], false); } void HelpWindow::loadTags() @@ -209,7 +209,8 @@ void HelpWindow::search(const std::string &text0) { const char *const str = (*it).c_str(); mBrowserBox->addRow(strprintf(" -> @@%s|%s@@", str, - translator->getChar(str))); + translator->getChar(str)), + false); } loadFile("footer"); mScrollArea->setVerticalScrollAmount(0); diff --git a/src/gui/windows/serverinfowindow.cpp b/src/gui/windows/serverinfowindow.cpp index 20f8d5f42..d3c851835 100644 --- a/src/gui/windows/serverinfowindow.cpp +++ b/src/gui/windows/serverinfowindow.cpp @@ -100,20 +100,23 @@ void ServerInfoWindow::showServerInfo() if (type == ServerFreeType::Free) { // TRANSLATORS: server info comment - mBrowserBox->addRow(_("##BServer with free license.")); + mBrowserBox->addRow(_("##BServer with free license."), + false); } else if (type == ServerFreeType::NonFree) { // TRANSLATORS: server info comment - mBrowserBox->addRow(_("##BServer with non free license.")); + mBrowserBox->addRow(_("##BServer with non free license."), + false); } else if (type == ServerFreeType::Unknown || type == ServerFreeType::NotSet) { // TRANSLATORS: server info comment - mBrowserBox->addRow(_("##BServer unknown license.")); + mBrowserBox->addRow(_("##BServer unknown license."), + false); } - mBrowserBox->addRow(""); + mBrowserBox->addRow("", false); addServerComment(mServerInfo.serverUrl, // TRANSLATORS: server info comment _("Server")); @@ -141,8 +144,8 @@ void ServerInfoWindow::addSourcesList(const STD_VECTOR &list, { if (!list.empty()) { - mBrowserBox->addRow(""); - mBrowserBox->addRow(comment); + mBrowserBox->addRow("", false); + mBrowserBox->addRow(comment, false); FOR_EACH (STD_VECTOR::const_iterator, it, list) { const ServerUrlInfo &info = *it; @@ -171,7 +174,8 @@ void ServerInfoWindow::addServerComment(const std::string &url, comment.c_str(), url.c_str()); } - mBrowserBox->addRow(str); + mBrowserBox->addRow(str, + false); } } diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index 3858b0a5e..5bff64bc3 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -399,24 +399,24 @@ void UpdaterWindow::loadNews() if (file.is_open()) file << line << std::endl; if (cnt < maxNews) - mBrowserBox->addRow(line); + mBrowserBox->addRow(line, false); } else { if (file.is_open()) file << line << std::endl; if (cnt < maxNews) - mBrowserBox->addRow(line); + mBrowserBox->addRow(line, false); } } file.close(); if (cnt > maxNews) { - mBrowserBox->addRow(""); + mBrowserBox->addRow("", false); // TRANSLATORS: updater window checkbox mBrowserBox->addRow("news", _("Show all news (can be slow)")); - mBrowserBox->addRow(""); + mBrowserBox->addRow("", false); } // Free the memory buffer now that we don't need it anymore free(mMemoryBuffer); @@ -856,15 +856,18 @@ void UpdaterWindow::logic() switch (mDownloadStatus) { case UpdateDownloadStatus::UPDATE_ERROR: - mBrowserBox->addRow(""); + mBrowserBox->addRow("", false); // TRANSLATORS: update message - mBrowserBox->addRow(_("##1 The update process is incomplete.")); + mBrowserBox->addRow(_("##1 The update process is incomplete."), + false); // TRANSLATORS: Continues "The update process is incomplete.". - mBrowserBox->addRow(_("##1 It is strongly recommended that")); + mBrowserBox->addRow(_("##1 It is strongly recommended that"), + false); // TRANSLATORS: Begins "It is strongly recommended that". - mBrowserBox->addRow(_("##1 you try again later.")); + mBrowserBox->addRow(_("##1 you try again later."), + false); if (mDownload != nullptr) - mBrowserBox->addRow(mDownload->getError()); + mBrowserBox->addRow(mDownload->getError(), false); mBrowserBox->updateHeight(); mScrollArea->setVerticalScrollAmount( mScrollArea->getVerticalMaxScroll()); @@ -1095,7 +1098,7 @@ void UpdaterWindow::loadFile(std::string file) Files::loadTextFileLocal(mUpdatesDir + "/local/help/news.txt", lines); for (size_t i = 0, sz = lines.size(); i < sz; ++i) - mBrowserBox->addRow(lines[i]); + mBrowserBox->addRow(lines[i], false); mBrowserBox->updateHeight(); } diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index 41738180a..8e35fb141 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -247,34 +247,34 @@ void WhoIsOnline::updateWindow(size_t numOnline) bool addedFromSection(false); FOR_EACH (STD_VECTOR::const_iterator, it, mFriends) { - mBrowserBox->addRow((*it)->getText()); + mBrowserBox->addRow((*it)->getText(), false); addedFromSection = true; } if (addedFromSection == true) { - mBrowserBox->addRow("---"); + mBrowserBox->addRow("---", false); addedFromSection = false; } FOR_EACH (STD_VECTOR::const_iterator, it, mEnemy) { - mBrowserBox->addRow((*it)->getText()); + mBrowserBox->addRow((*it)->getText(), false); addedFromSection = true; } if (addedFromSection == true) { - mBrowserBox->addRow("---"); + mBrowserBox->addRow("---", false); addedFromSection = false; } FOR_EACH (STD_VECTOR::const_iterator, it, mNeutral) { - mBrowserBox->addRow((*it)->getText()); + mBrowserBox->addRow((*it)->getText(), false); addedFromSection = true; } if (addedFromSection == true && !mDisregard.empty()) - mBrowserBox->addRow("---"); + mBrowserBox->addRow("---", false); FOR_EACH (STD_VECTOR::const_iterator, it, mDisregard) - mBrowserBox->addRow((*it)->getText()); + mBrowserBox->addRow((*it)->getText(), false); if (mScrollArea->getVerticalMaxScroll() < mScrollArea->getVerticalScrollAmount()) -- cgit v1.2.3-60-g2f50