Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Peter Shkenev
gajim
Commits
17f28f93
Commit
17f28f93
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
add catching for links and emots in history window
parent
59561d30
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
src/conversation_textview.py
+3
-2
3 additions, 2 deletions
src/conversation_textview.py
src/gtkgui.glade
+2
-18
2 additions, 18 deletions
src/gtkgui.glade
src/history_window.py
+7
-20
7 additions, 20 deletions
src/history_window.py
with
12 additions
and
40 deletions
src/conversation_textview.py
+
3
−
2
View file @
17f28f93
...
...
@@ -624,11 +624,12 @@ def print_subject(self, subject):
self
.
print_empty_line
()
def
print_real_text
(
self
,
text
,
text_tags
=
[],
name
=
None
):
'''
/me is replaces by name if name is given
'''
'''
this adds normal and special text. call this to add text
'''
buffer
=
self
.
get_buffer
()
#
detect urls formatting and if the user has it on emoticons
#
/me is replaced by name if name is given
if
name
and
text
.
startswith
(
'
/me
'
)
or
text
.
startswith
(
'
/me
\n
'
):
text
=
'
*
'
+
name
+
text
[
3
:]
# detect urls formatting and if the user has it on emoticons
index
=
self
.
detect_and_print_special_text
(
text
,
text_tags
)
# add the rest of text located in the index and after
...
...
This diff is collapsed.
Click to expand it.
src/gtkgui.glade
+
2
−
18
View file @
17f28f93
...
...
@@ -9025,7 +9025,7 @@ Custom</property>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow
16
">
<widget class="GtkScrolledWindow" id="scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
...
...
@@ -9034,23 +9034,7 @@ Custom</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTextView" id="history_textview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="overwrite">False</property>
<property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_WORD</property>
<property name="cursor_visible">False</property>
<property name="pixels_above_lines">0</property>
<property name="pixels_below_lines">0</property>
<property name="pixels_inside_wrap">0</property>
<property name="left_margin">0</property>
<property name="right_margin">0</property>
<property name="indent">0</property>
<property name="text" translatable="yes"></property>
</widget>
<placeholder/>
</child>
</widget>
<packing>
...
...
This diff is collapsed.
Click to expand it.
src/history_window.py
+
7
−
20
View file @
17f28f93
...
...
@@ -30,6 +30,7 @@
import
calendar
import
gtkgui_helpers
import
conversation_textview
from
common
import
gajim
from
common
import
helpers
...
...
@@ -65,7 +66,10 @@ def __init__(self, jid, account):
self
.
window
=
xml
.
get_widget
(
'
history_window
'
)
self
.
calendar
=
xml
.
get_widget
(
'
calendar
'
)
self
.
history_buffer
=
xml
.
get_widget
(
'
history_textview
'
).
get_buffer
()
scrolledwindow
=
xml
.
get_widget
(
'
scrolledwindow
'
)
self
.
history_textview
=
conversation_textview
.
ConversationTextview
(
account
)
scrolledwindow
.
add
(
self
.
history_textview
)
self
.
history_buffer
=
self
.
history_textview
.
get_buffer
()
self
.
query_entry
=
xml
.
get_widget
(
'
query_entry
'
)
self
.
search_button
=
xml
.
get_widget
(
'
search_button
'
)
query_builder_button
=
xml
.
get_widget
(
'
query_builder_button
'
)
...
...
@@ -114,23 +118,6 @@ def __init__(self, jid, account):
# selected month is current month as calendar defaults to selecting
# current date
self
.
calendar
.
emit
(
'
month-changed
'
)
tag
=
self
.
history_buffer
.
create_tag
(
'
incoming
'
)
color
=
gajim
.
config
.
get
(
'
inmsgcolor
'
)
tag
.
set_property
(
'
foreground
'
,
color
)
tag
=
self
.
history_buffer
.
create_tag
(
'
outgoing
'
)
color
=
gajim
.
config
.
get
(
'
outmsgcolor
'
)
tag
.
set_property
(
'
foreground
'
,
color
)
tag
=
self
.
history_buffer
.
create_tag
(
'
status
'
)
color
=
gajim
.
config
.
get
(
'
statusmsgcolor
'
)
tag
.
set_property
(
'
foreground
'
,
color
)
tag
=
self
.
history_buffer
.
create_tag
(
'
time_sometimes
'
)
tag
.
set_property
(
'
foreground
'
,
'
grey
'
)
tag
.
set_property
(
'
justification
'
,
gtk
.
JUSTIFY_CENTER
)
# select and show logs for last date we have logs with contact
# and if we don't have logs at all, default to today
...
...
@@ -297,9 +284,9 @@ def add_new_line(self, contact_name, tim, kind, show, message):
message
=
message
+
'
\n
'
if
tag_msg
:
buf
.
insert_with_tags_by_name
(
end_iter
,
message
,
tag_msg
)
self
.
history_textview
.
print_real_text
(
message
,
tag_msg
)
else
:
buf
.
insert
(
end_iter
,
message
)
self
.
history_textview
.
print_real_text
(
message
)
def
set_unset_expand_on_expander
(
self
,
widget
):
'''
expander has to have expand to TRUE so scrolledwindow resizes properly
...
...
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