~teemu-heinamaki/ubuntu/maverick/tuxguitar/merge-from-debian

« back to all changes in this revision

Viewing changes to TuxGuitar/src/org/herac/tuxguitar/gui/actions/composition/ChangeKeySignatureAction.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:
20
20
import org.eclipse.swt.widgets.Shell;
21
21
import org.herac.tuxguitar.gui.TuxGuitar;
22
22
import org.herac.tuxguitar.gui.actions.Action;
 
23
import org.herac.tuxguitar.gui.actions.ActionLock;
23
24
import org.herac.tuxguitar.gui.editors.tab.TGMeasureImpl;
24
25
import org.herac.tuxguitar.gui.undo.undoables.custom.UndoableChangeKeySignature;
25
26
import org.herac.tuxguitar.gui.util.DialogUtils;
 
27
import org.herac.tuxguitar.gui.util.MessageDialog;
26
28
import org.herac.tuxguitar.song.models.TGMeasure;
27
29
import org.herac.tuxguitar.song.models.TGTrack;
 
30
import org.herac.tuxguitar.util.TGSynchronizer;
28
31
 
29
32
/**
30
33
 * @author julian
99
102
                        buttonOK.setLayoutData(getButtonData());
100
103
                        buttonOK.addSelectionListener(new SelectionAdapter() {
101
104
                                public void widgetSelected(SelectionEvent arg0) {
102
 
                                        boolean toEndValue = toEnd.getSelection();
103
 
                                        setKeySignature(keySignatures.getSelectionIndex(),toEndValue);
 
105
                                        final boolean toEndValue = toEnd.getSelection();
 
106
                                        final int keySignature = keySignatures.getSelectionIndex();
104
107
                                        
105
108
                                        dialog.dispose();
 
109
                                        try {
 
110
                                                TGSynchronizer.instance().runLater(new TGSynchronizer.TGRunnable() {
 
111
                                                        public void run() throws Throwable {
 
112
                                                                ActionLock.lock();
 
113
                                                                TuxGuitar.instance().loadCursor(SWT.CURSOR_WAIT);
 
114
                                                                setKeySignature(keySignature,toEndValue);
 
115
                                                                TuxGuitar.instance().updateCache( true );
 
116
                                                                TuxGuitar.instance().loadCursor(SWT.CURSOR_ARROW);
 
117
                                                                ActionLock.unlock();
 
118
                                                        }
 
119
                                                });
 
120
                                        } catch (Throwable throwable) {
 
121
                                                MessageDialog.errorMessage(throwable);
 
122
                                        }
106
123
                                }
107
124
                        });
108
125