mirror of https://github.com/zlatinb/muwire
externalize strings in options dialogs
parent
06ec8d1f39
commit
16b50ff93e
|
@ -16,6 +16,8 @@ import java.awt.Font
|
||||||
import com.muwire.core.Core
|
import com.muwire.core.Core
|
||||||
import com.muwire.core.MuWireSettings
|
import com.muwire.core.MuWireSettings
|
||||||
|
|
||||||
|
import static com.muwire.gui.Translator.trans
|
||||||
|
|
||||||
@ArtifactProviderFor(GriffonController)
|
@ArtifactProviderFor(GriffonController)
|
||||||
class OptionsController {
|
class OptionsController {
|
||||||
@MVCMember @Nonnull
|
@MVCMember @Nonnull
|
||||||
|
@ -260,7 +262,7 @@ class OptionsController {
|
||||||
void downloadLocation() {
|
void downloadLocation() {
|
||||||
def chooser = new JFileChooser()
|
def chooser = new JFileChooser()
|
||||||
chooser.setFileHidingEnabled(false)
|
chooser.setFileHidingEnabled(false)
|
||||||
chooser.setDialogTitle("Select location for downloaded files")
|
chooser.setDialogTitle(trans("OPTIONS_SELECT_LOCATION_DOWNLOADED_FILES"))
|
||||||
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)
|
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)
|
||||||
int rv = chooser.showOpenDialog(null)
|
int rv = chooser.showOpenDialog(null)
|
||||||
if (rv == JFileChooser.APPROVE_OPTION)
|
if (rv == JFileChooser.APPROVE_OPTION)
|
||||||
|
@ -271,7 +273,7 @@ class OptionsController {
|
||||||
void incompleteLocation() {
|
void incompleteLocation() {
|
||||||
def chooser = new JFileChooser()
|
def chooser = new JFileChooser()
|
||||||
chooser.setFileHidingEnabled(false)
|
chooser.setFileHidingEnabled(false)
|
||||||
chooser.setDialogTitle("Select location for downloaded files")
|
chooser.setDialogTitle(trans("OPTIONS_SELECT_LOCATION_INCOMPLETE_FILES"))
|
||||||
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)
|
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)
|
||||||
int rv = chooser.showOpenDialog(null)
|
int rv = chooser.showOpenDialog(null)
|
||||||
if (rv == JFileChooser.APPROVE_OPTION)
|
if (rv == JFileChooser.APPROVE_OPTION)
|
||||||
|
@ -283,13 +285,13 @@ class OptionsController {
|
||||||
def chooser = new JFileChooser()
|
def chooser = new JFileChooser()
|
||||||
chooser.with {
|
chooser.with {
|
||||||
setFileHidingEnabled(false)
|
setFileHidingEnabled(false)
|
||||||
setDialogTitle("Select location of chat server welcome file")
|
setDialogTitle(trans("OPTIONS_SELECT_CHAT_SERVER_FILE"))
|
||||||
setFileSelectionMode(JFileChooser.FILES_ONLY)
|
setFileSelectionMode(JFileChooser.FILES_ONLY)
|
||||||
|
}
|
||||||
int rv = chooser.showOpenDialog(null)
|
int rv = chooser.showOpenDialog(null)
|
||||||
if (rv == JFileChooser.APPROVE_OPTION)
|
if (rv == JFileChooser.APPROVE_OPTION)
|
||||||
model.chatWelcomeFile = getSelectedFile().getAbsolutePath()
|
model.chatWelcomeFile = getSelectedFile().getAbsolutePath()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@ControllerAction
|
@ControllerAction
|
||||||
void automaticFont() {
|
void automaticFont() {
|
||||||
|
@ -328,6 +330,6 @@ class OptionsController {
|
||||||
void clearHistory() {
|
void clearHistory() {
|
||||||
uiSettings.searchHistory.clear()
|
uiSettings.searchHistory.clear()
|
||||||
saveUISettings()
|
saveUISettings()
|
||||||
JOptionPane.showMessageDialog(null, "Search history has been cleared")
|
JOptionPane.showMessageDialog(null, trans("OPTIONS_SEARCH_HISTORY_CLEARED"))
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -330,6 +330,12 @@ OPTIONS_ADVERTISE_CHAT=Advertise chat ability in search results
|
||||||
OPTIONS_MAX_CHAT_SCROLLBACK=Maximum lines of scrollback (-1 means unlimited)
|
OPTIONS_MAX_CHAT_SCROLLBACK=Maximum lines of scrollback (-1 means unlimited)
|
||||||
OPTIONS_CHAT_WELCOME_FILE=Welcome message file
|
OPTIONS_CHAT_WELCOME_FILE=Welcome message file
|
||||||
|
|
||||||
|
# Dialogs
|
||||||
|
OPTIONS_SELECT_LOCATION_DOWNLOADED_FILES=Select location for downloaded files
|
||||||
|
OPTIONS_SELECT_LOCATION_INCOMPLETE_FILES=Select location for incomplete files
|
||||||
|
OPTIONS_SELECT_CHAT_SERVER_FILE=Select chat server welcome text file
|
||||||
|
OPTIONS_SEARCH_HISTORY_CLEARED=Search history has been cleared
|
||||||
|
|
||||||
# Buttons panel
|
# Buttons panel
|
||||||
SAVE=Save
|
SAVE=Save
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue