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
fc77f079
Commit
fc77f079
authored
8 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
[emoticons] Simplify displaying description/legend
parent
2065cab5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
emoticons_pack/emoticons_pack.py
+11
-25
11 additions, 25 deletions
emoticons_pack/emoticons_pack.py
with
11 additions
and
25 deletions
emoticons_pack/emoticons_pack.py
+
11
−
25
View file @
fc77f079
...
...
@@ -19,7 +19,6 @@ from common import gajim
from
plugins
import
GajimPlugin
from
plugins.helpers
import
log_calls
from
htmltextview
import
HtmlTextView
from
conversation_textview
import
ConversationTextview
from
dialogs
import
WarningDialog
,
HigDialog
...
...
@@ -119,19 +118,19 @@ class EmoticonsPackPlugin(GajimPlugin):
selection
.
connect
(
'
changed
'
,
self
.
emoticons_treeview_selection_changed
)
selection
.
set_mode
(
Gtk
.
SelectionMode
.
SINGLE
)
self
.
emoticons_description_textview
=
Conversation
Text
v
iew
(
None
)
self
.
emoticons_description_textview
=
Html
Text
V
iew
()
sw
=
self
.
xml
.
get_object
(
'
scrolledwindow1
'
)
sw
.
add
(
self
.
emoticons_description_textview
.
tv
)
sw
.
add
(
self
.
emoticons_description_textview
)
self
.
xml
.
connect_signals
(
self
)
self
.
window
.
show_all
()
def
on_legend_button_clicked
(
self
,
widget
):
self
.
xml
.
get_object
(
'
scrolledwindow1
'
).
get_children
()[
0
].
destroy
()
treeview_selection
=
self
.
available_treeview
.
get_selection
()
model
,
iter
=
treeview_selection
.
get_selected
()
name
=
model
.
get_value
(
iter
,
Column
.
NAME
)
self
.
emoticons_description_textview
.
get_buffer
().
set_text
(
''
)
label
=
self
.
xml
.
get_object
(
'
label2
'
)
if
label
.
get_text
()
==
_
(
'
Legend
'
):
label
.
set_text
(
_
(
'
Description
'
))
...
...
@@ -140,11 +139,6 @@ class EmoticonsPackPlugin(GajimPlugin):
import
emoticons
imp
.
reload
(
emoticons
)
self
.
emoticons_description_textview
=
Gtk
.
TextView
()
sw
=
self
.
xml
.
get_object
(
'
scrolledwindow1
'
)
sw
.
add
(
self
.
emoticons_description_textview
)
sw
.
show_all
()
buff
=
self
.
emoticons_description_textview
.
get_buffer
()
for
icon
in
emoticons
.
emoticons
:
icon_file
=
os
.
path
.
join
(
self
.
tmp_dir
,
name
,
icon
)
...
...
@@ -169,10 +163,6 @@ class EmoticonsPackPlugin(GajimPlugin):
sys
.
path
.
remove
(
os
.
path
.
join
(
self
.
tmp_dir
,
name
))
else
:
self
.
emoticons_description_textview
=
ConversationTextview
(
None
)
sw
=
self
.
xml
.
get_object
(
'
scrolledwindow1
'
)
sw
.
add
(
self
.
emoticons_description_textview
.
tv
)
sw
.
show_all
()
label
.
set_text
(
_
(
'
Legend
'
))
desc
=
_
(
model
.
get_value
(
iter
,
Column
.
DESCRIPTION
))
if
not
desc
.
startswith
(
'
<body
'
):
...
...
@@ -180,9 +170,9 @@ class EmoticonsPackPlugin(GajimPlugin):
desc
+
'
</body>
'
desc
=
desc
.
replace
(
'
preview.image
'
,
(
'
file:
'
+
os
.
path
.
join
(
self
.
tmp_dir
,
name
,
'
preview.png
'
))).
replace
(
'
\n
'
,
'
<br/>
'
)
self
.
emoticons_description_textview
.
tv
.
display_html
(
desc
,
self
.
emoticons_description_textview
)
self
.
emoticons_description_textview
.
tv
.
set_property
(
self
.
emoticons_description_textview
.
display_html
(
desc
,
self
.
emoticons_description_textview
,
None
)
self
.
emoticons_description_textview
.
set_property
(
'
sensitive
'
,
True
)
def
on_inslall_upgrade_clicked
(
self
,
widget
):
...
...
@@ -319,11 +309,7 @@ class EmoticonsPackPlugin(GajimPlugin):
label
.
set_ellipsize
(
Pango
.
EllipsizeMode
.
END
)
self
.
homepage_linkbutton
.
set_property
(
'
sensitive
'
,
True
)
self
.
xml
.
get_object
(
'
scrolledwindow1
'
).
get_children
()[
0
].
destroy
()
self
.
emoticons_description_textview
=
ConversationTextview
(
None
)
sw
=
self
.
xml
.
get_object
(
'
scrolledwindow1
'
)
sw
.
add
(
self
.
emoticons_description_textview
.
tv
)
sw
.
show_all
()
self
.
emoticons_description_textview
.
get_buffer
().
set_text
(
''
)
desc
=
_
(
model
.
get_value
(
iter
,
Column
.
DESCRIPTION
))
if
not
desc
.
startswith
(
'
<body
'
):
desc
=
'
<body xmlns=
\'
http://www.w3.org/1999/xhtml
\'
>
'
+
\
...
...
@@ -331,9 +317,9 @@ class EmoticonsPackPlugin(GajimPlugin):
else
:
desc
=
desc
.
replace
(
'
preview.image
'
,
(
'
file:
'
+
os
.
path
.
join
(
self
.
tmp_dir
,
set_name
,
'
preview.png
'
)))
self
.
emoticons_description_textview
.
tv
.
display_html
(
desc
,
self
.
emoticons_description_textview
.
tv
,
None
)
self
.
emoticons_description_textview
.
tv
.
set_property
(
self
.
emoticons_description_textview
.
display_html
(
desc
,
self
.
emoticons_description_textview
,
None
)
self
.
emoticons_description_textview
.
set_property
(
'
sensitive
'
,
True
)
else
:
self
.
set_name
.
set_text
(
''
)
...
...
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