mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
[vfs] localizable fsnotifier messages
GitOrigin-RevId: 4757b274e7b87548d6110b0372b2c64d8fae6db5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2e7b1ffa65
commit
7a47d99d43
Binary file not shown.
Binary file not shown.
@@ -2,21 +2,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define VERSION "20191018.1702"
|
||||
#define VERSION "20200827.1844"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
// messaging
|
||||
typedef enum {
|
||||
MSG_INSTANCE_LIMIT, MSG_WATCH_LIMIT
|
||||
} MSG;
|
||||
|
||||
void message(MSG id);
|
||||
|
||||
|
||||
// logging
|
||||
// messaging and logging
|
||||
void message(const char *text);
|
||||
void userlog(int priority, const char* format, ...);
|
||||
|
||||
#define CHECK_NULL(p, r) if (p == NULL) { userlog(LOG_ERR, "out of memory"); return r; }
|
||||
|
||||
@@ -62,7 +62,7 @@ bool init_inotify() {
|
||||
int e = errno;
|
||||
userlog(LOG_ERR, "inotify_init: %s", strerror(e));
|
||||
if (e == EMFILE) {
|
||||
message(MSG_INSTANCE_LIMIT);
|
||||
message("inotify.instance.limit");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -189,7 +189,7 @@ static int add_watch(int path_len, watch_node* parent) {
|
||||
static void watch_limit_reached() {
|
||||
if (!limit_reached) {
|
||||
limit_reached = true;
|
||||
message(MSG_WATCH_LIMIT);
|
||||
message("inotify.watch.limit");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,14 +33,6 @@
|
||||
#define HELP_MSG \
|
||||
"Try 'fsnotifier --help' for more information.\n"
|
||||
|
||||
#define INSTANCE_LIMIT_TEXT \
|
||||
"The <b>inotify</b>(7) instances limit reached. " \
|
||||
"<a href=\"https://confluence.jetbrains.com/display/IDEADEV/Inotify+Instances+Limit\">More details.</a>\n"
|
||||
|
||||
#define WATCH_LIMIT_TEXT \
|
||||
"The current <b>inotify</b>(7) watch limit is too low. " \
|
||||
"<a href=\"https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit\">More details.</a>\n"
|
||||
|
||||
#define MISSING_ROOT_TIMEOUT 1
|
||||
|
||||
#define UNFLATTEN(root) (root[0] == '|' ? root + 1 : root)
|
||||
@@ -152,16 +144,8 @@ static void init_log() {
|
||||
}
|
||||
|
||||
|
||||
void message(MSG id) {
|
||||
if (id == MSG_INSTANCE_LIMIT) {
|
||||
output("MESSAGE\n" INSTANCE_LIMIT_TEXT);
|
||||
}
|
||||
else if (id == MSG_WATCH_LIMIT) {
|
||||
output("MESSAGE\n" WATCH_LIMIT_TEXT);
|
||||
}
|
||||
else {
|
||||
userlog(LOG_ERR, "unknown message: %d", id);
|
||||
}
|
||||
void message(const char *text) {
|
||||
output("MESSAGE\n%s\n", text);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -640,6 +640,12 @@ watcher.exe.not.exe=Native file watcher is not executable: <a href="{0}">{0}</a>
|
||||
watcher.failed.to.start=File watcher failed to start
|
||||
watcher.gave.up=File watcher gave up to operate
|
||||
watcher.non.watchable.project=Project files cannot be watched (are they under network mount?)
|
||||
# suppress inspection "UnusedProperty"
|
||||
inotify.instance.limit=The <b>inotify</b>(7) instances limit reached. \
|
||||
<a href="https://confluence.jetbrains.com/display/IDEADEV/Inotify+Instances+Limit">More details.</a>
|
||||
# suppress inspection "UnusedProperty"
|
||||
inotify.watch.limit=The current <b>inotify</b>(7) watch limit is too low. \
|
||||
<a href="https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit">More details.</a>
|
||||
|
||||
fs.case.sensitivity.mismatch.title=Filesystem Case-Sensitivity Mismatch
|
||||
fs.case.sensitivity.mismatch.message=\
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
package com.intellij.openapi.application;
|
||||
|
||||
import com.intellij.DynamicBundle;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.PropertyKey;
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@@ -13,20 +10,18 @@ import java.util.function.Supplier;
|
||||
* Provides access to localized properties of the IntelliJ Platform.
|
||||
*/
|
||||
public final class ApplicationBundle extends DynamicBundle {
|
||||
@NonNls public static final String BUNDLE = "messages.ApplicationBundle";
|
||||
private static final ApplicationBundle INSTANCE = new ApplicationBundle();
|
||||
public static final String BUNDLE = "messages.ApplicationBundle";
|
||||
public static final ApplicationBundle INSTANCE = new ApplicationBundle();
|
||||
|
||||
private ApplicationBundle() {
|
||||
super(BUNDLE);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static @Nls String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, Object @NotNull ... params) {
|
||||
public static @NotNull @Nls String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, Object @NotNull ... params) {
|
||||
return INSTANCE.getMessage(key, params);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Supplier<@Nls String> messagePointer(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, Object @NotNull ... params) {
|
||||
public static @NotNull Supplier<@Nls String> messagePointer(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, Object @NotNull ... params) {
|
||||
return INSTANCE.getLazyMessage(key, params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,8 +364,9 @@ public class NativeFileWatcherImpl extends PluggableFileWatcher {
|
||||
}
|
||||
}
|
||||
else if (myLastOp == WatcherOp.MESSAGE) {
|
||||
LOG.warn(line);
|
||||
notifyOnFailure(line, NotificationListener.URL_OPENING_LISTENER);
|
||||
String localized = Objects.requireNonNullElse(ApplicationBundle.INSTANCE.messageOrNull(line), line); //NON-NLS
|
||||
LOG.warn(localized);
|
||||
notifyOnFailure(localized, NotificationListener.URL_OPENING_LISTENER);
|
||||
myLastOp = null;
|
||||
}
|
||||
else if (myLastOp == WatcherOp.REMAP || myLastOp == WatcherOp.UNWATCHEABLE) {
|
||||
|
||||
Reference in New Issue
Block a user