7 Commits
72 changed files with 6441 additions and 2003 deletions
+4 -2
View File
@@ -14,6 +14,8 @@ Yacht Management Software (YMS) Installation
1.2 Native GUI
- Python GTK3
- python3-gi
- python3-fitz
- python3-pyudev
- gir1.2-gtk-3.0
- gir1.2-rsvg-2.0
@@ -77,9 +79,9 @@ group (here as example 'yms'). The user which runs the local gui (here
usermod -aG yms guiuser
chgrp yms /var/local/lib/yms
chgrp yms /var/local/lib/yms/thumb
chmod -R 770 /var/local/yms
chmod -R 770 /var/local/lib/yms
4. Setup local GUI
5. Setup local GUI
Create a local database user with same name as your computer user and allow
database access with current unix credentials. E.g if your current unix user
+1
View File
@@ -42,6 +42,7 @@ clean:
find . -type d -name "__pycache__" -prune -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
rm -f locale/program.pot
rm -f locale/views.pot
rm -f locale/ui.pot
rm -f locale/combined.pot
rm -f locale/de/LC_MESSAGES/ymsgui.mo
+7 -4
View File
@@ -26,8 +26,8 @@ INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
(2, 6, 'Yachthafen', NULL); -- Marina
INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
(3, 2, 'Bilge', NULL),
(3, 3, 'Schwalbennest', NULL);
(3, 3, 'Bilge', NULL),
(3, 4, 'Schwalbennest', NULL);
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(4, 1, 'Rumpf'),
@@ -38,7 +38,10 @@ INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(4, 6, 'Elektrik'),
(4, 7, 'Elektronik'),
(4, 8, 'Navigation'),
(4, 9, 'Pantry');
(4, 9, 'Pantry'),
(4, 10, 'Solar'),
(4, 11, 'Sicherheit'),
(4, 12, 'Laufendes Gut');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(5, 1, 'Allgemein'),
@@ -68,7 +71,7 @@ INSERT INTO dropdown (ddid, ddval, ddtext, ddshort) VALUES
(7, 4, 'MEGA/AMG-Sicherung', 'MEGA'),
(7, 5, 'MRBF-Sicherung', 'MRBF'),
(7, 6, 'ANL-Sicherung', 'ANL'),
(7, 7, 'Class-T-Sicherung', 'Class T'),
(7, 7, 'Class-T-Sicherung', 'Cl-T'),
(7, 8, 'Feinsicherung 5×20 mm', 'Fein'),
(7, 9, 'Glassicherung inline', 'Glas'),
(7, 10, 'Automat / Leitungsschutzschalter', 'Auto'),
+167
View File
@@ -0,0 +1,167 @@
/* Generic data suitable for all kind of boats
* SPDX-License-Identifier: WTFPL
Add this data additionally after applying minmal.sql
*/
INSERT INTO user (userid, login, pass, displayname, role) VALUES
(2, 'helmsman', '$2y$10$LFl2jvrt2kB.c2KXBLaCI.RF2XAGNmFsoRc.V2tzLKrfCPiBCbI0e', 'Helmsman', 'helmsman'),
(3, 'sailor', '$2y$10$H5ZKd9r3KLAzI7W5u3ocgOCcXF4aDgjMAFYCzVC9Q9/Q9BqAV0MKS', 'Sailor', 'sailor');
INSERT INTO vessel (vid, vesselname, model, loa, lwl, beam, draught, displacement, ballast) VALUES
(1, 'Generic vessel', 'Generic model', 10.0, 9.5, 3.0, 1.8, 4000, 1200);
INSERT INTO storage (sid, vid, sname, stype, x, y, z, remarks) VALUES
(0, 1, 'An Bord', 0, 0, 0, 0, 'Alles wo der Ort nicht spezifiziert werden kann');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(1, 1, 'Monohull'),
(1, 2, 'Catamaran'),
(1, 3, 'Trimaran');
INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
(2, 4, 'Service', NULL),
(2, 5, 'Sailmaker', NULL),
(2, 6, 'Marina', NULL);
INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
(3, 3, 'Bilge', NULL),
(3, 4, 'Quarter Berth', NULL);
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(4, 1, 'Hull'),
(4, 2, 'Deck'),
(4, 3, 'Rigging'),
(4, 4, 'Sails'),
(4, 5, 'Eingine'),
(4, 6, 'Electrical'),
(4, 7, 'Electronics'),
(4, 8, 'Navigation'),
(4, 9, 'Galley'),
(4, 10, 'Solar'),
(4, 11, 'Safety'),
(4, 12, 'Running Rigging');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(5, 1, 'General'),
(5, 2, 'Drinks'),
(5, 3, 'Sweets'),
(5, 4, 'Tinned Food'),
(5, 5, 'Fresh Food'),
(5, 6, 'Dry Goods'),
(5, 7, 'Freeze-Dried Food'),
(5, 8, 'Savoury Snacks');
INSERT INTO dropdown (ddid, ddval, ddtext, ddshort) VALUES
(6, 1, 'kg', 'kg'),
(6, 2, 'Litre', 'L'),
(6, 3, 'Piece', 'pc'),
(6, 4, 'Pack', 'pk'),
(6, 5, 'Tin', 'tin'),
(6, 6, 'Bottle', 'btl'),
(6, 7, 'Bag', 'bag'),
(6, 8, 'Bar', 'bar'),
(6, 9, 'Jar', 'jar');
INSERT INTO dropdown (ddid, ddval, ddtext, ddshort) VALUES
(7, 1, 'ATO/ATC blade fuse', 'ATO'),
(7, 2, 'MAXI blade fuse', 'Max'),
(7, 3, 'MIDI/AMI fuse', 'MIDI'),
(7, 4, 'MEGA/AMG fuse', 'MEGA'),
(7, 5, 'MRBF fuse', 'MRBF'),
(7, 6, 'ANL fuse', 'ANL'),
(7, 7, 'Class-T fuse', 'Cl-T'),
(7, 8, '5×20 mm cartridge fuse', 'Cart'),
(7, 9, 'Glass inline fuse', 'Glas'),
(7, 10, 'Circuit breaker', 'Auto'),
(7, 11, 'Torpedo fuse', 'Torp'),
(7, 12, 'Strip fuse', 'Str');
INSERT INTO dropdown (ddid, ddval, ddtext, ddshort) VALUES
(8, 1, 'mm', 'Millimetre'),
(8, 2, 'cm', 'Centimetre'),
(8, 3, 'g', 'Gram'),
(8, 4, 'kg', 'Kilogram'),
(8, 5, 'm', 'Metre'),
(8, 6, 'kW', 'Kilowatt'),
(8, 7, 'A', 'Ampere'),
(8, 8, 'L', 'Litre');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(9, 1, 'Small Plastic Box'),
(9, 2, 'Large Plastic Box'),
(9, 3, 'Parts Organiser'),
(9, 4, 'Toolbox');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(11, 1, 'Single-core cable'),
(11, 2, 'Control cable'),
(11, 3, 'Data cable'),
(11, 4, 'Network cable'),
(11, 5, 'Coaxial cable'),
(11, 6, 'Aerial cable'),
(11, 7, 'Speaker cable'),
(11, 8, 'Microphone cable'),
(11, 9, 'Battery cable'),
(11, 10, 'Solar cable'),
(11, 11, 'Rubber cable'),
(11, 12, 'Ribbon cable'),
(11, 13, 'Telephone cable'),
(11, 14, 'NMEA cable'),
(11, 15, 'CAN bus cable'),
(11, 16, 'USB cable');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(12, 1, 'H05V-K'),
(12, 2, 'H07V-K'),
(12, 3, 'H05VV-F'),
(12, 4, 'H07RN-F'),
(12, 5, 'LiYY'),
(12, 6, 'LiYCY'),
(12, 7, 'LiYCY-TP'),
(12, 8, 'Cat 5e'),
(12, 9, 'Cat 6'),
(12, 10, 'RG-58'),
(12, 11, 'RG-213'),
(12, 12, 'RG-316'),
(12, 13, 'H-155'),
(12, 14, 'Aircell 5'),
(12, 15, 'Aircell 7'),
(12, 16, 'Ecoflex 10');
/* supplier */
INSERT INTO company (comptype, compname, street, zip, city, country, phone, email, web) VALUES
(1, 'Compass24', NULL, NULL, 'Ascheberg', 'Deutschland', NULL, NULL, 'compass24.de'),
(1, 'Gründl', NULL, NULL, NULL, 'Deutschland', NULL, NULL, 'gruendl.de'),
(1, 'KlabauterShop', NULL, NULL, NULL, 'Deutschland', NULL, 'info@klabautershop.de', 'klabautershop.de'),
(1, 'SVB', NULL, NULL, 'Bremen', 'Deutschland', NULL, NULL, 'svb.de'),
(1, 'Toplicht', 'Notkestraße 97', '22607', 'Hamburg', 'Deutschland', '040 8890100', 'toplicht@toplicht.de', 'toplicht.de');
/* manufacturer */
INSERT INTO company (comptype, compname, street, zip, city, country, contact, phone, email, web) VALUES
(2, 'Airmar', NULL, NULL, NULL, 'USA', 'Sales', NULL, 'sales@airmar.com', 'airmar.com'),
(2, 'B&G', 'Marienthaler Str. 17', '24340', 'Eckernförde', 'Deutschland', 'Sales', '+49 4351 883290', 'sales.de@navico.com', 'bandg.com'),
(2, 'Blue Sea Systems', 'N85 W12545 Westbrook Crossing', '53051', 'Menomonee Falls', 'USA', 'Customer Service', '+1 800 307 6702', NULL, 'bluesea.com'),
(2, 'Dometic', 'Hemvärnsgatan 15', '171 54', 'Solna', 'Schweden', 'Customer Service', '+49 511 474046-400', 'contact.eu@dometic.com', 'dometic.com'),
(2, 'Garmin', 'Parkring 35', '85748', 'Garching', 'Deutschland', 'Zentrale', '+49 89 541999-700', 'impressum@garmin.de', 'garmin.com'),
(2, 'Harken', NULL, NULL, 'Pewaukee', 'USA', 'Customer Service', NULL, NULL, 'harken.com'),
(2, 'Hella Marine', NULL, NULL, 'Auckland', 'Neuseeland', 'Marine', NULL, NULL, 'hellamarine.com'),
(2, 'Icom', NULL, NULL, NULL, 'Japan', 'Marine', NULL, NULL, 'icomjapan.com'),
(2, 'Isotherm', NULL, NULL, NULL, 'Italien', 'Marine', NULL, NULL, 'indelwebastomarine.com'),
(2, 'Jabsco', '301 Water Street SE, Suite 200', '20003', 'Washington', 'USA', 'Xylem', '+1 978 281 0440', NULL, 'xylem.com'),
(2, 'Johnson Pump', NULL, NULL, NULL, 'Schweden', 'Marine', NULL, NULL, 'johnson-pump.com'),
(2, 'Lewmar', 'Southmoor Lane', 'PO9 1JJ', 'Havant', 'Vereinigtes Königreich', 'Customer Service', '+44 23 9247 1841', 'info@lewmar.com', 'lewmar.com'),
(2, 'Lofrans', 'Via Leonardo Da Vinci 6', '20040', 'Cambiago (MI)', 'Italien', 'Customer Service', '+39 02 36640684', NULL, 'lofrans.it'),
(2, 'Mastervolt', 'Snijdersbergweg 93', '1105 AN', 'Amsterdam', 'Niederlande', 'Customer Service', '+31 20 3422100', 'info.emea@OneASG.com', 'mastervolt.com'),
(2, 'Plastimo', NULL, NULL, 'Lorient', 'Frankreich', 'Marine', NULL, NULL, 'plastimo.com'),
(2, 'Quick', 'Via Piangipane 120/A', '48124', 'Piangipane (RA)', 'Italien', 'Headquarters', '+39 0544 415061', 'quick@quickitaly.com', 'quickitaly.com'),
(2, 'Raymarine', 'Atlantic-Haus, Zirkusweg 1', '20359', 'Hamburg', 'Deutschland', 'Support', '+49 40 2378080', NULL, 'raymarine.com'),
(2, 'Ronstan', NULL, NULL, 'Melbourne', 'Australien', 'Marine', NULL, NULL, 'ronstan.com'),
(2, 'Selden', 'Redegatan 11', '421 21', 'Västra Frölunda', 'Schweden', 'Headquarters', '+46 31 696900', 'info@seldenmast.com', 'seldenmast.com'),
(2, 'Simrad', NULL, NULL, NULL, 'Norwegen', 'Marine', NULL, NULL, 'simrad-yachting.com'),
(2, 'Spinlock', 'Birmingham Road', 'PO31 7BH', 'Cowes', 'Vereinigtes Königreich', 'Customer Service', '+44 1983 295555', NULL, 'spinlock.co.uk'),
(2, 'Torqeedo', NULL, NULL, NULL, 'Deutschland', 'Marine', NULL, NULL, 'torqeedo.com'),
(2, 'Vetus', 'Havenstraat 11', '3115 HC', 'Schiedam', 'Niederlande', 'Headquarters', '+31 884 884700', 'info@vetus.com', 'vetus.com'),
(2, 'Victron Energy', 'De Paal 35', '1351 JG', 'Almere', 'Niederlande', 'Headquarters', NULL, NULL, 'victronenergy.com'),
(2, 'Whale', NULL, NULL, NULL, 'Vereinigtes Königreich', 'Marine', NULL, NULL, 'whalepumps.com');
+13
View File
@@ -326,6 +326,7 @@ CREATE TABLE measurement (
unit tinyint(3) NOT NULL DEFAULT 1,
accuracy enum('unknown','precise','normal','rough','estimated') NOT NULL DEFAULT 'unknown',
mdate date DEFAULT NULL,
mcat tinyint(3) DEFAULT NULL,
note varchar(80) DEFAULT NULL,
PRIMARY KEY (mid),
FOREIGN KEY fk_measurement_vessel (vid)
@@ -484,6 +485,18 @@ CREATE TABLE note (
ON DELETE RESTRICT
) ENGINE=InnoDB;
/* generic key value store for main objects */
CREATE TABLE property (
propid int(10) NOT NULL AUTO_INCREMENT,
objid int(10) UNSIGNED NOT NULL,
objtype enum('vessel','equip','inv','proj','maint'),
keyname varchar(32) NOT NULL,
valstr varchar(200) DEFAULT NULL,
valint int(10) DEFAULT NULL,
PRIMARY KEY (propid),
INDEX ix_prop_obj (objid, objtype)
);
CREATE TABLE checklist (
clid smallint(6) NOT NULL AUTO_INCREMENT,
title varchar(30) NOT NULL,
+20 -15
View File
@@ -30,6 +30,9 @@ INSERT INTO settings (userid, sno, valstr) VALUES
(-1, 4, 'currency symbol e.g. €, $, £, ¥'),
(-1, 5, 'signalk connection'),
(-1, 6, 'nmea2000 connection'),
(-1, 7, 'usb backup device serial'),
(-1, 8, 'usb backup partition uuid'),
(-1, 9, 'last backup'),
(-1, 10, 'rows in table'),
(-1, 20, 'maximum image width'),
(-1, 21, 'maximum image height'),
@@ -61,21 +64,23 @@ INSERT INTO settings (userid, sno, valstr) VALUES
(-1, 212, 'fuse filter json');
/* List of lists is always required */
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(0, 0, 'Liste der Listen'),
(0, 1, 'Rumpftypen'),
(0, 2, 'Firmentypen'),
(0, 3, 'Stauraumtypen'),
(0, 4, 'Ausrüstungskategorien'),
(0, 5, 'Proviantkategorien'),
(0, 6, 'Provianteinheiten'),
(0, 7, 'Sicherungstypen'),
(0, 8, 'Einheiten'),
(0, 9, 'Kistentypen'),
(0, 10, 'Sicherungsblöcke'), -- fuse locations
(0, 11, 'Kabeltypen'),
(0, 12, 'Technische Kabel-Bezeichnung'),
(0, 13, 'Inventarkategorien');
INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
(0, 0, 'Liste der Listen', NULL),
(0, 1, 'Rumpftypen', NULL),
(0, 2, 'Firmentypen', NULL),
(0, 3, 'Stauraumtypen', NULL),
(0, 4, 'Ausrüstungskategorien', NULL),
(0, 5, 'Proviantkategorien', NULL),
(0, 6, 'Provianteinheiten', NULL),
(0, 7, 'Sicherungstypen', NULL),
(0, 8, 'Einheiten', NULL),
(0, 9, 'Kistentypen', NULL),
(0, 10, 'Sicherungsblöcke', NULL), -- fuse locations
(0, 11, 'Kabeltypen', NULL),
(0, 12, 'Technische Kabel-Bezeichnung', NULL),
(0, 13, 'Inventarkategorien', NULL),
(0, 14, 'BBN vessel.data Felder', 'locked'),
(0, 15, 'Messungskategorien', NULL);
INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
(2, 1, 'Lieferant', 'fixed'),
+20 -15
View File
@@ -29,6 +29,9 @@ INSERT INTO settings (userid, sno, valstr) VALUES
(-1, 4, 'currency symbol e.g. €, $, £, ¥'),
(-1, 5, 'signalk connection'),
(-1, 6, 'nmea2000 connection'),
(-1, 7, 'usb backup device serial'),
(-1, 8, 'usb backup partition uuid'),
(-1, 9, 'last backup'),
(-1, 10, 'rows in table'),
(-1, 20, 'maximum image width'),
(-1, 21, 'maximum image height'),
@@ -60,21 +63,23 @@ INSERT INTO settings (userid, sno, valstr) VALUES
(-1, 212, 'fuse filter json');
/* List of lists is always required */
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(0, 0, 'list of lists'),
(0, 1, 'hull type'),
(0, 2, 'company type'),
(0, 3, 'storage type'),
(0, 4, 'equipment category'),
(0, 5, 'provision category'),
(0, 6, 'provision unit'),
(0, 7, 'fuse type'),
(0, 8, 'unit'),
(0, 9, 'box types'),
(0, 10, 'fuse blocks'),
(0, 11, 'cable types'),
(0, 12, 'cable desc. technical'),
(0, 13, 'inventory category');
INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
(0, 0, 'list of lists', NULL),
(0, 1, 'hull type', NULL),
(0, 2, 'company type', NULL),
(0, 3, 'storage type', NULL),
(0, 4, 'equipment category', NULL),
(0, 5, 'provision category', NULL),
(0, 6, 'provision unit', NULL),
(0, 7, 'fuse type', NULL),
(0, 8, 'unit', NULL),
(0, 9, 'box types', NULL),
(0, 10, 'fuse blocks', NULL),
(0, 11, 'cable types', NULL),
(0, 12, 'cable desc. technical', NULL),
(0, 13, 'inventory category', NULL),
(0, 14, 'BBN vessel.data fields', 'locked'),
(0, 15, 'measurement category', NULL);
INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
(2, 1, 'Supplier', 'fixed'),
+2
View File
@@ -17,7 +17,9 @@ Depends:
gir1.2-gtk-3.0,
gir1.2-rsvg-2.0,
python3-mysqldb,
python3-fitz,
python3-bcrypt,
python3-pyudev,
php (>= 8.0),
php-mysql,
php-xml,
+3
View File
@@ -4,6 +4,8 @@ db/*.sql usr/share/yms/db/
# Native GUI
ymsgui.py usr/lib/yms/
yms/*.py usr/lib/yms/yms/
yms/model/*.py usr/lib/yms/yms/model/
yms/view/*.py usr/lib/yms/yms/view/
# GTK UI
yms/ui/* usr/share/yms/ui/
@@ -22,6 +24,7 @@ webgui/config.inc-sample usr/share/yms/
# Shared static data
shapes/* usr/share/yms/shapes/
icons/* usr/share/yms/icons/
# Desktop entry
yms.desktop usr/share/applications/
+1
View File
@@ -0,0 +1 @@
/etc/yms/config.inc /usr/share/yms/webgui/config.inc
-1
View File
@@ -97,7 +97,6 @@ if [ "$RET" = "true" ]; then
> /etc/yms/config.inc
chmod 0640 /etc/yms/config.inc
chown root:www-data /etc/yms/config.inc
ln -s /etc/yms/config.inc /usr/share/yms/webgui/config.inc
fi
fi
+1096 -335
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -31,7 +31,7 @@ foreach ($sth->fetchAll() as $row) {
$opt_storage[$row['sid']] = $row['sname'];
}
$opt_boxtype = db_get_options(9);
$opt_boxtype = db_get_options(DD_BOX_TYPE);
// ========== ACTIONS START ===================================================
+2 -2
View File
@@ -14,8 +14,8 @@ $pagetitle = _('Cables');
$id = gpc_get_int($_REQUEST, 'id', 0);
$opt_cabletype = db_get_options(11);
$opt_techname = db_get_options(12);
$opt_cabletype = db_get_options(DD_CABLE_TYPE);
$opt_techname = db_get_options(DD_CABLE_TECHNAME);
$opt_cablecond = db_load_enum('cable', 'cablecond', true, true);
// ========== ACTIONS START ===================================================
+1 -1
View File
@@ -13,7 +13,7 @@ require 'lib/gpc.inc';
$pagetitle=_('Company');
$id = gpc_get_int($_REQUEST, 'id', 0);
$opt_comptype = db_get_options(2);
$opt_comptype = db_get_options(DD_COMPANY_TYPE);
// ========== ACTIONS START ===================================================
+1
View File
@@ -153,6 +153,7 @@ switch ($submit = form_get_action()) {
$id = db_exec_insert('document', $p);
$file_techname = sprintf('%s/%s-%06d.%s', $g_doc_basepath, $prefix, $id, $file_ext);
move_uploaded_file($file_tmp, $file_techname);
chmod($file_techname, 0640);
$action = ACT_VIEW;
break;
+8 -2
View File
@@ -84,6 +84,8 @@ switch ($submit = form_get_action()) {
break;
case 'update':
# changing ddval would need to update all dependent data
# so this is not intended here!
$p[':ddtext'] = gpc_get_string($_POST, 'ddtext');
$p[':ddshort'] = gpc_get_string($_POST, 'ddshort');
$p[':color'] = gpc_get_color($_POST, 'color');
@@ -132,7 +134,7 @@ $sth = $pdo->query($sql);
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $row) {
$num[$row[0]] = $row[1];
}
$sql = "SELECT ddval, ddtext FROM dropdown WHERE ddid=0 AND ddval>0";
$sql = "SELECT ddval, ddtext, flags FROM dropdown WHERE ddid=0 AND ddval>0";
$sth = $pdo->query($sql);
echo "<h1>$pagetitle</h1>\n";
@@ -160,7 +162,11 @@ foreach ($sth->fetchAll() as $row) {
echo '<td>', $num[$row['ddval']] ?? 0, '</td>';
// form_action_buttons($g_scriptname, $row['ddval']);
echo "<td>";
echo '<a class="text-nowrap" title="', _('Edit'), '" href="', $g_scriptname, '?f=edit&id=', $row['ddval'], '"><i class="bi bi-pencil ms-2"></i></a>';
if ($row['flags'] == 'locked') {
echo _('Locked');
} else {
echo '<a class="text-nowrap" title="', _('Edit'), '" href="', $g_scriptname, '?f=edit&id=', $row['ddval'], '"><i class="bi bi-pencil ms-2"></i></a>';
}
echo "</td>\n";
echo "</tr>\n";
}
+18 -2
View File
@@ -18,8 +18,8 @@ $id = gpc_get_int($_REQUEST, 'id', 0);
$opt_supplier = db_get_opt_supp($g_opt_unknown);
$opt_manufacturer = db_get_opt_manuf($g_opt_unknown);
$opt_ecat = db_get_options(4); // Equipment categories
$opt_unit = db_get_options(8);
$opt_ecat = db_get_options(DD_EQUIPMENT_CATEGORY);
$opt_unit = db_get_options(DD_UNIT);
// ========== ACTIONS START ===================================================
@@ -202,6 +202,7 @@ switch ($submit = form_get_action()) {
$docid = $pdo->lastInsertId();
$file_techname = file_get_docname($docid, 'picture', $file_ext);
move_uploaded_file($file_tmp, $g_doc_basepath . '/' . $file_techname);
chmod($g_doc_basepath . '/' . $file_techname, 0640);
} else {
// A document record definitely exists here, now just
// connect it to the selected equipment
@@ -477,6 +478,21 @@ if (!empty($equipment->x)) {
}
echo '<tr><th>', _('Remarks'),"</th><td>", h($equipment->remarks, br:true), "</td></tr>\n";
echo '<tr><th>', _('Flags'),"</th><td>", $equipment->flags, "</td></tr>\n";
// Custom properties
$sql = "SELECT keyname, valstr, valint FROM property WHERE objtype='equip' AND objid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
foreach ($sth->fetchAll() as $row) {
echo "<tr><th>{$row['keyname']}</th><td>";
if (isset($row['valstr'])) {
echo $row['valstr'];
} else {
echo $row['valint'];
}
echo "</td></tr>\n";
}
echo "</table>\n";
echo '</div>'; // Column break
+3 -3
View File
@@ -14,8 +14,8 @@ $pagetitle = _('Fuses');
$id = gpc_get_int($_REQUEST, 'id', 0);
$opt_ftype = db_get_options(7);
$opt_location = db_get_options(10);
$opt_ftype = db_get_options(DD_FUSE_TYPE);
$opt_location = db_get_options(DD_FUSE_BLOCK);
// ========== ACTIONS START ===================================================
@@ -94,7 +94,7 @@ if ($action == ACT_DEFAULT):
// ========== VARIANT: default behavior =======================================
// lookup tables
$opt_ftype_short = db_get_options(7, '', true);
$opt_ftype_short = db_get_options(DD_FUSE_TYPE, '', true);
// load filter from db
$flt = db_get_filter($user->id, 212);
+19
View File
@@ -15,6 +15,7 @@
* 0.2.0 2026-08-18 First public release tho
* 0.2.1 2026-08-28 Foreign keys, bugfixes and output sanitation tho
* 0.2.2 2026-09-21 Lots of improvements and fixes tho
* 2026-10-01 Dropdown constants for readability tho
*
*/
@@ -47,6 +48,22 @@ define('ROLE_CAPTAIN', 'captain');
define('ROLE_HELMSMAN', 'helmsman');
define('ROLE_SAILOR', 'sailor');
define('DD_HULL_TYPE', 1);
define('DD_COMPANY_TYPE', 2);
define('DD_STORAGE_TYPE', 3);
define('DD_EQUIPMENT_CATEGORY', 4);
define('DD_PROVISION_CATEGORY', 5);
define('DD_PROVISION_UNIT', 6);
define('DD_FUSE_TYPE', 7);
define('DD_UNIT', 8);
define('DD_BOX_TYPE', 9);
define('DD_FUSE_BLOCK', 10);
define('DD_CABLE_TYPE', 11);
define('DD_CABLE_TECHNAME', 12);
define('DD_INVENTORY_CATEGORY', 13);
define('DD_BBN_VESSELDATA', 14);
define('DD_MEASUREMENT_CATEGORY', 15);
// ========== PAGE START CODE =================================================
// global version string
@@ -56,6 +73,8 @@ $g_scriptname = basename($_SERVER['SCRIPT_NAME']);
require 'config.inc';
umask(0027); // no rights for world!
// Localization
$lang = get_browser_lang(['de', 'en']);
+1 -1
View File
@@ -351,7 +351,7 @@ if ($user->role == 'captain') {
// Storage: 0 - default, 1 - tank
// $stype = [ 0 => _('Default'), 1 => _('Tank')];
$stype = db_get_options(3);
$stype = db_get_options(DD_STORAGE_TYPE);
$sql = "SELECT stype, COUNT(stype) "
. "FROM storage "
. "WHERE vid=? "
+15 -1
View File
@@ -18,7 +18,7 @@ $opt_storage = db_get_opt_storage($user->vid);
$opt_box = db_get_opt_box($user->vid);
$opt_invcond = db_load_enum('inventory', 'invcond', true, true);
$opt_equipment = db_get_opt_equip($user->vid, [-1 => _('&horbar; none &horbar;')]);
$opt_icat = db_get_options(13);
$opt_icat = db_get_options(DD_INVENTORY_CATEGORY);
// ========== ACTIONS START ===================================================
@@ -406,6 +406,20 @@ echo "<tr><th>", _('Remarks'), "</th><td>", h($inventory->remarks, br:true), "</
$tags = db_load_taglist('inv', $id);
form_tag_assignment($g_scriptname, $id, $tags);
// Custom properties
$sql = "SELECT keyname, valstr, valint FROM property WHERE objtype='inv' AND objid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
foreach ($sth->fetchAll() as $row) {
echo "<tr><th>{$row['keyname']}</th><td>";
if (isset($row['valstr'])) {
echo $row['valstr'];
} else {
echo $row['valint'];
}
echo "</td>\n";
}
echo "</table>\n";
form_view_buttons($g_scriptname, $id);
+15
View File
@@ -290,6 +290,21 @@ echo '<tr><th>', _('Last'),"</th><td>", $maint->last_hours, "</td></tr>\n";
echo '<tr><th>', _('Plan date'),"</th><td>", format_date($maint->plan_date), "</td></tr>\n";
echo '<tr><th>', _('Completion&nbsp;date'),"</th><td>", format_date($maint->completion_date), "</td></tr>\n";
echo '<tr><th scope="row">', _('State'),"</th><td>", get_enum($maint->maintstate), "</td></tr>\n";
// Custom properties
$sql = "SELECT keyname, valstr, valint FROM property WHERE objtype='maint' AND objid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
foreach ($sth->fetchAll() as $row) {
echo "<tr><th>{$row['keyname']}</th><td>";
if (isset($row['valstr'])) {
echo $row['valstr'];
} else {
echo $row['valint'];
}
echo "</td></tr>\n";
}
echo "</table>\n";
echo '</div>'; // Column break
+10 -3
View File
@@ -25,7 +25,8 @@ $pagetitle = _('Measurements');
$id = gpc_get_int($_REQUEST, 'id', 0);
$opt_unit = db_get_options(8);
$opt_unit = db_get_options(DD_UNIT);
$opt_category = db_get_options(DD_MEASUREMENT_CATEGORY);
$opt_accuracy = db_load_enum('measurement', 'accuracy', true, true);
$opt_dimensions = array(
1 => _('1D'),
@@ -102,6 +103,10 @@ switch ($submit = form_get_action()) {
$p[':unit'] = gpc_get_int($_POST, 'unit');
$p[':accuracy'] = gpc_get_string($_POST, 'accuracy');
$p[':mdate'] = gpc_get_date($_POST, 'mdate');
$p[':mcat'] = gpc_get_int($_POST, 'mcat');
if ($p[':mcat'] == -1) {
$p[':mcat'] = NULL;
}
$p[':note'] = gpc_get_string($_POST, 'note');
$p[':eid'] = gpc_get_int($_POST, 'eid');
if ($p[':eid'] == -1) {
@@ -291,7 +296,7 @@ form_create_select('eid', _('Equipment'), $opt_equipment, $id);
elseif ($action == ACT_VIEW):
// ========== VARIANT: view single record =====================================
$sql = "SELECT mname, unit, nval, val1, val2, val3, accuracy, mdate, note, eid "
$sql = "SELECT mname, unit, nval, val1, val2, val3, accuracy, mdate, mcat, note, eid "
. "FROM measurement "
. "WHERE mid=?";
$sth = $pdo->prepare($sql);
@@ -310,6 +315,7 @@ echo '<tr><th>', _('Value 3'), '</th><td>', $measurement->val3, "</td></tr>\n";
echo '<tr><th>', _('Accuracy'), '</th><td>', get_enum($measurement->accuracy), "</td></tr>\n";
echo '<tr><th>', _('Date'), '</th><td>', format_date($measurement->mdate), "</td></tr>\n";
echo '<tr><th>', _('Note'), '</th><td>', h($measurement->note), "</td></tr>\n";
echo '<tr><th>', _('Category'),"</th><td>", $opt_category[$measurement->mcat] ?? 'n/a', "</td></tr>\n";
echo '<tr><th>', _('Equipment'), '</th><td>', $opt_equipment[$measurement->eid], "</td></tr>\n";
echo "</table>\n";
@@ -319,7 +325,7 @@ form_view_buttons($g_scriptname, $id);
elseif ($action == ACT_EDIT):
// ========== VARIANT: edit single record =====================================
$sql = "SELECT mname, nval, val1, val2, val3, unit, accuracy, note, eid "
$sql = "SELECT mname, nval, val1, val2, val3, unit, accuracy, note, eid, mcat "
. "FROM measurement "
. "WHERE mid=?";
$sth = $pdo->prepare($sql);
@@ -356,6 +362,7 @@ form_create_select('nval', _('Dimensions'), $opt_dimensions, $measurement->nval)
<?php
form_create_select('unit', _('Unit'), $opt_unit, $measurement->unit);
form_create_select('accuracy', _('Accuracy'), $opt_accuracy, $measurement->accuracy);
form_create_select('mcat', _('Category'), $g_opt_none + $opt_category, $measurement->mcat);
form_create_select('eid', _('Equipment'), $opt_equipment, $measurement->eid);
form_edit_buttons($g_scriptname, $id);
+15
View File
@@ -316,6 +316,21 @@ echo '<tr><th scope="row">', _('Costs plan'),"</th><td>", format_currency($proje
echo '<tr><th scope="row">', _('Costs final'),"</th><td>", format_currency($project->costs_final), "</td></tr>\n";
echo '<tr><th scope="row">', _('State'),"</th><td>", get_enum($project->projstate), "</td></tr>\n";
echo '<tr><th scope="row">', _('Remarks'),"</th><td>", h($project->remarks, br:true), "</td></tr>\n";
// Custom properties go here
$sql = "SELECT keyname, valstr, valint FROM property WHERE objtype='proj' AND objid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
foreach ($sth->fetchAll() as $row) {
echo "<tr><th>{$row['keyname']}</th><td>";
if (isset($row['valstr'])) {
echo $row['valstr'];
} else {
echo $row['valint'];
}
echo "</td></tr>\n";
}
echo "</table>\n";
form_view_buttons($g_scriptname, $id);
+2 -2
View File
@@ -15,8 +15,8 @@ $pagetitle=_('Provisions');
$id = gpc_get_int($_REQUEST, 'id', 0);
$opt_storage = db_get_opt_storage($user->vid);
$opt_category = db_get_options(5);
$opt_unit = db_get_options(6);
$opt_category = db_get_options(DD_PROVISION_CATEGORY);
$opt_unit = db_get_options(DD_PROVISION_UNIT);
// ========== ACTIONS START ===================================================
+10 -3
View File
@@ -14,7 +14,7 @@ $pagetitle = _('Storage');
$id = gpc_get_int($_REQUEST, 'id', 0);
$opt_stype = db_get_options(3);
$opt_stype = db_get_options(SS_STORAGE_TYPE);
$opt_capaunit = $g_opt_empty + db_load_enum('storage', 'capaunit', true, true);
// ========== ACTIONS START ===================================================
@@ -50,6 +50,7 @@ switch ($submit = form_get_action()) {
$p[':capacity'] = gpc_get_int($_POST, 'capacity');
if ($p[':capacity'] == 0) $p[':capacity'] = NULL;
$p[':capaunit'] = gpc_get_string($_POST, 'capaunit');
$p[':color'] = gpc_get_color($_POST, 'color');
$p[':remarks'] = gpc_get_string($_POST, 'remarks', 150);
db_exec_update('storage', $p, 'sid');
$action = ACT_VIEW;
@@ -107,7 +108,7 @@ page_caption_search($pagetitle);
// Storage
// stype from dropdown
$sql = "SELECT sid, sname, x, y, z, angle, remarks "
$sql = "SELECT sid, sname, color, x, y, z, angle, remarks "
. "FROM storage "
. "WHERE vid=? "
. "ORDER BY sid";
@@ -119,6 +120,7 @@ echo "<thead>\n";
echo "<tr>";
echo '<th>#</th>';
echo "<th>", _('Name'), "</th>";
echo "<th>", _('Color'), "</th>";
echo "<th>", _('Position'), "</th>";
echo "<th>", _('Remarks'), "</th>";
echo "<th>&nbsp;</th>";
@@ -132,6 +134,7 @@ foreach ($res as $row) {
echo '<a class="text-nowrap" title="', _('View'), '" href="', $g_scriptname, '?f=view&id=', $row['sid'], '"><i class="bi bi-eye ms-2"></i></a>', "\n";
echo "</td>\n";
echo "<td>", $row['sname'], "</td>\n";
echo '<td>', format_color(strtoupper($row['color'])), "</td>\n";
if ($row['angle'] != 0) {
$angle = " (" . $row['angle'] . "°)";
} else {
@@ -216,7 +219,7 @@ form_create_select('stype', _('Type'), $opt_stype);
elseif ($action == ACT_VIEW):
// ========== VARIANT: view single record =====================================
$opt_unit = db_get_options(6);
$opt_unit = db_get_options(DD_PROVISION_UNIT);
$sql = "SELECT sid, sname, stype, capacity, capaunit, x, y, z, wx, wy, wz, angle, color, remarks "
. "FROM storage "
. "WHERE sid=?";
@@ -358,6 +361,10 @@ form_create_select('stype', _('Type'), $opt_stype, $storage->stype);
<input type="number" class="form-control" id="capacity" name="capacity" value="<?=$storage->capacity ?>">
</div>
<?php form_create_select('capaunit', _('Capacity Unit'), $opt_capaunit, $storage->capaunit); ?>
<div class="mb-3">
<label for="color"><?=_('Color')?></label>
<input type="color" class="form-control" id="color" name="color" value="#<?=$storage->color ?>">
</div>
<div class="mb-3">
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=h($storage->remarks)?></textarea>
+3 -3
View File
@@ -1,4 +1,4 @@
.TH YMS 1 "August 2026" "YMS 0.2" "User Commands"
.TH YMS 1 "September 2026" "YMS 0.2" "User Commands"
.SH NAME
yms - Yacht Management Software
.SH SYNOPSIS
@@ -50,7 +50,7 @@ the application is running.
Per-user configuration file for the YMS graphical user interface.
.TP
.I /var/local/yms/
.I /var/local/lib/yms/
Persistent storage for files managed by YMS.
The directory contains photos, documents and other media associated
@@ -60,7 +60,7 @@ SVG and PDF.
YMS stores application data in two separate locations.
The directory
.I /var/local/yms/
.I /var/local/lib/yms/
contains user-managed photos and documents and should be included
in regular backups.
+16
View File
@@ -125,6 +125,22 @@ class Database:
self.conn.commit()
return self.cur.rowcount == 1
def load_setting(self, sno):
sql = "SELECT valstr, valint FROM settings WHERE userid=0 AND sno=%s"
self.cur.execute(sql, (sno,))
row = self.cur.fetchone()
if not row:
sql = "INSERT INTO settings (userid, sno) VALUES (0, %s)"
self.cur.execute(sql, (sno,))
self.conn.commit()
return (None, None)
return row
def save_setting(self, sno, valstr, valint):
sql = "UPDATE settings SET valstr=%s, valint=%s WHERE userid=0 AND sno=%s"
values = (valstr, valint, sno)
return self.execute_write(sql, values, 1)
def execute_write(self, sql, values=(), expected_rows=None):
"""
Execute an INSERT, UPDATE, or DELETE statement.
+75 -14
View File
@@ -21,6 +21,58 @@ class Dropdown:
FUSE_BLOCK = 10
CABLE_TYPE = 11
CABLE_TECHNAME = 12
INVENTORY_CATEGORY = 13
BBN_VESSELDATA = 14
MEASUREMENT_CATEGORY = 15
Dependencies = {
HULL_TYPE: (
# unused
),
COMPANY_TYPE: (
('company', 'comptype'),
('company', 'comptype2')
),
STORAGE_TYPE: (
('storage', 'stype'),
),
EQUIPMENT_CATEGORY: (
('equipment', 'ecat'),
),
PROVISION_CATEGORY: (
('provisions', 'provcat'),
),
PROVISION_UNIT: (
('provisions', 'unit'),
),
FUSE_TYPE: (
('fuse', 'ftype'),
),
UNIT: (
('measurement', 'unit'),
),
BOX_TYPE: (
('box', 'boxtype'),
),
FUSE_BLOCK: (
('fuse', 'location'),
),
CABLE_TYPE: (
('cable', 'cabletype'),
),
CABLE_TECHNAME: (
('cable', 'techname'),
),
INVENTORY_CATEGORY: (
('inventory', 'invcat'),
),
BBN_VESSELDATA: (
#unused
),
MEASUREMENT_CATEGORY: (
('measurement', 'mcat'),
)
}
class Lookup:
@@ -38,27 +90,28 @@ class Lookup:
TODO translation via gettext needed
"""
db_enums = {
'user.role': ('user', 'role'),
'dropdown.flags': ('dropdown', 'flags'),
'vessel.vtype': ('vessel', 'vtype'),
'storage.capaunit': ('storage', 'capaunit'),
'tagref.objtype': ('tagref', 'objtype'),
'inventory.conttype': ('inventory', 'conttype'),
'inventory.invcond': ('inventory', 'invcond'),
'cable.cablecond': ('cable', 'cablecond'),
'measurement.accuracy': ('measurement', 'accuracy'),
'checkitem.checkresult': ('checkitem', 'checkresult'),
'checklist.clstate': ('checklist', 'clstate'),
'company.flags': ('company', 'flags'),
'docref.reftype': ('docref', 'reftype'),
'document.doctype': ('document', 'doctype'),
'document.roleaccess': ('document', 'roleaccess'),
'docref.reftype': ('docref', 'reftype'),
'dropdown.flags': ('dropdown', 'flags'),
'inventory.conttype': ('inventory', 'conttype'),
'inventory.invcond': ('inventory', 'invcond'),
'maintenance.maintstate': ('maintenance', 'maintstate'),
'measurement.accuracy': ('measurement', 'accuracy'),
'note.notetype': ('note', 'notetype'),
'project.projstate': ('project', 'projstate'),
'signalk.datatype': ('signalk', 'datatype'),
'signalk.objtype': ('signalk', 'objtype'),
'storage.capaunit': ('storage', 'capaunit'),
'tagref.objtype': ('tagref', 'objtype'),
'task.priority': ('task', 'priority'),
'task.taskstate': ('task', 'taskstate'),
'note.notetype': ('note', 'notetype'),
'checklist.clstate': ('checklist', 'clstate'),
'checkitem.checkresult': ('checkitem', 'checkresult'),
'signalk.objtype': ('signalk', 'objtype'),
'signalk.datatype': ('signalk', 'datatype')
'user.role': ('user', 'role'),
'vessel.vtype': ('vessel', 'vtype')
}
for key, (table, column) in db_enums.items():
self._enums[key] = self.db.load_enum(table, column)
@@ -83,6 +136,14 @@ class Lookup:
def dropdown(self, ddid):
return self._dropdowns[ddid]
def user(self):
userlist = {}
sql = "SELECT userid, displayname FROM user ORDER BY displayname"
self.db.cur.execute(sql)
for row in self.db.cur.fetchall():
userlist[row[0]] = row[1]
return userlist
def refresh(self):
# TODO ugly hack please improve
self._load_dropdowns()
+1 -1
View File
@@ -6,7 +6,7 @@ class Cable(DbRecord):
table = "cable"
pk_field = "cableid"
fields = ('cableid', 'vid', 'cablename', 'cabletype', 'techname', 'length',
fields = ('vid', 'cablename', 'cabletype', 'techname', 'length',
'conductors', 'diameter', 'xsection', 'weight', 'color', 'supplier',
'manufacturer', 'cablecond', 'remarks')
+2 -2
View File
@@ -23,7 +23,7 @@ class DbRecord:
self.conn = db.conn
self.last_update = None
self.title = _("DbRecord({})") # for pretty print
self._title = _("DbRecord({})") # for pretty print
if record_id is not None:
self.pk_value = int(record_id)
@@ -142,7 +142,7 @@ class DbRecord:
return True
def __str__(self):
out = [self.title.format(self.pk_value)]
out = [self._title.format(self.pk_value)]
for field in self.fields:
value = getattr(self, field, None)
out.append(" {:15}: {}".format(field, value))
+1 -1
View File
@@ -6,7 +6,7 @@ class Document(DbRecord):
table = "document"
pk_field = "docid"
fields = ('docid', 'doctype', 'mimetype', 'filename', 'extension',
fields = ('doctype', 'mimetype', 'filename', 'extension',
'hash', 'docsize', 'doctime', 'docdate', 'title', 'pages', 'remarks',
'roleaccess')
+1 -1
View File
@@ -6,7 +6,7 @@ class Equipment(DbRecord):
table = "equipment"
pk_field = "eid"
fields = ('eid', 'vid' 'ename', 'shortname', 'model', 'ecat', 'serial',
fields = ('eid', 'vid', 'ename', 'shortname', 'model', 'ecat', 'serial',
'supplier', 'manufacturer', 'purchdate', 'price', 'weight', 'remarks',
'flags')
+3 -2
View File
@@ -6,8 +6,9 @@ class Inventory(DbRecord):
table = "inventory"
pk_field = "invid"
fields = ('invid', 'invname', 'conttype', 'sid', 'boxid', 'eid', 'number',
'weight', 'price', 'purchdate', 'invcond', 'remarks', 'flags')
fields = ('invid', 'invname', 'icat', 'conttype', 'sid', 'boxid', 'eid',
'number', 'weight', 'price', 'purchdate', 'invcond', 'remarks',
'flags')
def __init__(self, db, invid=None):
super().__init__(db, invid)
+3 -3
View File
@@ -5,9 +5,9 @@ from .dbrecord import DbRecord
class Project(DbRecord):
table = "project"
pk_field = "prokid"
fields = ('projid', 'projname', 'vid', 'responsible', 'startdate',
'duration', 'costs_plan', 'costs_final', 'remarks', 'projstate')
pk_field = "projid"
fields = ('projname', 'vid', 'responsible', 'startdate', 'duration',
'costs_plan', 'costs_final', 'remarks', 'projstate')
def __init__(self, db, projid=None):
super().__init__(db, projid)
+2 -2
View File
@@ -6,8 +6,8 @@ class Task(DbRecord):
table = "task"
pk_field = "taskid"
fields = ('taskid', 'vid', 'projid', 'taskname', 'priority', 'taskstate',
'state_ts', 'plandate', 'duedate', 'started', 'finished', 'responsible')
fields = ('vid', 'projid', 'taskname', 'priority', 'taskstate', 'state_ts',
'plandate', 'duedate', 'started', 'finished', 'responsible', 'remarks')
def __init__(self, db, taskid=None):
super().__init__(db, taskid)
+1713 -1366
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -158,6 +158,7 @@
<object class="GtkTreeView" id="tvw_box">
<property name="visible">True</property>
<property name="can-focus">True</property>
<signal name="row-activated" handler="on_tvw_box_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
@@ -295,6 +296,7 @@
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -507,6 +509,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<child>
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
@@ -527,6 +530,8 @@
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">4</property>
<property name="column-spacing">8</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
+24 -4
View File
@@ -172,6 +172,7 @@
<object class="GtkTreeView" id="tvw_cables">
<property name="visible">True</property>
<property name="can-focus">True</property>
<signal name="row-activated" handler="on_tvw_cables_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
@@ -420,6 +421,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
@@ -552,6 +554,8 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -632,6 +636,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<child>
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
@@ -649,14 +654,19 @@
</child>
<child>
<!-- n-columns=2 n-rows=13 -->
<object class="GtkGrid">
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">4</property>
<property name="column-spacing">8</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -679,6 +689,9 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Type</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -701,6 +714,9 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Length</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -712,6 +728,9 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Conductors</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -734,6 +753,9 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Cross section</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -800,6 +822,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
@@ -952,9 +975,6 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkButton" id="but_save">
<property name="label" translatable="yes">Save</property>
+106 -42
View File
@@ -110,6 +110,10 @@
<object class="GtkTreeView" id="tvw_companies">
<property name="visible">True</property>
<property name="can-focus">True</property>
<signal name="row-activated" handler="on_tvw_companies_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
</object>
</child>
</object>
@@ -183,9 +187,12 @@
<object class="GtkBox" id="box_comp_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">4</property>
<property name="margin-bottom">4</property>
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Edit company</property>
@@ -204,11 +211,16 @@
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">4</property>
<property name="column-spacing">8</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Type</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -220,6 +232,9 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -242,7 +257,7 @@
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Type2</property>
<property name="label" translatable="yes">Secondary type</property>
</object>
<packing>
<property name="left-attach">0</property>
@@ -281,7 +296,7 @@
</packing>
</child>
<child>
<object class="GtkEntry">
<object class="GtkEntry" id="ent_shortname">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="max-length">20</property>
@@ -413,7 +428,7 @@
</packing>
</child>
<child>
<object class="GtkEntry">
<object class="GtkEntry" id="ent_street">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="max-length">40</property>
@@ -424,7 +439,7 @@
</packing>
</child>
<child>
<object class="GtkEntry">
<object class="GtkEntry" id="ent_zip">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="max-length">10</property>
@@ -435,7 +450,7 @@
</packing>
</child>
<child>
<object class="GtkEntry">
<object class="GtkEntry" id="ent_city">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="max-length">30</property>
@@ -446,7 +461,7 @@
</packing>
</child>
<child>
<object class="GtkEntry">
<object class="GtkEntry" id="ent_country">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="max-length">30</property>
@@ -457,7 +472,7 @@
</packing>
</child>
<child>
<object class="GtkEntry">
<object class="GtkEntry" id="ent_contact">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="max-length">30</property>
@@ -468,7 +483,7 @@
</packing>
</child>
<child>
<object class="GtkEntry">
<object class="GtkEntry" id="ent_phone">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="max-length">30</property>
@@ -480,7 +495,7 @@
</packing>
</child>
<child>
<object class="GtkEntry">
<object class="GtkEntry" id="ent_email">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="max-length">50</property>
@@ -492,7 +507,7 @@
</packing>
</child>
<child>
<object class="GtkEntry">
<object class="GtkEntry" id="ent_web">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="max-length">40</property>
@@ -503,7 +518,7 @@
</packing>
</child>
<child>
<object class="GtkEntry">
<object class="GtkEntry" id="ent_customerno">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="max-length">20</property>
@@ -514,7 +529,7 @@
</packing>
</child>
<child>
<object class="GtkEntry">
<object class="GtkEntry" id="ent_contractno">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="max-length">20</property>
@@ -595,7 +610,7 @@
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_title_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Company details</property>
@@ -610,12 +625,12 @@
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=15 -->
<!-- n-columns=2 n-rows=16 -->
<object class="GtkGrid" id="grd_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_name">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
@@ -626,7 +641,7 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_type">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Type</property>
@@ -637,7 +652,7 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_type2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Type secondary</property>
@@ -648,7 +663,7 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_shortname">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Short name</property>
@@ -659,7 +674,7 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_street">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Street</property>
@@ -670,7 +685,7 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_zip">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">ZIP</property>
@@ -681,7 +696,7 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_city">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">City</property>
@@ -692,7 +707,7 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_country">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Country</property>
@@ -707,6 +722,8 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -718,6 +735,8 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -729,6 +748,8 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -740,6 +761,8 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -751,6 +774,8 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -762,6 +787,8 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -773,6 +800,8 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -784,6 +813,8 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -791,10 +822,9 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_contact">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Contact</property>
</object>
<packing>
@@ -803,10 +833,9 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_phone">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Phone</property>
</object>
<packing>
@@ -815,10 +844,9 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_email">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Email</property>
</object>
<packing>
@@ -827,10 +855,9 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_web">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Web</property>
</object>
<packing>
@@ -839,10 +866,9 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_customerno">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Customer no.</property>
</object>
<packing>
@@ -851,10 +877,9 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_contractno">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Contract no.</property>
</object>
<packing>
@@ -863,15 +888,15 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_remarks">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">14</property>
<property name="top-attach">15</property>
</packing>
</child>
<child>
@@ -879,6 +904,8 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -890,6 +917,8 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -901,6 +930,8 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -912,6 +943,8 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -919,10 +952,12 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_custno">
<object class="GtkLabel" id="lbl_customerno">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -934,6 +969,8 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -945,6 +982,33 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="selectable">True</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">15</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_flags">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Flags</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">14</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_flags">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -993,12 +1057,12 @@
</packing>
</child>
<child>
<object class="GtkButton" id="but_cance">
<property name="label" translatable="yes">Cancel</property>
<object class="GtkButton" id="but_close">
<property name="label" translatable="yes">Close</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_cancel_clicked" swapped="no"/>
<signal name="clicked" handler="on_but_close_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
+55 -3
View File
@@ -147,6 +147,7 @@
<object class="GtkTreeView" id="tvw_documents">
<property name="visible">True</property>
<property name="can-focus">True</property>
<signal name="row-activated" handler="on_tvw_documents_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
@@ -240,7 +241,7 @@
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=8 -->
<!-- n-columns=3 n-rows=9 -->
<object class="GtkGrid" id="grd_details">
<property name="visible">True</property>
<property name="can-focus">False</property>
@@ -260,6 +261,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -304,6 +306,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -315,6 +318,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -326,6 +330,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -370,6 +375,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -381,6 +387,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -392,6 +399,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -403,10 +411,11 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
@@ -415,15 +424,54 @@
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="selectable">True</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_roleaccess">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Role access</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_roleaccess">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkImage" id="img_preview">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="yalign">0</property>
<property name="stock">gtk-missing-image</property>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
<property name="height">9</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
@@ -494,6 +542,8 @@
<object class="GtkBox" id="box_doc_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">4</property>
<property name="margin-bottom">4</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbl_title_edit">
@@ -515,6 +565,8 @@
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">4</property>
<property name="column-spacing">8</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
+37 -2
View File
@@ -334,7 +334,7 @@
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=11 -->
<!-- n-columns=2 n-rows=12 -->
<object class="GtkGrid" id="grd_details">
<property name="visible">True</property>
<property name="can-focus">False</property>
@@ -457,7 +457,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">10</property>
<property name="top-attach">11</property>
</packing>
</child>
<child>
@@ -465,6 +465,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -476,6 +477,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -487,6 +489,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -498,6 +501,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -509,6 +513,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">False</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -520,6 +525,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -531,6 +537,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -542,6 +549,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -553,6 +561,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -564,6 +573,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -576,6 +586,31 @@
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="selectable">True</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">11</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_flags">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Flags</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">10</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_flags">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
+31 -2
View File
@@ -157,6 +157,7 @@
<object class="GtkTreeView" id="tvw_fuses">
<property name="visible">True</property>
<property name="can-focus">True</property>
<signal name="row-activated" handler="on_tvw_fuses_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
@@ -235,7 +236,7 @@
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbl_title_details">
<object class="GtkLabel" id="lbl_title_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Fuse Details</property>
@@ -261,6 +262,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -349,6 +351,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
@@ -360,6 +363,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -371,6 +375,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -382,6 +387,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -393,6 +399,9 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="selectable">True</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -404,6 +413,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -415,6 +425,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -426,6 +437,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -505,7 +517,10 @@
<object class="GtkBox" id="box_fuse_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">4</property>
<property name="margin-bottom">4</property>
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<child>
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
@@ -523,14 +538,19 @@
</child>
<child>
<!-- n-columns=2 n-rows=8 -->
<object class="GtkGrid">
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">4</property>
<property name="column-spacing">8</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Number</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -542,6 +562,9 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Description</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -553,6 +576,9 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Type</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -564,6 +590,9 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Current</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
+49
View File
@@ -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

+25 -1
View File
@@ -388,7 +388,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">ddd</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -400,6 +400,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -411,6 +412,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -422,6 +424,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -433,6 +436,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -444,6 +448,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -455,6 +460,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -466,6 +472,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -477,6 +484,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -488,6 +496,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -500,6 +509,8 @@
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="selectable">True</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -522,6 +533,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -602,6 +614,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<child>
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
@@ -622,11 +635,16 @@
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">4</property>
<property name="column-spacing">8</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -638,6 +656,9 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Type</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -682,6 +703,9 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Number</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
+1 -1
View File
@@ -8,7 +8,7 @@
<property name="window-position">center</property>
<property name="default-width">800</property>
<property name="default-height">600</property>
<property name="icon">../../icons/yms.svg</property>
<property name="icon">icons/yms.svg</property>
<signal name="destroy" handler="on_destroy" swapped="no"/>
<child>
<object class="GtkNotebook" id="ntb_modules">
+30
View File
@@ -127,6 +127,7 @@
<object class="GtkTreeView" id="tvw_maintenance">
<property name="visible">True</property>
<property name="can-focus">True</property>
<signal name="row-activated" handler="on_tvw_maintenance_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
@@ -240,6 +241,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -262,6 +264,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -339,6 +342,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
@@ -350,6 +354,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -361,6 +366,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -372,6 +378,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -383,6 +390,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -394,6 +402,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -405,6 +414,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -416,6 +426,9 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="selectable">True</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -446,6 +459,7 @@
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
@@ -494,7 +508,10 @@
<object class="GtkBox" id="box_maint_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">4</property>
<property name="margin-bottom">4</property>
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<child>
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
@@ -515,11 +532,16 @@
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">4</property>
<property name="column-spacing">8</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Activities</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -531,6 +553,9 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Equipment</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -629,6 +654,7 @@
<object class="GtkComboBox" id="cmb_equipment">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -639,6 +665,7 @@
<object class="GtkSpinButton" id="spi_series">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -649,6 +676,7 @@
<object class="GtkSpinButton" id="spi_interval">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -659,6 +687,7 @@
<object class="GtkSpinButton" id="spi_last_hours">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -691,6 +720,7 @@
<object class="GtkComboBox" id="cmb_status">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
+844
View File
@@ -0,0 +1,844 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkAdjustment" id="adj_val1">
<property name="upper">100</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adj_val2">
<property name="upper">100</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adj_val3">
<property name="upper">100</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkStack" id="topobject">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">8</property>
<child>
<object class="GtkBox" id="box_measurement">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkExpander">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<!-- n-columns=3 n-rows=2 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="layout-style">start</property>
<child>
<object class="GtkButton" id="but_flt_clear">
<property name="label" translatable="yes">Clear</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_flt_apply">
<property name="label" translatable="yes">Apply</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
<property name="height">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Equipment</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Text</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_flt_equip">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_flt_text">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Filter Measurement</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="tvw_measurement">
<property name="visible">True</property>
<property name="can-focus">True</property>
<signal name="row-activated" handler="on_tvw_measurement_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_new">
<property name="label" translatable="yes">New</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_new_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_detail">
<property name="label" translatable="yes">Details</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_detail_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page0</property>
<property name="title" translatable="yes">page0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_measure_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbl_title_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Measurement Details</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=10 -->
<object class="GtkGrid" id="grd_details">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_name">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Equipment</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_equipment">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Dimensions</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Value 1</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Value 2</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Value 3</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Unit</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Accuracy</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Note</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_dimensions">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_val1">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_val2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_val3">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_unit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_accuracy">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_note">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="selectable">True</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Category</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_category">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_delete">
<property name="label" translatable="yes">Delete</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_delete_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit2">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_close">
<property name="label" translatable="yes">Close</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_close_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page1</property>
<property name="title" translatable="yes">page1</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_measure_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">4</property>
<property name="margin-bottom">4</property>
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<child>
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Edit Measurement</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=9 -->
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">4</property>
<property name="column-spacing">8</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Dimensions</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Value 1</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Value 2</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Value 3</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Accuracy</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Date</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Equipment</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Note</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_name">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_dimensions">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_val1">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="adjustment">adj_val1</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_val2">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="adjustment">adj_val2</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_val3">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="adjustment">adj_val3</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_date">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_equipment">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTextView" id="txt_note">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_accuracy">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_save">
<property name="label" translatable="yes">Save</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_save_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_cancel">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_cancel_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page2</property>
<property name="title" translatable="yes">page2</property>
<property name="position">2</property>
</packing>
</child>
</object>
</interface>
+26 -7
View File
@@ -165,6 +165,7 @@
<object class="GtkTreeView" id="tvw_projects">
<property name="visible">True</property>
<property name="can-focus">True</property>
<signal name="row-activated" handler="on_tvw_projects_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
@@ -183,12 +184,13 @@
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton">
<object class="GtkButton" id="but_new">
<property name="label" translatable="yes">New</property>
<property name="name">but_new</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_new_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@@ -197,12 +199,13 @@
</packing>
</child>
<child>
<object class="GtkButton">
<object class="GtkButton" id="but_edit">
<property name="label" translatable="yes">Edit</property>
<property name="name">but_edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@@ -211,11 +214,12 @@
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Delete</property>
<object class="GtkButton" id="but_detail">
<property name="label" translatable="yes">Details</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_detail_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@@ -343,6 +347,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
@@ -431,6 +436,9 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -439,7 +447,7 @@
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
@@ -455,6 +463,7 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_delete_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@@ -464,11 +473,12 @@
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit">
<object class="GtkButton" id="but_edit2">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@@ -482,6 +492,7 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_close_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@@ -507,12 +518,18 @@
<object class="GtkBox" id="box_proj_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">4</property>
<property name="margin-bottom">4</property>
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<child>
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
<property name="label" translatable="yes">Edit Project</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
@@ -525,6 +542,8 @@
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">4</property>
<property name="column-spacing">8</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
+160 -40
View File
@@ -114,7 +114,7 @@
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Filter Providions (here selection description)</property>
<property name="label" translatable="yes">Filter Provisions</property>
</object>
</child>
</object>
@@ -133,6 +133,7 @@
<object class="GtkTreeView" id="tvw_provisions">
<property name="visible">True</property>
<property name="can-focus">True</property>
<signal name="row-activated" handler="on_tvw_provisions_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
@@ -211,10 +212,13 @@
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Edit provision</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
@@ -227,11 +231,16 @@
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">4</property>
<property name="column-spacing">8</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -276,6 +285,9 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Number</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -341,6 +353,7 @@
<object class="GtkEntry" id="ent_name">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -351,6 +364,7 @@
<object class="GtkComboBox" id="cmb_category">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -361,6 +375,7 @@
<object class="GtkComboBox" id="cmb_storage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -371,6 +386,7 @@
<object class="GtkComboBox" id="cmb_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -381,6 +397,7 @@
<object class="GtkComboBox" id="cmb_unit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -391,6 +408,7 @@
<object class="GtkSpinButton" id="spi_number">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -401,6 +419,7 @@
<object class="GtkSpinButton" id="spi_weight">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -411,6 +430,7 @@
<object class="GtkSpinButton" id="spi_weight_net">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -421,6 +441,7 @@
<object class="GtkEntry" id="ent_storedate">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -431,6 +452,7 @@
<object class="GtkEntry" id="ent_shelflife">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -497,10 +519,13 @@
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_title_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">View Provision</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
@@ -509,12 +534,12 @@
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=10 -->
<!-- n-columns=2 n-rows=13 -->
<object class="GtkGrid" id="grd_details">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_name">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
@@ -525,7 +550,7 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_category">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Category</property>
@@ -536,7 +561,7 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_storage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Storage</property>
@@ -550,7 +575,8 @@
<object class="GtkLabel" id="lbl_name">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Placeholder</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -561,6 +587,8 @@
<object class="GtkLabel" id="lbl_category">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -571,6 +599,8 @@
<object class="GtkLabel" id="lbl_storage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -578,7 +608,7 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Box</property>
@@ -589,7 +619,7 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_number">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Number</property>
@@ -600,32 +630,21 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_weight">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Weight</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Weight net</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_weight_net">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Unit</property>
<property name="label" translatable="yes">Weight net</property>
</object>
<packing>
<property name="left-attach">0</property>
@@ -633,10 +652,10 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_unit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Storedate</property>
<property name="label" translatable="yes">Unit</property>
</object>
<packing>
<property name="left-attach">0</property>
@@ -644,20 +663,33 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="lbl_lb_storedate">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Storedate</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">10</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_shelflife">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Shelflife</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">9</property>
<property name="top-attach">11</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -668,6 +700,8 @@
<object class="GtkLabel" id="lbl_number">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -678,16 +712,8 @@
<object class="GtkLabel" id="lbl_weight">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_weight_net">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -695,9 +721,11 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_unit">
<object class="GtkLabel" id="lbl_weight_net">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -705,25 +733,113 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_storedate">
<object class="GtkLabel" id="lbl_unit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_storedate">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">10</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_shelflife">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">11</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_price">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Price</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_price">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_target">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Target</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_target">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_shelflife1">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">12</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_remarks">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="selectable">True</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">12</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
@@ -742,11 +858,13 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_delete_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
@@ -755,6 +873,7 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@@ -768,6 +887,7 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_close_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
+105 -28
View File
@@ -152,6 +152,7 @@
<object class="GtkTreeView" id="tvw_storage">
<property name="visible">True</property>
<property name="can-focus">True</property>
<signal name="row-activated" handler="on_tvw_storage_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
@@ -233,7 +234,7 @@
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Storage Detais</property>
<property name="label" translatable="yes">Storage Details</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -245,8 +246,8 @@
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=7 -->
<object class="GtkGrid">
<!-- n-columns=2 n-rows=8 -->
<object class="GtkGrid" id="grd_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
@@ -265,33 +266,13 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_remarks">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
@@ -352,6 +333,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -363,6 +345,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -374,6 +357,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -385,6 +369,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -396,12 +381,63 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Color</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_color">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="use-markup">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_remarks">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="selectable">True</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
@@ -475,7 +511,10 @@
<object class="GtkBox" id="box_stor_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">4</property>
<property name="margin-bottom">4</property>
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<child>
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
@@ -492,15 +531,20 @@
</packing>
</child>
<child>
<!-- n-columns=7 n-rows=7 -->
<object class="GtkGrid">
<!-- n-columns=7 n-rows=8 -->
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">4</property>
<property name="column-spacing">8</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -512,6 +556,9 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Typ</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
@@ -778,10 +825,11 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
@@ -798,7 +846,7 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
<property name="top-attach">7</property>
<property name="width">6</property>
</packing>
</child>
@@ -835,6 +883,35 @@
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Color</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
+877
View File
@@ -0,0 +1,877 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkStack" id="topobject">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">8</property>
<child>
<object class="GtkBox" id="box_tasks">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkExpander">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<!-- n-columns=3 n-rows=4 -->
<object class="GtkGrid" id="grd_filter">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="layout-style">start</property>
<child>
<object class="GtkButton" id="but_flt_clear">
<property name="label" translatable="yes">Clear</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_flt_apply">
<property name="label" translatable="yes">Apply</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
<property name="height">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Project</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="cmb_flt_priority">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Priority</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Text</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_flt_project">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Status</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkCheckButton">
<property name="label" translatable="yes">pending</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton">
<property name="label" translatable="yes">active</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton">
<property name="label" translatable="yes">waiting</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton">
<property name="label" translatable="yes">deleted</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkCheckButton">
<property name="label" translatable="yes">completed</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Filter Tasks</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="tvw_tasks">
<property name="visible">True</property>
<property name="can-focus">True</property>
<signal name="row-activated" handler="on_tvw_tasks_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_new">
<property name="label" translatable="yes">New</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_new_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_detail">
<property name="label" translatable="yes">Details</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_detail_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page0</property>
<property name="title" translatable="yes">page0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_task_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Task Details</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=10 -->
<object class="GtkGrid" id="grd_details">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_name">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Priority</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Status</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Timestamp</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_priority">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_status">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_timestamp">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Plan date</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_date">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Due date</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Started</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_plandate">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_duedate">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_started">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_remarks">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="selectable">True</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Finished</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_finished">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Responsible</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_responsible">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_delete">
<property name="label" translatable="yes">Delete</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_delete_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit2">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_close">
<property name="label" translatable="yes">Close</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_close_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page1</property>
<property name="title" translatable="yes">page1</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_task_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">4</property>
<property name="margin-bottom">4</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Edit Task</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=8 -->
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">4</property>
<property name="column-spacing">8</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_title">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Responsible</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">False</property>
<property name="vexpand">False</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTextView" id="txt_remarks">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_responsible">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_filename">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_doctype">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Project</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Priority</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_priority">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Plan Date</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_save">
<property name="label" translatable="yes">Save</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_save_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_cancel">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_cancel_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page2</property>
<property name="title" translatable="yes">page2</property>
<property name="position">2</property>
</packing>
</child>
</object>
</interface>
View File
+167 -8
View File
@@ -7,23 +7,35 @@ Notebook mit Vessel, User, Lists, Settings
"""
import os
import pyudev
from gi.repository import GLib, Gtk, Gdk, Rsvg
from datetime import datetime
import subprocess
import locale
from .view import View
from yms import gtkutils, combobox, treeview
from yms.lookup import Dropdown
from yms.model import user
class BaseView(View):
def __init__(self, context):
super().__init__(context, _("Base Data"), "base.ui")
#self.title = _("Base Data")
#builder = Gtk.Builder()
#builder.set_translation_domain(context.textdomain)
#builder.add_from_file(os.path.join(context.ui_path, "base.ui"))
#builder.connect_signals(self)
#self.topwidget = builder.get_object("topobject")
#gtkutils.init_named_controls(self, builder)
self.context = context
self.user = user.User(context.db) # current user record
self.newuser = False
self.backupdevice = None # USB-Stick detected only on demand
# Settings
self.sys_currency = context.db.load_setting(4)[0] or '€'
self.entry['sys_currency'].set_text(self.sys_currency)
self.sys_max_width = context.db.load_setting(20)[1] or 1024
self.spin['sys_max_width'].set_value(self.sys_max_width)
self.sys_max_height = context.db.load_setting(21)[1] or 768
self.spin['sys_max_height'].set_value(self.sys_max_height)
# combos
roles = {'captain': 'Captain', 'helmsman': 'Helmsman', 'sailor': 'Sailor'}
@@ -31,6 +43,14 @@ class BaseView(View):
langs = {'de': 'Deutsch', 'en': 'English'}
combobox.load_from_dict(self.combo['user_lang'], langs)
today = datetime.now()
datedict = {
key: f"{prefix} - {today.strftime(fmt)}"
for key, (fmt, prefix) in context.datefmt_map.items()
}
self.datefmt = context.db.load_setting(2)[0] or 'Y-m-d'
combobox.load_from_dict(self.combo['datefmt'], datedict, self.datefmt)
# shipyard
self.db.cur.execute("SELECT compid, compname FROM company WHERE comptype=3 ORDER BY compname")
shipyards = dict(self.db.cur.fetchall())
@@ -129,6 +149,132 @@ class BaseView(View):
storages = dict(self.db.cur.fetchall())
combobox.refresh_dict(self.combo['storage'], {-1: _("─── none ───")} | storages)
def find_usb_sticks(self):
result = []
for name in os.listdir("/sys/block"):
device = "/sys/block/" + name
removable = device + "/removable"
if not os.path.exists(removable):
continue
with open(removable) as f:
if f.read().strip() != "1":
continue
device_path = os.path.realpath(device + "/device")
if "/usb" in device_path.lower():
result.append(name)
return result
def is_mounted(self, device):
with open("/proc/mounts") as f:
for line in f:
mounted_device = line.split()[0]
if mounted_device == device:
return True
return False
def on_but_usbdevice_clicked(self, widget):
self.backupdevice = None
devlist = self.find_usb_sticks()
if len(devlist) == 0:
self.label['usb_device'].set_text('n/a')
return
if len(devlist) != 1:
print(devlist)
print("Multiple devices not supported yet")
self.label['usb_device'].set_text('multiple')
return
usbdev = devlist[0]
self.label['usb_device'].set_text(f"/dev/{usbdev}")
"""
serial number via python3-pyudev:
import pyudev
Settings
7 - usb backup device serial
8 - usb backup partition uuid
9 - last backup timestamp
"""
# first get stick hardware data
udevctx = pyudev.Context()
device = pyudev.Devices.from_sys_path(udevctx, os.path.join("/sys/class/block", usbdev))
serial = device.get("ID_SERIAL_SHORT")
vendor = device.get("ID_VENDOR")
model = device.get("ID_MODEL")
self.label['usb_serial'].set_text(serial or 'n/a')
self.label['usb_vendor'].set_text(vendor or 'n/a')
self.label['usb_model'].set_text(model or 'n/a')
# TODO second get partition, filesystem type and label
# there must be only one ext4 partition on disk
partitions = [
child for child in device.children
if child.device_type == "partition"
]
partition = partitions[0]
print(f"Partition={partition}")
if len(partitions) != 1:
print("error: more than one partition!")
return
partuuid = partition.properties.get("ID_PART_ENTRY_UUID")
fstype = partition.get("ID_FS_TYPE")
plabel = partition.get("ID_FS_LABEL")
self.label['usb_partition'].set_text(plabel)
self.label['usb_uuid'].set_text(partuuid)
self.label['usb_fstype'].set_text(fstype)
if fstype != "ext4":
print(f"error: invalid fileystem type {fstype}, ext4 expected")
return
self.backupdevice = f"/dev/{usbdev}1" # partition!
# check if device is mounted
if not self.is_mounted(self.backupdevice):
print("device is not mounted. trying to mount now")
pass
# For backup there must be an directory names ymsbackup which contains
# backup description and backup sets
# Desription and identification file backup.json?
# if plabel != 'BACKUP' or not os.path.isdir('ymsbackup')
mountpoint = os.path.join("/media", os.getlogin(), "BACKUP")
if not os.path.isdir(mountpoint):
print(f"Device is not mounted at {mountpoint}")
def on_but_usbinit_clicked(self, widget):
if self.backupdevice is None:
return
# UUID of devive -> settings
# check if backups already exist
answer = gtkutils.questionbox(
_("Initialize USB-Stick\n"
"All data on that device will be lost!\n"
"Are you really sure?"
), title="YMS")
if answer == False:
return
if self.label['usb_fstype'].get_text() != 'ext4':
print("formatting {self.backupdevice} with ext4")
#try:
# subprocess.run(["sudo", "mkfs.ext4", "-L", "BACKUP", self.backupdevice], check=True)
#except subprocess.CalledProcessError as e:
# print("formatting failed: ", e)
myself = os.getlogin()
mountpoint = os.path.join("/media", myself, "backup")
basedir = os.path.join(mountpoint, 'ymsbackup')
print(basedir)
# mkdir basedir
# chown (os.getlogin(), 'yms')
# chmod 770
else:
#
pass
def on_cmb_vessel_changed(self, widget):
self.context.vessel.load(combobox.get_list_value(widget))
sql = ("UPDATE settings SET valint=%s WHERE userid=0 AND sno=1")
@@ -189,7 +335,20 @@ class BaseView(View):
def display_vessel(self, vessel):
self.label['vesselname'].set_text(vessel.vesselname)
self.label['model'].set_text(vessel.model or '')
self.label['year_built'].set_text(self.format_int(vessel.year_built, default='n/a'))
self.label['shipyard'].set_text(str(vessel.shipyard))
self.label['year_built'].set_text(self.format_int(vessel.year_built, False, default='n/a'))
self.label['loa'].set_text(self.format_float(vessel.loa, 2, suffix="m"))
self.label['lwl'].set_text(self.format_float(vessel.lwl, 2, suffix="m"))
self.label['beam'].set_text(self.format_float(vessel.beam, 2, suffix="m"))
self.label['draught'].set_text(self.format_float(vessel.draught, 2, suffix="m"))
self.label['draught_min'].set_text(self.format_float(vessel.draught_min, 2, suffix="m"))
self.label['displacement'].set_text(self.format_int(vessel.displacement, 2, suffix="kg"))
self.label['ballast'].set_text(self.format_int(vessel.ballast, 2, suffix="kg"))
self.label['belt_bow'].set_text(self.format_float(vessel.beltpos_bow, 2, suffix="m"))
self.label['belt_aft'].set_text(self.format_float(vessel.beltpos_aft, 2, suffix="m"))
self.label['hull_shape'].set_text(vessel.shapefile or '')
self.label['storage_def'].set_text(str(vessel.sid_default))
self.label['remarks'].set_text(vessel.remarks or '')
def edit_vessel(self, vessel):
self.entry['vesselname'].set_text(vessel.vesselname)
+39 -3
View File
@@ -5,12 +5,14 @@ from gi.repository import GLib, Gtk, Gdk
from .view import View
from yms import gtkutils, combobox, treeview
from yms.lookup import Dropdown
from yms.model import box
class BoxesView(View):
def __init__(self, context):
super().__init__(context, _("Box"), "boxes.ui")
super().__init__(context, _("Boxes"), "boxes.ui")
self.context = context
# box already used for controls so other name here
self.sbox = box.Box(context.db) # current record
@@ -33,12 +35,33 @@ class BoxesView(View):
treeview.add_column(self.tree['box'], _('Remarks'), 3)
self.tree['box'].set_model(self.lst_box)
self.dd_boxtype = self.context.lookup.dropdown(Dropdown.BOX_TYPE)
combobox.load_from_dict(self.combo['type'], self.dd_boxtype)
def load_list(self):
pass
def clear_record(self):
self.entry['label'].set_text('')
self.entry['content'].set_text('')
self.spin['wx'].set_value(0)
self.spin['wy'].set_value(0)
self.spin['wz'].set_value(0)
self.text['remarks'].get_buffer().set_text('')
def display_record(self):
self.label['label'].set_text(self.sbox.label)
# storage sid
self.label['content'].set_text(self.sbox.content or '')
self.label['type'].set_text(self.dd_boxtype[self.sbox.boxtype])
self.label['color'].set_text(self.sbox.color or '')
if self.sbox.color:
self.label['color'].set_markup(f'#{self.sbox.color} <span foreground="#{self.sbox.color}">●</span>')
else:
self.label['color'].set_text('')
self.label['weight'].set_text(self.format_float(self.sbox.weight, 2, suffix='kg'))
self.label['weight_net'].set_text(self.format_float(self.sbox.weight_net, 2, suffix='kg'))
self.label['price'].set_text(self.format_float(self.sbox.price, 2, suffix='€'))
self.label['remarks'].set_text(self.sbox.remarks or '')
def edit_record(self):
@@ -64,14 +87,27 @@ class BoxesView(View):
self.topwidget.set_visible_child(self.box['box_edit'])
def on_but_detail_clicked(self, widget):
sid = treeview.get_value(self.tree['box'], 0)
self.sbox.load(sid)
boxid = treeview.get_value(self.tree['box'], 0)
if not boxid:
return
self.sbox.load(boxid)
self.display_record()
self.topwidget.set_visible_child(self.box['box_detail'])
self.button['close'].grab_focus()
def on_tvw_box_row_activated(self, widget, path, column):
boxid = treeview.get_value(widget, 0)
self.sbox.load(boxid)
self.display_record()
self.topwidget.set_visible_child(self.box['box_detail'])
self.button['close'].grab_focus()
# buttons on detail page
# edit2 uses edit callback
def on_but_close_clicked(self, widget):
boxid = treeview.get_value(self.tree['box'], 0)
if not boxid:
return
self.topwidget.set_visible_child(self.box['box'])
def on_but_delete_clicked(self, widget):
+35 -1
View File
@@ -5,6 +5,7 @@ from gi.repository import Gtk
from .view import View
from yms import gtkutils, combobox, treeview
from yms.lookup import Dropdown
from yms.model import cable
class CablesView(View):
@@ -36,6 +37,9 @@ class CablesView(View):
treeview.add_column(self.tree['cables'], _('Condition'), 2)
self.tree['cables'].set_model(self.lst_cables)
self.dd_type = self.context.lookup.dropdown(Dropdown.CABLE_TYPE)
self.dd_tech = self.context.lookup.dropdown(Dropdown.CABLE_TECHNAME)
# buttons on list page
def on_but_new_clicked(self, widget):
self.topwidget.set_visible_child(self.box['cable_edit'])
@@ -44,8 +48,20 @@ class CablesView(View):
self.topwidget.set_visible_child(self.box['cable_edit'])
def on_but_detail_clicked(self, widget):
cableid = treeview.get_value(self.tree['cables'], 0)
if not cableid:
return
self.cable.load(cableid)
self.display_record()
self.topwidget.set_visible_child(self.box['cable_detail'])
self.button['close'].grab_focus()
def on_tvw_cables_row_activated(self, widget, path, column):
cableid = treeview.get_value(widget, 0)
self.cable.load(cableid)
self.display_record()
self.topwidget.set_visible_child(self.box['cable_detail'])
# buttons on detail page
# edit2 uses edit callback
def on_but_close_clicked(self, widget):
@@ -62,7 +78,25 @@ class CablesView(View):
self.topwidget.set_visible_child(self.box['cables'])
def display_record(self):
pass
self.label['name'].set_text(self.cable.cablename)
self.label['type'].set_text(self.dd_type[self.cable.cabletype])
if self.cable.techname:
self.label['techname'].set_text(self.dd_tech[self.cable.techname])
else:
self.label['techname'].set_text('')
self.label['length'].set_text(self.format_int(self.cable.length))
self.label['conductors'].set_text(self.format_int(self.cable.conductors))
self.label['diameter'].set_text(self.format_float(self.cable.diameter, 1))
self.label['xsection'].set_text(self.format_float(self.cable.xsection, 1))
self.label['weight'].set_text(self.format_float(self.cable.weight))
if self.cable.color:
self.label['color'].set_markup(f'#{self.cable.color} <span foreground="#{self.cable.color}">●</span>')
else:
self.label['color'].set_text('')
self.label['supplier'].set_text(str(self.cable.supplier))
self.label['manufacturer'].set_text(str(self.cable.manufacturer))
self.label['condition'].set_text(self.cable.cablecond)
self.label['remarks'].set_text(self.cable.remarks or '')
def edit_record(self):
pass
+71 -16
View File
@@ -5,12 +5,14 @@ from gi.repository import Gtk
from .view import View
from yms import gtkutils, combobox, treeview
from yms.lookup import Dropdown
from yms.model import company
class CompaniesView(View):
def __init__(self, context):
super().__init__(context, _("Companies"), "companies.ui")
self.context = context
self.comp = company.Company(context.db) # current record
self.newrecord = False
@@ -20,7 +22,13 @@ class CompaniesView(View):
self.comptype = dict(self.db.cur.fetchall())
combobox.load_from_dict(self.combo['flt_type'], {-2: _("─── all ───")} | self.comptype, -2)
# companied
self.dd_comptype = self.context.lookup.dropdown(Dropdown.COMPANY_TYPE)
combobox.load_from_dict(self.combo['comptype'], self.dd_comptype)
combobox.load_from_dict(self.combo['comptype2'], self.dd_comptype)
self.dd_flags = context.lookup.enum('company.flags')
# companies
self.lst_companies = Gtk.ListStore(int, str, str, str)
self.db.cur.execute("SELECT compid, compname, comptype, remarks FROM company ORDER BY compname")
for row in self.db.cur.fetchall():
@@ -31,30 +39,77 @@ class CompaniesView(View):
treeview.add_column(self.tree['companies'], _('Remarks'), 3)
self.tree['companies'].set_model(self.lst_companies)
def display_company(self, company):
self.entry['compname'].set_text(company.compname)
# Type
# Type2
self.entry['shortname'].set_text(company.shortname)
self.entry['street'].set_text(company.street)
self.entry['zip'].set_text(company.zip)
self.entry['city'].set_text(company.city)
self.entry['country'].set_text(company.country)
self.entry['contact'].set_text(company.contact)
self.entry['phone'].set_text(company.phone)
self.entry['email'].set_text(company.email)
self.entry['web'].set_text(company.web)
self.entry['customerno'].set_text(company.customerno)
self.entry['contractno'].set_text(company.contractno)
def clear_record(self):
self.entry['name'].set_text('')
self.entry['shortname'].set_text('')
self.entry['street'].set_text('')
self.entry['zip'].set_text('')
self.entry['city'].set_text('')
self.entry['country'].set_text('')
self.entry['contact'].set_text('')
self.entry['phone'].set_text('')
self.entry['email'].set_text('')
self.entry['web'].set_text('')
self.entry['customerno'].set_text('')
self.entry['contractno'].set_text('')
combobox.activate_row(self.combo['comptype'], -1)
combobox.activate_row(self.combo['comptype2'], -1)
def display_record(self):
self.label['name'].set_text(self.comp.compname)
self.label['shortname'].set_text(self.comp.shortname or '')
self.label['type'].set_text(self.dd_comptype.get(self.comp.comptype, ''))
self.label['type2'].set_text(self.dd_comptype.get(self.comp.comptype2, ''))
self.label['street'].set_text(self.comp.street or '')
self.label['zip'].set_text(self.comp.zip or '')
self.label['city'].set_text(self.comp.city or '')
self.label['country'].set_text(self.comp.country or '')
self.label['phone'].set_text(self.comp.phone or '')
self.label['email'].set_text(self.comp.email or '')
self.label['web'].set_text(self.comp.web or '')
self.label['customerno'].set_text(self.comp.customerno or '')
self.label['contractno'].set_text(self.comp.contractno or '')
self.label['flags'].set_text(self.comp.flags or '')
self.label['remarks'].set_text(self.comp.remarks or '')
def edit_record(self):
self.entry['compname'].set_text(self.comp.compname)
# Type self.dd_comptype.get(self.comp.comptype, -1)
# Type2 self.dd_comptype.get(self.comp.comptype2, -1)
self.entry['shortname'].set_text(self.comp.shortname or '')
self.entry['street'].set_text(self.comp.street or '')
self.entry['zip'].set_text(self.comp.zip or '')
self.entry['city'].set_text(self.comp.city or '')
self.entry['country'].set_text(self.comp.country or '')
self.entry['contact'].set_text(self.comp.contact or '')
self.entry['phone'].set_text(self.comp.phone or '')
self.entry['email'].set_text(self.comp.email or '')
self.entry['web'].set_text(self.comp.web or '')
self.entry['customerno'].set_text(self.comp.customerno or '')
self.entry['contractno'].set_text(self.comp.contractno or '')
# buttons on list page
def on_but_new_clicked(self, widget):
self.topwidget.set_visible_child(self.box['comp_edit'])
def on_but_edit_clicked(self, widget):
compid = treeview.get_value(self.tree['companies'], 0)
if not compid:
return
self.topwidget.set_visible_child(self.box['comp_edit'])
def on_but_detail_clicked(self, widget):
compid = treeview.get_value(self.tree['companies'], 0)
if not compid:
return
self.comp.load(compid)
self.display_record()
self.topwidget.set_visible_child(self.box['comp_detail'])
def on_tvw_companies_row_activated(self, widget, path, column):
compid = treeview.get_value(widget, 0)
self.comp.load(compid)
self.display_record()
self.topwidget.set_visible_child(self.box['comp_detail'])
# buttons on detail page
+75 -2
View File
@@ -1,7 +1,8 @@
# SPDX-License-Identifier: WTFPL
import os
from gi.repository import GLib, Gtk, Gdk
from gi.repository import GLib, Gtk, Gdk, GdkPixbuf, Rsvg
import fitz
from .view import View
from yms import gtkutils, combobox, treeview
@@ -11,6 +12,7 @@ class DocumentsView(View):
def __init__(self, context):
super().__init__(context, _("Documents"), "documents.ui")
self.context = context
self.doc = document.Document(context.db) # current record
self.newrecord = False
@@ -41,7 +43,18 @@ class DocumentsView(View):
self.topwidget.set_visible_child(self.box['doc_edit'])
def on_but_detail_clicked(self, widget):
docid = treeview.get_value(self.tree['documents'], 0)
self.doc.load(docid)
self.display_record()
self.topwidget.set_visible_child(self.box['doc_detail'])
self.button['close'].grab_focus()
def on_tvw_documents_row_activated(self, widget, path, column):
docid = treeview.get_value(widget, 0)
self.doc.load(docid)
self.display_record()
self.topwidget.set_visible_child(self.box['doc_detail'])
self.button['close'].grab_focus()
# buttons on detail page
# edit2 uses edit callback
@@ -58,8 +71,68 @@ class DocumentsView(View):
def on_but_cancel_clicked(self, widget):
self.topwidget.set_visible_child(self.box['documents'])
def pdf_to_pixbuf(self, filename, max_width=400, max_height=400):
doc = fitz.open(filename)
page = doc[0]
rect = page.rect
scale = min(max_width / rect.width, max_height / rect.height)
matrix = fitz.Matrix(scale, scale)
pix = page.get_pixmap(matrix=matrix, alpha=False)
pixbuf = GdkPixbuf.Pixbuf.new_from_data(
pix.samples,
GdkPixbuf.Colorspace.RGB,
pix.alpha,
8,
pix.width,
pix.height,
pix.stride,
None,
None
)
return pixbuf
def display_record(self):
pass
print(self.doc)
self.label['title'].set_text(self.doc.title or '')
self.label['filename'].set_text(self.doc.filename)
# self.label['extents'] -> see below
self.label['mimetype'].set_text(self.doc.mimetype)
self.label['filesize'].set_text(self.format_int(self.doc.docsize, suffix="Byte"))
self.label['date'].set_text(self.format_date(self.doc.docdate))
self.label['doctype'].set_text(self.doc.doctype)
self.label['roleaccess'].set_text(self.doc.roleaccess)
self.label['doctype'].set_text(self.doc.remarks or '')
# image preview
if self.doc.doctype == 'picture':
filename = f"pic-{self.doc.pk_value:06d}.{self.doc.extension}"
imgpath = os.path.join(self.context.cfg['docpath'], filename)
info = GdkPixbuf.Pixbuf.get_file_info(imgpath)
if info:
imgformat, imgwidth, imgheight = info
self.label['extents'].set_text(f"{imgwidth}x{imgheight} Pixel")
if imgwidth > 400 or imgheight > 400:
print("loading scaled")
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(imgpath, 400, 400, True)
else:
print("loading")
pixbuf = GdkPixbuf.Pixbuf.new_from_file(imgpath)
else:
print("cannot get image info")
self.image['preview'].set_from_pixbuf(pixbuf)
elif self.doc.doctype == 'drawing':
filename = f"drw-{self.doc.pk_value:06d}.{self.doc.extension}"
imgpath = os.path.join(self.context.cfg['docpath'], filename)
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(imgpath, 400, 400, True)
self.image['preview'].set_from_pixbuf(pixbuf)
elif self.doc.mimetype == "application/pdf":
filename = f"doc-{self.doc.pk_value:06d}.{self.doc.extension}"
imgpath = os.path.join(self.context.cfg['docpath'], filename)
print(imgpath)
pixbuf = self.pdf_to_pixbuf(imgpath)
self.image['preview'].set_from_pixbuf(pixbuf)
else:
self.image['preview'].clear()
def edit_record(self):
pass
+22 -1
View File
@@ -5,12 +5,14 @@ from gi.repository import GLib, Gtk, Gdk
from .view import View
from yms import gtkutils, combobox, treeview
from yms.lookup import Dropdown
from yms.model import equipment
class EquipmentView(View):
def __init__(self, context):
super().__init__(context, _("Equipment"), "equipment.ui")
self.context = context
self.equip = equipment.Equipment(context.db) # current record
self.newrecord = False
@@ -36,11 +38,19 @@ class EquipmentView(View):
treeview.add_column(self.tree['equipment'], _('Remarks'), 6)
self.tree['equipment'].set_model(self.lst_equipment)
self.dd_category = self.context.lookup.dropdown(Dropdown.EQUIPMENT_CATEGORY)
#combobox.load_from_dict(self.combo['unit'], self.dd_unit)
# buttons on list page
def on_but_new_clicked(self, widget):
self.newrecord = True
self.label['title_editor'].set_text(_("Add new Equipment"))
self.clear_record()
self.equip.vid = self.context.vessel.vid
self.topwidget.set_visible_child(self.box['equip_edit'])
def on_but_edit_clicked(self, widget):
self.label['title_edit'].set_text(_("Edit Equipment"))
self.topwidget.set_visible_child(self.box['equip_edit'])
def on_but_detail_clicked(self, widget):
@@ -48,6 +58,7 @@ class EquipmentView(View):
self.equip.load(eid)
self.display_record()
self.topwidget.set_visible_child(self.box['equip_detail'])
self.button['close'].grab_focus()
def on_tvw_equipment_row_activated(self, widget, path, column):
eid = treeview.get_value(widget, 0)
@@ -72,7 +83,17 @@ class EquipmentView(View):
def display_record(self):
print(self.equip)
#self.label['name'].set_text(self.equip.sname)
self.label['name'].set_text(self.equip.ename)
self.label['shortname'].set_text(self.equip.shortname or '')
#lookup self.label['manufacturer'].set_text(self.equip.manufacturer)
self.label['model'].set_text(self.equip.model or '')
self.label['serial'].set_text(self.equip.serial or '')
self.label['weight'].set_text(self.format_float(self.equip.weight, 2, suffix='kg'))
self.label['price'].set_text(self.format_float(self.equip.price, 2, suffix='€'))
self.label['date_purch'].set_text(self.equip.purchdate or '')
#lookup self.label['supplier'].set_text(self.equip.supplier)
self.label['category'].set_text(self.dd_category[self.equip.ecat])
self.label['flags'].set_text(self.equip.flags or '')
self.label['remarks'].set_text(self.equip.remarks or '')
def edit_record(self):
+24 -1
View File
@@ -5,6 +5,7 @@ from gi.repository import Gtk
from .view import View
from yms import gtkutils, combobox, treeview
from yms.lookup import Dropdown
from yms.model import fuse
class FusesView(View):
@@ -38,6 +39,8 @@ class FusesView(View):
treeview.add_column(self.tree['fuses'], _('Description'), 3)
self.tree['fuses'].set_model(self.lst_fuses)
self.dd_type = self.context.lookup.dropdown(Dropdown.FUSE_TYPE)
# buttons on list page
def on_but_new_clicked(self, widget):
self.topwidget.set_visible_child(self.box['fuse_edit'])
@@ -46,7 +49,20 @@ class FusesView(View):
self.topwidget.set_visible_child(self.box['fuse_edit'])
def on_but_detail_clicked(self, widget):
fuseid = treeview.get_value(self.tree['fuses'], 0)
if not fuseid:
return
self.fuse.load(fuseid)
self.display_record()
self.topwidget.set_visible_child(self.box['fuse_detail'])
self.button['close'].grab_focus()
def on_tvw_fuses_row_activated(self, widget, path, column):
fuseid = treeview.get_value(widget, 0)
self.fuse.load(fuseid)
self.display_record()
self.topwidget.set_visible_child(self.box['fuse_detail'])
self.button['close'].grab_focus()
# buttons on detail page
# edit2 uses edit callback
@@ -64,7 +80,14 @@ class FusesView(View):
self.topwidget.set_visible_child(self.box['fuses'])
def display_record(self):
pass
self.label['fnumber'].set_text(f"F{self.fuse.fnumber}")
self.label['type'].set_text(self.dd_type[self.fuse.ftype])
self.label['current'].set_text(self.format_float(self.fuse.current, 2, suffix="A"))
self.label['cable'].set_text(str(self.fuse.cableid))
self.label['equipment'].set_text(str(self.fuse.eid))
self.label['location'].set_text(str(self.fuse.location))
self.label['description'].set_text(str(self.fuse.description or ''))
self.label['remarks'].set_text(str(self.fuse.remarks or ''))
def edit_record(self):
pass
+8
View File
@@ -5,6 +5,7 @@ from gi.repository import GLib, Gtk, Gdk
from .view import View
from yms import gtkutils, combobox, treeview
from yms.lookup import Dropdown
from yms.model import inventory
class InventoryView(View):
@@ -39,6 +40,8 @@ class InventoryView(View):
treeview.add_column(self.tree['inventory'], _('Remarks'), 5)
self.tree['inventory'].set_model(self.lst_inventory)
self.dd_category = self.context.lookup.dropdown(Dropdown.INVENTORY_CATEGORY)
# buttons on list page
def on_but_new_clicked(self, widget):
self.topwidget.set_visible_child(self.box['inv_edit'])
@@ -51,6 +54,7 @@ class InventoryView(View):
self.inv.load(invid)
self.display_record()
self.topwidget.set_visible_child(self.box['inv_detail'])
self.button['close'].grab_focus()
def on_tvw_inventory_row_activated(self, widget, path, column):
invid = treeview.get_value(widget, 0)
@@ -85,6 +89,10 @@ class InventoryView(View):
self.label['price'].set_text(self.format_float(self.inv.price, suffix='€'))
self.label['purchdate'].set_text(self.format_date(self.inv.purchdate))
self.label['condition'].set_text(self.inv.invcond)
if self.inv.icat is not None:
self.label['category'].set_text(self.dd_category[self.inv.icat])
else:
self.label['category'].set_text('')
self.label['remarks'].set_text(self.inv.remarks or '')
def edit_record(self):
+24 -2
View File
@@ -40,7 +40,20 @@ class MaintenanceView(View):
self.topwidget.set_visible_child(self.box['maint_edit'])
def on_but_detail_clicked(self, widget):
self.topwidget.set_visible_child(self.box['maintv_detail'])
maintid = treeview.get_value(self.tree['maintenance'], 0)
if not maintid:
return
self.maint.load(maintid)
self.display_record()
self.topwidget.set_visible_child(self.box['maint_detail'])
self.button['close'].grab_focus()
def on_tvw_maintenance_row_activated(self, widget, path, column):
maintid = treeview.get_value(widget, 0)
self.maint.load(maintid)
self.display_record()
self.topwidget.set_visible_child(self.box['maint_detail'])
self.button['close'].grab_focus()
# buttons on detail page
# edit2 uses edit callback
@@ -58,7 +71,16 @@ class MaintenanceView(View):
self.topwidget.set_visible_child(self.box['maintenance'])
def display_record(self):
pass
self.label['activities'].set_text(self.maint.activities)
self.label['equipment'].set_text(str(self.maint.eid))
self.label['series'].set_text(str(self.maint.series))
self.label['interval'].set_text(self.format_int(self.maint.interval_hours))
self.label['last'].set_text(self.format_int(self.maint.last_hours))
self.label['plandate'].set_text(self.format_date(self.maint.plan_date))
self.label['completion'].set_text(self.format_date(self.maint.completion_date))
self.label['status'].set_text(self.maint.maintstate)
self.label['remarks'].set_text(self.maint.remarks or '')
def edit_record(self):
pass
+102
View File
@@ -0,0 +1,102 @@
# SPDX-License-Identifier: WTFPL
import os
from gi.repository import Gtk
from .view import View
from yms import gtkutils, combobox, treeview
from yms.lookup import Dropdown
from yms.model import measurement
class MeasurementView(View):
def __init__(self, context):
super().__init__(context, _("Measurements"), "measurement.ui")
self.measure = measurement.Measurement(context.db) # current record
self.newrecord = False
# measurement units
self.dd_unit = self.context.lookup.dropdown(Dropdown.UNIT)
self.lst_measurement = Gtk.ListStore(int, str, str, str, str, str)
sql = (
"SELECT m.mid, m.mname, m.nval, m.val1, m.val2, m.val3, m.unit, "
"m.accuracy, m.note, e.ename "
"FROM measurement AS m LEFT OUTER JOIN equipment AS e USING (eid) "
"WHERE m.vid=%s "
"ORDER BY m.mid"
)
self.db.dcur.execute(sql, (context.vessel.vid,))
for row in self.db.dcur.fetchall():
if row['nval'] == 1:
value = "{} {}".format(row['val1'], row['unit'])
elif row['nval'] == 2:
value = "{}x{} {}".format(row['val1'], row['val2'], row['unit'])
elif row['nval'] == 3:
value = "{}x{}x{} {}".format(row['val1'], row['val2'], row['val3'], row['unit'])
else:
#invalid
value = "#invalid"
data = (
row['mid'],
row['mname'],
value,
row['accuracy'],
row['ename'],
row['note'] or ''
)
self.lst_measurement.append(data)
treeview.add_column(self.tree['measurement'], _('ID'), 0)
treeview.add_column(self.tree['measurement'], _('Measurement'), 1)
treeview.add_column(self.tree['measurement'], _('Value'), 2)
treeview.add_column(self.tree['measurement'], _('Accuracy'), 3)
treeview.add_column(self.tree['measurement'], _('Equipment'), 4)
treeview.add_column(self.tree['measurement'], _('Note'), 5)
self.tree['measurement'].set_model(self.lst_measurement)
# buttons on list page
def on_but_new_clicked(self, widget):
self.topwidget.set_visible_child(self.box['measure_edit'])
def on_but_edit_clicked(self, widget):
self.topwidget.set_visible_child(self.box['measure_edit'])
def on_but_detail_clicked(self, widget):
mid = treeview.get_value(self.tree['measurement'], 0)
if not mid:
return
self.measure.load(mid)
self.display_record()
self.topwidget.set_visible_child(self.box['measure_detail'])
self.button['close'].grab_focus()
def on_tvw_measurement_row_activated(self, widget, path, column):
mid = treeview.get_value(widget, 0)
self.measure.load(mid)
self.display_record()
self.topwidget.set_visible_child(self.box['measure_detail'])
self.button['close'].grab_focus()
# buttons on detail page
# edit2 uses edit callback
def on_but_close_clicked(self, widget):
self.topwidget.set_visible_child(self.box['measurement'])
def on_but_delete_clicked(self, widget):
self.topwidget.set_visible_child(self.box['measurement'])
# buttons on edit page
def on_but_save_clicked(self, widget):
pass
def on_but_cancel_clicked(self, widget):
self.topwidget.set_visible_child(self.box['measurement'])
def display_record(self):
self.label['name'].set_text(self.measure.mname)
self.label['note'].set_text(self.measure.note or '')
def edit_record(self):
pass
+25 -1
View File
@@ -11,6 +11,7 @@ class ProjectsView(View):
def __init__(self, context):
super().__init__(context, _("Projects"), "projects.ui")
self.context = context
self.project = project.Project(context.db) # current record
self.newrecord = False
@@ -42,6 +43,9 @@ class ProjectsView(View):
treeview.add_column(self.tree['projects'], _('Remarks'), 5)
self.tree['projects'].set_model(self.lst_projects)
self.dd_user = context.lookup.user()
self.dd_state = self.context.lookup.enum('project.projstate')
# buttons on list page
def on_but_new_clicked(self, widget):
self.topwidget.set_visible_child(self.box['proj_edit'])
@@ -50,7 +54,20 @@ class ProjectsView(View):
self.topwidget.set_visible_child(self.box['proj_edit'])
def on_but_detail_clicked(self, widget):
projid = treeview.get_value(self.tree['projects'], 0)
if not projid:
return
self.project.load(projid)
self.display_record()
self.topwidget.set_visible_child(self.box['proj_detail'])
self.button['close'].grab_focus()
def on_tvw_projects_row_activated(self, widget, path, column):
projid = treeview.get_value(widget, 0)
self.project.load(projid)
self.display_record()
self.topwidget.set_visible_child(self.box['proj_detail'])
self.button['close'].grab_focus()
# buttons on detail page
# edit2 uses edit callback
@@ -68,7 +85,14 @@ class ProjectsView(View):
self.topwidget.set_visible_child(self.box['projects'])
def display_record(self):
pass
self.label['name'].set_text(self.project.projname)
self.label['responsible'].set_text(self.dd_user[self.project.responsible])
self.label['date_start'].set_text(self.format_date(self.project.startdate))
self.label['duration'].set_text(self.format_int(self.project.duration, suffix="Days"))
self.label['costs_plan'].set_text(self.format_float(self.project.costs_plan, 2, suffix="€"))
self.label['costs_final'].set_text(self.format_float(self.project.costs_final, 2, suffix="€"))
self.label['status'].set_text(self.project.projstate)
self.label['remarks'].set_text(self.project.remarks or '')
def edit_record(self):
pass
+30 -1
View File
@@ -11,6 +11,7 @@ class ProvisionsView(View):
def __init__(self, context):
super().__init__(context, _("Provisions"), "provisions.ui")
self.context = context
self.prov = provision.Provision(context.db) # current record
self.newrecord = False
@@ -21,7 +22,7 @@ class ProvisionsView(View):
sql = (
"SELECT p.provid, p.provname, p.number, p.unit, p.storedate, p.shelflife "
"FROM provisions AS p LEFT OUTER JOIN storage AS s USING (sid) "
"WHERE s.vid=%s"
"WHERE s.vid=%s OR vid IS NULL"
)
self.db.dcur.execute(sql, (context.vessel.vid,))
for row in self.db.dcur.fetchall():
@@ -55,7 +56,18 @@ class ProvisionsView(View):
self.topwidget.set_visible_child(self.box['prov_edit'])
def on_but_detail_clicked(self, widget):
provid = treeview.get_value(self.tree['provisions'], 0)
self.prov.load(provid)
self.display_record()
self.topwidget.set_visible_child(self.box['prov_detail'])
self.button['close'].grab_focus()
def on_tvw_provisions_row_activated(self, widget, path, column):
provid = treeview.get_value(widget, 0)
self.prov.load(provid)
self.display_record()
self.topwidget.set_visible_child(self.box['prov_detail'])
self.button['close'].grab_focus()
# buttons on detail page
# edit2 uses edit callback
@@ -71,3 +83,20 @@ class ProvisionsView(View):
def on_but_cancel_clicked(self, widget):
self.topwidget.set_visible_child(self.box['provisions'])
def display_record(self):
print(self.prov)
self.label['name'].set_text(self.prov.provname)
self.label['category'].set_text(str(self.prov.provcat))
self.label['storage'].set_text(str(self.prov.sid))
self.label['box'].set_text(str(self.prov.boxid))
self.label['number'].set_text(str(self.prov.number))
self.label['unit'].set_text(str(self.prov.unit))
self.label['target'].set_text(str(self.prov.target))
self.label['weight'].set_text(self.format_float(self.prov.weight, 2, suffix='kg'))
self.label['weight_net'].set_text(self.format_float(self.prov.weight_net, 2, suffix='kg'))
self.label['price'].set_text(self.format_float(self.prov.price, 2, suffix='€'))
self.label['remarks'].set_text(self.prov.remarks or '')
def edit_record(self):
pass
+1 -1
View File
@@ -11,7 +11,7 @@ class StatusView:
def __init__(self, context):
self.context = context
self.title = _("Status")
self._title = _("Status")
builder = Gtk.Builder()
builder.set_translation_domain(context.textdomain)
builder.add_from_file(os.path.join(context.ui_path, "status.ui"))
+40 -25
View File
@@ -5,14 +5,13 @@ from gi.repository import GLib, Gtk, Gdk
from .view import View
from yms import gtkutils, combobox, treeview
from yms.model import storage
from yms.lookup import Dropdown
from yms.model import storage
class StorageView(View):
def __init__(self, context):
super().__init__(context, _("Storage"), "storage.ui")
self.context = context
self.storage = storage.Storage(context.db) # current record
@@ -27,15 +26,11 @@ class StorageView(View):
treeview.add_column(self.tree['storage'], _('Remarks'), 3)
self.tree['storage'].set_model(self.lst_storage)
#combodict = self.context.lookup.dropdown(Dropdown.STORAGE_TYPE)
#combobox.load_from_dict(self.combo['type'], combodict)
self.dd_stype = self.context.lookup.dropdown(Dropdown.STORAGE_TYPE)
combobox.load_from_dict(self.combo['type'], self.dd_stype)
combodict = self.context.lookup.dropdown(Dropdown.STORAGE_TYPE)
print(combodict)
combobox.load_from_dict(self.combo['type'], combodict)
combodict = self.context.lookup.enum('storage.capaunit')
combobox.load_from_dict(self.combo['unit'], combodict)
self.dd_unit = self.context.lookup.enum('storage.capaunit')
combobox.load_from_dict(self.combo['unit'], self.dd_unit)
def add_row(self):
pass
@@ -55,8 +50,32 @@ class StorageView(View):
for row in self.db.cur.fetchall():
self.lst_storage.append(row)
def clear_record(self):
self.storage.clear()
self.entry['sname'].set_text('')
self.spin['x'].set_value(0)
self.spin['y'].set_value(0)
self.spin['z'].set_value(0)
self.spin['wx'].set_value(0)
self.spin['wy'].set_value(0)
self.spin['wz'].set_value(0)
self.spin['angle'].set_value(0)
self.spin['capacity'].set_value(0)
combobox.activate_row(self.combo['type'], -1)
combobox.activate_row(self.combo['unit'], -1)
self.text['remarks'].get_buffer().set_text('')
def display_record(self):
self.label['name'].set_text(self.storage.sname)
self.label['type'].set_text(self.dd_stype[self.storage.stype])
self.label['position'].set_text(f"({self.storage.x}, {self.storage.y}, {self.storage.z})")
self.label['dimension'].set_text(f"({self.storage.wx}, {self.storage.wy}, {self.storage.wz})")
self.label['angle'].set_text(f"{self.storage.angle}°")
self.label['capacity'].set_text(f"{self.storage.capacity} {self.storage.capaunit}")
if self.storage.color:
self.label['color'].set_markup(f'#{self.storage.color} <span foreground="#{self.storage.color}">●</span>')
else:
self.label['color'].set_text('')
self.label['remarks'].set_text(self.storage.remarks or '')
def edit_record(self):
@@ -71,23 +90,9 @@ class StorageView(View):
self.spin['capacity'].set_value(self.storage.capacity)
combobox.activate_row(self.combo['type'], self.storage.stype)
combobox.activate_row(self.combo['unit'], self.storage.capaunit)
# flags
self.text['remarks'].get_buffer().set_text(self.storage.remarks or '')
def clear_record(self):
self.storage.clear()
self.entry['sname'].set_text('')
self.spin['x'].set_value(0)
self.spin['y'].set_value(0)
self.spin['z'].set_value(0)
self.spin['wx'].set_value(0)
self.spin['wy'].set_value(0)
self.spin['wz'].set_value(0)
self.spin['angle'].set_value(0)
self.spin['capacity'].set_value(0)
combobox.activate_row(self.combo['type'], -1)
combobox.activate_row(self.combo['unit'], .1)
self.text['remarks'].get_buffer().set_text('')
# buttons on list page
def on_but_new_clicked(self, widget):
self.newrecord = True
@@ -108,9 +113,19 @@ class StorageView(View):
def on_but_detail_clicked(self, widget):
sid = treeview.get_value(self.tree['storage'], 0)
if not sid:
return
self.storage.load(sid)
self.display_record()
self.topwidget.set_visible_child(self.box['stor_detail'])
self.button['close'].grab_focus()
def on_tvw_storage_row_activated(self, widget, path, column):
sid = treeview.get_value(widget, 0)
self.storage.load(sid)
self.display_record()
self.topwidget.set_visible_child(self.box['stor_detail'])
self.button['close'].grab_focus()
# buttons on detail page
# edit2 uses edit callback
+89
View File
@@ -0,0 +1,89 @@
# SPDX-License-Identifier: WTFPL
import os
from gi.repository import Gtk
from .view import View
from yms import gtkutils, combobox, treeview
from yms.model import task
class TasksView(View):
def __init__(self, context):
super().__init__(context, _("Tasks"), "tasks.ui")
self.context = context
self.task = task.Task(context.db) # current record
self.newrecord = False
self.lst_tasks = Gtk.ListStore(int, str, str, str, str)
sql = (
"SELECT t.taskid, t.taskname, t.priority, t.taskstate, "
"u.displayname AS responsible "
"FROM task AS t JOIN user AS u ON (t.responsible=u.userid)"
"WHERE t.vid=%s "
"ORDER BY t.taskid"
)
self.db.dcur.execute(sql, (context.vessel.vid,))
for row in self.db.dcur.fetchall():
data = (
row['taskid'],
row['taskname'],
row['priority'],
row['taskstate'],
row['responsible']
)
self.lst_tasks.append(data)
treeview.add_column(self.tree['tasks'], _('ID'), 0)
treeview.add_column(self.tree['tasks'], _('Name'), 1)
treeview.add_column(self.tree['tasks'], _('Priority'), 2)
treeview.add_column(self.tree['tasks'], _('Status'), 3)
treeview.add_column(self.tree['tasks'], _('Responsible'), 4)
self.tree['tasks'].set_model(self.lst_tasks)
# buttons on list page
def on_but_new_clicked(self, widget):
self.topwidget.set_visible_child(self.box['task_edit'])
def on_but_edit_clicked(self, widget):
self.topwidget.set_visible_child(self.box['task_edit'])
def on_but_detail_clicked(self, widget):
taskid = treeview.get_value(self.tree['tasks'], 0)
if not taskid:
return
self.task.load(taskid)
self.display_record()
self.topwidget.set_visible_child(self.box['task_detail'])
self.button['close'].grab_focus()
def on_tvw_tasks_row_activated(self, widget, path, column):
taskid = treeview.get_value(widget, 0)
self.task.load(taskid)
self.display_record()
self.topwidget.set_visible_child(self.box['task_detail'])
# buttons on detail page
# edit2 uses edit callback
def on_but_close_clicked(self, widget):
self.topwidget.set_visible_child(self.box['tasks'])
def on_but_delete_clicked(self, widget):
self.topwidget.set_visible_child(self.box['tasks'])
# buttons on edit page
def on_but_save_clicked(self, widget):
pass
def on_but_cancel_clicked(self, widget):
self.topwidget.set_visible_child(self.box['tasks'])
def display_record(self):
self.label['name'].set_text(self.task.taskname)
self.label['responsible'].set_text('')
self.label['status'].set_text(self.task.taskstate)
self.label['remarks'].set_text(self.task.remarks or '')
def edit_record(self):
pass
+1 -1
View File
@@ -17,7 +17,7 @@ class View:
self.db = context.db
self.vessel = context.vessel
self.user = context.user
self.title = title
self._title = title
builder = Gtk.Builder()
builder.set_translation_domain(context.textdomain)
builder.add_from_file(os.path.join(context.ui_path, ui_file))
+16 -15
View File
@@ -48,6 +48,8 @@ from yms.view.inventory import InventoryView
from yms.view.provisions import ProvisionsView
from yms.view.maintenance import MaintenanceView
from yms.view.projects import ProjectsView
from yms.view.tasks import TasksView
from yms.view.measurement import MeasurementView
from yms.view.cables import CablesView
from yms.view.fuses import FusesView
from yms.view.documents import DocumentsView
@@ -72,14 +74,14 @@ class AppContext:
# mapping between PHP and Python
datefmt_map = {
'Y-m-d': '%Y-%m-%d', # ISO / international / technical
'd.m.Y': '%d.%m.%Y', # Germany / Central & Northern Europe
'd/m/Y': '%d/%m/%Y', # UK / France / Spain / Italy / Australia / NZ
'd-m-Y': '%d-%m-%Y', # Netherlands / Denmark / Belgium
'd M Y': '%d %b %Y', # nautical documents / logbooks / unambiguous
'm.d.Y': '%m.%d.%Y', # USA
'm/d/Y': '%m/%d/%Y', # USA
'Y/m/d': '%Y/%m/%d' # Japan / China
'Y-m-d': ('%Y-%m-%d', 'YYYY-MM-DD'), # ISO / international / technical
'd.m.Y': ('%d.%m.%Y', 'DD.MM.YYYY'), # Germany / Central & Northern Europe
'd/m/Y': ('%d/%m/%Y', 'DD/MM/YYYY'), # UK / France / Spain / Italy / Australia / NZ
'd-m-Y': ('%d-%m-%Y', 'DD-MM-YYYY'), # Netherlands / Denmark / Belgium
'd M Y': ('%d %b %Y', 'DD Mon YYYY'), # nautical documents / logbooks / unambiguous
'm.d.Y': ('%m.%d.%Y', 'MM.DD.YYYY'), # USA
'm/d/Y': ('%m/%d/%Y', 'MM/DD/YYYY'), # USA
'Y/m/d': ('%Y/%m/%d', 'YYYY/MM/DD') # Japan / China
}
def __init__(self):
@@ -109,9 +111,10 @@ class AppContext:
if row is not None:
try:
self.datefmt = self.datefmt_map[row[0]]
print(row[0])
except KeyError:
# almost impossible case where db value is not in mapping
print("internal error: format mapping missinf")
print("internal error: date format mapping missing")
else:
# perhaps create missing record here?
pass
@@ -137,10 +140,12 @@ class Frontend:
"equipment": EquipmentView(context),
"inventory": InventoryView(context),
"provisions": ProvisionsView(context),
"measurement": MeasurementView(context),
"cables": CablesView(context),
"fuses": FusesView(context),
"maintenance": MaintenanceView(context),
"projects": ProjectsView(context),
"tasks": TasksView(context),
"documents": DocumentsView(context),
"status": StatusView(context)
}
@@ -152,13 +157,11 @@ class Frontend:
self.window = builder.get_object("wnd_main")
self.notebook = builder.get_object("ntb_modules")
for module in self.modules.values():
self.notebook.append_page(module.topwidget, Gtk.Label(label=module.title))
self.notebook.append_page(module.topwidget, Gtk.Label(label=module._title))
self.db_poll_ts = context.db.get_timestamp()
GLib.timeout_add_seconds(30, self.db_change_poller)
print("Frontend initialized.")
def run(self):
#self.label['vessel'].set_text(self._vessel.vesselname)
self.window.show_all()
@@ -195,14 +198,12 @@ def create_config(cfg, cfgfile):
if __name__ == "__main__":
print("Startup sequence entered...")
context = AppContext()
locale.setlocale(locale.LC_ALL, '')
gettext.bindtextdomain(context.textdomain, 'locale')
gettext.textdomain(context.textdomain)
gettext.install(context.textdomain)
gettext.install(context.textdomain, 'locale')
config = configparser.ConfigParser()
cfgfile = os.path.expanduser(context.cfg['cfgfile'])
+22 -7
View File
@@ -14,15 +14,28 @@ cfg = {
'user': 'yms'
}
def set_pass():
newpass = getpass('New Password: ')
def set_pass(uid):
sql = "SELECT login, displayname FROM user WHERE userid=%s"
db.cur.execute(sql, (uid,))
user = db.cur.fetchone()
displayname = "{}/{}".format(user[0], user[1])
try:
newpass = getpass(f"New Password for '{displayname}': ")
except (EOFError, KeyboardInterrupt):
print("Aborted.")
return
cryptpass = bcrypt.hashpw(newpass.encode(), bcrypt.gensalt())
print(cryptpass.decode())
sql = "UPDATE user SET pass=%s WHERE userid=%s"
db.cur.execute(sql, (cryptpass.decode(), uid))
db.conn.commit()
print("Ok.")
def get_user():
username = input('Username: ')
try:
username = input('Username: ')
except (EOFError, KeyboardInterrupt):
print("Aborted.")
return -1
sql = "SELECT userid FROM user WHERE login=%s"
db.cur.execute(sql, (username,))
row = db.cur.fetchone()
@@ -44,8 +57,10 @@ if __name__ == "__main__":
cfg['pass'] = config.get('DB', 'pass')
db = database.Database(cfg['host'], cfg['db'])
if db.connect(cfg['user'], cfg['pass']):
print("Connected to database")
print(get_user())
print("Connected to database {}@{}".format(cfg['db'], cfg['host']))
uid = get_user()
if uid >= 0:
set_pass(uid)
db.disconnect()
else:
print("Cannot connect to database {}@{}".format(cfg['db'], cfg['host']))