Exemple #1
0
 /** Save a file as something else. Called when the user goes to File -> Save As */
 public void saveFileAs() {
   JFileChooser chooser = new JFileChooser();
   chooser.addChoosableFileFilter(new CakeFileChooser());
   chooser.setDialogType(JFileChooser.SAVE_DIALOG);
   chooser.showSaveDialog(window);
   File f = chooser.getSelectedFile();
   if (f == null) return;
   try {
     if (calendar.getSettings().getName() == CakeCal.UNTITLED) {
       calendar.getSettings().setName(f.getName());
       parent.updateGUI(CakeCal.UNTITLED);
     }
     calendar.saveCal(f.getPath());
   } catch (IOException e) {
     System.out.println(e.getMessage());
   }
   calendar.getSettings().setFilename(f.getPath());
   // save.setEnabled(calendar.modified);
 }
Exemple #2
0
 /** Called by the settings dialog when it is done getting the new settings. */
 public void finished() {
   parent.updateGUI();
 }