Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
89bba742
Commit
89bba742
authored
16 years ago
by
Jérémy Quentin
Browse files
Options
Downloads
Patches
Plain Diff
[#1307] Implement "edit before call" in history and address book.
parent
50e3c983
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sflphone_kde/sflphone_kdeview.cpp
+64
-6
64 additions, 6 deletions
sflphone_kde/sflphone_kdeview.cpp
sflphone_kde/sflphone_kdeview.h
+21
-21
21 additions, 21 deletions
sflphone_kde/sflphone_kdeview.h
with
85 additions
and
27 deletions
sflphone_kde/sflphone_kdeview.cpp
+
64
−
6
View file @
89bba742
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include
<QtGui/QMenu>
#include
<QtGui/QMenu>
#include
<QtGui/QBrush>
#include
<QtGui/QBrush>
#include
<QtGui/QPalette>
#include
<QtGui/QPalette>
#include
<QtGui/QInputDialog>
#include
<kstandardaction.h>
#include
<kstandardaction.h>
#include
<kactioncollection.h>
#include
<kactioncollection.h>
...
@@ -332,12 +333,27 @@ void sflphone_kdeView::enter()
...
@@ -332,12 +333,27 @@ void sflphone_kdeView::enter()
if
(
stackedWidget_screen
->
currentWidget
()
==
page_callHistory
)
if
(
stackedWidget_screen
->
currentWidget
()
==
page_callHistory
)
{
{
qDebug
()
<<
"In call history."
;
qDebug
()
<<
"In call history."
;
lineEdit_searchHistory
->
clear
();
action_history
->
setChecked
(
false
);
stackedWidget_screen
->
setCurrentWidget
(
page_callList
);
Call
*
pastCall
=
callList
->
findCallByHistoryItem
(
listWidget_callHistory
->
currentItem
());
Call
*
call
=
callList
->
addDialingCall
(
pastCall
->
getPeerName
());
call
->
appendItemText
(
pastCall
->
getPeerPhoneNumber
());
addCallToCallList
(
call
);
listWidget_callList
->
setCurrentRow
(
listWidget_callList
->
count
()
-
1
);
actionb
(
call
,
CALL_ACTION_ACCEPT
);
}
}
if
(
stackedWidget_screen
->
currentWidget
()
==
page_addressBook
)
if
(
stackedWidget_screen
->
currentWidget
()
==
page_addressBook
)
{
{
qDebug
()
<<
"In address book."
;
qDebug
()
<<
"In address book."
;
lineEdit_addressBook
->
clear
();
action_addressBook
->
setChecked
(
false
);
stackedWidget_screen
->
setCurrentWidget
(
page_callList
);
ContactItemWidget
*
w
=
(
ContactItemWidget
*
)
(
listWidget_addressBook
->
itemWidget
(
listWidget_addressBook
->
currentItem
()));
Call
*
call
=
callList
->
addDialingCall
(
w
->
getContactName
());
call
->
appendItemText
(
w
->
getContactNumber
());
addCallToCallList
(
call
);
listWidget_callList
->
setCurrentRow
(
listWidget_callList
->
count
()
-
1
);
actionb
(
call
,
CALL_ACTION_ACCEPT
);
}
}
}
}
...
@@ -958,12 +974,20 @@ void sflphone_kdeView::on_stackedWidget_screen_currentChanged(int index)
...
@@ -958,12 +974,20 @@ void sflphone_kdeView::on_stackedWidget_screen_currentChanged(int index)
void
sflphone_kdeView
::
contextMenuEvent
(
QContextMenuEvent
*
event
)
void
sflphone_kdeView
::
contextMenuEvent
(
QContextMenuEvent
*
event
)
{
{
QMenu
menu
(
this
);
QMenu
menu
(
this
);
if
(
stackedWidget_screen
->
currentWidget
()
==
page_callHistory
||
stackedWidget_screen
->
currentWidget
()
==
page_addressBook
)
{
QAction
*
action_edit
=
new
QAction
(
&
menu
);
action_edit
->
setText
(
tr2i18n
(
"Edit before call"
,
0
));
connect
(
action_edit
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
editBeforeCall
()));
menu
.
addAction
(
action_edit
);
}
menu
.
addAction
(
action_accept
);
menu
.
addAction
(
action_accept
);
menu
.
addAction
(
action_refuse
);
menu
.
addAction
(
action_refuse
);
menu
.
addAction
(
action_hold
);
menu
.
addAction
(
action_hold
);
menu
.
addAction
(
action_transfer
);
menu
.
addAction
(
action_transfer
);
menu
.
addAction
(
action_record
);
menu
.
addAction
(
action_record
);
//TODO accounts to choose
menu
.
addSeparator
();
menu
.
addSeparator
();
QVector
<
Account
*>
accounts
=
registeredAccounts
();
QVector
<
Account
*>
accounts
=
registeredAccounts
();
for
(
int
i
=
0
;
i
<
accounts
.
size
()
;
i
++
)
for
(
int
i
=
0
;
i
<
accounts
.
size
()
;
i
++
)
...
@@ -984,6 +1008,43 @@ void sflphone_kdeView::contextMenuEvent(QContextMenuEvent *event)
...
@@ -984,6 +1008,43 @@ void sflphone_kdeView::contextMenuEvent(QContextMenuEvent *event)
}
}
void
sflphone_kdeView
::
editBeforeCall
()
{
qDebug
()
<<
"editBeforeCall"
;
QString
name
;
QString
number
;
if
(
stackedWidget_screen
->
currentWidget
()
==
page_callHistory
)
{
QListWidgetItem
*
item
=
listWidget_callHistory
->
currentItem
();
if
(
item
)
{
Call
*
call
=
callList
->
findCallByHistoryItem
(
item
);
name
=
call
->
getPeerName
();
number
=
call
->
getPeerPhoneNumber
();
}
}
if
(
stackedWidget_screen
->
currentWidget
()
==
page_addressBook
)
{
QListWidgetItem
*
item
=
listWidget_addressBook
->
currentItem
();
if
(
item
)
{
ContactItemWidget
*
w
=
(
ContactItemWidget
*
)
(
listWidget_addressBook
->
itemWidget
(
listWidget_addressBook
->
currentItem
()));
name
=
w
->
getContactName
();
number
=
w
->
getContactNumber
();
}
}
QString
newNumber
=
QInputDialog
::
getText
(
this
,
tr2i18n
(
"Edit before call"
,
0
),
QString
(),
QLineEdit
::
Normal
,
number
);
action_history
->
setChecked
(
false
);
action_addressBook
->
setChecked
(
false
);
stackedWidget_screen
->
setCurrentWidget
(
page_callList
);
Call
*
call
=
callList
->
addDialingCall
(
name
);
call
->
appendItemText
(
newNumber
);
addCallToCallList
(
call
);
listWidget_callList
->
setCurrentRow
(
listWidget_callList
->
count
()
-
1
);
actionb
(
call
,
CALL_ACTION_ACCEPT
);
}
void
sflphone_kdeView
::
setAccountFirst
(
Account
*
account
)
void
sflphone_kdeView
::
setAccountFirst
(
Account
*
account
)
{
{
qDebug
()
<<
"setAccountFirst : "
<<
account
->
getAlias
();
qDebug
()
<<
"setAccountFirst : "
<<
account
->
getAlias
();
...
@@ -1073,8 +1134,6 @@ void sflphone_kdeView::on_action_accept_triggered()
...
@@ -1073,8 +1134,6 @@ void sflphone_kdeView::on_action_accept_triggered()
Call
*
pastCall
=
callList
->
findCallByHistoryItem
(
listWidget_callHistory
->
currentItem
());
Call
*
pastCall
=
callList
->
findCallByHistoryItem
(
listWidget_callHistory
->
currentItem
());
Call
*
call
=
callList
->
addDialingCall
(
pastCall
->
getPeerName
());
Call
*
call
=
callList
->
addDialingCall
(
pastCall
->
getPeerName
());
call
->
appendItemText
(
pastCall
->
getPeerPhoneNumber
());
call
->
appendItemText
(
pastCall
->
getPeerPhoneNumber
());
// if(!pastCall->getPeerName().isEmpty())
// call->setPeerName(pastCall->getPeerName());
addCallToCallList
(
call
);
addCallToCallList
(
call
);
listWidget_callList
->
setCurrentRow
(
listWidget_callList
->
count
()
-
1
);
listWidget_callList
->
setCurrentRow
(
listWidget_callList
->
count
()
-
1
);
actionb
(
call
,
CALL_ACTION_ACCEPT
);
actionb
(
call
,
CALL_ACTION_ACCEPT
);
...
@@ -1085,7 +1144,6 @@ void sflphone_kdeView::on_action_accept_triggered()
...
@@ -1085,7 +1144,6 @@ void sflphone_kdeView::on_action_accept_triggered()
stackedWidget_screen
->
setCurrentWidget
(
page_callList
);
stackedWidget_screen
->
setCurrentWidget
(
page_callList
);
ContactItemWidget
*
w
=
(
ContactItemWidget
*
)
(
listWidget_addressBook
->
itemWidget
(
listWidget_addressBook
->
currentItem
()));
ContactItemWidget
*
w
=
(
ContactItemWidget
*
)
(
listWidget_addressBook
->
itemWidget
(
listWidget_addressBook
->
currentItem
()));
Call
*
call
=
callList
->
addDialingCall
(
w
->
getContactName
());
Call
*
call
=
callList
->
addDialingCall
(
w
->
getContactName
());
// call->setPeerName(w->getContactName());
call
->
appendItemText
(
w
->
getContactNumber
());
call
->
appendItemText
(
w
->
getContactNumber
());
addCallToCallList
(
call
);
addCallToCallList
(
call
);
listWidget_callList
->
setCurrentRow
(
listWidget_callList
->
count
()
-
1
);
listWidget_callList
->
setCurrentRow
(
listWidget_callList
->
count
()
-
1
);
...
...
This diff is collapsed.
Click to expand it.
sflphone_kde/sflphone_kdeview.h
+
21
−
21
View file @
89bba742
...
@@ -57,7 +57,6 @@ class sflphone_kdeView : public QWidget, public Ui::SFLPhone
...
@@ -57,7 +57,6 @@ class sflphone_kdeView : public QWidget, public Ui::SFLPhone
Q_OBJECT
Q_OBJECT
private:
private:
//Ui::SFLPhone ui_sflphone_kdeview_base;
static
ConfigurationDialog
*
configDialog
;
static
ConfigurationDialog
*
configDialog
;
AccountWizard
*
wizard
;
AccountWizard
*
wizard
;
...
@@ -81,11 +80,17 @@ public:
...
@@ -81,11 +80,17 @@ public:
QErrorMessage
*
getErrorWindow
();
QErrorMessage
*
getErrorWindow
();
private
slots
:
private
slots
:
void
actionb
(
Call
*
call
,
call_action
action
);
void
action
(
QListWidgetItem
*
item
,
call_action
action
);
void
setAccountFirst
(
Account
*
account
);
//void typeChar(QChar c);
//void typeChar(QChar c);
void
typeString
(
QString
str
);
void
typeString
(
QString
str
);
void
backspace
();
void
backspace
();
void
actionb
(
Call
*
call
,
call_action
action
);
void
escape
();
void
action
(
QListWidgetItem
*
item
,
call_action
action
);
void
enter
();
void
editBeforeCall
();
void
alternateColors
(
QListWidget
*
listWidget
);
void
alternateColors
(
QListWidget
*
listWidget
);
...
@@ -106,8 +111,6 @@ private slots:
...
@@ -106,8 +111,6 @@ private slots:
void
updateVolumeControls
();
void
updateVolumeControls
();
void
updateDialpad
();
void
updateDialpad
();
void
escape
();
void
enter
();
virtual
void
keyPressEvent
(
QKeyEvent
*
event
)
virtual
void
keyPressEvent
(
QKeyEvent
*
event
)
{
{
...
@@ -115,7 +118,7 @@ private slots:
...
@@ -115,7 +118,7 @@ private slots:
if
(
key
==
Qt
::
Key_Escape
)
if
(
key
==
Qt
::
Key_Escape
)
escape
();
escape
();
else
if
(
key
==
Qt
::
Key_Return
||
key
==
Qt
::
Key_Enter
)
else
if
(
key
==
Qt
::
Key_Return
||
key
==
Qt
::
Key_Enter
)
on_action_accept_triggered
();
enter
();
else
if
(
key
==
Qt
::
Key_Backspace
)
else
if
(
key
==
Qt
::
Key_Backspace
)
backspace
();
backspace
();
else
else
...
@@ -128,7 +131,6 @@ private slots:
...
@@ -128,7 +131,6 @@ private slots:
}
}
}
}
void
on_action_displayVolumeControls_toggled
();
void
on_action_displayVolumeControls_toggled
();
void
on_action_displayDialpad_toggled
();
void
on_action_displayDialpad_toggled
();
void
on_action_configureAccounts_triggered
();
void
on_action_configureAccounts_triggered
();
...
@@ -143,7 +145,6 @@ private slots:
...
@@ -143,7 +145,6 @@ private slots:
void
on_action_history_triggered
(
bool
checked
);
void
on_action_history_triggered
(
bool
checked
);
void
on_action_addressBook_triggered
(
bool
checked
);
void
on_action_addressBook_triggered
(
bool
checked
);
void
on_action_mailBox_triggered
();
void
on_action_mailBox_triggered
();
//void on_actionAbout();
void
on_pushButton_1_clicked
();
void
on_pushButton_1_clicked
();
void
on_pushButton_2_clicked
();
void
on_pushButton_2_clicked
();
...
@@ -184,7 +185,6 @@ private slots:
...
@@ -184,7 +185,6 @@ private slots:
void
on1_voiceMailNotify
(
const
QString
&
accountID
,
int
count
);
void
on1_voiceMailNotify
(
const
QString
&
accountID
,
int
count
);
void
on1_volumeChanged
(
const
QString
&
device
,
double
value
);
void
on1_volumeChanged
(
const
QString
&
device
,
double
value
);
void
setAccountFirst
(
Account
*
account
);
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment