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
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor 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
mesonium
gajim
Commits
af7ce201
Commit
af7ce201
authored
5 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
SubscriptionRequest: Refactor code
- Rename methods - Make methods private - Fix pylint errors
parent
c948830e
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
gajim/data/gui/subscription_request_window.ui
+4
-4
4 additions, 4 deletions
gajim/data/gui/subscription_request_window.ui
gajim/gtk/subscription_request.py
+13
-9
13 additions, 9 deletions
gajim/gtk/subscription_request.py
with
17 additions
and
13 deletions
gajim/data/gui/subscription_request_window.ui
+
4
−
4
View file @
af7ce201
...
...
@@ -91,7 +91,7 @@
<property
name=
"tooltip_text"
translatable=
"yes"
>
Contact Information
</property>
<property
name=
"valign"
>
center
</property>
<property
name=
"image"
>
image2
</property>
<signal
name=
"clicked"
handler=
"on_contact_info_
button_
clicked"
swapped=
"no"
/>
<signal
name=
"clicked"
handler=
"
_
on_contact_info_clicked"
swapped=
"no"
/>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
...
...
@@ -106,7 +106,7 @@
<property
name=
"tooltip_text"
translatable=
"yes"
>
Start Chat
</property>
<property
name=
"valign"
>
center
</property>
<property
name=
"image"
>
image1
</property>
<signal
name=
"clicked"
handler=
"on_start_chat_
button_
clicked"
swapped=
"no"
/>
<signal
name=
"clicked"
handler=
"
_
on_start_chat_clicked"
swapped=
"no"
/>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
...
...
@@ -152,7 +152,7 @@
<property
name=
"receives_default"
>
False
</property>
<property
name=
"tooltip_text"
translatable=
"yes"
>
Deny authorization from contact so the contact cannot know if you are connected
</property>
<property
name=
"use_underline"
>
True
</property>
<signal
name=
"clicked"
handler=
"on_deny_
button_
clicked"
swapped=
"no"
/>
<signal
name=
"clicked"
handler=
"
_
on_deny_clicked"
swapped=
"no"
/>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
...
...
@@ -170,7 +170,7 @@
<property
name=
"receives_default"
>
False
</property>
<property
name=
"tooltip_text"
translatable=
"yes"
>
Authorize contact so the contact can know if you are connected
</property>
<property
name=
"use_underline"
>
True
</property>
<signal
name=
"clicked"
handler=
"on_authorize_
button_
clicked"
swapped=
"no"
/>
<signal
name=
"clicked"
handler=
"
_
on_authorize_clicked"
swapped=
"no"
/>
<style>
<class
name=
"suggested-action"
/>
</style>
...
...
This diff is collapsed.
Click to expand it.
gajim/gtk/subscription_request.py
+
13
−
9
View file @
af7ce201
...
...
@@ -52,41 +52,45 @@ def __init__(self, account, jid, text, user_nick=None):
self
.
_ui
.
connect_signals
(
self
)
self
.
show_all
()
def
on_authorize_
button_
clicked
(
self
,
widget
):
def
_
on_authorize_clicked
(
self
,
_
widget
):
"""
Accept the request
"""
app
.
connections
[
self
.
account
].
get_module
(
'
Presence
'
).
subscribed
(
self
.
jid
)
con
=
app
.
connections
[
self
.
account
]
con
.
get_module
(
'
Presence
'
).
subscribed
(
self
.
jid
)
self
.
destroy
()
contact
=
app
.
contacts
.
get_contact
(
self
.
account
,
self
.
jid
)
if
not
contact
or
_
(
'
Not in contact list
'
)
in
contact
.
groups
:
AddNewContactWindow
(
self
.
account
,
self
.
jid
,
self
.
user_nick
)
def
on_contact_info_
button_
clicked
(
self
,
widget
):
def
_
on_contact_info_clicked
(
self
,
_
widget
):
"""
Ask for vCard
"""
if
self
.
jid
in
app
.
interface
.
instances
[
self
.
account
][
'
infos
'
]:
app
.
interface
.
instances
[
self
.
account
][
'
infos
'
][
self
.
jid
].
window
.
present
()
open_windows
=
app
.
interface
.
instances
[
self
.
account
][
'
infos
'
]
if
self
.
jid
in
open_windows
:
open_windows
[
self
.
jid
].
window
.
present
()
else
:
contact
=
app
.
contacts
.
create_contact
(
jid
=
self
.
jid
,
account
=
self
.
account
)
contact
=
app
.
contacts
.
create_contact
(
jid
=
self
.
jid
,
account
=
self
.
account
)
app
.
interface
.
instances
[
self
.
account
][
'
infos
'
][
self
.
jid
]
=
\
vcard
.
VcardWindow
(
contact
,
self
.
account
)
# Remove xmpp page
app
.
interface
.
instances
[
self
.
account
][
'
infos
'
][
self
.
jid
].
xml
.
\
get_object
(
'
information_notebook
'
).
remove_page
(
0
)
def
on_start_chat_
button_
clicked
(
self
,
widget
):
def
_
on_start_chat_clicked
(
self
,
_
widget
):
"""
Open chat
"""
app
.
interface
.
new_chat_from_jid
(
self
.
account
,
self
.
jid
)
def
on_deny_
button_
clicked
(
self
,
widget
):
def
_
on_deny_clicked
(
self
,
_
widget
):
"""
Refuse the request
"""
app
.
connections
[
self
.
account
].
get_module
(
'
Presence
'
).
unsubscribed
(
self
.
jid
)
con
=
app
.
connections
[
self
.
account
]
con
.
get_module
(
'
Presence
'
).
unsubscribed
(
self
.
jid
)
contact
=
app
.
contacts
.
get_contact
(
self
.
account
,
self
.
jid
)
if
contact
and
_
(
'
Not in contact list
'
)
in
contact
.
get_shown_groups
():
app
.
interface
.
roster
.
remove_contact
(
self
.
jid
,
self
.
account
)
...
...
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