From: Olaf Wintermann Date: Tue, 28 Oct 2025 15:57:30 +0000 (+0100) Subject: add menu items for adding feeds and folders X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=33340db84749d44f6150ed9dc53eee53eb11d9ef;p=rssreader.git add menu items for adding feeds and folders --- diff --git a/rss-application/src/main/kotlin/de/unixwork/rssreader/App.kt b/rss-application/src/main/kotlin/de/unixwork/rssreader/App.kt index bf9e18c..31cf151 100644 --- a/rss-application/src/main/kotlin/de/unixwork/rssreader/App.kt +++ b/rss-application/src/main/kotlin/de/unixwork/rssreader/App.kt @@ -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") diff --git a/rss-application/src/main/kotlin/de/unixwork/rssreader/FeedConfig.kt b/rss-application/src/main/kotlin/de/unixwork/rssreader/FeedConfig.kt index 46525cb..7d3397c 100644 --- a/rss-application/src/main/kotlin/de/unixwork/rssreader/FeedConfig.kt +++ b/rss-application/src/main/kotlin/de/unixwork/rssreader/FeedConfig.kt @@ -52,7 +52,7 @@ class FeedConfig(toplevel: Toplevel) { fill = true) { row { - rlabel("Category") + rlabel("Folder") dropdown(value = groups, hexpand = true, colspan = 2) { elm, column -> elm.name } diff --git a/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt b/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt index 7fd2791..ec7c95a 100644 --- a/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt +++ b/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt @@ -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",