Add main window icon and fix key length selection bug

master
Thomas Hooge 4 years ago
parent b0ba091ac1
commit a797cda27c
  1. BIN
      icons/tinyca.png
  2. 69
      icons/tinyca.svg
  3. 8
      lib/GUI.pm

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 463 463"
style="enable-background:new 0 0 463 463;"
xml:space="preserve"><metadata
id="metadata39"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title><cc:license
rdf:resource="http://creativecommons.org/publicdomain/zero/1.0/" /></cc:Work><cc:License
rdf:about="http://creativecommons.org/publicdomain/zero/1.0/"><cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" /><cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" /><cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /></cc:License></rdf:RDF></metadata><defs
id="defs37" />
<path
style="opacity:1;fill:#f0f0f0;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="M 231.5,28.138 448,151.852 V 164 H 15 v -12.148 z"
id="rect846" />
<path
style="opacity:1;fill:#f8f8f8;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m 432,179 v 17 H 31 v -17 z"
id="rect846-3" /><path
style="opacity:1;fill:#f8f8f8;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="M 80,372 H 63 V 235 h 17 z"
id="rect846-3-6" /><path
style="opacity:1;fill:#f8f8f8;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="M 160,372 H 143 V 235 h 17 z"
id="rect846-3-6-7" /><path
style="opacity:1;fill:#f8f8f8;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="M 240,372 H 223 V 235 h 17 z"
id="rect846-3-6-5" /><path
style="opacity:1;fill:#f8f8f8;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="M 320,372 H 303 V 235 h 17 z"
id="rect846-3-6-3" /><path
style="opacity:1;fill:#f8f8f8;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="M 400,372 H 383 V 235 h 17 z"
id="rect846-3-6-56" /><path
style="opacity:1;fill:#f8f8f8;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="M 87.652238,220.83156 54.779147,220.75283 55,211 h 33 z"
id="rect846-3-6-2" /><path
style="opacity:1;fill:#f8f8f8;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="M 167.65224,220.83153 134.77915,220.75283 135,211 h 33 z"
id="rect846-3-6-2-9" /><path
style="opacity:1;fill:#f8f8f8;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="M 247.65223,220.83153 214.77914,220.75283 215,211 h 33 z"
id="rect846-3-6-2-1" /><path
style="opacity:1;fill:#f8f8f8;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="M 327.65223,220.83153 294.77914,220.75283 295,211 h 33 z"
id="rect846-3-6-2-2" /><path
style="opacity:1;fill:#f8f8f8;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="M 407.65223,220.83153 374.77914,220.75283 375,211 h 33 z"
id="rect846-3-6-2-7" /><path
style="opacity:1;fill:#f8f8f8;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m 432,387 v 17 H 31 v -17 z"
id="rect846-3-0" /><path
style="opacity:1;fill:#f0f0f0;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m 448,419 v 17 H 15 v -17 z"
id="rect846-3-9" /><path
d="M423,219.5V211h16.5c4.142,0,7.5-3.358,7.5-7.5V179h8.5c4.142,0,7.5-3.358,7.5-7.5v-24c0-2.691-1.442-5.177-3.779-6.512 l-224-128c-2.306-1.317-5.137-1.317-7.442,0l-224,128C1.442,142.323,0,144.808,0,147.5v24c0,4.142,3.358,7.5,7.5,7.5H16v24.5 c0,4.142,3.358,7.5,7.5,7.5H40v8.5c0,5.827,3.235,10.908,8,13.555V372H23.5c-4.142,0-7.5,3.358-7.5,7.5V404H7.5 c-4.142,0-7.5,3.358-7.5,7.5v32c0,4.142,3.358,7.5,7.5,7.5h448c4.142,0,7.5-3.358,7.5-7.5v-32c0-4.142-3.358-7.5-7.5-7.5H447v-24.5 c0-4.142-3.358-7.5-7.5-7.5H415V233.055C419.765,230.408,423,225.327,423,219.5z M408,219.5c0,0.276-0.224,0.5-0.5,0.5h-32 c-0.276,0-0.5-0.224-0.5-0.5V211h33V219.5z M335,372V233.055c4.765-2.647,8-7.728,8-13.555V211h17v8.5 c0,5.827,3.235,10.908,8,13.555V372H335z M303,372V235h17v137H303z M255,372V233.055c4.765-2.647,8-7.728,8-13.555V211h17v8.5 c0,5.827,3.235,10.908,8,13.555V372H255z M223,372V235h17v137H223z M175,372V233.055c4.765-2.647,8-7.728,8-13.555V211h17v8.5 c0,5.827,3.235,10.908,8,13.555V372H175z M143,372V235h17v137H143z M95,372V233.055c4.765-2.647,8-7.728,8-13.555V211h17v8.5 c0,5.827,3.235,10.908,8,13.555V372H95z M168,211v8.5c0,0.276-0.224,0.5-0.5,0.5h-32c-0.276,0-0.5-0.224-0.5-0.5V211H168z M248,211 v8.5c0,0.276-0.224,0.5-0.5,0.5h-32c-0.276,0-0.5-0.224-0.5-0.5V211H248z M328,211v8.5c0,0.276-0.224,0.5-0.5,0.5h-32 c-0.276,0-0.5-0.224-0.5-0.5V211H328z M15,151.852L231.5,28.138L448,151.852V164H15V151.852z M31,179h401v17H31V179z M88,211v8.5 c0,0.276-0.224,0.5-0.5,0.5h-32c-0.276,0-0.5-0.224-0.5-0.5V211H88z M63,235h17v137H63V235z M448,436H15v-17h433V436z M432,404H31 v-17h401V404z M383,372V235h17v137H383z"
id="path2" /></svg>

After

Width:  |  Height:  |  Size: 6.4 KiB

@ -111,6 +111,7 @@ sub new {
# initialize main window
$self->{'mw'} = Gtk2::Window->new("toplevel");
$self->{'mw'}->set_title("TinyCA2 Management $self->{'version'}");
$self->{'mw'}->set_icon_from_file("./icons/tinyca.png");
$self->{'mw'}->set_resizable(1);
$section = $self->{'init'}->{'cfg'}->{window};
@ -1366,13 +1367,12 @@ sub show_req_dialog {
$radiobox = Gtk2::HBox->new(0, 0);
# use config if present
main::printd("preparing radiobox for type " . $self->{'CA'}->{'cfg'}->{global}{default_req_type});
my $bits = \$opts->{'bits'};
if ($self->{'CA'}->{'cfg'}->{global}{default_req_type} eq 'user') {
$bits = $self->{'CA'}->{'cfg'}->{user}{default_bits} // \$opts->{'bits'};
$opts->{'bits'} = $self->{'CA'}->{'cfg'}->{user}{default_bits} // \$opts->{'bits'};
} elsif ($self->{'CA'}->{'cfg'}->{global}{default_req_type} eq 'server') {
$bits = $self->{'CA'}->{'cfg'}->{server}{default_bits}// \$opts->{'bits'};
$opts->{'bits'} = $self->{'CA'}->{'cfg'}->{server}{default_bits}// \$opts->{'bits'};
}
_fill_radiobox($radiobox, \$bits, %bit_lengths);
_fill_radiobox($radiobox, \$opts->{'bits'}, %bit_lengths);
$reqtable->attach_defaults($radiobox, 1, 2, 13, 14);
$label = GUI::HELPERS::create_label(