Search in sources :

Example 1 with Preferences

use of nl.tudelft.watchdog.eclipse.ui.preferences.Preferences in project watchdog by TestRoots.

the class RegistrationWizardBase method performFinish.

@Override
public boolean performFinish() {
    Preferences preferences = Preferences.getInstance();
    preferences.registerProjectId(WatchDogUtils.getWorkspaceName(), projectId);
    preferences.registerProjectUse(WatchDogUtils.getWorkspaceName(), true);
    StartupHandler.startWatchDog();
    return true;
}
Also used : Preferences(nl.tudelft.watchdog.eclipse.ui.preferences.Preferences)

Example 2 with Preferences

use of nl.tudelft.watchdog.eclipse.ui.preferences.Preferences in project watchdog by TestRoots.

the class UserRegistrationPage method makeRegistration.

protected void makeRegistration() {
    User user = new User();
    user.email = getEmailInput().getText();
    user.organization = getOrganizationInput().getText();
    user.mayContactUser = getMayContactUser();
    user.programmingExperience = getProgrammingExperience();
    user.operatingSystem = Platform.getOS();
    try {
        id = new JsonTransferer().registerNewUser(user);
    } catch (ServerCommunicationException exception) {
        successfulRegistration = false;
        messageTitle = "Problem creating new user!";
        messageBody = WordUtils.wrap(exception.getMessage(), 100, null, true);
        messageBody += "\nAre you connected to the internet, and is port 80 open?";
        messageBody += "\nPlease contact us via www.testroots.org. \nWe'll troubleshoot the issue!";
        return;
    }
    successfulRegistration = true;
    ((UserProjectRegistrationWizard) getWizard()).userid = id;
    messageTitle = "New user registered!";
    messageBody = "Your new user id is registered: ";
    Preferences preferences = Preferences.getInstance();
    preferences.setUserId(id);
    preferences.registerProjectId(WatchDogUtils.getWorkspaceName(), "");
    preferences.setProgrammingExperience(user.programmingExperience);
}
Also used : JsonTransferer(nl.tudelft.watchdog.core.logic.network.JsonTransferer) ServerCommunicationException(nl.tudelft.watchdog.core.logic.network.ServerCommunicationException) User(nl.tudelft.watchdog.core.ui.wizards.User) Preferences(nl.tudelft.watchdog.eclipse.ui.preferences.Preferences)

Example 3 with Preferences

use of nl.tudelft.watchdog.eclipse.ui.preferences.Preferences in project watchdog by TestRoots.

the class InfoHandler method updateElement.

@Override
public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
    if (WatchDogGlobals.isActive) {
        Preferences preferences = Preferences.getInstance();
        displayUpdateQuestionDialog(preferences);
        if (WatchDogGlobals.lastTransactionFailed || preferences.isOldVersion()) {
            element.setTooltip(WatchDogGlobals.ACTIVE_WATCHDOG_TEXT);
            element.setIcon(UIUtils.WATCHDOG_ICON_WARNING);
        } else {
            element.setTooltip(WatchDogGlobals.ACTIVE_WATCHDOG_TEXT);
            element.setIcon(UIUtils.WATCHDOG_ICON);
        }
        if (!preferences.isOldVersion()) {
            preferences.setBigUpdateAnswered(false);
        }
    } else {
        element.setTooltip(WatchDogGlobals.INACTIVE_WATCHDOG_TEXT);
        element.setIcon(UIUtils.WATCHDOG_ICON_DISABLED);
    }
}
Also used : Preferences(nl.tudelft.watchdog.eclipse.ui.preferences.Preferences)

Aggregations

Preferences (nl.tudelft.watchdog.eclipse.ui.preferences.Preferences)3 JsonTransferer (nl.tudelft.watchdog.core.logic.network.JsonTransferer)1 ServerCommunicationException (nl.tudelft.watchdog.core.logic.network.ServerCommunicationException)1 User (nl.tudelft.watchdog.core.ui.wizards.User)1