phpide_Dialog_Generic(dirname(__FILE__) ."/text_entry_dialog.glade"); $this->bookmark_type_combo = $this->widget->get_widget("bookmark_type_combo"); $this->bookmark_type = $this->widget->get_widget("bookmark_type"); $this->text_entry = $this->widget->get_widget("text_entry"); $this->text_entry->connect("key_press_event", array(&$this,"key_pressed")); $this->ok_pressed_callback = array(&$this, "ok_pressed"); } function show($bookmarkid,$URL,$type) { $this->bookmarkid=$bookmarkid; $this->type =$type; $this->URL = $URL; $pos = strpos($this->URL,":"); $this->URI = substr($this->URL,0,$pos); if ($this->type == "dir") { $this->__show("create a new directory in\n$URL"); } else { $this->__show("create a new file in\n$URL"); } $this->text_entry->set_text(""); $this->text_entry->grab_focus(); } function ok_pressed() { global $application; $filename = $this->text_entry->get_text(); $errormessage = $application->transports->create_new( $this->bookmarkid,$this->URL,$this->type , $filename); if ($errormessage) { $application->dialogs["ok"]->show($errormessage); } $this->hide(); } function key_pressed($widget,$event) { if ($event->keyval == 65293) if ($this->ok_pressed_callback) call_user_func($this->ok_pressed_callback); } } ?>