FeedConfig.PreviousGroup?.let {
groups.selectedIndex = groups.indexOf(it)
}
+
+ feedCollection?.let { initUI(it) }
+ }
+
+ private fun initUI(feed: FeedCollection) {
+ name.setString(feed.name)
+ readstatus.selectedIndex = feed.itemStateMode
+ when(feed.maxItemAge) {
+ 0 -> autoDeleteOptions.selectedIndex = 0
+ -1 -> autoDeleteOptions.selectedIndex = 1
+ else -> {
+ autoDeleteOptions.selectedIndex = 2
+ maxItemAge.setIntValue(feed.maxItemAge)
+ }
+ }
+ itemContent.selectedIndex = if(feed.internalBrowser) 1 else 0
+
+ val feeds = Database.getCollectionFeeds(feed)
+ val uris = feeds.map { it.uri }.joinToString("\n")
+
+ urls.setText(uris)
+
+ if(feeds.isNotEmpty()) {
+ user.setString(feeds[0].user)
+ password.setString(feeds[0].password)
+ }
}
fun addFeed() {