rejetto forum
February 11, 2012, 02:07:14 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: 1 [2]  All
  Print  
Author Topic: Testing build #253  (Read 3498 times)
0 Members and 1 Guest are viewing this topic.
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1469



View Profile WWW
« Reply #15 on: February 06, 2010, 12:15:59 PM »

For you who likes the simplicity, this solution should delight you.   Grin



When loading a new or recent VFS , if the actual is modified , there was nothing to ask saving before.

From now on it will exist in the future build. Wink

Quote
procedure TmainFrm.Loadfilesystem1Click(Sender: TObject);
var
  fn: string;
begin
if blockLoadSave() then exit;
if VFSModified then
 case msgDlg('VFS has changed, save current file system before open new?',MB_ICONINFORMATION+MB_YESNOCANCEL) of
    IDYES: begin
           mainfrm.saveVFS(lastFileOpen);
           if not VFSModified then msgDlg('The VFS was correctly saved,'#13#13'click on OK to continue', MB_ICONASTERISK);
           end;
    IDNO: ; // just go on
    IDCANCEL: exit;
    end;
fn:='';
if PromptForFileName(fn, 'VirtualFileSystem|*.vfs', 'vfs', 'Open VFS file') then
  loadVFS(fn);
end;

............

procedure Tmainfrm.recentsClick(sender:Tobject);
var
  i: integer;
begin
if blockLoadSave() then exit;
i:=strToInt((sender as Tmenuitem).Caption[3]);
if i > length(recentFiles) then exit;
dec(i); // convert to zero based
if FileExists(recentFiles) then
  if vfsmodified then
  case msgDlg('VFS has changed, save current file system before select new file?',MB_ICONINFORMATION+MB_YESNOCANCEL) of
    IDYES: begin
           mainfrm.saveVFS(lastFileOpen);
           if not VFSModified then msgDlg('The VFS was correctly saved,'#13#13'click on OK to continue', MB_ICONASTERISK);
           end;
    IDNO: begin        
           loadVFS(recentFiles)
           end;
    IDCANCEL: exit;
    end
  else
  loadVFS(recentFiles)
else
  begin
  msgDlg('The file does not exist anymore', MB_ICONERROR);
  removeString(recentFiles, i);
  updateRecentFilesMenu();
  end;
end;

« Last Edit: February 15, 2010, 06:08:46 AM by SilentPliz » Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11759


View Profile
« Reply #16 on: February 08, 2010, 09:14:25 AM »

good point mars.

but i opted for adding just this line to both procedures:
if not checkVfsOnQuit() then exit;

isn't it enough?
Logged
Pages: 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page January 01, 2012, 01:29:14 AM