Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
arjide committed Oct 28, 2014
1 parent 7a4f5ef commit 23a8939
Show file tree
Hide file tree
Showing 23 changed files with 375 additions and 179 deletions.
3 changes: 1 addition & 2 deletions QQStars.pro
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ OTHER_FILES += \
qml/Chat/GroupChatPage.qml \
qml/Chat/DiscuChatPage.qml \
qml/Chat/ChatPage.qml \
qml/Utility/TrayMessageWindow.qml \
qml/Utility/ImageColorCleaner.qml
qml/Utility/TrayMessageWindow.qml

FORMS +=
8 changes: 4 additions & 4 deletions images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<file>images/avatar.svg</file>
<file>images/avatar_left.png</file>
<file>images/avatar-border.svg</file>
<file>images/away.png</file>
<file>images/imaway.png</file>
<file>images/background_arabesquitic.svg</file>
<file>images/background_input.png</file>
<file>images/busy.png</file>
<file>images/imbusy.png</file>
<file>images/button-login.svg</file>
<file>images/button-login-hover.svg</file>
<file>images/button-login-press.svg</file>
Expand All @@ -32,9 +32,9 @@
<file>images/lock20.png</file>
<file>images/login-panel.svg</file>
<file>images/login-panel-shadow.png</file>
<file>images/mute.png</file>
<file>images/imsilent.png</file>
<file>images/progress-bar.png</file>
<file>images/Qme.png</file>
<file>images/imcallme.png</file>
<file>images/QQ-for-ubuntu.svg</file>
<file>images/soft-keyboard.svg</file>
<file>images/status-away-1.svg</file>
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 4 additions & 0 deletions qml/Api/QQApi.qml
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,8 @@ QQ{
var url = "http://s.web2.qq.com/api/get_group_info_ext2?gcode="+gcode+"&cb=undefined&vfwebqq="+loginReData.vfwebqq
utility.httpGet(callbackFun, url, true)
}
function getOnlineFriends(callbackFun){//获取在线好友列表
var url = "http://d.web2.qq.com/channel/get_online_buddies2?clientid="+clientid+"&psessionid="+loginReData.psessionid
utility.httpGet(callbackFun, url, true)
}
}
2 changes: 1 addition & 1 deletion qml/Chat/ChatPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Item{
property alias rightBar: right_bar
property alias inputBox: input
property alias listModel: mymodel
property var myinfo//用来储存自己的各种信息(用uin标识)
property QQItemInfo myinfo//用来储存自己的各种信息(用uin标识)
onMyinfoChanged: {
if(myinfo){//从缓冲区中读取数据
var message_list = myinfo.getChatRecords()//获取内存中的所有聊天记录
Expand Down
91 changes: 56 additions & 35 deletions qml/Chat/ChatWindowCommand.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ MyWindow{
noNotifyIcon:false//隐藏任务栏图标
color: "transparent"
windowGlowItem.color: "black"//"#f07000"
windowIcon: currentShowPage?currentShowPage.myinfo.avatar40:"qrc:/images/avatar.png"

setLeftBorder: function(arg){
if(left_bar.isOpen&&left_bar.setBarDefaultWidth(left_bar.defaultWidth+arg)){//如果窗口大小设置成功
root.mySetLeftBorder(arg)//设置窗口位置
Expand All @@ -40,22 +42,18 @@ MyWindow{
if(visible)
root.showFront()//显示到最屏幕最前端
}
windowIcon: {
if(currentShowPage)
return currentShowPage.myinfo.avatar40
else
return "qrc:/images/avatar.png"
}


function setCurrentShowPage(page){
//console.log(page+","+currentShowPage)
if(currentShowPage!==page&&page){//判断是否page就是当前活动页面
page.myinfo.isActiveChatPage=true//将他信息中是否为活跃页面的属性设置为true
page.visible = true
if(currentShowPage)
if(currentShowPage){
currentShowPage.visible = false//先将旧的page设置为隐藏
currentShowPage.myinfo.isActiveChatPage=false//将他信息中是否为活跃页面的属性设置为false
}
currentShowPage = page//
currentShowPage.myinfo.unreadMessagesCount = 0//将未读消息的条数设为0
//console.log(page+","+currentShowPage)
}
}

Expand All @@ -79,6 +77,22 @@ MyWindow{
return false
}
}

Rectangle{
anchors.left: parent.left
color: "#eee"
width: 10
height: width
visible: left_bar.width>0
}
Rectangle{
anchors.bottom: parent.bottom
anchors.left: parent.left
color: "#eee"
width: 10
height: width
visible: left_bar.width>0
}
}
Connections{
target: myqq
Expand All @@ -105,6 +119,7 @@ MyWindow{
anchors.bottom: parent.bottom
color:"#ddd"
radius:10
clip: true

onDefaultWidthChanged: {
if(isOpen){//如果是打开状态
Expand Down Expand Up @@ -161,33 +176,18 @@ MyWindow{
}
Rectangle{
anchors.right: parent.right
color: "#eee"
color: left_bar.color
width: parent.radius
height: width
visible: parent.isOpen
visible: parent.width>0
}
Rectangle{
anchors.bottom: parent.bottom
anchors.right: parent.right
color: "#eee"
color: left_bar.color
width: parent.radius
height: width
visible: parent.isOpen
}
Rectangle{
anchors.right: parent.right
color: parent.color
width: parent.radius
height: width
visible: left_bar.width>0
}
Rectangle{
anchors.bottom: parent.bottom
anchors.right: parent.right
color: parent.color
width: parent.radius
height: width
visible: left_bar.width>0
visible: parent.width>0
}

MyScrollView{
Expand Down Expand Up @@ -257,7 +257,12 @@ MyWindow{
id: avatar
x:10
width:35
grayscale: my.myinfo.state==FriendInfo.Offlineing
grayscale: {
if(my)
return my.myinfo.state == FriendInfo.Offlineing
return false
}

source: {
if(my!==null)
return my.myinfo.avatar40
Expand All @@ -273,12 +278,7 @@ MyWindow{
anchors.left: avatar.right
anchors.leftMargin: 10
//font.pointSize: 14
text: {
if(my!=null)
return my.myinfo.aliasOrNick
else
return ""
}
text: my?my.myinfo.aliasOrNick:""
}
Rectangle{
width: image_clost_page.width+16
Expand All @@ -289,6 +289,27 @@ MyWindow{
opacity: 0.75
visible: image_clost_page.visible&&root.currentShowPage!=my
}
Rectangle{
width: text_message_count.implicitWidth+10
height: image_clost_page.width
anchors.right: rect_hover.right
anchors.rightMargin: 5
anchors.verticalCenter: parent.verticalCenter
color: "red"
radius: height
visible: my?my.myinfo.unreadMessagesCount>0:false
Text{
id: text_message_count
anchors.centerIn: parent
text: my?my.myinfo.unreadMessagesCount:"0"//未读消息的个数
color: "white"
onTextChanged: {
if(text == "100"){
text = "99+"
}
}
}
}
SvgView{
id:image_clost_page
width: defaultSize.width*myqq.windowScale
Expand Down
6 changes: 4 additions & 2 deletions qml/Chat/GroupChatPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import utility 1.0

ChatPage{
id: root
property bool existMembers: false
myinfo: myqq.createGroupInfo(myuin)
onMyinfoChanged: {
if(myinfo&&myinfo.code!=""){
if(!existMembers&&myinfo&&myinfo.code!=""){
myqq.getGroupMembersList(getMembersListFinished, myinfo.code)
//console.debug("开始获取群列表")
//开始获取群列表
Expand All @@ -20,9 +21,10 @@ ChatPage{

data = JSON.parse(data)
if( data.retcode == 0 ){
existMembers = true//记得设置为真,不然每次进群都会获取群成员列表
var members = data.result.minfo
//console.debug("群成员列表获取完成1:"+members.length)
for(var i=0; i<members.length; ++i){
for(var i in members){
var info = myqq.createFriendInfo(members[i].uin)
info.nick = members[i].nick//储存昵称
}
Expand Down
2 changes: 1 addition & 1 deletion qml/Chat/MessageListComponent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Component{
height: nick.implicitHeight+backgound.height+backgound.anchors.topMargin
property var myinfo: myqq.createFriendInfo(uin)
property string sendUin: send_uin//将此消息发送给谁
property var parentInfo: parent_info//如果消息发送成功就回调此函数
property QQItemInfo parentInfo: parent_info//消息属主的info

property var sendMessage: {
if(!parentInfo)
Expand Down
9 changes: 4 additions & 5 deletions qml/MainPanel/ListPage/DiscuList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Item{
if(data.retcode ==0 ) {
var list_info = data.result.dnamelist
for( var i=0; i< list_info.length;++i ) {
mymodel.append({"obj_info": list_info[i]})
var info = myqq.createDiscuInfo(list_info[i].did)
info.nick = list_info[i].name//设置昵称
mymodel.append({"obj_info": info})
}
}
}
Expand Down Expand Up @@ -51,10 +53,7 @@ Item{
id: item_root
width: parent.width
height: avatar.height
property var myinfo: myqq.createDiscuInfo(obj_info.did)
Component.onCompleted: {
myinfo.nick = obj_info.name
}
property DiscuInfo myinfo: obj_info

MyImage{
id: avatar
Expand Down
Loading

0 comments on commit 23a8939

Please sign in to comment.