Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
254851a5
Commit
254851a5
authored
Jul 25, 2012
by
Emmanuel Lepage Vallee
Browse files
[ #13801 ] Fix indentation, beautify the code, add comment
parent
62b69203
Changes
33
Hide whitespace changes
Inline
Side-by-side
kde/src/AccountWizard.cpp
View file @
254851a5
...
...
@@ -2,6 +2,7 @@
* Copyright (C) 2009-2012 by Savoir-Faire Linux *
* Author : Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> *
* Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com>*
* ^^ Refuse any liability for this code *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
...
...
kde/src/AccountWizard.h
View file @
254851a5
...
...
@@ -36,13 +36,10 @@ class AccountWizard : public QWizard
Q_OBJECT
public:
enum
{
Page_Intro
,
Page_AutoMan
,
Page_Type
,
Page_Email
,
Page_SIPForm
,
Page_IAXForm
,
Page_Stun
,
Page_Conclusion
};
AccountWizard
(
QWidget
*
parent
=
0
);
~
AccountWizard
();
void
accept
();
};
/***************************************************************************
...
...
kde/src/CallView.cpp
View file @
254851a5
...
...
@@ -69,7 +69,6 @@ CallTreeItemDelegate(CallView* widget)
if
(
index
.
parent
().
isValid
()
&&
!
index
.
parent
().
child
(
index
.
row
()
+
1
,
0
).
isValid
())
sh
.
rheight
()
+=
15
;
}
return
sh
;
...
...
@@ -113,7 +112,6 @@ CallTreeItemDelegate(CallView* widget)
for
(
int
i
=
0
;
i
<
childCount
;
i
++
)
{
r
.
setHeight
(
r
.
height
()
+
sizeHint
(
option
,
index
).
height
());
}
// qDebug() << "\n\nFINAL SIZE" << r;
}
r
.
setTop
(
r
.
top
()
+
m_ConferenceDrawer
.
leftMargin
());
...
...
@@ -180,13 +178,13 @@ CallTreeItemDelegate(CallView* widget)
widget
->
setMaximumSize
((
m_tree
->
viewport
()
->
width
()
-
m_ConferenceDrawer
.
leftMargin
()
-
m_ConferenceDrawer
.
rightMargin
())
-
m_ConferenceDrawer
.
leftMargin
(),
max
);
}
}
if
(
index
.
parent
().
isValid
()
&&
!
index
.
parent
().
child
(
index
.
row
()
+
1
,
0
).
isValid
())
{
m_ConferenceDrawer
.
drawBoxBottom
(
index
,
0
,
option
,
painter
);
}
}
private:
CallView
*
m_tree
;
ConferenceBox
m_ConferenceDrawer
;
...
...
kde/src/CallView.h
View file @
254851a5
...
...
@@ -18,10 +18,13 @@
#ifndef CALL_VIEW
#define CALL_VIEW
//Qt
#include
<QtGui/QTreeWidget>
#include
<QtGui/QPainter>
#include
<QtGui/QStyledItemDelegate>
#include
<QtCore/QTimer>
//SFLPhone
#include
"lib/CallModel.h"
//Qt
...
...
kde/src/SFLPhone.cpp
View file @
254851a5
...
...
@@ -252,35 +252,37 @@ void SFLPhone::setupActions()
action_configureSflPhone
=
KStandardAction
::
preferences
(
m_pView
,
SLOT
(
configureSflPhone
()),
this
);
action_configureSflPhone
->
setText
(
i18n
(
"Configure SFLphone"
));
action_displayDialpad
=
new
KAction
(
KIcon
(
QIcon
(
ICON_DISPLAY_DIALPAD
)),
i18n
(
"Display dialpad"
),
this
);
action_displayDialpad
=
new
KAction
(
KIcon
(
QIcon
(
ICON_DISPLAY_DIALPAD
)),
i18n
(
"Display dialpad"
)
,
this
);
action_displayMessageBox
=
new
KAction
(
KIcon
(
"mail-message-new"
),
i18n
(
"Display text message box"
)
,
this
);
action_displayVolumeControls
=
new
KAction
(
KIcon
(
QIcon
(
ICON_DISPLAY_VOLUME_CONSTROLS
)),
i18n
(
"Display volume controls"
),
this
);
action_pastenumber
=
new
KAction
(
KIcon
(
"edit-paste"
),
i18n
(
"Paste"
)
,
this
);
action_showContactDock
=
new
KAction
(
KIcon
(
"edit-find-user"
)
,
i18n
(
"Display Contact"
)
,
this
);
action_showHistoryDock
=
new
KAction
(
KIcon
(
"view-history"
)
,
i18n
(
"Display history"
)
,
this
);
action_showBookmarkDock
=
new
KAction
(
KIcon
(
"bookmark-new-list"
),
i18n
(
"Display bookmark"
)
,
this
);
action_accountCreationWizard
=
new
KAction
(
i18n
(
"Account creation wizard"
)
,
this
);
action_displayDialpad
->
setCheckable
(
true
);
action_displayDialpad
->
setChecked
(
ConfigurationSkeleton
::
displayDialpad
()
);
action_configureSflPhone
->
setText
(
i18n
(
"Configure SFLphone"
));
action_displayMessageBox
=
new
KAction
(
KIcon
(
"mail-message-new"
),
i18n
(
"Display text message box"
),
this
);
action_displayMessageBox
->
setCheckable
(
true
);
action_displayMessageBox
->
setChecked
(
ConfigurationSkeleton
::
displayMessageBox
()
);
action_displayVolumeControls
=
new
KAction
(
KIcon
(
QIcon
(
ICON_DISPLAY_VOLUME_CONSTROLS
)),
i18n
(
"Display volume controls"
),
this
);
action_displayVolumeControls
->
setCheckable
(
true
);
action_displayVolumeControls
->
setChecked
(
ConfigurationSkeleton
::
displayVolume
()
);
action_pastenumber
=
new
KAction
(
KIcon
(
"edit-paste"
),
i18n
(
"Paste"
),
this
);
action_pastenumber
->
setShortcut
(
Qt
::
CTRL
+
Qt
::
Key_V
);
action_showContactDock
=
new
KAction
(
KIcon
(
"edit-find-user"
)
,
i18n
(
"Display Contact"
)
,
this
);
action_showContactDock
->
setCheckable
(
true
);
action_showContactDock
->
setChecked
(
ConfigurationSkeleton
::
displayContactDock
());
action_showHistoryDock
=
new
KAction
(
KIcon
(
"view-history"
)
,
i18n
(
"Display history"
)
,
this
);
action_showHistoryDock
->
setCheckable
(
true
);
action_showHistoryDock
->
setChecked
(
ConfigurationSkeleton
::
displayHistoryDock
());
action_showBookmarkDock
=
new
KAction
(
KIcon
(
"bookmark-new-list"
),
i18n
(
"Display bookmark"
),
this
);
action_showBookmarkDock
->
setCheckable
(
true
);
action_showBookmarkDock
->
setChecked
(
ConfigurationSkeleton
::
displayBookmarkDock
());
action_accountCreationWizard
=
new
KAction
(
i18n
(
"Account creation wizard"
),
this
);
action_configureShortcut
=
new
KAction
(
KIcon
(
KIcon
(
"configure-shortcuts"
)),
i18n
(
"Configure Shortcut"
),
this
);
...
...
kde/src/SFLPhoneAccessibility.cpp
View file @
254851a5
...
...
@@ -28,18 +28,18 @@ SFLPhoneAccessibility* SFLPhoneAccessibility::m_pInstance=nullptr;
SFLPhoneAccessibility
::
SFLPhoneAccessibility
()
:
QObject
(
0
),
QList
<
KAction
*>
()
{
KAction
*
action
=
new
KAction
(
0
);
action
->
setObjectName
(
"listCall"
);
action
->
setShortcut
(
Qt
::
CTRL
+
Qt
::
Key_L
);
action
->
setText
(
"List all current calls"
);
action
->
setIcon
(
KIcon
(
"text-speak"
));
action
->
setObjectName
(
"listCall"
);
action
->
setShortcut
(
Qt
::
CTRL
+
Qt
::
Key_L
);
action
->
setText
(
"List all current calls"
);
action
->
setIcon
(
KIcon
(
"text-speak"
)
);
*
this
<<
action
;
connect
(
action
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
listCall
()));
action
=
new
KAction
(
0
);
action
->
setObjectName
(
"currentCallDetails"
);
action
->
setShortcut
(
Qt
::
CTRL
+
Qt
::
Key_I
);
action
->
setText
(
"Get current call details"
);
action
->
setIcon
(
KIcon
(
"text-speak"
));
action
->
setObjectName
(
"currentCallDetails"
);
action
->
setShortcut
(
Qt
::
CTRL
+
Qt
::
Key_I
);
action
->
setText
(
"Get current call details"
);
action
->
setIcon
(
KIcon
(
"text-speak"
)
);
*
this
<<
action
;
connect
(
action
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
currentCallDetails
()));
}
...
...
@@ -92,7 +92,7 @@ void SFLPhoneAccessibility::currentCallDetails()
toSay
+=
i18n
(
", the peer phone number is %1 "
,
numberToDigit
(
call
->
getPeerPhoneNumber
())
);
else
if
(
!
call
->
getCallNumber
().
isEmpty
())
toSay
+=
i18n
(
", the phone number is %1 "
,
numberToDigit
(
call
->
getCallNumber
()));
int
nSec
=
QDateTime
::
fromTime_t
(
call
->
getStartTimeStamp
().
toInt
()).
time
().
secsTo
(
QTime
::
currentTime
()
);
if
(
nSec
>
0
)
toSay
+=
i18n
(
" and you have been talking since %1 seconds"
,
nSec
);
...
...
kde/src/SFLPhoneAccessibility.h
View file @
254851a5
...
...
@@ -26,10 +26,14 @@ class SFLPhoneAccessibility : public QObject, public QList<KAction*>
{
Q_OBJECT
public:
//Singleton
static
SFLPhoneAccessibility
*
getInstance
();
private:
//Constructor
SFLPhoneAccessibility
();
QString
numberToDigit
(
QString
number
);
//Static attributes
static
SFLPhoneAccessibility
*
m_pInstance
;
public
slots
:
...
...
kde/src/SFLPhoneView.cpp
View file @
254851a5
...
...
@@ -414,15 +414,18 @@ void SFLPhoneView::updateWindowCallState()
actionTexts
[
SFLPhone
::
Refuse
]
=
ACTION_LABEL_REFUSE
;
m_pMessageBoxW
->
setVisible
(
false
||
IM_ACTIVE
)
;
break
;
case
CALL_STATE_RINGING
:
enabledActions
[
SFLPhone
::
Hold
]
=
false
;
enabledActions
[
SFLPhone
::
Transfer
]
=
false
;
m_pMessageBoxW
->
setVisible
(
false
)
;
break
;
case
CALL_STATE_CURRENT
:
buttonIconFiles
[
SFLPhone
::
Record
]
=
ICON_REC_DEL_ON
;
m_pMessageBoxW
->
setVisible
((
true
&&
ConfigurationSkeleton
::
displayMessageBox
())
||
IM_ACTIVE
);
break
;
case
CALL_STATE_DIALING
:
enabledActions
[
SFLPhone
::
Hold
]
=
false
;
enabledActions
[
SFLPhone
::
Transfer
]
=
false
;
...
...
@@ -431,11 +434,13 @@ void SFLPhoneView::updateWindowCallState()
buttonIconFiles
[
SFLPhone
::
Accept
]
=
ICON_ACCEPT
;
m_pMessageBoxW
->
setVisible
(
false
)
;
break
;
case
CALL_STATE_HOLD
:
buttonIconFiles
[
SFLPhone
::
Hold
]
=
ICON_UNHOLD
;
actionTexts
[
SFLPhone
::
Hold
]
=
ACTION_LABEL_UNHOLD
;
m_pMessageBoxW
->
setVisible
(
false
)
;
break
;
case
CALL_STATE_FAILURE
:
enabledActions
[
SFLPhone
::
Accept
]
=
false
;
enabledActions
[
SFLPhone
::
Hold
]
=
false
;
...
...
@@ -443,6 +448,7 @@ void SFLPhoneView::updateWindowCallState()
enabledActions
[
SFLPhone
::
Record
]
=
false
;
m_pMessageBoxW
->
setVisible
(
false
)
;
break
;
case
CALL_STATE_BUSY
:
enabledActions
[
SFLPhone
::
Accept
]
=
false
;
enabledActions
[
SFLPhone
::
Hold
]
=
false
;
...
...
@@ -450,6 +456,7 @@ void SFLPhoneView::updateWindowCallState()
enabledActions
[
SFLPhone
::
Record
]
=
false
;
m_pMessageBoxW
->
setVisible
(
false
)
;
break
;
case
CALL_STATE_TRANSFERRED
:
buttonIconFiles
[
SFLPhone
::
Accept
]
=
ICON_EXEC_TRANSF
;
actionTexts
[
SFLPhone
::
Transfer
]
=
ACTION_LABEL_GIVE_UP_TRANSF
;
...
...
@@ -457,6 +464,7 @@ void SFLPhoneView::updateWindowCallState()
m_pMessageBoxW
->
setVisible
(
false
||
IM_ACTIVE
)
;
transfer
=
true
;
break
;
case
CALL_STATE_TRANSF_HOLD
:
buttonIconFiles
[
SFLPhone
::
Accept
]
=
ICON_EXEC_TRANSF
;
buttonIconFiles
[
SFLPhone
::
Hold
]
=
ICON_UNHOLD
;
...
...
@@ -465,25 +473,31 @@ void SFLPhoneView::updateWindowCallState()
m_pMessageBoxW
->
setVisible
(
false
)
;
transfer
=
true
;
break
;
case
CALL_STATE_OVER
:
kDebug
()
<<
"Error : Reached CALL_STATE_OVER with call "
<<
call
->
getCallId
()
<<
"!"
;
m_pMessageBoxW
->
setVisible
(
false
)
;
break
;
case
CALL_STATE_ERROR
:
kDebug
()
<<
"Error : Reached CALL_STATE_ERROR with call "
<<
call
->
getCallId
()
<<
"!"
;
m_pMessageBoxW
->
setVisible
(
false
)
;
break
;
case
CALL_STATE_CONFERENCE
:
enabledActions
[
SFLPhone
::
Transfer
]
=
false
;
m_pMessageBoxW
->
setVisible
(
false
||
IM_ACTIVE
)
;
break
;
case
CALL_STATE_CONFERENCE_HOLD
:
enabledActions
[
SFLPhone
::
Transfer
]
=
false
;
m_pMessageBoxW
->
setVisible
(
false
)
;
break
;
default:
kDebug
()
<<
"Error : Reached unexisting state for call "
<<
call
->
getCallId
()
<<
"("
<<
call
->
toHumanStateName
()
<<
"!"
;
break
;
}
}
...
...
kde/src/main.cpp
View file @
254851a5
...
...
@@ -82,7 +82,7 @@ int main(int argc, char **argv)
//configuration dbus
TreeWidgetCallModel
::
init
();
SFLPhone
*
sflphoneWindow_
=
new
SFLPhone
();
if
(
!
sflphoneWindow_
->
initialize
()
)
{
exit
(
1
);
...
...
@@ -96,13 +96,13 @@ int main(int argc, char **argv)
sflphoneWindow_
->
show
();
else
sflphoneWindow_
->
hide
();
int
retVal
=
app
->
exec
();
delete
sflphoneWindow_
;
ConfigurationSkeleton
::
self
()
->
writeConfig
();
delete
app
;
return
retVal
;
}
...
...
kde/src/widgets/AcceleratedVideoWidget.cpp
View file @
254851a5
/***************************************************************************
* Copyright (C) 2009-2012 by Savoir-Faire Linux *
* Author : Emmanuel Lepage Valle <emmanuel.lepage@savoirfairelinux.com >*
* Nokia *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
...
...
@@ -26,9 +27,9 @@
#include
<QtGui/QImage>
#include
<QtCore/QPropertyAnimation>
static
const
qreal
FACE_SIZE
=
0.4
;
static
const
qreal
FACE_SIZE
=
0.4
;
static
const
qreal
speeds
[]
=
{
1.8
f
,
2.4
f
,
3.6
f
};
static
const
qreal
speeds
[]
=
{
1.8
f
,
2.4
f
,
3.6
f
};
static
const
qreal
amplitudes
[]
=
{
2.0
f
,
2.5
f
,
3.0
f
};
static
inline
void
qSetColor
(
float
colorVec
[],
QColor
c
)
...
...
kde/src/widgets/AcceleratedVideoWidget.h
View file @
254851a5
/***************************************************************************
* Copyright (C) 2009-2012 by Savoir-Faire Linux *
* Author : Emmanuel Lepage Valle <emmanuel.lepage@savoirfairelinux.com >*
* Nokia *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
...
...
kde/src/widgets/BookmarkDock.cpp
View file @
254851a5
...
...
@@ -69,26 +69,26 @@ BookmarkDock::BookmarkDock(QWidget* parent) : QDockWidget(parent)
setSizePolicy
(
QSizePolicy
::
Minimum
,
QSizePolicy
::
Minimum
);
setMinimumSize
(
250
,
0
);
m_pFilterLE
=
new
KLineEdit
(
this
);
m_pSplitter
=
new
QSplitter
(
Qt
::
Vertical
,
this
);
m_pItemView
=
new
CategorizedTreeWidget
(
this
);
m_pMostUsedCK
=
new
QCheckBox
(
this
);
m_pFilterLE
=
new
KLineEdit
(
this
);
m_pSplitter
=
new
QSplitter
(
Qt
::
Vertical
,
this
);
m_pItemView
=
new
CategorizedTreeWidget
(
this
);
m_pMostUsedCK
=
new
QCheckBox
(
this
);
QWidget
*
mainWidget
=
new
QWidget
(
this
);
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
(
mainWidget
);
m_pFilterLE
->
setPlaceholderText
(
i18n
(
"Filter"
));
m_pMostUsedCK
->
setChecked
(
ConfigurationSkeleton
::
displayContactCallHistory
());
QWidget
*
mainWidget
=
new
QWidget
(
this
);
setWidget
(
mainWidget
);
m_pMostUsedCK
->
setText
(
i18n
(
"Show most called contacts"
));
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
(
mainWidget
);
mainLayout
->
addWidget
(
m_pMostUsedCK
);
mainLayout
->
addWidget
(
m_pSplitter
);
m_pSplitter
->
addWidget
(
m_pItemView
);
mainLayout
->
addWidget
(
m_pFilterLE
);
mainLayout
->
addWidget
(
m_pMostUsedCK
);
mainLayout
->
addWidget
(
m_pSplitter
);
m_pSplitter
->
addWidget
(
m_pItemView
);
mainLayout
->
addWidget
(
m_pFilterLE
);
m_pSplitter
->
setChildrenCollapsible
(
true
);
m_pSplitter
->
setStretchFactor
(
0
,
7
);
...
...
kde/src/widgets/CallTreeItem.cpp
View file @
254851a5
...
...
@@ -194,12 +194,14 @@ void CallTreeItem::setCall(Call *call)
baseColor
.
setRed
(
baseColor
.
red
()
+
(
textColor
.
red
()
-
baseColor
.
red
())
*
0.6
);
baseColor
.
setGreen
(
baseColor
.
green
()
+
(
textColor
.
green
()
-
baseColor
.
green
())
*
0.6
);
m_pHistoryPeerL
=
new
QLabel
(
i18n
(
"<b>Conference</b>"
),
this
);
m_pHistoryPeerL
->
setStyleSheet
(
"color:"
+
baseColor
.
name
());
m_pIconL
=
new
QLabel
(
" "
,
this
);
m_pHistoryPeerL
=
new
QLabel
(
i18n
(
"<b>Conference</b>"
),
this
);
m_pIconL
=
new
QLabel
(
" "
,
this
);
QHBoxLayout
*
mainLayout
=
new
QHBoxLayout
();
mainLayout
->
addWidget
(
m_pIconL
);
mainLayout
->
addWidget
(
m_pHistoryPeerL
);
m_pHistoryPeerL
->
setStyleSheet
(
"color:"
+
baseColor
.
name
());
mainLayout
->
addWidget
(
m_pIconL
);
mainLayout
->
addWidget
(
m_pHistoryPeerL
);
setLayout
(
mainLayout
);
m_Init
=
true
;
}
...
...
@@ -213,35 +215,34 @@ void CallTreeItem::setCall(Call *call)
m_pTransferNumberL
=
new
QLabel
(
" "
);
m_pElapsedL
=
new
QLabel
(
" "
);
QSpacerItem
*
verticalSpacer
=
new
QSpacerItem
(
0
,
0
,
QSizePolicy
::
Expanding
,
QSizePolicy
::
Expanding
);
m_pTransferPrefixL
->
setVisible
(
false
);
m_pTransferNumberL
->
setVisible
(
false
);
QHBoxLayout
*
mainLayout
=
new
QHBoxLayout
();
mainLayout
->
setContentsMargins
(
3
,
1
,
2
,
1
);
m_pBtnConf
=
new
TranslucentButtons
(
this
);
m_pBtnConf
->
setVisible
(
false
);
m_pBtnConf
->
setParent
(
this
);
m_pBtnConf
->
setText
(
i18n
(
"Conference"
));
m_pBtnConf
->
setPixmap
(
new
QImage
(
KStandardDirs
::
locate
(
"data"
,
"sflphone-client-kde/confBlackWhite.png"
)));
connect
(
m_pBtnConf
,
SIGNAL
(
dataDropped
(
QMimeData
*
)),
this
,
SLOT
(
conversationEvent
(
QMimeData
*
)));
m_pBtnTrans
=
new
TranslucentButtons
(
this
);
m_pBtnTrans
->
setText
(
i18n
(
"Transfer"
));
m_pBtnTrans
->
setVisible
(
false
);
m_pBtnTrans
->
setPixmap
(
new
QImage
(
KStandardDirs
::
locate
(
"data"
,
"sflphone-client-kde/transferarraw.png"
)));
connect
(
m_pBtnTrans
,
SIGNAL
(
dataDropped
(
QMimeData
*
)),
this
,
SLOT
(
transferEvent
(
QMimeData
*
)));
m_pElapsedL
->
setStyleSheet
(
"margin-right:5px;"
);
mainLayout
->
setSpacing
(
4
);
QVBoxLayout
*
descr
=
new
QVBoxLayout
();
descr
->
setMargin
(
1
);
descr
->
setSpacing
(
1
);
QVBoxLayout
*
descr
=
new
QVBoxLayout
();
QHBoxLayout
*
transfer
=
new
QHBoxLayout
();
transfer
->
setMargin
(
0
);
descr
->
setMargin
(
1
);
descr
->
setSpacing
(
1
);
transfer
->
setMargin
(
0
);
transfer
->
setSpacing
(
0
);
if
(
ConfigurationSkeleton
::
displayCallIcon
())
{
...
...
@@ -499,12 +500,12 @@ void CallTreeItem::dropEvent(QDropEvent *e)
void
CallTreeItem
::
resizeEvent
(
QResizeEvent
*
e
)
{
if
(
m_pBtnConf
)
{
m_pBtnConf
->
setMinimumSize
(
width
()
/
2
-
15
,
height
()
-
4
);
m_pBtnConf
->
setMaximumSize
(
width
()
/
2
-
15
,
height
()
-
4
);
m_pBtnTrans
->
setMinimumSize
(
width
()
/
2
-
15
,
height
()
-
4
);
m_pBtnTrans
->
setMaximumSize
(
width
()
/
2
-
15
,
height
()
-
4
);
m_pBtnTrans
->
move
(
width
()
/
2
+
10
,
m_pBtnTrans
->
y
()
+
2
);
m_pBtnConf
->
move
(
10
,
m_pBtnConf
->
y
()
+
2
);
m_pBtnConf
->
setMinimumSize
(
width
()
/
2
-
15
,
height
()
-
4
);
m_pBtnConf
->
setMaximumSize
(
width
()
/
2
-
15
,
height
()
-
4
);
m_pBtnTrans
->
setMinimumSize
(
width
()
/
2
-
15
,
height
()
-
4
);
m_pBtnTrans
->
setMaximumSize
(
width
()
/
2
-
15
,
height
()
-
4
);
m_pBtnTrans
->
move
(
width
()
/
2
+
10
,
m_pBtnTrans
->
y
()
+
2
);
m_pBtnConf
->
move
(
10
,
m_pBtnConf
->
y
()
+
2
);
}
e
->
accept
();
...
...
@@ -539,11 +540,11 @@ void CallTreeItem::copy()
{
kDebug
()
<<
"Copying contact"
;
QMimeData
*
mimeData
=
new
QMimeData
();
mimeData
->
setData
(
MIME_CALLID
,
m_pItemCall
->
getCallId
().
toUtf8
());
QString
numbers
(
m_pItemCall
->
getPeerName
()
+
": "
+
m_pItemCall
->
getPeerPhoneNumber
());
QString
numbersHtml
(
"<b>"
+
m_pItemCall
->
getPeerName
()
+
"</b><br />"
+
m_pItemCall
->
getPeerPhoneNumber
());
mimeData
->
setData
(
"text/plain"
,
numbers
.
toUtf8
());
mimeData
->
setData
(
"text/html"
,
numbersHtml
.
toUtf8
());
mimeData
->
setData
(
MIME_CALLID
,
m_pItemCall
->
getCallId
().
toUtf8
()
);
mimeData
->
setData
(
"text/plain"
,
numbers
.
toUtf8
()
);
mimeData
->
setData
(
"text/html"
,
numbersHtml
.
toUtf8
()
);
QClipboard
*
clipboard
=
QApplication
::
clipboard
();
clipboard
->
setMimeData
(
mimeData
);
}
...
...
@@ -552,7 +553,7 @@ void CallTreeItem::copy()
void
CallTreeItem
::
hide
()
{
if
(
!
m_isHover
)
{
m_pBtnConf
->
setVisible
(
false
);
m_pBtnConf
->
setVisible
(
false
);
m_pBtnTrans
->
setVisible
(
false
);
}
}
...
...
kde/src/widgets/CallTreeItem.h
View file @
254851a5
...
...
@@ -97,11 +97,11 @@ class CallTreeItem : public QWidget
virtual
void
mouseDoubleClickEvent
(
QMouseEvent
*
e
);
private
slots
:
void
transferEvent
(
QMimeData
*
data
);
void
transferEvent
(
QMimeData
*
data
);
void
conversationEvent
(
QMimeData
*
data
);
void
hide
(
);
void
incrementTimer
(
);
void
copy
(
);
void
hide
(
);
void
incrementTimer
(
);
void
copy
(
);
public
slots
:
void
updated
();
...
...
kde/src/widgets/CategorizedTreeWidget.cpp
View file @
254851a5
...
...
@@ -31,6 +31,7 @@
#include
<QKeyEvent>
//BEGIN KateColorTreeDelegate
///Code taken from Kate and adapted to render categorized lists
class
KateColorTreeDelegate
:
public
QStyledItemDelegate
{
public:
...
...
@@ -154,6 +155,7 @@ class KateColorTreeDelegate : public QStyledItemDelegate
};
//END KateColorTreeDelegate
///Constructor
CategorizedTreeWidget
::
CategorizedTreeWidget
(
QWidget
*
parent
)
:
QTreeWidget
(
parent
)
{
...
...
@@ -166,20 +168,21 @@ CategorizedTreeWidget::CategorizedTreeWidget(QWidget *parent)
setHorizontalScrollMode
(
QAbstractItemView
::
ScrollPerItem
);
}
///Do not draw branches
void
CategorizedTreeWidget
::
drawBranches
(
QPainter
*
painter
,
const
QRect
&
rect
,
const
QModelIndex
&
index
)
const
{
Q_UNUSED
(
painter
)
Q_UNUSED
(
rect
)
Q_UNUSED
(
index
)
/*if (index.parent().parent().isValid())
QTreeWidget::drawBranches(painter,rect,index);*/
Q_UNUSED
(
painter
)
Q_UNUSED
(
rect
)
Q_UNUSED
(
index
)
}
///Get the item list
QVector
<
QTreeWidgetItem
*>
CategorizedTreeWidget
::
realItems
()
const
{
return
m_lItems
;
}
///Remove an item from the list
void
CategorizedTreeWidget
::
removeItem
(
QTreeWidgetItem
*
item
)
{
for
(
int
i
=
0
;
i
<
topLevelItemCount
();
i
++
)
{
...
...
kde/src/widgets/CategorizedTreeWidget.h
View file @
254851a5
...
...
@@ -51,6 +51,7 @@ class CategorizedTreeWidget : public QTreeWidget
QVector
<
QTreeWidgetItem
*>
m_lItems
;
};
///Add new item to the list
template
<
class
T
>
T
*
CategorizedTreeWidget
::
addItem
(
QString
category
,
bool
top
)
{
QTreeWidgetItem
*
categoryItem
=
0
;
...
...
@@ -74,7 +75,7 @@ template <class T> T* CategorizedTreeWidget::addItem(QString category,bool top)
return
iwdg
;
}
///Add a category to the list
template
<
class
T
>
T
*
CategorizedTreeWidget
::
addCategory
(
QString
name
)
{
T
*
categoryItem
=
new
T
(
this
);
...
...
kde/src/widgets/CategoryDrawer.cpp
View file @
254851a5
...
...
@@ -24,248 +24,251 @@
#include
<QApplication>
#include
<QStyleOption>
///Constructor
CategoryDrawer
::
CategoryDrawer
()
{
setLeftMargin
(
7
);
setRightMargin
(
7
);
}
void
CategoryDrawer
::
drawCategory
(
const
QModelIndex
&
index
,
int
sortRole
,
const
QStyleOption
&
option
,
QPainter
*
painter
)
const
///Draw a category style
void
CategoryDrawer
::
drawCategory
(
const
QModelIndex
&
index
,
int
sortRole
,
const
QStyleOption
&
option
,
QPainter
*
painter
)
const
{
Q_UNUSED
(
sortRole
)
Q_UNUSED
(
sortRole
)
painter
->
setRenderHint
(
QPainter
::
Antialiasing
);
painter
->
setRenderHint
(
QPainter
::
Antialiasing
);
const
QRect
optRect
=
option
.
rect
;
QFont
font
(
QApplication
::
font
());
font
.
setBold
(
true
);
const
QFontMetrics
fontMetrics
=
QFontMetrics
(
font
);
const
int
height
=
categoryHeight
(
index
,
option
);
const
bool
leftToRight
=
painter
->
layoutDirection
()
==
Qt
::
LeftToRight
;
const
QRect
optRect
=
option
.
rect
;
QFont
font
(
QApplication
::
font
());
font
.
setBold
(
true
);
const
QFontMetrics
fontMetrics
=
QFontMetrics
(
font
);
const
int
height
=
categoryHeight
(
index
,
option
);
const
bool
leftToRight
=
painter
->
layoutDirection
()
==
Qt
::
LeftToRight
;
//BEGIN: decoration gradient
{
QPainterPath
path
(
optRect
.
bottomLeft
());
//BEGIN: decoration gradient
{
QPainterPath
path
(
optRect
.
bottomLeft
());
path
.
lineTo
(
QPoint
(
optRect
.
topLeft
().
x
(),
optRect
.
topLeft
().
y
()
-
3
));
const
QPointF
topLeft
(
optRect
.
topLeft
());
QRectF
arc
(
topLeft
,
QSizeF
(
4
,
4
));
path
.
arcTo
(
arc
,
180
,
-
90
);
path
.
lineTo
(
optRect
.
topRight
());
path
.
lineTo
(
optRect
.
bottomRight
());
path
.
lineTo
(
optRect
.
bottomLeft
());
path
.
lineTo
(
QPoint
(
optRect
.
topLeft
().
x
(),
optRect
.
topLeft
().
y
()
-
3
));
const
QPointF
topLeft
(
optRect
.
topLeft
());
QRectF
arc
(
topLeft
,
QSizeF
(
4
,
4
));
path
.
arcTo
(
arc
,
180
,
-
90
);
path
.
lineTo
(
optRect
.
topRight
());
path
.
lineTo
(
optRect
.
bottomRight
());
path
.
lineTo
(
optRect
.
bottomLeft
());
QColor
window
(
option
.
palette
.
window
().
color
());
const
QColor
base
(
option
.
palette
.
base
().
color
());
QColor
window
(
option
.
palette
.
window
().
color
());