Commit b208cd5f authored by Daniel Brötzmann's avatar Daniel Brötzmann
Browse files

[omemo] Remove YesNoDialog

parent f8c6000a
...@@ -35,7 +35,9 @@ from gajim.common import app ...@@ -35,7 +35,9 @@ from gajim.common import app
from gajim.common import configpaths from gajim.common import configpaths
from gajim.common.const import URIType from gajim.common.const import URIType
from gajim.plugins.plugins_i18n import _ from gajim.plugins.plugins_i18n import _
from gajim.gtk.dialogs import ErrorDialog, YesNoDialog from gajim.gtk.dialogs import ErrorDialog
from gajim.gtk.dialogs import DialogButton
from gajim.gtk.dialogs import NewConfirmationDialog
from omemo.gtk.progress import ProgressWindow from omemo.gtk.progress import ProgressWindow
from omemo.backend.aes import aes_decrypt_file from omemo.backend.aes import aes_decrypt_file
...@@ -132,13 +134,20 @@ class FileDecryption: ...@@ -132,13 +134,20 @@ class FileDecryption:
file.filepath = os.path.join(DIRECTORY, newfilename) file.filepath = os.path.join(DIRECTORY, newfilename)
def finished(self, file): def finished(self, file):
question = _('Do you want to open %s') % file.filename NewConfirmationDialog(
YesNoDialog(_('Open File'), question, _('Open File'),
transient_for=self.window, _('Open File?'),
on_response_yes=(self.open_file, file.filepath)) _('Do you want to open %s?') % file.filename,
[DialogButton.make('Cancel',
text=_('_No')),
DialogButton.make('OK',
text=_('_Open'),
callback=self.open_file(file.filepath))],
transient_for=self.window).show()
return False return False
def open_file(self, checked, path): def open_file(self, path):
if platform.system() == "Windows": if platform.system() == "Windows":
os.startfile(path) os.startfile(path)
elif platform.system() == "Darwin": elif platform.system() == "Darwin":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment