Prepare for installation and source code release
This commit is contained in:
@@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg
|
||||||
|
viewBox="0 0 1536 1536"
|
||||||
|
xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g
|
||||||
|
id="database"
|
||||||
|
transform="matrix(1.2722662,0,0,1.272228,-90.933152,-28.35833)">
|
||||||
|
<path
|
||||||
|
d="m 117,608.4 v 178.5 c 1.5,93.7 155.7,169.5 395,169.5 239.3,0 393.4,-75.8 395,-169.5 V 608.4 Z"
|
||||||
|
fill="#1b9bdb"
|
||||||
|
style="stroke-width:0.617813" />
|
||||||
|
<path
|
||||||
|
d="m 907,607.7 c 0,99.4 -154.8,180 -395,180 -240.2,0 -395,-80.6 -395,-180 0,-99.4 154.8,-180 395,-180 240.2,0 395,80.5 395,180 z"
|
||||||
|
fill="#ffffff"
|
||||||
|
style="stroke-width:0.617813" />
|
||||||
|
<path
|
||||||
|
d="m 117,428.4 v 158.5 c 1.5,93.7 155.7,179.5 395,179.5 239.3,0 393.4,-85.8 395,-179.5 V 428.4 Z"
|
||||||
|
fill="#1b9bdb"
|
||||||
|
style="stroke-width:0.617813" />
|
||||||
|
<path
|
||||||
|
d="m 907,427.7 c 0,99.4 -154.8,180 -395,180 -240.2,0 -395,-80.6 -395,-180 0,-99.4 154.8,-180 395,-180 240.2,0 395,80.5 395,180 z"
|
||||||
|
fill="#ffffff"
|
||||||
|
style="stroke-width:0.617813" />
|
||||||
|
<path
|
||||||
|
d="m 117,248.4 v 158.5 c 1.5,93.7 155.7,179.5 395,179.5 239.3,0 393.4,-85.8 395,-179.5 V 248.4 Z"
|
||||||
|
fill="#1b9bdb"
|
||||||
|
style="stroke-width:0.617813" />
|
||||||
|
<path
|
||||||
|
d="m 907,247.7 c 0,99.4 -154.8,180 -395,180 -240.2,0 -395,-80.6 -395,-180 0,-99.4 154.8,-180 395,-180 240.2,0 395,80.5 395,180 z"
|
||||||
|
fill="#3ed6ff"
|
||||||
|
style="stroke-width:0.617813" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="vessel"
|
||||||
|
transform="matrix(1.1909726,0,0,1.1909662,-198.75012,-148.39229)">
|
||||||
|
<path
|
||||||
|
d="M 1037.0086,942.8165 C 974.9073,737.83301 942.30445,523.89181 951.83243,309.49199 c 1.5097,-38.97292 5.19683,-77.86596 8.09496,-116.78033 1.33545,-17.93774 14.12957,-29.73918 29.76885,-28.01762 15.18766,1.67139 24.69326,15.34216 22.63436,33.07917 -33.49361,282.57064 3.9464,579.18885 117.5337,840.84319 14.0515,28.6031 34.323,54.1283 42.0974,85.5486 -0.8685,0.8127 -1.7384,1.6268 -2.6068,2.4395 22.4824,0.4363 45.4611,-0.9256 67.6396,2.0896 24.6445,3.8083 31.7539,27.8852 14.8155,46.1268 -42.8084,33.5071 -93.4092,57.5965 -144.1675,76.5923 -45.2046,15.5791 -92.8194,15.752 -140.07182,14.7971 -86.06691,-2.4785 -172.62034,-4.5918 -258.15753,-14.5378 -49.89263,-6.6633 -89.41252,-33.7999 -122.0572,-71.3733 -13.21372,-15.2083 -26.37865,-30.4626 -39.73874,-45.5441 -9.4764,-10.6974 -10.62506,-25.0345 -2.49944,-35.8518 7.82173,-10.413 21.13582,-11.584 34.42482,-7.7519 58.20923,12.4036 118.76875,12.9598 177.93008,19.0738 116.70842,6.7176 232.51074,16.4769 349.60533,15.8078 -107.60982,-101.9209 -250.59373,-174.55152 -386.30655,-76.5421 -36.41405,23.8245 -62.39401,63.1905 -94.97736,7.8272 -161.7569,-288.68926 58.74593,-585.96682 271.1984,-776.50727 10.62367,-9.71744 23.00936,-11.36791 32.93463,-4.62244 10.06468,6.84027 13.4744,18.81456 8.23018,32.2149 -107.65021,209.91817 -24.71143,451.69299 97.1213,635.25935 0.5771,-0.28437 1.1529,-0.56456 1.73,-0.84614 z M 629.22054,855.6216 c 2.64024,35.38899 6.80412,87.08895 19.83243,124.46576 3.86278,12.49983 15.35351,17.36761 25.40425,13.65265 10.09116,-3.73169 14.12679,-14.04296 10.64179,-26.96238 -50.10731,-188.23341 43.24326,-376.97144 157.7854,-522.04023 7.43699,-8.44334 11.91451,-23.02159 4.19454,-31.75907 -12.41217,-8.27327 -26.32149,3.53793 -34.90295,12.81905 C 698.60268,542.0512 635.33044,690.09335 629.22054,855.6216 Z"
|
||||||
|
fill="#000000"
|
||||||
|
style="fill:#044a6c;fill-opacity:1;stroke-width:0.689852" />
|
||||||
|
<path
|
||||||
|
d="m 976.33894,1356.0705 c -106.98667,25.935 -160.80619,60.3789 -268.18457,0.9479 -83.80725,-45.1288 -152.96774,47.5988 -271.91213,-6.3594 -59.29377,-30.832 -86.0014,-16.994 -139.15153,16.1855 -12.44423,7.2878 -23.33834,6.6061 -31.00534,-2.0644 -7.54153,-8.5284 -8.05034,-21.3029 1.8596,-31.0008 49.1605,-48.1007 101.79234,-72.3253 166.37634,-46.3094 81.32174,40.1062 120.05401,16.0991 200.59093,-0.9702 92.29392,-18.6557 148.72441,75.2624 246.39219,32.0253 70.72316,-27.9312 115.42315,-28.2797 187.00917,-3.485 45.8612,16.2051 88.8145,-7.7826 131.3747,-23.0369 66.9956,-28.7494 133.4782,6.9866 198.992,22.6201 42.7219,10.7058 34.2534,66.196 -10.6752,61.8231 -29.3883,-6.5698 -59.0972,-13.3655 -87.2644,-24.2748 -92.043,-34.5247 -143.9527,62.0098 -261.4404,19.63 -20.3914,-6.2952 -41.45474,-10.4283 -62.96136,-15.731 z"
|
||||||
|
fill="#000000"
|
||||||
|
style="fill:#044a6c;fill-opacity:1;stroke-width:0.689852" />
|
||||||
|
<path
|
||||||
|
d="m 629.22333,855.62439 c 6.09457,-165.49758 69.39608,-313.59968 182.95406,-429.82561 8.56334,-9.26022 22.53958,-21.18433 34.90574,-12.81626 7.66282,8.87408 3.26754,23.24881 -4.19872,31.75627 -114.52681,145.02977 -207.89968,333.85143 -157.78122,522.04302 3.48361,12.91663 -0.55202,23.2293 -10.64318,26.96099 -10.05074,3.71635 -21.54008,-1.15282 -25.40564,-13.65126 -13.02693,-37.33638 -17.20892,-89.08095 -19.83104,-124.46715 z"
|
||||||
|
fill="#ffffff"
|
||||||
|
style="stroke-width:0.689852" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
+11
@@ -0,0 +1,11 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Version=1.0
|
||||||
|
Name=YMS
|
||||||
|
Comment=Yacht Management Software
|
||||||
|
Exec=/usr/local/bin/yms
|
||||||
|
Icon=yms
|
||||||
|
StartupNotify=true
|
||||||
|
Terminal=false
|
||||||
|
Type=Application
|
||||||
|
Categories=Office;
|
||||||
|
Keywords=Database;Documentation
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# should be located in /usr/local/bin as yms
|
||||||
|
exec /usr/bin/python3 /usr/local/lib/yms/ymsgui.py "$@"
|
||||||
@@ -31,3 +31,41 @@ def init_named_controls(window, builder):
|
|||||||
continue
|
continue
|
||||||
var = getattr(window, ctrltype[nameparts[0]])
|
var = getattr(window, ctrltype[nameparts[0]])
|
||||||
var[nameparts[2]] = widget
|
var[nameparts[2]] = widget
|
||||||
|
|
||||||
|
def messagebox(messagetext, symbol=None, title=None, parent=None):
|
||||||
|
if not symbol:
|
||||||
|
symbol = Gtk.MessageType.INFO
|
||||||
|
if parent:
|
||||||
|
flags = Gtk.DialogFlags.DESTROY_WITH_PARENT
|
||||||
|
else:
|
||||||
|
flags = 0
|
||||||
|
md = Gtk.MessageDialog(parent=parent, flags=flags, message_type=symbol, buttons=Gtk.ButtonsType.CLOSE)
|
||||||
|
md.set_markup(messagetext)
|
||||||
|
if title:
|
||||||
|
md.set_title(title)
|
||||||
|
if not parent:
|
||||||
|
md.set_position(Gtk.WindowPosition.CENTER)
|
||||||
|
md.run()
|
||||||
|
md.destroy()
|
||||||
|
|
||||||
|
def questionbox(messagetext, symbol=None, title=None, parent=None):
|
||||||
|
"""
|
||||||
|
Ja/Nein-Nachfrage bei wirklich wichtigen Entscheidungen
|
||||||
|
Die Entscheidung wird als Rückgabewert geliefert: True falls
|
||||||
|
zugestimmt wurde, False bei Ablehnung
|
||||||
|
"""
|
||||||
|
if not symbol:
|
||||||
|
symbol = Gtk.MessageType.QUESTION
|
||||||
|
if parent:
|
||||||
|
flags = Gtk.DialogFlags.DESTROY_WITH_PARENT
|
||||||
|
else:
|
||||||
|
flags = 0
|
||||||
|
md = Gtk.MessageDialog(parent=parent, flags=flags, message_type=symbol, buttons=Gtk.ButtonsType.YES_NO)
|
||||||
|
md.set_markup(messagetext)
|
||||||
|
if title:
|
||||||
|
md.set_title(title)
|
||||||
|
if not parent:
|
||||||
|
md.set_position(Gtk.WindowPosition.CENTER)
|
||||||
|
response = md.run()
|
||||||
|
md.destroy()
|
||||||
|
return response == Gtk.ResponseType.YES
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class Frontend():
|
|||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
Gtk.main()
|
Gtk.main()
|
||||||
|
|
||||||
def user_display(self)
|
def user_display(self):
|
||||||
self.entry['user_login'].set_text(self._user.login)
|
self.entry['user_login'].set_text(self._user.login)
|
||||||
self.entry['user_displayname'].set_text(self._user.displayname)
|
self.entry['user_displayname'].set_text(self._user.displayname)
|
||||||
combobox.activate_row(self.combo['user_role'], self._user.role)
|
combobox.activate_row(self.combo['user_role'], self._user.role)
|
||||||
@@ -132,6 +132,12 @@ class Frontend():
|
|||||||
|
|
||||||
def on_but_user_del_clicked(self, widget):
|
def on_but_user_del_clicked(self, widget):
|
||||||
print("Delete user")
|
print("Delete user")
|
||||||
|
answer = gtkutils.questionbox(
|
||||||
|
_("Delete user!\n"
|
||||||
|
"Are you sure?"
|
||||||
|
), title="YMS")
|
||||||
|
if answer == False:
|
||||||
|
return
|
||||||
self._user.delete()
|
self._user.delete()
|
||||||
selection = self.tree['user'].get_selection()
|
selection = self.tree['user'].get_selection()
|
||||||
model, tree_iter = selection.get_selected()
|
model, tree_iter = selection.get_selected()
|
||||||
@@ -210,20 +216,6 @@ class Frontend():
|
|||||||
def on_destroy(self, widget, data=None):
|
def on_destroy(self, widget, data=None):
|
||||||
Gtk.main_quit()
|
Gtk.main_quit()
|
||||||
|
|
||||||
def messagebox(messagetext, symbol=None, title=None, parent=None):
|
|
||||||
if not symbol:
|
|
||||||
symbol = Gtk.MessageType.INFO
|
|
||||||
if parent:
|
|
||||||
symbol |= Gtk.DIALOG_DESTROY_WITH_PARENT
|
|
||||||
md = Gtk.MessageDialog(parent=parent, flags=0, message_type=symbol, buttons=Gtk.ButtonsType.CLOSE)
|
|
||||||
md.set_markup(messagetext)
|
|
||||||
if title:
|
|
||||||
md.set_title(title)
|
|
||||||
if not parent:
|
|
||||||
md.set_position(Gtk.WindowPosition.CENTER)
|
|
||||||
md.run()
|
|
||||||
md.destroy()
|
|
||||||
|
|
||||||
def create_config(cfgfile):
|
def create_config(cfgfile):
|
||||||
# create inital config file
|
# create inital config file
|
||||||
with open(cfgfile, 'w') as fh:
|
with open(cfgfile, 'w') as fh:
|
||||||
@@ -238,6 +230,21 @@ def create_config(cfgfile):
|
|||||||
os.chmod(cfgfile, 0o600)
|
os.chmod(cfgfile, 0o600)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
dialog = Gtk.MessageDialog(
|
||||||
|
message_type=Gtk.MessageType.QUESTION,
|
||||||
|
buttons=Gtk.ButtonsType.YES_NO,
|
||||||
|
text="Are you sure?"
|
||||||
|
)
|
||||||
|
image = Gtk.Image.new_from_stock(
|
||||||
|
Gtk.STOCK_DIALOG_QUESTION,
|
||||||
|
Gtk.IconSize.DIALOG
|
||||||
|
)
|
||||||
|
dialog.set_image(image)
|
||||||
|
dialog.show_all()
|
||||||
|
response = dialog.run()
|
||||||
|
dialog.destroy()
|
||||||
|
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
gettext.bindtextdomain('ymsgui', 'locale')
|
gettext.bindtextdomain('ymsgui', 'locale')
|
||||||
gettext.textdomain('ymsgui')
|
gettext.textdomain('ymsgui')
|
||||||
@@ -246,11 +253,12 @@ if __name__ == "__main__":
|
|||||||
cfgfile = os.path.expanduser(cfg['cfgfile'])
|
cfgfile = os.path.expanduser(cfg['cfgfile'])
|
||||||
if not config.read(cfgfile):
|
if not config.read(cfgfile):
|
||||||
create_config(cfgfile)
|
create_config(cfgfile)
|
||||||
messagebox(_("Configuration file '%s' not found.\n"
|
gtkutils.messagebox(
|
||||||
"Default configuration has been created.\n"
|
_("Configuration file '{}' not found.\n"
|
||||||
"Please edit that file according to your needs.\n\n"
|
"Default configuration has been created.\n"
|
||||||
"Then restart this program."
|
"Please edit that file according to your needs.\n\n"
|
||||||
) % cfgfile, title="YMS")
|
"Then restart this program."
|
||||||
|
).format(cfgfile), title="YMS")
|
||||||
else:
|
else:
|
||||||
cfg['host'] = config.get('DB', 'host')
|
cfg['host'] = config.get('DB', 'host')
|
||||||
cfg['db'] = config.get('DB', 'db')
|
cfg['db'] = config.get('DB', 'db')
|
||||||
|
|||||||
Reference in New Issue
Block a user