Update of /cvsroot/azureus/azureus2/org/gudy/azureus2/ui/swt/views
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv18828/org/gudy/azureus2/ui/swt/views
Modified Files:
MyTorrentsView.java GeneralView.java MyTorrentsSuperView.java
Log Message:
Added a user comment field.
Index: MyTorrentsSuperView.java
===================================================================
RCS file: /cvsroot/azureus/azureus2/org/gudy/azureus2/ui/swt/views/MyTorrentsSuperView.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- MyTorrentsSuperView.java 7 Sep 2006 18:54:08 -0000 1.42
+++ MyTorrentsSuperView.java 26 Oct 2006 23:33:50 -0000 1.43
@@ -78,6 +78,7 @@
new RemainingItem(),
new PiecesItem(),
new CompletionItem(),
+ new CommentItem(TableManager.TABLE_MYTORRENTS_INCOMPLETE),
new MaxUploadsItem(TableManager.TABLE_MYTORRENTS_INCOMPLETE),
new TotalSpeedItem(TableManager.TABLE_MYTORRENTS_INCOMPLETE),
new FilesDoneItem(TableManager.TABLE_MYTORRENTS_INCOMPLETE),
@@ -118,6 +119,7 @@
new UpSpeedLimitItem(TableManager.TABLE_MYTORRENTS_COMPLETE),
// Initially Invisible
+ new CommentItem(TableManager.TABLE_MYTORRENTS_INCOMPLETE),
new MaxUploadsItem(TableManager.TABLE_MYTORRENTS_COMPLETE),
new TotalSpeedItem(TableManager.TABLE_MYTORRENTS_COMPLETE),
new FilesDoneItem(TableManager.TABLE_MYTORRENTS_COMPLETE),
Index: MyTorrentsView.java
===================================================================
RCS file: /cvsroot/azureus/azureus2/org/gudy/azureus2/ui/swt/views/MyTorrentsView.java,v
retrieving revision 1.284
retrieving revision 1.285
diff -u -d -r1.284 -r1.285
--- MyTorrentsView.java 24 Sep 2006 00:56:59 -0000 1.284
+++ MyTorrentsView.java 26 Oct 2006 23:33:50 -0000 1.285
@@ -1678,7 +1678,7 @@
itemRenameBoth.setData("save_name", Boolean.valueOf(true));
itemRenameBoth.setData("msg_key", "displayed_and_save_path");
}
-
+
Listener rename_listener = new Listener() {
public void handleEvent(Event event) {
MenuItem mi = (MenuItem)event.widget;
@@ -1713,6 +1713,34 @@
itemRenameSavePath.addListener(SWT.Selection, rename_listener);
itemRenameBoth.addListener(SWT.Selection, rename_listener);
+ // Edit Comment
+ final MenuItem itemEditComment = new MenuItem(menu, SWT.CASCADE);
+ Messages.setLanguageText(itemEditComment, "MyTorrentsView.menu.edit_comment");
+ itemEditComment.setEnabled(fileMove && dms.length == 1);
+ if (itemEditComment.isEnabled()) {
+ itemEditComment.setData("suggested_text", first_selected.getDownloadState().getUserComment());
+ }
+
+ Listener edit_comment_listener = new Listener() {
+ public void handleEvent(Event event) {
+ MenuItem mi = (MenuItem)event.widget;
+ String suggested = (String)mi.getData("suggested_text");
+ String msg_key_prefix = "MyTorrentsView.menu.edit_comment.enter.";
+ SimpleTextEntryWindow text_entry = new SimpleTextEntryWindow(getComposite().getDisplay(), msg_key_prefix + "title", msg_key_prefix + "message", suggested, null);
+ if (text_entry.wasDataSubmitted()) {
+ String value = text_entry.getStoredString();
+ final String value_to_set = (value.length() == 0) ? null : value;
+ MyTorrentsView.this.runForSelectedRows(new GroupTableRowRunner() {
+ public void run(TableRowCore row) {
+ ((DownloadManager)row.getDataSource(true)).getDownloadState().setUserComment(value_to_set);
+ }
+ });
+ }
+ }
+ };
+
+ itemEditComment.addListener(SWT.Selection, edit_comment_listener);
+
// ---
new MenuItem(menu, SWT.SEPARATOR);
Index: GeneralView.java
===================================================================
RCS file: /cvsroot/azureus/azureus2/org/gudy/azureus2/ui/swt/views/GeneralView.java,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -d -r1.125 -r1.126
--- GeneralView.java 26 Jul 2006 16:20:07 -0000 1.125
+++ GeneralView.java 26 Oct 2006 23:33:50 -0000 1.126
@@ -118,6 +118,7 @@
BufferedLabel pieceSize;
Control lblComment;
BufferedLabel creation_date;
+ BufferedLabel user_comment;
BufferedLabel hashFails;
BufferedLabel shareRatio;
Button updateButton;
@@ -554,7 +555,14 @@
label = new Label(gInfo, SWT.LEFT);
// row
-
+
+ label = new Label(gInfo, SWT.LEFT);
+ Messages.setLanguageText(label, "GeneralView.label.user_comment"); //$NON-NLS-1$
+ user_comment = new BufferedLabel(gInfo, SWT.LEFT);
+ gridData = new GridData(GridData.FILL_HORIZONTAL);
+ gridData.horizontalSpan = 3;
+ user_comment.setLayoutData(gridData);
+
label = new Label(gInfo, SWT.LEFT);
gridData = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
label.setLayoutData(gridData);
@@ -726,7 +734,8 @@
manager.getNbPieces(),
manager.getPieceLength(),
manager.getTorrentComment(),
- DisplayFormatters.formatDate(manager.getTorrentCreationDate()*1000));
+ DisplayFormatters.formatDate(manager.getTorrentCreationDate()*1000),
+ manager.getDownloadState().getUserComment());
//A special layout, for OS X and Linux, on which for some unknown reason
@@ -1154,7 +1163,8 @@
final int _pieceNumber,
final String _pieceLength,
final String _comment,
- final String _creation_date) {
+ final String _creation_date,
+ final String _user_comment) {
if (display == null || display.isDisposed())
return;
Utils.execSWTThread(new AERunnable() {
@@ -1192,6 +1202,7 @@
}
creation_date.setText(_creation_date);
+ user_comment.setText(_user_comment);
}
});
}
|