Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mogujie/TeamTalk
Browse files Browse the repository at this point in the history
  • Loading branch information
zscorpio committed Aug 15, 2015
2 parents d6c80e3 + dd19b64 commit 0c1feaa
Show file tree
Hide file tree
Showing 61 changed files with 7,630 additions and 2,936 deletions.
1 change: 1 addition & 0 deletions win-client/bin/teamtalk/chinese.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ STRID_GLOBAL_DETAILINFO =

STRID_MAINDIALOG_TIP_DISCONNECT = 与服务器连接中断
STRID_MAINDIALOG_TIP_HIDE = TeamTalk没有退出噢,躲在这里了!
STRID_MAINDIALOG_TOOLTIP_MSGCNT = (%d条未读)

STRID_LOGINDIALOG_USERNAME_EMPTY = 用户名不能为空
STRID_LOGINDIALOG_PASSWORD_EMPTY = 密码不能为空
Expand Down
1 change: 1 addition & 0 deletions win-client/bin/teamtalk/data/module/js/module-msgview.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,5 @@ window.showGoodsInfo = IMApp.MessageView.showGoodsInfo;

$(document).ready(function() {
IMApp.MessageView.init();
window.open("moguim://moguim/:documentcompleted");
});
8 changes: 5 additions & 3 deletions win-client/bin/teamtalk/gui/MainDialog/MainDialog.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Window caption="0,0,0,90" roundcorner="4,4" size="280,550" sizebox="0,4,0,4" mininfo="280,550" >
<Window caption="0,0,0,65" roundcorner="4,4" size="280,550" sizebox="0,4,0,4" mininfo="280,550" >
<Font name="微软雅黑" size="12" bold="false" default="true" />
<Font name="微软雅黑" size="14" bold="true"/>
<Default name="VScrollBar" value="button1normalimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,0,8,7&apos;&quot; button1hotimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,0,8,7&apos;&quot; button1pushedimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,0,8,7&apos;&quot; button2normalimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,17,8,24&apos;&quot; button2hotimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,17,8,24&apos;&quot; button2pushedimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,17,8,24&apos;&quot; thumbnormalimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,24,8,72&apos; corner=&apos;2,2,2,2&apos;&quot; thumbhotimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,24,8,72&apos; corner=&apos;2,2,2,2&apos;&quot; thumbpushedimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,24,8,72&apos; corner=&apos;2,2,2,2&apos;&quot; bknormalimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,6,8,17&apos;&quot;" />
Expand All @@ -18,12 +18,13 @@
</HorizontalLayout>
<VerticalLayout bkcolor="#FFF7F7F7">
<HorizontalLayout name="UserInfoLayout" height="70" padding="5,0,0,0" bkcolor="#FFF7F7F7">
<Button name="myfacebtn" bordersize="0" borderround="2,2" bordercolor="FFCD7F32" width="60" height="60" padding="0,0,0,3" bkimage="MainDialog/Face.png" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" />
<VerticalLayout padding="10,12,0,0">
<Button name="myfacebtn" bordersize="0" borderround="2,2" bordercolor="FFCD7F32" width="60" height="60" padding="0,0,0,3" bkimage="file=&apos;MainDialog/Face.png&apos;" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" />
<VerticalLayout padding="10,8,0,0">
<HorizontalLayout height="30">
<Button name="onlineStatus" padding="0,5,0,0" width="16" height="16" bkimage="file=&apos;MainDialog/online.png&apos; dest=&apos;0,0,16,16&apos;" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" hotimage="file=&apos;MainDialog/btn_hot.png&apos; corner=&apos;2,8,2,2&apos;" />
<Text name="unametxt" padding="0,3,0,0" textpadding="2,0,2,0" text="登陆者名称" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="1" align="wrap" />
</HorizontalLayout>
<Edit name="signature" endellipsis="true" textcolor="#FF333333" multiline="false" bkcolor="#FFF7F7F7" textcolor="#FF999999" tooltip="编辑个性签名" />
</VerticalLayout>
</HorizontalLayout>
<Control height="1" bkcolor="#FFD1DCE1"/>
Expand All @@ -44,6 +45,7 @@
<Option name="RecentlyListbtn" tooltip="最近联系人" width="92" height="35" selected="true" group="true" normalimage="file=&apos;MainDialog/tab_btn.png&apos; source=&apos;0,0,92,35&apos;" selectedimage="file=&apos;MainDialog/tab_btn.png&apos; source=&apos;0,36,92,71&apos;"/>
<Option name="friendbtn" tooltip="组织架构" width="93" height="35" group="true" normalimage="file=&apos;MainDialog/tab_btn.png&apos; source=&apos;93,0,186,35&apos;" selectedimage="file=&apos;MainDialog/tab_btn.png&apos; source=&apos;93,36,186,71&apos;" />
<Option name="groupbtn" tooltip="群/讨论组" width="92" height="35" group="true" normalimage="file=&apos;MainDialog/tab_btn.png&apos; source=&apos;187,0,280,35&apos;" selectedimage="file=&apos;MainDialog/tab_btn.png&apos; source=&apos;187,36,280,71&apos;" />
<Text name="msgCount" visible="false" text="1" float="true" pos="62,15" mouse="false" textcolor="#FFFFFFFF" width="25" height="15" bkimage="file='MainDialog/unrreadcntbk.png' corner='2,2,2,2'" roundcorner="2,2,2,2" align="center"/>
</HorizontalLayout>
<ListLayout >
<TabLayout name="tabs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@
</HorizontalLayout>
<HorizontalLayout>
<Text endellipsis="true" padding="0,6,0,0" textcolor="#FF333333" font="1" text="邮箱:" />
<Edit name="mail" textcolor="#FF333333" trans="true" readonly="true" endellipsis="true" text="[email protected]别地加以考察的认识活动" />
<Edit name="mail" textcolor="#FF333333" trans="true" readonly="true" endellipsis="true" text="[email protected]" />
</HorizontalLayout>
<HorizontalLayout>
<Text endellipsis="true" padding="0,6,0,0" textcolor="#FF333333" font="1" text="签名:" />
<Edit name="signInfo" padding="0,3,0,0" textcolor="#FF333333" trans="true" readonly="true" endellipsis="true" text="签名"/>
</HorizontalLayout>
<HorizontalLayout>
<Control />
Expand Down
11 changes: 6 additions & 5 deletions win-client/bin/teamtalk/gui/SessionDialog/SessionDialog.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Window size="520,540" mininfo="520,540" caption="0,0,0,60" sizebox="4,4,4,4" roundcorner="4,4,4,4">
<Window size="520,540" mininfo="520,540" caption="0,0,0,40" sizebox="4,4,4,4" roundcorner="4,4,4,4">
<Font name="微软雅黑" size="12" bold="false" default="true" />
<Font name="微软雅黑" size="14" bold="true"/>
<Default name="VScrollBar" value="button1normalimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,0,8,7&apos;&quot; button1hotimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,0,8,7&apos;&quot; button1pushedimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,0,8,7&apos;&quot; button2normalimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,18,8,25&apos;&quot; button2hotimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,18,8,25&apos;&quot; button2pushedimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,18,8,25&apos;&quot; thumbnormalimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,25,8,72&apos; corner=&apos;2,2,2,2&apos;&quot; thumbhotimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,25,8,72&apos; corner=&apos;2,2,2,2&apos;&quot; thumbpushedimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,25,8,72&apos; corner=&apos;2,2,2,2&apos;&quot; bknormalimage=&quot;file=&apos;MainDialog/scrollbar.png&apos; source=&apos;0,6,8,17&apos;&quot;" />
Expand All @@ -9,9 +9,9 @@
<VerticalLayout width="48" inset="0,1,0,0" padding="10,10,0,0">
<Button name="UserAvatar" width="44" height="44" maxheight="44" maxwidth="44" bkimage="file='MainDialog/Face.png' corner='5,5,5,5'"/>
</VerticalLayout>
<VerticalLayout height="40" padding="5,15,0,0">
<VerticalLayout height="50" padding="5,10,0,0">
<Edit name="username" readonly="true" endellipsis="true" textcolor="#FF333333" font="1" bkcolor="#FFF7F7F7" text="用户名" width="500"/>
<Text name="description" endellipsis="true" textcolor="#FF333333" visible="false" text="签名" width="200"/>
<Edit name="userSignature" endellipsis="true" textcolor="#FF333333" multiline="false" readonly="true" bkcolor="#FFF7F7F7" textcolor="#FF999999"/>
</VerticalLayout>
<Text name="writingStatus" visible="false" padding="0,40,0,0" textcolor="#FF999999" text="对方正在输入..." />
<HorizontalLayout width="68" padding="0,5,0,0">
Expand All @@ -24,15 +24,16 @@
<SessionLayout name="会话面板">
<VerticalLayout>
<WebBrowser name="ie" clsid="{8856F961-340A-11D0-A96B-00C04FD705A2}" delaycreate="false"/>
<VerticalLayout height="210" maxheight="350" minheight="80" sepheight="-6" sepimm="true">
<VerticalLayout height="210" maxheight="350" minheight="80" sepheight="-30" sepimm="true">
<HorizontalLayout height="30" inset="2,4,2,4">
<Button name="emotionbtn" width="23" height="21" tooltip="表情" bkimage="file='SessionDialog/toolbtn.png' source='0,0,15,13' dest='4,4,19,17'" hotimage="file='SessionDialog/btn_hot.png' corner='2,2,2,2'" selectedimage="file='SessionDialog/btn_push.png' corner='2,5,2,2'" />
<Button name="imagebtn" width="23" height="21" padding="5,0,0,0" tooltip="发送图片" bkimage="file='SessionDialog/toolbtn.png' source='22,0,37,13' dest='3,4,18,17'" hotimage="file='SessionDialog/btn_hot.png' corner='2,3,2,2'" selectedimage="file='SessionDialog/btn_push.png' corner='2,5,2,2'" />
<Button name="screenshot" visible="true" width="24" height="20" padding="5,0,0,0" tooltip="屏幕截图(Ctrl+Shift+Q)" bkimage="file='SessionDialog/toolbtn.png' source='44,0,60,13' dest='2,5,20,18'" hotimage="file='SessionDialog/btn_hot.png' corner='2,3,2,2'" pushedimage="file='SessionDialog/btn_push.png' corner='2,5,2,2'" />
<Button name="jisuanqibtn" visible="false" width="24" height="20" padding="5,0,0,0" bkimage="file='SessionDialog/toolbtn.png' source='67,0,85,13' dest='2,5,20,18'" hotimage="file='SessionDialog/btn_hot.png' corner='2,3,2,2'" pushedimage="file='SessionDialog/btn_push.png' corner='2,5,2,2'" />
<Button name="shockbtn" width="24" height="22" padding="5,0,0,0" tooltip="窗口抖动" bkimage="file='SessionDialog/toolbtn.png' source='91,0,113,13' dest='1,5,22,18'" hotimage="file='SessionDialog/btn_hot.png' corner='2,3,2,2'" pushedimage="file='SessionDialog/btn_push.png' corner='2,5,2,2'" />
<Button name="banGroupMsg" visible="fasle" width="23" height="21" padding="5,0,0,0" tooltip="屏蔽群消息" bkimage="file='SessionDialog/toolbtn.png' source='145,0,163,13' dest='3,5,20,18'" hotimage="file='SessionDialog/btn_hot.png' corner='2,3,2,2'" pushedimage="file='SessionDialog/btn_push.png' corner='2,5,2,2'" />
<Button name="displayGroupMsg" visible="false" width="23" height="21" padding="5,0,0,0" tooltip="显示群消息" bkimage="file='SessionDialog/toolbtn.png' source='171,0,189,13' dest='3,5,20,18'" hotimage="file='SessionDialog/btn_hot.png' corner='2,3,2,2'" pushedimage="file='SessionDialog/btn_push.png' corner='2,5,2,2'" />
<Button name="sendfilebtn" visible="false" width="24" height="20" padding="5,0,0,0" tooltip="发送文件" bkimage="file='SessionDialog/toolbtn.png' source='119,0,136,13' dest='2,5,19,18'" hotimage="file='SessionDialog/btn_hot.png' corner='2,3,2,2'" pushedimage="file='SessionDialog/btn_push.png' corner='2,5,2,2'" />
<Button name="sendfilebtn" width="24" height="20" padding="5,0,0,0" tooltip="发送文件" bkimage="file='SessionDialog/toolbtn.png' source='119,0,136,13' dest='2,5,19,18'" hotimage="file='SessionDialog/btn_hot.png' corner='2,3,2,2'" pushedimage="file='SessionDialog/btn_push.png' corner='2,5,2,2'" />
<Control />
<Button name="adduserbtn" width="29" height="21" padding="0,0,5,0" tooltip="创建讨论组" bkimage="file='SessionDialog/adduser.png' dest='5,5,28,18'" hotimage="file='SessionDialog/btn_hot.png' corner='2,3,2,2'" pushedimage="file='SessionDialog/btn_push.png' corner='2,5,2,2'" />
</HorizontalLayout>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Window caption="0,0,0,465" roundcorner="4,4" size="465,470" >
<Window caption="0,0,0,36" roundcorner="4,4" size="465,470" >
<Font name="微软雅黑" size="12" bold="false" default="true" />
<Font name="微软雅黑" size="12" bold="true"/>
<Default name="Button" value="size=&quot;#8&quot; textcolor=&quot;#FFFFFF&quot; hottextcolor=&quot;#000000&quot; disabledtextcolor=&quot;#ffffff&quot; focusedtextcolor=&quot;#000000&quot; pushedtextcolor=&quot;#ffffff&quot; normalimage=&quot;file='LoginDialog/LoginBtnBack.png' corner='4,4,4,4' source='0,0,0,0'&quot; hotimage=&quot;file='LoginDialog/LoginBtnBack.png' corner='4,4,4,4' source='0,0,0,0'&quot; pushedimage=&quot;file='LoginDialog/LoginBtnBack.png' corner='4,4,4,4' source='0,0,0,0'&quot; disabledimage=&quot;file='LoginDialog/LoginBtnBack.png' corner='4,4,4,4' source='0,0,0,0'&quot;" />
Expand Down
4 changes: 2 additions & 2 deletions win-client/bin/teamtalk/gui/menu/TrayIconMenu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<MenuElement name="SysSettingMenuItem" text="系统设置" />
<MenuElement name="LogDir" text="打开日志目录" />
<MenuElement name="inner" text="打开内网" visible="false" bkimage="file='menu/inner.png' source='0,0,15,15' dest='5,5,20,20'"/>
<MenuElement name="serverAddressSetting" text="服务器地址配置" visible="true"/>
<MenuElement name="showFileTransferDialog" text="文件传输管理器" visible="false" />
<MenuElement name="serverAddressSetting" text="服务器地址配置" />
<MenuElement name="showFileTransferDialog" text="文件传输管理器" />
<MenuElement name="exitMenuItem" text="退出" />
</Menu>
</Window>
28 changes: 28 additions & 0 deletions win-client/core/DuiLib/Core/UIManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2398,9 +2398,37 @@ bool CPaintManagerUI::TranslateAccelerator(LPMSG pMsg)
}
return false;
}
bool CPaintManagerUI::PreTranslateMessage(const LPMSG pMsg)
{
//code by nansong, adjust window handle
if (pMsg->message == WM_MOUSEWHEEL)
{
POINT point;
point.x = (short)(WORD)(pMsg->lParam);
point.y = (short)(WORD)(pMsg->lParam >> 16);

HWND hWnd = ::WindowFromPoint(point);
if (hWnd && hWnd != pMsg->hwnd)
{
DWORD dwAppProcessID, dwWndProcessID;
dwAppProcessID = -1;
dwWndProcessID = -2;
::GetWindowThreadProcessId(pMsg->hwnd, &dwAppProcessID);
::GetWindowThreadProcessId(hWnd, &dwWndProcessID);
if (dwAppProcessID == dwWndProcessID)
pMsg->hwnd = hWnd;
}
}

return true;
}
bool CPaintManagerUI::TranslateMessage(const LPMSG pMsg)
{
if (!PreTranslateMessage(pMsg))
{
return false;
}

// Pretranslate Message takes care of system-wide messages, such as
// tabbing and shortcut key-combos. We'll look for all messages for
// each window and any child control attached.
Expand Down
1 change: 1 addition & 0 deletions win-client/core/DuiLib/Core/UIManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ class UILIB_API CPaintManagerUI

static void MessageLoop();
static bool TranslateMessage(const LPMSG pMsg);
static bool PreTranslateMessage(const LPMSG pMsg);
static void Term();

bool MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lRes);
Expand Down
23 changes: 16 additions & 7 deletions win-client/core/network/ImCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,21 @@ NAMESPACE_BEGIN(imcore)
}
}

void IMLibCoreStartOperationWithLambda(std::function<void()> operationRun, Int32 delay /*= 0*/)
{
if (getOperationManager()->startOperationWithLambda(operationRun, delay) != IMCORE_OK)
{
LOG__(ERR, _T("push operation with lambda failed"));
}
}
void IMLibCoreStartOperationWithLambda(std::function<void()> operationRun, Int32 delay /*= 0*/, std::string oper_name)
{
if (getOperationManager()->startOperationWithLambda(operationRun, delay, oper_name) != IMCORE_OK)
{
LOG__(ERR, _T("push operation with lambda failed"));
}
}

void IMLibCoreClearOperationByName(std::string oper_name)
{
if (getOperationManager()->clearOperationByName(oper_name) != IMCORE_OK)
{
LOG__(ERR, _T("clear operation by name failed"));
}
}


NAMESPACE_END(imcore)
6 changes: 5 additions & 1 deletion win-client/core/network/Operation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,22 @@
/******************************************************************************/
NAMESPACE_BEGIN(imcore)

const std::string OPERATION_NAME_COMMON = "operation_name_common";


// -----------------------------------------------------------------------------
// Operation: Public, Constructor

Operation::Operation()
:m_state(OPERATION_IDLE)
, m_name(OPERATION_NAME_COMMON)
{

}

Operation::Operation(const std::string& name)
:m_state(OPERATION_IDLE)
,m_name(name.c_str())
,m_name(name)
{

}
Expand Down
33 changes: 30 additions & 3 deletions win-client/core/network/OperationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,37 @@ IMCoreErrorCode OperationManager::startOperation(IN Operation* pOperation, Int32
return IMCORE_OK;
}

IMCoreErrorCode OperationManager::startOperationWithLambda(std::function<void()> operationRun, Int32 delay)
IMCoreErrorCode OperationManager::startOperationWithLambda(std::function<void()> operationRun
, Int32 delay
, std::string oper_name)
{
LambdaOperation* pLambdaOper = new LambdaOperation(operationRun);
return startOperation(pLambdaOper, delay);
LambdaOperation* pLambdaOper = new LambdaOperation(operationRun);
pLambdaOper->set_name(oper_name);
return startOperation(pLambdaOper, delay);
}

IMCoreErrorCode OperationManager::clearOperationByName(std::string oper_name)
{
std::lock_guard<std::mutex> locker(m_mutexOperation);
auto iter = std::remove_if(m_vecRealtimeOperations.begin(), m_vecRealtimeOperations.end(),
[=](Operation* pOper)
{
if (pOper->name() == oper_name)
{
LOG__(APP, _T("clearOperationByName - %S"), oper_name.c_str());

pOper->release();
return true;
}
return false;
});

if (iter != m_vecRealtimeOperations.end())
{
m_vecRealtimeOperations.erase(iter, m_vecRealtimeOperations.end());
}

return IMCORE_OK;
}

OperationManager::~OperationManager()
Expand Down
9 changes: 6 additions & 3 deletions win-client/core/network/OperationManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ class OperationManager

public:
IMCoreErrorCode startup();
void shutdown(IN int seconds = 2000);
IMCoreErrorCode startOperation(IN Operation* pOperation, Int32 delay);
IMCoreErrorCode startOperationWithLambda(std::function<void()> operationRun, Int32 delay);
void shutdown(IN int seconds = 2000);
IMCoreErrorCode startOperation(IN Operation* pOperation, Int32 delay);
IMCoreErrorCode startOperationWithLambda(std::function<void()> operationRun
, Int32 delay
, std::string oper_name);
IMCoreErrorCode clearOperationByName(std::string oper_name);

private:
std::list<Operation*> m_vecDelayOperations;
Expand Down
Loading

0 comments on commit 0c1feaa

Please sign in to comment.