NCBI C++ ToolKit
submitblockdlg.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: submitblockdlg.cpp 47479 2023-05-02 13:24:02Z ucko $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Colleen Bollin
27  */
28 
29 
30 #include <ncbi_pch.hpp>
33 #include <objects/biblio/Affil.hpp>
37 #include <objects/general/Date.hpp>
40 #include <objects/seq/Pubdesc.hpp>
41 #include <objects/pub/Pub.hpp>
43 
44 #include <wx/listctrl.h>
45 #include <wx/msgdlg.h>
46 #include <wx/filedlg.h>
47 #include <wx/stattext.h>
48 
49 ////@begin includes
50 #include "wx/imaglist.h"
51 ////@end includes
52 
53 // for file loader
60 
63 
64 ////@begin XPM images
65 ////@end XPM images
66 
68 
69 /*!
70  * CSubmitBlockDlg type definition
71  */
72 
73 IMPLEMENT_DYNAMIC_CLASS( CSubmitBlockDlg, wxDialog )
74 
75 
76 /*!
77  * CSubmitBlockDlg event table definition
78  */
79 
80 BEGIN_EVENT_TABLE( CSubmitBlockDlg, wxDialog )
81 
82 ////@begin CSubmitBlockDlg event table entries
84 
86 
88 
90 
92 
94 
95 ////@end CSubmitBlockDlg event table entries
98 
100 
101 
102 /*!
103  * CSubmitBlockDlg constructors
104  */
105 
107 {
108  Init();
109 }
110 
112  IWorkbench* workbench,
113  wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) :
114  m_Workbench (workbench)
115 {
116  m_SubmitBlock = new objects::CSubmit_block();
117  if (block) {
118  m_SubmitBlock->Assign(*block);
119  }
120  m_Gen = new objects::CCit_gen();
121  if (gen) {
122  m_Gen->Assign(*gen);
123  }
124  Init();
125  Create(parent, id, caption, pos, size, style);
126 }
127 
128 
129 /*!
130  * SubmitBlockDlg creator
131  */
132 
133 bool CSubmitBlockDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
134 {
135 ////@begin CSubmitBlockDlg creation
136  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
137  wxDialog::Create( parent, id, caption, pos, size, style );
138 
139  CreateControls();
140  if (GetSizer())
141  {
142  GetSizer()->SetSizeHints(this);
143  }
144  Centre();
145 ////@end CSubmitBlockDlg creation
146  return true;
147 }
148 
149 
150 /*!
151  * CSubmitBlockDlg destructor
152  */
153 
155 {
156 ////@begin CSubmitBlockDlg destruction
157 ////@end CSubmitBlockDlg destruction
158 }
159 
160 
161 /*!
162  * Member initialisation
163  */
164 
166 {
167 ////@begin CSubmitBlockDlg member initialisation
168  m_Updatable = NULL;
169  m_Book = NULL;
171  m_BackBtn = NULL;
172  m_NextBtn = NULL;
173 ////@end CSubmitBlockDlg member initialisation
175 }
176 
177 
178 #define NCBI_AuthorCompareFields(Field,Obj1,Obj2) \
179  if (##Obj1.IsSet##Field()) { \
180  if (##Obj2.IsSet##Field()) { \
181  if (!NStr::Equal(##Obj1.Get##Field(), ##Obj2.Get##Field())) { \
182  return false; \
183  } \
184  } else if (!NStr::IsBlank(##Obj1.Get##Field())) { \
185  return false; \
186  } \
187  } else { \
188  if (##Obj2.IsSet##Field() && !NStr::IsBlank(##Obj2.Get##Field())) { \
189  return false; \
190  } \
191  }
192 
193 bool s_Name_stdsSame (const objects::CName_std& p1, const objects::CName_std& p2)
194 {
195  if (p1.IsSetLast()) {
196  if (p2.IsSetLast()) {
197  if (!NStr::Equal(p1.GetLast(), p2.GetLast())) {
198  return false;
199  }
200  } else if (!NStr::IsBlank(p1.GetLast())) {
201  return false;
202  }
203  } else {
204  if (p2.IsSetLast() && !NStr::IsBlank(p2.GetLast())) {
205  return false;
206  }
207  }
208  if (p1.IsSetFirst()) {
209  if (p2.IsSetFirst()) {
210  if (!NStr::Equal(p1.GetFirst(), p2.GetFirst())) {
211  return false;
212  }
213  } else if (!NStr::IsBlank(p1.GetFirst())) {
214  return false;
215  }
216  } else {
217  if (p2.IsSetFirst() && !NStr::IsBlank(p2.GetFirst())) {
218  return false;
219  }
220  }
221  if (p1.IsSetInitials()) {
222  if (p2.IsSetInitials()) {
223  if (!NStr::Equal(p1.GetInitials(), p2.GetInitials())) {
224  return false;
225  }
226  } else if (!NStr::IsBlank(p1.GetInitials())) {
227  return false;
228  }
229  } else {
230  if (p2.IsSetInitials() && !NStr::IsBlank(p2.GetInitials())) {
231  return false;
232  }
233  }
234  if (p1.IsSetSuffix()) {
235  if (p2.IsSetSuffix()) {
236  if (!NStr::Equal(p1.GetSuffix(), p2.GetSuffix())) {
237  return false;
238  }
239  } else if (!NStr::IsBlank(p1.GetSuffix())) {
240  return false;
241  }
242  } else {
243  if (p2.IsSetSuffix() && !NStr::IsBlank(p2.GetSuffix())) {
244  return false;
245  }
246  }
247 
248  return true;
249 }
250 
251 
252 bool s_AffilSame (const objects::CAffil& a1, const objects::CAffil& a2)
253 {
254  if (a1.IsStr() && !a2.IsStr()) {
255  return false;
256  } else if (!a1.IsStr() && a2.IsStr()) {
257  return false;
258  } else if (a1.IsStr()) {
259  return NStr::Equal(a1.GetStr(), a2.GetStr());
260  } else if (a1.IsStd() && !a2.IsStd()) {
261  return false;
262  } else if (!a1.IsStd() && a2.IsStd()) {
263  return false;
264  } else if (a1.IsStd()) {
265  const objects::CAffil::TStd& af1 = a1.GetStd();
266  const objects::CAffil::TStd& af2 = a2.GetStd();
267  string val1 = "";
268  string val2 = "";
269  if (af1.IsSetAffil()) {
270  val1 = af1.GetAffil();
271  }
272  if (af2.IsSetAffil()) {
273  val2 = af2.GetAffil();
274  }
275  if (!NStr::Equal(val1, val2)) {
276  return false;
277  }
278  val1 = "";
279  val2 = "";
280  if (af1.IsSetDiv()) {
281  val1 = af1.GetDiv();
282  }
283  if (af2.IsSetDiv()) {
284  val2 = af2.GetDiv();
285  }
286  if (!NStr::Equal(val1, val2)) {
287  return false;
288  }
289  val1 = "";
290  val2 = "";
291  if (af1.IsSetCity()) {
292  val1 = af1.GetCity();
293  }
294  if (af2.IsSetCity()) {
295  val2 = af2.GetCity();
296  }
297  if (!NStr::Equal(val1, val2)) {
298  return false;
299  }
300  val1 = "";
301  val2 = "";
302  if (af1.IsSetSub()) {
303  val1 = af1.GetSub();
304  }
305  if (af2.IsSetSub()) {
306  val2 = af2.GetSub();
307  }
308  if (!NStr::Equal(val1, val2)) {
309  return false;
310  }
311  val1 = "";
312  val2 = "";
313  if (af1.IsSetCountry()) {
314  val1 = af1.GetCountry();
315  }
316  if (af2.IsSetCountry()) {
317  val2 = af2.GetCountry();
318  }
319  if (!NStr::Equal(val1, val2)) {
320  return false;
321  }
322  val1 = "";
323  val2 = "";
324  if (af1.IsSetStreet()) {
325  val1 = af1.GetStreet();
326  }
327  if (af2.IsSetStreet()) {
328  val2 = af2.GetStreet();
329  }
330  if (!NStr::Equal(val1, val2)) {
331  return false;
332  }
333  val1 = "";
334  val2 = "";
335  if (af1.IsSetEmail()) {
336  val1 = af1.GetEmail();
337  }
338  if (af2.IsSetEmail()) {
339  val2 = af2.GetEmail();
340  }
341  if (!NStr::Equal(val1, val2)) {
342  return false;
343  }
344  val1 = "";
345  val2 = "";
346  if (af1.IsSetFax()) {
347  val1 = af1.GetFax();
348  }
349  if (af2.IsSetFax()) {
350  val2 = af2.GetFax();
351  }
352  if (!NStr::Equal(val1, val2)) {
353  return false;
354  }
355  val1 = "";
356  val2 = "";
357  if (af1.IsSetPhone()) {
358  val1 = af1.GetPhone();
359  }
360  if (af2.IsSetPhone()) {
361  val2 = af2.GetPhone();
362  }
363  if (!NStr::Equal(val1, val2)) {
364  return false;
365  }
366  val1 = "";
367  val2 = "";
368  if (af1.IsSetPostal_code()) {
369  val1 = af1.GetPostal_code();
370  }
371  if (af2.IsSetPostal_code()) {
372  val2 = af2.GetPostal_code();
373  }
374  if (!NStr::Equal(val1, val2)) {
375  return false;
376  }
377  }
378  return true;
379 }
380 
381 
382 bool s_AuthorsSame(const objects::CAuthor& a1, const objects::CAuthor& a2)
383 {
384  if (a1.IsSetName() && !a2.IsSetName()) {
385  return false;
386  } else if (!a1.IsSetName() && a2.IsSetName()) {
387  return false;
388  } else if (!a1.IsSetName()) {
389  return true;
390  } else if (a1.GetName().IsStr() && !a2.GetName().IsStr()) {
391  return false;
392  } else if (!a1.GetName().IsStr() && a2.GetName().IsStr()) {
393  return false;
394  } else if (a1.GetName().IsStr()) {
395  return NStr::Equal(a1.GetName().GetStr(), a2.GetName().GetStr());
396  } else if (a1.GetName().IsName() && !a2.GetName().IsName()) {
397  return false;
398  } else if (!a1.GetName().IsName() && a2.GetName().IsName()) {
399  return false;
400  } else if (a1.GetName().IsName()) {
401  return s_Name_stdsSame(a1.GetName().GetName(), a2.GetName().GetName());
402  } else {
403  return false;
404  }
405 }
406 
407 
408 bool s_AuthorListsSame(const objects::CAuth_list& list1, const objects::CAuth_list& list2)
409 {
410  if (list1.IsSetNames() && !list2.IsSetNames()) {
411  return false;
412  } else if (!list1.IsSetNames() && list2.IsSetNames()) {
413  return false;
414  } else if (!list1.IsSetNames()) {
415  return true;
416  } else if (list1.GetNames().Which() != list2.GetNames().Which()) {
417  return true;
418  } else if (list1.GetNames().IsStd()) {
419  objects::CAuth_list::C_Names::TStd::const_iterator it1 = list1.GetNames().GetStd().begin();
420  objects::CAuth_list::C_Names::TStd::const_iterator it2 = list2.GetNames().GetStd().begin();
421  while (it1 != list1.GetNames().GetStd().end() && it2 != list2.GetNames().GetStd().end()) {
422  if (!s_AuthorsSame(**it1, **it2)) {
423  return false;
424  }
425  ++it1;
426  ++it2;
427  }
428  if (it1 != list1.GetNames().GetStd().end() || it2 != list2.GetNames().GetStd().end()) {
429  return false;
430  }
431  return true;
432  } else if (list1.GetNames().IsStr()) {
433  objects::CAuth_list::C_Names::TStr::const_iterator it1 = list1.GetNames().GetStr().begin();
434  objects::CAuth_list::C_Names::TStr::const_iterator it2 = list2.GetNames().GetStr().begin();
435  while (it1 != list1.GetNames().GetStr().end() && it2 != list2.GetNames().GetStr().end()) {
436  if (!NStr::Equal(*it1, *it2)) {
437  return false;
438  }
439  ++it1;
440  ++it2;
441  }
442  if (it1 != list1.GetNames().GetStr().end() || it2 != list2.GetNames().GetStr().end()) {
443  return false;
444  }
445  return true;
446  } else {
447  return true;
448  }
449 }
450 
451 
452 /*!
453  * Control creation for SubmitBlockDlg
454  */
455 
457 {
458 ////@begin CSubmitBlockDlg content construction
459  // Generated by DialogBlocks, 10/06/2013 17:56:49 (unregistered)
460 
461  CSubmitBlockDlg* itemDialog1 = this;
462 
463  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
464  itemDialog1->SetSizer(itemBoxSizer2);
465 
466  m_Updatable = new wxBoxSizer(wxVERTICAL);
467  itemBoxSizer2->Add(m_Updatable, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
468 
469  m_Book = new wxNotebook( itemDialog1, ID_SUBMITBLOCKDLGLISTBOOK, wxDefaultPosition, wxSize(600, -1), wxBK_DEFAULT );
470 
471  m_Updatable->Add(m_Book, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
472 
473  m_SameAuthSizer = new wxBoxSizer(wxVERTICAL);
474  m_Updatable->Add(m_SameAuthSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
475 
476  wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
477  itemBoxSizer2->Add(itemBoxSizer6, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
478 
479  wxButton* itemButton7 = new wxButton( itemDialog1, ID_CLEAR_BTN, _("Clear"), wxDefaultPosition, wxDefaultSize, 0 );
480  itemBoxSizer6->Add(itemButton7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
481 
482  wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
483  itemBoxSizer2->Add(itemBoxSizer8, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
484 
485  m_BackBtn = new wxButton( itemDialog1, ID_BUTTON15, _("< Back"), wxDefaultPosition, wxDefaultSize, 0 );
486  m_BackBtn->Enable(false);
487  itemBoxSizer8->Add(m_BackBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
488 
489  m_NextBtn = new wxButton( itemDialog1, ID_BUTTON14, _("Next >"), wxDefaultPosition, wxDefaultSize, 0 );
490  itemBoxSizer8->Add(m_NextBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
491 
492  wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxHORIZONTAL);
493  itemBoxSizer2->Add(itemBoxSizer11, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
494 
495  wxButton* itemButton12 = new wxButton( itemDialog1, ID_IMPORT_BTN, _("Import Template"), wxDefaultPosition, wxDefaultSize, 0 );
496  itemBoxSizer11->Add(itemButton12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
497 
498  wxButton* itemButton13 = new wxButton( itemDialog1, ID_EXPORT_BTN, _("Export Template"), wxDefaultPosition, wxDefaultSize, 0 );
499  itemBoxSizer11->Add(itemButton13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
500 
501 ////@end CSubmitBlockDlg content construction
502 
503  x_BuildPages();
504 }
505 
506 
508 {
510  m_Book->AddPage(m_ReleaseDatePanel, wxT("Release Date"));
511 
512  wxPanel* contact_panel = new wxPanel(m_Book);
513  wxSizer* contact_sizer = new wxBoxSizer(wxVERTICAL);
514  contact_panel->SetSizer(contact_sizer);
515  m_ContactPanel = new CContactPanel (contact_panel, m_SubmitBlock->SetContact());
516  contact_sizer->Add(m_ContactPanel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
517  wxSizer* alt_sizer = new wxBoxSizer(wxHORIZONTAL);
518  contact_sizer->Add(alt_sizer, 0, wxALIGN_LEFT|wxALL, 5);
519  wxStaticText* label = new wxStaticText(contact_panel, wxID_ANY, _("Alternate Email Address"));
520  alt_sizer->Add(label, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
521  m_AlternateEmail = new wxTextCtrl(contact_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(150, -1));
522  alt_sizer->Add(m_AlternateEmail, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
523 
524  m_Book->AddPage(contact_panel, wxT("Contact"));
525 
526  objects::CAuth_list& auth_list = m_SubmitBlock->SetCit().SetAuthors();
527  m_SequenceAuthorsPanel = new CAuthorNamesPanel(m_Book, auth_list, false);
528  m_Book->AddPage(m_SequenceAuthorsPanel, wxT("Sequence Authors"));
529  m_AffilPanel = new CAuthorAffiliationPanel(m_Book, auth_list.SetAffil());
530  m_Book->AddPage (m_AffilPanel, wxT("Authors Affiliation"));
531 
532  m_UnpublishedPanel = new CUnpublishedPanel(m_Book, m_Gen->IsSetTitle() ? m_Gen->GetTitle() : kEmptyStr);
533  m_Book->AddPage(m_UnpublishedPanel, wxT("Manuscript Title"));
534 
535  objects::CAuth_list& man_auth_list = m_Gen->SetAuthors();
536  bool authors_same = s_AuthorListsSame(auth_list, man_auth_list);
537 
538  m_AuthorsSame = new wxCheckBox (this, ID_SUBMITBLOCKDLG_SAME_AUTHORS, _("Manuscript authors are same as sequence authors"));
539  m_SameAuthSizer->Add(m_AuthorsSame, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
540  m_AuthorsSame->SetValue(authors_same);
541  m_CopySeqAuthToManAuth = new wxButton( this, ID_COPY_SEQ_AUTH_TO_MAN_AUTH, _("Copy Sequence Authors to Manuscript Authors"), wxDefaultPosition, wxDefaultSize, 0 );
542  m_SameAuthSizer->Add(m_CopySeqAuthToManAuth, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
544  if (!authors_same) {
545  m_ManAuthorsPanel = new CAuthorNamesPanel(m_Book, man_auth_list, false);
546  m_Book->AddPage (m_ManAuthorsPanel, wxT("Manuscript Authors"));
547  }
548 
553  if (m_ManAuthorsPanel) {
555  }
556 }
557 
558 
559 /*!
560  * Should we show tooltips?
561  */
562 
564 {
565  return true;
566 }
567 
568 /*!
569  * Get bitmap resources
570  */
571 
572 wxBitmap CSubmitBlockDlg::GetBitmapResource( const wxString& name )
573 {
574  // Bitmap retrieval
575 ////@begin CSubmitBlockDlg bitmap retrieval
576  wxUnusedVar(name);
577  return wxNullBitmap;
578 ////@end CSubmitBlockDlg bitmap retrieval
579 }
580 
581 /*!
582  * Get icon resources
583  */
584 
585 wxIcon CSubmitBlockDlg::GetIconResource( const wxString& name )
586 {
587  // Icon retrieval
588 ////@begin CSubmitBlockDlg icon retrieval
589  wxUnusedVar(name);
590  return wxNullIcon;
591 ////@end CSubmitBlockDlg icon retrieval
592 }
593 
594 
595 static bool s_NamesNotSet (const objects::CAuth_list::TNames& names)
596 {
598  || (names.IsStr() && names.GetStr().empty())
599  || (names.IsStd() && names.GetStd().empty())
600  || (names.IsMl() && names.GetMl().empty()))
601  {
602  return true;
603  }
604  else
605  {
606  return false;
607  }
608 }
609 
610 
611 bool s_AuthorNameBlank (const objects::CAuthor& auth)
612 {
613  bool is_blank = false;
614  if (!auth.IsSetName())
615  {
616  is_blank = true;
617  }
618  else if (auth.GetName().IsStr())
619  {
620  if (NStr::IsBlank(auth.GetName().GetStr()))
621  {
622  is_blank = true;
623  }
624  }
625  else if (auth.GetName().IsName())
626  {
627  const objects::CName_std& name = auth.GetName().GetName();
628  if ((!name.IsSetLast() || NStr::IsBlank(name.GetLast()))
629  && (!name.IsSetFirst() || NStr::IsBlank(name.GetFirst()))
630  && (!name.IsSetInitials() || NStr::IsBlank(name.GetInitials()))
631  && (!name.IsSetSuffix() || NStr::IsBlank(name.GetSuffix())))
632  {
633  is_blank = true;
634  }
635  }
636  return is_blank;
637 }
638 
639 
641 {
642  bool rval = false;
643  objects::CAuth_list::TNames& names = m_SubmitBlock->SetCit().SetAuthors().SetNames();
644  objects::CContact_info& contact = m_SubmitBlock->SetContact();
645  if (s_NamesNotSet(names) || (names.IsStr() && names.GetStr().size() == 1 && NStr::IsBlank(names.GetStr().front())))
646  {
647  // if no authors, but contact filled in, add contact author
648  if (!s_AuthorNameBlank(contact.SetContact()))
649  {
650  CRef<objects::CAuthor> new_auth(new objects::CAuthor());
651  new_auth->Assign (contact.GetContact());
652  names.SetStd().push_back(new_auth);
653  rval = true;
654  }
655  }
656  else
657  {
658  // if contact is blank, copy first author
659  if (s_AuthorNameBlank(contact.SetContact()) && names.IsStd())
660  {
661  contact.SetContact().Assign(*names.GetStd().front());
662  rval = true;
663  }
664  }
665  return rval;
666 }
667 
668 
669 bool s_AuthListEmpty (const objects::CAuth_list::TNames& names)
670 {
671  bool any = false;
672  if (s_NamesNotSet(names)) {
673  return true;
674  } else if (names.IsStr()) {
675  ITERATE (objects::CAuth_list::TNames::TStr, it, names.GetStr()) {
676  if (!NStr::IsBlank(*it)) {
677  any = true;
678  break;
679  }
680  }
681  } else if (names.IsStd()) {
682  ITERATE (objects::CAuth_list::TNames::TStd, it, names.GetStd()) {
683  if (!s_AuthorNameBlank(**it)) {
684  any = true;
685  break;
686  }
687  }
688  }
689  return !any;
690 }
691 
692 
693 const string kAllSubmitMissing = "Sequence authors, affiliation, and contact information is missing!";
694 const string kSequenceAuthorsMissing = "You must provide sequence authors.";
695 const string kAffilMissing = "You must provide an affiliation.";
696 const string kContactMissing = "You must provide a contact name.";
697 const string kEmailMissing = "You must provide an email address.";
698 const string kCityMissing = "You must provide a city in affiliation.";
699 const string kCountryMissing = "You must provide a country in affiliation.";
700 
701 const string kAllCitGenMissing = "Manuscript title, authors, and affiliation is missing!";
702 const string kTitleMissing = "You must provide a manuscript title.";
703 const string kManuscriptAuthorsMissing = "You must provide authors.";
704 const string kInvalidEmail = "Email address is invalid.";
705 
706 
708 {
709  string err = "";
710  bool missing_authors = true;
711  bool missing_affil = true;
712  bool missing_contact = true;
713  bool missing_email = true;
714  bool missing_city = true;
715  bool missing_country = true;
716 
717  if (block && block->IsSetCit()) {
718  if (block->GetCit().IsSetAuthors()) {
719  const objects::CAuth_list& auth_list = block->GetCit().GetAuthors();
720  if (auth_list.IsSetNames()
721  && !s_AuthListEmpty(auth_list.GetNames())) {
722  missing_authors = false;
723  }
724  if (auth_list.IsSetAffil()) {
725  if (((auth_list.GetAffil().IsStr() && !NStr::IsBlank(auth_list.GetAffil().GetStr()))
726  || (auth_list.GetAffil().IsStd() && auth_list.GetAffil().GetStd().IsSetAffil()
727  && !NStr::IsBlank(auth_list.GetAffil().GetStd().GetAffil())))) {
728  missing_affil = false;
729  }
730  if (auth_list.GetAffil().IsStd()) {
731  if (auth_list.GetAffil().GetStd().IsSetCity() && !NStr::IsBlank(auth_list.GetAffil().GetStd().GetCity())) {
732  missing_city = false;
733  }
734  if (auth_list.GetAffil().GetStd().IsSetCountry() && !NStr::IsBlank(auth_list.GetAffil().GetStd().GetCountry())) {
735  missing_country = false;
736  }
737  }
738  }
739  }
740  }
741  if (block && block->IsSetContact()) {
742  if (block->GetContact().IsSetContact()) {
743  missing_contact = false;
744  }
745  if (block->GetContact().IsSetEmail()) {
746  missing_email = false;
747  }
748  }
749 
750  if (missing_authors && missing_affil && missing_contact && missing_email) {
751  err = kAllSubmitMissing;
752  } else if (missing_authors) {
754  } else if (missing_affil) {
755  err = kAffilMissing;
756  } else if (missing_contact) {
757  err = kContactMissing;
758  } else if (missing_email) {
759  err = kEmailMissing;
760  } else if (missing_city) {
761  err = kCityMissing;
762  } else if (missing_country) {
763  err = kCountryMissing;
764  }
765 
766  if (NStr::IsBlank(err)) {
767  if (block->IsSetHup() && block->IsSetReldate()) {
768  try {
769  CTime release_date = block->GetReldate().AsCTime();
770  if (release_date < CTime(CTime::eCurrent)) {
771  err = "Release date is in the past.";
772  }
773  } catch (exception &) {
774  err = "Release date is invalid";
775  }
776  }
777  }
778  if (NStr::IsBlank(err)) {
779  if (!IsValidEmail(block->GetContact().GetEmail())) {
780  err = kInvalidEmail;
781  }
782  }
783 
784  return err;
785 }
786 
787 
788 enum
789 {
795  ePageManAuth = 5
796 };
797 
798 
800 {
801  if (NStr::IsBlank(errors)) {
802  return;
803  }
804  if (NStr::FindNoCase(errors, kAllSubmitMissing) != string::npos) {
805  m_Book->SetSelection(ePageContact);
806  } else if (NStr::FindNoCase(errors, kSequenceAuthorsMissing) != string::npos) {
807  m_Book->SetSelection(ePageSequenceAuth);
808  } else if (NStr::FindNoCase(errors, kAffilMissing) != string::npos
809  || NStr::FindNoCase(errors, kCityMissing) != string::npos
810  || NStr::FindNoCase(errors, kCountryMissing) != string::npos) {
811  m_Book->SetSelection(ePageAffil);
812  } else if (NStr::FindNoCase(errors, kContactMissing) != string::npos) {
813  m_Book->SetSelection(ePageContact);
814  } else if (NStr::FindNoCase(errors, "release date") != string::npos) {
815  m_Book->SetSelection(ePageDate);
816  } else if (NStr::FindNoCase(errors, kAllCitGenMissing) != string::npos) {
817  m_Book->SetSelection(ePageTitle);
818  } else if (NStr::FindNoCase(errors, kTitleMissing) != string::npos) {
819  m_Book->SetSelection(ePageTitle);
820  } else if (NStr::FindNoCase(errors, kManuscriptAuthorsMissing) != string::npos) {
821  if (m_Book->GetPageCount() == 6) {
822  m_Book->SetSelection(ePageManAuth);
823  } else {
824  m_Book->SetSelection(ePageSequenceAuth);
825  }
826  } else if (NStr::FindNoCase(errors, kEmailMissing) != string::npos
827  || NStr::FindNoCase(errors, kInvalidEmail) != string::npos
828  || NStr::FindNoCase(errors, "email") != string::npos) {
829  m_Book->SetSelection(ePageContact);
830  }
831 }
832 
833 
835 {
837 }
838 
839 
841 {
844  objects::CAuth_list& auth_list = m_SubmitBlock->SetCit().SetAuthors();
849  if (affil)
850  auth_list.SetAffil(*affil);
851  else
852  auth_list.ResetAffil();
853 
854 
855  if (x_CopyAuthors()) {
860  m_SequenceAuthorsPanel->PopulateAuthors(m_SubmitBlock->SetCit().SetAuthors());
861  }
862 
863  CRef<objects::CSubmit_block> block(new objects::CSubmit_block());
864  block->Assign(*m_SubmitBlock);
865  block->SetTool("Genome Workbench Submission Preparation Tool " + kSubmissionPreparationToolVersion);
866  objects::CAuth_list::TNames& names = block->SetCit().SetAuthors().SetNames();
867  if (s_NamesNotSet(names)) {
868  names.SetStr().push_back(" ");
869  }
870  if (!block->GetCit().GetAuthors().IsSetAffil()) {
871  block->SetCit().SetAuthors().SetAffil().SetStd().SetAffil(" ");
872  }
873  block->SetContact().SetContact().SetAffil().Assign(block->GetCit().GetAuthors().GetAffil());
874  if (s_AuthorNameBlank(block->SetContact().SetContact())) {
875  block->SetContact().SetContact().SetName().SetStr(" ");
876  }
877 
878  // set submit date. use today as default value
879  if (!block->GetCit().IsSetDate()) {
880  CRef<objects::CDate> submit_date(new objects::CDate(CTime(CTime::eCurrent), objects::CDate::ePrecision_day));
881  block->SetCit().SetDate(*submit_date);
882  }
883 
884  return block;
885 }
886 
887 
889 {
891 
892  string err = m_ReleaseDatePanel->GetProblems();
893  if (NStr::IsBlank(err)) {
894  err = GetBlockProblems(block);
895  }
896  if (!NStr::IsBlank(err)) {
898  return empty;
899  }
900 
901  return block;
902 }
903 
904 
906 {
907  string title = m_UnpublishedPanel->GetTitle();
908  if (title.empty())
909  m_Gen->ResetTitle();
910  else
911  m_Gen->SetTitle(title);
912 
913  if (m_ManAuthorsPanel) {
915  m_ManAuthorsPanel->PopulateAuthors(m_Gen->SetAuthors());
916  } else {
919  }
920  CAuth_list& auth_list = m_SubmitBlock->SetCit().SetAuthors();
923  if (affil)
924  {
925  auth_list.SetAffil(*affil);
926  m_Gen->SetAuthors().SetAffil(*affil);
927  }
928  else
929  {
930  auth_list.ResetAffil();
931  m_Gen->SetAuthors().ResetAffil();
932  }
933 
934 
935  m_Gen->SetCit("Unpublished");
936 
937  // set submit date. use today as default value
938  if (!m_Gen->IsSetDate()) {
939  CRef<objects::CDate> submit_date(new objects::CDate(CTime(CTime::eCurrent), objects::CDate::ePrecision_day));
940  m_Gen->SetDate(*submit_date);
941  }
942 
943  CRef<objects::CCit_gen> gen(new objects::CCit_gen());
944  gen->Assign(*m_Gen);
945  return gen;
946 }
947 
948 
950 {
951  string err = "";
952  bool missing_authors = true;
953  bool missing_affil = true;
954  bool missing_title = true;
955 
956  if (gen) {
957  if (gen->IsSetTitle() && !NStr::IsBlank(gen->GetTitle())) {
958  missing_title = false;
959  }
960  if (gen->IsSetAuthors()) {
961  const objects::CAuth_list& auth_list = gen->GetAuthors();
962  if (auth_list.IsSetNames()
963  && !s_AuthListEmpty(auth_list.GetNames())) {
964  missing_authors = false;
965  }
966  if (auth_list.IsSetAffil()
967  && ((auth_list.GetAffil().IsStr() && !NStr::IsBlank(auth_list.GetAffil().GetStr()))
968  || (auth_list.GetAffil().IsStd() && auth_list.GetAffil().GetStd().IsSetAffil()
969  && !NStr::IsBlank(auth_list.GetAffil().GetStd().GetAffil())))) {
970  missing_affil = false;
971  }
972  }
973  }
974 
975  if (missing_title && missing_authors && missing_affil) {
976  err = kAllCitGenMissing;
977  } else if (missing_title) {
978  err = kTitleMissing ;
979  } else if (missing_authors) {
981  } else if (missing_affil) {
982  err = kAffilMissing;
983  }
984 
985  return err;
986 }
987 
988 
990 {
992 
993  string err = GetCitGenProblems(gen);
994  if (!NStr::IsBlank(err)) {
996  return empty;
997  }
998 
999  return gen;
1000 }
1001 
1002 
1004 {
1005  m_AlternateEmail->SetValue(ToWxString(alt_email));
1006 }
1007 
1008 
1010 {
1011  string alt_email = ToAsciiStdString(m_AlternateEmail->GetValue());
1012  return alt_email;
1013 }
1014 
1015 
1017 {
1020 
1021  string err = m_ReleaseDatePanel->GetProblems();
1022  string block_err = GetBlockProblems(block);
1023  if (!NStr::IsBlank(block_err)) {
1024  if (!NStr::IsBlank(err)) {
1025  err += " ";
1026  }
1027  err += block_err;
1028  }
1029  string cit_gen_err = GetCitGenProblems(gen);
1030  if (!NStr::IsBlank(cit_gen_err)) {
1031  if (!NStr::IsBlank(err)) {
1032  err += " ";
1033  }
1034  err += cit_gen_err;
1035  }
1036 
1037  return err;
1038 }
1039 
1040 
1041 /*!
1042  * wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED event handler for ID_SUBMITBLOCKDLGLISTBOOK
1043  */
1044 
1045 void CSubmitBlockDlg::OnSubmitblockdlgPageChanged( wxNotebookEvent& event )
1046 {
1047  if ( this->wxWindow::IsShown() ) // Added by Igor, otherwise Crashes on Linux - see Pitfals at http://wiki.wxwidgets.org/WxNoteBook
1048  {
1051  m_SequenceAuthorsPanel->PopulateAuthors(m_SubmitBlock->SetCit().SetAuthors());
1052  if (x_CopyAuthors()) {
1055  }
1056  int curr = m_Book->GetSelection();
1057  if (curr == 0) {
1058  m_BackBtn->Enable(false);
1059  } else {
1060  m_BackBtn->Enable(true);
1061  }
1062  if (curr == m_Book->GetPageCount() - 1) {
1063  m_NextBtn->Enable(false);
1064  } else {
1065  m_NextBtn->Enable(true);
1066  }
1067  }
1068 }
1069 
1070 
1071 /*!
1072  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON15
1073  */
1074 
1075 void CSubmitBlockDlg::OnBackBtnClick( wxCommandEvent& event )
1076 {
1077  int curr = m_Book->GetSelection();
1078  if (curr > 0) {
1079  m_Book->SetSelection(curr - 1);
1080  }
1081 }
1082 
1083 
1084 /*!
1085  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON14
1086  */
1087 
1088 void CSubmitBlockDlg::OnNextBtnClick( wxCommandEvent& event )
1089 {
1090  int curr = m_Book->GetSelection();
1091  if (curr < m_Book->GetPageCount() - 1) {
1092  m_Book->SetSelection(curr + 1);
1093  }
1094 }
1095 
1096 
1097 void CSubmitBlockDlg::OnSeparateAuthorsClick( wxCommandEvent& event )
1098 {
1099  if (m_AuthorsSame->GetValue()) {
1100  if (m_ManAuthorsPanel) {
1101  m_Book->RemovePage(m_Book->GetPageCount() - 1);
1103  }
1104  m_CopySeqAuthToManAuth->Enable(false);
1105  } else {
1106  objects::CAuth_list& man_auth_list = m_Gen->SetAuthors();
1107  if (m_ManAuthorsPanel) {
1108  m_ManAuthorsPanel->SetAuthors(man_auth_list);
1109  } else {
1110  m_ManAuthorsPanel = new CAuthorNamesPanel(m_Book, man_auth_list, false);
1111  m_Book->AddPage (m_ManAuthorsPanel, wxT("Manuscript Authors"));
1113  }
1114  m_CopySeqAuthToManAuth->Enable(true);
1115  }
1116  Refresh();
1117 }
1118 
1119 
1121 {
1122  objects::CAuth_list& man_auth_list = m_Gen->SetAuthors();
1124  m_SequenceAuthorsPanel->PopulateAuthors(man_auth_list);
1125  m_ManAuthorsPanel->SetAuthors(man_auth_list);
1126 }
1127 
1128 
1129 /*!
1130  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_IMPORT_BTN
1131  */
1132 
1133 void CSubmitBlockDlg::OnImportBtnClick( wxCommandEvent& event )
1134 {
1135  CRef<CFileLoadWizard> fileManager(new CFileLoadWizard());
1136  vector<string> format_ids;
1137  format_ids.push_back("file_loader_asn");
1138  fileManager->LoadFormats(format_ids);
1139 
1140  vector<CIRef<IOpenObjectsPanelClient> > loadManagers;
1141  loadManagers.push_back(CIRef<IOpenObjectsPanelClient>(fileManager.GetPointer()));
1142 
1143  COpenObjectsDlg dlg(NULL);
1144  dlg.SetSize(710, 480);
1145 
1146  dlg.SetRegistryPath("Dialogs.Edit.OpenTable");
1147  dlg.SetManagers(loadManagers);
1148 
1149  if (dlg.ShowModal() == wxID_OK) {
1150  CIRef<IObjectLoader> object_loader(dlg.GetObjectLoader());
1151  if (!object_loader) {
1152  wxMessageBox(wxT("Failed to get object loader"), wxT("Error"),
1153  wxOK | wxICON_ERROR);
1154  } else {
1155  IExecuteUnit* execute_unit = dynamic_cast<IExecuteUnit*>(object_loader.GetPointer());
1156  if (execute_unit) {
1157  if (!execute_unit->PreExecute())
1158  return;
1159 
1160  if (!GUI_AsyncExecUnit(*execute_unit, wxT("Reading file(s)...")))
1161  return; // Canceled
1162 
1163  if (!execute_unit->PostExecute())
1164  return;
1165  }
1166  const IObjectLoader::TObjects& objects = object_loader->GetObjects();
1167  bool any_unrecognized = false;
1168  bool any_change = false;
1169  string alt_email = "";
1171  const CObject& ptr = obj_it->GetObject();
1172  const objects::CSubmit_block* block = dynamic_cast<const objects::CSubmit_block*>(&ptr);
1173  if (block) {
1174  if (!m_SubmitBlock) {
1175  m_SubmitBlock.Reset(new objects::CSubmit_block());
1176  }
1177  m_SubmitBlock->Assign(*block);
1178  any_change = true;
1179  } else {
1180  const objects::CSeqdesc* desc = dynamic_cast<const objects::CSeqdesc*>(&ptr);
1181  if (desc) {
1182  if (desc->IsPub() && desc->GetPub().IsSetPub() && desc->GetPub().GetPub().IsSet()
1183  && desc->GetPub().GetPub().Get().size() == 1
1184  && desc->GetPub().GetPub().Get().front()->IsGen()) {
1185  if (!m_Gen) {
1186  m_Gen.Reset(new objects::CCit_gen());
1187  }
1188  m_Gen->Assign(desc->GetPub().GetPub().Get().front()->GetGen());
1189  any_change = true;
1190  } else if (desc->IsUser() && IsBankItSubmissionObject(desc->GetUser())) {
1191  alt_email = GetDescAlternateEmailAddress(*desc);
1192  any_change = true;
1193  } else {
1194  any_unrecognized = true;
1195  }
1196  } else {
1197  any_unrecognized = true;
1198  }
1199  }
1200  }
1201  if (any_unrecognized) {
1202  wxMessageBox(wxT("Warning: Unrecognized objects in template file"), wxT("Error"),
1203  wxOK | wxICON_ERROR);
1204  }
1205  if (any_change) {
1206  while (m_Updatable->GetItemCount() > 0) {
1207  int pos = 0;
1208  m_Updatable->GetItem(pos)->DeleteWindows();
1209  m_Updatable->Remove(pos);
1210  }
1211  m_Book = NULL;
1212 
1217  m_AffilPanel = NULL;
1218  m_ContactPanel = NULL;
1221  m_AuthorsSame = NULL;
1222  m_AffilsSame = NULL;
1223 
1224  m_Book = new wxNotebook( this, ID_SUBMITBLOCKDLGLISTBOOK, wxDefaultPosition, wxDefaultSize, wxBK_DEFAULT );
1225  m_Updatable->Add(m_Book, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
1226  m_SameAuthSizer = new wxBoxSizer(wxVERTICAL);
1227  m_Updatable->Add(m_SameAuthSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
1228 
1229  x_BuildPages();
1230  m_AlternateEmail->SetValue(ToWxString(alt_email));
1231  Layout();
1232  Refresh();
1233 
1235  if (block && block->IsSetHup() && block->IsSetReldate()) {
1236  CTime release_date = block->GetReldate().AsCTime();
1237  if (release_date < CTime(CTime::eCurrent)) {
1238  wxMessageBox(wxT("Release date is in the past."), wxT("Error"),
1239  wxOK | wxICON_ERROR);
1240  }
1241  }
1242 
1243  }
1244  }
1245  }
1246 }
1247 
1248 
1249 /*!
1250  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_EXPORT_BTN
1251  */
1252 
1253 void CSubmitBlockDlg::OnExportBtnClick( wxCommandEvent& event )
1254 {
1255  string errors = GetErrors();
1256  if (!NStr::IsBlank(errors)) {
1257  wxString wxs(errors);
1258  wxMessageBox(wxT("Cannot export invalid template: " + wxs), wxT("Error"),
1259  wxOK | wxICON_ERROR);
1260  return;
1261  }
1262 
1263  wxString extensions = GetAsnSqnExtensions();
1264  wxFileDialog asn_save_file(this, wxT("Select a file"), m_SaveFileDir, m_SaveFileName,
1265  //CFileExtensions::GetDialogFilter(CFileExtensions::kASN) + wxT("|") +
1266  wxT("ASN.1 files (")+extensions + wxT(")|") + extensions + wxT("|") +
1268  wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
1269 
1270  if (asn_save_file.ShowModal() == wxID_OK)
1271  {
1272  wxString path = asn_save_file.GetPath();
1273  wxString name = asn_save_file.GetFilename();
1274 
1275  name.Trim(false);
1276  name.Trim(true);
1277 
1278  if (name.IsEmpty())
1279  {
1280  wxMessageBox(wxT("Please, select file name"), wxT("Error"),
1281  wxOK | wxICON_ERROR, this);
1282  return;
1283  }
1284 
1285  if (name.Find(wxUniChar('.')) == wxNOT_FOUND)
1286  {
1287  path += wxT(".sqn");
1288  name += wxT(".sqn");
1289  }
1290 
1291  ios::openmode mode = ios::out;
1292  CNcbiOfstream os(path.fn_str(), mode);
1293  if (!os)
1294  {
1295  wxMessageBox(wxT("Cannot open file ")+name, wxT("Error"),
1296  wxOK | wxICON_ERROR, this);
1297  return;
1298  }
1299  os << MSerial_AsnText;
1300 
1302  const CSerialObject* so = block.GetPointer();
1303 
1304  if (so)
1305  os << *so;
1306 
1308  if (gen) {
1309  CRef<objects::CPub> pub(new objects::CPub());
1310  pub->SetGen().Assign(*gen);
1311  CRef<objects::CSeqdesc> desc(new objects::CSeqdesc());
1312  desc->SetPub().SetPub().Set().push_back(pub);
1313  so = desc.GetPointer();
1314  os << *so;
1315  }
1316 
1317  string alt_email = ToAsciiStdString(m_AlternateEmail->GetValue());
1318  if (!NStr::IsBlank(alt_email)) {
1320  SetUserAlternateEmailAddress(*u, alt_email);
1321  CRef<objects::CSeqdesc> desc(new objects::CSeqdesc());
1322  desc->SetUser().Assign(*u);
1323  so = desc.GetPointer();
1324  os << *so;
1325  }
1326 
1327  m_SaveFileDir = asn_save_file.GetDirectory();
1328  m_SaveFileName = name;
1329  }
1330 }
1331 
1332 
1333 /*!
1334  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CLEAR_BTN
1335  */
1336 
1337 void CSubmitBlockDlg::OnClearBtnClick( wxCommandEvent& event )
1338 {
1339  // clear currently shown page
1340  switch (m_Book->GetSelection()) {
1341  case ePageDate:
1342  m_SubmitBlock->ResetReldate();
1345  break;
1346  case ePageContact:
1347  m_SubmitBlock->SetContact().Reset();
1349  m_AlternateEmail->SetValue(wxEmptyString);
1350  break;
1351  case ePageSequenceAuth:
1352  m_SubmitBlock->SetCit().SetAuthors().ResetNames();
1353  m_SequenceAuthorsPanel->SetAuthors(m_SubmitBlock->SetCit().SetAuthors());
1354  break;
1355  case ePageAffil:
1356  m_SubmitBlock->SetCit().SetAuthors().SetAffil().Reset();
1359  break;
1360  case ePageTitle:
1361  m_Gen->ResetTitle();
1363  break;
1364  case ePageManAuth:
1365  m_Gen->ResetAuthors();
1366  m_ManAuthorsPanel->SetAuthors(m_Gen->SetAuthors());
1367  break;
1368  }
1369 }
1370 
1371 
1373 
1374 
User-defined methods of the data storage class.
EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX, CAdjustFeaturesForGaps::OnKnownUnknownSelected) EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX1
bool GUI_AsyncExecUnit(IExecuteUnit &exec_unit, const wxString &msg)
Definition: async_call.cpp:53
@Auth_list.hpp User-defined methods of the data storage class.
Definition: Auth_list.hpp:57
void SetAffil(CRef< objects::CAffil > affil)
CRef< objects::CAffil > GetAffil()
void PopulateAuthors(objects::CAuth_list &auth_list)
virtual bool TransferDataToWindow()
virtual bool TransferDataFromWindow()
virtual void SetAuthors(const objects::CAuth_list &auth_list)
virtual bool TransferDataFromWindow()
virtual bool TransferDataToWindow()
virtual void SetRegistryPath(const string &path)
Definition: dialog.cpp:59
static wxString GetDialogFilter(EFileType fileType)
CObject –.
Definition: ncbiobj.hpp:180
IObjectLoader * GetObjectLoader()
void SetManagers(vector< CIRef< IOpenObjectsPanelClient > > &managers)
virtual bool TransferDataFromWindow()
virtual bool TransferDataToWindow()
Base class for all serializable objects.
Definition: serialbase.hpp:150
wxNotebook * m_Book
static string GetCitGenProblems(CRef< objects::CCit_gen > gen)
wxCheckBox * m_AuthorsSame
CRef< objects::CCit_gen > x_CreateCitGen()
string GetAlternateEmailAddress()
CUnpublishedPanel * m_UnpublishedPanel
CAuthorAffiliationPanel * m_AffilPanel
CRef< objects::CSubmit_block > GetSubmitBlock()
void OnNextBtnClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON14
static string GetBlockProblems(CRef< objects::CSubmit_block > block)
bool Create(wxWindow *parent, wxWindowID id=10015, const wxString &caption=_("Submission Information"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
void OnSeparateAuthorsClick(wxCommandEvent &event)
wxCheckBox * m_AffilsSame
CRef< objects::CSubmit_block > m_SubmitBlock
CRef< objects::CCit_gen > m_Gen
wxBoxSizer * m_SameAuthSizer
~CSubmitBlockDlg()
Destructor.
wxButton * m_BackBtn
CRef< objects::CCit_gen > GetCitGen()
void OnCopySeqAuthToManAuthClick(wxCommandEvent &event)
CReleaseDatePanel * m_ReleaseDatePanel
void Init()
Initialises member variables.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxButton * m_NextBtn
wxTextCtrl * m_AlternateEmail
void SetAlternateEmailAddress(string alt_email)
CAuthorNamesPanel * m_SequenceAuthorsPanel
void OnClearBtnClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CLEAR_BTN
CSubmitBlockDlg()
Constructors.
void OnBackBtnClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON15
wxButton * m_CopySeqAuthToManAuth
void OnExportBtnClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_EXPORT_BTN
void SetPageForError(string errors)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
CAuthorNamesPanel * m_ManAuthorsPanel
void UnselectReleaseDateChoice()
void CreateControls()
Creates the controls and sizers.
CContactPanel * m_ContactPanel
wxBoxSizer * m_Updatable
void OnSubmitblockdlgPageChanged(wxNotebookEvent &event)
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED event handler for ID_SUBMITBLOCKDLGLISTBOOK
static bool ShowToolTips()
Should we show tooltips?
void OnImportBtnClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_IMPORT_BTN
CRef< objects::CSubmit_block > x_CreateBlock()
CTime –.
Definition: ncbitime.hpp:296
void SetTitle(const string &title)
virtual bool PreExecute()=0
virtual bool PostExecute()=0
vector< SObject > TObjects
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
#define _(proto)
Definition: ct_nlmzip_i.h:78
#define ID_BUTTON14
#define ID_BUTTON15
std::ofstream out("events_result.xml")
main entry point for tests
static const struct name_t names[]
static void Init(void)
Definition: cursor6.c:76
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NULL
Definition: ncbistd.hpp:225
#define MSerial_AsnText
I/O stream manipulators –.
Definition: serialbase.hpp:696
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
Definition: ncbistre.hpp:500
#define kEmptyStr
Definition: ncbistr.hpp:123
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
Definition: ncbistr.cpp:2993
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
Definition: ncbistr.cpp:106
static bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
Definition: ncbistr.hpp:5384
@ eCurrent
Use current time. See also CCurrentTime.
Definition: ncbitime.hpp:300
static const char label[]
void SetAffil(TAffil &value)
Assign a value to Affil data member.
Definition: Auth_list_.cpp:160
void ResetAffil(void)
Reset Affil data member.
Definition: Auth_list_.cpp:155
@ e_not_set
END_EVENT_TABLE()
#define wxT(x)
Definition: muParser.cpp:41
constexpr bool empty(list< Ts... >) noexcept
mdb_mode_t mode
Definition: lmdb++.h:38
const struct ncbi::grid::netcache::search::fields::SIZE size
static static static wxID_ANY
bool s_AuthorListsSame(const objects::CAuth_list &list1, const objects::CAuth_list &list2)
const string kAffilMissing
const string kTitleMissing
const string kInvalidEmail
const string kAllCitGenMissing
const string kSequenceAuthorsMissing
@ ePageSequenceAuth
@ ePageAffil
@ ePageManAuth
@ ePageDate
@ ePageTitle
@ ePageContact
bool s_Name_stdsSame(const objects::CName_std &p1, const objects::CName_std &p2)
const string kEmailMissing
bool s_AuthListEmpty(const objects::CAuth_list::TNames &names)
const string kManuscriptAuthorsMissing
const string kContactMissing
static bool s_NamesNotSet(const objects::CAuth_list::TNames &names)
const string kCityMissing
const string kAllSubmitMissing
bool s_AffilSame(const objects::CAffil &a1, const objects::CAffil &a2)
bool s_AuthorsSame(const objects::CAuthor &a1, const objects::CAuthor &a2)
bool s_AuthorNameBlank(const objects::CAuthor &auth)
const string kCountryMissing
#define ID_SUBMITBLOCKDLG_SAME_AUTHORS
#define ID_CLEAR_BTN
#define ID_IMPORT_BTN
#define ID_COPY_SEQ_AUTH_TO_MAN_AUTH
#define ID_EXPORT_BTN
#define ID_SUBMITBLOCKDLGLISTBOOK
CRef< objects::CUser_object > MakeBankItSubmissionObject()
bool IsValidEmail(string email)
bool IsBankItSubmissionObject(const objects::CUser_object &user)
string GetDescAlternateEmailAddress(const objects::CSeqdesc &desc)
const string kSubmissionPreparationToolVersion
wxString GetAsnSqnExtensions()
void SetUserAlternateEmailAddress(objects::CUser_object &u, string alt_email)
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
string ToAsciiStdString(const wxString &input)
Definition: wx_utils.hpp:166
Modified on Sat Jun 15 11:48:50 2024 by modify_doxy.py rev. 669887