Added spinners for selecting which identity to use.

(Although it isn't possible to create an identity yet...)
This commit is contained in:
akwizgran
2013-03-30 19:15:15 +00:00
parent 3309938467
commit 5800949b26
20 changed files with 432 additions and 228 deletions

View File

@@ -2045,9 +2045,8 @@ DatabaseCleaner.Callback {
while(freeSpace < MIN_FREE_SPACE) {
boolean expired = expireMessages(BYTES_PER_SWEEP);
if(freeSpace < CRITICAL_FREE_SPACE && !expired) {
// FIXME: Work out what to do here - the amount of free space
// is critically low and there are no messages left to expire
throw new Error("Disk space is critical");
// FIXME: Work out what to do here
throw new Error("Disk space is critically low");
}
Thread.yield();
freeSpace = db.getFreeSpace();
@@ -2086,7 +2085,7 @@ DatabaseCleaner.Callback {
messageLock.writeLock().unlock();
}
if(expired.isEmpty()) return false;
callListeners(new MessageExpiredEvent(expired));
callListeners(new MessageExpiredEvent());
return true;
}

View File

@@ -1155,7 +1155,8 @@ abstract class JdbcDatabase implements Database<Connection> {
PreparedStatement ps = null;
ResultSet rs = null;
try {
String sql = "SELECT authorId, name, publicKey, lastConnected"
String sql = "SELECT authorId, name, publicKey, localAuthorId,"
+ " lastConnected"
+ " FROM contacts AS c"
+ " JOIN connectionTimes AS ct"
+ " ON c.contactId = ct.contactId"
@@ -1167,11 +1168,12 @@ abstract class JdbcDatabase implements Database<Connection> {
AuthorId authorId = new AuthorId(rs.getBytes(1));
String name = rs.getString(2);
byte[] publicKey = rs.getBytes(3);
long lastConnected = rs.getLong(4);
AuthorId localAuthorId = new AuthorId(rs.getBytes(4));
long lastConnected = rs.getLong(5);
rs.close();
ps.close();
Author author = new Author(authorId, name, publicKey);
return new Contact(c, author, lastConnected);
return new Contact(c, author, localAuthorId, lastConnected);
} catch(SQLException e) {
tryToClose(rs);
tryToClose(ps);
@@ -1205,7 +1207,7 @@ abstract class JdbcDatabase implements Database<Connection> {
ResultSet rs = null;
try {
String sql = "SELECT c.contactId, authorId, name, publicKey,"
+ " lastConnected"
+ " localAuthorId, lastConnected"
+ " FROM contacts AS c"
+ " JOIN connectionTimes AS ct"
+ " ON c.contactId = ct.contactId";
@@ -1217,9 +1219,11 @@ abstract class JdbcDatabase implements Database<Connection> {
AuthorId authorId = new AuthorId(rs.getBytes(2));
String name = rs.getString(3);
byte[] publicKey = rs.getBytes(4);
long lastConnected = rs.getLong(5);
AuthorId localAuthorId = new AuthorId(rs.getBytes(5));
long lastConnected = rs.getLong(6);
Author author = new Author(authorId, name, publicKey);
contacts.add(new Contact(contactId, author, lastConnected));
contacts.add(new Contact(contactId, author, localAuthorId,
lastConnected));
}
rs.close();
ps.close();

View File

@@ -134,6 +134,7 @@ class KeyManagerImpl extends TimerTask implements KeyManager, DatabaseListener {
} else if(now >= creationTime) {
incomingNew.put(k, s);
} else {
// FIXME: Work out what to do here
throw new Error("Clock has moved backwards");
}
}