]> uap-core.de Git - rssreader.git/commitdiff
add menu items for adding feeds and folders
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Tue, 28 Oct 2025 15:57:30 +0000 (16:57 +0100)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Tue, 28 Oct 2025 15:57:30 +0000 (16:57 +0100)
rss-application/src/main/kotlin/de/unixwork/rssreader/App.kt
rss-application/src/main/kotlin/de/unixwork/rssreader/FeedConfig.kt
rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt

index bf9e18cb1441b7bce9cf971b0bbc6b0abf5efc73..31cf1513febe41085b42a72878e183741a6854ae 100644 (file)
@@ -60,6 +60,15 @@ object App : Application {
         }
     }
 
+    fun markAllAsRead() {
+        GlobalScope.launch(Dispatchers.IO) {
+            Database.updateAllItems(true)
+            GlobalScope.launch(ToolkitDispatcher) {
+                window?.reload()
+            }
+        }
+    }
+
     fun initToolbar() {
         toolbarItem(name = "reloadFeed", icon = "view-refresh", tooltip = "Refresh current feed") { event ->
             syncCurrent()
@@ -76,6 +85,13 @@ object App : Application {
         }
 
         toolbarAppMenu {
+            menuItem(label = "Add Feed") {
+                window?.createFeedDialog()
+            }
+            menuItem(label = "Add Folder") {
+                window?.createCategoryDialog()
+            }
+            separator()
             menuItem(label = "Update All") {
                 syncAll()
             }
@@ -87,12 +103,7 @@ object App : Application {
                 markCurrentFeedAsRead()
             }
             menuItem(label = "Mark All as Read") {
-                GlobalScope.launch(Dispatchers.IO) {
-                    Database.updateAllItems(true)
-                    GlobalScope.launch(ToolkitDispatcher) {
-                        window?.reload()
-                    }
-                }
+                markAllAsRead()
             }
             separator()
             radioItem(label = "Open item with default settings", varname = "browserSetting")
index 46525cb9e7750f377d1066f26a80ffe327ac232c..7d3397cd22b4640c63acddce62cca70ed91c15e1 100644 (file)
@@ -52,7 +52,7 @@ class FeedConfig(toplevel: Toplevel) {
                 fill = true)
             {
                 row {
-                    rlabel("Category")
+                    rlabel("Folder")
                     dropdown<FeedGroup>(value = groups, hexpand = true, colspan = 2) { elm, column ->
                         elm.name
                     }
index 7fd27916038b2c2627f7a0bd933b963ca75670c5..ec7c95a30c29186713a1537f5d75de83898955ba 100644 (file)
@@ -211,7 +211,7 @@ class MainWindow() {
         }
     }
 
-    private fun createFeedDialog() {
+    fun createFeedDialog() {
         var feedConfig: FeedConfig? = null
         val w = dialogWindow(
             parent = window.ui,
@@ -235,11 +235,11 @@ class MainWindow() {
         w.show()
     }
 
-    private fun createCategoryDialog() {
+    fun createCategoryDialog() {
         var name: UiString? = null
         val w = dialogWindow(
             parent = window.ui,
-            title = "Add Category",
+            title = "Add Folder",
             defaultButton = 1,
             lbutton1 = "Add",
             rbutton4 = "Cancel",