Skip to content

Commit aa75c76

Browse files
authored
Merge pull request #855 from Gliese852/gtk-add-model-segfault
Fix segfault when adding a model via howdy-gtk
2 parents 344eb34 + 05b8cb5 commit aa75c76

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

howdy-gtk/src/tab_models.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from i18n import _
55
from gi.repository import Gtk as gtk
6+
from gi.repository import GObject as gobject
67

78

89
def on_user_change(self, select):
@@ -73,13 +74,13 @@ def on_model_add(self, button):
7374
dialog = gtk.MessageDialog(parent=self, flags=gtk.DialogFlags.MODAL, buttons=gtk.ButtonsType.NONE)
7475
dialog.set_title(_("Creating Model"))
7576
dialog.props.text = _("Please look directly into the camera")
76-
dialog.get_child().connect("map", lambda w: execute_add(self, dialog, entered_name, self.active_user))
7777
dialog.show_all()
7878

79+
# Wait a bit to allow the user to read the dialog
80+
gobject.timeout_add(600, lambda: execute_add(self, dialog, entered_name))
7981

80-
def execute_add(box, dialog, entered_name, user):
8182

82-
time.sleep(1)
83+
def execute_add(box, dialog, entered_name):
8384

8485
status, output = subprocess.getstatusoutput(["howdy add '" + entered_name + "' -y -U " + box.active_user])
8586

0 commit comments

Comments
 (0)