wip
authorNiki <david.roulet@uclouvain.be>
Thu, 7 Mar 2019 11:51:16 +0000 (12:51 +0100)
committerNiki <david.roulet@uclouvain.be>
Thu, 7 Mar 2019 11:51:16 +0000 (12:51 +0100)
src/be/nikiroo/fanfix/reader/tui/TuiReaderApplication.java
src/be/nikiroo/fanfix/reader/tui/TuiReaderMainWindow.java
src/be/nikiroo/fanfix/test/ConversionTest.java

index 1de62a46a2a420484cf7ea8fa54efee1d83cc692..89034e485c5f9b6ff79f3d1d4b40c8994e505956 100644 (file)
@@ -180,6 +180,7 @@ class TuiReaderApplication extends TApplication implements Reader {
                        } else {
                                main.setSource(source);
                        }
+                       main.maximize();
                }
        }
 
index 528ee3dc881540505a9c675379071a37e52fadac..b54d2cb695e45f87baf1ef70f9cf66aa01684a5b 100644 (file)
@@ -43,24 +43,28 @@ class TuiReaderMainWindow extends TWindow {
 
                this.reader = reader;
 
-               maximize();
-
                listKeys = new ArrayList<MetaData>();
                listItems = new ArrayList<String>();
 
                // TODO size + onResize
 
+               
+
+               addLabel("Search: ", 5, 3);
+               addField(15, 3, 5, true);
+               
                addLabel("Sort by: ", 5, 1);
                // -1 = no default index (0 means first,...) 1=height when visible, null
                // = action
+               List<String> data = Arrays.asList("(show all)", "Source", "Name", "Author");
+               // must be last so to be able to draw over the rest
+               // TODO: make it so we cannot add manual entries
+               // TODO: how to select the item via keyboard? why double-click via mouse?
                addComboBox(15, 1, 12,
-                               Arrays.asList("(show all)", "Source", "Name", "Author"), 0, 1,
+                               data, 0, Math.min(data.size()+1,getHeight()-1-1),
                                null);
 
-               addLabel("Search: ", 5, 3);
-               addField(15, 3, 12, true);
-
-               list = addList(listItems, 0, 5, getWidth(), getHeight(), new TAction() {
+               list = addList(listItems, 0, 7, getWidth(), getHeight(), new TAction() {
                        @Override
                        public void DO() {
                                MetaData meta = getSelectedMeta();
index 51b6deb4f817e6a2f451ead2d7b73f554a7795af..c59a3db15f739672d7bf1628f25afbc80dc98989 100644 (file)
@@ -172,11 +172,17 @@ class ConversionTest extends TestLauncher {
                        };
                }
 
-               List<String> resultFiles = Arrays.asList(resultDir.list(filter));
-               resultFiles.sort(null);
-               List<String> expectedFiles = Arrays.asList(expectedDir.list(filter));
-               expectedFiles.sort(null);
-
+               List<String> resultFiles;
+               List<String> expectedFiles;
+               {
+                       String[] resultArr = resultDir.list(filter);
+                       Arrays.sort(resultArr);
+                       resultFiles = Arrays.asList(resultArr);
+                       String[] expectedArr = expectedDir.list(filter);
+                       Arrays.sort(expectedArr);
+                       expectedFiles = Arrays.asList(expectedArr);
+               }
+               
                testCase.assertEquals(errMess, expectedFiles, resultFiles);
 
                for (int i = 0; i < resultFiles.size(); i++) {