Show intro on new version first launch [message #754296] |
Tue, 01 November 2011 21:16 |
Eclipse User |
|
|
|
I was pretty sure, that when I launch new version of Eclipse, Welcome
page is shown. I considered this as default behavior of RCP App.
But this doesn't work for my app.
I've got app version 1.0 (set in plug-in and product config) and app
1.1. When I clean user data, intros show at first launch any of them.
But nothing appears when after using 1.0, I launch 1.1.
--
Tomek
|
|
|
Re: Show intro on new version first launch [message #754794 is a reply to message #754296] |
Fri, 04 November 2011 11:59 |
Eclipse User |
|
|
|
W dniu 2011-11-01 22:16, Tomasz Kańka pisze:
> I was pretty sure, that when I launch new version of Eclipse, Welcome
> page is shown. I considered this as default behavior of RCP App.
>
> But this doesn't work for my app.
>
> I've got app version 1.0 (set in plug-in and product config) and app
> 1.1. When I clean user data, intros show at first launch any of them.
> But nothing appears when after using 1.0, I launch 1.1.
>
I did it manually, but I don't like it
public void preWindowOpen()
{
// Take version number
Dictionary<String, String> headers =
Activator.getDefault().getBundle().getHeaders();
String version = headers.get("Bundle-Version");
if (version == null)
version = "0.0";
//Take first 2 digits
Pattern p = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)\\.([\\d\\w]+)");
Matcher m = p.matcher(version);
if (m.matches())
{
version = m.group(1)+"."+m.group(2);
}
String introCount =
PlatformUI.getPreferenceStore().getString(INTRO_COUNTER + version);
if ((introCount == null) || !introCount.matches("\\d+"))
introCount = INTRO_COUNTER_MAX;
Long c = Long.valueOf(introCount);
if (c > 0)
{
c = c - 1;
PlatformUI.getPreferenceStore().putValue(INTRO_COUNTER + version,
Long.valueOf(c).toString());
PlatformUI.getPreferenceStore().putValue(IWorkbenchPreferenceConstants.SHOW_INTRO, "true");
....
}
|
|
|
Powered by
FUDForum. Page generated in 0.25935 seconds