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
8f2b65ee
Commit
8f2b65ee
authored
Sep 16, 2011
by
Emmanuel Lepage
Browse files
Restore and improve support for Call history
parent
7ef79e87
Changes
14
Hide whitespace changes
Inline
Side-by-side
kde/src/CMakeLists.txt
View file @
8f2b65ee
...
@@ -27,6 +27,7 @@ SET( sflphone_client_kde_SRCS
...
@@ -27,6 +27,7 @@ SET( sflphone_client_kde_SRCS
AccountWizard.cpp
AccountWizard.cpp
AccountItemWidget.cpp
AccountItemWidget.cpp
widgets/CallTreeItem.cpp
widgets/CallTreeItem.cpp
widgets/HistoryTreeItem.cpp
ActionSetAccountFirst.cpp
ActionSetAccountFirst.cpp
conf/ConfigurationDialog.cpp
conf/ConfigurationDialog.cpp
conf/dlggeneral.cpp
conf/dlggeneral.cpp
...
...
kde/src/SFLPhone.cpp
View file @
8f2b65ee
...
@@ -41,7 +41,7 @@ SFLPhone* SFLPhone::m_sApp = NULL;
...
@@ -41,7 +41,7 @@ SFLPhone* SFLPhone::m_sApp = NULL;
SFLPhone
::
SFLPhone
(
QWidget
*
parent
)
SFLPhone
::
SFLPhone
(
QWidget
*
parent
)
:
KXmlGuiWindow
(
parent
),
:
KXmlGuiWindow
(
parent
),
initialized_
(
false
),
initialized_
(
false
),
v
iew
(
new
SFLPhoneView
(
this
))
m_pV
iew
(
new
SFLPhoneView
(
this
))
{
{
setupActions
();
setupActions
();
m_sApp
=
this
;
m_sApp
=
this
;
...
@@ -52,6 +52,15 @@ SFLPhone* SFLPhone::app()
...
@@ -52,6 +52,15 @@ SFLPhone* SFLPhone::app()
return
m_sApp
;
return
m_sApp
;
}
}
SFLPhoneView
*
SFLPhone
::
view
()
{
return
m_pView
;
}
CallView
*
SFLPhone
::
model
()
{
return
m_pView
->
model
();
}
SFLPhone
::~
SFLPhone
()
SFLPhone
::~
SFLPhone
()
{
{
saveState
();
saveState
();
...
@@ -73,25 +82,26 @@ bool SFLPhone::initialize()
...
@@ -73,25 +82,26 @@ bool SFLPhone::initialize()
addDockWidget
(
Qt
::
TopDockWidgetArea
,
m_pContactCD
);
addDockWidget
(
Qt
::
TopDockWidgetArea
,
m_pContactCD
);
// tell the KXmlGuiWindow that this is indeed the main widget
// tell the KXmlGuiWindow that this is indeed the main widget
//setCentralWidget(
v
iew);
//setCentralWidget(
m_pV
iew);
m_pCentralDW
=
new
QDockWidget
(
this
);
m_pCentralDW
=
new
QDockWidget
(
this
);
m_pCentralDW
->
setWidget
(
view
);
m_pCentralDW
->
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Expanding
);
m_pCentralDW
->
setWidget
(
m_pView
);
m_pCentralDW
->
setWindowTitle
(
"Call"
);
m_pCentralDW
->
setWindowTitle
(
"Call"
);
m_pCentralDW
->
setFeatures
(
QDockWidget
::
NoDockWidgetFeatures
);
m_pCentralDW
->
setFeatures
(
QDockWidget
::
NoDockWidgetFeatures
);
m_pView
->
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Expanding
);
m_pCentralDW
->
setStyleSheet
(
"\
m_pCentralDW
->
setStyleSheet
(
"\
QDockWidget::title {\
QDockWidget::title {\
display:none;\
margin:0px;\
margin:0px;\
padding:0px;\
padding:0px;\
spacing:0px;\
spacing:0px;\
max-height:0px;\
max-height:0px;\
}\
}\
\
\
"
);
"
);
m_pCentralDW
->
setTitleBarWidget
(
new
QWidget
());
m_pCentralDW
->
setTitleBarWidget
(
new
QWidget
());
m_pCentralDW
->
setContentsMargins
(
0
,
0
,
0
,
0
);
m_pCentralDW
->
setContentsMargins
(
0
,
0
,
0
,
0
);
v
iew
->
setContentsMargins
(
0
,
0
,
0
,
0
);
m_pV
iew
->
setContentsMargins
(
0
,
0
,
0
,
0
);
addDockWidget
(
Qt
::
TopDockWidgetArea
,
m_pCentralDW
);
addDockWidget
(
Qt
::
TopDockWidgetArea
,
m_pCentralDW
);
...
@@ -118,8 +128,8 @@ bool SFLPhone::initialize()
...
@@ -118,8 +128,8 @@ bool SFLPhone::initialize()
setObjectNames
();
setObjectNames
();
QMetaObject
::
connectSlotsByName
(
this
);
QMetaObject
::
connectSlotsByName
(
this
);
v
iew
->
on_stackedWidget_screen_currentChanged
(
SCREEN_MAIN
);
m_pV
iew
->
on_stackedWidget_screen_currentChanged
(
SCREEN_MAIN
);
v
iew
->
loadWindow
();
m_pV
iew
->
loadWindow
();
move
(
QCursor
::
pos
().
x
()
-
geometry
().
width
()
/
2
,
QCursor
::
pos
().
y
()
-
geometry
().
height
()
/
2
);
move
(
QCursor
::
pos
().
x
()
-
geometry
().
width
()
/
2
,
QCursor
::
pos
().
y
()
-
geometry
().
height
()
/
2
);
//if( ! configurationManager.isStartHidden()) {
//if( ! configurationManager.isStartHidden()) {
...
@@ -137,7 +147,7 @@ bool SFLPhone::initialize()
...
@@ -137,7 +147,7 @@ bool SFLPhone::initialize()
void
SFLPhone
::
setObjectNames
()
void
SFLPhone
::
setObjectNames
()
{
{
v
iew
->
setObjectName
(
"
v
iew"
);
m_pV
iew
->
setObjectName
(
"
m_pV
iew"
);
statusBar
()
->
setObjectName
(
"statusBar"
);
statusBar
()
->
setObjectName
(
"statusBar"
);
trayIcon
->
setObjectName
(
"trayIcon"
);
trayIcon
->
setObjectName
(
"trayIcon"
);
}
}
...
@@ -177,7 +187,7 @@ void SFLPhone::setupActions()
...
@@ -177,7 +187,7 @@ void SFLPhone::setupActions()
action_close
=
KStandardAction
::
close
(
this
,
SLOT
(
close
()),
this
);
action_close
=
KStandardAction
::
close
(
this
,
SLOT
(
close
()),
this
);
action_quit
=
KStandardAction
::
quit
(
this
,
SLOT
(
quitButton
()),
this
);
action_quit
=
KStandardAction
::
quit
(
this
,
SLOT
(
quitButton
()),
this
);
action_configureSflPhone
=
KStandardAction
::
preferences
(
v
iew
,
SLOT
(
configureSflPhone
()),
this
);
action_configureSflPhone
=
KStandardAction
::
preferences
(
m_pV
iew
,
SLOT
(
configureSflPhone
()),
this
);
action_configureSflPhone
->
setText
(
i18n
(
"Configure SFLphone"
));
action_configureSflPhone
->
setText
(
i18n
(
"Configure SFLphone"
));
action_displayVolumeControls
=
new
KAction
(
KIcon
(
QIcon
(
ICON_DISPLAY_VOLUME_CONSTROLS
)),
i18n
(
"Display volume controls"
),
this
);
action_displayVolumeControls
=
new
KAction
(
KIcon
(
QIcon
(
ICON_DISPLAY_VOLUME_CONSTROLS
)),
i18n
(
"Display volume controls"
),
this
);
...
@@ -189,16 +199,16 @@ void SFLPhone::setupActions()
...
@@ -189,16 +199,16 @@ void SFLPhone::setupActions()
action_displayDialpad
->
setChecked
(
/*configurationManager.getDialpad()*/
true
);
action_displayDialpad
->
setChecked
(
/*configurationManager.getDialpad()*/
true
);
action_accountCreationWizard
=
new
KAction
(
i18n
(
"Account creation wizard"
),
this
);
action_accountCreationWizard
=
new
KAction
(
i18n
(
"Account creation wizard"
),
this
);
connect
(
action_accept
,
SIGNAL
(
triggered
()),
v
iew
,
SLOT
(
accept
()));
connect
(
action_accept
,
SIGNAL
(
triggered
()),
m_pV
iew
,
SLOT
(
accept
()));
connect
(
action_refuse
,
SIGNAL
(
triggered
()),
v
iew
,
SLOT
(
refuse
()));
connect
(
action_refuse
,
SIGNAL
(
triggered
()),
m_pV
iew
,
SLOT
(
refuse
()));
connect
(
action_hold
,
SIGNAL
(
triggered
()),
v
iew
,
SLOT
(
hold
()));
connect
(
action_hold
,
SIGNAL
(
triggered
()),
m_pV
iew
,
SLOT
(
hold
()));
connect
(
action_transfer
,
SIGNAL
(
triggered
()),
v
iew
,
SLOT
(
transfer
()));
connect
(
action_transfer
,
SIGNAL
(
triggered
()),
m_pV
iew
,
SLOT
(
transfer
()));
connect
(
action_record
,
SIGNAL
(
triggered
()),
v
iew
,
SLOT
(
record
()));
connect
(
action_record
,
SIGNAL
(
triggered
()),
m_pV
iew
,
SLOT
(
record
()));
connect
(
action_screen
,
SIGNAL
(
triggered
(
QAction
*
)),
this
,
SLOT
(
updateScreen
(
QAction
*
)));
connect
(
action_screen
,
SIGNAL
(
triggered
(
QAction
*
)),
this
,
SLOT
(
updateScreen
(
QAction
*
)));
connect
(
action_mailBox
,
SIGNAL
(
triggered
()),
v
iew
,
SLOT
(
mailBox
()));
connect
(
action_mailBox
,
SIGNAL
(
triggered
()),
m_pV
iew
,
SLOT
(
mailBox
()));
connect
(
action_displayVolumeControls
,
SIGNAL
(
toggled
(
bool
)),
v
iew
,
SLOT
(
displayVolumeControls
(
bool
)));
connect
(
action_displayVolumeControls
,
SIGNAL
(
toggled
(
bool
)),
m_pV
iew
,
SLOT
(
displayVolumeControls
(
bool
)));
connect
(
action_displayDialpad
,
SIGNAL
(
toggled
(
bool
)),
v
iew
,
SLOT
(
displayDialpad
(
bool
)));
connect
(
action_displayDialpad
,
SIGNAL
(
toggled
(
bool
)),
m_pV
iew
,
SLOT
(
displayDialpad
(
bool
)));
connect
(
action_accountCreationWizard
,
SIGNAL
(
triggered
()),
v
iew
,
SLOT
(
accountCreationWizard
()));
connect
(
action_accountCreationWizard
,
SIGNAL
(
triggered
()),
m_pV
iew
,
SLOT
(
accountCreationWizard
()));
action_screen
->
addAction
(
action_main
);
action_screen
->
addAction
(
action_main
);
action_screen
->
addAction
(
action_history
);
action_screen
->
addAction
(
action_history
);
...
@@ -245,7 +255,7 @@ void SFLPhone::setupActions()
...
@@ -245,7 +255,7 @@ void SFLPhone::setupActions()
SFLPhoneView
*
SFLPhone
::
getView
()
SFLPhoneView
*
SFLPhone
::
getView
()
{
{
return
v
iew
;
return
m_pV
iew
;
}
}
bool
SFLPhone
::
queryClose
()
bool
SFLPhone
::
queryClose
()
...
@@ -258,12 +268,12 @@ bool SFLPhone::queryClose()
...
@@ -258,12 +268,12 @@ bool SFLPhone::queryClose()
void
SFLPhone
::
quitButton
()
void
SFLPhone
::
quitButton
()
{
{
InstanceInterface
&
instance
=
InstanceInterfaceSingleton
::
getInstance
();
InstanceInterface
&
instance
=
InstanceInterfaceSingleton
::
getInstance
();
//qDebug() << "quitButton : " <<
v
iew->callTree->count() << " calls open.";
//qDebug() << "quitButton : " <<
m_pV
iew->callTree->count() << " calls open.";
//if(
v
iew->callTree->count() > 0 && instance.getRegistrationCount() <= 1) {
//if(
m_pV
iew->callTree->count() > 0 && instance.getRegistrationCount() <= 1) {
//qDebug() << "Attempting to quit when still having some calls open.";
//qDebug() << "Attempting to quit when still having some calls open.";
//}
//}
v
iew
->
saveState
();
m_pV
iew
->
saveState
();
instance
.
Unregister
(
getpid
());
instance
.
Unregister
(
getpid
());
qApp
->
quit
();
qApp
->
quit
();
}
}
...
@@ -293,21 +303,21 @@ void SFLPhone::changeEvent(QEvent* event)
...
@@ -293,21 +303,21 @@ void SFLPhone::changeEvent(QEvent* event)
}
}
}
}
void
SFLPhone
::
on_
v
iew_statusMessageChangeAsked
(
const
QString
&
message
)
void
SFLPhone
::
on_
m_pV
iew_statusMessageChangeAsked
(
const
QString
&
message
)
{
{
qDebug
()
<<
"on_
v
iew_statusMessageChangeAsked : "
+
message
;
qDebug
()
<<
"on_
m_pV
iew_statusMessageChangeAsked : "
+
message
;
statusBarWidget
->
setText
(
message
);
statusBarWidget
->
setText
(
message
);
}
}
void
SFLPhone
::
on_
v
iew_windowTitleChangeAsked
(
const
QString
&
message
)
void
SFLPhone
::
on_
m_pV
iew_windowTitleChangeAsked
(
const
QString
&
message
)
{
{
qDebug
()
<<
"on_
v
iew_windowTitleChangeAsked : "
+
message
;
qDebug
()
<<
"on_
m_pV
iew_windowTitleChangeAsked : "
+
message
;
setWindowTitle
(
message
);
setWindowTitle
(
message
);
}
}
void
SFLPhone
::
on_
v
iew_enabledActionsChangeAsked
(
const
bool
*
enabledActions
)
void
SFLPhone
::
on_
m_pV
iew_enabledActionsChangeAsked
(
const
bool
*
enabledActions
)
{
{
qDebug
()
<<
"on_
v
iew_enabledActionsChangeAsked"
;
qDebug
()
<<
"on_
m_pV
iew_enabledActionsChangeAsked"
;
action_accept
->
setVisible
(
enabledActions
[
SFLPhone
::
Accept
]);
action_accept
->
setVisible
(
enabledActions
[
SFLPhone
::
Accept
]);
action_refuse
->
setVisible
(
enabledActions
[
SFLPhone
::
Refuse
]);
action_refuse
->
setVisible
(
enabledActions
[
SFLPhone
::
Refuse
]);
action_hold
->
setVisible
(
enabledActions
[
SFLPhone
::
Hold
]);
action_hold
->
setVisible
(
enabledActions
[
SFLPhone
::
Hold
]);
...
@@ -316,9 +326,9 @@ void SFLPhone::on_view_enabledActionsChangeAsked(const bool * enabledActions)
...
@@ -316,9 +326,9 @@ void SFLPhone::on_view_enabledActionsChangeAsked(const bool * enabledActions)
action_mailBox
->
setVisible
(
enabledActions
[
SFLPhone
::
Mailbox
]);
action_mailBox
->
setVisible
(
enabledActions
[
SFLPhone
::
Mailbox
]);
}
}
void
SFLPhone
::
on_
v
iew_actionIconsChangeAsked
(
const
QString
*
actionIcons
)
void
SFLPhone
::
on_
m_pV
iew_actionIconsChangeAsked
(
const
QString
*
actionIcons
)
{
{
qDebug
()
<<
"on_
v
iew_actionIconsChangeAsked"
;
qDebug
()
<<
"on_
m_pV
iew_actionIconsChangeAsked"
;
action_accept
->
setIcon
(
QIcon
(
actionIcons
[
SFLPhone
::
Accept
]));
action_accept
->
setIcon
(
QIcon
(
actionIcons
[
SFLPhone
::
Accept
]));
action_refuse
->
setIcon
(
QIcon
(
actionIcons
[
SFLPhone
::
Refuse
]));
action_refuse
->
setIcon
(
QIcon
(
actionIcons
[
SFLPhone
::
Refuse
]));
action_hold
->
setIcon
(
QIcon
(
actionIcons
[
SFLPhone
::
Hold
]));
action_hold
->
setIcon
(
QIcon
(
actionIcons
[
SFLPhone
::
Hold
]));
...
@@ -327,9 +337,9 @@ void SFLPhone::on_view_actionIconsChangeAsked(const QString * actionIcons)
...
@@ -327,9 +337,9 @@ void SFLPhone::on_view_actionIconsChangeAsked(const QString * actionIcons)
action_mailBox
->
setIcon
(
QIcon
(
actionIcons
[
SFLPhone
::
Mailbox
]));
action_mailBox
->
setIcon
(
QIcon
(
actionIcons
[
SFLPhone
::
Mailbox
]));
}
}
void
SFLPhone
::
on_
v
iew_actionTextsChangeAsked
(
const
QString
*
actionTexts
)
void
SFLPhone
::
on_
m_pV
iew_actionTextsChangeAsked
(
const
QString
*
actionTexts
)
{
{
qDebug
()
<<
"on_
v
iew_actionTextsChangeAsked"
;
qDebug
()
<<
"on_
m_pV
iew_actionTextsChangeAsked"
;
action_accept
->
setText
(
actionTexts
[
SFLPhone
::
Accept
]);
action_accept
->
setText
(
actionTexts
[
SFLPhone
::
Accept
]);
action_refuse
->
setText
(
actionTexts
[
SFLPhone
::
Refuse
]);
action_refuse
->
setText
(
actionTexts
[
SFLPhone
::
Refuse
]);
action_hold
->
setText
(
actionTexts
[
SFLPhone
::
Hold
]);
action_hold
->
setText
(
actionTexts
[
SFLPhone
::
Hold
]);
...
@@ -339,13 +349,13 @@ void SFLPhone::on_view_actionTextsChangeAsked(const QString * actionTexts)
...
@@ -339,13 +349,13 @@ void SFLPhone::on_view_actionTextsChangeAsked(const QString * actionTexts)
}
}
void
SFLPhone
::
on_
v
iew_transferCheckStateChangeAsked
(
bool
transferCheckState
)
void
SFLPhone
::
on_
m_pV
iew_transferCheckStateChangeAsked
(
bool
transferCheckState
)
{
{
qDebug
()
<<
"Changing transfer action checkState"
;
qDebug
()
<<
"Changing transfer action checkState"
;
action_transfer
->
setChecked
(
transferCheckState
);
action_transfer
->
setChecked
(
transferCheckState
);
}
}
void
SFLPhone
::
on_
v
iew_recordCheckStateChangeAsked
(
bool
recordCheckState
)
void
SFLPhone
::
on_
m_pV
iew_recordCheckStateChangeAsked
(
bool
recordCheckState
)
{
{
qDebug
()
<<
"Changing record action checkState"
;
qDebug
()
<<
"Changing record action checkState"
;
action_record
->
setChecked
(
recordCheckState
);
action_record
->
setChecked
(
recordCheckState
);
...
@@ -353,14 +363,14 @@ void SFLPhone::on_view_recordCheckStateChangeAsked(bool recordCheckState)
...
@@ -353,14 +363,14 @@ void SFLPhone::on_view_recordCheckStateChangeAsked(bool recordCheckState)
void
SFLPhone
::
updateScreen
(
QAction
*
action
)
void
SFLPhone
::
updateScreen
(
QAction
*
action
)
{
{
if
(
action
==
action_main
)
v
iew
->
changeScreen
(
SCREEN_MAIN
);
if
(
action
==
action_main
)
m_pV
iew
->
changeScreen
(
SCREEN_MAIN
);
else
if
(
action
==
action_history
)
v
iew
->
changeScreen
(
SCREEN_HISTORY
);
else
if
(
action
==
action_history
)
m_pV
iew
->
changeScreen
(
SCREEN_HISTORY
);
else
if
(
action
==
action_addressBook
)
v
iew
->
changeScreen
(
SCREEN_ADDRESS
);
else
if
(
action
==
action_addressBook
)
m_pV
iew
->
changeScreen
(
SCREEN_ADDRESS
);
}
}
void
SFLPhone
::
on_
v
iew_screenChanged
(
int
screen
)
void
SFLPhone
::
on_
m_pV
iew_screenChanged
(
int
screen
)
{
{
qDebug
()
<<
"on_
v
iew_screenChanged"
;
qDebug
()
<<
"on_
m_pV
iew_screenChanged"
;
if
(
screen
==
SCREEN_MAIN
)
action_main
->
setChecked
(
true
);
if
(
screen
==
SCREEN_MAIN
)
action_main
->
setChecked
(
true
);
else
if
(
screen
==
SCREEN_HISTORY
)
action_history
->
setChecked
(
true
);
else
if
(
screen
==
SCREEN_HISTORY
)
action_history
->
setChecked
(
true
);
else
if
(
screen
==
SCREEN_ADDRESS
)
action_addressBook
->
setChecked
(
true
);
else
if
(
screen
==
SCREEN_ADDRESS
)
action_addressBook
->
setChecked
(
true
);
...
@@ -378,7 +388,7 @@ QList<QAction*> SFLPhone::getCallActions()
...
@@ -378,7 +388,7 @@ QList<QAction*> SFLPhone::getCallActions()
return
callActions
;
return
callActions
;
}
}
void
SFLPhone
::
on_
v
iew_incomingCall
(
const
Call
*
call
)
void
SFLPhone
::
on_
m_pV
iew_incomingCall
(
const
Call
*
call
)
{
{
//ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
//ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
//trayIconSignal();
//trayIconSignal();
...
@@ -391,7 +401,7 @@ void SFLPhone::on_view_incomingCall(const Call * call)
...
@@ -391,7 +401,7 @@ void SFLPhone::on_view_incomingCall(const Call * call)
//}
//}
}
}
void
SFLPhone
::
on_
v
iew_addressBookEnableAsked
(
bool
enabled
)
void
SFLPhone
::
on_
m_pV
iew_addressBookEnableAsked
(
bool
enabled
)
{
{
action_addressBook
->
setVisible
(
enabled
);
action_addressBook
->
setVisible
(
enabled
);
}
}
kde/src/SFLPhone.h
View file @
8f2b65ee
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
#include
"widgets/SFLPhoneTray.h"
#include
"widgets/SFLPhoneTray.h"
class
SFLPhoneView
;
class
SFLPhoneView
;
class
CallView
;
/**
/**
* This class represents the SFLphone main window
* This class represents the SFLphone main window
...
@@ -94,7 +95,7 @@ private:
...
@@ -94,7 +95,7 @@ private:
KAction
*
action_configureSflPhone
;
KAction
*
action_configureSflPhone
;
KAction
*
action_accountCreationWizard
;
KAction
*
action_accountCreationWizard
;
SFLPhoneView
*
v
iew
;
SFLPhoneView
*
m_pV
iew
;
QMenu
*
trayIconMenu
;
QMenu
*
trayIconMenu
;
bool
iconChanged
;
bool
iconChanged
;
SFLPhoneTray
*
trayIcon
;
SFLPhoneTray
*
trayIcon
;
...
@@ -128,19 +129,21 @@ public:
...
@@ -128,19 +129,21 @@ public:
friend
class
SFLPhoneView
;
friend
class
SFLPhoneView
;
static
SFLPhone
*
app
();
static
SFLPhone
*
app
();
SFLPhoneView
*
view
();
CallView
*
model
();
private
slots
:
private
slots
:
void
on_
v
iew_statusMessageChangeAsked
(
const
QString
&
message
);
void
on_
m_pV
iew_statusMessageChangeAsked
(
const
QString
&
message
);
void
on_
v
iew_windowTitleChangeAsked
(
const
QString
&
message
);
void
on_
m_pV
iew_windowTitleChangeAsked
(
const
QString
&
message
);
void
on_
v
iew_enabledActionsChangeAsked
(
const
bool
*
enabledActions
);
void
on_
m_pV
iew_enabledActionsChangeAsked
(
const
bool
*
enabledActions
);
void
on_
v
iew_actionIconsChangeAsked
(
const
QString
*
actionIcons
);
void
on_
m_pV
iew_actionIconsChangeAsked
(
const
QString
*
actionIcons
);
void
on_
v
iew_actionTextsChangeAsked
(
const
QString
*
actionTexts
);
void
on_
m_pV
iew_actionTextsChangeAsked
(
const
QString
*
actionTexts
);
void
on_
v
iew_transferCheckStateChangeAsked
(
bool
transferCheckState
);
void
on_
m_pV
iew_transferCheckStateChangeAsked
(
bool
transferCheckState
);
void
on_
v
iew_recordCheckStateChangeAsked
(
bool
recordCheckState
);
void
on_
m_pV
iew_recordCheckStateChangeAsked
(
bool
recordCheckState
);
void
on_
v
iew_addressBookEnableAsked
(
bool
enabled
);
void
on_
m_pV
iew_addressBookEnableAsked
(
bool
enabled
);
void
on_
v
iew_screenChanged
(
int
screen
);
void
on_
m_pV
iew_screenChanged
(
int
screen
);
void
on_
v
iew_incomingCall
(
const
Call
*
call
);
void
on_
m_pV
iew_incomingCall
(
const
Call
*
call
);
void
updateScreen
(
QAction
*
action
);
void
updateScreen
(
QAction
*
action
);
...
...
kde/src/SFLPhoneView.cpp
View file @
8f2b65ee
...
@@ -57,9 +57,9 @@ using namespace KABC;
...
@@ -57,9 +57,9 @@ using namespace KABC;
SFLPhoneView
::
SFLPhoneView
(
QWidget
*
parent
)
SFLPhoneView
::
SFLPhoneView
(
QWidget
*
parent
)
:
QWidget
(
parent
),
:
QWidget
(
parent
),
wizard
(
0
),
wizard
(
0
),
addressBookTree
(
CallView
::
Address
),
addressBookTree
(
new
CallView
(
CallView
::
Address
)
)
,
callTreeModel
(
CallView
::
ActiveCall
),
callTreeModel
(
new
CallView
(
CallView
::
ActiveCall
)
)
,
historyTreeModel
(
CallView
::
History
)
historyTreeModel
(
new
CallView
(
CallView
::
History
)
)
{
{
setupUi
(
this
);
setupUi
(
this
);
...
@@ -74,15 +74,15 @@ SFLPhoneView::SFLPhoneView(QWidget *parent)
...
@@ -74,15 +74,15 @@ SFLPhoneView::SFLPhoneView(QWidget *parent)
//historyTree = new CallTreeWidget(page_callHistory);
//historyTree = new CallTreeWidget(page_callHistory);
//callTree = new CallTreeWidget(this);
//callTree = new CallTreeWidget(this);
//historyTree = new CallTreeWidget(this);
//historyTree = new CallTreeWidget(this);
callTreeModel
.
setTitle
(
"Calls"
);
callTreeModel
->
setTitle
(
"Calls"
);
historyTreeModel
.
setTitle
(
"History"
);
historyTreeModel
->
setTitle
(
"History"
);
page_callList
->
layout
()
->
addWidget
(
callTreeModel
.
getWidget
());
page_callList
->
layout
()
->
addWidget
(
callTreeModel
->
getWidget
());
page_callHistory
->
layout
()
->
addWidget
(
historyTreeModel
.
getWidget
());
page_callHistory
->
layout
()
->
addWidget
(
historyTreeModel
->
getWidget
());
historyLoaded
=
false
;
historyLoaded
=
false
;
// for(int i = 0 ; i < callTreeModel
.
size() ; i++) {
// for(int i = 0 ; i < callTreeModel
->
size() ; i++) {
// Call * call = (*callList)[i];
// Call * call = (*callList)[i];
// if(call->getState() == CALL_STATE_OVER) {
// if(call->getState() == CALL_STATE_OVER) {
// addCallToCallHistory(call);
// addCallToCallHistory(call);
...
@@ -142,11 +142,11 @@ SFLPhoneView::SFLPhoneView(QWidget *parent)
...
@@ -142,11 +142,11 @@ SFLPhoneView::SFLPhoneView(QWidget *parent)
connect
(
CallView
::
getAccountList
(),
SIGNAL
(
accountListUpdated
()),
connect
(
CallView
::
getAccountList
(),
SIGNAL
(
accountListUpdated
()),
this
,
SLOT
(
updateWindowCallState
()));
this
,
SLOT
(
updateWindowCallState
()));
connect
(
callTreeModel
.
getWidget
(),
SIGNAL
(
itemChanged
()),
//currentItemChanged
connect
(
callTreeModel
->
getWidget
(),
SIGNAL
(
itemChanged
()),
//currentItemChanged
this
,
SLOT
(
on_callTree_currentItemChanged
()));
this
,
SLOT
(
on_callTree_currentItemChanged
()));
connect
(
callTreeModel
.
getWidget
(),
SIGNAL
(
itemChanged
()),
//ITem changed
connect
(
callTreeModel
->
getWidget
(),
SIGNAL
(
itemChanged
()),
//ITem changed
this
,
SLOT
(
on_callTree_itemChanged
()));
this
,
SLOT
(
on_callTree_itemChanged
()));
connect
(
callTreeModel
.
getWidget
(),
SIGNAL
(
doubleClicked
(
const
QModelIndex
&
)),
connect
(
callTreeModel
->
getWidget
(),
SIGNAL
(
doubleClicked
(
const
QModelIndex
&
)),
this
,
SLOT
(
on_callTree_itemDoubleClicked
(
const
QModelIndex
&
)));
this
,
SLOT
(
on_callTree_itemDoubleClicked
(
const
QModelIndex
&
)));
...
@@ -161,7 +161,7 @@ SFLPhoneView::~SFLPhoneView()
...
@@ -161,7 +161,7 @@ SFLPhoneView::~SFLPhoneView()
void
SFLPhoneView
::
saveState
()
void
SFLPhoneView
::
saveState
()
{
{
ConfigurationManagerInterface
&
configurationManager
=
ConfigurationManagerInterfaceSingleton
::
getInstance
();
ConfigurationManagerInterface
&
configurationManager
=
ConfigurationManagerInterfaceSingleton
::
getInstance
();
configurationManager
.
setHistory
(
callTreeModel
.
getHistory
());
configurationManager
.
setHistory
(
callTreeModel
->
getHistory
CallId
());
}
}
void
SFLPhoneView
::
loadWindow
()
void
SFLPhoneView
::
loadWindow
()
...
@@ -186,10 +186,15 @@ QErrorMessage * SFLPhoneView::getErrorWindow()
...
@@ -186,10 +186,15 @@ QErrorMessage * SFLPhoneView::getErrorWindow()
return
errorWindow
;
return
errorWindow
;
}
}
CallView
*
SFLPhoneView
::
model
()
{
return
callTreeModel
;
}
// Call* SFLPhoneView::addCallToCallList(Call * call)
// Call* SFLPhoneView::addCallToCallList(Call * call)
// {
// {
// // return callTree->insert(call);
// // return callTree->insert(call);
// return callTreeModel
.
addCall(call);
// return callTreeModel
->
addCall(call);
// }
// }
// Call* SFLPhoneView::addCallToCallHistory(Call * call)
// Call* SFLPhoneView::addCallToCallHistory(Call * call)
...
@@ -216,7 +221,7 @@ void SFLPhoneView::typeString(QString str)
...
@@ -216,7 +221,7 @@ void SFLPhoneView::typeString(QString str)
CallManagerInterface
&
callManager
=
CallManagerInterfaceSingleton
::
getInstance
();
CallManagerInterface
&
callManager
=
CallManagerInterfaceSingleton
::
getInstance
();
if
(
stackedWidget_screen
->
currentWidget
()
==
page_callList
)
{
if
(
stackedWidget_screen
->
currentWidget
()
==
page_callList
)
{
Call
*
call
=
callTreeModel
.
getCurrentItem
();
Call
*
call
=
callTreeModel
->
getCurrentItem
();
callManager
.
playDTMF
(
str
);
callManager
.
playDTMF
(
str
);
Call
*
currentCall
=
0
;
Call
*
currentCall
=
0
;
Call
*
candidate
=
0
;
Call
*
candidate
=
0
;
...
@@ -227,13 +232,13 @@ void SFLPhoneView::typeString(QString str)
...
@@ -227,13 +232,13 @@ void SFLPhoneView::typeString(QString str)
}
}
}
}
// for(int i = callTreeModel
.
size() - 1 ; i >= 0 ; i--)
// for(int i = callTreeModel
->
size() - 1 ; i >= 0 ; i--)
// {
// {
// Call *call2 = (*callList)[i];
// Call *call2 = (*callList)[i];
//
//
//
//
// }
// }
foreach
(
Call
*
call2
,
callTreeModel
.
getCallList
())
{
foreach
(
Call
*
call2
,
callTreeModel
->
getCallList
())
{
if
(
currentCall
!=
call2
&&
call2
->
getState
()
==
CALL_STATE_CURRENT
)
{
if
(
currentCall
!=
call2
&&
call2
->
getState
()
==
CALL_STATE_CURRENT
)
{
action
(
call2
,
CALL_ACTION_HOLD
);
action
(
call2
,
CALL_ACTION_HOLD
);
}
}
...
@@ -244,9 +249,9 @@ void SFLPhoneView::typeString(QString str)
...
@@ -244,9 +249,9 @@ void SFLPhoneView::typeString(QString str)
if
(
!
currentCall
&&
!
candidate
)
{
if
(
!
currentCall
&&
!
candidate
)
{
qDebug
()
<<
"Typing when no item is selected. Opening an item."
;
qDebug
()
<<
"Typing when no item is selected. Opening an item."
;
candidate
=
callTreeModel
.
addDialingCall
();
candidate
=
callTreeModel
->
addDialingCall
();
//callTree->setCurrentRow(callTree->count() + 1); //TODO
//callTree->setCurrentRow(callTree->count() + 1); //TODO
//callTreeModel
.
selectItem(addCallToCallList(candidate));
//callTreeModel
->
selectItem(addCallToCallList(candidate));
}
}
if
(
!
currentCall
&&
candidate
)
{
if
(
!
currentCall
&&
candidate
)
{
...
@@ -270,19 +275,19 @@ void SFLPhoneView::backspace()
...
@@ -270,19 +275,19 @@ void SFLPhoneView::backspace()
qDebug
()
<<
"backspace"
;
qDebug
()
<<
"backspace"
;
if
(
stackedWidget_screen
->
currentWidget
()
==
page_callList
)
{
if
(
stackedWidget_screen
->
currentWidget
()
==
page_callList
)
{
qDebug
()
<<
"In call list."
;
qDebug
()
<<
"In call list."
;
Call
*
call
=
callTreeModel
.
getCurrentItem
();
Call
*
call
=
callTreeModel
->
getCurrentItem
();
if
(
!
call
)
{
if
(
!
call
)
{
qDebug
()
<<
"Error : Backspace on unexisting call."
;
qDebug
()
<<
"Error : Backspace on unexisting call."
;
}
}
else
{
else
{
call
->
backspaceItemText
();
call
->
backspaceItemText
();
if
(
call
->
getState
()
==
CALL_STATE_OVER
)
{
if
(
call
->
getState
()
==
CALL_STATE_OVER
)
{
if
(
callTreeModel
.
getCurrentItem
())
if
(
callTreeModel
->
getCurrentItem
())
callTreeModel
.
removeItem
(
callTreeModel
.
getCurrentItem
());
callTreeModel
->
removeItem
(
callTreeModel
->
getCurrentItem
());
if
(
call
->
getHistoryState
()
!=
NONE
)
{
if
(
call
->
getHistoryState
()
!=
NONE
)
{
//historyTree->insert(call);
//historyTree->insert(call);
historyTreeModel
.
addCall
(
call
);
historyTreeModel
->
addCall
(
call
);
}
}
}
}
}
}
...
@@ -294,7 +299,7 @@ void SFLPhoneView::escape()
...
@@ -294,7 +299,7 @@ void SFLPhoneView::escape()
qDebug
()
<<
"escape"
;
qDebug
()
<<
"escape"
;
if
(
stackedWidget_screen
->
currentWidget
()
==
page_callList
)
{
if
(
stackedWidget_screen
->
currentWidget
()
==
page_callList
)
{
qDebug
()
<<
"In call list."
;
qDebug
()
<<
"In call list."
;
Call
*
call
=
callTreeModel
.
getCurrentItem
();
Call
*
call
=
callTreeModel
->
getCurrentItem
();
if
(
!
call
)
{
if
(
!
cal