Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed c86b201

Added a confirmation before exiting with unsaved changes.

  • Participants
  • Parent commits c7fd841

Comments (0)

Files changed (2)

File 1st-version-as-scripts/edit-yaml-gui.pl

         $frame,
         $exit_item,
         sub {
-            $_[0]->Close();
+            my $win = shift;
+
+            if ($self->_was_data_changed())
+            {
+                my $verdict = Wx::MessageBox(
+                    Wx::gettext("There are unsaved changes. Still exit?"),
+                    Wx::gettext("Exit without save?"),
+                    (Wx::wxOK | Wx::wxCANCEL),
+                    $frame,
+                );
+                
+                if ($verdict == Wx::wxCANCEL)
+                {
+                    return;
+                }
+            }
+            $win->Close();
         },
     );
 
             $self->_was_data_changed(1);
         },
     );
-=begin Hello
-
-    EVT_LISTBOX_DCLICK($frame->{list}, wxID_ANY(), sub {
-            my $list = shift;
-            my $event = shift;
-
-            my $sel = $event->GetSelection();
-            my $string = $list->GetString($sel);
-        }
-    );
-
-=end Hello
-
-=cut
 
     return 1;
 }

File 1st-version-as-scripts/upload-spec.yml

   - ''
   filename: img_7953.jpg
   tags: []
-  title: ''
+  title: First Title
 - description_parts:
   - ''
   - ''
   - ''
   filename: img_7954.jpg
   tags: []
-  title: ''
+  title: Second Title
 - description_parts:
   - ''
   - ''
   - ''
   filename: img_7957.jpg
   tags: []
-  title: ''
+  title: Third
 - description_parts:
   - ''
   - ''