Pārlūkot izejas kodu

ThePimp: do not attempt to save a file if there is no open image.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2931 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam pirms 16 gadiem
vecāks
revīzija
011761076d
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. +3
    -1
      ThePimp/MainWindow.cs

+ 3
- 1
ThePimp/MainWindow.cs Parādīt failu

@@ -50,7 +50,7 @@ namespace ThePimp
} }


while(notebook1.NPages > 0) while(notebook1.NPages > 0)
notebook1.RemovePage(0);
notebook1.RemovePage(0);
int n = notebook1.AppendPage(new PictureView(p), int n = notebook1.AppendPage(new PictureView(p),
new Label(p.FileName)); new Label(p.FileName));
notebook1.Page = n; notebook1.Page = n;
@@ -86,6 +86,8 @@ namespace ThePimp


protected virtual void OnSaveAsActionActivated (object sender, System.EventArgs e) protected virtual void OnSaveAsActionActivated (object sender, System.EventArgs e)
{ {
if(notebook1.NPages <= 0)
return;
SaveFile save = new SaveFile(); SaveFile save = new SaveFile();
PictureView view = notebook1.CurrentPageWidget as PictureView; PictureView view = notebook1.CurrentPageWidget as PictureView;
save.Save(view.Picture); save.Save(view.Picture);


Notiek ielāde…
Atcelt
Saglabāt