Examples of MessageBoxShell


Examples of org.gudy.azureus2.ui.swt.shells.MessageBoxShell

              s += object.getClass() + ";" + object;
            }
            s += "\n";
          }
        }
        new MessageBoxShell(SWT.OK, "test", s).open(null);
        return true;
      }
    });
  }
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.MessageBoxShell

      Licence[] trial = featman.createLicences(new String[] {
        "dvdburn_trial"
      });
    } catch (Throwable e) {
      String s = "Creating Trial: " + Debug.getNestedExceptionMessage(e);
      new MessageBoxShell("Trial Error", s).open(null);
      Logger.log(new LogAlert(true, s, e));
    }
  }
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.MessageBoxShell

              }
            } catch (Throwable e) {
             
              String s = Debug.getNestedExceptionMessage(e);
             
              MessageBoxShell mb = new MessageBoxShell(
                  SWT.ICON_ERROR | SWT.OK,
                  "Licence Addition Error",
                  s );
             
              mb.open();
             
              Logger.log(new LogAlert(true, LogAlert.AT_ERROR, "Adding Licence",
                  e));
            }
          }
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.MessageBoxShell

  private static BrowserFunction browserFunction;

  public static void checkForDonationPopup() {
    if (shell != null) {
      if (DEBUG) {
        new MessageBoxShell(SWT.OK, "Donations Test", "Already Open").open(null);
      }
      return;
    }
   
    FeatureManager fm = PluginInitializer.getDefaultInterface().getUtilities().getFeatureManager();
   
    FeatureDetails[] fds = fm.getFeatureDetails( "core" );
   
    for ( FeatureDetails fd: fds ){
     
      if ( !fd.hasExpired()){
       
        return;
      }
    }

    long maxDate = COConfigurationManager.getLongParameter("donations.maxDate", 0);
    boolean force = maxDate > 0 && SystemTime.getCurrentTime() > maxDate ? true : false
   
    //Check if user has already donated first
    boolean alreadyDonated = COConfigurationManager.getBooleanParameter(
        "donations.donated", false);
    if (alreadyDonated && !force) {
      if (DEBUG) {
        new MessageBoxShell(SWT.OK, "Donations Test",
            "Already Donated! I like you.").open(null);
      }
      return;
    }
   
    OverallStats stats = StatsFactory.getStats();
    if (stats == null) {
      return;
    }

    long upTime = stats.getTotalUpTime();
    int hours = (int) (upTime / (60 * 60)); //secs * mins

    //Ask every DONATIONS_ASK_AFTER hours.
    int nextAsk = COConfigurationManager.getIntParameter(
        "donations.nextAskHours", 0);

    if (nextAsk == 0) {
      // First Time
      COConfigurationManager.setParameter("donations.nextAskHours", hours
          + initialAskHours);
      COConfigurationManager.save();
      if (DEBUG) {
        new MessageBoxShell(SWT.OK, "Donations Test",
            "Newbie. You're active for " + hours + ".").open(null);
      }
      return;
    }

    if (hours < nextAsk && !force) {
      if (DEBUG) {
        new MessageBoxShell(SWT.OK, "Donations Test", "Wait "
            + (nextAsk - hours) + ".").open(null);
      }
      return;
    }

    long minDate = COConfigurationManager.getLongParameter("donations.minDate",
        0);
    if (minDate > 0 && minDate > SystemTime.getCurrentTime()) {
      if (DEBUG) {
        new MessageBoxShell(SWT.OK, "Donation Test", "Wait "
            + ((SystemTime.getCurrentTime() - minDate) / 1000 / 3600 / 24)
            + " days").open(null);
      }
      return;
    }
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.MessageBoxShell

              Utils.execSWTThread(new AERunnable() {
                public void runSupport() {
                  Debug.out("Page Didn't Load:" + url);
                  shell.dispose();
                  if (showNoLoad) {
                    new MessageBoxShell(SWT.OK,
                        MessageText.getString("DonationWindow.noload.title"),
                        MessageText.getString("DonationWindow.noload.text",
                            new String[] {
                              url
                            })).open(null);
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.MessageBoxShell

               
                styles |= SWT.CANCEL;
              }
             

              MessageBoxShell mb = new MessageBoxShell(styles,
                  MessageText.getString((String)params[0]),
                  MessageText.getString((String)params[1]));
              mb.open(null);
              int _r = mb.waitUntilClosed();
             
              int  r = 0;
             
              if (( _r & SWT.YES ) != 0 ){
               
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.MessageBoxShell

 
  // @see org.gudy.azureus2.plugins.ui.UIInstance#promptUser(java.lang.String, java.lang.String, java.lang.String[], int)
  public int promptUser(String title, String text, String[] options,
      int defaultOption) {
   
    MessageBoxShell mb = new MessageBoxShell(title, text, options,
        defaultOption);
    mb.open(null);
    // bah, no way to change this to use the UserPrompterResultListener trigger
    return mb.waitUntilClosed();
  }
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.MessageBoxShell

  }

  protected void
  removeWithConfirm( )
  {
    MessageBoxShell mb =
      new MessageBoxShell(
        MessageText.getString("message.confirm.delete.title"),
        MessageText.getString("message.confirm.delete.text",
            new String[] {
              subs.getName()
            }),
        new String[] {
          MessageText.getString("Button.yes"),
          MessageText.getString("Button.no")
        },
        1 );
   
    mb.open(new UserPrompterResultListener() {
      public void prompterClosed(int result) {
        if (result == 0) {
          subs.setSubscribed( false );
        }
      }
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.MessageBoxShell

        removeSubs(toRemove, nextIndex);
      }
      return;
    }

    MessageBoxShell mb = new MessageBoxShell(
        MessageText.getString("message.confirm.delete.title"),
        MessageText.getString("message.confirm.delete.text", new String[] {
          toRemove[startIndex].getName()
        }));

    if (startIndex == toRemove.length - 1) {
      mb.setButtons(0, new String[] {
        MessageText.getString("Button.yes"),
        MessageText.getString("Button.no"),
      }, new Integer[] { 0, 1 });
    } else {
      mb.setButtons(1, new String[] {
        MessageText.getString("Button.removeAll"),
        MessageText.getString("Button.yes"),
        MessageText.getString("Button.no"),
      }, new Integer[] { 2, 0, 1 });
    }

    mb.open(new UserPrompterResultListener() {
      public void prompterClosed(int result) {
        if (result == 0) {
          toRemove[startIndex].setSubscribed( false );
        } else if (result == 2) {
          for (int i = startIndex; i < toRemove.length; i++) {
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.MessageBoxShell

    try {
      if !completed &&
          wizard_mode != WIZARD_MODE_SPEED_TEST_AUTO &&
          !COConfigurationManager.getBooleanParameter("Wizard Completed")){
       
        MessageBoxShell mb = new MessageBoxShell(
            MessageText.getString("wizard.close.confirmation"),
            MessageText.getString("wizard.close.message"), new String[] {
              MessageText.getString("Button.yes"),
              MessageText.getString("Button.no")
            }, 0);

        mb.open(new UserPrompterResultListener() {
          public void prompterClosed(int result) {
            if (result == 1) {
              COConfigurationManager.setParameter("Wizard Completed", true);
              COConfigurationManager.save();
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.