Changeset 10387
- Timestamp:
- 2005-08-02T10:01:40+12:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r10372 r10387 468 468 * @see org.greenstone.gatherer.gui.GUIManager 469 469 */ 470 public void exit() { 470 public void exit() 471 { 471 472 exit = true; 472 // If we have an open collection make note of it. 473 Configuration.setString("general.open_collection", true, null); 474 if(c_man.ready()) { 475 ///ystem.err.println("Collection open."); 476 if(c_man.saved()) { 477 ///ystem.err.println("Collection has been recently saved, so I'll remember it for next time."); 478 Configuration.setString("general.open_collection", true, c_man.getCollectionFilePath()); 479 } 480 c_man.closeCollection(); 481 } 482 if(assoc_man != null) { 473 474 // If we have an open collection remember it for next time, then save it and close it 475 if (c_man.ready()) { 476 Configuration.setString("general.open_collection", true, c_man.getCollectionFilePath()); 477 g_man.saveThenCloseCurrentCollection(); 478 } 479 else { 480 Configuration.setString("general.open_collection", true, null); 481 } 482 483 // Save the file associations 484 if (assoc_man != null) { 483 485 assoc_man.save(); 484 486 assoc_man = null; -
trunk/gli/src/org/greenstone/gatherer/gui/EnrichPane.java
r10325 r10387 194 194 // Force all of the controls to be updated 195 195 valueChanged(null); 196 } 197 198 199 /** Called to inform this pane that it has just lost focus as an effect of the user clicking on another tab 200 */ 201 public void loseFocus() 202 { 203 // Nothing to do 196 204 } 197 205 -
trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
r10379 r10387 150 150 } 151 151 else if (esrc == menu_bar.file_close) { 152 tab_pane.setSelectedComponent(gather_pane); // Must be done before closing the collection 153 Gatherer.c_man.saveCollection(); 154 Gatherer.c_man.closeCollection(); 152 saveThenCloseCurrentCollection(); 155 153 } 156 154 else if (esrc == menu_bar.file_delete) { 157 155 DeleteCollectionPrompt dcp = new DeleteCollectionPrompt(); 158 156 if (dcp.display()) { 159 Gatherer.c_man.closeCollection();157 saveThenCloseCurrentCollection(); 160 158 } 161 159 dcp.destroy(); … … 176 174 } 177 175 else if (esrc == menu_bar.file_exit) { 176 returnToInitialPane(); 178 177 exit(); 179 178 } … … 188 187 // If there is already a collection open, save and close it 189 188 if (Gatherer.c_man.ready()) { 190 tab_pane.setSelectedComponent(gather_pane); // Must be done before closing the collection 191 Gatherer.c_man.saveCollection(); 192 Gatherer.c_man.closeCollection(); 189 saveThenCloseCurrentCollection(); 193 190 } 194 191 … … 286 283 287 284 288 public void closeCurrentCollection() { 285 public void saveThenCloseCurrentCollection() 286 { 287 tab_pane.setSelectedComponent(gather_pane); 289 288 Gatherer.c_man.saveCollection(); 290 289 Gatherer.c_man.closeCollection(); 291 tab_pane.setSelectedComponent(gather_pane);292 290 } 293 291 … … 690 688 // If there is already a collection open, save and close it. 691 689 if (Gatherer.c_man.ready()) { 692 Gatherer.c_man.saveCollection(); 693 Gatherer.c_man.closeCollection(); 690 saveThenCloseCurrentCollection(); 694 691 } 695 692 … … 745 742 * @param event A ChangeEvent containing information about the event that fired this call. 746 743 */ 747 public void stateChanged(ChangeEvent event) { 748 if(previous_pane != null) { 749 if(previous_pane == create_pane) { 744 public void stateChanged(ChangeEvent event) 745 { 746 // Tell the previous pane that it has lost focus 747 if (previous_pane != null) { 748 if (previous_pane == enrich_pane) { 749 enrich_pane.loseFocus(); 750 } 751 else if (previous_pane == design_pane) { 752 design_pane.loseFocus(); 753 } 754 else if (previous_pane == create_pane) { 750 755 create_pane.loseFocus(); 751 }752 else if(previous_pane == design_pane) {753 design_pane.loseFocus();754 756 } 755 757 } -
trunk/gli/src/org/greenstone/gatherer/gui/Preferences.java
r10006 r10387 718 718 // shut down the collection 719 719 System.err.println("shutting down teh collection"); 720 Gatherer.g_man. closeCurrentCollection();720 Gatherer.g_man.saveThenCloseCurrentCollection(); 721 721 } 722 722
Note:
See TracChangeset
for help on using the changeset viewer.