~ubuntu-branches/ubuntu/lucid/tuxguitar/lucid-updates

« back to all changes in this revision

Viewing changes to TuxGuitar/src/org/herac/tuxguitar/gui/system/config/TGConfigEditor.java

  • Committer: Bazaar Package Importer
  • Author(s): Philippe Coval
  • Date: 2009-04-25 19:49:27 UTC
  • mfrom: (1.1.3 upstream) (2.1.7 jaunty)
  • Revision ID: james.westby@ubuntu.com-20090425194927-pblqed0zxp0pmyeq
Tags: 1.1-1
* New Upstream Release (Closes: #489859) (LP: #366476)
* Merged patch : tuxguitar_1.0.dak-1ubuntu1.patch
* debian/README.txt
  - suggests to install tuxguitar-jsa

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
import org.herac.tuxguitar.gui.TuxGuitar;
26
26
import org.herac.tuxguitar.gui.actions.ActionLock;
27
27
import org.herac.tuxguitar.gui.editors.TablatureEditor;
28
 
import org.herac.tuxguitar.gui.helper.SyncThread;
29
28
import org.herac.tuxguitar.gui.system.config.items.LanguageOption;
30
29
import org.herac.tuxguitar.gui.system.config.items.MainOption;
31
30
import org.herac.tuxguitar.gui.system.config.items.Option;
35
34
import org.herac.tuxguitar.gui.system.config.items.ToolBarsOption;
36
35
import org.herac.tuxguitar.gui.util.ConfirmDialog;
37
36
import org.herac.tuxguitar.gui.util.DialogUtils;
 
37
import org.herac.tuxguitar.util.TGSynchronizer;
38
38
 
39
39
/**
40
40
 * @author julian
250
250
        }
251
251
        
252
252
        protected void applyConfig(final boolean force){
 
253
                TuxGuitar.instance().loadCursor(SWT.CURSOR_WAIT);
253
254
                new Thread(new Runnable() {
254
255
                        public void run() {
255
256
                                TGConfigEditor.this.runnables = new ArrayList();
259
260
                                        Option option = (Option)it.next();
260
261
                                        option.applyConfig(force);
261
262
                                }
262
 
                                
263
 
                                new SyncThread( new Runnable() {
264
 
                                        public void run() {
265
 
                                                Iterator it = TGConfigEditor.this.runnables.iterator();
266
 
                                                while(it.hasNext()){
267
 
                                                        Runnable current = (Runnable)it.next();
268
 
                                                        current.run();
 
263
                                try {
 
264
                                        TGSynchronizer.instance().runLater(new TGSynchronizer.TGRunnable() {
 
265
                                                public void run() throws Throwable {
 
266
                                                        Iterator it = TGConfigEditor.this.runnables.iterator();
 
267
                                                        while(it.hasNext()){
 
268
                                                                Runnable current = (Runnable)it.next();
 
269
                                                                current.run();
 
270
                                                        }
 
271
                                                        new Thread(new Runnable() {
 
272
                                                                public void run() {
 
273
                                                                        TuxGuitar.instance().fireUpdate();
 
274
                                                                        TuxGuitar.instance().updateCache(true);
 
275
                                                                        TuxGuitar.instance().loadCursor(SWT.CURSOR_ARROW);
 
276
                                                                        ActionLock.unlock();
 
277
                                                                }
 
278
                                                        }).start();
269
279
                                                }
270
 
                                                new Thread(new Runnable() {
271
 
                                                        public void run() {
272
 
                                                                TuxGuitar.instance().fireUpdate();
273
 
                                                                TuxGuitar.instance().updateCache(true);
274
 
                                                                TuxGuitar.instance().loadCursor(SWT.CURSOR_ARROW);
275
 
                                                                ActionLock.unlock();
276
 
                                                        }
277
 
                                                }).start();
278
 
                                        }
279
 
                                }).start();
 
280
                                        });
 
281
                                } catch (Throwable throwable) {
 
282
                                        TuxGuitar.instance().fireUpdate();
 
283
                                        TuxGuitar.instance().updateCache(true);
 
284
                                        TuxGuitar.instance().loadCursor(SWT.CURSOR_ARROW);
 
285
                                        ActionLock.unlock();
 
286
                                        throwable.printStackTrace();
 
287
                                }
280
288
                        }
281
289
                }).start();
282
290
        }