Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gajim-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Evert Mouw
gajim-plugins
Commits
73dc0848
Commit
73dc0848
authored
14 years ago
by
Dicson
Browse files
Options
Downloads
Patches
Plain Diff
clients_icons. ability to change icon position
parent
1c05fe1c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
clients_icons/clients_icons.py
+30
-9
30 additions, 9 deletions
clients_icons/clients_icons.py
clients_icons/config_dialog.ui
+31
-0
31 additions, 0 deletions
clients_icons/config_dialog.ui
with
61 additions
and
9 deletions
clients_icons/clients_icons.py
+
30
−
9
View file @
73dc0848
...
...
@@ -83,7 +83,7 @@ class ClientsIconsPlugin(GajimPlugin):
@log_calls
(
'
ClientsIconsPlugin
'
)
def
init
(
self
):
self
.
config_dialog
=
ClientsIconsPluginConfigDialog
(
self
)
self
.
pos_list
=
[
'
after statusicon
'
,
'
befor avatar
'
]
self
.
events_handlers
=
{
'
CAPS_RECEIVED
'
:
(
ged
.
POSTGUI
,
self
.
caps_received
),
'
presence-received
'
:
...
...
@@ -96,9 +96,10 @@ class ClientsIconsPlugin(GajimPlugin):
self
.
config_default_values
=
{
'
show_in_roster
'
:
(
True
,
''
),
'
show_in_groupchats
'
:
(
True
,
''
),
'
show_unknown_icon
'
:
(
True
,
''
),}
'
show_unknown_icon
'
:
(
True
,
''
),
'
pos_in_list
'
:
(
0
,
''
),}
self
.
groupchats_tree_is_transformed
=
False
self
.
config_dialog
=
ClientsIconsPluginConfigDialog
(
self
)
theme
=
gtk
.
icon_theme_get_default
()
self
.
default_pixbuf
=
theme
.
load_icon
(
'
gtk-dialog-question
'
,
16
,
gtk
.
ICON_LOOKUP_USE_BUILTIN
)
...
...
@@ -117,9 +118,11 @@ class ClientsIconsPlugin(GajimPlugin):
# remove old column
chat_control
.
list_treeview
.
remove_column
(
chat_control
.
list_treeview
.
get_column
(
0
))
# add new renderer in renderers list after location pixbuf renderer
# add new renderer in renderers list
position_list
=
[
'
name
'
,
'
avatar
'
]
position
=
position_list
[
self
.
config
[
'
pos_in_list
'
]]
for
renderer
in
chat_control
.
renderers_list
:
if
renderer
[
0
]
==
'
name
'
:
if
renderer
[
0
]
==
position
:
break
num
=
chat_control
.
renderers_list
.
index
(
renderer
)
chat_control
.
renderers_list
.
insert
(
num
,
client_icon_rend
)
...
...
@@ -148,9 +151,11 @@ class ClientsIconsPlugin(GajimPlugin):
roster
.
_fill_pep_pixbuf_renderer
,
self
.
renderer_num
)
# remove old column
roster
.
tree
.
remove_column
(
roster
.
tree
.
get_column
(
0
))
# add new renderer in renderers list after location pixbuf renderer
# add new renderer in renderers list
position_list
=
[
'
name
'
,
'
avatar
'
]
position
=
position_list
[
self
.
config
[
'
pos_in_list
'
]]
for
renderer
in
roster
.
renderers_list
:
if
renderer
[
0
]
==
'
name
'
:
if
renderer
[
0
]
==
position
:
break
num
=
roster
.
renderers_list
.
index
(
renderer
)
roster
.
renderers_list
.
insert
(
num
,
client_icon_rend
)
...
...
@@ -174,8 +179,12 @@ class ClientsIconsPlugin(GajimPlugin):
break
roster
.
fill_column
(
col
)
roster
.
tree
.
insert_column
(
col
,
0
)
roster
.
columns
.
remove
(
roster
.
columns
[
self
.
renderer_num
])
roster
.
columns
=
roster
.
columns
[:
self
.
renderer_num
]
+
roster
.
columns
[
self
.
renderer_num
+
1
:]
roster
.
setup_and_draw_roster
()
# TODO remove this
import
time
time
.
sleep
(
2
)
def
caps_received
(
self
,
account
,
data
):
if
not
self
.
config
[
'
show_in_roster
'
]:
...
...
@@ -265,11 +274,20 @@ class ClientsIconsPluginConfigDialog(GajimPluginConfigDialog):
self
.
xml
=
gtk
.
Builder
()
self
.
xml
.
add_objects_from_file
(
self
.
GTK_BUILDER_FILE_PATH
,
[
'
vbox1
'
])
#config_table = self.xml.get_object('config_table')
vbox
=
self
.
xml
.
get_object
(
'
vbox1
'
)
self
.
child
.
pack_start
(
vbox
)
self
.
xml
.
connect_signals
(
self
)
self
.
connect
(
'
hide
'
,
self
.
on_hide
)
self
.
combo
=
self
.
xml
.
get_object
(
'
combobox1
'
)
self
.
liststore
=
gtk
.
ListStore
(
str
)
self
.
combo
.
set_model
(
self
.
liststore
)
cellrenderer
=
gtk
.
CellRendererText
()
self
.
combo
.
pack_start
(
cellrenderer
,
True
)
self
.
combo
.
add_attribute
(
cellrenderer
,
'
text
'
,
0
)
for
item
in
self
.
plugin
.
pos_list
:
self
.
liststore
.
append
((
item
,))
self
.
combo
.
set_active
(
self
.
plugin
.
config
[
'
pos_in_list
'
])
def
on_hide
(
self
,
widget
):
pass
...
...
@@ -290,3 +308,6 @@ class ClientsIconsPluginConfigDialog(GajimPluginConfigDialog):
def
on_show_unknown_icon_toggled
(
self
,
widget
):
self
.
plugin
.
config
[
'
show_unknown_icon
'
]
=
widget
.
get_active
()
def
on_combobox1_changed
(
self
,
widget
):
self
.
plugin
.
config
[
'
pos_in_list
'
]
=
widget
.
get_active
()
This diff is collapsed.
Click to expand it.
clients_icons/config_dialog.ui
+
31
−
0
View file @
73dc0848
...
...
@@ -52,6 +52,37 @@
<property
name=
"position"
>
2
</property>
</packing>
</child>
<child>
<object
class=
"GtkHBox"
id=
"hbox1"
>
<property
name=
"visible"
>
True
</property>
<child>
<object
class=
"GtkLabel"
id=
"label1"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"xpad"
>
3
</property>
<property
name=
"label"
translatable=
"yes"
>
Show icon:
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkComboBox"
id=
"combobox1"
>
<property
name=
"visible"
>
True
</property>
<signal
name=
"changed"
handler=
"on_combobox1_changed"
/>
</object>
<packing>
<property
name=
"position"
>
1
</property>
</packing>
</child>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
3
</property>
</packing>
</child>
</object>
</child>
</object>
...
...
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