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
f0b42760
Commit
f0b42760
authored
17 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Patches
Plain Diff
Add a check to enable/disable accounts fron the config window
parent
3715f6e2
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
sflphone-gtk/src/accountwindow.c
+1
-1
1 addition, 1 deletion
sflphone-gtk/src/accountwindow.c
sflphone-gtk/src/configwindow.c
+42
-14
42 additions, 14 deletions
sflphone-gtk/src/configwindow.c
sflphone-gtk/src/configwindow.h
+1
-0
1 addition, 0 deletions
sflphone-gtk/src/configwindow.h
with
44 additions
and
15 deletions
sflphone-gtk/src/accountwindow.c
+
1
−
1
View file @
f0b42760
...
@@ -115,7 +115,7 @@ show_account_window (account_t * a)
...
@@ -115,7 +115,7 @@ show_account_window (account_t * a)
gchar
*
curFullName
=
""
;
gchar
*
curFullName
=
""
;
/* TODO: add curProxy, and add boxes for Proxy support */
/* TODO: add curProxy, and add boxes for Proxy support */
gchar
*
stun_enabled
=
"FALSE"
;
gchar
*
stun_enabled
=
"FALSE"
;
gchar
*
stun_server
=
""
;
gchar
*
stun_server
=
"
stun.fwdnet.net:3478
"
;
// Load from SIP/IAX/Unknown ?
// Load from SIP/IAX/Unknown ?
if
(
a
)
if
(
a
)
...
...
This diff is collapsed.
Click to expand it.
sflphone-gtk/src/configwindow.c
+
42
−
14
View file @
f0b42760
...
@@ -88,19 +88,12 @@ config_window_fill_account_list()
...
@@ -88,19 +88,12 @@ config_window_fill_account_list()
account_t
*
a
=
account_list_get_nth
(
i
);
account_t
*
a
=
account_list_get_nth
(
i
);
if
(
a
)
if
(
a
)
{
{
if
(
g_hash_table_lookup
(
a
->
properties
,
ACCOUNT_ENABLED
)
)
stock_id
=
GTK_STOCK_CONNECT
;
else
stock_id
=
GTK_STOCK_DISCONNECT
;
gtk_list_store_append
(
accountStore
,
&
iter
);
gtk_list_store_append
(
accountStore
,
&
iter
);
gtk_list_store_set
(
accountStore
,
&
iter
,
gtk_list_store_set
(
accountStore
,
&
iter
,
0
,
g_hash_table_lookup
(
a
->
properties
,
ACCOUNT_ALIAS
),
// Name
0
,
g_hash_table_lookup
(
a
->
properties
,
ACCOUNT_ALIAS
),
// Name
1
,
g_hash_table_lookup
(
a
->
properties
,
ACCOUNT_TYPE
),
// Protocol
1
,
g_hash_table_lookup
(
a
->
properties
,
ACCOUNT_TYPE
),
// Protocol
2
,
account_state_name
(
a
->
state
),
// Status
2
,
account_state_name
(
a
->
state
),
// Status
3
,
gtk_widget_render_icon
(
gtk_image_new_from_stock
(
stock_id
,
GTK_ICON_SIZE_BUTTON
),
3
,
g_hash_table_lookup
(
a
->
properties
,
ACCOUNT_ENABLED
),
// Enable/Disable
stock_id
,
GTK_ICON_SIZE_BUTTON
,
NULL
),
4
,
a
,
// Pointer
4
,
a
,
// Pointer
-
1
);
-
1
);
}
}
...
@@ -635,6 +628,42 @@ codec_active_toggled(GtkCellRendererToggle *renderer, gchar *path, gpointer data
...
@@ -635,6 +628,42 @@ codec_active_toggled(GtkCellRendererToggle *renderer, gchar *path, gpointer data
codec_list_update_to_daemon
();
codec_list_update_to_daemon
();
}
}
static
void
enable_account
(
GtkCellRendererToggle
*
rend
,
gchar
*
path
,
gpointer
data
)
{
GtkTreeIter
iter
;
GtkTreePath
*
treePath
;
GtkTreeModel
*
model
;
gboolean
enable
;
account_t
*
acc
;
// Get path of clicked codec active toggle box
treePath
=
gtk_tree_path_new_from_string
(
path
);
model
=
gtk_tree_view_get_model
(
GTK_TREE_VIEW
(
data
));
gtk_tree_model_get_iter
(
model
,
&
iter
,
treePath
);
// Get pointer on object
gtk_tree_model_get
(
model
,
&
iter
,
3
,
&
enable
,
4
,
&
acc
,
-
1
);
enable
=
!
enable
;
// Store value
gtk_list_store_set
(
GTK_LIST_STORE
(
model
),
&
iter
,
3
,
enable
,
-
1
);
gtk_tree_path_free
(
treePath
);
// Modify account state
g_print
(
"ENABLE = %s - %i
\n
"
,
g_hash_table_lookup
(
acc
->
properties
,
g_strdup
(
ACCOUNT_ENABLED
))
,
enable
);
g_hash_table_replace
(
acc
->
properties
,
g_strdup
(
ACCOUNT_ENABLED
)
,
g_strdup
(
g_hash_table_lookup
(
acc
->
properties
,
ACCOUNT_ENABLED
)
?
"FALSE"
:
"TRUE"
));
g_print
(
"ENABLE = %s - %i
\n
"
,
g_hash_table_lookup
(
acc
->
properties
,
g_strdup
(
ACCOUNT_ENABLED
))
,
enable
);
}
/**
/**
* Move codec in list depending on direction and selected codec and
* Move codec in list depending on direction and selected codec and
* update changes in the deamon list and the configuration files
* update changes in the deamon list and the configuration files
...
@@ -850,7 +879,7 @@ create_accounts_tab()
...
@@ -850,7 +879,7 @@ create_accounts_tab()
G_TYPE_STRING
,
// Name
G_TYPE_STRING
,
// Name
G_TYPE_STRING
,
// Protocol
G_TYPE_STRING
,
// Protocol
G_TYPE_STRING
,
// Status
G_TYPE_STRING
,
// Status
G
DK
_TYPE_
PIXBUF
,
// Enabled / Disabled
G_TYPE_
BOOLEAN
,
// Enabled / Disabled
G_TYPE_POINTER
// Pointer to the Object
G_TYPE_POINTER
// Pointer to the Object
);
);
...
@@ -861,9 +890,8 @@ create_accounts_tab()
...
@@ -861,9 +890,8 @@ create_accounts_tab()
accountStore
);
accountStore
);
gtk_tree_sortable_set_sort_column_id
(
GTK_TREE_SORTABLE
(
accountStore
),
gtk_tree_sortable_set_sort_column_id
(
GTK_TREE_SORTABLE
(
accountStore
),
3
,
GTK_SORT_ASCENDING
);
2
,
GTK_SORT_ASCENDING
);
//g_signal_connect(G_OBJECT(renderer), "toggled", G_CALLBACK(codec_active_toggled), (gpointer)treeView);
renderer
=
gtk_cell_renderer_text_new
();
renderer
=
gtk_cell_renderer_text_new
();
treeViewColumn
=
gtk_tree_view_column_new_with_attributes
(
"Alias"
,
treeViewColumn
=
gtk_tree_view_column_new_with_attributes
(
"Alias"
,
renderer
,
renderer
,
...
@@ -891,11 +919,11 @@ create_accounts_tab()
...
@@ -891,11 +919,11 @@ create_accounts_tab()
gtk_tree_view_append_column
(
GTK_TREE_VIEW
(
treeView
),
treeViewColumn
);
gtk_tree_view_append_column
(
GTK_TREE_VIEW
(
treeView
),
treeViewColumn
);
gtk_tree_view_column_set_cell_data_func
(
treeViewColumn
,
renderer
,
bold_if_default_account
,
NULL
,
NULL
);
gtk_tree_view_column_set_cell_data_func
(
treeViewColumn
,
renderer
,
bold_if_default_account
,
NULL
,
NULL
);
renderer
=
gtk_cell_renderer_
pixbuf
_new
();
renderer
=
gtk_cell_renderer_
toggle
_new
();
treeViewColumn
=
gtk_tree_view_column_new_with_attributes
(
""
,
renderer
,
"
pixbuf
"
,
3
,
NULL
);
treeViewColumn
=
gtk_tree_view_column_new_with_attributes
(
""
,
renderer
,
"
active
"
,
3
,
NULL
);
gtk_tree_view_append_column
(
GTK_TREE_VIEW
(
treeView
),
treeViewColumn
);
gtk_tree_view_append_column
(
GTK_TREE_VIEW
(
treeView
),
treeViewColumn
);
g_signal_connect
(
G_OBJECT
(
renderer
)
,
"toggled"
,
G_CALLBACK
(
enable_account
),
(
gpointer
)
treeView
);
// Toggle codec active property on clicked
g_object_unref
(
G_OBJECT
(
accountStore
));
g_object_unref
(
G_OBJECT
(
accountStore
));
gtk_container_add
(
GTK_CONTAINER
(
scrolledWindow
),
treeView
);
gtk_container_add
(
GTK_CONTAINER
(
scrolledWindow
),
treeView
);
...
...
This diff is collapsed.
Click to expand it.
sflphone-gtk/src/configwindow.h
+
1
−
0
View file @
f0b42760
...
@@ -39,6 +39,7 @@ void update_combo_box( gchar* plugin );
...
@@ -39,6 +39,7 @@ void update_combo_box( gchar* plugin );
void
default_account
(
GtkWidget
*
widget
,
gpointer
data
);
void
default_account
(
GtkWidget
*
widget
,
gpointer
data
);
void
bold_if_default_account
(
GtkTreeViewColumn
*
col
,
GtkCellRenderer
*
rend
,
GtkTreeModel
*
tree_model
,
GtkTreeIter
*
iter
,
gpointer
data
);
void
bold_if_default_account
(
GtkTreeViewColumn
*
col
,
GtkCellRenderer
*
rend
,
GtkTreeModel
*
tree_model
,
GtkTreeIter
*
iter
,
gpointer
data
);
void
default_codecs
(
GtkWidget
*
widget
,
gpointer
data
);
void
default_codecs
(
GtkWidget
*
widget
,
gpointer
data
);
void
enable_account
(
GtkWidget
*
widget
,
gpointer
data
);
GtkWidget
*
create_codec_table
();
GtkWidget
*
create_codec_table
();
GtkWidget
*
create_accounts_tab
();
GtkWidget
*
create_accounts_tab
();
GtkWidget
*
create_audio_tab
();
GtkWidget
*
create_audio_tab
();
...
...
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