message.cpp 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /**
  2. \file vdigit/message.cpp
  3. \brief wxvdigit - 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-2009 by Martin Landa, and the GRASS development team
  8. \author Martin Landa <landa.martin gmail.com>
  9. */
  10. #include "driver.h"
  11. #include "digit.h"
  12. /**
  13. \brief Error message - no display driver available
  14. */
  15. void DisplayDriver::DisplayMsg(void)
  16. {
  17. wxMessageDialog dlg(parentWin, _("Display driver not available."),
  18. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  19. dlg.ShowModal();
  20. return;
  21. }
  22. /**
  23. \brief Error message - cannot edit 3d features
  24. */
  25. void DisplayDriver::Only2DMsg(void)
  26. {
  27. wxMessageDialog dlg(parentWin, _("3D vector features are not currently supported."),
  28. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  29. dlg.ShowModal();
  30. return;
  31. }
  32. /**
  33. \brief Error message - unable to write line
  34. */
  35. void DisplayDriver::WriteLineMsg(void)
  36. {
  37. wxMessageDialog dlg(parentWin, _("Unable to write new line"),
  38. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  39. dlg.ShowModal();
  40. return;
  41. }
  42. /**
  43. \brief Error message - unable to read line
  44. \param line line id
  45. */
  46. void DisplayDriver::ReadLineMsg(int line)
  47. {
  48. wxString msg;
  49. msg.Printf(_("Unable to read line %d"), line);
  50. wxMessageDialog dlg(parentWin, msg,
  51. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  52. dlg.ShowModal();
  53. return;
  54. }
  55. /**
  56. \brief Error message - trying to read dead line
  57. \param line line id
  58. */
  59. void DisplayDriver::DeadLineMsg(int line)
  60. {
  61. wxString msg;
  62. msg.Printf(_("Unable to read line %d, line is dead"), line);
  63. wxMessageDialog dlg(parentWin, msg,
  64. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  65. dlg.ShowModal();
  66. return;
  67. }
  68. /**
  69. \brief Error message - unable to open background map
  70. \param bgmap map name
  71. */
  72. void DisplayDriver::BackgroundMapMsg(const char *bgmap)
  73. {
  74. wxString msg;
  75. msg.Printf(_("Unable to open background vector map <%s>. "
  76. "Please check digitizer settings."),
  77. wxString (bgmap, wxConvUTF8).c_str());
  78. wxMessageDialog dlg(parentWin, msg,
  79. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  80. dlg.ShowModal();
  81. return;
  82. }
  83. /**
  84. \brief Error message - dblink not defined
  85. \param layer layer id
  86. */
  87. void DisplayDriver::DblinkMsg(int layer)
  88. {
  89. wxString msg;
  90. msg.Printf(_("Database connection not defined for layer %d"), layer);
  91. wxMessageDialog dlg(parentWin, msg,
  92. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  93. dlg.ShowModal();
  94. return;
  95. }
  96. /**
  97. \brief Error message - unable to start driver
  98. \param driver driver name
  99. */
  100. void DisplayDriver::DbDriverMsg(const char *driver)
  101. {
  102. wxString msg;
  103. msg.Printf(_("Unable to start driver <%s>"),
  104. wxString(driver, wxConvUTF8).c_str());
  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 DisplayDriver::DbDatabaseMsg(const char *driver, const char *database)
  116. {
  117. wxString msg;
  118. msg.Printf(_("Unable to open database <%s> by driver <%s>"),
  119. wxString(database, wxConvUTF8).c_str(),
  120. wxString(driver, wxConvUTF8).c_str());
  121. wxMessageDialog dlg(parentWin, msg,
  122. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  123. dlg.ShowModal();
  124. return;
  125. }
  126. /**
  127. \brief Error message - unable to execute SQL command
  128. \param sql sql command
  129. */
  130. void DisplayDriver::DbExecuteMsg(const char *sql)
  131. {
  132. wxString msg;
  133. msg.Printf(_("Unable to execute: '%s'"),
  134. wxString(sql, wxConvUTF8).c_str());
  135. wxMessageDialog dlg(parentWin, msg,
  136. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  137. dlg.ShowModal();
  138. return;
  139. }
  140. /**
  141. \brief Error message - unable to open select cursor
  142. \param sql sql command
  143. */
  144. void DisplayDriver::DbSelectCursorMsg(const char *sql)
  145. {
  146. wxString msg;
  147. msg.Printf(_("Unable to open select cursor: '%s'"),
  148. wxString(sql, wxConvUTF8).c_str());
  149. wxMessageDialog dlg(parentWin, msg,
  150. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  151. dlg.ShowModal();
  152. return;
  153. }
  154. /**
  155. \brief Error message - unable to get line categories
  156. \param line line id
  157. */
  158. void DisplayDriver::GetLineCatsMsg(int line)
  159. {
  160. wxString msg;
  161. msg.Printf(_("Unable to get feature (%d) categories"), line);
  162. wxMessageDialog dlg(parentWin, msg,
  163. msgCaption, wxOK | wxICON_ERROR | wxCENTRE);
  164. dlg.ShowModal();
  165. return;
  166. }