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
eta
gajim
Commits
8f50831d
Commit
8f50831d
authored
12 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
ability to hide / show status changes in history window. Fixes #7255
parent
ee6cc335
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
data/gui/history_window.ui
+15
-1
15 additions, 1 deletion
data/gui/history_window.ui
src/history_window.py
+15
-1
15 additions, 1 deletion
src/history_window.py
with
30 additions
and
2 deletions
data/gui/history_window.ui
+
15
−
1
View file @
8f50831d
...
...
@@ -211,7 +211,21 @@
</packing>
</child>
<child>
<placeholder/>
<object
class=
"GtkCheckButton"
id=
"show_status_checkbutton"
>
<property
name=
"label"
translatable=
"yes"
>
_Show status changes
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
False
</property>
<property
name=
"use_underline"
>
True
</property>
<property
name=
"active"
>
True
</property>
<property
name=
"draw_indicator"
>
True
</property>
<signal
name=
"toggled"
handler=
"on_show_status_checkbutton_toggled"
/>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
</object>
<packing>
...
...
This diff is collapsed.
Click to expand it.
src/history_window.py
+
15
−
1
View file @
8f50831d
...
...
@@ -76,6 +76,7 @@ class HistoryWindow:
self
.
checkbutton
=
xml
.
get_object
(
'
log_history_checkbutton
'
)
self
.
checkbutton
.
connect
(
'
toggled
'
,
self
.
on_log_history_checkbutton_toggled
)
self
.
show_status_checkbutton
=
xml
.
get_object
(
'
show_status_checkbutton
'
)
self
.
query_entry
=
xml
.
get_object
(
'
query_entry
'
)
self
.
query_combobox
=
xml
.
get_object
(
'
query_combobox
'
)
self
.
jid_entry
=
self
.
query_combobox
.
child
...
...
@@ -328,7 +329,7 @@ class HistoryWindow:
def
on_calendar_day_selected
(
self
,
widget
):
if
not
self
.
jid
:
return
year
,
month
,
day
=
widget
.
get_date
()
# integers
year
,
month
,
day
=
self
.
calendar
.
get_date
()
# integers
month
=
gtkgui_helpers
.
make_gtk_month_python_month
(
month
)
self
.
_add_lines_for_date
(
year
,
month
,
day
)
...
...
@@ -381,6 +382,7 @@ class HistoryWindow:
"""
self
.
history_buffer
.
set_text
(
''
)
# clear the buffer first
self
.
last_time_printout
=
0
show_status
=
self
.
show_status_checkbutton
.
get_active
()
lines
=
gajim
.
logger
.
get_conversation_for_date
(
self
.
jid
,
year
,
month
,
day
,
self
.
account
)
...
...
@@ -389,6 +391,9 @@ class HistoryWindow:
for
line
in
lines
:
# line[0] is contact_name, line[1] is time of message
# line[2] is kind, line[3] is show, line[4] is message
if
not
show_status
and
line
[
2
]
in
(
constants
.
KIND_GCSTATUS
,
constants
.
KIND_STATUS
):
continue
self
.
_add_new_line
(
line
[
0
],
line
[
1
],
line
[
2
],
line
[
3
],
line
[
4
],
line
[
5
])
...
...
@@ -520,6 +525,8 @@ class HistoryWindow:
year
,
month
,
day
=
self
.
calendar
.
get_date
()
# integers
month
=
gtkgui_helpers
.
make_gtk_month_python_month
(
month
)
show_status
=
self
.
show_status_checkbutton
.
get_active
()
# contact_name, time, kind, show, message, subject
results
=
gajim
.
logger
.
get_search_results_for_query
(
jid
,
text
,
account
,
year
,
month
,
day
)
...
...
@@ -527,6 +534,9 @@ class HistoryWindow:
# add "subject: | message: " in message column if kind is single
# also do we need show at all? (we do not search on subject)
for
row
in
results
:
if
not
show_status
and
row
[
2
]
in
(
constants
.
KIND_GCSTATUS
,
constants
.
KIND_STATUS
):
continue
contact_name
=
row
[
0
]
if
not
contact_name
:
kind
=
row
[
2
]
...
...
@@ -638,6 +648,10 @@ class HistoryWindow:
gajim
.
config
.
set_per
(
'
accounts
'
,
self
.
account
,
'
no_log_for
'
,
'
'
.
join
(
no_log_for
))
def
on_show_status_checkbutton_toggled
(
self
,
widget
):
# reload logs
self
.
on_calendar_day_selected
(
None
)
def
open_history
(
self
,
jid
,
account
):
"""
Load chat history of the specified jid
...
...
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