Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
130
Issues
130
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
76fa379a
Commit
76fa379a
authored
Jul 27, 2010
by
Alexandre Savard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#3218] Fix shortcuts
parent
615d73ec
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
33 deletions
+33
-33
sflphone-client-gnome/src/dbus/dbus.c
sflphone-client-gnome/src/dbus/dbus.c
+1
-0
sflphone-client-gnome/src/shortcuts.c
sflphone-client-gnome/src/shortcuts.c
+7
-8
sflphone-common/src/dbus/configurationmanager.cpp
sflphone-common/src/dbus/configurationmanager.cpp
+5
-0
sflphone-common/src/preferences.cpp
sflphone-common/src/preferences.cpp
+19
-24
sflphone-common/src/preferences.h
sflphone-common/src/preferences.h
+1
-1
No files found.
sflphone-client-gnome/src/dbus/dbus.c
View file @
76fa379a
...
...
@@ -2297,6 +2297,7 @@ dbus_get_shortcuts(void)
{
GError
*
error
=
NULL
;
GHashTable
*
shortcuts
;
if
(
!
org_sflphone_SFLphone_ConfigurationManager_get_shortcuts
(
configurationManagerProxy
,
&
shortcuts
,
&
error
))
{
...
...
sflphone-client-gnome/src/shortcuts.c
View file @
76fa379a
...
...
@@ -387,6 +387,8 @@ shortcuts_initialize_bindings ()
gchar
*
action
,
*
maskAndKey
,
*
token1
,
*
token2
=
NULL
;
guint
mask
,
key
=
0
;
DEBUG
(
"Shortcuts: Initialize bindings"
);
// get shortcuts stored in config through dbus
shortcutsMap
=
dbus_get_shortcuts
();
...
...
@@ -402,7 +404,6 @@ shortcuts_initialize_bindings ()
action
=
shortcutsKeysElement
->
data
;
maskAndKey
=
g_strdup
(
g_hash_table_lookup
(
shortcutsMap
,
action
));
DEBUG
(
"-------------------- maskAndKey %s"
,
maskAndKey
);
token1
=
strtok
(
maskAndKey
,
"x"
);
token2
=
strtok
(
NULL
,
"x"
);
...
...
@@ -411,7 +412,7 @@ shortcuts_initialize_bindings ()
// Value not setted
if
(
token1
&&
token2
){
DEBUG
(
"token1 %s, token2 %s"
,
token1
,
token2
);
DEBUG
(
"
Ahortcuts:
token1 %s, token2 %s"
,
token1
,
token2
);
mask
=
atoi
(
token1
);
key
=
atoi
(
token2
);
...
...
@@ -465,8 +466,7 @@ filter_keys (const GdkXEvent *xevent, const GdkEvent *event, gpointer data)
int
i
=
0
;
xev
=
(
XEvent
*
)
xevent
;
if
(
xev
->
type
!=
KeyPress
)
{
if
(
xev
->
type
!=
KeyPress
)
{
return
GDK_FILTER_CONTINUE
;
}
...
...
@@ -474,8 +474,7 @@ filter_keys (const GdkXEvent *xevent, const GdkEvent *event, gpointer data)
keystate
=
key
->
state
&
~
(
Mod2Mask
|
Mod5Mask
|
LockMask
);
// try to find corresponding action
while
(
accelerators_list
[
i
].
action
!=
NULL
)
{
while
(
accelerators_list
[
i
].
action
!=
NULL
)
{
if
(
accelerators_list
[
i
].
key
==
key
->
keycode
&&
accelerators_list
[
i
].
mask
==
keystate
)
{
...
...
sflphone-common/src/dbus/configurationmanager.cpp
View file @
76fa379a
...
...
@@ -734,15 +734,20 @@ void ConfigurationManager::setShortcuts(
const
std
::
map
<
std
::
string
,
std
::
string
>&
shortcutsMap
)
{
std
::
map
<
std
::
string
,
std
::
string
>
map_cpy
=
shortcutsMap
;
/*
std::map<std::string, std::string> map_cpy = shortcutsMap;
std::map<std::string, std::string>::iterator it;
for (int i = 0; i < (int)shortcutsKeys.size(); i++) {
std::string key = shortcutsKeys.at(i);
it = map_cpy.find(key);
if (it != shortcutsMap.end()) {
Manager::instance().setConfig("Shortcuts", key, it->second);
}
}
*/
Manager
::
instance
().
shortcutPreferences
.
setShortcuts
(
map_cpy
);
Manager
::
instance
().
saveConfig
();
}
...
...
sflphone-common/src/preferences.cpp
View file @
76fa379a
...
...
@@ -449,49 +449,44 @@ std::map<std::string, std::string> ShortcutPreferences::getShortcuts()
std
::
map
<
std
::
string
,
std
::
string
>
shortcutsMap
;
shortcutsMap
.
insert
(
std
::
pair
<
std
::
string
,
std
::
string
>
(
hangupShortKey
,
_hangup
.
data
()
));
shortcutsMap
.
insert
(
std
::
pair
<
std
::
string
,
std
::
string
>
(
pickupShortKey
,
_pickup
.
data
()
));
shortcutsMap
.
insert
(
std
::
pair
<
std
::
string
,
std
::
string
>
(
popupShortKey
,
_popup
.
data
()
));
shortcutsMap
.
insert
(
std
::
pair
<
std
::
string
,
std
::
string
>
(
toggleHoldShortKey
,
_toggleHold
.
data
()
));
shortcutsMap
.
insert
(
std
::
pair
<
std
::
string
,
std
::
string
>
(
togglePickupHangupShortKey
,
_togglePickupHangup
.
data
()
));
shortcutsMap
.
insert
(
std
::
pair
<
std
::
string
,
std
::
string
>
(
hangupShortKey
,
_hangup
));
shortcutsMap
.
insert
(
std
::
pair
<
std
::
string
,
std
::
string
>
(
pickupShortKey
,
_pickup
));
shortcutsMap
.
insert
(
std
::
pair
<
std
::
string
,
std
::
string
>
(
popupShortKey
,
_popup
));
shortcutsMap
.
insert
(
std
::
pair
<
std
::
string
,
std
::
string
>
(
toggleHoldShortKey
,
_toggleHold
));
shortcutsMap
.
insert
(
std
::
pair
<
std
::
string
,
std
::
string
>
(
togglePickupHangupShortKey
,
_togglePickupHangup
));
return
shortcutsMap
;
}
void
ShortcutPreferences
::
setShortcuts
(
std
::
map
<
std
::
string
,
int
>
shortcut
)
void
ShortcutPreferences
::
setShortcuts
(
std
::
map
<
std
::
string
,
std
::
string
>
map_cpy
)
{
std
::
map
<
std
::
string
,
int
>
map_cpy
=
shortcut
;
std
::
map
<
std
::
string
,
int
>::
iterator
it
;
//
std::map<std::string, int> map_cpy = shortcut;
std
::
map
<
std
::
string
,
std
::
string
>::
iterator
it
;
it
=
map_cpy
.
find
(
hangupShortKey
);
if
(
it
!=
map_cpy
.
end
())
{
std
::
stringstream
hangupstr
;
hangupstr
<<
it
->
second
;
_hangup
=
hangupstr
.
str
();
_hangup
=
it
->
second
;
}
it
=
map_cpy
.
find
(
pickupShortKey
);
if
(
it
!=
map_cpy
.
end
())
{
std
::
stringstream
pickupstr
;
pickupstr
<<
it
->
second
;
_pickup
=
pickupstr
.
str
();
_pickup
=
it
->
second
;
}
it
=
map_cpy
.
find
(
popupShortKey
);
if
(
it
!=
map_cpy
.
end
())
{
std
::
stringstream
popupstr
;
popupstr
<<
it
->
second
;
_popup
=
popupstr
.
str
();
_popup
=
it
->
second
;
}
it
=
map_cpy
.
find
(
toggleHoldShortKey
);
if
(
it
!=
map_cpy
.
end
())
{
std
::
stringstream
holdstr
;
holdstr
<<
it
->
second
;
_toggleHold
=
holdstr
.
str
();
_toggleHold
=
it
->
second
;
}
it
=
map_cpy
.
find
(
togglePickupHangupShortKey
);
if
(
it
!=
map_cpy
.
end
())
{
std
::
stringstream
togglestr
;
togglestr
<<
it
->
second
;
_togglePickupHangup
=
togglestr
.
str
();
_togglePickupHangup
=
it
->
second
;
}
/*
for (int i = 0; i < (int)shortcutsKeys.size(); i++) {
...
...
@@ -537,13 +532,13 @@ void ShortcutPreferences::unserialize(Conf::MappingNode *map)
Conf
::
ScalarNode
*
val
=
NULL
;
val
=
(
Conf
::
ScalarNode
*
)(
map
->
getValue
(
hangupShortKey
));
if
(
val
)
{
_hangup
=
atoi
(
val
->
getValue
().
data
()
);
val
=
NULL
;
}
if
(
val
)
{
_hangup
=
val
->
getValue
(
);
val
=
NULL
;
}
val
=
(
Conf
::
ScalarNode
*
)(
map
->
getValue
(
pickupShortKey
));
if
(
val
)
{
_pickup
=
atoi
(
val
->
getValue
().
data
()
);
val
=
NULL
;
}
if
(
val
)
{
_pickup
=
val
->
getValue
(
);
val
=
NULL
;
}
val
=
(
Conf
::
ScalarNode
*
)(
map
->
getValue
(
popupShortKey
));
if
(
val
)
{
_popup
=
atoi
(
val
->
getValue
().
data
()
);
val
=
NULL
;
}
if
(
val
)
{
_popup
=
val
->
getValue
(
);
val
=
NULL
;
}
val
=
(
Conf
::
ScalarNode
*
)(
map
->
getValue
(
toggleHoldShortKey
));
if
(
val
)
{
_toggleHold
=
atoi
(
val
->
getValue
().
data
()
);
val
=
NULL
;
}
if
(
val
)
{
_toggleHold
=
val
->
getValue
(
);
val
=
NULL
;
}
val
=
(
Conf
::
ScalarNode
*
)(
map
->
getValue
(
togglePickupHangupShortKey
));
if
(
val
)
{
_togglePickupHangup
=
atoi
(
val
->
getValue
().
data
()
);
val
=
NULL
;
}
if
(
val
)
{
_togglePickupHangup
=
val
->
getValue
(
);
val
=
NULL
;
}
}
sflphone-common/src/preferences.h
View file @
76fa379a
...
...
@@ -375,8 +375,8 @@ class ShortcutPreferences : public Serializable {
virtual
void
unserialize
(
Conf
::
MappingNode
*
map
);
void
setShortcuts
(
std
::
map
<
std
::
string
,
std
::
string
>
shortcut
);
std
::
map
<
std
::
string
,
std
::
string
>
getShortcuts
(
void
);
void
setShortcuts
(
std
::
map
<
std
::
string
,
int
>
shortcut
);
std
::
string
getHangup
(
void
)
{
return
_hangup
;
}
void
setHangup
(
std
::
string
hangup
)
{
_hangup
=
hangup
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment