Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
gajim
gajim-plugins
Commits
fa5679da
Commit
fa5679da
authored
Aug 19, 2019
by
Daniel Brötzmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[tictactoe] Remove NonModalConfirmationDialog
parent
994b3a51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
tictactoe/plugin.py
tictactoe/plugin.py
+19
-9
No files found.
tictactoe/plugin.py
View file @
fa5679da
...
...
@@ -46,10 +46,12 @@ from gajim.plugins.helpers import log_calls, log
from
gajim.plugins.gui
import
GajimPluginConfigDialog
from
gajim
import
chat_control
from
gajim.common
import
ged
from
gajim
import
dialogs
from
gajim.common.connection_handlers_events
import
InformationEvent
from
gajim.plugins.plugins_i18n
import
_
from
gajim.gtk.dialogs
import
DialogButton
from
gajim.gtk.dialogs
import
NewConfirmationDialog
NS_GAMES
=
'http://jabber.org/protocol/games'
NS_GAMES_TICTACTOE
=
NS_GAMES
+
'/tictactoe'
...
...
@@ -131,10 +133,10 @@ class TictactoePlugin(GajimPlugin):
@
log_calls
(
'TictactoePlugin'
)
def
show_request_dialog
(
self
,
obj
,
session
):
def
on_
ok
():
def
_
on_
accept
():
session
.
invited
(
obj
.
stanza
)
def
on_
cancel
():
def
_
on_
decline
():
session
.
decline_invitation
()
account
=
obj
.
conn
.
name
...
...
@@ -143,12 +145,20 @@ class TictactoePlugin(GajimPlugin):
name
=
contact
.
get_shown_name
()
else
:
name
=
obj
.
jid
pritext
=
_
(
'Incoming Tictactoe'
)
sectext
=
_
(
'%(name)s (%(jid)s) wants to play tictactoe with you. '
'Do you want to accept?'
)
%
{
'name'
:
name
,
'jid'
:
obj
.
jid
}
dialog
=
dialogs
.
NonModalConfirmationDialog
(
pritext
,
sectext
=
sectext
,
on_response_ok
=
on_ok
,
on_response_cancel
=
on_cancel
)
dialog
.
popup
()
NewConfirmationDialog
(
_
(
'Incoming Tictactoe'
),
_
(
'Incoming Tictactoe Invitation'
),
_
(
'%(name)s (%(jid)s) wants to play tictactoe with you.'
)
%
{
'name'
:
name
,
'jid'
:
obj
.
jid
},
[
DialogButton
.
make
(
'Cancel'
,
text
=
_
(
'_Decline'
),
callback
=
_on_decline
),
DialogButton
.
make
(
'OK'
,
text
=
_
(
'_Accept'
),
callback
=
_on_accept
)],
modal
=
False
,
transient_for
=
app
.
app
.
get_active_window
()).
show
()
@
log_calls
(
'TictactoePlugin'
)
def
_nec_decrypted_message_received
(
self
,
obj
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment