merge
commit
7b79b455d0
|
|
@ -36,9 +36,10 @@
|
|||
#include "llnotificationsutil.h"
|
||||
#include "llurlaction.h"
|
||||
#include "llimagepng.h"
|
||||
#include "lltrans.h"
|
||||
|
||||
|
||||
// Local function
|
||||
// Local functions
|
||||
void prompt_user_for_error(U32 status, const std::string& reason, const std::string& code, const std::string& description)
|
||||
{
|
||||
// Note: 302 (redirect) is *not* an error that warrants prompting the user
|
||||
|
|
@ -55,6 +56,13 @@ void prompt_user_for_error(U32 status, const std::string& reason, const std::str
|
|||
}
|
||||
}
|
||||
|
||||
void toast_user_for_success()
|
||||
{
|
||||
LLSD args;
|
||||
args["MESSAGE"] = LLTrans::getString("facebook_post_success");
|
||||
LLNotificationsUtil::add("SystemMessage", args);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
class LLFacebookConnectHandler : public LLCommandHandler
|
||||
|
|
@ -133,6 +141,7 @@ public:
|
|||
{
|
||||
if (isGoodStatus(status))
|
||||
{
|
||||
toast_user_for_success();
|
||||
LL_DEBUGS("FacebookConnect") << "Post successful. content: " << content << LL_ENDL;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -57,21 +57,48 @@ std::string get_map_url()
|
|||
return map_url;
|
||||
}
|
||||
|
||||
LLSocialStatusPanel::LLSocialStatusPanel()
|
||||
LLSocialStatusPanel::LLSocialStatusPanel() :
|
||||
mMessageTextEditor(NULL),
|
||||
mPostStatusButton(NULL)
|
||||
{
|
||||
mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLSocialStatusPanel::onSend, this));
|
||||
}
|
||||
|
||||
BOOL LLSocialStatusPanel::postBuild()
|
||||
{
|
||||
mMessageTextEditor = getChild<LLUICtrl>("status_message");
|
||||
mPostStatusButton = getChild<LLUICtrl>("post_status_btn");
|
||||
|
||||
return LLPanel::postBuild();
|
||||
}
|
||||
|
||||
void LLSocialStatusPanel::draw()
|
||||
{
|
||||
if (mMessageTextEditor && mPostStatusButton)
|
||||
{
|
||||
std::string message = mMessageTextEditor->getValue().asString();
|
||||
mPostStatusButton->setEnabled(!message.empty());
|
||||
}
|
||||
|
||||
LLPanel::draw();
|
||||
}
|
||||
|
||||
void LLSocialStatusPanel::onSend()
|
||||
{
|
||||
std::string message = getChild<LLUICtrl>("message")->getValue().asString();
|
||||
LLFacebookConnect::instance().updateStatus(message);
|
||||
if (mMessageTextEditor)
|
||||
{
|
||||
std::string message = mMessageTextEditor->getValue().asString();
|
||||
if (!message.empty())
|
||||
{
|
||||
LLFacebookConnect::instance().updateStatus(message);
|
||||
|
||||
LLFloater* floater = getParentByType<LLFloater>();
|
||||
if (floater)
|
||||
{
|
||||
floater->closeFloater();
|
||||
}
|
||||
LLFloater* floater = getParentByType<LLFloater>();
|
||||
if (floater)
|
||||
{
|
||||
floater->closeFloater();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LLSocialPhotoPanel::LLSocialPhotoPanel() :
|
||||
|
|
@ -84,8 +111,6 @@ mThumbnailPlaceholder(NULL)
|
|||
mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLSocialPhotoPanel::onSend, this));
|
||||
}
|
||||
|
||||
|
||||
|
||||
LLSocialPhotoPanel::~LLSocialPhotoPanel()
|
||||
{
|
||||
if(mPreviewHandle.get())
|
||||
|
|
|
|||
|
|
@ -36,7 +36,13 @@ class LLSocialStatusPanel : public LLPanel
|
|||
{
|
||||
public:
|
||||
LLSocialStatusPanel();
|
||||
BOOL postBuild();
|
||||
void draw();
|
||||
void onSend();
|
||||
|
||||
private:
|
||||
LLUICtrl* mMessageTextEditor;
|
||||
LLUICtrl* mPostStatusButton;
|
||||
};
|
||||
|
||||
class LLSocialPhotoPanel : public LLPanel
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
left="9"
|
||||
length="1"
|
||||
max_length="700"
|
||||
name="message"
|
||||
name="status_message"
|
||||
type="string"
|
||||
word_wrap="true">
|
||||
</text_editor>
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
follows="left|top"
|
||||
height="23"
|
||||
label="Post"
|
||||
name="post_btn"
|
||||
name="post_status_btn"
|
||||
top_pad="18"
|
||||
width="100">
|
||||
<button.commit_callback
|
||||
|
|
|
|||
|
|
@ -3421,6 +3421,9 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
|
|||
Drag items from inventory here
|
||||
</string>
|
||||
|
||||
<string name="facebook_post_success">
|
||||
Posting to Facebook was successful.
|
||||
</string>
|
||||
|
||||
<string name="no_session_message">
|
||||
(IM Session Doesn't Exist)
|
||||
|
|
|
|||
Loading…
Reference in New Issue