mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-04 17:21:19 +00:00
eclipse plugin: ask the user for creating the mainline/useraddons projects
This commit is contained in:
parent
75d972860c
commit
efef39aba3
@ -36,6 +36,7 @@ import org.eclipse.core.runtime.Status;
|
|||||||
import org.eclipse.jface.preference.PreferenceDialog;
|
import org.eclipse.jface.preference.PreferenceDialog;
|
||||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||||
import org.eclipse.jface.window.Window;
|
import org.eclipse.jface.window.Window;
|
||||||
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.ui.IWorkbenchWindow;
|
import org.eclipse.ui.IWorkbenchWindow;
|
||||||
import org.eclipse.ui.IWorkingSet;
|
import org.eclipse.ui.IWorkingSet;
|
||||||
@ -335,15 +336,25 @@ public class WorkspaceUtils
|
|||||||
String campaignsDir = Preferences.getString(Constants.P_WESNOTH_WORKING_DIR) + "/data/campaigns/";
|
String campaignsDir = Preferences.getString(Constants.P_WESNOTH_WORKING_DIR) + "/data/campaigns/";
|
||||||
|
|
||||||
File[] tmp = null;
|
File[] tmp = null;
|
||||||
|
if (GUIUtils.showMessageBox("Do you want me to create for you" +
|
||||||
|
" projects for each of your addon, so you can easily use them?",
|
||||||
|
SWT.ICON_QUESTION | SWT.YES | SWT.NO) == SWT.YES)
|
||||||
|
{
|
||||||
// useraddons/add-ons/data
|
// useraddons/add-ons/data
|
||||||
tmp = new File(addonsDir).listFiles();
|
tmp = new File(addonsDir).listFiles();
|
||||||
if (tmp != null)
|
if (tmp != null)
|
||||||
files.addAll(Arrays.asList(tmp));
|
files.addAll(Arrays.asList(tmp));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GUIUtils.showMessageBox("Do you want me to create for you" +
|
||||||
|
" projects for each mainline campaign?",
|
||||||
|
SWT.ICON_QUESTION | SWT.YES | SWT.NO) == SWT.YES)
|
||||||
|
{
|
||||||
// workingdir/data/campaigns
|
// workingdir/data/campaigns
|
||||||
tmp = new File(campaignsDir).listFiles();
|
tmp = new File(campaignsDir).listFiles();
|
||||||
if (tmp != null)
|
if (tmp != null)
|
||||||
files.addAll(Arrays.asList(tmp));
|
files.addAll(Arrays.asList(tmp));
|
||||||
|
}
|
||||||
|
|
||||||
monitor.beginTask("Setting up the workspace...", files.size() * 35);
|
monitor.beginTask("Setting up the workspace...", files.size() * 35);
|
||||||
for(File file: files)
|
for(File file: files)
|
||||||
@ -378,7 +389,6 @@ public class WorkspaceUtils
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO select the default working set manager as the active one
|
//TODO select the default working set manager as the active one
|
||||||
|
|
||||||
if (guided)
|
if (guided)
|
||||||
{
|
{
|
||||||
GUIUtils.showInfoMessageBox(
|
GUIUtils.showInfoMessageBox(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user