[gui-dev] do not sort by priority if queue panel is invisible

Jens-Uwe Mager <[email protected]> Fri, 19 Nov 2004 17:21:41 +0100
Newsgroups gmane.network.gnutella.limewire.gui.devel
Message-ID <[email protected]>
Due to limited screen real estate I have on my computer the queue panel
invisible. Also with the type of content I am looking for I do not need
queueing, I am happy if one of the pending downloads I have completes
within a week or even longer. I was wondering recently why my queue table
does some fancy jumping, and I found that the queue is sorted by
priority even if the queue panel is not visible. The attached patch
changes that.
-- 
Jens-Uwe Mager	<pgp-mailto:F476EBC2>

_______________________________________________
gui-dev mailing list
[email protected]
http://www.limewire.org/mailman/listinfo/gui-dev
q.patch (text/plain, 1.5 KB)
Index: gui/com/limegroup/gnutella/gui/download/DownloadButtons.java
===================================================================
RCS file: /cvs/gui/com/limegroup/gnutella/gui/download/DownloadButtons.java,v
retrieving revision 1.16
diff -u -r1.16 DownloadButtons.java
--- gui/com/limegroup/gnutella/gui/download/DownloadButtons.java	3 Nov 2004 17:01:13 -0000	1.16
+++ gui/com/limegroup/gnutella/gui/download/DownloadButtons.java	19 Nov 2004 16:06:40 -0000
@@ -171,4 +171,11 @@
     void setQueuePanelVisible(boolean visible) {
         QUEUE_PANEL.setVisible(visible);
     }
+
+    /**
+     * Check if the queue panel is visible.
+     */
+    boolean isQueuePanelVisible() {
+        return QUEUE_PANEL.isVisible();
+    }
 }
Index: gui/com/limegroup/gnutella/gui/download/DownloadMediator.java
===================================================================
RCS file: /cvs/gui/com/limegroup/gnutella/gui/download/DownloadMediator.java,v
retrieving revision 1.52
diff -u -r1.52 DownloadMediator.java
--- gui/com/limegroup/gnutella/gui/download/DownloadMediator.java	12 Oct 2004 21:45:33 -0000	1.52
+++ gui/com/limegroup/gnutella/gui/download/DownloadMediator.java	19 Nov 2004 16:06:40 -0000
@@ -225,7 +225,7 @@
 		GUIMediator.addRefreshListener(this);
 		GUIMediator.addThemeObserver(this);
 		
-        if(SETTINGS.REAL_TIME_SORT.getValue())
+        if(SETTINGS.REAL_TIME_SORT.getValue() && _downloadButtons.isQueuePanelVisible())
             DATA_MODEL.sort(DownloadDataLine.PRIORITY_INDEX); // ascending
 	}