diff --git a/dpkg/usr/share/icons/hicolor/128x128/sweecrypt.png b/dpkg/usr/share/icons/hicolor/128x128/sweecrypt.png new file mode 100644 index 0000000..cdd8683 Binary files /dev/null and b/dpkg/usr/share/icons/hicolor/128x128/sweecrypt.png differ diff --git a/dpkg/usr/share/icons/hicolor/scalable/sweecrypt.svg b/dpkg/usr/share/icons/hicolor/scalable/sweecrypt.svg new file mode 100644 index 0000000..1e46c19 --- /dev/null +++ b/dpkg/usr/share/icons/hicolor/scalable/sweecrypt.svg @@ -0,0 +1,76 @@ + + + + + + + + + S + $ + + + diff --git a/dpkg/usr/share/icons/hicolor/symbolic/sweecrypt.svg b/dpkg/usr/share/icons/hicolor/symbolic/sweecrypt.svg new file mode 100644 index 0000000..1e46c19 --- /dev/null +++ b/dpkg/usr/share/icons/hicolor/symbolic/sweecrypt.svg @@ -0,0 +1,76 @@ + + + + + + + + + S + $ + + + diff --git a/sweecrypt-gtk.py b/sweecrypt-gtk.py index 31c414c..08180cf 100644 --- a/sweecrypt-gtk.py +++ b/sweecrypt-gtk.py @@ -1,39 +1,36 @@ -#!/usr/bin/env python -# -*- Mode: Python; coding: utf-8; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- -# -# main.py -# Copyright (C) 2024 Swee -# - from gi.repository import Gtk, GdkPixbuf, Gdk import os, sys - - -#Comment the first line and uncomment the second before installing -#or making the tarball (alternatively, use project variables) +from sweecrypt import encrypt, decrypt UI_FILE = os.path.dirname(os.path.realpath(__file__)) + "/sweecrypt-gtk.ui" -#UI_FILE = "/usr/local/share/sweecrypt_gui/ui/sweecrypt_gui.ui" - - class GUI: def __init__(self): - self.builder = Gtk.Builder() self.builder.add_from_file(UI_FILE) self.builder.connect_signals(self) - window = self.builder.get_object('window') - - window.show_all() - def on_window_destroy(self, window): Gtk.main_quit() - + def encode_toggle(self, encode): + active = encode.get_property("active") + print(f"Encode = {active}") + self.builder.get_object('decode').set_property("active", not active) + def decode_toggle(self, decode): + active = decode.get_property("active") + print(f"Decode = {active}") + self.builder.get_object('encode').set_property("active", not active) + def start_clicked(self, start): + print("Start clicked!") + 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('encode').set_property("active", False) + else: + self.builder.get_object('text').set_property("text", decrypt(inputted)) + self.builder.get_object('decode').set_property("active", False) def main(): app = GUI() Gtk.main() - if __name__ == "__main__": - sys.exit(main()) - + sys.exit(main()) \ No newline at end of file diff --git a/sweecrypt-gtk.ui b/sweecrypt-gtk.ui index 13458c9..7008c30 100644 --- a/sweecrypt-gtk.ui +++ b/sweecrypt-gtk.ui @@ -17,18 +17,25 @@ False document-properties + + replace this text with anything +you want to encode or decode. + False + SweeCrypt GTK sweecrypt + True False vertical - + True True + text True @@ -38,13 +45,14 @@ - + Encode True True True image1 True + False @@ -53,12 +61,13 @@ - + Decode True True True image2 + False @@ -67,12 +76,13 @@ - + Start True True True start + False diff --git a/sweecrypt-gtk.ui~ b/sweecrypt-gtk.ui~ new file mode 100644 index 0000000..f662ee4 --- /dev/null +++ b/sweecrypt-gtk.ui~ @@ -0,0 +1,95 @@ + + + + + + True + False + edit-copy + + + True + False + document-revert + + + True + False + document-properties + + + replace this text with anything +you want to encode or decode. + + + False + sweecrypt + + + + True + False + vertical + + + True + True + text + True + + + True + True + 0 + + + + + Encode + True + True + True + image1 + True + + + + False + True + 1 + + + + + Decode + True + True + True + image2 + + + + False + True + 2 + + + + + Start + True + True + True + start + + + + False + True + 4 + + + + + +