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

« back to all changes in this revision

Viewing changes to TuxGuitar/src/org/herac/tuxguitar/gui/actions/composition/ChangeInfoAction.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.Text;
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.undo.undoables.custom.UndoableChangeInfo;
24
25
import org.herac.tuxguitar.gui.util.DialogUtils;
 
26
import org.herac.tuxguitar.gui.util.MessageDialog;
25
27
import org.herac.tuxguitar.song.models.TGSong;
 
28
import org.herac.tuxguitar.util.TGSynchronizer;
26
29
 
27
30
/**
28
31
 * @author julian
63
66
                        nameLabel.setLayoutData(makeLabelData()); 
64
67
                        nameLabel.setText(TuxGuitar.getProperty("composition.name") + ":");
65
68
                        
66
 
                        final Text name = new Text(group, SWT.BORDER);
67
 
                        name.setLayoutData(makeTextData());
68
 
                        name.setText(song.getName());
 
69
                        final Text nameText = new Text(group, SWT.BORDER);
 
70
                        nameText.setLayoutData(makeTextData());
 
71
                        nameText.setText(song.getName());
69
72
                        //-------ARTIST------------------------------------
70
73
                        Label artistLabel = new Label(group, SWT.NULL);
71
74
                        artistLabel.setLayoutData(makeLabelData());
72
75
                        artistLabel.setText(TuxGuitar.getProperty("composition.artist") + ":");
73
76
                        
74
 
                        final Text artist = new Text(group, SWT.BORDER);
75
 
                        artist.setLayoutData(makeTextData());
76
 
                        artist.setText(song.getArtist());
 
77
                        final Text artistText = new Text(group, SWT.BORDER);
 
78
                        artistText.setLayoutData(makeTextData());
 
79
                        artistText.setText(song.getArtist());
77
80
                        //-------ALBUM------------------------------------
78
81
                        Label albumLabel = new Label(group, SWT.NULL);
79
82
                        albumLabel.setLayoutData(makeLabelData());
80
83
                        albumLabel.setText(TuxGuitar.getProperty("composition.album") + ":");
81
84
                        
82
 
                        final Text album = new Text(group, SWT.BORDER);
83
 
                        album.setLayoutData(makeTextData());
84
 
                        album.setText(song.getAlbum());
 
85
                        final Text albumText = new Text(group, SWT.BORDER);
 
86
                        albumText.setLayoutData(makeTextData());
 
87
                        albumText.setText(song.getAlbum());
85
88
                        //-------AUTHOR------------------------------------
86
89
                        Label authorLabel = new Label(group, SWT.NULL);
87
90
                        authorLabel.setLayoutData(makeLabelData());
88
91
                        authorLabel.setText(TuxGuitar.getProperty("composition.author") + ":");
89
92
                        
90
 
                        final Text author = new Text(group, SWT.BORDER);
91
 
                        author.setLayoutData(makeTextData());
92
 
                        author.setText(song.getAuthor());
 
93
                        final Text authorText = new Text(group, SWT.BORDER);
 
94
                        authorText.setLayoutData(makeTextData());
 
95
                        authorText.setText(song.getAuthor());
93
96
                        
94
97
                        //------------------BUTTONS--------------------------
95
98
                        Composite buttons = new Composite(dialog, SWT.NONE);
101
104
                        buttonOK.setLayoutData(getButtonData());
102
105
                        buttonOK.addSelectionListener(new SelectionAdapter() {
103
106
                                public void widgetSelected(SelectionEvent arg0) {
104
 
                                        setProperties(name.getText(),artist.getText(),album.getText(),author.getText());
 
107
                                        final String name = nameText.getText();
 
108
                                        final String artist = artistText.getText();
 
109
                                        final String album = albumText.getText();
 
110
                                        final String author = authorText.getText();
 
111
                                        
105
112
                                        dialog.dispose();
 
113
                                        try {
 
114
                                                TGSynchronizer.instance().runLater(new TGSynchronizer.TGRunnable() {
 
115
                                                        public void run() throws Throwable {
 
116
                                                                ActionLock.lock();
 
117
                                                                TuxGuitar.instance().loadCursor(SWT.CURSOR_WAIT);
 
118
                                                                setProperties(name,artist,album,author);
 
119
                                                                TuxGuitar.instance().updateCache( true );
 
120
                                                                TuxGuitar.instance().loadCursor(SWT.CURSOR_ARROW);
 
121
                                                                ActionLock.unlock();
 
122
                                                        }
 
123
                                                });
 
124
                                        } catch (Throwable throwable) {
 
125
                                                MessageDialog.errorMessage(throwable);
 
126
                                        }
106
127
                                }
107
128
                        });
108
129