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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
74616804
Commit
74616804
authored
15 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Patches
Plain Diff
[#2518] Work on the treeview that displays the account list
parent
23b894cb
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sflphone-client-gnome/src/config/accountlistconfigdialog.c
+57
-0
57 additions, 0 deletions
sflphone-client-gnome/src/config/accountlistconfigdialog.c
with
57 additions
and
0 deletions
sflphone-client-gnome/src/config/accountlistconfigdialog.c
+
57
−
0
View file @
74616804
...
...
@@ -312,6 +312,57 @@ close_dialog_cb (GtkWidget * widget,
}
void
highlight_ip_profile
(
GtkTreeViewColumn
*
col
,
GtkCellRenderer
*
rend
,
GtkTreeModel
*
tree_model
,
GtkTreeIter
*
iter
,
gpointer
data
)
{
GValue
val
;
account_t
*
current
;
memset
(
&
val
,
0
,
sizeof
(
val
));
gtk_tree_model_get_value
(
tree_model
,
iter
,
COLUMN_ACCOUNT_DATA
,
&
val
);
current
=
(
account_t
*
)
g_value_get_pointer
(
&
val
);
g_value_unset
(
&
val
);
if
(
current
!=
NULL
)
{
// Make the first line appear differently
(
g_strcasecmp
(
current
->
accountID
,
IP2IP
)
==
0
)
?
g_object_set
(
G_OBJECT
(
rend
),
"weight"
,
PANGO_WEIGHT_THIN
,
"style"
,
PANGO_STYLE_ITALIC
,
"stretch"
,
PANGO_STRETCH_ULTRA_EXPANDED
,
"scale"
,
0
.
95
,
NULL
)
:
g_object_set
(
G_OBJECT
(
rend
),
"weight"
,
PANGO_WEIGHT_MEDIUM
,
"style"
,
PANGO_STYLE_NORMAL
,
"stretch"
,
PANGO_STRETCH_NORMAL
,
"scale"
,
1
.
0
,
NULL
)
;
}
}
void
highlight_registration
(
GtkTreeViewColumn
*
col
,
GtkCellRenderer
*
rend
,
GtkTreeModel
*
tree_model
,
GtkTreeIter
*
iter
,
gpointer
data
)
{
GValue
val
;
account_t
*
current
;
GdkColor
green
=
{
0
,
255
,
0
,
0
};
memset
(
&
val
,
0
,
sizeof
(
val
));
gtk_tree_model_get_value
(
tree_model
,
iter
,
COLUMN_ACCOUNT_DATA
,
&
val
);
current
=
(
account_t
*
)
g_value_get_pointer
(
&
val
);
g_value_unset
(
&
val
);
if
(
current
!=
NULL
)
{
if
(
g_strcasecmp
(
current
->
accountID
,
IP2IP
)
!=
0
)
{
// Color the account state: green -> registered, otherwise red
(
current
->
state
==
ACCOUNT_STATE_REGISTERED
)
?
g_object_set
(
G_OBJECT
(
rend
),
"foreground"
,
"Dark Green"
,
NULL
)
:
g_object_set
(
G_OBJECT
(
rend
),
"foreground"
,
"Dark Red"
,
NULL
);
}
else
g_object_set
(
G_OBJECT
(
rend
),
"foreground"
,
"Black"
,
NULL
);
}
}
/**
* Account settings tab
*/
...
...
@@ -367,6 +418,7 @@ GtkWidget* create_account_list(GtkDialog * dialog) {
// A double click on the account line opens the window to edit the account
g_signal_connect
(
G_OBJECT
(
treeView
)
,
"row-activated"
,
G_CALLBACK
(
edit_account_cb
)
,
NULL
);
gtk_tree_view_column_set_cell_data_func
(
treeViewColumn
,
renderer
,
highlight_ip_profile
,
NULL
,
NULL
);
renderer
=
gtk_cell_renderer_text_new
();
treeViewColumn
=
gtk_tree_view_column_new_with_attributes
(
_
(
"Protocol"
),
...
...
@@ -374,6 +426,7 @@ GtkWidget* create_account_list(GtkDialog * dialog) {
"markup"
,
COLUMN_ACCOUNT_TYPE
,
NULL
);
gtk_tree_view_append_column
(
GTK_TREE_VIEW
(
treeView
),
treeViewColumn
);
gtk_tree_view_column_set_cell_data_func
(
treeViewColumn
,
renderer
,
highlight_ip_profile
,
NULL
,
NULL
);
renderer
=
gtk_cell_renderer_text_new
();
treeViewColumn
=
gtk_tree_view_column_new_with_attributes
(
_
(
"Status"
),
...
...
@@ -381,6 +434,10 @@ GtkWidget* create_account_list(GtkDialog * dialog) {
"markup"
,
COLUMN_ACCOUNT_STATUS
,
NULL
);
gtk_tree_view_append_column
(
GTK_TREE_VIEW
(
treeView
),
treeViewColumn
);
// Highlight IP profile
gtk_tree_view_column_set_cell_data_func
(
treeViewColumn
,
renderer
,
highlight_ip_profile
,
NULL
,
NULL
);
// Highlight account registration state
gtk_tree_view_column_set_cell_data_func
(
treeViewColumn
,
renderer
,
highlight_registration
,
NULL
,
NULL
);
g_object_unref
(
G_OBJECT
(
accountStore
));
...
...
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