Compare commits

...

13 Commits

Author SHA1 Message Date
Zlatin Balevsky
77e48b01bb Release 0.2.0 2019-06-15 21:10:11 +01:00
Zlatin Balevsky
12db6857c1 disable unshare files popup until implemented 2019-06-15 12:12:08 +01:00
Zlatin Balevsky
acd67733a5 sort the downloads table on updates 2019-06-15 12:08:29 +01:00
Zlatin Balevsky
8d3ce7aa8e use the same sorted row selection logic in downloads table 2019-06-15 09:57:12 +01:00
Zlatin Balevsky
0eb5870e9b Release 0.1.13 2019-06-15 09:19:19 +01:00
Zlatin Balevsky
051efbfaba prevent empty searches 2019-06-15 09:11:42 +01:00
Zlatin Balevsky
6b38d7bffb fix sorting bug try 2 2019-06-15 08:58:51 +01:00
Zlatin Balevsky
5778d537ce Release 0.1.12 2019-06-15 08:39:19 +01:00
Zlatin Balevsky
93664a7985 update readme 2019-06-15 08:37:29 +01:00
Zlatin Balevsky
edd58e0c90 allow cancelling of downloads while hashlist is being fetched 2019-06-15 08:35:23 +01:00
Zlatin Balevsky
9ac52b61dc sort results table on update 2019-06-15 08:33:22 +01:00
Zlatin Balevsky
0a4b9c7029 shut down connection manager last 2019-06-15 08:20:10 +01:00
Zlatin Balevsky
87b366a205 add ability to cancel failed downloads 2019-06-14 22:49:56 +01:00
8 changed files with 19 additions and 13 deletions

View File

@@ -31,4 +31,3 @@ The first time you run MuWire it will ask you to select a nickname. This nickna
### Known bugs and limitations
* Many UI features you would expect are not there yet
* Sorting the results table sometimes causes the wrong result to be downloaded

View File

@@ -34,7 +34,7 @@ class Cli {
Core core
try {
core = new Core(props, home, "0.1.11")
core = new Core(props, home, "0.2.0")
} catch (Exception bad) {
bad.printStackTrace(System.out)
println "Failed to initialize core, exiting"

View File

@@ -53,7 +53,7 @@ class CliDownloader {
Core core
try {
core = new Core(props, home, "0.1.11")
core = new Core(props, home, "0.2.0")
} catch (Exception bad) {
bad.printStackTrace(System.out)
println "Failed to initialize core, exiting"

View File

@@ -234,14 +234,14 @@ public class Core {
}
public void shutdown() {
log.info("shutting down connection manager")
connectionManager.shutdown()
log.info("shutting down download manageer")
downloadManager.shutdown()
log.info("shutting down connection acceeptor")
connectionAcceptor.stop()
log.info("shutting down connection establisher")
connectionEstablisher.stop()
log.info("shutting down connection manager")
connectionManager.shutdown()
}
static main(args) {
@@ -268,7 +268,7 @@ public class Core {
}
}
Core core = new Core(props, home, "0.1.11")
Core core = new Core(props, home, "0.2.0")
core.startServices()
// ... at the end, sleep or execute script

View File

@@ -1,5 +1,5 @@
group = com.muwire
version = 0.1.11
version = 0.2.0
groovyVersion = 2.4.15
slf4jVersion = 1.7.25
spockVersion = 1.1-groovy-2.4

View File

@@ -39,6 +39,9 @@ class MainFrameController {
cardsPanel.getLayout().show(cardsPanel, "search window")
def search = builder.getVariable("search-field").text
search = search.trim()
if (search.length() == 0)
return
def uuid = UUID.randomUUID()
Map<String, Object> params = new HashMap<>()
params["search-terms"] = search
@@ -86,16 +89,17 @@ class MainFrameController {
return
def sortEvt = group.view.lastSortEvent
if (sortEvt != null) {
row = sortEvt.convertPreviousRowIndexToModel(row)
}
row = group.view.resultsTable.rowSorter.convertRowIndexToModel(row)
}
group.model.results[row]
}
private int selectedDownload() {
def selected = builder.getVariable("downloads-table").getSelectedRow()
def downloadsTable = builder.getVariable("downloads-table")
def selected = downloadsTable.getSelectedRow()
def sortEvt = mvcGroup.view.lastDownloadSortEvent
if (sortEvt != null)
selected = sortEvt.convertPreviousRowIndexToModel(selected)
selected = downloadsTable.rowSorter.convertRowIndexToModel(selected)
selected
}

View File

@@ -280,11 +280,12 @@ class MainFrameView {
switch(downloader.getCurrentState()) {
case Downloader.DownloadState.CONNECTING :
case Downloader.DownloadState.DOWNLOADING :
case Downloader.DownloadState.HASHLIST:
model.cancelButtonEnabled = true
model.retryButtonEnabled = false
break
case Downloader.DownloadState.FAILED:
model.cancelButtonEnabled = false
model.cancelButtonEnabled = true
model.retryButtonEnabled = true
break
default:
@@ -298,6 +299,7 @@ class MainFrameView {
downloadsTable.setDefaultRenderer(Integer.class, centerRenderer)
downloadsTable.rowSorter.addRowSorterListener({evt -> lastDownloadSortEvent = evt})
downloadsTable.rowSorter.setSortsOnUpdates(true)
// shared files table
def sharedFilesTable = builder.getVariable("shared-files-table")
@@ -322,7 +324,7 @@ class MainFrameView {
}
def showPopupMenu(JPopupMenu menu, MouseEvent event) {
menu.show(event.getComponent(), event.getX(), event.getY())
// menu.show(event.getComponent(), event.getX(), event.getY())
}
int selectedDownloaderRow() {

View File

@@ -97,6 +97,7 @@ class SearchTabView {
resultsTable.rowSorter.addRowSorterListener({ evt -> lastSortEvent = evt})
resultsTable.rowSorter.setSortsOnUpdates(true)
resultsTable.addMouseListener(new MouseAdapter() {
@Override