Package org.gudy.azureus2.plugins

Examples of org.gudy.azureus2.plugins.PluginConfig


    {
    config_model.addLabelParameter2("AzTrackerFind.url.winlabel");
    }
   
    config_model.addLabelParameter2("AzTrackerFind.label.close" );
    PluginConfig config_getter = pluginInterface.getPluginconfig();
    boolean autoOpen = config_getter.getPluginBooleanParameter("AutoOpen");
   
   
   
    newView = new View(pluginInterface);
   
View Full Code Here


    /**
     * Returns the user set status of whether or not the plugin should autoOpen
     * @return boolean autoOpen
     */
    public static boolean isPluginAutoOpen(){
        PluginConfig config_getter = getPluginInterface().getPluginconfig();
        return config_getter.getPluginBooleanParameter("firefrog_auto_open",true);
    }
View Full Code Here

        //listener for button
        modBlockButton.addListener(SWT.Selection, new Listener() {
            public void handleEvent(Event e) {
                try {
                    PluginConfig config = Plugin.getPluginInterface().getPluginconfig();
                    config.setPluginParameter("Stuffer_Block_Mods",modBlockButton.getSelection());
                    config.save();

                } catch (PluginException e1) {
                    e1.printStackTrace();
                }
            }
        });

        final Label colorLabel = new Label(modBlockComp,SWT.BORDER);
        gridData = new GridData(GridData.BEGINNING);
        gridData.widthHint = 20;
        colorLabel.setLayoutData(gridData);

        colorLabel.setToolTipText("Double click to change the color");

        //Set Initial Color
        RGB rgb = Utils.getRGB(Plugin.getPluginInterface().getPluginconfig().getPluginStringParameter("Stuffer_Block_Mods_Color","r255g0b0"));
        Color color = new Color(Plugin.getDisplay(),rgb);
        colorLabel.setBackground(color);
        color.dispose();

        colorLabel.addListener(SWT.MouseDoubleClick, new Listener() {
            public void handleEvent(Event e) {

                //Choose color
                ColorDialog colorDialog1 = new ColorDialog(colorLabel.getShell());
                colorDialog1.setText("Choose Color for Client");
                colorDialog1.setRGB(colorLabel.getBackground().getRGB());
                RGB selectedColor = colorDialog1.open();

                if(selectedColor != null){
                    Color color = new Color(Plugin.getDisplay(),
                            selectedColor.red,
                            selectedColor.green,
                            selectedColor.blue);
                    colorLabel.setBackground(color);
                    color.dispose();
                    String newColorString = "r"+colorLabel.getBackground().getRed() + "g" + colorLabel.getBackground().getGreen() + "b" + colorLabel.getBackground().getBlue();
                    PluginConfig config = Plugin.getPluginInterface().getPluginconfig();
                    config.setPluginParameter("Stuffer_Block_Mods_Color",newColorString);
                    try {
                        config.save();
                    } catch (PluginException e1) {

                        e1.printStackTrace();
                    }

                }

            }
        });

        Label MOD_block_label = new Label(modBlockComp,SWT.NULL);
        MOD_block_label.setText("     Total Blocks: ");

        MOD_block_num = new Label (modBlockComp,SWT.NULL);
        MOD_block_num.setText(String.valueOf(Constants.MOD_CLIENT_BLOCKS));


        //second rule
        //-------------

        final Button badBlockButton = new Button(modBlockComp,SWT.CHECK);
        badBlockButton.setText("Force Stuffer to block ALL seeds (Allows downloading from only peers)");

        //set the selection to the user preferences
        badBlockButton.setSelection(Plugin.getPluginInterface().getPluginconfig().getPluginBooleanParameter("Stuffer_Block_Seeder",false));



        //listener for button
        badBlockButton.addListener(SWT.Selection, new Listener() {
            public void handleEvent(Event e) {
                try {
                    PluginConfig config = Plugin.getPluginInterface().getPluginconfig();
                    config.setPluginParameter("Stuffer_Block_Seeder",badBlockButton.getSelection());
                    config.save();

                } catch (PluginException e1) {
                    e1.printStackTrace();
                }
            }
        });

        final Label colorLabel_bad = new Label(modBlockComp,SWT.BORDER);
        gridData = new GridData(GridData.BEGINNING);
        gridData.widthHint = 20;
        colorLabel_bad.setLayoutData(gridData);

        colorLabel_bad.setToolTipText("Double click to change the color");

        //Set Initial Color
        RGB rgb_bad = Utils.getRGB(Plugin.getPluginInterface().getPluginconfig().getPluginStringParameter("Stuffer_Block_Bad_Color","r0g255b0"));
        Color color_bad = new Color(Plugin.getDisplay(),rgb_bad);
        colorLabel_bad.setBackground(color_bad);
        color_bad.dispose();

        colorLabel_bad.addListener(SWT.MouseDoubleClick, new Listener() {
            public void handleEvent(Event e) {

                //Choose color
                ColorDialog colorDialog1 = new ColorDialog(colorLabel_bad.getShell());
                colorDialog1.setText("Choose Color for Client");
                colorDialog1.setRGB(colorLabel_bad.getBackground().getRGB());
                RGB selectedColor = colorDialog1.open();

                if(selectedColor != null){
                    Color color = new Color(Plugin.getDisplay(),
                            selectedColor.red,
                            selectedColor.green,
                            selectedColor.blue);
                    colorLabel_bad.setBackground(color);
                    color.dispose();
                    String newColorString = "r"+colorLabel_bad.getBackground().getRed() + "g" + colorLabel_bad.getBackground().getGreen() + "b" + colorLabel_bad.getBackground().getBlue();
                    PluginConfig config = Plugin.getPluginInterface().getPluginconfig();
                    config.setPluginParameter("Stuffer_Block_Seeder_Color",newColorString);
                    try {
                        config.save();
                    } catch (PluginException e1) {

                        e1.printStackTrace();
                    }
View Full Code Here

   
   
    this.composite = new Composite(parent,SWT.NULL);
    stack = new StackX(5);
    //Config getter
    PluginConfig config_getter = pluginInterface.getPluginconfig();
    port1 = config_getter.getPluginIntParameter("webpeer_port1");
    port2 = config_getter.getPluginIntParameter("webpeer_port2");
    port3 = config_getter.getPluginIntParameter("webpeer_port3");
    VERSION_TIMEOUT_MILLIS = (config_getter.getPluginIntParameter("timeout_value")*1000);
    url_user = config_getter.getPluginStringParameter( "webpeer_url_user");
    url_password = config_getter.getPluginStringParameter( "webpeer_url_password");
   
    url_autoinsert = config_getter.getPluginBooleanParameter( "webpeer_autoinsert", false);
    //System.out.println(url_autoinsert);
   
    if (OSName.equalsIgnoreCase("Linux"))
        {
      url_commandline = config_getter.getPluginStringParameter( "webpeer_url_commandline");
        }
        else if (OSName.equalsIgnoreCase("Mac OS X"))
        {
          url_commandline = config_getter.getPluginStringParameter( "webpeer_url_commandline");
        }
   
   
   
    GridLayout layout = new GridLayout();
View Full Code Here

    {
    config_model.addLabelParameter2("webpeer.url.winlabel");
    }
   
    config_model.addLabelParameter2("webpeer.label.close" );
    PluginConfig config_getter = pluginInterface.getPluginconfig();
    boolean autoOpen = config_getter.getPluginBooleanParameter("AutoOpen");
    //System.out.print("AutoInsert: " + config_getter.getPluginBooleanParameter("webpeer_autoinsert"));
   
   
    newView = new View(pluginInterface);
   
View Full Code Here

    /**
     * Returns the user set status of whether or not the plugin should autoOpen
     * @return boolean autoOpen
     */
    public static boolean isPluginAutoOpen(){
        PluginConfig config_getter = getPluginInterface().getPluginconfig();
        return config_getter.getPluginBooleanParameter("userspace_auto_open",true);
    }
View Full Code Here

public class Downloader {

    public static void generic_getter(final String inet_address, final String url, final String dir_to_save, final String filename, final PluginInterface pluginInterface, final Display display){
       
        try{
            final PluginConfig config_getter = pluginInterface.getPluginconfig();
           
           
           
            ResourceDownloaderFactory rdf;
            URL url_get = new URL (url);
            rdf = pluginInterface.getUtilities().getResourceDownloaderFactory();
           
           
            //normal resource downloader
            ResourceDownloader rd_t = rdf.create(
                    url_get,
                    config_getter.getPluginStringParameter( "AzTrackerFind_url_user"),
                    config_getter.getPluginStringParameter( "AzTrackerFind_url_password"));
           
            rd_t = rdf.getRetryDownloader(rd_t, 3);
           
            rd_t = rdf.getTimeoutDownloader(rd_t,(config_getter.getPluginIntParameter("timeout_value")*1000));
            rd_t = rdf.getSuffixBasedDownloader(rd_t);
           
            
         
         
          //Listener for rd_t (normal downloader)
          rd_t.addListener(new ResourceDownloaderListener()
                    {
                        public boolean
                        completed(
                            final ResourceDownloader downloader,
                            InputStream data )
                        {
                            boolean isAz = false;
                            int seeds = 0;
                            try{
                            FileOutputStream file = new FileOutputStream(dir_to_save + filename);
                  BufferedOutputStream out = new BufferedOutputStream(file);
                 
                  int j;
                  j = 0;
                  while ((j = data.read()) != -1) {
                    out.write(j);
                  }
                  out.flush();
                  out.close();                         
                 
                  File file_to_read = new File (dir_to_save + filename);
                  BufferedReader bir = new BufferedReader(new FileReader(file_to_read));
                  String temp_line;
                 
                  while((temp_line=bir.readLine())!=null)
                  {
                      //System.out.println("FOUND!!!! " + temp_line);
                      if (temp_line.startsWith("<title>Azureus"))
                      {
                         isAz=true;
                        
                                
                      }
                      if (temp_line.startsWith("                <td> <a href=") || temp_line.startsWith("                  <td> <a href="))
                      {
                          String[] parsed = Parser.getTorrentUrl(temp_line);
                         
                          //System.out.println(url+parsed[1] + " : " + parsed[2]); 
                          if(!parsed[1].equals("none"))
                          {
                              seeds++;
                              View.addTableElementDouble(View.bookMarkedIPs,parsed[2],url+parsed[1],0);
                              if(config_getter.getPluginBooleanParameter("AutoDownload")){
                                  TorrentUtils.torrent_save(url+parsed[1],parsed[2],pluginInterface);
                              }
                          }
                         
                          //System.out.println("FOUND!!!! " + temp_line);
                      }
                  }
                  bir.close();
                  file_to_read.delete();
                  data.close();
                  if(isAz)
                  {
                      InetAddress inet = InetAddress.getByName(inet_address);
                   String dnsName = inet.getHostName();
                   View.addTableElementDouble(View.webPositiveIPs,(inet_address + ":" + 6969), dnsName, seeds);
                      rss_tester("http://" + inet_address + ":6969/rss_feed.xml",pluginInterface);
                   PluginConfig config_getter = pluginInterface.getPluginconfig();
                      //System.out.println("Seeds: " + seeds + "  AutoAdd: " + config_getter.getPluginBooleanParameter("AzTrackerFind_autoinsert"));
                      if(seeds > 0 && config_getter.getPluginBooleanParameter("AzTrackerFind_autoinsert"))
                      {
                          Bookmarks.addBookmark(pluginInterface,display,inet_address + ":" + 6969,dnsName,new String("" + seeds),"N",Time.getCurrentTime(config_getter.getBooleanParameter("MilitaryTime")));
                         
                      }
                  }

                        }
View Full Code Here

        layout.numColumns = 3;
        composite.setLayout(layout);
       
        //Label
        title = new Label(composite,SWT.NULL);
        PluginConfig pc = pluginInterface.getPluginconfig();
       
        if(pc.getPluginStringParameter("ClientSpoof.clientid").equals("Off"))
        {
            title.setText("Name ClientSpoof is Currently Sending to Trackers: Spoofing is off");
        }
        else
        {
View Full Code Here

        accept.setText("Accept and Restart Later");
        accept.addListener(SWT.Selection, new Listener() {
          public void handleEvent(Event e) {
              if (shell!=null && !shell.isDisposed())
              {
                  PluginConfig config_getter = pluginInterface.getPluginconfig();
                  if(client1.getSelection())
                      config_getter.setPluginParameter("ClientSpoof.clientid", "Mainline_3_4_2");
                  else if(client6.getSelection())
                      config_getter.setPluginParameter("ClientSpoof.clientid", "Mainline_3_9_1");
                  else if(client7.getSelection())
                      config_getter.setPluginParameter("ClientSpoof.clientid", "BitTornado_0_3_10");
                  else if(client2.getSelection())
                      config_getter.setPluginParameter("ClientSpoof.clientid", "ABC_2_6_9");
                  else if(client3.getSelection())
                      config_getter.setPluginParameter("ClientSpoof.clientid", "Azureus_2_1_0_4");
                  else if(client5.getSelection())
                      config_getter.setPluginParameter("ClientSpoof.clientid", "Azureus_2_2_0_2");
                        else if(client8.getSelection())
                            config_getter.setPluginParameter("ClientSpoof.clientid", "BitComet_0_5_7");
                        else if(client4.getSelection())
                      config_getter.setPluginParameter("ClientSpoof.clientid", "Off");
                 
                  shell.dispose();
              }
          }
        });
       
        Button accept_restart = new Button(shell, SWT.PUSH);
        accept_restart.setText("Accept and Restart Azureus");
        accept_restart.addListener(SWT.Selection, new Listener() {
          public void handleEvent(Event e) {
              if (shell!=null && !shell.isDisposed())
              {
                  PluginConfig config_getter = pluginInterface.getPluginconfig();
                  if(client1.getSelection())
                      config_getter.setPluginParameter("ClientSpoof.clientid", "Mainline_3_4_2");
                  else if(client6.getSelection())
                      config_getter.setPluginParameter("ClientSpoof.clientid", "Mainline_3_9_1");
                  else if(client7.getSelection())
                      config_getter.setPluginParameter("ClientSpoof.clientid", "BitTornado_0_3_10");
                  else if(client2.getSelection())
                      config_getter.setPluginParameter("ClientSpoof.clientid", "ABC_2_6_9");
                  else if(client3.getSelection())
                      config_getter.setPluginParameter("ClientSpoof.clientid", "Azureus_2_1_0_4");
                  else if(client5.getSelection())
                      config_getter.setPluginParameter("ClientSpoof.clientid", "Azureus_2_2_0_2");
                        else if(client8.getSelection())
                            config_getter.setPluginParameter("ClientSpoof.clientid", "BitComet_0_5_7");
                  else if(client4.getSelection())
                      config_getter.setPluginParameter("ClientSpoof.clientid", "Off");
                 
                  shell.dispose();
                  UpdateManager um = pluginInterface.getUpdateManager();
                  try {
                            um.applyUpdates(true);
                        } catch (UpdateException e1) {
                            e1.printStackTrace();
                        }
                 
                 
              }
          }
        });
       
       
        Button cancel = new Button(shell, SWT.PUSH);
        cancel.setText("Cancel");
        cancel.addListener(SWT.Selection, new Listener() {
          public void handleEvent(Event e) {
              if (shell!=null && !shell.isDisposed())
              {
                  shell.dispose();
              }
          }
        });
        PluginConfig config_getter = pluginInterface.getPluginconfig();
       
        if(config_getter.getPluginStringParameter("ClientSpoof.clientid").equals("Mainline_3_4_2")){
             client1.setSelection(true);
             client6.setSelection(false);
             client7.setSelection(false);
             client2.setSelection(false);
             client3.setSelection(false);
             client5.setSelection(false);
                   client8.setSelection(false);
             client4.setSelection(false);
        }else if (config_getter.getPluginStringParameter("ClientSpoof.clientid").equals("Mainline_3_9_1")){
             client1.setSelection(false);
             client6.setSelection(true);
             client7.setSelection(false);
             client2.setSelection(false);
             client3.setSelection(false);
             client5.setSelection(false);
                   client8.setSelection(false);
             client4.setSelection(false);
        }else if (config_getter.getPluginStringParameter("ClientSpoof.clientid").equals("BitTornado_0_3_10")){
             client1.setSelection(false);
             client6.setSelection(false);
             client7.setSelection(true);
             client2.setSelection(false);
             client3.setSelection(false);
             client5.setSelection(false);
                   client8.setSelection(false);
             client4.setSelection(false);
        }else if (config_getter.getPluginStringParameter("ClientSpoof.clientid").equals("ABC_2_6_9")){
             client1.setSelection(false);
             client6.setSelection(false);
             client7.setSelection(false);
             client2.setSelection(true);
             client3.setSelection(false);
             client5.setSelection(false);
                   client8.setSelection(false);
             client4.setSelection(false);
        }else if (config_getter.getPluginStringParameter("ClientSpoof.clientid").equals("Azureus_2_1_0_4")){
             client1.setSelection(false);
             client6.setSelection(false);
             client7.setSelection(false);
             client2.setSelection(false);
             client3.setSelection(true);
             client5.setSelection(false);
                   client8.setSelection(false);
             client4.setSelection(false);
        }else if (config_getter.getPluginStringParameter("ClientSpoof.clientid").equals("Azureus_2_2_0_2")){
             client1.setSelection(false);
             client6.setSelection(false);
             client7.setSelection(false);
             client2.setSelection(false);
             client3.setSelection(false);
             client5.setSelection(true);
                   client8.setSelection(false);
             client4.setSelection(false);
            }else if (config_getter.getPluginStringParameter("ClientSpoof.clientid").equals("BitComet_0_5_7")){
                   client1.setSelection(false);
                   client6.setSelection(false);
                   client7.setSelection(false);
                   client2.setSelection(false);
                   client3.setSelection(false);
View Full Code Here

  public void
  load(
    PluginInterface  pluginInterface )
  {
   
    PluginConfig config_getter = pluginInterface.getPluginconfig();
    String clientID = config_getter.getPluginStringParameter("ClientSpoof.clientid", "Off");
    ClientIDGenerator gen;
    //System.out.println(clientID);
    if(clientID.equals("Mainline_3_4_2"))
    {
        PluginManager.getDefaults().setDefaultPluginEnabled( PluginManagerDefaults.PID_CLIENT_ID , false );
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.plugins.PluginConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.