예제 #1
0
//----------------------------------------------------------------
void Collection::edit_paper()
{
  //Need a mechanism to have the current paper?
  Paper * paper = dynamic_cast<Paper *>(_current_library->get_current_entry());
  if ( ! paper )
    {
      Entry * entry = _current_library->get_current_entry();
      if ( entry->open_new_dialog()  == QDialog::Accepted )
	{
	  update_paper_list();
	}
    }
  else if ( paper->open_new_dialog()  == QDialog::Accepted )
    {
      update_paper_list();
    }
}
예제 #2
0
//----------------------------------------------------------------
void Collection::new_paper()
{
  //we should not try to add a paper if no current library;
  if ( !_current_library )
    {
      QMessageBox::about(this, tr("Error"),
			 tr("Error: you have no Libraries defined\n"
			    "you cannot create a new paper"));
      return;
    }
  Paper * paper = new Paper();
  if ( paper->open_new_dialog()  == QDialog::Accepted )
    {
      _stdout << "We should have some data in here now: " 
	      << paper->get_author() << endl;
      _stdout.flush();
      //add the entry to the library
      _current_library->add_entry(paper);
      //add the entry to the list
      add_paper_to_list(*paper,_paper_list);
      update_library_list();
    }
}