1. Andreas Tscharner
  2. lrc

Source

lrc / src / gui / ButtonHandlers.cxx

Diff from to

File src/gui/ButtonHandlers.cxx

  • Ignore whitespace
 	m_listHandler->removeSelected(selectedRes);
 }
 
+void ButtonHandlers::on_edit_button_clicked(void)
+{
+	int dlgRet;
+
+
+	dlgRet = m_editDialog->run();
+	m_editDialog->hide();
+}
+
 ButtonHandlers::ButtonHandlers(Glib::RefPtr<Gtk::Builder> p_refBuilder)
 {
 	Gtk::Window *mainWin;
 
 	p_refBuilder->get_widget("bnAdd", m_addButton);
 	m_addButton->signal_clicked().connect(sigc::mem_fun(*this,
-	                                         &ButtonHandlers::on_add_button_clicked));
-
+	                                      &ButtonHandlers::on_add_button_clicked));
 	p_refBuilder->get_widget("bnRemove", m_removeButton);
 	m_removeButton->signal_clicked().connect(sigc::mem_fun(*this,
-	                                            &ButtonHandlers::on_remove_button_clicked));
+	                                         &ButtonHandlers::on_remove_button_clicked));
+	p_refBuilder->get_widget("bnEdit", m_editButton);
+	m_editButton->signal_clicked().connect(sigc::mem_fun(*this,
+	                                       &ButtonHandlers::on_edit_button_clicked));
 
 	p_refBuilder->get_widget("MainWindow", mainWin);
+
 	m_addFilesDlg = new Gtk::FileChooserDialog(*mainWin, "Dateien für Resourcen auswählen",
 	                                           Gtk::FILE_CHOOSER_ACTION_OPEN);
-
 	m_addFilesDlg->set_select_multiple(true);
 	m_addFilesDlg->set_has_resize_grip(false);
 	m_addFilesDlg->set_create_folders(false);
-
 	m_addFilesDlg->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
 	m_addFilesDlg->add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK);
-
 	anyFile->set_name("Any file");
 	anyFile->add_pattern("*");
 	m_addFilesDlg->add_filter(anyFile);
 
+	p_refBuilder->get_widget("dlgEdit", m_editDialog);
+
 	m_listHandler = nullptr;
 }
 
 ButtonHandlers::~ButtonHandlers(void)
 {
+	delete m_editDialog;
 	delete m_addFilesDlg;
+	delete m_editButton;
 	delete m_removeButton;
 	delete m_addButton;
 }