slightly simplify
This commit is contained in:
parent
18f96c7062
commit
0061d5aa23
1 changed files with 3 additions and 5 deletions
|
@ -1,8 +1,6 @@
|
|||
import gi
|
||||
import gi, os, sys, sweecrypt as sc
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, GdkPixbuf, Gdk
|
||||
import os, sys
|
||||
from sweecrypt import encrypt, decrypt
|
||||
UI_FILE = os.path.dirname(os.path.realpath(__file__)) + "/sweecrypt-gtk.ui"
|
||||
class GUI:
|
||||
def __init__(self):
|
||||
|
@ -25,10 +23,10 @@ class GUI:
|
|||
encode = self.builder.get_object('encode').get_property("active")
|
||||
inputted = self.builder.get_object('text').get_property("text")
|
||||
if encode:
|
||||
self.builder.get_object('text').set_property("text", encrypt(inputted))
|
||||
self.builder.get_object('text').set_property("text", sc.encrypt(inputted))
|
||||
self.builder.get_object('encode').set_property("active", False)
|
||||
else:
|
||||
self.builder.get_object('text').set_property("text", decrypt(inputted))
|
||||
self.builder.get_object('text').set_property("text", sc.decrypt(inputted))
|
||||
self.builder.get_object('decode').set_property("active", False)
|
||||
def main():
|
||||
app = GUI()
|
||||
|
|
Loading…
Reference in a new issue