Add SweeCrypt 1.1.0 feature
All checks were successful
Sanity check / Test Python file (push) Successful in 9s

This commit is contained in:
Nova Cat 2024-12-24 16:29:10 -08:00
parent 80e5b89a61
commit 4233c29d58
3 changed files with 38 additions and 3 deletions

View file

@ -1,5 +1,5 @@
Package: sweecrypt-gtk
Version: 1.1
Version: 1.2
Section: utils
Priority: optional
Architecture: all

View file

@ -14,12 +14,13 @@ class GUI:
checkbox.set_property("label", "Encode" if checkbox.get_property("active") else "Decode")
def start_clicked(self, start):
encode = self.builder.get_object('encode').get_property("active")
shift = int(self.builder.get_object('shift').get_property("value"))
inputted = self.builder.get_object('text').get_property("text")
if encode:
self.builder.get_object('text').set_property("text", sc.encrypt(inputted))
self.builder.get_object('text').set_property("text", sc.encrypt(inputted, shift))
self.builder.get_object('encode').set_property("active", False)
else:
self.builder.get_object('text').set_property("text", sc.decrypt(inputted))
self.builder.get_object('text').set_property("text", sc.decrypt(inputted, shift))
self.builder.get_object('encode').set_property("active", True)
def main():
app = GUI()

View file

@ -2,6 +2,12 @@
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkAdjustment" id="database-shift">
<property name="lower">-100</property>
<property name="upper">100</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkTextBuffer" id="text">
<property name="text" translatable="yes">replace this text with anything
you want to encode or decode.</property>
@ -51,6 +57,18 @@ you want to encode or decode.</property>
<property name="active">True</property>
<signal name="toggled" handler="toggle" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Database shift: </property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
@ -72,6 +90,22 @@ you want to encode or decode.</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="shift">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="caps-lock-warning">False</property>
<property name="primary-icon-tooltip-text" translatable="yes">Database shift</property>
<property name="adjustment">database-shift</property>
<property name="climb-rate">1</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>