propagate from branch 'i2p.i2p' (head ce3040d00c42e384f3fc62d018c9bdade01df033)

to branch 'i2p.i2p.str4d.i2ptunnel' (head 6259f71c23cbb08c8b1de472632d8efb1b016d29)
This commit is contained in:
str4d
2012-01-24 04:36:21 +00:00
16 changed files with 233 additions and 16 deletions

View File

@@ -127,6 +127,7 @@ public class PluginStarter implements Runnable {
} }
Log log = ctx.logManager().getLog(PluginStarter.class); Log log = ctx.logManager().getLog(PluginStarter.class);
int updated = 0;
for (Map.Entry<String, String> entry : toUpdate.entrySet()) { for (Map.Entry<String, String> entry : toUpdate.entrySet()) {
String appName = entry.getKey(); String appName = entry.getKey();
if (log.shouldLog(Log.WARN)) if (log.shouldLog(Log.WARN))
@@ -152,7 +153,13 @@ public class PluginStarter implements Runnable {
Thread.sleep(5*1000); Thread.sleep(5*1000);
} catch (InterruptedException ie) {} } catch (InterruptedException ie) {}
} while (puh.isRunning()); } while (puh.isRunning());
if (puh.wasUpdateSuccessful())
updated++;
} }
if (updated > 0)
puc.setDoneStatus(ngettext("1 plugin updated", "{0} plugins updated", updated, ctx));
else
puc.setDoneStatus(Messages.getString("Plugin update check complete", ctx));
} }
/** this shouldn't throw anything */ /** this shouldn't throw anything */
@@ -764,4 +771,9 @@ public class PluginStarter implements Runnable {
method.setAccessible(true); method.setAccessible(true);
method.invoke(urlClassLoader, new Object[]{u}); method.invoke(urlClassLoader, new Object[]{u});
} }
/** translate a string */
private static String ngettext(String s, String p, int n, I2PAppContext ctx) {
return Messages.getString(n, s, p, ctx);
}
} }

View File

@@ -104,6 +104,12 @@ public class PluginUpdateChecker extends UpdateHandler {
public void setAppStatus(String status) { public void setAppStatus(String status) {
updateStatus(status); updateStatus(status);
} }
/** @since 0.8.13 */
public void setDoneStatus(String status) {
updateStatus(status);
scheduleStatusClean(status);
}
public boolean isRunning() { public boolean isRunning() {
return _pluginUpdateCheckerRunner != null && _pluginUpdateCheckerRunner.isRunning(); return _pluginUpdateCheckerRunner != null && _pluginUpdateCheckerRunner.isRunning();

View File

@@ -42,6 +42,8 @@ public class PluginUpdateHandler extends UpdateHandler {
private static PluginUpdateRunner _pluginUpdateRunner; private static PluginUpdateRunner _pluginUpdateRunner;
private String _xpi2pURL; private String _xpi2pURL;
private String _appStatus; private String _appStatus;
private volatile boolean _updated;
private static final String XPI2P = "app.xpi2p"; private static final String XPI2P = "app.xpi2p";
private static final String ZIP = XPI2P + ".zip"; private static final String ZIP = XPI2P + ".zip";
public static final String PLUGIN_DIR = "plugins"; public static final String PLUGIN_DIR = "plugins";
@@ -92,6 +94,11 @@ public class PluginUpdateHandler extends UpdateHandler {
return false; return false;
} }
/** @since 0.8.13 */
public boolean wasUpdateSuccessful() {
return _updated;
}
private void scheduleStatusClean(String msg) { private void scheduleStatusClean(String msg) {
SimpleScheduler.getInstance().addEvent(new Cleaner(msg), 20*60*1000); SimpleScheduler.getInstance().addEvent(new Cleaner(msg), 20*60*1000);
} }
@@ -108,6 +115,7 @@ public class PluginUpdateHandler extends UpdateHandler {
} }
public class PluginUpdateRunner extends UpdateRunner implements Runnable, EepGet.StatusListener { public class PluginUpdateRunner extends UpdateRunner implements Runnable, EepGet.StatusListener {
private boolean _updated;
public PluginUpdateRunner(String url) { public PluginUpdateRunner(String url) {
super(); super();
@@ -115,6 +123,7 @@ public class PluginUpdateHandler extends UpdateHandler {
@Override @Override
protected void update() { protected void update() {
_updated = false;
updateStatus("<b>" + _("Downloading plugin from {0}", _xpi2pURL) + "</b>"); updateStatus("<b>" + _("Downloading plugin from {0}", _xpi2pURL) + "</b>");
// use the same settings as for updater // use the same settings as for updater
boolean shouldProxy = Boolean.valueOf(_context.getProperty(ConfigUpdateHandler.PROP_SHOULD_PROXY, ConfigUpdateHandler.DEFAULT_SHOULD_PROXY)).booleanValue(); boolean shouldProxy = Boolean.valueOf(_context.getProperty(ConfigUpdateHandler.PROP_SHOULD_PROXY, ConfigUpdateHandler.DEFAULT_SHOULD_PROXY)).booleanValue();
@@ -383,6 +392,7 @@ public class PluginUpdateHandler extends UpdateHandler {
return; return;
} }
_updated = true;
to.delete(); to.delete();
if (Boolean.valueOf(props.getProperty("dont-start-at-install")).booleanValue()) { if (Boolean.valueOf(props.getProperty("dont-start-at-install")).booleanValue()) {
if (Boolean.valueOf(props.getProperty("router-restart-required")).booleanValue()) if (Boolean.valueOf(props.getProperty("router-restart-required")).booleanValue())

View File

@@ -172,3 +172,43 @@ input[type=reset]:hover {
opacity: 1.0; opacity: 1.0;
-moz-box-shadow: inset 0px 0px 0px 1px #fff; -moz-box-shadow: inset 0px 0px 0px 1px #fff;
} }
input.accept {
background: #ddf url('/themes/console/images/accept.png') no-repeat 2px center;
padding: 2px 3px 2px 20px;
min-height: 22px;
}
input.add {
background: #ddf url('/themes/console/images/add.png') no-repeat 2px center;
padding: 2px 3px 2px 20px;
min-height: 22px;
}
input.cancel {
background: #ddf url('/themes/console/images/cancel.png') no-repeat 2px center;
padding: 2px 3px 2px 20px;
min-height: 22px;
}
input.delete {
background: #ddf url('/themes/console/images/delete.png') no-repeat 2px center;
padding: 2px 3px 2px 20px;
min-height: 22px;
}
input.reload {
background: #ddf url('/themes/console/images/arrow_refresh.png') no-repeat 2px center;
padding: 2px 3px 2px 20px;
min-height: 22px;
}
input.search {
background: #ddf url('/themes/console/images/magnifier.png') no-repeat 2px center;
padding: 2px 3px 2px 24px;
min-height: 22px;
}
input.search[type="text"] {
background: #eef url('/themes/console/images/magnifier.png') no-repeat 2px center;
}

View File

@@ -117,8 +117,8 @@ ${book.loadBookMessages}
<input type="hidden" name="begin" value="0"> <input type="hidden" name="begin" value="0">
<input type="hidden" name="end" value="99"> <input type="hidden" name="end" value="99">
<table><tr> <table><tr>
<td class="search"><%=intl._("Search")%>: <input type="text" name="search" value="${book.search}" size="20" ></td> <td class="search"><%=intl._("Search")%>: <input class="search" type="text" name="search" value="${book.search}" size="20" ></td>
<td class="search"><input type="submit" name="submitsearch" value="<%=intl._("Search")%>" ></td> <td class="search"><input class="search" type="submit" name="submitsearch" value="<%=intl._("Search")%>" ></td>
</tr> </tr>
</table> </table>
</form></div> </form></div>
@@ -167,8 +167,8 @@ ${book.loadBookMessages}
<c:if test="${book.master || book.router || book.published || book.private}"> <c:if test="${book.master || book.router || book.published || book.private}">
<div id="buttons"> <div id="buttons">
<p class="buttons"> <p class="buttons">
<input type="reset" value="<%=intl._("Cancel")%>" > <input class="cancel" type="reset" value="<%=intl._("Cancel")%>" >
<input type="submit" name="action" value="<%=intl._("Delete Selected")%>" > <input class="delete" type="submit" name="action" value="<%=intl._("Delete Selected")%>" >
</p> </p>
</div></form> </div></form>
</c:if> </c:if>
@@ -193,9 +193,9 @@ ${book.loadBookMessages}
<b><%=intl._("Destination")%></b></td><td><textarea name="destination" rows="1" style="height: 3em;" cols="70" wrap="off" spellcheck="false">${book.destination}</textarea> <b><%=intl._("Destination")%></b></td><td><textarea name="destination" rows="1" style="height: 3em;" cols="70" wrap="off" spellcheck="false">${book.destination}</textarea>
</td></tr></table> </td></tr></table>
<p class="buttons"> <p class="buttons">
<input type="reset" value="<%=intl._("Cancel")%>" > <input class="cancel" type="reset" value="<%=intl._("Cancel")%>" >
<input type="submit" name="action" value="<%=intl._("Replace")%>" > <input class="accept" type="submit" name="action" value="<%=intl._("Replace")%>" >
<input type="submit" name="action" value="<%=intl._("Add")%>" > <input class="add" type="submit" name="action" value="<%=intl._("Add")%>" >
</p> </p>
</div></form> </div></form>

View File

@@ -69,8 +69,8 @@
<textarea name="config" rows="10" cols="80">${cfg.config}</textarea> <textarea name="config" rows="10" cols="80">${cfg.config}</textarea>
</div> </div>
<div id="buttons"> <div id="buttons">
<input type="submit" name="action" value="<%=intl._("Reload")%>" > <input class="reload" type="submit" name="action" value="<%=intl._("Reload")%>" >
<input type="submit" name="action" value="<%=intl._("Save")%>" > <input class="accept" type="submit" name="action" value="<%=intl._("Save")%>" >
</div> </div>
</form> </form>
<div id="help"> <div id="help">

View File

@@ -129,7 +129,7 @@
<input type="hidden" name="begin" value="0"> <input type="hidden" name="begin" value="0">
<input type="hidden" name="end" value="99"> <input type="hidden" name="end" value="99">
<input type="hidden" name="checked" value="<%=detail%>"> <input type="hidden" name="checked" value="<%=detail%>">
<input type="submit" name="action" value="<%=intl._("Delete Entry")%>" > <input class="delete" type="submit" name="action" value="<%=intl._("Delete Entry")%>" >
</p> </p>
</form> </form>
</div> </div>

View File

@@ -69,8 +69,8 @@
<textarea name="content" rows="10" cols="80">${subs.content}</textarea> <textarea name="content" rows="10" cols="80">${subs.content}</textarea>
</div> </div>
<div id="buttons"> <div id="buttons">
<input type="submit" name="action" value="<%=intl._("Reload")%>" > <input class="reload" type="submit" name="action" value="<%=intl._("Reload")%>" >
<input type="submit" name="action" value="<%=intl._("Save")%>" > <input class="accept" type="submit" name="action" value="<%=intl._("Save")%>" >
</div> </div>
</form> </form>
<div id="help"> <div id="help">

View File

@@ -129,4 +129,65 @@ form {
.mailhead { .mailhead {
font-size: 9pt; font-size: 9pt;
font-weight: bold; font-weight: bold;
} }
input.cancel, input.clearselection, input.logout {
background: #ddf url('/themes/console/images/cancel.png') no-repeat 2px center;
padding: 2px 3px 2px 20px;
min-height: 22px;
}
input.delete, input.delete_attachment, input.really_delete {
background: #ddf url('/themes/console/images/delete.png') no-repeat 2px center;
padding: 2px 3px 2px 20px;
min-height: 22px;
}
input.download, input.lastpage {
background: #ddf url('/themes/console/images/arrow_down.png') no-repeat 2px center;
padding: 2px 3px 2px 20px;
min-height: 22px;
}
input.firstpage {
background: #ddf url('/themes/console/images/arrow_up.png') no-repeat 2px center;
padding: 2px 3px 2px 20px;
min-height: 22px;
}
input.forward, input.login, input.nextpage, input.send {
background: #ddf url('/themes/console/images/arrow_right.png') no-repeat 2px center;
padding: 2px 3px 2px 20px;
min-height: 22px;
}
input.invertselection, input.reload, input.refresh {
background: #ddf url('/themes/console/images/arrow_refresh.png') no-repeat 2px center;
padding: 2px 3px 2px 20px;
min-height: 22px;
}
input.markall, input.show {
background: #ddf url('/themes/console/images/tick.png') no-repeat 2px center;
padding: 2px 3px 2px 20px;
min-height: 22px;
}
input.new, input.reply, input.replyall {
background: #ddf url('/themes/console/images/email.png') no-repeat 2px center;
padding: 2px 3px 2px 20px;
min-height: 22px;
}
input.prevpage {
background: #ddf url('/themes/console/images/arrow_left.png') no-repeat 2px center;
padding: 2px 3px 2px 20px;
min-height: 22px;
}
input.send, input.setpagesize {
background: #ddf url('/themes/console/images/accept.png') no-repeat 2px center;
padding: 2px 3px 2px 20px;
min-height: 22px;
}

View File

@@ -346,7 +346,7 @@ public class WebMail extends HttpServlet
*/ */
private static String button( String name, String label ) private static String button( String name, String label )
{ {
return "<input type=\"submit\" name=\"" + name + "\" value=\"" + label + "\">"; return "<input type=\"submit\" class=\"" + name + "\" name=\"" + name + "\" value=\"" + label + "\">";
} }
/** /**
* returns html string of a disabled form button with name and label * returns html string of a disabled form button with name and label
@@ -1601,7 +1601,7 @@ public class WebMail extends HttpServlet
"<tr><td align=\"right\" width=\"30%\">" + _("SMTP-Port") + "</td><td width=\"40%\" align=\"left\"><input type=\"text\" size=\"5\" name=\"" + SMTP +"\" value=\"" + smtp + "\"" + ( fixed ? " disabled" : "" ) + "></td></tr>\n"); "<tr><td align=\"right\" width=\"30%\">" + _("SMTP-Port") + "</td><td width=\"40%\" align=\"left\"><input type=\"text\" size=\"5\" name=\"" + SMTP +"\" value=\"" + smtp + "\"" + ( fixed ? " disabled" : "" ) + "></td></tr>\n");
} }
out.println( out.println(
"<tr><td></td><td align=\"left\">" + button( LOGIN, _("Login") ) + " <input type=\"reset\" value=\"" + _("Reset") + "\"></td></tr>\n" + "<tr><td></td><td align=\"left\">" + button( LOGIN, _("Login") ) + " <input class=\"cancel\" type=\"reset\" value=\"" + _("Reset") + "\"></td></tr>\n" +
"<tr><td></td><td align=\"left\"><a href=\"http://hq.postman.i2p/?page_id=14\">" + _("Learn about I2P mail") + "</a></td></tr>\n" + "<tr><td></td><td align=\"left\"><a href=\"http://hq.postman.i2p/?page_id=14\">" + _("Learn about I2P mail") + "</a></td></tr>\n" +
"<tr><td></td><td align=\"left\"><a href=\"http://hq.postman.i2p/?page_id=16\">" + _("Create Account") + "</a></td></tr>\n" + "<tr><td></td><td align=\"left\"><a href=\"http://hq.postman.i2p/?page_id=16\">" + _("Create Account") + "</a></td></tr>\n" +
"</table>"); "</table>");

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

View File

@@ -599,6 +599,82 @@ td {
border-bottom: 1px outset #99f; border-bottom: 1px outset #99f;
} }
/***********************************************************************************/
#appsummary {
margin-top: 53px;
}
h2.app {
margin: 15px 10px 15px 0 !important;
}
h4.app {
clear: left;
margin: 12px 4px;
padding: 20px 0 8px 0;
}
div.app {
float: left;
padding: 8px;
height: 100px;
width: 112px;
}
div.appgroup {
clear: left;
margin: 4px 20px;
padding: 16px 8px;
width: auto;
}
div.search {
margin: 20px;
padding: 8px;
width: auto;
}
img.app {
height: 48px;
width: 48px;
padding: 8px;
}
table.app {
background: none;
border: 0;
margin: auto;
width: auto;
}
tr.app {
background: none;
border: 0;
margin: 0;
}
td.app {
background: none;
border: 0;
margin: 0;
}
div.applabel {
background: url('images/header.png') center center repeat-x;
-moz-border-radius: 4px;
-khtml-border-radius: 4px;
border: 2px #00f;
border-radius: 4px;
border-width: 1px;
font-size: 9pt;
margin: 0;
padding: 3px 6px 4px 6px;
text-align: center;
}
/***********************************************************************************/
tt { tt {
font: bold 8pt "Lucida Console", "DejaVu Sans Mono", Courier, mono; font: bold 8pt "Lucida Console", "DejaVu Sans Mono", Courier, mono;
color: #008000; color: #008000;
@@ -864,6 +940,12 @@ button.reload {
min-height: 22px; min-height: 22px;
} }
button.search {
background: #ffe url('../images/magnifier.png') no-repeat 2px center;
padding: 2px 3px 2px 20px;
min-height: 22px;
}
button.stop { button.stop {
background: #ffe url('../images/stop.png') no-repeat 2px center; background: #ffe url('../images/stop.png') no-repeat 2px center;
padding: 2px 3px 2px 20px; padding: 2px 3px 2px 20px;
@@ -978,6 +1060,12 @@ input.reload {
min-height: 22px; min-height: 22px;
} }
input.search[type="text"] {
background: #ffe url('../images/magnifier.png') no-repeat 2px center;
padding: 2px 3px 2px 24px;
min-height: 22px;
}
input.stop { input.stop {
background: #ffe url('../images/stop.png') no-repeat 2px center; background: #ffe url('../images/stop.png') no-repeat 2px center;
padding: 2px 3px 2px 20px; padding: 2px 3px 2px 20px;

View File

@@ -228,7 +228,7 @@ hr {
-khtml-border-radius: 4px; -khtml-border-radius: 4px;
border-radius: 4px; border-radius: 4px;
margin-top: 8px; margin-top: 8px;
background: #ffe url(images/header.png) center center repeat-x !important; background: #ffe url(images/header.png) center center repeat-x;
text-decoration: none; text-decoration: none;
} }