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
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
Weblate
gajim
Commits
7a0fa12f
Commit
7a0fa12f
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
[SF] respect print time selection for history too. now ichat-style works there too!
parent
4c4ad5e8
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
src/gtkgui.glade
+1
-1
1 addition, 1 deletion
src/gtkgui.glade
src/history_window.py
+26
-4
26 additions, 4 deletions
src/history_window.py
with
27 additions
and
5 deletions
src/gtkgui.glade
+
1
−
1
View file @
7a0fa12f
...
...
@@ -4413,7 +4413,7 @@ Agent JID - node</property>
<child>
<widget class="GtkLabel" id="label228">
<property name="visible">True</property>
<property name="label" translatable="yes"><b>Format of a
Chat L
ine</b></property>
<property name="label" translatable="yes"><b>Format of a
l
ine</b></property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
...
...
This diff is collapsed.
Click to expand it.
src/history_window.py
+
26
−
4
View file @
7a0fa12f
...
...
@@ -126,6 +126,10 @@ class HistoryWindow:
color
=
gajim
.
config
.
get
(
'
statusmsgcolor
'
)
tag
.
set_property
(
'
foreground
'
,
color
)
tag
=
self
.
history_buffer
.
create_tag
(
'
time_sometimes
'
)
tag
.
set_property
(
'
foreground
'
,
'
#9e9e9e
'
)
tag
.
set_property
(
'
justification
'
,
gtk
.
JUSTIFY_CENTER
)
date
=
time
.
localtime
()
y
,
m
,
d
=
date
[
0
],
date
[
1
],
date
[
2
]
self
.
add_lines_for_date
(
y
,
m
,
d
)
...
...
@@ -193,6 +197,7 @@ class HistoryWindow:
def
add_lines_for_date
(
self
,
year
,
month
,
day
):
'''
adds all the lines for given date in textbuffer
'''
self
.
history_buffer
.
set_text
(
''
)
# clear the buffer first
self
.
last_time_printout
=
0
lines
=
gajim
.
logger
.
get_conversation_for_date
(
self
.
jid
,
year
,
month
,
day
)
# lines holds list with tupples that have:
# contact_name, time, kind, show, message
...
...
@@ -205,8 +210,23 @@ class HistoryWindow:
'''
add a new line in textbuffer
'''
buf
=
self
.
history_buffer
end_iter
=
buf
.
get_end_iter
()
tim
=
time
.
strftime
(
'
[%X]
'
,
time
.
localtime
(
float
(
tim
)))
buf
.
insert
(
end_iter
,
tim
)
# add time
if
gajim
.
config
.
get
(
'
print_time
'
)
==
'
always
'
:
before_str
=
gajim
.
config
.
get
(
'
before_time
'
)
after_str
=
gajim
.
config
.
get
(
'
after_time
'
)
format
=
before_str
+
'
%X
'
+
after_str
+
'
'
tim
=
time
.
strftime
(
format
,
time
.
localtime
(
float
(
tim
)))
buf
.
insert
(
end_iter
,
tim
)
# add time
elif
gajim
.
config
.
get
(
'
print_time
'
)
==
'
sometimes
'
:
every_foo_seconds
=
60
*
gajim
.
config
.
get
(
'
print_ichat_every_foo_minutes
'
)
seconds_passed
=
tim
-
self
.
last_time_printout
if
seconds_passed
>
every_foo_seconds
:
self
.
last_time_printout
=
tim
tim
=
time
.
strftime
(
'
%X
'
,
time
.
localtime
(
float
(
tim
)))
buf
.
insert_with_tags_by_name
(
end_iter
,
tim
+
'
\n
'
,
'
time_sometimes
'
)
tag_name
=
''
tag_msg
=
''
...
...
@@ -276,10 +296,12 @@ class HistoryWindow:
def
on_search_button_clicked
(
self
,
widget
):
text
=
self
.
query_entry
.
get_text
()
# contact_name, time, kind, show, message
results
=
gajim
.
logger
.
get_search_results_for_query
(
self
.
jid
,
text
)
model
=
self
.
results_treeview
.
get_model
()
model
.
clear
()
if
text
==
''
:
return
# contact_name, time, kind, show, message
results
=
gajim
.
logger
.
get_search_results_for_query
(
self
.
jid
,
text
)
for
row
in
results
:
iter
=
model
.
append
((
row
[
0
],
row
[
1
],
row
[
2
],
row
[
3
],
row
[
4
]))
...
...
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