More stuff I missed...

master
Ansariel 2025-08-09 11:31:03 +02:00
parent 33da1b75f7
commit 29739cdb18
2 changed files with 16 additions and 27 deletions

View File

@ -152,7 +152,6 @@ void FSFloaterPrimfeed::update()
} }
} }
// virtual
S32 FSPrimfeedPhotoPanel::notify(const LLSD& info) S32 FSPrimfeedPhotoPanel::notify(const LLSD& info)
{ {
if (info.has("snapshot-updating")) if (info.has("snapshot-updating"))
@ -242,8 +241,7 @@ void FSPrimfeedPhotoPanel::draw()
LLSnapshotLivePreview* FSPrimfeedPhotoPanel::getPreviewView() LLSnapshotLivePreview* FSPrimfeedPhotoPanel::getPreviewView()
{ {
auto previewp = (LLSnapshotLivePreview*)mPreviewHandle.get(); return (LLSnapshotLivePreview*)mPreviewHandle.get();
return previewp;
} }
void FSPrimfeedPhotoPanel::onVisibilityChange(bool visible) void FSPrimfeedPhotoPanel::onVisibilityChange(bool visible)
@ -252,8 +250,7 @@ void FSPrimfeedPhotoPanel::onVisibilityChange(bool visible)
{ {
if (mPreviewHandle.get()) if (mPreviewHandle.get())
{ {
LLSnapshotLivePreview* preview = getPreviewView(); if (LLSnapshotLivePreview* preview = getPreviewView())
if (preview)
{ {
LL_DEBUGS() << "opened, updating snapshot" << LL_ENDL; LL_DEBUGS() << "opened, updating snapshot" << LL_ENDL;
preview->updateSnapshot(true); preview->updateSnapshot(true);
@ -282,8 +279,7 @@ void FSPrimfeedPhotoPanel::onVisibilityChange(bool visible)
void FSPrimfeedPhotoPanel::onClickNewSnapshot() void FSPrimfeedPhotoPanel::onClickNewSnapshot()
{ {
LLSnapshotLivePreview* previewp = getPreviewView(); if (LLSnapshotLivePreview* previewp = getPreviewView())
if (previewp)
{ {
previewp->updateSnapshot(true); previewp->updateSnapshot(true);
} }
@ -335,7 +331,7 @@ bool FSPrimfeedPhotoPanel::onPrimfeedConnectStateChange(const LLSD& /*data*/)
void FSPrimfeedPhotoPanel::sendPhoto() void FSPrimfeedPhotoPanel::sendPhoto()
{ {
auto ratingToString = [&](int rating) auto ratingToString = [](S32 rating)
{ {
static const std::array<std::string, 4> RATING_NAMES = { static const std::array<std::string, 4> RATING_NAMES = {
"general", // 1 "general", // 1
@ -345,14 +341,14 @@ void FSPrimfeedPhotoPanel::sendPhoto()
}; };
// clamp into [1,4] // clamp into [1,4]
int idx = llclamp(rating, 1, 4) - 1; S32 idx = llclamp(rating, 1, 4) - 1;
return RATING_NAMES[idx]; return RATING_NAMES[idx];
}; };
// Get the description (primfeed has no title/tags etc at this point) // Get the description (primfeed has no title/tags etc at this point)
std::string description = mDescriptionTextBox->getValue().asString(); std::string description = mDescriptionTextBox->getValue().asString();
// Get the content rating // Get the content rating
int content_rating = mRatingComboBox->getValue().asInteger(); S32 content_rating = mRatingComboBox->getValue().asInteger();
bool post_to_public_gallery = mPublicGalleryCheckbox->get(); bool post_to_public_gallery = mPublicGalleryCheckbox->get();
bool commercial_content = mCommercialCheckbox->get(); bool commercial_content = mCommercialCheckbox->get();
std::string store_id = mStoresComboBox->getValue().asString(); std::string store_id = mStoresComboBox->getValue().asString();
@ -429,9 +425,7 @@ void FSPrimfeedPhotoPanel::updateControls()
void FSPrimfeedPhotoPanel::updateResolution(bool do_update) void FSPrimfeedPhotoPanel::updateResolution(bool do_update)
{ {
auto combobox = static_cast<LLComboBox*>(mResolutionComboBox); std::string sdstring = mResolutionComboBox->getSelectedValue();
std::string sdstring = combobox->getSelectedValue();
LLSD sdres; LLSD sdres;
std::stringstream sstream(sdstring); std::stringstream sstream(sdstring);
LLSDSerialize::fromNotation(sdres, sstream, sdstring.size()); LLSDSerialize::fromNotation(sdres, sstream, sdstring.size());
@ -442,7 +436,7 @@ void FSPrimfeedPhotoPanel::updateResolution(bool do_update)
// Note : index 0 of the filter drop down is assumed to be "No filter" in whichever locale // Note : index 0 of the filter drop down is assumed to be "No filter" in whichever locale
std::string filter_name = (mFilterComboBox->getCurrentIndex() > 0 ? mFilterComboBox->getSimple() : ""); std::string filter_name = (mFilterComboBox->getCurrentIndex() > 0 ? mFilterComboBox->getSimple() : "");
if (auto previewp = static_cast<LLSnapshotLivePreview*>(mPreviewHandle.get()); previewp && combobox->getCurrentIndex() >= 0) if (auto previewp = static_cast<LLSnapshotLivePreview*>(mPreviewHandle.get()); previewp && mResolutionComboBox->getCurrentIndex() >= 0)
{ {
checkAspectRatio(width); checkAspectRatio(width);
@ -518,7 +512,7 @@ void FSPrimfeedPhotoPanel::checkAspectRatio(S32 index)
} }
else if (-1 == index) else if (-1 == index)
{ {
keep_aspect = getChild<LLCheckBoxCtrl>("keep_aspect_ratio")->get(); keep_aspect = mKeepAspectRatioCbx->get();
} }
else // predefined resolution else // predefined resolution
{ {
@ -569,8 +563,7 @@ void FSPrimfeedPhotoPanel::onOpen(const LLSD& key)
{ {
// Reauthorise if necessary. // Reauthorise if necessary.
FSPrimfeedAuth::initiateAuthRequest(); FSPrimfeedAuth::initiateAuthRequest();
LLSD dummy; onPrimfeedConnectStateChange(LLSD());
onPrimfeedConnectStateChange(dummy);
} }
void FSPrimfeedPhotoPanel::uploadCallback(bool success, const LLSD& response) void FSPrimfeedPhotoPanel::uploadCallback(bool success, const LLSD& response)
@ -688,9 +681,8 @@ bool FSPrimfeedAccountPanel::postBuild()
mAccountConnectedAsLabel = getChild<LLTextBox>("connected_as_label"); mAccountConnectedAsLabel = getChild<LLTextBox>("connected_as_label");
mAccountNameLink = getChild<LLTextBox>("primfeed_account_name"); mAccountNameLink = getChild<LLTextBox>("primfeed_account_name");
mAccountPlan = getChild<LLTextBox>("primfeed_account_plan"); mAccountPlan = getChild<LLTextBox>("primfeed_account_plan");
mPanelButtons = getChild<LLUICtrl>("panel_buttons"); mConnectButton = getChild<LLButton>("connect_btn");
mConnectButton = getChild<LLUICtrl>("connect_btn"); mDisconnectButton = getChild<LLButton>("disconnect_btn");
mDisconnectButton = getChild<LLUICtrl>("disconnect_btn");
LLSD dummy; LLSD dummy;
onPrimfeedConnectStateChange(dummy); onPrimfeedConnectStateChange(dummy);
@ -807,15 +799,13 @@ void FSPrimfeedAccountPanel::showConnectedLayout()
void FSPrimfeedAccountPanel::onConnect() void FSPrimfeedAccountPanel::onConnect()
{ {
FSPrimfeedAuth::initiateAuthRequest(); FSPrimfeedAuth::initiateAuthRequest();
LLSD dummy; onPrimfeedConnectStateChange(LLSD());
onPrimfeedConnectStateChange(dummy);
} }
void FSPrimfeedAccountPanel::onDisconnect() void FSPrimfeedAccountPanel::onDisconnect()
{ {
FSPrimfeedAuth::resetAuthStatus(); FSPrimfeedAuth::resetAuthStatus();
LLSD dummy; onPrimfeedConnectStateChange(LLSD());
onPrimfeedConnectStateChange(dummy);
} }
FSPrimfeedAccountPanel::~FSPrimfeedAccountPanel() FSPrimfeedAccountPanel::~FSPrimfeedAccountPanel()

View File

@ -131,9 +131,8 @@ private:
LLTextBox* mAccountConnectedAsLabel{ nullptr }; LLTextBox* mAccountConnectedAsLabel{ nullptr };
LLTextBox* mAccountNameLink{ nullptr }; LLTextBox* mAccountNameLink{ nullptr };
LLTextBox* mAccountPlan{ nullptr }; LLTextBox* mAccountPlan{ nullptr };
LLUICtrl* mPanelButtons{ nullptr }; LLButton* mConnectButton{ nullptr };
LLUICtrl* mConnectButton{ nullptr }; LLButton* mDisconnectButton{ nullptr };
LLUICtrl* mDisconnectButton{ nullptr };
}; };