message.cpp 4.5 KB

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