[omemo] Remove YesNoDialog
This commit is contained in:
@@ -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:
|
|||||||
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":
|
||||||
|
|||||||
Reference in New Issue
Block a user