Browse Source

A partial fix for issue #2530, which will makes the bonjour dialog put the port number in the string.

Joseph Lenox 10 years ago
parent
commit
4f2e172561
2 changed files with 5 additions and 1 deletions
  1. 4 0
      lib/Slic3r/GUI/BonjourBrowser.pm
  2. 1 1
      lib/Slic3r/GUI/Tab.pm

+ 4 - 0
lib/Slic3r/GUI/BonjourBrowser.pm

@@ -47,5 +47,9 @@ sub GetValue {
     my ($self) = @_;
     return $self->{devices}[ $self->{choice}->GetSelection ]->address;
 }
+sub GetPort {
+    my ($self) = @_;
+    return $self->{devices}[ $self->{choice}->GetSelection ]->port;
+}
 
 1;

+ 1 - 1
lib/Slic3r/GUI/Tab.pm

@@ -1015,7 +1015,7 @@ sub build {
                 EVT_BUTTON($self, $btn, sub {
                     my $dlg = Slic3r::GUI::BonjourBrowser->new($self);
                     if ($dlg->ShowModal == wxID_OK) {
-                        my $value = $dlg->GetValue;
+                        my $value = $dlg->GetValue . ":" . $dlg->GetPort;
                         $self->{config}->set('octoprint_host', $value);
                         $self->update_dirty;
                         $self->_on_value_change('octoprint_host', $value);