1. Andreas Tscharner
  2. lrc

Commits

Andreas Tscharner  committed 0bde56e

gui: Save selected filenames in vector and provide it in method

  • Participants
  • Parent commits 77d3a30
  • Branches default

Comments (0)

Files changed (2)

File src/gui/AddRemoveHandlers.cxx

View file
  • Ignore whitespace
 
 
 	dlgRet = m_addFilesDlg->run();
+	if (dlgRet == Gtk::RESPONSE_OK) {
+		m_lastSelected.clear();
+		m_lastSelected = m_addFilesDlg->get_filenames();
+	};
 	m_addFilesDlg->hide();
 }
 
 	anyFile->set_name("Any file");
 	anyFile->add_pattern("*");
 	m_addFilesDlg->add_filter(anyFile);
+
+	m_lastSelected.clear();
 }
 
 AddRemoveHandlers::~AddRemoveHandlers(void)
 	delete m_removeButton;
 	delete m_addButton;
 }
+
+std::vector<std::string> AddRemoveHandlers::getSelectedFilenames(void)
+{
+	return m_lastSelected;
+}

File src/gui/AddRemoveHandlers.hxx

View file
  • Ignore whitespace
  * main window
  *
  * \author Andreas Tscharner
- * \date 2012-06-10
+ * \date 2012-06-17
  */
 
 
 		Gtk::Button *m_addButton;      //!< Reference to "Add" button
 		Gtk::Button *m_removeButton;   //!< Reference to "Remove" button
 		Gtk::FileChooserDialog *m_addFilesDlg;   //!< Reference to "Add Files" dialog
+		std::vector<std::string> m_lastSelected; //!< List of filenames that were last selected
 
 	protected:
 		/*! \brief Signal handler for "Add" button
 		 * Frees all the used memory
 		 */
 		~AddRemoveHandlers(void);
+
+		/*! \brief Returns last selected filenames
+		 *
+		 * This method returns the list of the filenames that were last
+		 * selected. The list will not be cleared.
+		 *
+		 * \return List of last selected filenames
+		 */
+		std::vector<std::string> getSelectedFilenames(void);
 };