From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 163FB9B72C for ; Wed, 18 Oct 2023 14:00:40 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E9C1ADF85 for ; Wed, 18 Oct 2023 14:00:09 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Wed, 18 Oct 2023 14:00:08 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id AE8374242D for ; Wed, 18 Oct 2023 14:00:08 +0200 (CEST) Message-ID: Date: Wed, 18 Oct 2023 14:00:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Content-Language: en-US To: pve-devel@lists.proxmox.com References: <20231017135708.128807-1-m.sandoval@proxmox.com> From: Filip Schauer In-Reply-To: <20231017135708.128807-1-m.sandoval@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 1.487 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -3.339 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Subject: Re: [pve-devel] [PATCH installer v2] fix #4869: Show state in management interface ComboBox X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2023 12:00:40 -0000 Tested this in the installer and it looks good to me. Tested-by: Filip Schauer On 17/10/2023 15:57, Maximiliano Sandoval R wrote: > From: Maximiliano Sandoval > > This is a continuation of > https://lists.proxmox.com/pipermail/pve-devel/2023-August/058639.html. > > Signed-off-by: Maximiliano Sandoval R > --- > proxinstall | 23 +++++++++++++++++++++-- > 1 file changed, 21 insertions(+), 2 deletions(-) > > diff --git a/proxinstall b/proxinstall > index d5b2565..d1f8ae2 100755 > --- a/proxinstall > +++ b/proxinstall > @@ -341,10 +341,20 @@ sub create_ipconf_view { > > my ($cidr_box, $ipconf_entry_addr, $ipconf_entry_mask) = create_cidr_inputs($cidr); > > - my $device_cb = Gtk3::ComboBoxText->new(); > + my $device_model = Gtk3::ListStore->new('Glib::String', 'Glib::String'); > + my $device_cb = Gtk3::ComboBox->new_with_model($device_model); > $device_cb->set_active(0); > $device_cb->set_visible(1); > > + my $icon_cell = Gtk3::CellRendererText->new(); > + $device_cb->pack_start($icon_cell, 0); > + $device_cb->add_attribute($icon_cell, 'text', 0); > + $icon_cell->set_property('foreground', 'green'); > + > + my $cell = Gtk3::CellRendererText->new(); > + $device_cb->pack_start($cell, 0); > + $device_cb->add_attribute($cell, 'text', 1); > + > my $get_device_desc = sub { > my $iface = shift; > return "$iface->{name} - $iface->{mac} ($iface->{driver})"; > @@ -374,7 +384,16 @@ sub create_ipconf_view { > my $i = 0; > for my $index (sort keys $ipconf->{ifaces}->%*) { > my $iface = $ipconf->{ifaces}->{$index}; > - $device_cb->append_text($get_device_desc->($iface)); > + my $iter = $device_model->append(); > + my $symbol; > + { > + use utf8; > + $symbol = "$iface->{state}" eq "UP" ? '●' : ' '; > + } > + $device_model->set($iter, > + 0 => $symbol, > + 1 => $get_device_desc->($iface), > + ); > $device_active_map->{$i} = $index; > $device_active_reverse_map->{$iface->{name}} = $i; > if ($ipconf_first_view && $index == $ipconf->{default}) {