Ansariel 2023-12-09 14:59:53 +01:00
commit 4f974f4e91
9 changed files with 109 additions and 60 deletions

View File

@ -726,6 +726,13 @@ void LLStatBar::drawLabelAndValue( F32 value, std::string &label, LLRect &bar_re
void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect )
{
// <FS:Beq> FIRE-33481 - FS hangs on login, progress bar full
LL_DEBUGS("STATBAR") << "name: " << this->getName() << "min: " << min << ", max: " << max << ", value_scale: " << value_scale << LL_ENDL;
if ( value_scale == INFINITY )
{
return;
}
// </FS:Beq>
if (!llisnan(min) && (mAutoScaleMax || mAutoScaleMin))
{
F32 u = LLSmoothInterpolation::getInterpolant(10.f);

View File

@ -44,21 +44,20 @@
#include "llfloaterreg.h"
#include "discord-rpc/discord_rpc.h"
#include "boost/algorithm/string/case_conv.hpp"
#include <discord-rpc/discord_rpc.h>
#include <boost/algorithm/string/case_conv.hpp>
#include "fsdiscordkey.h"
#include "llviewernetwork.h"
boost::scoped_ptr<LLEventPump> FSDiscordConnect::sStateWatcher(new LLEventStream("DiscordConnectState"));
boost::scoped_ptr<LLEventPump> FSDiscordConnect::sInfoWatcher(new LLEventStream("DiscordConnectInfo"));
std::unique_ptr<LLEventPump> FSDiscordConnect::sStateWatcher = std::make_unique<LLEventStream>("DiscordConnectState");
std::unique_ptr<LLEventPump> FSDiscordConnect::sInfoWatcher = std::make_unique<LLEventStream>("DiscordConnectInfo");
// Returns false when the file exists and has not our UUID
// Or, put simply, returns true if someone else is using it
bool FSDiscordConnect::checkMarkerFile()
bool FSDiscordConnect::checkMarkerFile() const
{
if (!LLFile::isfile(mMarkerFilename))
{
@ -94,7 +93,7 @@ void FSDiscordConnect::clearMarkerFile()
LLFile::remove(mMarkerFilename);
}
void handleDiscordReady(const DiscordUser *request)
static void handleDiscordReady(const DiscordUser *request)
{
LLSD info;
info["name"] = request->username;
@ -102,12 +101,12 @@ void handleDiscordReady(const DiscordUser *request)
FSDiscordConnect::getInstance()->setConnectionState(FSDiscordConnect::DISCORD_CONNECTED);
}
void handleDiscordError(int errorCode, const char* message)
static void handleDiscordError(int errorCode, const char* message)
{
LL_WARNS("DiscordConnect") << "Discord error, errorCode: \"" << errorCode << "\", message: \"" << message << "\"" << LL_ENDL;
}
void handleDiscordDisconnected(int errorCode, const char* message)
static void handleDiscordDisconnected(int errorCode, const char* message)
{
LL_INFOS("DiscordConnect") << "Discord disconnected, errorCode: \"" << errorCode << "\", message: \"" << message << "\"" << LL_ENDL;
FSDiscordConnect::getInstance()->setConnectionState(FSDiscordConnect::DISCORD_NOT_CONNECTED);
@ -157,7 +156,7 @@ void FSDiscordConnect::discordConnectedCoro(bool autoConnect)
}
bool isRegionVisible(LLViewerRegion* region)
static bool isRegionVisible(LLViewerRegion* region)
{
U8 rating = region->getSimAccess();
bool visible = true;
@ -183,9 +182,9 @@ bool isRegionVisible(LLViewerRegion* region)
return visible;
}
void FSDiscordConnect::updateRichPresence()
void FSDiscordConnect::updateRichPresence() const
{
LLViewerRegion * region = gAgent.getRegion();
LLViewerRegion* region = gAgent.getRegion();
if (!isConnected() || !region)
{
return;
@ -238,7 +237,8 @@ void FSDiscordConnect::updateRichPresence()
discordPresence.largeImageKey = "secondlife_512";
#endif
discordPresence.largeImageText = LLGridManager::getInstance()->getGridLabel().c_str();
auto gridLabel = LLGridManager::getInstance()->getGridLabel();
discordPresence.largeImageText = gridLabel.c_str();
discordPresence.smallImageKey = "firestorm_512";
std::string appName = std::string("via " + APP_NAME);
discordPresence.smallImageText = appName.c_str();
@ -256,10 +256,11 @@ FSDiscordConnect::FSDiscordConnect()
: mConnectionState(DISCORD_NOT_CONNECTED),
mConnected(false),
mInfo(),
mRefreshInfo(false)
mRefreshInfo(false),
mConnectTime(0)
{
mMarkerFilename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "discord_in_use_marker");
LLEventPumps::instance().obtain("mainloop").listen("FSDiscordConnect", boost::bind(&FSDiscordConnect::Tick, this, _1));
LLEventPumps::instance().obtain("mainloop").listen("FSDiscordConnect", std::bind(&FSDiscordConnect::Tick, this, std::placeholders::_1));
}
FSDiscordConnect::~FSDiscordConnect()
@ -270,7 +271,7 @@ FSDiscordConnect::~FSDiscordConnect()
void FSDiscordConnect::connectToDiscord()
{
LLCoros::instance().launch("FSDiscordConnect::discordConnectCoro",
boost::bind(&FSDiscordConnect::discordConnectCoro, this));
std::bind(&FSDiscordConnect::discordConnectCoro, this));
}
void FSDiscordConnect::disconnectFromDiscord()
@ -278,13 +279,13 @@ void FSDiscordConnect::disconnectFromDiscord()
setConnectionState(FSDiscordConnect::DISCORD_DISCONNECTING);
LLCoros::instance().launch("FSDiscordConnect::discordDisconnectCoro",
boost::bind(&FSDiscordConnect::discordDisconnectCoro, this));
std::bind(&FSDiscordConnect::discordDisconnectCoro, this));
}
void FSDiscordConnect::checkConnectionToDiscord(bool auto_connect)
{
LLCoros::instance().launch("FSDiscordConnect::discordConnectedCoro",
boost::bind(&FSDiscordConnect::discordConnectedCoro, this, auto_connect));
std::bind(&FSDiscordConnect::discordConnectedCoro, this, auto_connect));
}
bool FSDiscordConnect::Tick(const LLSD&)

View File

@ -60,10 +60,10 @@ public:
void setConnectionState(EConnectionState connection_state);
void setConnected(bool connected);
bool isConnected() { return mConnected; }
bool isConnected() const { return mConnected; }
EConnectionState getConnectionState() { return mConnectionState; }
void updateRichPresence();
void updateRichPresence() const;
bool Tick(const LLSD&);
@ -74,15 +74,14 @@ private:
LLSD mInfo;
bool mRefreshInfo;
static boost::scoped_ptr<LLEventPump> sStateWatcher;
static boost::scoped_ptr<LLEventPump> sInfoWatcher;
static boost::scoped_ptr<LLEventPump> sContentWatcher;
static std::unique_ptr<LLEventPump> sStateWatcher;
static std::unique_ptr<LLEventPump> sInfoWatcher;
void discordConnectCoro();
void discordDisconnectCoro();
void discordConnectedCoro(bool autoConnect);
bool checkMarkerFile();
bool checkMarkerFile() const;
void setMarkerFile();
void clearMarkerFile();

View File

@ -44,23 +44,22 @@
#include "llfloaterreg.h"
#include "llcorehttputil.h"
boost::scoped_ptr<LLEventPump> LLFlickrConnect::sStateWatcher(new LLEventStream("FlickrConnectState"));
boost::scoped_ptr<LLEventPump> LLFlickrConnect::sInfoWatcher(new LLEventStream("FlickrConnectInfo"));
boost::scoped_ptr<LLEventPump> LLFlickrConnect::sContentWatcher(new LLEventStream("FlickrConnectContent"));
std::unique_ptr<LLEventPump> LLFlickrConnect::sStateWatcher = std::make_unique<LLEventStream>("FlickrConnectState");
std::unique_ptr<LLEventPump> LLFlickrConnect::sInfoWatcher = std::make_unique<LLEventStream>("FlickrConnectInfo");
// Local functions
void log_flickr_connect_error(const std::string& request, U32 status, const std::string& reason, const std::string& code, const std::string& description)
static void log_flickr_connect_error(const std::string& request, U32 status, const std::string& reason, const std::string& code, const std::string& description)
{
// Note: 302 (redirect) is *not* an error that warrants logging
if (status != 302)
{
LL_WARNS("FlickrConnect") << request << " request failed with a " << status << " " << reason << ". Reason: " << code << " (" << description << ")" << LL_ENDL;
LL_WARNS("FlickrConnect") << request << " request failed with a " << status << " " << reason << ". Reason: " << code << " (" << description << ")" << LL_ENDL;
}
}
void toast_user_for_flickr_success()
static void toast_user_for_flickr_success()
{
LLSD args;
LLSD args;
args["MESSAGE"] = LLTrans::getString("flickr_post_success");
LLNotificationsUtil::add("FlickrConnect", args);
}
@ -437,19 +436,19 @@ std::string LLFlickrConnect::getFlickrConnectURL(const std::string& route, bool
void LLFlickrConnect::connectToFlickr(const std::string& request_token, const std::string& oauth_verifier)
{
LLCoros::instance().launch("LLFlickrConnect::flickrConnectCoro",
boost::bind(&LLFlickrConnect::flickrConnectCoro, this, request_token, oauth_verifier));
std::bind(&LLFlickrConnect::flickrConnectCoro, this, request_token, oauth_verifier));
}
void LLFlickrConnect::disconnectFromFlickr()
{
LLCoros::instance().launch("LLFlickrConnect::flickrDisconnectCoro",
boost::bind(&LLFlickrConnect::flickrDisconnectCoro, this));
std::bind(&LLFlickrConnect::flickrDisconnectCoro, this));
}
void LLFlickrConnect::checkConnectionToFlickr(bool auto_connect)
{
LLCoros::instance().launch("LLFlickrConnect::flickrConnectedCoro",
boost::bind(&LLFlickrConnect::flickrConnectedCoro, this, auto_connect));
std::bind(&LLFlickrConnect::flickrConnectedCoro, this, auto_connect));
}
void LLFlickrConnect::loadFlickrInfo()
@ -457,7 +456,7 @@ void LLFlickrConnect::loadFlickrInfo()
if(mRefreshInfo)
{
LLCoros::instance().launch("LLFlickrConnect::flickrInfoCoro",
boost::bind(&LLFlickrConnect::flickrInfoCoro, this));
std::bind(&LLFlickrConnect::flickrInfoCoro, this));
}
}
@ -473,7 +472,7 @@ void LLFlickrConnect::uploadPhoto(const std::string& image_url, const std::strin
setConnectionState(LLFlickrConnect::FLICKR_POSTING);
LLCoros::instance().launch("LLFlickrConnect::flickrShareCoro",
boost::bind(&LLFlickrConnect::flickrShareCoro, this, body));
std::bind(&LLFlickrConnect::flickrShareCoro, this, body));
}
void LLFlickrConnect::uploadPhoto(LLPointer<LLImageFormatted> image, const std::string& title, const std::string& description, const std::string& tags, int safety_level)
@ -481,7 +480,7 @@ void LLFlickrConnect::uploadPhoto(LLPointer<LLImageFormatted> image, const std::
setConnectionState(LLFlickrConnect::FLICKR_POSTING);
LLCoros::instance().launch("LLFlickrConnect::flickrShareImageCoro",
boost::bind(&LLFlickrConnect::flickrShareImageCoro, this, image,
std::bind(&LLFlickrConnect::flickrShareImageCoro, this, image,
title, description, tags, safety_level));
}

View File

@ -78,8 +78,8 @@ public:
void setConnectionState(EConnectionState connection_state);
void setConnected(bool connected);
bool isConnected() { return mConnected; }
bool isTransactionOngoing() { return ((mConnectionState == FLICKR_CONNECTION_IN_PROGRESS) || (mConnectionState == FLICKR_POSTING) || (mConnectionState == FLICKR_DISCONNECTING)); }
bool isConnected() const { return mConnected; }
bool isTransactionOngoing() const { return ((mConnectionState == FLICKR_CONNECTION_IN_PROGRESS) || (mConnectionState == FLICKR_POSTING) || (mConnectionState == FLICKR_DISCONNECTING)); }
EConnectionState getConnectionState() { return mConnectionState; }
void openFlickrWeb(std::string url);
@ -94,9 +94,8 @@ private:
bool mRefreshInfo;
bool mReadFromMaster;
static boost::scoped_ptr<LLEventPump> sStateWatcher;
static boost::scoped_ptr<LLEventPump> sInfoWatcher;
static boost::scoped_ptr<LLEventPump> sContentWatcher;
static std::unique_ptr<LLEventPump> sStateWatcher;
static std::unique_ptr<LLEventPump> sInfoWatcher;
bool testShareStatus(LLSD &result);
void flickrConnectCoro(std::string requestToken, std::string oauthVerifier);

View File

@ -191,8 +191,10 @@ LLTextureToolTip::LLTextureToolTip(const LLToolTip::Params& p)
mMaxWidth = llmax(mMaxWidth, mPreviewSize);
// Currently has to share params with LLToolTip, override values
setBackgroundColor(LLColor4::black);
setTransparentColor(LLColor4::black);
// <FS:Ansariel> Make the texture tooltip not look ugly
//setBackgroundColor(LLColor4::black);
//setTransparentColor(LLColor4::black);
// </FS:Ansariel>
setBorderVisible(true);
}
@ -226,22 +228,27 @@ void LLTextureToolTip::initFromParams(const LLToolTip::Params& p)
// Currently has to share params with LLToolTip, override values manually
// Todo: provide from own params instead, may be like object inspector does it
LLViewBorder::Params border_params;
border_params.border_thickness(LLPANEL_BORDER_WIDTH);
border_params.highlight_light_color(LLColor4::white);
border_params.highlight_dark_color(LLColor4::white);
border_params.shadow_light_color(LLColor4::white);
border_params.shadow_dark_color(LLColor4::white);
addBorder(border_params);
setBorderVisible(true);
// <FS:Ansariel> Make the texture tooltip not look ugly
//LLViewBorder::Params border_params;
//border_params.border_thickness(LLPANEL_BORDER_WIDTH);
//border_params.highlight_light_color(LLColor4::white);
//border_params.highlight_dark_color(LLColor4::white);
//border_params.shadow_light_color(LLColor4::white);
//border_params.shadow_dark_color(LLColor4::white);
//addBorder(border_params);
//setBorderVisible(true);
// <FS:Ansariel>
setBackgroundColor(LLColor4::black);
// <FS:Ansariel> Make the texture tooltip not look ugly
// setBackgroundColor(LLColor4::black);
setBackgroundVisible(true);
setBackgroundOpaque(true);
setBackgroundImage(nullptr);
// <FS:Ansariel> Make the texture tooltip not look ugly
//setBackgroundImage(nullptr);
setTransparentImage(nullptr);
mTextBox->setColor(LLColor4::white);
// <FS:Ansariel> Make the texture tooltip not look ugly
//mTextBox->setColor(LLColor4::white);
snapToChildren();
}

View File

@ -41,6 +41,10 @@
#include "llinventorymodel.h"
#include "llviewerinventory.h"
#include "llinspecttexture.h"
#include "lltooltip.h"
#include "llviewercontrol.h"
static LLWidgetNameRegistry::StaticRegistrar sRegisterPanelInventoryListItemBaseParams(&typeid(LLPanelInventoryListItemBase::Params), "inventory_list_item");
static const S32 WIDGET_SPACING = 3;
@ -418,7 +422,35 @@ void LLPanelInventoryListItemBase::setTitle(const std::string& title,
BOOL LLPanelInventoryListItemBase::handleToolTip( S32 x, S32 y, MASK mask)
{
LLRect text_box_rect = mTitleCtrl->getRect();
const LLRect& text_box_rect = mTitleCtrl->getRect();
// <FS:Ansariel> Make inventory thumbnail tooltips work with inventory lists
static LLCachedControl<bool> showInventoryThumbnailTooltips(gSavedSettings, "FSShowInventoryThumbnailTooltips");
if (showInventoryThumbnailTooltips && text_box_rect.pointInRect(x, y))
{
if (auto inventoryItem = gInventory.getItem(mInventoryItemUUID); inventoryItem)
{
if (const LLUUID& thumbnailUUID = inventoryItem->getThumbnailUUID(); !thumbnailUUID.isNull())
{
static LLCachedControl<F32> inventoryThumbnailTooltipsDelay(gSavedSettings, "FSInventoryThumbnailTooltipsDelay");
static LLCachedControl<F32> tooltip_fast_delay(gSavedSettings, "ToolTipFastDelay");
F32 tooltipDelay = LLToolTipMgr::instance().toolTipVisible() ? tooltip_fast_delay() : inventoryThumbnailTooltipsDelay();
LLSD params;
params["thumbnail_id"] = thumbnailUUID;
LLToolTipMgr::instance().show(LLToolTip::Params()
.message(inventoryItem->getName())
.sticky_rect(calcScreenRect())
.delay_time(tooltipDelay)
.create_callback(boost::bind(&LLInspectTextureUtil::createInventoryToolTip, _1))
.create_params(params));
return TRUE;
}
}
}
// </FS:Ansariel>
if (text_box_rect.pointInRect(x, y) &&
mTitleCtrl->getTextPixelWidth() <= text_box_rect.getWidth())
{

View File

@ -81,11 +81,11 @@
<panel
bevel_style="none"
border="true"
bottom="445"
bottom="485"
follows="left|bottom|right"
left="20"
right="-20"
top="445" />
top="485" />
<button
follows="left|bottom|right"
height="23"
@ -95,7 +95,7 @@
layout="topleft"
left="185"
name="btn_clear_all"
top="462"
top="495"
width="130">
<button.commit_callback function="Toybox.ClearAll" />
</button>
@ -108,7 +108,7 @@
layout="topleft"
left="335"
name="btn_restore_defaults"
top="462"
top="495"
width="130">
<button.commit_callback function="Toybox.RestoreDefaults" />
</button>

View File

@ -57,6 +57,11 @@
<check_box label="Redimensionnement automatique des listes de conversations et de notifications de style V1" name="FSLegacyNotificationWellAutoResize" tool_tip="Si cette case est cochée, Firestorm redimensionnera toujours automatiquement les listes de conversations et de notifications de style V1 lorsque des éléments sont ajoutés ou supprimés."/>
<check_box label="Redéfinit les réccourcis déjà utilisés par Linux (Linux seul; requires restart)" name="FSRemapLinuxShortcuts" tool_tip="Activée, cette option redéfinit les raccourcis déjà utilisés par Linux (par exemple : CTRL-ALT-Fx)."/>
<check_box label="Empêche le fenêtre de statistiques d'obtenir le focus" name="FSStatisticsNoFocus" tool_tip="Si cette option est activée, la fenêtre de statistiques n'obtiendra jamais le focus quand une autre fenêtre est fermée (des actions telles que la modification de la présentation des graphiques sont toujours possibles)."/>
<check_box label="Afficher les vignettes des articles d'inventaire dans les infobulles" name="FSShowInventoryThumbnailTooltips" tool_tip="Si cette option est activée, le survol d'éléments d'inventaire contenant une vignette affichera cette dernière dans une infobulle."/>
<slider label="Délai d'affichage de l'infobulle :" tool_tip="Délai d'affichage des vignettes des éléments d'inventaire dans les infobulles" name="FSInventoryThumbnailTooltipsDelay"/>
<text name="FSInventoryThumbnailTooltipsDelayText">
sec
</text>
<slider label="Nombre de flashs sur les onglets d'IM :" label_width="210" name="ButtonsFlashCount"/>
<slider label="Durée de flash de l'avertissement :" label_width="210" tool_tip="Durée en secondes d'un flash utilisé pour notifier les notifications de message manqué" name="ButtonFlashRate"/>
<text name="ButtonFlashRateText">sec</text>