Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed error message when dropping files in bad state

  • Loading branch information...
commit 6d33bee821e401d902d4ecba86251eb19799f900 1 parent 84c963c
Thor Grimner authored
BIN  bin-win/cli.exe
Binary file not shown
BIN  bin-win/gui.exe
Binary file not shown
24 gui/main.c
@@ -138,8 +138,8 @@ static bool top_event(SDL_Event *event) {
138 138 switch( event->type ) {
139 139 #ifdef SDL2
140 140 case SDL_DROPFILE:
141   - if(event->drop.file) {
142   - if(p_mach) {
  141 + if(p_mach) {
  142 + if(event->drop.file) {
143 143 if(image_loadpicture(event->drop.file)) {
144 144 if(p_mach->size_check(image_width(),image_height())) {
145 145 p_item=ui_list_add(top[TOP_LIST],"PPP IS WWWXHHH",4+image_width()*image_height());
@@ -155,20 +155,20 @@ static bool top_event(SDL_Event *event) {
155 155 } else {
156 156 stat_format++;
157 157 }
158   - } else {
159   - ui_field_add(msg[MSG_TEXT],"NOT READY TO ACCEPT IMAGES\nAT THIS TIME. PLEASE SELECT\nMACHINE USING FORMAT FIRST.");
  158 + } else {
  159 + sprintf(text,"SUCCESSFULLY ADDED: %i\nTOO BIG FOR MACHINE: %i\nUNRECOGNIZED FORMAT: %i",stat_add,stat_size,stat_format);
  160 + ui_field_add(msg[MSG_TEXT],text);
  161 + stat_add=0;
  162 + stat_size=0;
  163 + stat_format=0;
160 164 view=VIEW_MSG;
161 165 return true;
162   - }
163   - } else {
164   - sprintf(text,"SUCCESSFULLY ADDED: %i\nTOO BIG FOR MACHINE: %i\nUNRECOGNIZED FORMAT: %i",stat_add,stat_size,stat_format);
165   - ui_field_add(msg[MSG_TEXT],text);
166   - stat_add=0;
167   - stat_size=0;
168   - stat_format=0;
  166 + }
  167 + } else {
  168 + ui_field_add(msg[MSG_TEXT],"NOT READY TO ACCEPT IMAGES\nAT THIS TIME. PLEASE SELECT\nMACHINE USING FORMAT FIRST.");
169 169 view=VIEW_MSG;
170 170 return true;
171   - }
  171 + }
172 172 break;
173 173 #endif
174 174 case SDL_QUIT:

0 comments on commit 6d33bee

Please sign in to comment.
Something went wrong with that request. Please try again.