summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/CMakeLists.txt2
-rw-r--r--indra/newview/llflashtimer.cpp82
-rw-r--r--indra/newview/llflashtimer.h66
-rw-r--r--indra/newview/llfloaterimcontainer.cpp14
-rw-r--r--indra/newview/llfloaterimcontainer.h2
-rw-r--r--indra/newview/llfloaterimsessiontab.cpp10
6 files changed, 21 insertions, 155 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 574fdc495a..f652c9e50c 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -178,7 +178,6 @@ set(viewer_SOURCE_FILES
llfilepicker.cpp
llfilteredwearablelist.cpp
llfirstuse.cpp
- llflashtimer.cpp
llflexibleobject.cpp
llfloaterabout.cpp
llfloaterbvhpreview.cpp
@@ -763,7 +762,6 @@ set(viewer_HEADER_FILES
llfilepicker.h
llfilteredwearablelist.h
llfirstuse.h
- llflashtimer.h
llflexibleobject.h
llfloaterabout.h
llfloaterbvhpreview.h
diff --git a/indra/newview/llflashtimer.cpp b/indra/newview/llflashtimer.cpp
deleted file mode 100644
index 2feacfa218..0000000000
--- a/indra/newview/llflashtimer.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * @file llflashtimer.cpp
- * @brief LLFlashTimer class implementation
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2012, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llflashtimer.h"
-#include "llviewercontrol.h"
-#include "lleventtimer.h"
-
-LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period)
- : LLEventTimer(period)
- , mCallback(cb)
- , mCurrentTickCount(0)
- , mIsFlashing(false)
-{
- mEventTimer.stop();
-
- // By default use settings from settings.xml to be able change them via Debug settings. See EXT-5973.
- // Due to Timer is implemented as derived class from EventTimer it is impossible to change period
- // in runtime. So, both settings are made as required restart.
- mFlashCount = 2 * ((count>0)? count : gSavedSettings.getS32("FlashCount"));
- if (mPeriod<=0)
- {
- mPeriod = gSavedSettings.getF32("FlashPeriod");
- }
-}
-
-BOOL LLFlashTimer::tick()
-{
- mIsHighlight = !(mCurrentTickCount % 2);
- if (mCallback)
- {
- mCallback(mIsHighlight);
- }
-
- if (++mCurrentTickCount >= mFlashCount)
- {
- mEventTimer.stop();
- }
-
- return FALSE;
-}
-
-void LLFlashTimer::startFlashing()
-{
- mCurrentTickCount = 0;
- mIsFlashing = true;
- mEventTimer.start();
-}
-
-void LLFlashTimer::stopFlashing()
-{
- mIsFlashing = false;
- mIsHighlight = false;
- mEventTimer.stop();
-}
-
-
diff --git a/indra/newview/llflashtimer.h b/indra/newview/llflashtimer.h
deleted file mode 100644
index c030edfc52..0000000000
--- a/indra/newview/llflashtimer.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * @file llflashtimer.h
- * @brief LLFlashTimer class implementation
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2012, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_FLASHTIMER_H
-#define LL_FLASHTIMER_H
-
-#include "lleventtimer.h"
-
-class LLFlashTimer : public LLEventTimer
-{
-public:
-
- typedef boost::function<void (bool)> callback_t;
-
- /**
- * Constructor.
- *
- * @param count - how many times callback should be called (twice to not change original state)
- * @param period - how frequently callback should be called
- * @param cb - callback to be called each tick
- */
- LLFlashTimer(callback_t cb = NULL, S32 count = 0, F32 period = 0.0);
- ~LLFlashTimer() {};
-
- /*virtual*/ BOOL tick();
-
- void startFlashing();
- void stopFlashing();
- bool isFlashing() {return mIsFlashing;}
- bool isHighlight() {return mIsHighlight;}
-
-private:
- callback_t mCallback;
- /**
- * How many times Well will blink.
- */
- S32 mFlashCount;
- S32 mCurrentTickCount;
- bool mIsHighlight;
- bool mIsFlashing;
-};
-
-#endif /* LL_FLASHTIMER_H */
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index da6f3a484d..90ddeef5bb 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -41,6 +41,7 @@
#include "llcallbacklist.h"
#include "llgroupactions.h"
#include "llgroupiconctrl.h"
+#include "llflashtimer.h"
#include "llfloateravatarpicker.h"
#include "llfloaterpreference.h"
#include "llimview.h"
@@ -1594,17 +1595,22 @@ void LLFloaterIMContainer::reSelectConversation()
{
selectFloater(session_floater);
}
-
}
-void LLFloaterIMContainer::flashConversationItemWidget(const LLUUID& session_id)
+void LLFloaterIMContainer::flashConversationItemWidget(const LLUUID& session_id, bool is_flashes)
{
LLFolderViewItem* widget = get_ptr_in_map(mConversationsWidgets,session_id);
if (widget)
{
- widget->;
+ if (is_flashes)
+ {
+ widget->getFlashTimer()->startFlashing();
+ }
+ else
+ {
+ widget->getFlashTimer()->stopFlashing();
+ }
}
-
}
// EOF
diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h
index 443688668b..9112b54018 100644
--- a/indra/newview/llfloaterimcontainer.h
+++ b/indra/newview/llfloaterimcontainer.h
@@ -164,7 +164,7 @@ public:
void setTimeNow(const LLUUID& session_id, const LLUUID& participant_id);
void setNearbyDistances();
void reSelectConversation();
- void flashConversationItemWidget(const LLUUID& session_id);
+ void flashConversationItemWidget(const LLUUID& session_id, bool is_flashes);
private:
LLConversationViewSession* createConversationItemWidget(LLConversationItem* item);
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index 69b42cdd6d..42e7e6cb55 100644
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -40,6 +40,7 @@
#include "llfloaterimsession.h"
#include "llfloaterimcontainer.h" // to replace separate IM Floaters with multifloater container
#include "lllayoutstack.h"
+#include "lltoolbarview.h"
#include "llfloaterimnearbychat.h"
const F32 REFRESH_INTERVAL = 0.2f;
@@ -328,11 +329,20 @@ std::string LLFloaterIMSessionTab::appendTime()
void LLFloaterIMSessionTab::appendMessage(const LLChat& chat, const LLSD &args)
{
+
// Update the participant activity time
LLFloaterIMContainer* im_box = LLFloaterIMContainer::findInstance();
if (im_box)
{
im_box->setTimeNow(mSessionID,chat.mFromID);
+
+ // TODO: Warning! The next two lines of code are included below only temporarily
+ // to demonstrate the correct format call the appropriate functions.
+ // They should be moved to the right places when working on CHUI-486. ~Alex ProductEngine.
+ // ---- start demo ----
+ im_box->flashConversationItemWidget(mSessionID, true); // flashing of the conversation's item
+ gToolBarView->flashCommand(LLCommandId("chat"), true); // flashing of the FUI button "Chat"
+ // ---- end demo -----
}