Skip to content
Snippets Groups Projects
Commit a99eac70 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Implement buffer renaming for query buffers

parent 9d317727
No related branches found
No related tags found
No related merge requests found
...@@ -95,6 +95,25 @@ class BufferViewConfigFragment : ServiceBoundFragment() { ...@@ -95,6 +95,25 @@ class BufferViewConfigFragment : ServiceBoundFragment() {
actionMode?.finish() actionMode?.finish()
true true
} }
R.id.action_rename -> {
MaterialDialog.Builder(activity!!)
.input(
getString(R.string.label_buffer_name),
info.bufferName,
false
) { _, input ->
session.bufferSyncer?.requestRenameBuffer(selected.info.bufferId, input.toString())
}
.positiveText(R.string.label_save)
.negativeText(R.string.label_cancel)
.negativeColorAttr(R.attr.colorTextPrimary)
.backgroundColorAttr(R.attr.colorBackgroundCard)
.contentColorAttr(R.attr.colorTextPrimary)
.build()
.show()
actionMode?.finish()
true
}
R.id.action_unhide -> { R.id.action_unhide -> {
bufferSyncer?.let { bufferSyncer?.let {
bufferViewConfig?.requestAddBuffer(info, bufferSyncer) bufferViewConfig?.requestAddBuffer(info, bufferSyncer)
...@@ -214,6 +233,7 @@ class BufferViewConfigFragment : ServiceBoundFragment() { ...@@ -214,6 +233,7 @@ class BufferViewConfigFragment : ServiceBoundFragment() {
R.id.action_join, R.id.action_join,
R.id.action_part, R.id.action_part,
R.id.action_delete, R.id.action_delete,
R.id.action_rename,
R.id.action_unhide, R.id.action_unhide,
R.id.action_hide_temp, R.id.action_hide_temp,
R.id.action_hide_perm R.id.action_hide_perm
...@@ -252,7 +272,7 @@ class BufferViewConfigFragment : ServiceBoundFragment() { ...@@ -252,7 +272,7 @@ class BufferViewConfigFragment : ServiceBoundFragment() {
} + visibilityActions } + visibilityActions
} }
Buffer_Type.QueryBuffer -> { Buffer_Type.QueryBuffer -> {
setOf(R.id.action_delete) + visibilityActions setOf(R.id.action_delete, R.id.action_rename) + visibilityActions
} }
else -> visibilityActions else -> visibilityActions
} }
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
<item <item
android:id="@+id/action_delete" android:id="@+id/action_delete"
android:title="@string/label_delete" /> android:title="@string/label_delete" />
<item
android:id="@+id/action_rename"
android:title="@string/label_rename" />
<item <item
android:id="@+id/action_unhide" android:id="@+id/action_unhide"
android:title="@string/label_unhide" android:title="@string/label_unhide"
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<string name="connection_service_title">Connection Service</string> <string name="connection_service_title">Connection Service</string>
<string name="connection_service_description">Keeps a connection to your core to allow for notifications, and to transmit messages.</string> <string name="connection_service_description">Keeps a connection to your core to allow for notifications, and to transmit messages.</string>
<string name="label_buffer_name">Buffer Name</string>
<string name="label_cancel">Cancel</string> <string name="label_cancel">Cancel</string>
<string name="label_clear_backlog">Clear Backlog</string> <string name="label_clear_backlog">Clear Backlog</string>
<string name="label_close">Close</string> <string name="label_close">Close</string>
...@@ -15,14 +16,17 @@ ...@@ -15,14 +16,17 @@
<string name="label_hide_temp">Hide Temporarily</string> <string name="label_hide_temp">Hide Temporarily</string>
<string name="label_input_history">Input History</string> <string name="label_input_history">Input History</string>
<string name="label_join">Join</string> <string name="label_join">Join</string>
<string name="label_no">No</string>
<string name="label_open">Open</string> <string name="label_open">Open</string>
<string name="label_part">Part</string> <string name="label_part">Part</string>
<string name="label_placeholder">Write a message…</string> <string name="label_placeholder">Write a message…</string>
<string name="label_rename">Rename</string>
<string name="label_save">Save</string> <string name="label_save">Save</string>
<string name="label_select_multiple">Select</string> <string name="label_select_multiple">Select</string>
<string name="label_settings">Settings</string> <string name="label_settings">Settings</string>
<string name="label_show_hidden">Show Hidden</string> <string name="label_show_hidden">Show Hidden</string>
<string name="label_unhide">Make Visible</string> <string name="label_unhide">Make Visible</string>
<string name="label_yes">Yes</string>
<string name="label_status_disconnected">Disconnected</string> <string name="label_status_disconnected">Disconnected</string>
<string name="label_status_connecting">Connecting</string> <string name="label_status_connecting">Connecting</string>
...@@ -36,6 +40,4 @@ ...@@ -36,6 +40,4 @@
<string name="notification_channel_highlight_title">Highlight</string> <string name="notification_channel_highlight_title">Highlight</string>
<string name="buffer_delete_confirmation">Do you want to delete this buffer permanently?</string> <string name="buffer_delete_confirmation">Do you want to delete this buffer permanently?</string>
<string name="label_yes">Yes</string>
<string name="label_no">No</string>
</resources> </resources>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment