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
b71dcd0b
Commit
b71dcd0b
authored
Jul 19, 2012
by
Alexandre Savard
Browse files
Merge branch 'master' of
git+ssh://git.sflphone.org/var/repos/sflphone/git/sflphone
parents
dfda5df8
5d6c9654
Changes
35
Hide whitespace changes
Inline
Side-by-side
daemon/src/video/shm_sink.cpp
View file @
b71dcd0b
...
...
@@ -70,7 +70,7 @@ SHMSink::start()
return
false
;
}
const
int
flags
=
O_RDWR
|
O_CREAT
|
O_TRUNC
;
const
int
flags
=
O_RDWR
|
O_CREAT
|
O_TRUNC
|
O_EXCL
;
if
(
not
shm_name_
.
empty
())
{
fd_
=
shm_open
(
shm_name_
.
c_str
(),
flags
,
perms_
);
if
(
fd_
<
0
)
{
...
...
daemon/src/video/test/test_video_preview.cpp
View file @
b71dcd0b
...
...
@@ -44,12 +44,14 @@ void VideoPreviewTest::testPreview()
args
[
"height"
]
=
"480"
;
sfl_video
::
VideoPreview
preview
(
args
);
sleep
(
1
0
);
sleep
(
1
);
}
int
main
()
{
VideoPreviewTest
test
;
test
.
testPreview
();
for
(
int
i
=
0
;
i
<
20
;
++
i
)
{
VideoPreviewTest
test
;
test
.
testPreview
();
}
return
0
;
}
gnome/src/actions.c
View file @
b71dcd0b
...
...
@@ -70,6 +70,9 @@
#include
"unused.h"
#include
"sliders.h"
#include
"messaging/message_tab.h"
#ifdef SFL_VIDEO
#include
"video/video_callbacks.h"
#endif
static
GHashTable
*
ip2ip_profile
;
...
...
@@ -150,6 +153,9 @@ void
sflphone_quit
(
gboolean
force_quit
)
{
if
(
force_quit
||
calllist_get_size
(
current_calls_tab
)
==
0
||
main_window_ask_quit
())
{
#ifdef SFL_VIDEO
video_cleanup
();
#endif
dbus_unregister
(
getpid
());
dbus_clean
();
account_list_free
();
...
...
gnome/src/config/hooks-config.c
View file @
b71dcd0b
...
...
@@ -32,11 +32,12 @@
#include
"gtk2_wrappers.h"
#include
"str_utils.h"
#include
"hooks-config.h"
#include
"eel-gconf-extensions.h"
#include
"dbus.h"
URLHook_Config
*
_urlhook_config
;
GtkWidget
*
field
,
*
command
,
*
prefix
;
GtkWidget
*
field
,
*
command
,
*
prefix
,
*
url
;
void
hooks_load_parameters
(
URLHook_Config
**
settings
)
{
...
...
@@ -94,6 +95,8 @@ void hooks_save_parameters(void)
// Decrement the reference count
g_hash_table_unref
(
params
);
eel_gconf_set_string
(
MESSAGING_URL_COMMAND
,
gtk_entry_get_text
(
GTK_ENTRY
(
url
)));
}
static
void
sip_enabled_cb
(
GtkWidget
*
widget
)
...
...
@@ -194,6 +197,22 @@ GtkWidget* create_hooks_settings()
gtk_widget_set_sensitive
(
GTK_WIDGET
(
prefix
),
gtk_toggle_button_get_active
(
GTK_TOGGLE_BUTTON
(
widg
)));
gtk_table_attach
(
GTK_TABLE
(
table
),
prefix
,
1
,
2
,
0
,
1
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
10
);
gnome_main_section_new_with_table
(
_
(
"Messaging"
),
&
frame
,
&
table
,
4
,
2
);
gtk_box_pack_start
(
GTK_BOX
(
ret
),
frame
,
FALSE
,
FALSE
,
0
);
gtk_widget_show
(
frame
);
label
=
gtk_label_new_with_mnemonic
(
_
(
"Open URL in"
));
url
=
gtk_entry_new
();
gchar
*
url_command
=
eel_gconf_get_string
(
MESSAGING_URL_COMMAND
);
if
(
url_command
&&
*
url_command
)
{
gtk_entry_set_text
(
GTK_ENTRY
(
url
),
url_command
);
g_free
(
url_command
);
}
else
gtk_entry_set_text
(
GTK_ENTRY
(
url
),
"xdg-open"
);
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
label
),
url
);
gtk_table_attach
(
GTK_TABLE
(
table
),
label
,
0
,
1
,
4
,
5
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
10
);
gtk_table_attach
(
GTK_TABLE
(
table
),
url
,
1
,
2
,
4
,
5
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
10
);
gtk_widget_show_all
(
ret
);
return
ret
;
...
...
gnome/src/config/videoconf.c
View file @
b71dcd0b
...
...
@@ -732,9 +732,11 @@ fill_devices()
gtk_widget_hide
(
v4l2_nodev
);
gtk_widget_set_sensitive
(
preview_button
,
TRUE
);
}
else
{
gtk_widget_hide
(
v4l2_hbox
);
gtk_widget_show
(
v4l2_nodev
);
gtk_widget_set_sensitive
(
preview_button
,
FALSE
);
if
(
GTK_IS_WIDGET
(
v4l2_hbox
))
{
gtk_widget_hide
(
v4l2_hbox
);
gtk_widget_show
(
v4l2_nodev
);
gtk_widget_set_sensitive
(
preview_button
,
FALSE
);
}
}
}
...
...
gnome/src/dbus/dbus.c
View file @
b71dcd0b
...
...
@@ -1274,8 +1274,6 @@ dbus_get_current_video_codec_name(const callable_obj_t *c)
codecName
=
g_strdup
(
""
);
}
DEBUG
(
"%s: codecName : %s"
,
__PRETTY_FUNCTION__
,
codecName
);
return
codecName
;
}
#endif
...
...
@@ -1289,7 +1287,6 @@ dbus_get_current_audio_codec_name(const callable_obj_t *c)
org_sflphone_SFLphone_CallManager_get_current_audio_codec_name
(
call_proxy
,
c
->
_callID
,
&
codecName
,
&
error
);
check_error
(
error
);
DEBUG
(
"%s: codecName : %s"
,
__PRETTY_FUNCTION__
,
codecName
);
return
codecName
;
}
...
...
gnome/src/eel-gconf-extensions.c
View file @
b71dcd0b
...
...
@@ -243,10 +243,10 @@ eel_gconf_unset(const char *key)
eel_gconf_handle_error
(
&
error
);
}
char
*
g
char
*
eel_gconf_get_string
(
const
char
*
key
)
{
char
*
result
;
g
char
*
result
=
NULL
;
GConfClient
*
client
;
GError
*
error
=
NULL
;
...
...
gnome/src/eel-gconf-extensions.h
View file @
b71dcd0b
...
...
@@ -54,6 +54,7 @@ BEGIN_EXTERN_C
#define POPUP_ON_CALL CONF_PREFIX "/state/popup"
#define HISTORY_ENABLED CONF_PREFIX "/state/history"
#define INSTANT_MESSAGING_ENABLED CONF_PREFIX "/state/instant_messaging"
#define MESSAGING_URL_COMMAND CONF_PREFIX "/hook/url_command"
#define EEL_GCONF_UNDEFINED_CONNECTION 0
...
...
gnome/src/messaging/Makefile.am
View file @
b71dcd0b
...
...
@@ -4,8 +4,8 @@ noinst_LTLIBRARIES = libmessaging.la
libmessaging_la_SOURCES
=
message_tab.c message_tab.h
libmessaging_la_LDFLAGS
=
libmessaging_la_LDFLAGS
=
$(GCONF_LDFLAGS)
$(GTK_LDFLAGS)
$(GLIB_LDFLAGS)
$(DBUSGLIB_LDFLAGS)
libmessaging_la_LIBADD
=
@GTK_LIBS@ @GLIB_LIBS@
libmessaging_la_LIBADD
=
@GTK_LIBS@ @GLIB_LIBS@
$(GCONF_LIBS)
$(DBUSGLIB_LIBS)
libmessaging_la_CFLAGS
=
@GTK_CFLAGS@ @GLIB_CFLAGS@ @DBUSGLIB_CFLAGS@
libmessaging_la_CFLAGS
=
@GTK_CFLAGS@ @GLIB_CFLAGS@ @DBUSGLIB_CFLAGS@
$(GCONF_CFLAGS)
gnome/src/messaging/message_tab.c
View file @
b71dcd0b
...
...
@@ -32,6 +32,7 @@
#include
"../dbus/dbus.h"
#include
<glib.h>
#include
"../mainwindow.h"
#include
"eel-gconf-extensions.h"
#include
<string.h>
static
GtkWidget
*
tab_box
=
NULL
;
...
...
@@ -188,15 +189,21 @@ on_focus_out(GtkEntry *entry UNUSED, gpointer user_data UNUSED)
}
static
void
on_clicked
(
GtkTextBuffer
*
textbuffer
UNUSED
,
GtkTextIter
*
location
UNUSED
,
GtkTextMark
*
mark
UNUSED
,
gpointer
user_data
UNUSED
)
on_clicked
(
GtkTextBuffer
*
textbuffer
,
GtkTextIter
*
location
UNUSED
,
GtkTextMark
*
mark
UNUSED
,
gpointer
user_data
UNUSED
)
{
if
(
start_link
&&
end_link
&&
gtk_text_iter_compare
(
start_link
,
location
)
<=
0
&&
gtk_text_iter_compare
(
location
,
end_link
)
<=
0
)
{
gchar
*
text
=
gtk_text_buffer_get_text
(
textbuffer
,
start_link
,
end_link
,
FALSE
);
start_link
=
NULL
;
end_link
=
NULL
;
if
(
strlen
(
text
))
{
const
gchar
*
argv
[
3
]
=
{
"x-www-browser"
,
text
,(
char
*
)
NULL
};
g_spawn_async
(
NULL
,(
gchar
**
)
argv
,
NULL
,
G_SPAWN_SEARCH_PATH
|
G_SPAWN_STDOUT_TO_DEV_NULL
|
G_SPAWN_STDERR_TO_DEV_NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
gchar
*
url_command
=
eel_gconf_get_string
(
MESSAGING_URL_COMMAND
);
if
(
url_command
&&
!
strlen
(
url_command
))
url_command
=
"xdg-open"
;
const
gchar
*
argv
[
3
]
=
{
url_command
,
text
,(
char
*
)
NULL
};
g_spawn_async
(
NULL
,(
gchar
**
)
argv
,
NULL
,
G_SPAWN_SEARCH_PATH
|
G_SPAWN_STDOUT_TO_DEV_NULL
|
G_SPAWN_STDERR_TO_DEV_NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
gtk_text_buffer_remove_all_tags
(
textbuffer
,
start_link
,
end_link
);
start_link
=
NULL
;
end_link
=
NULL
;
}
}
}
...
...
@@ -228,7 +235,7 @@ on_cursor_motion(GtkTextView *view UNUSED, GdkEvent *event, gpointer data)
/*Match the regex*/
GError
*
error
=
NULL
;
gchar
*
pattern_string
=
"^
http
\\
://[a-zA-Z0-9
\\
-
\\
.]+
\\
.[a-zA-Z]{2,3}(/
\\
S*)?$"
;
gchar
*
pattern_string
=
"^
[a-z]*
\\
://[a-zA-Z0-9
\\
-
\\
.]+
\\
.[a-zA-Z]{2,3}(/
\\
S*)?$"
;
GRegex
*
regex
=
g_regex_new
(
pattern_string
,
0
,
0
,
&
error
);
GMatchInfo
*
match_info
=
NULL
;
GdkWindow
*
win
=
gtk_text_view_get_window
(
GTK_TEXT_VIEW
(
view
),
GTK_TEXT_WINDOW_TEXT
);
...
...
@@ -274,6 +281,8 @@ disable_messaging_tab(const gchar * id)
tab
=
g_hash_table_lookup
(
tabs
,
id
);
if
(
tab
!=
NULL
)
gtk_widget_hide
(
tab
->
entry
);
if
(
!
g_list_length
(
gtk_container_get_children
(
GTK_CONTAINER
(
get_tab_box
()))))
gtk_widget_hide
(
get_tab_box
());
}
void
...
...
@@ -354,8 +363,10 @@ create_messaging_tab_common(const gchar* call_id, const gchar *label)
/* Create the main layout */
GtkWidget
*
vbox
=
gtk_box_new
(
GTK_ORIENTATION_VERTICAL
,
0
);
GtkTextBuffer
*
text_buffer
=
gtk_text_buffer_new
(
NULL
);
gtk_text_buffer_create_tag
(
text_buffer
,
"b"
,
"weight"
,
PANGO_WEIGHT_BOLD
,
NULL
);
gtk_text_buffer_create_tag
(
text_buffer
,
"link"
,
"foreground"
,
"#0000FF"
,
"underline"
,
PANGO_UNDERLINE_SINGLE
);
if
(
text_buffer
)
{
gtk_text_buffer_create_tag
(
text_buffer
,
"b"
,
"weight"
,
PANGO_WEIGHT_BOLD
,
NULL
);
gtk_text_buffer_create_tag
(
text_buffer
,
"link"
,
"foreground"
,
"#0000FF"
,
"underline"
,
PANGO_UNDERLINE_SINGLE
,
NULL
);
}
/* Create the conversation history widget*/
GtkWidget
*
history_hbox
=
gtk_box_new
(
GTK_ORIENTATION_HORIZONTAL
,
2
);
...
...
@@ -465,11 +476,12 @@ create_messaging_tab(callable_obj_t* call)
message_tab
*
create_messaging_tab_conf
(
conference_obj_t
*
call
)
{
message_tab
*
self
=
create_messaging_tab_common
(
call
->
_confID
,
"Conference"
);
self
->
conf
=
call
;
self
->
call
=
NULL
;
disable_conference_calls
(
call
);
return
self
;
if
(
call
->
_confID
&&
strlen
(
call
->
_confID
))
{
message_tab
*
self
=
create_messaging_tab_common
(
call
->
_confID
,
"Conference"
);
self
->
conf
=
call
;
self
->
call
=
NULL
;
disable_conference_calls
(
call
);
return
self
;
}
return
NULL
;
}
\ No newline at end of file
gnome/src/video/video_callbacks.c
View file @
b71dcd0b
...
...
@@ -39,9 +39,36 @@
#include
"config/videoconf.h"
#include
"unused.h"
// FIXME: get rid of these
static
GtkWidget
*
video_window_global
=
NULL
;
static
gboolean
video_window_fullscreen
=
FALSE
;
typedef
struct
{
gchar
*
id
;
GtkWidget
*
window
;
gboolean
fullscreen
;
}
VideoHandle
;
static
GHashTable
*
video_handles
;
static
gboolean
video_is_local
(
const
gchar
*
id
)
{
static
const
gchar
*
const
LOCAL_VIDEO_ID
=
"local"
;
return
g_strcmp0
(
id
,
LOCAL_VIDEO_ID
)
==
0
;
}
static
void
cleanup_handle
(
gpointer
data
)
{
VideoHandle
*
h
=
(
VideoHandle
*
)
data
;
if
(
!
h
)
return
;
if
(
GTK_IS_WIDGET
(
h
->
window
))
{
gtk_widget_destroy
(
h
->
window
);
if
(
video_is_local
(
h
->
id
))
update_preview_button_label
();
g_free
(
h
->
id
);
}
g_free
(
h
);
}
static
void
video_window_deleted_cb
(
GtkWidget
*
widget
UNUSED
,
gpointer
data
UNUSED
)
...
...
@@ -51,19 +78,55 @@ video_window_deleted_cb(GtkWidget *widget UNUSED, gpointer data UNUSED)
}
static
void
video_window_button_cb
(
GtkWindow
*
win
,
GdkEventButton
*
event
,
gpointer
fullscreen
)
video_window_button_cb
(
GtkWindow
*
win
,
GdkEventButton
*
event
,
gpointer
data
)
{
int
*
fs
=
fullscreen
;
VideoHandle
*
handle
=
(
VideoHandle
*
)
data
;
if
(
event
->
type
==
GDK_2BUTTON_PRESS
)
{
*
fs
=
!*
fs
;
if
(
*
fs
)
DEBUG
(
"TOGGLING FULL SCREEEN!"
);
handle
->
fullscreen
=
!
handle
->
fullscreen
;
if
(
handle
->
fullscreen
)
gtk_window_fullscreen
(
win
);
else
gtk_window_unfullscreen
(
win
);
}
}
static
VideoHandle
*
add_handle
(
const
gchar
*
id
)
{
if
(
!
video_handles
)
video_handles
=
g_hash_table_new_full
(
g_str_hash
,
g_str_equal
,
g_free
,
cleanup_handle
);
if
(
g_hash_table_lookup
(
video_handles
,
id
))
{
ERROR
(
"Already created handle for video with id %s"
,
id
);
return
NULL
;
}
VideoHandle
*
handle
=
g_new0
(
VideoHandle
,
1
);
handle
->
id
=
g_strdup
(
id
);
handle
->
window
=
gtk_window_new
(
GTK_WINDOW_TOPLEVEL
);
handle
->
fullscreen
=
FALSE
;
g_signal_connect
(
handle
->
window
,
"button_press_event"
,
G_CALLBACK
(
video_window_button_cb
),
handle
);
g_signal_connect
(
handle
->
window
,
"delete-event"
,
G_CALLBACK
(
video_window_deleted_cb
),
NULL
);
if
(
video_is_local
(
id
))
update_preview_button_label
();
g_hash_table_insert
(
video_handles
,
g_strdup
(
id
),
handle
);
return
handle
;
}
void
video_cleanup
()
{
if
(
video_handles
)
{
g_hash_table_destroy
(
video_handles
);
video_handles
=
NULL
;
}
}
static
gboolean
try_clutter_init
()
{
...
...
@@ -84,38 +147,24 @@ try_clutter_init()
#undef PRINT_ERR
}
static
gboolean
video_is_local
(
const
gchar
*
id
)
{
static
const
gchar
*
const
LOCAL_VIDEO_ID
=
"local"
;
return
g_strcmp0
(
id
,
LOCAL_VIDEO_ID
)
==
0
;
}
void
started_decoding_video_cb
(
DBusGProxy
*
proxy
UNUSED
,
gchar
*
id
,
gchar
*
shm_path
,
gint
width
,
gint
height
,
GError
*
error
UNUSED
,
gpointer
userdata
UNUSED
)
{
if
(
!
video_window_global
)
{
video_window_global
=
gtk_window_new
(
GTK_WINDOW_TOPLEVEL
);
video_window_fullscreen
=
FALSE
;
g_signal_connect
(
video_window_global
,
"button_press_event"
,
G_CALLBACK
(
video_window_button_cb
),
&
video_window_fullscreen
);
g_signal_connect
(
video_window_global
,
"delete-event"
,
G_CALLBACK
(
video_window_deleted_cb
),
NULL
);
if
(
video_is_local
(
id
))
update_preview_button_label
();
}
if
(
!
id
||
!*
id
||
!
shm_path
||
!*
shm_path
)
return
;
if
(
!
try_clutter_init
())
return
;
VideoHandle
*
handle
=
add_handle
(
id
);
if
(
!
handle
)
return
;
GtkWidget
*
video_area
=
gtk_clutter_embed_new
();
ClutterActor
*
stage
=
gtk_clutter_embed_get_stage
(
GTK_CLUTTER_EMBED
(
video_area
));
if
(
!
stage
)
if
(
!
stage
)
{
gtk_widget_destroy
(
video_area
);
else
{
}
else
{
ClutterColor
stage_color
=
{
0x61
,
0x64
,
0x8c
,
0xff
};
clutter_stage_set_color
(
CLUTTER_STAGE
(
stage
),
&
stage_color
);
}
...
...
@@ -123,13 +172,10 @@ void started_decoding_video_cb(DBusGProxy *proxy UNUSED,
GtkWidget
*
vbox
=
gtk_box_new
(
GTK_ORIENTATION_VERTICAL
,
6
);
gtk_container_add
(
GTK_CONTAINER
(
vbox
),
video_area
);
if
(
shm_path
==
0
||
strlen
(
shm_path
)
==
0
)
return
;
gtk_widget_set_size_request
(
video_area
,
width
,
height
);
if
(
video_window_global
)
{
gtk_container_add
(
GTK_CONTAINER
(
video_window_global
),
vbox
);
gtk_widget_show_all
(
video_window_global
);
if
(
handle
)
{
gtk_container_add
(
GTK_CONTAINER
(
handle
->
window
),
vbox
);
gtk_widget_show_all
(
handle
->
window
);
}
DEBUG
(
"Video started for id: %s shm-path:%s width:%d height:%d"
,
...
...
@@ -144,16 +190,12 @@ void started_decoding_video_cb(DBusGProxy *proxy UNUSED,
}
void
stopped_decoding_video_cb
(
DBusGProxy
*
proxy
UNUSED
,
gchar
*
id
,
gchar
*
shm_path
,
GError
*
error
UNUSED
,
gpointer
userdata
UNUSED
)
stopped_decoding_video_cb
(
DBusGProxy
*
proxy
UNUSED
,
gchar
*
id
,
gchar
*
shm_path
UNUSED
,
GError
*
error
UNUSED
,
gpointer
userdata
UNUSED
)
{
DEBUG
(
"Video stopped for id %s, shm path %s"
,
id
,
shm_path
);
if
(
video_window_global
)
{
if
(
GTK_IS_WIDGET
(
video_window_global
))
{
gtk_widget_destroy
(
video_window_global
);
if
(
video_is_local
(
id
))
update_preview_button_label
();
}
video_window_global
=
NULL
;
}
if
(
video_handles
)
g_hash_table_remove
(
video_handles
,
id
);
}
gnome/src/video/video_callbacks.h
View file @
b71dcd0b
...
...
@@ -33,6 +33,8 @@
#include
"dbus.h"
void
video_cleanup
();
void
started_decoding_video_cb
(
DBusGProxy
*
proxy
,
gchar
*
id
,
gchar
*
shm_path
,
gint
width
,
gint
height
,
GError
*
error
,
gpointer
userdata
);
...
...
kde/src/CMakeLists.txt
View file @
b71dcd0b
...
...
@@ -55,6 +55,8 @@ SET(
widgets/CategorizedTreeWidget.cpp
widgets/VideoDock.cpp
widgets/VideoWidget.cpp
widgets/IMManager.cpp
widgets/IMTab.cpp
# widgets/AcceleratedVideoWidget.cpp
Codec.cpp
CallView.cpp
...
...
kde/src/SFLPhone.cpp
View file @
b71dcd0b
...
...
@@ -45,6 +45,8 @@
#include
"lib/instance_interface_singleton.h"
#include
"lib/configurationmanager_interface_singleton.h"
#include
"lib/Contact.h"
#include
"lib/AccountList.h"
#include
"lib/InstantMessagingModel.h"
//SFLPhone
#include
"klib/AkonadiBackend.h"
...
...
@@ -131,7 +133,6 @@ bool SFLPhone::initialize()
// CallModel<CallTreeItem*,QTreeWidgetItem*>* histoModel = new CallModel<CallTreeItem*,QTreeWidgetItem*>(CallModel<CallTreeItem*,QTreeWidgetItem*>::History);
// histoModel->initHistory();
ConfigurationManagerInterface
&
configurationManager
=
ConfigurationManagerInterfaceSingleton
::
getInstance
();
// accept dnd
setAcceptDrops
(
true
);
...
...
@@ -215,7 +216,7 @@ bool SFLPhone::initialize()
move
(
QCursor
::
pos
().
x
()
-
geometry
().
width
()
/
2
,
QCursor
::
pos
().
y
()
-
geometry
().
height
()
/
2
);
show
();
if
(
configurationManager
.
getAccountList
().
valu
e
()
.
size
()
<=
1
)
{
if
(
AccountList
::
getInstanc
e
()
->
size
()
<=
1
)
{
(
new
AccountWizard
())
->
show
();
}
...
...
@@ -357,6 +358,8 @@ TreeWidgetCallModel* SFLPhone::model()
m_pModel
=
new
TreeWidgetCallModel
();
m_pModel
->
initCall
();
Call
::
setContactBackend
(
AkonadiBackend
::
getInstance
());
InstantMessagingModelManager
::
init
(
m_pModel
);
AccountList
::
getInstance
()
->
setDefaultAccount
(
AccountList
::
getInstance
()
->
getAccountById
(
ConfigurationSkeleton
::
defaultAccountId
()));
#ifdef ENABLE_VIDEO
VideoModel
::
getInstance
();
#endif
...
...
kde/src/SFLPhoneView.cpp
View file @
b71dcd0b
...
...
@@ -53,6 +53,8 @@
#include
"lib/Contact.h"
#include
"klib/HelperFunctions.h"
#define IM_ACTIVE m_pMessageTabBox->isVisible()
//ConfigurationDialog* SFLPhoneView::configDialog;
class
ColorVisitor
:
public
AccountListColorVisitor
{
...
...
@@ -412,7 +414,7 @@ void SFLPhoneView::updateWindowCallState()
buttonIconFiles
[
SFLPhone
::
Refuse
]
=
ICON_REFUSE
;
actionTexts
[
SFLPhone
::
Accept
]
=
ACTION_LABEL_ACCEPT
;
actionTexts
[
SFLPhone
::
Refuse
]
=
ACTION_LABEL_REFUSE
;
m_pMessageBoxW
->
setVisible
(
false
)
;
m_pMessageBoxW
->
setVisible
(
false
||
IM_ACTIVE
)
;
break
;
case
CALL_STATE_RINGING
:
enabledActions
[
SFLPhone
::
Hold
]
=
false
;
...
...
@@ -421,7 +423,7 @@ void SFLPhoneView::updateWindowCallState()
break
;
case
CALL_STATE_CURRENT
:
buttonIconFiles
[
SFLPhone
::
Record
]
=
ICON_REC_DEL_ON
;
m_pMessageBoxW
->
setVisible
(
true
&&
ConfigurationSkeleton
::
displayMessageBox
());
m_pMessageBoxW
->
setVisible
(
(
true
&&
ConfigurationSkeleton
::
displayMessageBox
())
||
IM_ACTIVE
)
;
break
;
case
CALL_STATE_DIALING
:
enabledActions
[
SFLPhone
::
Hold
]
=
false
;
...
...
@@ -434,7 +436,7 @@ void SFLPhoneView::updateWindowCallState()
case
CALL_STATE_HOLD
:
buttonIconFiles
[
SFLPhone
::
Hold
]
=
ICON_UNHOLD
;
actionTexts
[
SFLPhone
::
Hold
]
=
ACTION_LABEL_UNHOLD
;
m_pMessageBoxW
->
setVisible
(
true
&&
ConfigurationSkeleton
::
displayMessageBox
())
;
m_pMessageBoxW
->
setVisible
(
false
)
;
break
;
case
CALL_STATE_FAILURE
:
enabledActions
[
SFLPhone
::
Accept
]
=
false
;
...
...
@@ -454,7 +456,7 @@ void SFLPhoneView::updateWindowCallState()
buttonIconFiles
[
SFLPhone
::
Accept
]
=
ICON_EXEC_TRANSF
;
actionTexts
[
SFLPhone
::
Transfer
]
=
ACTION_LABEL_GIVE_UP_TRANSF
;
buttonIconFiles
[
SFLPhone
::
Record
]
=
ICON_REC_DEL_ON
;
m_pMessageBoxW
->
setVisible
(
false
)
;
m_pMessageBoxW
->
setVisible
(
false
||
IM_ACTIVE
)
;
transfer
=
true
;
break
;
case
CALL_STATE_TRANSF_HOLD
:
...
...
@@ -467,13 +469,15 @@ void SFLPhoneView::updateWindowCallState()
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
)
;
m_pMessageBoxW
->
setVisible
(
false
||
IM_ACTIVE
)
;
break
;
case
CALL_STATE_CONFERENCE_HOLD
:
enabledActions
[
SFLPhone
::
Transfer
]
=
false
;
...
...
@@ -886,6 +890,7 @@ void SFLPhoneView::sendMessage()
if
(
dynamic_cast
<
Call
*>
(
call
)
&&
!
m_pSendMessageLE
->
text
().
isEmpty
())
{
call
->
sendTextMessage
(
m_pSendMessageLE
->
text
());
}
m_pSendMessageLE
->
clear
();
}
#include
"SFLPhoneView.moc"
\ No newline at end of file
kde/src/conf/dlgaccounts.cpp
View file @
b71dcd0b
...
...
@@ -34,6 +34,7 @@
#include
<KStandardDirs>
//SFLPhone
#include
"klib/ConfigurationSkeleton.h"
#include
"conf/ConfigurationDialog.h"
#include
"lib/configurationmanager_interface_singleton.h"
#include
"SFLPhoneView.h"
...
...
@@ -211,6 +212,11 @@ void DlgAccounts::saveAccount(QModelIndex item)
/**/
account
->
setRingtonePath
(
m_pRingTonePath
->
url
().
path
()
);
// /
if
(
m_pDefaultAccount
->
isChecked
())
{
ConfigurationSkeleton
::
setDefaultAccountId
(
account
->
getAccountId
());
AccountList
::
getInstance
()
->
setDefaultAccount
(
account
);
}
if
(
m_pRingtoneListLW
->
selectedItems
().
size
()
==
1
&&
m_pRingtoneListLW
->
currentIndex
().
isValid
()
)
{
QListWidgetItem
*
selectedRingtone
=
m_pRingtoneListLW
->
currentItem
();
RingToneListItem
*
ringtoneWidget
=
qobject_cast
<
RingToneListItem
*>
(
m_pRingtoneListLW
->
itemWidget
(
selectedRingtone
));
...
...
@@ -325,6 +331,8 @@ void DlgAccounts::loadAccount(QModelIndex item)
/**/
combo_security_STRP
->
setCurrentIndex
(
account
->
getTlsMethod
());
/* */
m_pDefaultAccount
->
setChecked
(
account
==
AccountList
::
getInstance
()
->
getDefaultAccount
());
account
->
getVideoCodecModel
()
->
reload
();
disconnect
(
list_credential
->
selectionModel
(),
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
selectCredential
(
QModelIndex
,
QModelIndex
)));
...
...
kde/src/conf/dlgaccountsbase.ui
View file @
b71dcd0b
...
...
@@ -326,14 +326,14 @@
<item
row=
"5"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"edit6_mailbox"
/>
</item>
<item
row=
"
6
"
column=
"0"
>
<item
row=
"
8
"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label7_state"
>
<property
name=
"text"
>
<string>
Status
</string>
</property>
</widget>
</item>
<item
row=
"
6
"
column=
"1"
>
<item
row=
"
8
"
column=
"1"
>
<widget
class=
"QLabel"
name=
"edit7_state"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Preferred"
>
...
...
@@ -352,6 +352,13 @@
</property>
</widget>
</item>
<item
row=
"7"
column=
"1"
>
<widget
class=
"QCheckBox"
name=
"m_pDefaultAccount"
>
<property
name=
"text"
>
<string>
Default account
</string>
</property>
</widget>