From aabef9c85897e3634d68f6304cb521d581071bdb Mon Sep 17 00:00:00 2001 From: Swee Date: Sat, 7 Sep 2024 21:09:23 -0700 Subject: [PATCH] icon --- .../share/icons/hicolor/128x128/sweecrypt.png | Bin 0 -> 4157 bytes .../icons/hicolor/scalable/sweecrypt.svg | 76 ++++++++++++++ .../icons/hicolor/symbolic/sweecrypt.svg | 76 ++++++++++++++ sweecrypt-gtk.py | 43 ++++---- sweecrypt-gtk.ui | 18 +++- sweecrypt-gtk.ui~ | 95 ++++++++++++++++++ 6 files changed, 281 insertions(+), 27 deletions(-) create mode 100644 dpkg/usr/share/icons/hicolor/128x128/sweecrypt.png create mode 100644 dpkg/usr/share/icons/hicolor/scalable/sweecrypt.svg create mode 100644 dpkg/usr/share/icons/hicolor/symbolic/sweecrypt.svg create mode 100644 sweecrypt-gtk.ui~ 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 0000000000000000000000000000000000000000..cdd8683d0300ee423888fdd720be5b988111baed GIT binary patch literal 4157 zcmV-D5W???P)pjs83wrggbIvuBW zEvvOwM;Wx1qBvrGfwlq)!tl}&EhvRRLP$U$BtU?KJRldy^WOR6N1EK^=A3)aJ?B2S z=d;#XN$%PA><#C8_SyTlf4|?hI2;a4LYFXqH^9Wdm;wlK!aM$vPWB%hSZ?xHV@!<4 zf}`LprH{7#?IZxX`Hq`?-z*bf;lSebcetxUc3UFNBqA$tO`uD>vlROdiL z0yHMbxhR`lE7AtZCuIhZauj+Ule&~RH%z99CLZCP0H!RH8|4ngvti$2I5W!gZaSIUE*br26v$MuBSjuO{b`3qfF@oDpyz2A^R9Y1TN-S99!^fuToraJRE(12%b$sT zV8})oz8*62#c))7oBDOE%`owgGHclOB<%m8_BLH7Xcxe!_r;8>#Kjxn{kQa=pEvY? z{2$1XTnc^ngDpk*JH1Z8?f(jCMe_HIXW?9)h$@89J_sDPLHWGh3LpL6c;ie>HWbcR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MCj5huR_srqLpHwEA?>{iL6wE831^qlmbN?4o40Hrgg z0Q`+3Ofs*(xgM$qD3=}Zxo0MFH!uYdC|tY&*1V~_o?&t59-eLrAdsj}mjoF~=)6mb zDS$wuM8&k-^Ng<5nF0tj>iQ{fa-s7E6{Y|Jkw%4p6rHW1rT_wsuvX>Gxv%RiVJ6~A zrj+|Yuc)VMm;wki#=Nb3Ugu0%hqOzCzQ^Z0&th)QaQ%17FV=$dE&27Iaq#H<+_(NBDqXl%QFs$S=XKY zm0Ba=)8DEm#?XK%04+pZl_$3IQ`-`KE&pEtw)n&KB$IA@cYR(jZo`g5Z zYMovyc1^Lc`B^yf5Bgls1*QN3mGgP9;lH7#zoFHb0_cv~{@~c<`z>AS`bjp_g9{`Y z$zV(YbjS8z!q-2Byia6jkkk_6#9)trvI$T$S9VVIVcei8043`C$i4-89+XwMi~|z2 zoL(sV0`;iS79-f0AhU5_Fh@z!1k2K#24IB`lip0jN>_00000NkvXX Hu0mjf6Bq^7 literal 0 HcmV?d00001 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 + + + + + +