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
d2903b71
Commit
d2903b71
authored
13 years ago
by
Dicson
Browse files
Options
Downloads
Patches
Plain Diff
juick. fixes #16
parent
0b240bf2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
juick/config_dialog.ui
+19
-2
19 additions, 2 deletions
juick/config_dialog.ui
juick/manifest.ini
+1
-1
1 addition, 1 deletion
juick/manifest.ini
juick/plugin.py
+27
-9
27 additions, 9 deletions
juick/plugin.py
with
47 additions
and
12 deletions
juick/config_dialog.ui
+
19
−
2
View file @
d2903b71
...
...
@@ -42,6 +42,23 @@
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkCheckButton"
id=
"only_first_avatar"
>
<property
name=
"label"
translatable=
"yes"
>
Show only the first avatar in the message
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
False
</property>
<property
name=
"relief"
>
none
</property>
<property
name=
"xalign"
>
0
</property>
<property
name=
"draw_indicator"
>
True
</property>
<signal
name=
"toggled"
handler=
"on_only_first_avatar_toggled"
/>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
<child>
<object
class=
"GtkHBox"
id=
"hbox1"
>
<property
name=
"visible"
>
True
</property>
...
...
@@ -78,7 +95,7 @@
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
1
</property>
<property
name=
"position"
>
2
</property>
</packing>
</child>
<child>
...
...
@@ -116,7 +133,7 @@
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
2
</property>
<property
name=
"position"
>
3
</property>
</packing>
</child>
</object>
...
...
This diff is collapsed.
Click to expand it.
juick/manifest.ini
+
1
−
1
View file @
d2903b71
[info]
name:
Juick
short_name:
Juick
version:
0.
6
version:
0.
7
description:
Clickable
juick
links
,
juick
nics,
preview
juick
picturs.
The
key
combination
alt
+
up
in
the
textbox
allow
insert
the
number
of
last
message
(comment
or
topic).
authors:
Denis
Fomin
<fominde@gmail.com>,
evgen
<drujebober@gmail.com>
...
...
This diff is collapsed.
Click to expand it.
juick/plugin.py
+
27
−
9
View file @
d2903b71
...
...
@@ -43,6 +43,7 @@ class JuickPlugin(GajimPlugin):
'
LINK_COLOR
'
:
(
'
#B8833E
'
,
'
Juick link color
'
),
'
SHOW_TAG_BUTTON
'
:
(
True
,
''
),
'
ONLY_AUTHOR_AVATAR
'
:
(
True
,
''
),
'
ONLY_FIRST_AVATAR
'
:
(
False
,
''
),
'
MENUITEM1
'
:
(
'
tune
'
,
''
),
'
MENUITEM_TEXT1
'
:
(
'
*tune
'
,
''
),
'
MENUITEM2
'
:
(
'
geo
'
,
''
),
'
MENUITEM_TEXT2
'
:
(
'
*geo
'
,
''
),
'
MENUITEM3
'
:
(
'
gajim
'
,
''
),
...
...
@@ -143,10 +144,7 @@ class Base(object):
self
.
juick_post_re
=
re
.
compile
(
r
'
#(\d+)
'
)
self
.
juick_post_comment_re
=
re
.
compile
(
r
'
#(\d+)/(\d+)
'
)
sharp_slash
=
r
'
#\d+(\/\d+)?
'
if
self
.
plugin
.
config
[
'
ONLY_AUTHOR_AVATAR
'
]:
juick_nick
=
r
'
@[a-zA-Z0-9_@\.-]+:
'
else
:
juick_nick
=
r
'
@[a-zA-Z0-9_@:\.-]+
'
juick_nick
=
r
'
@[a-zA-Z0-9_@:\.-]+
'
juick_pic
=
r
'
http://i\.juick\.com/.+/[0-9-]+\.[JPG|jpg]
'
interface
=
gajim
.
interface
interface
.
sharp_slash_re
=
re
.
compile
(
sharp_slash
)
...
...
@@ -323,14 +321,30 @@ class Base(object):
return
if
gajim
.
interface
.
juick_nick_re
.
match
(
special_text
):
# insert juick nick @nickname////
if
not
self
.
plugin
.
config
[
'
SHOW_AVATARS
'
]:
self
.
textview
.
plugin_modified
=
True
return
buffer_
,
iter_
,
tag
=
self
.
get_iter_and_tag
(
'
juick_nick
'
)
mark
=
buffer_
.
create_mark
(
None
,
iter_
,
True
)
nick
=
special_text
[
1
:].
rstrip
(
'
:
'
)
buffer_
.
insert_with_tags
(
iter_
,
special_text
,
tag
)
# insert avatars
if
not
self
.
plugin
.
config
[
'
SHOW_AVATARS
'
]:
self
.
textview
.
plugin_modified
=
True
return
b_nick
=
buffer_
.
get_text
(
buffer_
.
get_start_iter
(),
buffer_
.
get_iter_at_mark
(
mark
),
False
)
if
self
.
plugin
.
config
[
'
ONLY_AUTHOR_AVATAR
'
]
and
not
\
special_text
.
endswith
(
'
:
'
)
and
b_nick
[
-
9
:]
not
in
(
'
Subscribed to
'
):
self
.
textview
.
plugin_modified
=
True
return
if
self
.
plugin
.
config
[
'
ONLY_FIRST_AVATAR
'
]:
if
b_nick
[
-
9
:]
not
in
(
'
Reply by
'
,
'
message from
'
,
'
ended by
'
,
'
Subscribed to
'
):
if
b_nick
[
-
2
]
!=
gajim
.
config
.
get
(
'
after_nickname
'
):
self
.
textview
.
plugin_modified
=
True
return
elif
b_nick
[
-
1
]
==
'
\n
'
:
self
.
textview
.
plugin_modified
=
True
return
conn
=
gajim
.
connections
[
self
.
chat_control
.
account
]
if
not
conn
.
connected
:
self
.
textview
.
plugin_modified
=
True
...
...
@@ -608,6 +622,7 @@ class JuickPluginConfigDialog(GajimPluginConfigDialog):
self
.
xml
.
set_translation_domain
(
'
gajim_plugins
'
)
self
.
xml
.
add_objects_from_file
(
self
.
GTK_BUILDER_FILE_PATH
,
[
'
vbox1
'
])
self
.
checkbutton
=
self
.
xml
.
get_object
(
'
checkbutton
'
)
self
.
only_first_avatar
=
self
.
xml
.
get_object
(
'
only_first_avatar
'
)
self
.
avatar_size_spinbutton
=
self
.
xml
.
get_object
(
'
avatar_size
'
)
self
.
avatar_size_spinbutton
.
get_adjustment
().
set_all
(
20
,
10
,
32
,
1
,
10
,
0
)
...
...
@@ -625,6 +640,8 @@ class JuickPluginConfigDialog(GajimPluginConfigDialog):
def
on_run
(
self
):
self
.
checkbutton
.
set_active
(
self
.
plugin
.
config
[
'
SHOW_AVATARS
'
])
self
.
only_first_avatar
.
set_active
(
self
.
plugin
.
config
[
'
ONLY_FIRST_AVATAR
'
])
self
.
xml
.
get_object
(
'
only_author_avatar
'
).
set_active
(
self
.
plugin
.
config
[
'
ONLY_AUTHOR_AVATAR
'
])
self
.
avatar_size_spinbutton
.
set_value
(
self
.
plugin
.
config
[
'
AVATAR_SIZE
'
])
...
...
@@ -647,8 +664,9 @@ class JuickPluginConfigDialog(GajimPluginConfigDialog):
def
on_only_author_ava_toggled
(
self
,
checkbutton
):
self
.
plugin
.
config
[
'
ONLY_AUTHOR_AVATAR
'
]
=
checkbutton
.
get_active
()
for
control
in
self
.
plugin
.
controls
:
control
.
create_patterns
()
def
on_only_first_avatar_toggled
(
self
,
checkbutton
):
self
.
plugin
.
config
[
'
ONLY_FIRST_AVATAR
'
]
=
checkbutton
.
get_active
()
def
avatar_size_value_changed
(
self
,
spinbutton
):
self
.
plugin
.
config
[
'
AVATAR_SIZE
'
]
=
spinbutton
.
get_value
()
...
...
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