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
12623b96
Commit
12623b96
authored
14 years ago
by
Dicson
Browse files
Options
Downloads
Patches
Plain Diff
chatstate. use theme color
parent
006c277b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
chatstate/chatstate.py
+23
-41
23 additions, 41 deletions
chatstate/chatstate.py
chatstate/manifest.ini
+1
-1
1 addition, 1 deletion
chatstate/manifest.ini
with
24 additions
and
42 deletions
chatstate/chatstate.py
+
23
−
41
View file @
12623b96
...
...
@@ -5,7 +5,6 @@ import gtk
import
gobject
import
pango
from
plugins.gui
import
GajimPluginConfigDialog
from
plugins
import
GajimPlugin
from
plugins.helpers
import
log_calls
,
log
from
common
import
ged
...
...
@@ -18,15 +17,10 @@ class ChatstatePlugin(GajimPlugin):
@log_calls
(
'
ChatstatePlugin
'
)
def
init
(
self
):
self
.
config_dialog
=
ChatstatePluginConfigDialog
(
self
)
self
.
config_dialog
=
None
#
ChatstatePluginConfigDialog(self)
self
.
events_handlers
=
{
'
raw-message-received
'
:
(
ged
.
POSTCORE
,
self
.
raw_pres_received
),}
self
.
config_default_values
=
{
'
active
'
:
(
'
darkred
'
,
''
),
'
composing
'
:
(
'
darkgreen
'
,
''
),
'
inactive
'
:
(
'
#675B5B
'
,
''
),
'
paused
'
:
(
'
darkblue
'
,
''
),}
self
.
compose
=
(
'
active
'
,
'
composing
'
,
'
gone
'
,
'
inactive
'
,
'
paused
'
)
self
.
chatstates
=
(
'
active
'
,
'
composing
'
,
'
gone
'
,
'
inactive
'
,
'
paused
'
)
self
.
active
=
None
...
...
@@ -39,8 +33,8 @@ class ChatstatePlugin(GajimPlugin):
if
not
contact
:
return
for
c
ompos
e
in
self
.
c
ompose
:
state
=
event_object
.
xmpp_msg
.
getTag
(
c
ompos
e
)
for
c
hatstat
e
in
self
.
c
hatstates
:
state
=
event_object
.
xmpp_msg
.
getTag
(
c
hatstat
e
)
if
state
:
break
if
not
state
:
...
...
@@ -52,9 +46,25 @@ class ChatstatePlugin(GajimPlugin):
for
child_iter
in
child_iters
:
name
=
gobject
.
markup_escape_text
(
contact
.
get_shown_name
())
if
compose
!=
'
gone
'
:
name
=
'
<span foreground=
"
%s
"
>%s</span>
'
%
(
self
.
config
[
compose
],
name
)
theme
=
gajim
.
config
.
get
(
'
roster_theme
'
)
color
=
None
if
chatstate
==
'
composing
'
:
color
=
gajim
.
config
.
get_per
(
'
themes
'
,
theme
,
'
state_composing_color
'
)
elif
chatstate
==
'
inactive
'
:
color
=
gajim
.
config
.
get_per
(
'
themes
'
,
theme
,
'
state_inactive_color
'
)
elif
chatstate
==
'
gone
'
:
color
=
gajim
.
config
.
get_per
(
'
themes
'
,
theme
,
'
state_gone_color
'
)
elif
chatstate
==
'
paused
'
:
color
=
gajim
.
config
.
get_per
(
'
themes
'
,
theme
,
'
state_paused_color
'
)
elif
chatstate
==
'
active
'
:
color
=
gajim
.
config
.
get
(
'
inmsgcolor
'
)
name
=
'
<span foreground=
"
%s
"
>%s</span>
'
%
(
color
,
name
)
if
contact
.
status
and
gajim
.
config
.
get
(
'
show_status_msgs_in_roster
'
):
status
=
contact
.
status
.
strip
()
if
status
!=
''
:
...
...
@@ -78,31 +88,3 @@ class ChatstatePlugin(GajimPlugin):
def
deactivate
(
self
):
self
.
active
=
False
pass
class
ChatstatePluginConfigDialog
(
GajimPluginConfigDialog
):
def
init
(
self
):
self
.
GTK_BUILDER_FILE_PATH
=
self
.
plugin
.
local_file_path
(
'
config_dialog.ui
'
)
self
.
xml
=
gtk
.
Builder
()
self
.
xml
.
set_translation_domain
(
'
gajim
'
)
self
.
xml
.
add_objects_from_file
(
self
.
GTK_BUILDER_FILE_PATH
,
[
'
vbox1
'
])
vbox1
=
self
.
xml
.
get_object
(
'
vbox1
'
)
self
.
child
.
pack_start
(
vbox1
)
self
.
xml
.
connect_signals
(
self
)
self
.
connect
(
'
hide
'
,
self
.
on_hide
)
def
on_run
(
self
):
for
name
in
self
.
plugin
.
config_default_values
:
widget
=
self
.
xml
.
get_object
(
name
)
widget
.
set_color
(
gtk
.
gdk
.
color_parse
(
self
.
plugin
.
config
[
name
]))
def
changed
(
self
,
entry
):
name
=
gtk
.
Buildable
.
get_name
(
entry
)
self
.
plugin
.
config
[
name
]
=
entry
.
get_text
()
def
on_hide
(
self
,
widget
):
for
name
in
self
.
plugin
.
config_default_values
:
widget
=
self
.
xml
.
get_object
(
name
)
self
.
plugin
.
config
[
name
]
=
widget
.
get_color
().
to_string
()
This diff is collapsed.
Click to expand it.
chatstate/manifest.ini
+
1
−
1
View file @
12623b96
[info]
name:
Chatstate
in
roster
short_name:
chatstate
version:
0.
1
version:
0.
2
description:
Chat
State
Notifications
in
roster.
Font
color
of
the
contact
varies
depending
on
the
chat
state.
The
plugin
does
not
work
if
you
use
custom
font
color
for
contacts
in
roster.
...
...
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