Tellico – collection manager for books, videos, music
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

158 lines
6.3KB

  1. /***************************************************************************
  2. copyright : (C) 2003-2006 by Robby Stephenson
  3. email : robby@periapsis.org
  4. ***************************************************************************/
  5. /***************************************************************************
  6. * *
  7. * This program is free software; you can redistribute it and/or modify *
  8. * it under the terms of version 2 of the GNU General Public License as *
  9. * published by the Free Software Foundation; *
  10. * *
  11. ***************************************************************************/
  12. #include "comicbookcollection.h"
  13. #include <tdelocale.h>
  14. namespace {
  15. static const char* comic_general = I18N_NOOP("General");
  16. static const char* comic_publishing = I18N_NOOP("Publishing");
  17. static const char* comic_classification = I18N_NOOP("Classification");
  18. static const char* comic_personal = I18N_NOOP("Personal");
  19. }
  20. using Tellico::Data::ComicBookCollection;
  21. ComicBookCollection::ComicBookCollection(bool addFields_, const TQString& title_ /*=null*/)
  22. : Collection(title_.isEmpty() ? i18n("My Comic Books") : title_) {
  23. if(addFields_) {
  24. addFields(defaultFields());
  25. }
  26. setDefaultGroupField(TQString::fromLatin1("series"));
  27. }
  28. Tellico::Data::FieldVec ComicBookCollection::defaultFields() {
  29. FieldVec list;
  30. FieldPtr field;
  31. field = new Field(TQString::fromLatin1("title"), i18n("Title"));
  32. field->setCategory(i18n(comic_general));
  33. field->setFlags(Field::NoDelete);
  34. field->setFormatFlag(Field::FormatTitle);
  35. list.append(field);
  36. field = new Field(TQString::fromLatin1("subtitle"), i18n("Subtitle"));
  37. field->setCategory(i18n(comic_general));
  38. field->setFormatFlag(Field::FormatTitle);
  39. list.append(field);
  40. field = new Field(TQString::fromLatin1("writer"), i18n("Writer"));
  41. field->setCategory(i18n(comic_general));
  42. field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
  43. field->setFormatFlag(Field::FormatName);
  44. list.append(field);
  45. field = new Field(TQString::fromLatin1("artist"), i18n("Comic Book Illustrator", "Artist"));
  46. field->setCategory(i18n(comic_general));
  47. field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
  48. field->setFormatFlag(Field::FormatName);
  49. list.append(field);
  50. field = new Field(TQString::fromLatin1("series"), i18n("Series"));
  51. field->setCategory(i18n(comic_general));
  52. field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
  53. field->setFormatFlag(Field::FormatTitle);
  54. list.append(field);
  55. field = new Field(TQString::fromLatin1("issue"), i18n("Issue"), Field::Number);
  56. field->setCategory(i18n(comic_general));
  57. field->setFlags(Field::AllowMultiple);
  58. list.append(field);
  59. field = new Field(TQString::fromLatin1("publisher"), i18n("Publisher"));
  60. field->setCategory(i18n(comic_publishing));
  61. field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
  62. field->setFormatFlag(Field::FormatPlain);
  63. list.append(field);
  64. field = new Field(TQString::fromLatin1("edition"), i18n("Edition"));
  65. field->setCategory(i18n(comic_publishing));
  66. field->setFlags(Field::AllowCompletion);
  67. field->setFormatFlag(Field::FormatPlain);
  68. list.append(field);
  69. field = new Field(TQString::fromLatin1("pub_year"), i18n("Publication Year"), Field::Number);
  70. field->setCategory(i18n(comic_publishing));
  71. field->setFlags(Field::AllowGrouped);
  72. list.append(field);
  73. field = new Field(TQString::fromLatin1("pages"), i18n("Pages"), Field::Number);
  74. field->setCategory(i18n(comic_publishing));
  75. list.append(field);
  76. field = new Field(TQString::fromLatin1("country"), i18n("Country"));
  77. field->setCategory(i18n(comic_publishing));
  78. field->setFlags(Field::AllowCompletion | Field::AllowGrouped | Field::AllowMultiple);
  79. field->setFormatFlag(Field::FormatPlain);
  80. list.append(field);
  81. field = new Field(TQString::fromLatin1("language"), i18n("Language"));
  82. field->setCategory(i18n(comic_publishing));
  83. field->setFlags(Field::AllowCompletion | Field::AllowGrouped | Field::AllowMultiple);
  84. field->setFormatFlag(Field::FormatPlain);
  85. list.append(field);
  86. field = new Field(TQString::fromLatin1("genre"), i18n("Genre"));
  87. field->setCategory(i18n(comic_classification));
  88. field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
  89. field->setFormatFlag(Field::FormatPlain);
  90. list.append(field);
  91. field = new Field(TQString::fromLatin1("keyword"), i18n("Keywords"));
  92. field->setCategory(i18n(comic_classification));
  93. field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
  94. list.append(field);
  95. TQStringList cond = TQStringList::split(TQRegExp(TQString::fromLatin1("\\s*,\\s*")),
  96. i18n("Comic book grade levels - "
  97. "Mint,Near Mint,Very Fine,Fine,Very Good,Good,Fair,Poor",
  98. "Mint,Near Mint,Very Fine,Fine,Very Good,Good,Fair,Poor"),
  99. false);
  100. field = new Field(TQString::fromLatin1("condition"), i18n("Condition"), cond);
  101. field->setCategory(i18n(comic_classification));
  102. list.append(field);
  103. field = new Field(TQString::fromLatin1("pur_date"), i18n("Purchase Date"));
  104. field->setCategory(i18n(comic_personal));
  105. field->setFormatFlag(Field::FormatDate);
  106. list.append(field);
  107. field = new Field(TQString::fromLatin1("pur_price"), i18n("Purchase Price"));
  108. field->setCategory(i18n(comic_personal));
  109. list.append(field);
  110. field = new Field(TQString::fromLatin1("signed"), i18n("Signed"), Field::Bool);
  111. field->setCategory(i18n(comic_personal));
  112. list.append(field);
  113. field = new Field(TQString::fromLatin1("gift"), i18n("Gift"), Field::Bool);
  114. field->setCategory(i18n(comic_personal));
  115. list.append(field);
  116. field = new Field(TQString::fromLatin1("loaned"), i18n("Loaned"), Field::Bool);
  117. field->setCategory(i18n(comic_personal));
  118. list.append(field);
  119. field = new Field(TQString::fromLatin1("cover"), i18n("Front Cover"), Field::Image);
  120. list.append(field);
  121. field = new Field(TQString::fromLatin1("comments"), i18n("Comments"), Field::Para);
  122. field->setCategory(i18n(comic_personal));
  123. list.append(field);
  124. return list;
  125. }
  126. #include "comicbookcollection.moc"