Giter Club home page Giter Club logo

Comments (9)

krlvm avatar krlvm commented on May 24, 2024

Yes, standard interfaces are fully available to you, and you can call readTextFile from your plugin's main class to read any file in configs directory, like it is used here.

Didn't really think of a way to obtain configuration directory at runtime, I will add a method for that in the next version, you can just hardcode it at the moment.

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 24, 2024

Yes, standard interfaces are fully available to you, and you can call readTextFile from your plugin's main class to read any file in configs directory, like it is used here.

Didn't really think of a way to obtain configuration directory at runtime, I will add a method for that in the next version, you can just hardcode it at the moment.

oh okay okay thanks, and, can you make Error Messagebox for Plugins please

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 24, 2024

example, if user didnt put anything at user input, it will show error messagebox on android, or when user press start button, the app wil show error message

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 24, 2024

Yes, standard interfaces are fully available to you, and you can call readTextFile from your plugin's main class to read any file in configs directory, like it is used here.

Didn't really think of a way to obtain configuration directory at runtime, I will add a method for that in the next version, you can just hardcode it at the moment.

oh yeah, btw, i mean like file user interface, so user can select the file

from powertunnel-android.

krlvm avatar krlvm commented on May 24, 2024

example, if user didnt put anything at user input, it will show error messagebox on android, or when user press start button, the app wil show error message

You can throw an exception and its message will be shown to user

oh yeah, btw, i mean like file user interface, so user can select the file

I intended this as a tool primarily for an advanced users, but I'll consider adding such feature.
If you a built-in text file editor, you can declare additional config files in plugin manifest like this, and then long-press a gear in plugin list to access it.

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 24, 2024

You can throw an exception and its message will be shown to user

Sorry, can you make the example code?

Thanks

from powertunnel-android.

krlvm avatar krlvm commented on May 24, 2024
public class MyPlugin extends PowerTunnelPlugin {

    @Override
    public void onProxyInitialization(@NotNull ProxyServer proxy) {
        // ...
        if (somethingIsWrong) {
            throw new Exception("Error message");
        }
        // ...
    }

}

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 24, 2024

ohh okay okay, and it will show the dialog error?

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 24, 2024

okay okay thanks

from powertunnel-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.