message.cpp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. /**
  2. \file message.cpp
  3. \brief Error message dialogs
  4. This program is free software under the GNU General Public
  5. License (>=v2). Read the file COPYING that comes with GRASS
  6. for details.
  7. (C) 2008 by The GRASS development team
  8. \author Martin Landa <landa.martin gmail.com>
  9. \date 2008
  10. */
  11. #include "driver.h"
  12. #include "digit.h"
  13. /**
  14. \brief Error message - no display driver available
  15. */
  16. void Digit::DisplayMsg(void)
  17. {
  18. wxMessageDialog dlg(parentWin, _("Display driver not available."),
  19. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  20. dlg.ShowModal();
  21. return;
  22. }
  23. /**
  24. \brief Error message - cannot edit 3d features
  25. */
  26. void Digit::Only2DMsg(void)
  27. {
  28. wxMessageDialog dlg(parentWin, _("3D vector features are not currently supported."),
  29. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  30. dlg.ShowModal();
  31. return;
  32. }
  33. /**
  34. \brief Error message - unable to write line
  35. */
  36. void Digit::WriteLineMsg(void)
  37. {
  38. wxMessageDialog dlg(parentWin, _("Unable to write new line"),
  39. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  40. dlg.ShowModal();
  41. return;
  42. }
  43. /**
  44. \brief Error message - unable to read line
  45. \param line line id
  46. */
  47. void Digit::ReadLineMsg(int line)
  48. {
  49. wxString msg;
  50. msg.Printf(_("Unable to read line %d"), line);
  51. wxMessageDialog dlg(parentWin, msg,
  52. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  53. dlg.ShowModal();
  54. return;
  55. }
  56. /**
  57. \brief Error message - trying to read dead line
  58. \param line line id
  59. */
  60. void Digit::DeadLineMsg(int line)
  61. {
  62. wxString msg;
  63. msg.Printf(_("Unable to read line %d, line is dead"), line);
  64. wxMessageDialog dlg(parentWin, msg,
  65. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  66. dlg.ShowModal();
  67. return;
  68. }
  69. /**
  70. \brief Error message - unable to open background map
  71. \param bgmap map name
  72. */
  73. void Digit::BackgroundMapMsg(const char *bgmap)
  74. {
  75. wxString msg;
  76. msg.Printf(_("Unable to open background vector map <%s>. "
  77. "Please check digitizer settings."),
  78. wxString (bgmap, wxConvUTF8).c_str());
  79. wxMessageDialog dlg(parentWin, msg,
  80. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  81. dlg.ShowModal();
  82. return;
  83. }
  84. /**
  85. \brief Error message - dblink not defined
  86. \param layer layer id
  87. */
  88. void Digit::DblinkMsg(int layer)
  89. {
  90. wxString msg;
  91. msg.Printf(_("Database connection not defined for layer %d"), layer);
  92. wxMessageDialog dlg(parentWin, msg,
  93. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  94. dlg.ShowModal();
  95. return;
  96. }
  97. /**
  98. \brief Error message - unable to start driver
  99. \param driver driver name
  100. */
  101. void Digit::DbDriverMsg(const char *driver)
  102. {
  103. wxString msg;
  104. msg.Printf(_("Unable to start driver <%s>"), driver);
  105. wxMessageDialog dlg(parentWin, msg,
  106. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  107. dlg.ShowModal();
  108. return;
  109. }
  110. /**
  111. \brief Error message - unable to open database
  112. \param driver driver name
  113. \param database database name
  114. */
  115. void Digit::DbDatabaseMsg(const char *driver, const char *database)
  116. {
  117. wxString msg;
  118. msg.Printf(_("Unable to open database <%s> by driver <%s>"),
  119. database, driver);
  120. wxMessageDialog dlg(parentWin, msg,
  121. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  122. dlg.ShowModal();
  123. return;
  124. }
  125. /**
  126. \brief Error message - unable to execute SQL command
  127. \param sql sql command
  128. */
  129. void Digit::DbExecuteMsg(const char *sql)
  130. {
  131. wxString msg;
  132. msg.Printf(_("Unable to execute: '%s'"), sql);
  133. wxMessageDialog dlg(parentWin, msg,
  134. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  135. dlg.ShowModal();
  136. return;
  137. }
  138. wxString msg;
  139. /**
  140. \brief Error message - unable to get line categories
  141. \param line line id
  142. */
  143. void Digit::GetLineCatsMsg(int line)
  144. {
  145. msg.Printf(_("Unable to get feature categories"), line);
  146. wxMessageDialog dlg(parentWin, msg,
  147. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  148. dlg.ShowModal();
  149. return;
  150. }