series60-remote-commits Mailing List for S60 Software Suite
Brought to you by:
lukashetzi
You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(26) |
Aug
(11) |
Sep
(8) |
Oct
(14) |
Nov
(7) |
Dec
(54) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(26) |
Feb
(33) |
Mar
(3) |
Apr
(17) |
May
(46) |
Jun
(8) |
Jul
(24) |
Aug
(16) |
Sep
(3) |
Oct
|
Nov
(16) |
Dec
(58) |
2010 |
Jan
(14) |
Feb
(23) |
Mar
(12) |
Apr
(35) |
May
(39) |
Jun
(14) |
Jul
(40) |
Aug
(82) |
Sep
(25) |
Oct
(38) |
Nov
(30) |
Dec
(3) |
2011 |
Jan
(1) |
Feb
(11) |
Mar
(9) |
Apr
(5) |
May
(4) |
Jun
(6) |
Jul
|
Aug
(24) |
Sep
(21) |
Oct
|
Nov
|
Dec
(25) |
2012 |
Jan
(22) |
Feb
(16) |
Mar
(35) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <luk...@us...> - 2012-06-25 14:45:18
|
Revision: 987 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=987&view=rev Author: lukashetzi Date: 2012-06-25 14:45:08 +0000 (Mon, 25 Jun 2012) Log Message: ----------- [WIP] Implement an alternative to the contact sync based on the MD5 checksum (the new alternative uses the version of the contact in the android database) Modified Paths: -------------- branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/connection/BaseClientThread.java branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactManager.java Added Paths: ----------- branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactSync/ branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactSync/Methods/ branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactSync/Methods/ContactChecksum/ branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactSync/Methods/ContactChecksum/ContactChecksumMethod.java branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactSync/Methods/VersionDatabase/ branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactSync/Methods/VersionDatabase/DBAdapter.java branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactSync/Methods/VersionDatabase/VersionDatabaseMethod.java Modified: branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/connection/BaseClientThread.java =================================================================== --- branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/connection/BaseClientThread.java 2012-04-08 17:04:18 UTC (rev 986) +++ branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/connection/BaseClientThread.java 2012-06-25 14:45:08 UTC (rev 987) @@ -10,6 +10,7 @@ import com.hetzenecker.openmobilesuite.service.MessageManager; import com.hetzenecker.openmobilesuite.service.Statuscodes; import com.hetzenecker.openmobilesuite.service.SysinfoManager; +import com.hetzenecker.openmobilesuite.service.ContactSync.Methods.ContactChecksum.ContactChecksumMethod; public abstract class BaseClientThread extends Thread { private static final String TAG = "OpenMobileSuite|BaseClientThread"; @@ -114,10 +115,12 @@ mSysinfoManager.sendSysinfo(); break; case Statuscodes.NUM_CONTACTS_REQUEST_HASH_ALL: - mContactManager.sendContactHash(); + //mContactManager.sendContactHash(); + ContactChecksumMethod.sendContactHash(mContactManager, this); break; case Statuscodes.NUM_CONTACTS_REQUEST_HASH_SINGLE: - mContactManager.sendContactHashSingle(); + //mContactManager.sendContactHashSingle(); + ContactChecksumMethod.sendContactHashSingle(mContactManager, this); break; case Statuscodes.NUM_CONTACTS_REQUEST_CONTACT: mContactManager.sendContact(message); Modified: branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactManager.java =================================================================== --- branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactManager.java 2012-04-08 17:04:18 UTC (rev 986) +++ branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactManager.java 2012-06-25 14:45:08 UTC (rev 987) @@ -51,14 +51,7 @@ public class ContactManager { private static final String TAG = "OpenMobileSuite|ContactManager"; - private static boolean DEBUG = false; - // For hash functions - public static final char CONTACT_SEP = 0x1F; // Unit Separator - public static final char ENTRY_SEP = 0x1F; // Unit Separator - public static final char FIELD_SEP = 0x1E; // Record Separator - public static final char INFO_SEP = 0x1D; // Group Separator - public static enum ModificationType { Add, Remove } private BaseClientThread mClientThread; @@ -95,7 +88,7 @@ return baos.toByteArray(); } - private List<Contact> getContacts() { + public List<Contact> getContacts() { return getContacts(null); } @@ -374,149 +367,13 @@ } mClientThread.send(Statuscodes.NUM_CONTACTS_REPLY_CONTACT_END, String.valueOf(c.id)); } - - public String md5(String raw) - { - MessageDigest md; - try { - md = MessageDigest.getInstance("MD5"); - } catch (NoSuchAlgorithmException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - return null; - } - //Log.e(TAG, "RAW String: " + raw); - - md.reset(); - md.update(raw.getBytes()); - - /*Log.e(TAG, "RAW Bytes: " + raw.getBytes()); - - Formatter formatter = new Formatter(); - for (byte b : raw.getBytes()) - formatter.format("%02x", b); - - Log.e(TAG, "RAW HEX Bytes: " + formatter.toString()); - */ - byte[] bArr = md.digest(); - StringBuffer sb = new StringBuffer(); - - for (int i = 0; i < bArr.length; i++) - { - int unsigned = bArr[i] & 0xff; - if (unsigned < 0x10) - { - sb.append("0"); - } - sb.append(Integer.toHexString((unsigned))); - } - - return sb.toString(); - - } - - public void sendContactHash() + public void aaa() { - String hash = ""; + ContentResolver cr = mContext.getContentResolver(); + Cursor people = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); - FileWriter fstream; - BufferedWriter out = null; - - // DEBUGGING START - if (DEBUG) { - try { - Calendar cal = Calendar.getInstance(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); - fstream = new FileWriter("/mnt/sdcard/oms-full-hash-mobile-" + sdf.format(cal.getTime()) + ".txt", false); - out = new BufferedWriter(fstream); - } catch (IOException e) { - } - } - // DEBUGGING END - - for(Contact contact : getContacts()) - { - hash += contact.id; - hash += FIELD_SEP; - - - // DEBUGGING START - if (DEBUG) { - try { - out.write(String.valueOf(contact.id) + FIELD_SEP + "\n"); - } catch (IOException e) { - } - } - // DEBUGGING END - - for (ContactField field : contact.fields()) - { - hash += md5(String.valueOf(field.id) + INFO_SEP + field.account + INFO_SEP + field.type + INFO_SEP + field.location + INFO_SEP + field.custom_location + INFO_SEP + - field.detail + INFO_SEP + field.custom_detail + INFO_SEP + field.value + INFO_SEP + (field.primary ? "1" : "0")); - hash += FIELD_SEP; - - // DEBUGGING START - if (DEBUG) { - try { - out.write("md5(" + String.valueOf(field.id) + INFO_SEP + field.account + INFO_SEP + field.type + INFO_SEP + field.location + INFO_SEP + field.custom_location + INFO_SEP + - field.detail + INFO_SEP + field.custom_detail + INFO_SEP + field.value + INFO_SEP + (field.primary ? "1" : "0") + ") = "); - out.write(md5(String.valueOf(field.id) + INFO_SEP + field.account + INFO_SEP + field.type + INFO_SEP + field.location + INFO_SEP + field.custom_location + INFO_SEP + - field.detail + INFO_SEP + field.custom_detail + INFO_SEP + field.value + INFO_SEP + (field.primary ? "1" : "0"))); - out.write(FIELD_SEP + "\n"); - } catch (IOException e) { - } - } - // DEBUGGING END - } - hash += CONTACT_SEP; - - // DEBUGGING START - if (DEBUG) { - try { - out.write(CONTACT_SEP + "\n\n"); - } catch (IOException e) { - } - } - // DEBUGGING END - - } - - // DEBUGGING START - if (DEBUG) { - try { - out.write("\n\n\n--------------\n" + hash); - out.write("\n\n --> " + md5(hash)); - out.close(); - } catch (IOException e) { - } - } - // DEBUGGING END - - - mClientThread.send(Statuscodes.NUM_CONTACTS_REPLY_HASH_ALL, md5(hash)); } - public void sendContactHashSingle() { - List<Contact> contacts = getContacts(); - - mClientThread.send(Statuscodes.NUM_CONTACTS_REPLY_HASH_SINGLE_START, String.valueOf(contacts.size())); - - String hash; - - for (Contact contact : contacts) { - hash = ""; - for (ContactField field : contact.fields()) { - hash += md5(String.valueOf(field.id) + INFO_SEP + field.account + INFO_SEP + field.type + INFO_SEP + field.location + INFO_SEP + field.custom_location + INFO_SEP + - field.detail + INFO_SEP + field.custom_detail + INFO_SEP + field.value + INFO_SEP + (field.primary ? "1" : "0")); - hash += FIELD_SEP; - } - - mClientThread.send(Statuscodes.NUM_CONTACTS_REPLY_HASH_SINGLE_LINE, String.valueOf(contact.id), md5(hash)); - } - - mClientThread.send(Statuscodes.NUM_CONTACTS_REPLY_HASH_SINGLE_END); - } - } Added: branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactSync/Methods/ContactChecksum/ContactChecksumMethod.java =================================================================== --- branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactSync/Methods/ContactChecksum/ContactChecksumMethod.java (rev 0) +++ branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactSync/Methods/ContactChecksum/ContactChecksumMethod.java 2012-06-25 14:45:08 UTC (rev 987) @@ -0,0 +1,176 @@ +package com.hetzenecker.openmobilesuite.service.ContactSync.Methods.ContactChecksum; + +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.List; + +import com.hetzenecker.openmobilesuite.connection.BaseClientThread; +import com.hetzenecker.openmobilesuite.elements.Contact; +import com.hetzenecker.openmobilesuite.elements.ContactField; +import com.hetzenecker.openmobilesuite.service.ContactManager; +import com.hetzenecker.openmobilesuite.service.Statuscodes; + +public class ContactChecksumMethod { + + private static boolean DEBUG = false; + + // For hash functions + private static final char CONTACT_SEP = 0x1F; // Unit Separator + private static final char ENTRY_SEP = 0x1F; // Unit Separator + private static final char FIELD_SEP = 0x1E; // Record Separator + private static final char INFO_SEP = 0x1D; // Group Separator + + private ContactChecksumMethod() + { + } + + private static String md5(String raw) + { + MessageDigest md; + try { + md = MessageDigest.getInstance("MD5"); + } catch (NoSuchAlgorithmException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return null; + } + + //Log.e(TAG, "RAW String: " + raw); + + md.reset(); + md.update(raw.getBytes()); + + /*Log.e(TAG, "RAW Bytes: " + raw.getBytes()); + + Formatter formatter = new Formatter(); + for (byte b : raw.getBytes()) + formatter.format("%02x", b); + + Log.e(TAG, "RAW HEX Bytes: " + formatter.toString()); + */ + byte[] bArr = md.digest(); + StringBuffer sb = new StringBuffer(); + + for (int i = 0; i < bArr.length; i++) + { + int unsigned = bArr[i] & 0xff; + if (unsigned < 0x10) + { + sb.append("0"); + } + sb.append(Integer.toHexString((unsigned))); + } + + return sb.toString(); + + } + + public static void sendContactHash(ContactManager cm, BaseClientThread client) + { + String hash = ""; + + + FileWriter fstream; + BufferedWriter out = null; + + // DEBUGGING START + if (DEBUG) { + try { + Calendar cal = Calendar.getInstance(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); + fstream = new FileWriter("/mnt/sdcard/oms-full-hash-mobile-" + sdf.format(cal.getTime()) + ".txt", false); + out = new BufferedWriter(fstream); + } catch (IOException e) { + } + } + // DEBUGGING END + + for(Contact contact : cm.getContacts()) + { + hash += contact.id; + hash += FIELD_SEP; + + + // DEBUGGING START + if (DEBUG) { + try { + out.write(String.valueOf(contact.id) + FIELD_SEP + "\n"); + } catch (IOException e) { + } + } + // DEBUGGING END + + for (ContactField field : contact.fields()) + { + hash += md5(String.valueOf(field.id) + INFO_SEP + field.account + INFO_SEP + field.type + INFO_SEP + field.location + INFO_SEP + field.custom_location + INFO_SEP + + field.detail + INFO_SEP + field.custom_detail + INFO_SEP + field.value + INFO_SEP + (field.primary ? "1" : "0")); + hash += FIELD_SEP; + + // DEBUGGING START + if (DEBUG) { + try { + out.write("md5(" + String.valueOf(field.id) + INFO_SEP + field.account + INFO_SEP + field.type + INFO_SEP + field.location + INFO_SEP + field.custom_location + INFO_SEP + + field.detail + INFO_SEP + field.custom_detail + INFO_SEP + field.value + INFO_SEP + (field.primary ? "1" : "0") + ") = "); + out.write(md5(String.valueOf(field.id) + INFO_SEP + field.account + INFO_SEP + field.type + INFO_SEP + field.location + INFO_SEP + field.custom_location + INFO_SEP + + field.detail + INFO_SEP + field.custom_detail + INFO_SEP + field.value + INFO_SEP + (field.primary ? "1" : "0"))); + out.write(FIELD_SEP + "\n"); + } catch (IOException e) { + } + } + // DEBUGGING END + } + hash += CONTACT_SEP; + + // DEBUGGING START + if (DEBUG) { + try { + out.write(CONTACT_SEP + "\n\n"); + } catch (IOException e) { + } + } + // DEBUGGING END + + } + + // DEBUGGING START + if (DEBUG) { + try { + out.write("\n\n\n--------------\n" + hash); + out.write("\n\n --> " + md5(hash)); + out.close(); + } catch (IOException e) { + } + } + // DEBUGGING END + + + client.send(Statuscodes.NUM_CONTACTS_REPLY_HASH_ALL, md5(hash)); + } + + public static void sendContactHashSingle(ContactManager cm, BaseClientThread client) { + List<Contact> contacts = cm.getContacts(); + + client.send(Statuscodes.NUM_CONTACTS_REPLY_HASH_SINGLE_START, String.valueOf(contacts.size())); + + String hash; + + for (Contact contact : contacts) { + hash = ""; + for (ContactField field : contact.fields()) { + hash += md5(String.valueOf(field.id) + INFO_SEP + field.account + INFO_SEP + field.type + INFO_SEP + field.location + INFO_SEP + field.custom_location + INFO_SEP + + field.detail + INFO_SEP + field.custom_detail + INFO_SEP + field.value + INFO_SEP + (field.primary ? "1" : "0")); + hash += FIELD_SEP; + } + + client.send(Statuscodes.NUM_CONTACTS_REPLY_HASH_SINGLE_LINE, String.valueOf(contact.id), md5(hash)); + } + + client.send(Statuscodes.NUM_CONTACTS_REPLY_HASH_SINGLE_END); + } + +} \ No newline at end of file Added: branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactSync/Methods/VersionDatabase/DBAdapter.java =================================================================== --- branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactSync/Methods/VersionDatabase/DBAdapter.java (rev 0) +++ branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactSync/Methods/VersionDatabase/DBAdapter.java 2012-06-25 14:45:08 UTC (rev 987) @@ -0,0 +1,15 @@ +package com.hetzenecker.openmobilesuite.service.ContactSync.Methods.VersionDatabase; + +public class DBAdapter { + private static final String DATABASE_NAME = "contact_sync_database"; + private static final String DATABASE_TABLE = "last_synced_versions"; + private static final int DATABASE_VERSION = 1; + + public static final String KEY_ROWID = "_id"; + public static final String KEY_ISBN = "isbn"; + public static final String KEY_TITLE = "title"; + public static final String KEY_PUBLISHER = "publisher"; + private static final String DATABASE_CREATE = "create table titles (_id integer primary key autoincrement, " + + "isbn text not null, title text not null, " + "publisher text not null);"; + //private final Context context; +} Added: branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactSync/Methods/VersionDatabase/VersionDatabaseMethod.java =================================================================== --- branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactSync/Methods/VersionDatabase/VersionDatabaseMethod.java (rev 0) +++ branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactSync/Methods/VersionDatabase/VersionDatabaseMethod.java 2012-06-25 14:45:08 UTC (rev 987) @@ -0,0 +1,5 @@ +package com.hetzenecker.openmobilesuite.service.ContactSync.Methods.VersionDatabase; + +public class VersionDatabaseMethod { + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <luk...@us...> - 2012-04-08 17:04:26
|
Revision: 986 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=986&view=rev Author: lukashetzi Date: 2012-04-08 17:04:18 +0000 (Sun, 08 Apr 2012) Log Message: ----------- include desktop file too Modified Paths: -------------- branches/work/series60-remote-dbus/pc/gui/MANIFEST.in branches/work/series60-remote-dbus/pc/gui/debian/changelog Modified: branches/work/series60-remote-dbus/pc/gui/MANIFEST.in =================================================================== --- branches/work/series60-remote-dbus/pc/gui/MANIFEST.in 2012-03-26 18:55:23 UTC (rev 985) +++ branches/work/series60-remote-dbus/pc/gui/MANIFEST.in 2012-04-08 17:04:18 UTC (rev 986) @@ -28,6 +28,7 @@ include setup.py include setup_build_ui.py include openmobilesuite-gui +include openmobilesuite-gui.desktop recursive-include src *.py recursive-include distutils_oms *.py Modified: branches/work/series60-remote-dbus/pc/gui/debian/changelog =================================================================== --- branches/work/series60-remote-dbus/pc/gui/debian/changelog 2012-03-26 18:55:23 UTC (rev 985) +++ branches/work/series60-remote-dbus/pc/gui/debian/changelog 2012-04-08 17:04:18 UTC (rev 986) @@ -1,3 +1,9 @@ +openmobilesuite-gui (0.9.92-2ubuntu1) oneiric; urgency=low + + * Packaging fixes + + -- Lukas Hetzenecker <luk...@gm...> Fri, 23 Mar 2012 18:05:50 +0000 + openmobilesuite-gui (0.9.92-1ubuntu1) oneiric; urgency=low * New upstream version. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <luk...@us...> - 2012-03-26 18:55:29
|
Revision: 985 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=985&view=rev Author: lukashetzi Date: 2012-03-26 18:55:23 +0000 (Mon, 26 Mar 2012) Log Message: ----------- [WIN] Fix dbus path Modified Paths: -------------- branches/work/series60-remote-dbus/install-win32/openmobilesuite.spec Modified: branches/work/series60-remote-dbus/install-win32/openmobilesuite.spec =================================================================== --- branches/work/series60-remote-dbus/install-win32/openmobilesuite.spec 2012-03-26 18:50:00 UTC (rev 984) +++ branches/work/series60-remote-dbus/install-win32/openmobilesuite.spec 2012-03-26 18:55:23 UTC (rev 985) @@ -10,7 +10,8 @@ PKG_PATH = APP_PATH + "\\install-win32\\package" MODULE_PATH = PKG_PATH + "\\Lib\\site-packages\\openmobilesuite\\" DATA_PATH = PKG_PATH + "\\share\\openmobilesuite" -DBUS_PATH = os.getenv("ProgramFiles") + "\\dbus" +#DBUS_PATH = os.getenv("ProgramFiles") + "\\dbus" +DBUS_PATH = os.getenv("HOMEDRIVE") + "\\kderoot" try: os.mkdir(PKG_PATH) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Luk...@us...> - 2012-03-26 18:50:11
|
Revision: 984 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=984&view=rev Author: LukasHetzi Date: 2012-03-26 18:50:00 +0000 (Mon, 26 Mar 2012) Log Message: ----------- move convertContactId to base class Modified Paths: -------------- branches/work/series60-remote-dbus/pc/connection-manager/src/connectionmanager.py branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_listener/connection_listener.py branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/connectionmanager_object.py Modified: branches/work/series60-remote-dbus/pc/connection-manager/src/connectionmanager.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/src/connectionmanager.py 2012-03-26 16:25:16 UTC (rev 983) +++ branches/work/series60-remote-dbus/pc/connection-manager/src/connectionmanager.py 2012-03-26 18:50:00 UTC (rev 984) @@ -125,6 +125,26 @@ if not self.openDatabase(): raise Exception + def convertContactId(self, device_id, contact_id_on_phone = None, address = None): + # convert from contact id from phone to id from our database + id = None + + if contact_id_on_phone is not None: + id = self.database.contactIdFromIdOnPhone(device_id, contact_id_on_phone) + + if address is not None: + if id is None: + id = self.database.contactIdByPhone(device_id, address) + if id is None: + id = self.database.contactIdByName(device_id, address) + if id is None: + contact = Contact(device_id=device_id, name=address) + contact.id = self.database.contactAdd(contact) + self.contacts_service.ContactAdded(contact.serialize()) + + id = contact.id + return id + def quit(self): for connection in self.connections.itervalues(): connection.remote_object.Quit() Modified: branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_listener/connection_listener.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_listener/connection_listener.py 2012-03-26 16:25:16 UTC (rev 983) +++ branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_listener/connection_listener.py 2012-03-26 18:50:00 UTC (rev 984) @@ -76,20 +76,7 @@ remote_object.RequestCalendarHash() else: remote_object.RequestAllCalendarEntries() - - def __convertContactId(self, device, message): - # convert from contact id from phone to id from our database - id = self.database.contactIdFromIdOnPhone(device.id, message.contact_id) - if id is None: - id = self.database.contactIdByPhone(device.id, message.address) - if id is None: - id = self.database.contactIdByName(device.id, message.address) - if id is None: - contact = Contact(device_id=device.id, name=message.address) - contact.id = self.database.contactAdd(contact) - self.contacts_service.ContactAdded(contact.serialize()) - return id - + def connectionsChanged(self, name, old_owner, new_owner): if new_owner == "": print "connections lost!" @@ -210,7 +197,7 @@ message = Message.deserialize(message) #message.device_id = connection.device.id - message.contact_id = self.__convertContactId(connection.device, message) + message.contact_id = self.main.convertContactId(connection.device.id, message.contact_id, message.address) message.id = self.database.messageUpdate(message, connection.device.id) connection._updated_messages += 1 @@ -252,7 +239,7 @@ message = Message.deserialize(message) print "old contact id", message.contact_id - message.contact_id = self.__convertContactId(connection.device, message) + message.contact_id = self.main.convertContactId(connection.device.id, message.contact_id, message.address) print "new contact id", message.contact_id # The message id shouldn't be saved in the database, because there could be other messages with a higher id Modified: branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/connectionmanager_object.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/connectionmanager_object.py 2012-03-26 16:25:16 UTC (rev 983) +++ branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/connectionmanager_object.py 2012-03-26 18:50:00 UTC (rev 984) @@ -109,7 +109,12 @@ @dbus.service.method("net.sourceforge.OpenMobileSuite.ConnectionManager", in_signature='q' + Message.dbus_signature + 's') def SendMessage(self, connection_id, message, contact_name): connection = self.main.connections[connection_id] + message = Message.deserialize(message) + + if not message.contact_id: + message.contact_id = self.main.convertContactId(connection.device.id, address = message.address) + message.id = self.database.messageAdd(message) self.messages[message.id] = message This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Luk...@us...> - 2012-03-26 16:25:27
|
Revision: 983 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=983&view=rev Author: LukasHetzi Date: 2012-03-26 16:25:16 +0000 (Mon, 26 Mar 2012) Log Message: ----------- include sources in android tarball Modified Paths: -------------- branches/work/series60-remote-dbus/mobile/android/MANIFEST.in Modified: branches/work/series60-remote-dbus/mobile/android/MANIFEST.in =================================================================== --- branches/work/series60-remote-dbus/mobile/android/MANIFEST.in 2012-03-26 16:12:01 UTC (rev 982) +++ branches/work/series60-remote-dbus/mobile/android/MANIFEST.in 2012-03-26 16:25:16 UTC (rev 983) @@ -12,7 +12,21 @@ include debian/pycompat include debian/rules +include AndroidManifest.xml +include build.xml +include default.properties +include project.properties include setup.py +include drawable-scalable/LICENSE +include drawable-scalable/oxygen/LICENSE +include drawable-scalable/oxygen/README + recursive-include dist *.apk recursive-include distutils_oms *.py + +recursive-include drawable-scalable *.svg +recursive-include drawable-scalable/oxygen *.svgz + +recursive-include res *.png *.xml +recursive-include src *.java This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Luk...@us...> - 2012-03-26 16:12:12
|
Revision: 982 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=982&view=rev Author: LukasHetzi Date: 2012-03-26 16:12:01 +0000 (Mon, 26 Mar 2012) Log Message: ----------- Update ChangeLogs Modified Paths: -------------- branches/work/series60-remote-dbus/mobile/android/Changelog branches/work/series60-remote-dbus/pc/base/Changelog branches/work/series60-remote-dbus/pc/connection-manager/Changelog branches/work/series60-remote-dbus/pc/connection-obex/Changelog branches/work/series60-remote-dbus/pc/connection-oms/Changelog branches/work/series60-remote-dbus/pc/gui/Changelog Modified: branches/work/series60-remote-dbus/mobile/android/Changelog =================================================================== --- branches/work/series60-remote-dbus/mobile/android/Changelog 2012-03-25 22:00:59 UTC (rev 981) +++ branches/work/series60-remote-dbus/mobile/android/Changelog 2012-03-26 16:12:01 UTC (rev 982) @@ -0,0 +1,8 @@ +Open Mobile Suite 0.9.92 (1.0 Technical Preview 3) +-------------------------------------------------- + +Many bugfixes +Run service in foreground +Major speed improvement in message syncing +FEATURE: Add TCP as connection method +BUGFIX: Fix bug when account type is null Modified: branches/work/series60-remote-dbus/pc/base/Changelog =================================================================== --- branches/work/series60-remote-dbus/pc/base/Changelog 2012-03-25 22:00:59 UTC (rev 981) +++ branches/work/series60-remote-dbus/pc/base/Changelog 2012-03-26 16:12:01 UTC (rev 982) @@ -0,0 +1,5 @@ +Open Mobile Suite 0.9.92 (1.0 Technical Preview 3) +-------------------------------------------------- + +Many bugfixes +Port connection manager to generic connection types (e.g. bluetooth, tcp) Modified: branches/work/series60-remote-dbus/pc/connection-manager/Changelog =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/Changelog 2012-03-25 22:00:59 UTC (rev 981) +++ branches/work/series60-remote-dbus/pc/connection-manager/Changelog 2012-03-26 16:12:01 UTC (rev 982) @@ -1,3 +1,12 @@ +Open Mobile Suite 0.9.92 (1.0 Technical Preview 3) +-------------------------------------------------- + +Many bugfixes +Port connection manager to generic connection types (e.g. bluetooth, tcp) +FEATURE: Add TCP as connection method +FEATURE: Multiple connections are possible +BUGFIX: No signal is emitted when no contact is created + Open Mobile Suite 0.9.91 (1.0 Technical Preview 2) -------------------------------------------------- Modified: branches/work/series60-remote-dbus/pc/connection-obex/Changelog =================================================================== --- branches/work/series60-remote-dbus/pc/connection-obex/Changelog 2012-03-25 22:00:59 UTC (rev 981) +++ branches/work/series60-remote-dbus/pc/connection-obex/Changelog 2012-03-26 16:12:01 UTC (rev 982) @@ -0,0 +1,4 @@ +Open Mobile Suite 0.9.92 (1.0 Technical Preview 3) +-------------------------------------------------- + +Many bugfixes Modified: branches/work/series60-remote-dbus/pc/connection-oms/Changelog =================================================================== --- branches/work/series60-remote-dbus/pc/connection-oms/Changelog 2012-03-25 22:00:59 UTC (rev 981) +++ branches/work/series60-remote-dbus/pc/connection-oms/Changelog 2012-03-26 16:12:01 UTC (rev 982) @@ -1,3 +1,9 @@ +Open Mobile Suite 0.9.92 (1.0 Technical Preview 3) +-------------------------------------------------- + +Many bugfixes +FEATURE: Add TCP as connection method + Open Mobile Suite 0.9.91 (1.0 Technical Preview 2) -------------------------------------------------- Modified: branches/work/series60-remote-dbus/pc/gui/Changelog =================================================================== --- branches/work/series60-remote-dbus/pc/gui/Changelog 2012-03-25 22:00:59 UTC (rev 981) +++ branches/work/series60-remote-dbus/pc/gui/Changelog 2012-03-26 16:12:01 UTC (rev 982) @@ -1,3 +1,17 @@ +Open Mobile Suite 0.9.92 (1.0 Technical Preview 3) +-------------------------------------------------- + +Many bugfixes +Handle message count updates +FEATURE: Add TCP as connection method +FEATURE: History browser works again +FEATURE: Statistic window works again +FEATURE: Multiple connections are possible +BUGFIX: Fix problem with popup when systemtray-icon position is unknown +BUGFIX: Opening a chat from the favorite list doesn't work +BUGFIX: Clicking on unread message doesn't open chat window +BUGFIX: Fix installation of UI files + Open Mobile Suite 0.9.91 (1.0 Technical Preview 2) -------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Luk...@us...> - 2012-03-25 22:01:06
|
Revision: 981 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=981&view=rev Author: LukasHetzi Date: 2012-03-25 22:00:59 +0000 (Sun, 25 Mar 2012) Log Message: ----------- set default size for chat window Modified Paths: -------------- branches/work/series60-remote-dbus/pc/gui/src/lib/settings.py Modified: branches/work/series60-remote-dbus/pc/gui/src/lib/settings.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/lib/settings.py 2012-03-25 21:35:12 UTC (rev 980) +++ branches/work/series60-remote-dbus/pc/gui/src/lib/settings.py 2012-03-25 22:00:59 UTC (rev 981) @@ -105,7 +105,7 @@ self.beginGroup("chat") self.__settings["windows/chat/tabbedChat"] = self.value("tabbedChat", QVariant(False)).toBool() - self.__settings["windows/chat/size"] = self.value("size", QVariant(QSize())).toSize() + self.__settings["windows/chat/size"] = self.value("size", QVariant(QSize(600, 400))).toSize() self.__settings["windows/chat/splitter"] = self.value("splitter", QVariant(QByteArray())).toByteArray() self.beginGroup("theme") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Luk...@us...> - 2012-03-25 21:35:20
|
Revision: 980 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=980&view=rev Author: LukasHetzi Date: 2012-03-25 21:35:12 +0000 (Sun, 25 Mar 2012) Log Message: ----------- add desktop file Modified Paths: -------------- branches/work/series60-remote-dbus/pc/gui/setup.py Added Paths: ----------- branches/work/series60-remote-dbus/pc/gui/openmobilesuite-gui.desktop Added: branches/work/series60-remote-dbus/pc/gui/openmobilesuite-gui.desktop =================================================================== --- branches/work/series60-remote-dbus/pc/gui/openmobilesuite-gui.desktop (rev 0) +++ branches/work/series60-remote-dbus/pc/gui/openmobilesuite-gui.desktop 2012-03-25 21:35:12 UTC (rev 980) @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Open Mobile Suite +Type=Application +Exec=openmobilesuite-gui +Icon=phone +Comment=Application to manage your Android or S60 mobile phone +MimeType= +Categories=Network;Office; Modified: branches/work/series60-remote-dbus/pc/gui/setup.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/setup.py 2012-03-23 22:48:09 UTC (rev 979) +++ branches/work/series60-remote-dbus/pc/gui/setup.py 2012-03-25 21:35:12 UTC (rev 980) @@ -41,6 +41,9 @@ for file in files: data[datadest].append(os.sep.join( (root, file) )) +application_dir = os.sep.join(['share', 'applications']) +data[application_dir] = [moddir + os.sep + 'openmobilesuite-gui.desktop'] + setup(name='openmobilesuite-gui', version='0.9.92', package_dir={'openmobilesuite.gui': srcdir}, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <luk...@us...> - 2012-03-23 22:48:22
|
Revision: 979 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=979&view=rev Author: lukashetzi Date: 2012-03-23 22:48:09 +0000 (Fri, 23 Mar 2012) Log Message: ----------- Many bugfixes Modified Paths: -------------- branches/work/series60-remote-dbus/pc/connection-manager/src/connectionmanager.py branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_listener/obexconnection_listener.py branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/bluetoothscanner_object.py branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/obexconnectionmanager_object.py branches/work/series60-remote-dbus/pc/connection-oms/src/connection/base_connection_thread_listener.py branches/work/series60-remote-dbus/pc/connection-oms/src/connection/bluetooth_pybluez_connection_listener.py branches/work/series60-remote-dbus/pc/connection-oms/src/connection/tcp_connection_listener.py branches/work/series60-remote-dbus/pc/gui/src/lib/helper.py branches/work/series60-remote-dbus/pc/gui/src/widget/MessageReplyWidget.py branches/work/series60-remote-dbus/pc/gui/src/window/mainwindow/messages.py branches/work/series60-remote-dbus/pc/gui/src/window/popups.py branches/work/series60-remote-dbus/pc/gui/src/window/wizard.py Modified: branches/work/series60-remote-dbus/pc/connection-manager/src/connectionmanager.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/src/connectionmanager.py 2012-03-23 18:10:36 UTC (rev 978) +++ branches/work/series60-remote-dbus/pc/connection-manager/src/connectionmanager.py 2012-03-23 22:48:09 UTC (rev 979) @@ -55,7 +55,8 @@ self.plugins = (p_openmobilesuite, ) self.plugin_obex_ftp = ConnectionPlugin("OBEX", "openmobilesuite-connection-obex", "OBEX File Transfer", (Symbian, Android)) - self.plugin_obex_opp = ConnectionPlugin("OBEX", "openmobilesuite-connection-obex", "Object Push", (Symbian, Android)) + self.plugin_obex_opp = ConnectionPlugin("OBEX", "openmobilesuite-connection-obex", "OBEX Object Push", (Symbian, Android)) + self.plugin_obex_opp_alt = ConnectionPlugin("OBEX", "openmobilesuite-connection-obex", "Object Push", (Symbian, Android)) # Initialize variables self.connections = {} Modified: branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_listener/obexconnection_listener.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_listener/obexconnection_listener.py 2012-03-23 18:10:36 UTC (rev 978) +++ branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_listener/obexconnection_listener.py 2012-03-23 22:48:09 UTC (rev 979) @@ -50,12 +50,12 @@ def initialized(self, bluetooth_address, bluetooth_port, obex_protocol, interface, path): con = None for connection in self.main.obex_connections.itervalues(): - print connection.state, connection.device.bluetooth_address, connection.device.bluetooth_port + print connection.state, connection.device.connection.bluetooth_address, connection.device.connection.bluetooth_port print "requested", connection.state == ConnectionState.ConnectionRequested print "ready", connection.state == ConnectionState.ConnectionReady print "connecting", connection.state == ConnectionState.Connecting - if connection.state == ConnectionState.ConnectionRequested and connection.device.bluetooth_address == bluetooth_address \ - and connection.device.bluetooth_port == bluetooth_port: + if connection.state == ConnectionState.ConnectionRequested and connection.device.connection.bluetooth_address == bluetooth_address \ + and connection.device.connection.bluetooth_port == bluetooth_port: con = connection break Modified: branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/bluetoothscanner_object.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/bluetoothscanner_object.py 2012-03-23 18:10:36 UTC (rev 978) +++ branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/bluetoothscanner_object.py 2012-03-23 22:48:09 UTC (rev 979) @@ -82,7 +82,10 @@ if protocol == Protocol.FileTransfer: return self.LookupPortByService(bluetooth_address, self.main.plugin_obex_ftp.bluetooth_servicename) elif protocol == Protocol.ObjectPush: - return self.LookupPortByService(bluetooth_address, self.main.plugin_obex_opp.bluetooth_servicename) + port = self.LookupPortByService(bluetooth_address, self.main.plugin_obex_opp.bluetooth_servicename) + if port == 0: + port = self.LookupPortByService(bluetooth_address, self.main.plugin_obex_opp_alt.bluetooth_servicename) + return port return ScanningError.UnknownProtocol Modified: branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/obexconnectionmanager_object.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/obexconnectionmanager_object.py 2012-03-23 18:10:36 UTC (rev 978) +++ branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/obexconnectionmanager_object.py 2012-03-23 22:48:09 UTC (rev 979) @@ -6,7 +6,9 @@ from openmobilesuite.base.element.obex_connection import ObexConnection, Protocol, ConnectionState from openmobilesuite.base.element.directory_element import DirectoryElement from openmobilesuite.base.element.connection import ConnectionError +from openmobilesuite.base.element.connection_type import ConnectionType from openmobilesuite.base.element.device import Device +from openmobilesuite.base.lib.connection_adapter import ConnectionAdapter class QueueElement: func = None @@ -61,7 +63,10 @@ @dbus.service.method("net.sourceforge.OpenMobileSuite.ObexConnectionManager", in_signature='sqq', out_signature='i', async_callbacks=('dbus_ok', 'dbus_error')) def RequestConnection(self, bluetooth_address, bluetooth_port, protocol, dbus_ok, dbus_error): - device = Device(bluetooth_address=bluetooth_address, bluetooth_port=bluetooth_port) + device = Device(connection_type = ConnectionType.Bluetooth) + device.connection = ConnectionAdapter(device) + device.connection.setArgumentList(bluetooth_address, bluetooth_port) + requested_connection = ObexConnection(device, protocol) if requested_connection in self.main.obex_connections.itervalues(): dbus_error(ConnectionError.AlreadyConnected) Modified: branches/work/series60-remote-dbus/pc/connection-oms/src/connection/base_connection_thread_listener.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-oms/src/connection/base_connection_thread_listener.py 2012-03-23 18:10:36 UTC (rev 978) +++ branches/work/series60-remote-dbus/pc/connection-oms/src/connection/base_connection_thread_listener.py 2012-03-23 22:48:09 UTC (rev 979) @@ -21,62 +21,55 @@ def receiveFromSocket(self, socket): raise NotImplementedError() - # recv = self.sock.recv(100000) def sendToSocket(self, socket, data): raise NotImplementedError() + def connectionFailed(self, error_number, error_message): + self.connection_service.ConnectionFailed(error_number, error_message) + def run(self): self.connect(self.parent, QtCore.SIGNAL("requestSend(QString)"), self.send) -# try: self.sock = self.openSocket() - self.connectSocket(self.sock) -# except Exception as (errno, errmsg): -## if os.name == "nt": -## errno = msg.errno -## errmsg = msg.message -## else: -## print "msg is", msg, type(msg) -## errno, errmsg = eval(msg[0]) # msg.message has been deprecated as of Python 2.6 -## errmsg = unicode(errmsg, "utf8") -# self.connection_service.ConnectionFailed(errno, errmsg) -# return + if not self.connectSocket(self.sock): + return data = "" while True: - #try: + try: recv = self.receiveFromSocket(self.sock) - if recv: - data += recv - - # Last part is either empty or the beginning of the next data segment - data = data.split(NUM_END_TEXT) - for part in data[:-1]: - # Extract header and message - header = int(part.split(NUM_END_HEADER)[0]) - message = unicode(part.split(NUM_END_HEADER)[1], "utf8") + except Exception: + self.disconnect(self.parent, SIGNAL("requestSend(QString)"), self.send) + return + + if recv: + data += recv + + # Last part is either empty or the beginning of the next data segment + data = data.split(NUM_END_TEXT) + for part in data[:-1]: + # Extract header and message + header = int(part.split(NUM_END_HEADER)[0]) + message = unicode(part.split(NUM_END_HEADER)[1], "utf8") - # Quit the thread -> finished() signal emitted - if header == NUM_QUIT: - return - #print "recv", header, message - self.emit(QtCore.SIGNAL("dataAvailable"), header, message) + # Quit the thread -> finished() signal emitted + if header == NUM_QUIT: + return + #print "recv", header, message + self.emit(QtCore.SIGNAL("dataAvailable"), header, message) - data = data[-1] - else: - # Got an empty string -> connection is closed - self.disconnect(self.parent, QtCore.SIGNAL("requestSend(QString)"), self.send) - return - #except Exception: - #self.disconnect(self.parent, SIGNAL("requestSend(QString)"), self.send) - #return + data = data[-1] + else: + # Got an empty string -> connection is closed + self.disconnect(self.parent, QtCore.SIGNAL("requestSend(QString)"), self.send) + return def send(self, data): data = str(data.toAscii()) - #try: - self.sendToSocket(self.sock, data) - #except Exception: + try: + self.sendToSocket(self.sock, data) + except Exception: # print "exception..." - # self.disconnect(self.parent, QtCore.SIGNAL("requestSend(QString)"), self.send) - # self.exit(1) + self.disconnect(self.parent, QtCore.SIGNAL("requestSend(QString)"), self.send) + self.exit(1) Modified: branches/work/series60-remote-dbus/pc/connection-oms/src/connection/bluetooth_pybluez_connection_listener.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-oms/src/connection/bluetooth_pybluez_connection_listener.py 2012-03-23 18:10:36 UTC (rev 978) +++ branches/work/series60-remote-dbus/pc/connection-oms/src/connection/bluetooth_pybluez_connection_listener.py 2012-03-23 22:48:09 UTC (rev 979) @@ -3,6 +3,7 @@ # Copyright (c) 2008 - 2012 Lukas Hetzenecker <Lu...@gm...> +import os import bluetooth from .base_connection_thread_listener import BaseConnectionThreadListener @@ -14,7 +15,20 @@ return bluetooth.BluetoothSocket( bluetooth.RFCOMM ) def connectSocket(self, socket): - return socket.connect( (self.connection.bluetooth_address, self.connection.bluetooth_port) ) + try: + socket.connect( (self.connection.bluetooth_address, self.connection.bluetooth_port) ) + except bluetooth.btcommon.BluetoothError, msg: + if os.name == "nt": + errno = msg.errno + errmsg = msg.message + else: + errno, errmsg = eval(msg[0]) # msg.message has been deprecated as of Python 2.6 + errmsg = unicode(errmsg, "utf8") + + self.connectionFailed(errno, errmsg) + return False + + return True def receiveFromSocket(self, socket): return socket.recv(100000) Modified: branches/work/series60-remote-dbus/pc/connection-oms/src/connection/tcp_connection_listener.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-oms/src/connection/tcp_connection_listener.py 2012-03-23 18:10:36 UTC (rev 978) +++ branches/work/series60-remote-dbus/pc/connection-oms/src/connection/tcp_connection_listener.py 2012-03-23 22:48:09 UTC (rev 979) @@ -14,7 +14,13 @@ return socket.socket(socket.AF_INET, socket.SOCK_STREAM) def connectSocket(self, socket): - return socket.connect( (self.connection.remote_address, self.connection.remote_port) ) + try: + socket.connect( (self.connection.remote_address, self.connection.remote_port) ) + except Exception as error: + self.connectionFailed(error.errno, error.strerror) + return False + + return True def receiveFromSocket(self, socket): return socket.recv(100000) Modified: branches/work/series60-remote-dbus/pc/gui/src/lib/helper.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/lib/helper.py 2012-03-23 18:10:36 UTC (rev 978) +++ branches/work/series60-remote-dbus/pc/gui/src/lib/helper.py 2012-03-23 22:48:09 UTC (rev 979) @@ -182,7 +182,7 @@ If you're using the SVN version of the application you have to create the file yourself If you downloaded a pre-built package please report the error to ser...@li... !""").arg("mobile" + os.sep + device_type.name + os.sep + file)) else: - dir = QFileInfo(folder).absoluteDir().absolutePath() + dir = QFileInfo(path).absoluteDir().absolutePath() QDesktopServices.openUrl(QUrl.fromLocalFile(dir)) def __showError(self, parent, title, message): @@ -218,7 +218,7 @@ If you downloaded a pre-built package please report the error to ser...@li... !""").arg("mobile" + os.sep + device_type.name + os.sep + file)) return - self.__obex_beginConnect(parent, device.bluetooth_address, path) + self.__obex_beginConnect(parent, device.connection.bluetooth_address, path) def __obex_beginConnect(self, parent, address, path): def error(error): Modified: branches/work/series60-remote-dbus/pc/gui/src/widget/MessageReplyWidget.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/widget/MessageReplyWidget.py 2012-03-23 18:10:36 UTC (rev 978) +++ branches/work/series60-remote-dbus/pc/gui/src/widget/MessageReplyWidget.py 2012-03-23 22:48:09 UTC (rev 979) @@ -20,7 +20,7 @@ self.setMaximumHeight(self.messageEditWidget.height()) def sentMessage(self, message): - self.messageDisplayWidget.setText("<b>" + self.tr("Your reply:") + "</b><br />" + message.message()) + self.messageDisplayWidget.setText("<b>" + self.tr("Your reply:") + "</b><br />" + message.message) self.setCurrentWidget(self.messageDisplayWidget) self.setMaximumHeight(self.messageDisplayWidget.sizeHint().height()) Modified: branches/work/series60-remote-dbus/pc/gui/src/window/mainwindow/messages.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/window/mainwindow/messages.py 2012-03-23 18:10:36 UTC (rev 978) +++ branches/work/series60-remote-dbus/pc/gui/src/window/mainwindow/messages.py 2012-03-23 22:48:09 UTC (rev 979) @@ -168,7 +168,8 @@ message.encoding = "" # TODO: encoding # TODO: connection id - connection_id = self.main.active_connections.keys()[0] + #connection_id = self.main.active_connections.keys()[0] + connection_id = device.active_connection.id self.main.connection_manager_object.SendMessage(connection_id, message.serialize(), contact.visibleString()) self.recipent_line.clearContacts() Modified: branches/work/series60-remote-dbus/pc/gui/src/window/popups.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/window/popups.py 2012-03-23 18:10:36 UTC (rev 978) +++ branches/work/series60-remote-dbus/pc/gui/src/window/popups.py 2012-03-23 22:48:09 UTC (rev 979) @@ -8,7 +8,7 @@ from ..widget.Popup import Popup, PopupType from ..widget.MessageReplyWidget import MessageReplyWidget from ..widget.MessageReplyTextEdit import MessageReplyTextEdit -from openmobilesuite.base.element.message import Message +from openmobilesuite.base.element.message import Message, MessageType from openmobilesuite.base.element.connection import ConnectionState class Popups(QWidget): @@ -23,6 +23,8 @@ #self.database = main.database self.settings = main.settings self.trayicon = main.trayicon + + self.connection_manager_object = main.connection_manager_object def connected(self, connection): if not self.settings.setting("popups/show"): @@ -64,6 +66,8 @@ # return contact = self.main.contact(msg.contact_id) + device = self.main.devices[contact.device_id] + connection = device.active_connection for popup in self.main.popups: if popup.popupType() == PopupType.Message and popup.property("message").toPyObject().contact_id == msg.contact_id: @@ -155,9 +159,9 @@ self.connect(myPopup.buttons, SIGNAL("clicked(QAbstractButton *)"), self.buttonClicked) self.connect(myPopup, SIGNAL("extendedWidgetActivated"), lambda activated : sendButton.setEnabled(activated)) self.connect(myPopup, SIGNAL("extendedWidgetActivated"), lambda activated : self.__extendedWidgetActivated(activated, msg)) - self.connect(myPopup, SIGNAL("closeButtonClicked()"), lambda : self.main.unreadMessages.remove(msg)) - self.connect(myPopup, SIGNAL("closeButtonClicked()"), lambda : self.connection.setRead(msg)) - self.connect(sendButton, SIGNAL("clicked()"), lambda : self.__sendMessage(sendButton, extendedWidget, contact)) + #self.connect(myPopup, SIGNAL("closeButtonClicked()"), lambda : connection.unread_messages.remove(msg)) + self.connect(myPopup, SIGNAL("closeButtonClicked()"), lambda : self.connection_manager_object.SetMessageRead(connection.id, msg.id)) + self.connect(sendButton, SIGNAL("clicked()"), lambda : self.__sendMessage(sendButton, extendedWidget, connection, contact, msg.address)) self.connect(menu, SIGNAL("triggered(QAction *)"), lambda act : myPopup.close()) self.connect(menu, SIGNAL("triggered(QAction *)"), self.ignore) @@ -169,56 +173,56 @@ self.main.unreadMessages.remove(msg) self.connection.setRead(msg) - def __sendMessage(self, sendButton, extendedWidget, contact): - message = unicode(extendedWidget.toPlainText()) - if len(message) == 0: + def __sendMessage(self, sendButton, extendedWidget, connection, contact, address): + message_text = unicode(extendedWidget.toPlainText()) + if len(message_text) == 0: QToolTip.showText(sendButton.mapToGlobal(QPoint(0, 0)), self.tr("You have to write a reply message!")) return - if len(contact.value("mobile_number")) > 1: - self.log.info(QString("Contact %1 has more then one mobile number.").arg(contact.name())) - phone = self.askMobileNumber(contact) - if phone == None: - return - elif len(contact.value("mobile_number")) == 1: - phone = contact.value("mobile_number")[0] - elif re.match(r"^[+]{0,1}\d*$", contact.name()) != None: - # name is a phone number - phone = contact.name() - else: - self.log.info(QString("Contact %1 has no valid mobile number.").arg(contact.name())) - - dialog = QDialog(self) - ml = QVBoxLayout(dialog) - label = QLabel(self.tr("Please enter a valid mobile phone number:"), dialog) - lineedit = QLineEdit(dialog) - validator = QRegExpValidator(QRegExp("\+?\d*"), dialog) - buttonbox = QDialogButtonBox(QDialogButtonBox.Ok, Qt.Horizontal, dialog) - - lineedit.setValidator(validator) - ml.addWidget(label) - ml.addWidget(lineedit) - ml.addWidget(buttonbox) - - dialog.connect(buttonbox, SIGNAL("accepted()"), dialog.accept) - - dialog.exec_() - - phone = lineedit.text() - - contact.addInternalValue("phone", phone) +# if len(contact.value("mobile_number")) > 1: +# self.log.info(QString("Contact %1 has more then one mobile number.").arg(contact.name())) +# phone = self.askMobileNumber(contact) +# if phone == None: +# return +# elif len(contact.value("mobile_number")) == 1: +# phone = contact.value("mobile_number")[0] +# elif re.match(r"^[+]{0,1}\d*$", contact.name()) != None: +# # name is a phone number +# phone = contact.name() +# else: +# self.log.info(QString("Contact %1 has no valid mobile number.").arg(contact.name())) +# +# dialog = QDialog(self) +# ml = QVBoxLayout(dialog) +# label = QLabel(self.tr("Please enter a valid mobile phone number:"), dialog) +# lineedit = QLineEdit(dialog) +# validator = QRegExpValidator(QRegExp("\+?\d*"), dialog) +# buttonbox = QDialogButtonBox(QDialogButtonBox.Ok, Qt.Horizontal, dialog) +# +# lineedit.setValidator(validator) +# ml.addWidget(label) +# ml.addWidget(lineedit) +# ml.addWidget(buttonbox) +# +# dialog.connect(buttonbox, SIGNAL("accepted()"), dialog.accept) +# +# dialog.exec_() +# +# phone = lineedit.text() +# +# contact.addInternalValue("phone", phone) - msg = Message() - msg.setType(MessageType.Outgoing) - msg.setDevice(self.connection.device()) - msg.setContact(contact) - msg.setDateTime(QDateTime.currentDateTime()) - msg.setMessage(message) - #msg.setMessageEncoding(self.encodingLabel.encoding()) - - extendedWidget.sentMessage(msg) - self.connection.sendMessage(msg) + message = Message() + message.type = MessageType.Outgoing + message.contact_id = contact.id + message.address = address + message.date_time = QDateTime.currentDateTime() + message.message = message_text + message.encoding = "" # TODO: encoding + extendedWidget.sentMessage(message) + self.main.connection_manager_object.SendMessage(connection.id, message.serialize(), contact.visibleString()) + extendedWidget.parent().disableAnimations() extendedWidget.parent().adjustSize() extendedWidget.parent().enableAnimations() Modified: branches/work/series60-remote-dbus/pc/gui/src/window/wizard.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/window/wizard.py 2012-03-23 18:10:36 UTC (rev 978) +++ branches/work/series60-remote-dbus/pc/gui/src/window/wizard.py 2012-03-23 22:48:09 UTC (rev 979) @@ -107,10 +107,8 @@ if not device.type().has_been_configured: self.setStartId(WizardPages.PlatformPage) - elif isinstance(device.type(), Android): - self.setStartId(WizardPages.InstallAndroidPage) - elif isinstance(device.type(), Symbian): - self.setStartId(WizardPages.InstallS60Page) + else: + self.setStartId(WizardPages.InstallPage) self.setEndId(WizardPages.DatabasePage) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <luk...@us...> - 2012-03-23 18:10:48
|
Revision: 978 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=978&view=rev Author: lukashetzi Date: 2012-03-23 18:10:36 +0000 (Fri, 23 Mar 2012) Log Message: ----------- bump versions; update script Modified Paths: -------------- branches/work/series60-remote-dbus/install-win32/openmobilesuite.iss branches/work/series60-remote-dbus/update_version.py Modified: branches/work/series60-remote-dbus/install-win32/openmobilesuite.iss =================================================================== --- branches/work/series60-remote-dbus/install-win32/openmobilesuite.iss 2012-03-23 18:03:05 UTC (rev 977) +++ branches/work/series60-remote-dbus/install-win32/openmobilesuite.iss 2012-03-23 18:10:36 UTC (rev 978) @@ -6,7 +6,7 @@ ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppId={{5CDAE448-28FD-401D-BB5B-1E97B25249DC} AppName=Open Mobile Suite -AppVerName=Open Mobile Suite - 1.0 Technical Preview 2 +AppVerName=Open Mobile Suite - 1.0 Technical Preview 3 AppPublisher=Lukas Hetzenecker AppPublisherURL=http://series60-remote.sourceforge.net AppSupportURL=http://series60-remote.sourceforge.net @@ -16,7 +16,7 @@ AllowNoIcons=yes LicenseFile=dist\openmobilesuite\LICENSE.txt InfoBeforeFile=dist\openmobilesuite\Changelog.txt -OutputBaseFilename=openmobilesuite-0.9.91 +OutputBaseFilename=openmobilesuite-0.9.92 Compression=lzma SolidCompression=yes Modified: branches/work/series60-remote-dbus/update_version.py =================================================================== --- branches/work/series60-remote-dbus/update_version.py 2012-03-23 18:03:05 UTC (rev 977) +++ branches/work/series60-remote-dbus/update_version.py 2012-03-23 18:10:36 UTC (rev 978) @@ -16,7 +16,7 @@ [r"version='(.*)',$", ["mobile/android/setup.py"]], [r"^VERSION=(.*)$", ["mobile/android/Makefile"]], [r"android:versionName=\"(.*)\"", ["mobile/android/AndroidManifest.xml"]], - [r"\"Android package\" : \"OpenMobileSuite-(.*).apk\"", ["pc/base/src/device/android.py"]], + [r"version = \"(.*)\"", ["pc/base/src/device/android.py"]], ], ["openmobilesuite-mobile-android", "mobile/android/debian/changelog"], ], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <luk...@us...> - 2012-03-23 18:03:16
|
Revision: 977 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=977&view=rev Author: lukashetzi Date: 2012-03-23 18:03:05 +0000 (Fri, 23 Mar 2012) Log Message: ----------- update android project files and versions Modified Paths: -------------- branches/work/series60-remote-dbus/mobile/android/AndroidManifest.xml branches/work/series60-remote-dbus/mobile/android/Makefile branches/work/series60-remote-dbus/mobile/android/build.xml branches/work/series60-remote-dbus/mobile/android/debian/changelog branches/work/series60-remote-dbus/mobile/android/proguard.cfg branches/work/series60-remote-dbus/mobile/android/setup.py branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/Statuscodes.java Modified: branches/work/series60-remote-dbus/mobile/android/AndroidManifest.xml =================================================================== --- branches/work/series60-remote-dbus/mobile/android/AndroidManifest.xml 2012-03-23 17:34:17 UTC (rev 976) +++ branches/work/series60-remote-dbus/mobile/android/AndroidManifest.xml 2012-03-23 18:03:05 UTC (rev 977) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hetzenecker.openmobilesuite" android:versionCode="1" - android:versionName="0.9.91"> + android:versionName="0.9.92"> <uses-permission android:name="android.permission.BLUETOOTH"></uses-permission> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"></uses-permission> Modified: branches/work/series60-remote-dbus/mobile/android/Makefile =================================================================== --- branches/work/series60-remote-dbus/mobile/android/Makefile 2012-03-23 17:34:17 UTC (rev 976) +++ branches/work/series60-remote-dbus/mobile/android/Makefile 2012-03-23 18:03:05 UTC (rev 977) @@ -1,7 +1,7 @@ #!/bin/make -f MODULE=mobile-android -VERSION=0.9.91 +VERSION=0.9.92 PYTHON=`which python` Modified: branches/work/series60-remote-dbus/mobile/android/build.xml =================================================================== --- branches/work/series60-remote-dbus/mobile/android/build.xml 2012-03-23 17:34:17 UTC (rev 976) +++ branches/work/series60-remote-dbus/mobile/android/build.xml 2012-03-23 18:03:05 UTC (rev 977) @@ -45,22 +45,20 @@ unless="sdk.dir" /> + <!-- + Import per project custom build rules if present at the root of the project. + This is the place to put custom intermediary targets such as: + -pre-build + -pre-compile + -post-compile (This is typically used for code obfuscation. + Compiled code location: ${out.classes.absolute.dir} + If this is not done in place, override ${out.dex.input.absolute.dir}) + -post-package + -post-build + -pre-clean + --> + <import file="custom_rules.xml" optional="true" /> -<!-- extension targets. Uncomment the ones where you want to do custom work - in between standard targets --> -<!-- - <target name="-pre-build"> - </target> - <target name="-pre-compile"> - </target> - - /* This is typically used for code obfuscation. - Compiled code location: ${out.classes.absolute.dir} - If this is not done in place, override ${out.dex.input.absolute.dir} */ - <target name="-post-compile"> - </target> ---> - <!-- Import the actual build file. To customize existing targets, there are two options: @@ -79,7 +77,7 @@ In all cases you must update the value of version-tag below to read 'custom' instead of an integer, in order to avoid having your file be overridden by tools such as "android update project" --> - <!-- version-tag: custom --> + <!-- version-tag: 1 --> <import file="${sdk.dir}/tools/ant/build.xml" /> </project> Modified: branches/work/series60-remote-dbus/mobile/android/debian/changelog =================================================================== --- branches/work/series60-remote-dbus/mobile/android/debian/changelog 2012-03-23 17:34:17 UTC (rev 976) +++ branches/work/series60-remote-dbus/mobile/android/debian/changelog 2012-03-23 18:03:05 UTC (rev 977) @@ -1,3 +1,9 @@ +openmobilesuite-mobile-android (0.9.92-1ubuntu1) oneiric; urgency=low + + * New upstream version. + + -- Lukas Hetzenecker <luk...@gm...> Fri, 23 Mar 2012 18:04:59 +0000 + openmobilesuite-mobile-android (0.9.91-2ubuntu1) oneiric; urgency=low * Rebuild. Modified: branches/work/series60-remote-dbus/mobile/android/proguard.cfg =================================================================== --- branches/work/series60-remote-dbus/mobile/android/proguard.cfg 2012-03-23 17:34:17 UTC (rev 976) +++ branches/work/series60-remote-dbus/mobile/android/proguard.cfg 2012-03-23 18:03:05 UTC (rev 977) @@ -18,18 +18,14 @@ native <methods>; } --keepclasseswithmembers class * { +-keepclasseswithmembernames class * { public <init>(android.content.Context, android.util.AttributeSet); } --keepclasseswithmembers class * { +-keepclasseswithmembernames class * { public <init>(android.content.Context, android.util.AttributeSet, int); } --keepclassmembers class * extends android.app.Activity { - public void *(android.view.View); -} - -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); Modified: branches/work/series60-remote-dbus/mobile/android/setup.py =================================================================== --- branches/work/series60-remote-dbus/mobile/android/setup.py 2012-03-23 17:34:17 UTC (rev 976) +++ branches/work/series60-remote-dbus/mobile/android/setup.py 2012-03-23 18:03:05 UTC (rev 977) @@ -22,6 +22,6 @@ data[datadest].append(os.sep.join( (root, file) )) setup(name='openmobilesuite-mobile-android', - version='0.9.91', + version='0.9.92', data_files=data.items(), ) Modified: branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/Statuscodes.java =================================================================== --- branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/Statuscodes.java 2012-03-23 17:34:17 UTC (rev 976) +++ branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/Statuscodes.java 2012-03-23 18:03:05 UTC (rev 977) @@ -74,6 +74,6 @@ public static final char NUM_SEPERATOR = 0x1E; // Record Separator public static final char NUM_END_TEXT = 0x03; // End of Text - public static final float PROTOCOL_VERSION = 1.6f; + public static final float PROTOCOL_VERSION = 1.7f; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <luk...@us...> - 2012-03-23 17:34:30
|
Revision: 976 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=976&view=rev Author: lukashetzi Date: 2012-03-23 17:34:17 +0000 (Fri, 23 Mar 2012) Log Message: ----------- Bump version Modified Paths: -------------- branches/work/series60-remote-dbus/pc/base/Makefile branches/work/series60-remote-dbus/pc/base/debian/changelog branches/work/series60-remote-dbus/pc/base/setup.py branches/work/series60-remote-dbus/pc/connection-manager/Makefile branches/work/series60-remote-dbus/pc/connection-manager/debian/changelog branches/work/series60-remote-dbus/pc/connection-manager/setup.py branches/work/series60-remote-dbus/pc/connection-obex/Makefile branches/work/series60-remote-dbus/pc/connection-obex/debian/changelog branches/work/series60-remote-dbus/pc/connection-obex/setup.py branches/work/series60-remote-dbus/pc/connection-oms/Makefile branches/work/series60-remote-dbus/pc/connection-oms/debian/changelog branches/work/series60-remote-dbus/pc/connection-oms/setup.py branches/work/series60-remote-dbus/pc/connection-oms/src/plugin/StatusNumbers.py branches/work/series60-remote-dbus/pc/gui/Makefile branches/work/series60-remote-dbus/pc/gui/debian/changelog branches/work/series60-remote-dbus/pc/gui/setup.py branches/work/series60-remote-dbus/pc/gui/src/gui.py Modified: branches/work/series60-remote-dbus/pc/base/Makefile =================================================================== --- branches/work/series60-remote-dbus/pc/base/Makefile 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/base/Makefile 2012-03-23 17:34:17 UTC (rev 976) @@ -1,7 +1,7 @@ #!/bin/make -f MODULE=base -VERSION=0.9.91 +VERSION=0.9.92 PYTHON=`which python` Modified: branches/work/series60-remote-dbus/pc/base/debian/changelog =================================================================== --- branches/work/series60-remote-dbus/pc/base/debian/changelog 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/base/debian/changelog 2012-03-23 17:34:17 UTC (rev 976) @@ -1,3 +1,9 @@ +openmobilesuite-base (0.9.92-1ubuntu1) oneiric; urgency=low + + * New upstream version. + + -- Lukas Hetzenecker <luk...@gm...> Fri, 23 Mar 2012 18:05:33 +0000 + openmobilesuite-base (0.9.91-2ubuntu1) oneiric; urgency=low * Rebuild. Modified: branches/work/series60-remote-dbus/pc/base/setup.py =================================================================== --- branches/work/series60-remote-dbus/pc/base/setup.py 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/base/setup.py 2012-03-23 17:34:17 UTC (rev 976) @@ -8,7 +8,7 @@ #from distutils.core import setup from distutils_oms import setup, find_modules setup(name='openmobilesuite-base', - version='0.9.91', + version='0.9.92', package_dir={'openmobilesuite.base': srcdir}, packages=find_modules('openmobilesuite.base', srcdir), touch_modules=['openmobilesuite'], Modified: branches/work/series60-remote-dbus/pc/connection-manager/Makefile =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/Makefile 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/connection-manager/Makefile 2012-03-23 17:34:17 UTC (rev 976) @@ -1,7 +1,7 @@ #!/bin/make -f MODULE=connectionmanager -VERSION=0.9.91 +VERSION=0.9.92 PYTHON=`which python` Modified: branches/work/series60-remote-dbus/pc/connection-manager/debian/changelog =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/debian/changelog 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/connection-manager/debian/changelog 2012-03-23 17:34:17 UTC (rev 976) @@ -1,3 +1,9 @@ +openmobilesuite-connectionmanager (0.9.92-1ubuntu1) oneiric; urgency=low + + * New upstream version. + + -- Lukas Hetzenecker <luk...@gm...> Fri, 23 Mar 2012 18:05:36 +0000 + openmobilesuite-connectionmanager (0.9.91-1ubuntu2) oneiric; urgency=low * Rebuild Modified: branches/work/series60-remote-dbus/pc/connection-manager/setup.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/setup.py 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/connection-manager/setup.py 2012-03-23 17:34:17 UTC (rev 976) @@ -8,7 +8,7 @@ #from distutils.core import setup from distutils_oms import setup, find_modules setup(name='openmobilesuite-connectionmanager', - version='0.9.91', + version='0.9.92', package_dir={'openmobilesuite.connectionmanager': srcdir}, packages=find_modules('openmobilesuite.connectionmanager', srcdir), dbus_files=[moddir + os.sep + 'data' + os.sep + 'net.sourceforge.OpenMobileSuite.ConnectionManager.service.in'], Modified: branches/work/series60-remote-dbus/pc/connection-obex/Makefile =================================================================== --- branches/work/series60-remote-dbus/pc/connection-obex/Makefile 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/connection-obex/Makefile 2012-03-23 17:34:17 UTC (rev 976) @@ -1,7 +1,7 @@ #!/bin/make -f MODULE=connection-obex -VERSION=0.9.91 +VERSION=0.9.92 PYTHON=`which python` Modified: branches/work/series60-remote-dbus/pc/connection-obex/debian/changelog =================================================================== --- branches/work/series60-remote-dbus/pc/connection-obex/debian/changelog 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/connection-obex/debian/changelog 2012-03-23 17:34:17 UTC (rev 976) @@ -1,3 +1,9 @@ +openmobilesuite-connection-obex (0.9.92-1ubuntu1) oneiric; urgency=low + + * New upstream version. + + -- Lukas Hetzenecker <luk...@gm...> Fri, 23 Mar 2012 18:05:47 +0000 + openmobilesuite-connection-obex (0.9.91-1ubuntu2) oneiric; urgency=low * Rebuild Modified: branches/work/series60-remote-dbus/pc/connection-obex/setup.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-obex/setup.py 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/connection-obex/setup.py 2012-03-23 17:34:17 UTC (rev 976) @@ -9,7 +9,7 @@ from distutils_oms import setup, find_modules setup(name='openmobilesuite-connection-obex', - version='0.9.91', + version='0.9.92', package_dir={'openmobilesuite.connection_obex': srcdir}, packages=find_modules('openmobilesuite.connection_obex', srcdir), scripts=[moddir + os.sep + 'openmobilesuite-connection-obex'], Modified: branches/work/series60-remote-dbus/pc/connection-oms/Makefile =================================================================== --- branches/work/series60-remote-dbus/pc/connection-oms/Makefile 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/connection-oms/Makefile 2012-03-23 17:34:17 UTC (rev 976) @@ -1,7 +1,7 @@ #!/bin/make -f MODULE=connection-oms -VERSION=0.9.91 +VERSION=0.9.92 PYTHON=`which python` Modified: branches/work/series60-remote-dbus/pc/connection-oms/debian/changelog =================================================================== --- branches/work/series60-remote-dbus/pc/connection-oms/debian/changelog 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/connection-oms/debian/changelog 2012-03-23 17:34:17 UTC (rev 976) @@ -1,3 +1,9 @@ +openmobilesuite-connection-oms (0.9.92-1ubuntu1) oneiric; urgency=low + + * New upstream version. + + -- Lukas Hetzenecker <luk...@gm...> Fri, 23 Mar 2012 18:05:38 +0000 + openmobilesuite-connection-oms (0.9.91-1ubuntu1-1) oneiric; urgency=low * New upstream version. Modified: branches/work/series60-remote-dbus/pc/connection-oms/setup.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-oms/setup.py 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/connection-oms/setup.py 2012-03-23 17:34:17 UTC (rev 976) @@ -9,7 +9,7 @@ from distutils_oms import setup, find_modules setup(name='openmobilesuite-connection-oms', - version='0.9.91', + version='0.9.92', package_dir={'openmobilesuite.connection_oms': srcdir}, packages=find_modules('openmobilesuite.connection_oms', srcdir), scripts=[moddir + os.sep + 'openmobilesuite-connection-oms'], Modified: branches/work/series60-remote-dbus/pc/connection-oms/src/plugin/StatusNumbers.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-oms/src/plugin/StatusNumbers.py 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/connection-oms/src/plugin/StatusNumbers.py 2012-03-23 17:34:17 UTC (rev 976) @@ -75,4 +75,4 @@ NUM_SEPERATOR = chr(0x1E) # Record Separator NUM_END_TEXT = chr(0x03) # End of Text -PROTOCOL_VERSION = 1.6 +PROTOCOL_VERSION = 1.7 Modified: branches/work/series60-remote-dbus/pc/gui/Makefile =================================================================== --- branches/work/series60-remote-dbus/pc/gui/Makefile 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/gui/Makefile 2012-03-23 17:34:17 UTC (rev 976) @@ -1,7 +1,7 @@ #!/bin/make -f MODULE=gui -VERSION=0.9.91 +VERSION=0.9.92 PYTHON=`which python` Modified: branches/work/series60-remote-dbus/pc/gui/debian/changelog =================================================================== --- branches/work/series60-remote-dbus/pc/gui/debian/changelog 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/gui/debian/changelog 2012-03-23 17:34:17 UTC (rev 976) @@ -1,3 +1,9 @@ +openmobilesuite-gui (0.9.92-1ubuntu1) oneiric; urgency=low + + * New upstream version. + + -- Lukas Hetzenecker <luk...@gm...> Fri, 23 Mar 2012 18:05:50 +0000 + openmobilesuite-gui (0.9.91-2ubuntu1) oneiric; urgency=low * Rebuild. Modified: branches/work/series60-remote-dbus/pc/gui/setup.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/setup.py 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/gui/setup.py 2012-03-23 17:34:17 UTC (rev 976) @@ -42,7 +42,7 @@ data[datadest].append(os.sep.join( (root, file) )) setup(name='openmobilesuite-gui', - version='0.9.91', + version='0.9.92', package_dir={'openmobilesuite.gui': srcdir}, packages=find_modules('openmobilesuite.gui', srcdir) + find_ui_packages("openmobilesuite.gui"), #dbus_files=['data/net.sourceforge.OpenMobileSuite.ConnectionManager.service.in'], Modified: branches/work/series60-remote-dbus/pc/gui/src/gui.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/gui.py 2012-03-21 18:22:15 UTC (rev 975) +++ branches/work/series60-remote-dbus/pc/gui/src/gui.py 2012-03-23 17:34:17 UTC (rev 976) @@ -43,7 +43,7 @@ from .element.device import Device from openmobilesuite.base.include.odict import odict -appVersion = (0, 9, 91) +appVersion = (0, 9, 92) settingsVersion = (0, 3) versionIsStable = bool(0) @@ -80,7 +80,7 @@ # for i in self.appVersion[:-1]: # self.appVersionStr += str(i) + "." # self.appVersionStr += str(self.appVersion[-1:][0]) - self.appVersionStr = "1.0 Technical Preview 2" + self.appVersionStr = "1.0 Technical Preview 3" self.settingsVersionStr = str() for i in self.settingsVersion[:-1]: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Luk...@us...> - 2012-03-21 18:22:21
|
Revision: 975 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=975&view=rev Author: LukasHetzi Date: 2012-03-21 18:22:15 +0000 (Wed, 21 Mar 2012) Log Message: ----------- Revert 'Fix obvious bug' Modified Paths: -------------- branches/work/series60-remote-dbus/pc/gui/src/widget/Popup.py Modified: branches/work/series60-remote-dbus/pc/gui/src/widget/Popup.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/widget/Popup.py 2012-03-21 18:18:23 UTC (rev 974) +++ branches/work/series60-remote-dbus/pc/gui/src/widget/Popup.py 2012-03-21 18:22:15 UTC (rev 975) @@ -361,9 +361,12 @@ self.close() def closeEvent(self, event): + try: + self.main.popups.remove(self) + except ValueError: + pass + if self.__close or not ANIMATION_SUPPORT or not self.settings.setting("popups/animate"): - self.main.popups.remove(self) - event.accept() self.repositionPopups(self.main.popups, self.target(), animate=self.settings.setting("popups/animate")) else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Luk...@us...> - 2012-03-21 18:18:33
|
Revision: 974 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=974&view=rev Author: LukasHetzi Date: 2012-03-21 18:18:23 +0000 (Wed, 21 Mar 2012) Log Message: ----------- BUGFIX: Clicking on unread message didn't open chat window Modified Paths: -------------- branches/work/series60-remote-dbus/pc/gui/src/window/systemtrayicon.py Modified: branches/work/series60-remote-dbus/pc/gui/src/window/systemtrayicon.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/window/systemtrayicon.py 2012-03-21 18:16:51 UTC (rev 973) +++ branches/work/series60-remote-dbus/pc/gui/src/window/systemtrayicon.py 2012-03-21 18:18:23 UTC (rev 974) @@ -109,7 +109,7 @@ unread_contacts[contact] = 1 if unread_contacts: - contacts_menu = QMenu(self.tr("&Unread messages"), self.parent) + contacts_menu = QMenu(self.tr("&Unread messages"), self.menu) contacts_menu.setIcon(QIcon(":/message-new")) if sys.platform == 'darwin': @@ -153,7 +153,7 @@ def contextMenuTriggered(self, action): type = action.property("type").toString() - + if type == "contact": connection = action.property("connection").toPyObject() contact = action.data().toPyObject() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Luk...@us...> - 2012-03-21 18:16:57
|
Revision: 973 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=973&view=rev Author: LukasHetzi Date: 2012-03-21 18:16:51 +0000 (Wed, 21 Mar 2012) Log Message: ----------- Opening a chat from the favorite list in the mainwindow works again Modified Paths: -------------- branches/work/series60-remote-dbus/pc/gui/src/window/mainwindow/mainwindow.py Modified: branches/work/series60-remote-dbus/pc/gui/src/window/mainwindow/mainwindow.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/window/mainwindow/mainwindow.py 2012-03-21 18:16:20 UTC (rev 972) +++ branches/work/series60-remote-dbus/pc/gui/src/window/mainwindow/mainwindow.py 2012-03-21 18:16:51 UTC (rev 973) @@ -243,13 +243,14 @@ type = action.property("type").toString() if type == "contact": + connection = action.property("connection").toPyObject() contact = action.data().toPyObject() - self.openChat(contact) + self.openChat(connection, contact) elif type == "configureFavorites": self.showFavoriteDialog() - def openChat(self, contact): - self.main.chatManager.openChat(contact) + def openChat(self, connection, contact): + self.main.chat_manager.openChat(connection, contact) @pyqtSignature("") def showFavoriteDialog(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Luk...@us...> - 2012-03-21 18:16:31
|
Revision: 972 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=972&view=rev Author: LukasHetzi Date: 2012-03-21 18:16:20 +0000 (Wed, 21 Mar 2012) Log Message: ----------- Bugfix Modified Paths: -------------- branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_listener/connection_listener.py Modified: branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_listener/connection_listener.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_listener/connection_listener.py 2012-03-19 01:25:00 UTC (rev 971) +++ branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_listener/connection_listener.py 2012-03-21 18:16:20 UTC (rev 972) @@ -86,7 +86,7 @@ id = self.database.contactIdByName(device.id, message.address) if id is None: contact = Contact(device_id=device.id, name=message.address) - contact.id = self.database.contactAdd() + contact.id = self.database.contactAdd(contact) self.contacts_service.ContactAdded(contact.serialize()) return id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 971 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=971&view=rev Author: LukasHetzi Date: 2012-03-19 01:25:00 +0000 (Mon, 19 Mar 2012) Log Message: ----------- Regression: Hide notification item when service stopped; Run service in foreground Modified Paths: -------------- branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ConnectionService.java Modified: branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ConnectionService.java =================================================================== --- branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ConnectionService.java 2012-03-19 01:23:32 UTC (rev 970) +++ branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ConnectionService.java 2012-03-19 01:25:00 UTC (rev 971) @@ -35,6 +35,8 @@ public static String ACTION_EXTRA_SERVICES = "services"; public static String ACTION_EXTRA_CLIENTS = "clients"; + private static int SERVICE_NOTIFICACTION_ID = 1; + private static Notification notification; private static final String TAG = "OpenMobileSuite|ConnectionService"; @@ -57,8 +59,8 @@ public void onClientConnected(Connection client) { mClients.add(client); - updateNotification(getBaseContext()); - updateClients(getApplicationContext()); + updateNotification(); + updateClients(); } }; @@ -70,16 +72,29 @@ mClients.remove(client); - updateNotification(getBaseContext()); - updateClients(getApplicationContext()); + updateNotification(); + updateClients(); } }; - private static void updateNotification(Context context) + private void updateNotification() { - Intent notificationIntent = new Intent(context, MainWindowActivity.class); - PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0); + //NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); + + if (!isRunning()) + { + //nm.cancel(TAG, SERVICE_NOTIFICACTION_ID); + + // Remove notification icon + this.stopForeground(true); + return; + } + Log.d(TAG, "Show notification"); + + Intent notificationIntent = new Intent(this, MainWindowActivity.class); + PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); + String msg; switch (clientCount()) { @@ -95,27 +110,26 @@ notification = new Notification(R.drawable.ic_stat_openmobilesuite, "Service started", System.currentTimeMillis()); notification.flags |= Notification.FLAG_ONGOING_EVENT | Notification.FLAG_NO_CLEAR | Notification.FLAG_FOREGROUND_SERVICE; - notification.setLatestEventInfo(context, "Open Mobile Suite", msg, contentIntent); + notification.setLatestEventInfo(this, "Open Mobile Suite", msg, contentIntent); notification.number = clientCount(); - NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - nm.notify(TAG, 1, notification); - //context.startForeground(1, notification); + //nm.notify(TAG, SERVICE_NOTIFICACTION_ID, notification); + this.startForeground(SERVICE_NOTIFICACTION_ID, notification); } - private static void updateClients(Context context) + private void updateClients() { Intent intent = new Intent(ACTION_UPDATE_CLIENTS); intent.putExtra(ACTION_EXTRA_CLIENTS, mClients); - context.sendBroadcast(intent); + this.sendBroadcast(intent); } - private static void updateService(Context context) + private void updateService() { Intent intent = new Intent(ACTION_UPDATE_STATUS); intent.putExtra(ACTION_EXTRA_RUNNING, mRunning); intent.putExtra(ACTION_EXTRA_SERVICES, mServices); - context.sendBroadcast(intent); + this.sendBroadcast(intent); } public static boolean isRunning() @@ -165,8 +179,8 @@ ConnectionService.mServices = defaultServices(); } - updateService(getApplicationContext()); - updateNotification(getApplicationContext()); + updateService(); + updateNotification(); for (Connection.ConnectionType type : mServices) { @@ -220,7 +234,8 @@ mRunning = false; - updateService(getApplicationContext()); + updateService(); + updateNotification(); for (BaseServerThread server : mServers) { @@ -231,6 +246,9 @@ tmpServer.interrupt(); } } + + mServers.clear(); + super.onDestroy(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 970 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=970&view=rev Author: LukasHetzi Date: 2012-03-19 01:23:32 +0000 (Mon, 19 Mar 2012) Log Message: ----------- do not show backtrace Modified Paths: -------------- branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/connection/StreamServerThread.java Modified: branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/connection/StreamServerThread.java =================================================================== --- branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/connection/StreamServerThread.java 2012-03-19 01:23:05 UTC (rev 969) +++ branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/connection/StreamServerThread.java 2012-03-19 01:23:32 UTC (rev 970) @@ -40,9 +40,7 @@ socket = accept(); } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - continue; + return; } if (mOnClientConnectedListener != null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 969 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=969&view=rev Author: LukasHetzi Date: 2012-03-19 01:23:05 +0000 (Mon, 19 Mar 2012) Log Message: ----------- debug-- Modified Paths: -------------- branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactManager.java Modified: branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactManager.java =================================================================== --- branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactManager.java 2012-03-14 09:33:15 UTC (rev 968) +++ branches/work/series60-remote-dbus/mobile/android/src/com/hetzenecker/openmobilesuite/service/ContactManager.java 2012-03-19 01:23:05 UTC (rev 969) @@ -141,7 +141,7 @@ String mimetype = details.getString(details.getColumnIndex(ContactsContract.Data.MIMETYPE)); if (!ContactFieldTypeConverter.mMimetypes.containsKey(mimetype)) { - Log.d(TAG, "Mimetype " + mimetype + " unknown!"); + //Log.d(TAG, "Mimetype " + mimetype + " unknown!"); continue; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Luk...@us...> - 2012-03-14 09:33:26
|
Revision: 968 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=968&view=rev Author: LukasHetzi Date: 2012-03-14 09:33:15 +0000 (Wed, 14 Mar 2012) Log Message: ----------- Fix obvious bug Modified Paths: -------------- branches/work/series60-remote-dbus/pc/gui/src/widget/Popup.py Modified: branches/work/series60-remote-dbus/pc/gui/src/widget/Popup.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/widget/Popup.py 2012-03-14 08:52:40 UTC (rev 967) +++ branches/work/series60-remote-dbus/pc/gui/src/widget/Popup.py 2012-03-14 09:33:15 UTC (rev 968) @@ -361,11 +361,9 @@ self.close() def closeEvent(self, event): - try: - self.main.popups.remove(self) - except ValueError: - pass if self.__close or not ANIMATION_SUPPORT or not self.settings.setting("popups/animate"): + self.main.popups.remove(self) + event.accept() self.repositionPopups(self.main.popups, self.target(), animate=self.settings.setting("popups/animate")) else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Luk...@us...> - 2012-03-14 08:52:49
|
Revision: 967 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=967&view=rev Author: LukasHetzi Date: 2012-03-14 08:52:40 +0000 (Wed, 14 Mar 2012) Log Message: ----------- Fix new contact is added, but no signal is emitted Modified Paths: -------------- branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_listener/connection_listener.py Modified: branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_listener/connection_listener.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_listener/connection_listener.py 2012-03-14 08:51:49 UTC (rev 966) +++ branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_listener/connection_listener.py 2012-03-14 08:52:40 UTC (rev 967) @@ -85,7 +85,9 @@ if id is None: id = self.database.contactIdByName(device.id, message.address) if id is None: - id = self.database.contactAdd(Contact(device_id=device.id, name=message.address)) + contact = Contact(device_id=device.id, name=message.address) + contact.id = self.database.contactAdd() + self.contacts_service.ContactAdded(contact.serialize()) return id def connectionsChanged(self, name, old_owner, new_owner): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Luk...@us...> - 2012-03-14 08:51:55
|
Revision: 966 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=966&view=rev Author: LukasHetzi Date: 2012-03-14 08:51:49 +0000 (Wed, 14 Mar 2012) Log Message: ----------- Fix problem with popup when systemtray-icon position is unknown (don't know why that happens though) - show popup always in the bottom right corner Modified Paths: -------------- branches/work/series60-remote-dbus/pc/gui/src/widget/Popup.py Modified: branches/work/series60-remote-dbus/pc/gui/src/widget/Popup.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/widget/Popup.py 2012-03-12 22:43:15 UTC (rev 965) +++ branches/work/series60-remote-dbus/pc/gui/src/widget/Popup.py 2012-03-14 08:51:49 UTC (rev 966) @@ -83,9 +83,6 @@ self.connect(self.__captionLabel, SIGNAL("clicked()"), self.forceClose) self.connect(self.__messageLabel, SIGNAL("clicked()"), self.forceClose) - def __str__(self): - return "\"Popup\"" - def setCaption(self, caption): self.__captionLabel.setText(caption) @@ -229,11 +226,7 @@ self.main.popups.append(self) - if self.target(): - self.moveNear(self.target(), animate=self.settings.setting("popups/animate")) - else: - target = QApplication.desktop().availableGeometry() - self.moveNear(target, bottomRight=True, animate=False) + self.moveNear(self.target(), animate=self.settings.setting("popups/animate")) def moveNear(self, target, bottomRight=False, animate=False): pos = self.calculateNearbyPoint(self, target, bottomRight) @@ -241,7 +234,7 @@ if animate and ANIMATION_SUPPORT: # If we animate the move we place the popup next to target # After setGeometry is called we get a resizeEvent and the popup is moved to its location - oldGeometry = QRect(pos.x(), target.y(), + oldGeometry = QRect(pos.x(), target.y() if target else pos.y(), self.sizeHint().width(), self.sizeHint().height()) self.setGeometry(oldGeometry) @@ -260,6 +253,10 @@ @staticmethod def calculateNearbyPoint(widget, target, bottomRight=False): + if not target: + target = QApplication.desktop().availableGeometry() + bottomRight = True + if bottomRight: pos = target.bottomRight() else: @@ -268,27 +265,27 @@ y = pos.y() w = widget.sizeHint().width() h = widget.height() - + r = QApplication.desktop().availableGeometry() - + if x < r.center().x(): x = x + target.width() else: x = x - w - + # It's apparently trying to go off screen, so display it ALL at the bottom. if (y + h) > r.bottom(): y = r.bottom() - h - + if (x + w) > r.right(): x = r.right() - w - + if y < r.top(): y = r.top() - + if x < r.left(): x = r.left() - + return QPoint(x, y) @staticmethod @@ -311,7 +308,7 @@ newPoint = Popup.calculateNearbyPoint(popup, newTarget) newGeometry = QRect(newPoint.x(), newPoint.y(), popup.sizeHint().width(), popup.height()) - + if animate and ANIMATION_SUPPORT: geometry = popup.geometry() if geometry.y() < 0: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <luk...@us...> - 2012-03-12 22:43:22
|
Revision: 965 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=965&view=rev Author: lukashetzi Date: 2012-03-12 22:43:15 +0000 (Mon, 12 Mar 2012) Log Message: ----------- [WIP] More favorite menu optimizations Modified Paths: -------------- branches/work/series60-remote-dbus/pc/gui/src/gui.py branches/work/series60-remote-dbus/pc/gui/src/lib/favorites.py branches/work/series60-remote-dbus/pc/gui/src/window/mainwindow/mainwindow.py branches/work/series60-remote-dbus/pc/gui/src/window/systemtrayicon.py Modified: branches/work/series60-remote-dbus/pc/gui/src/gui.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/gui.py 2012-03-12 19:04:06 UTC (rev 964) +++ branches/work/series60-remote-dbus/pc/gui/src/gui.py 2012-03-12 22:43:15 UTC (rev 965) @@ -25,6 +25,7 @@ #import plugin.Plugin from .lib.connection_adapter import ConnectionAdapter from .lib.chat_manager import ChatManager +from .lib.favorites import FavoriteMenu ##import lib.database from .lib.settings import Settings from .lib.helper import Helper @@ -277,9 +278,10 @@ #self.databaseConnect() # Show mainwindow, a trayicon and popups + self.favorite_menu = FavoriteMenu(None, self) self.main_window = MainWindow(None, self) - self.chat_manager = ChatManager(self.main_window, self) - self.trayicon = SystemTrayIcon(self.main_window, self) + self.chat_manager = ChatManager(self.main_window, self) + self.trayicon = SystemTrayIcon(self.main_window, self) self.popup = Popups(None, self) def reloadPlugin(self): Modified: branches/work/series60-remote-dbus/pc/gui/src/lib/favorites.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/lib/favorites.py 2012-03-12 19:04:06 UTC (rev 964) +++ branches/work/series60-remote-dbus/pc/gui/src/lib/favorites.py 2012-03-12 22:43:15 UTC (rev 965) @@ -2,35 +2,61 @@ # Copyright (c) 2008 - 2009 Lukas Hetzenecker <Lu...@gm...> -from PyQt4.QtCore import * -from PyQt4.QtGui import * +from PyQt4 import QtCore, QtGui -class FavoriteMenu(QObject): - def __init__(self, parent, main): - super(FavoriteMenu, self).__init__(parent) +class FavoriteMenu(QtCore.QObject): + def __init__(self, parent, main): + super(FavoriteMenu, self).__init__(parent) self.parent = parent self.main = main + self.connectionmanager_listener = main.connectionmanager_listener self.contacts_object = main.contacts_object #self.database = main.database self.settings = main.settings self.helper = main.helper - - def menu(self, menu): - submenu = self.settings.setting("contacts/displayFavoritesInSubmenu") + + self.favorites = [] + + self.connect(self.connectionmanager_listener, QtCore.SIGNAL("messageCountUpdated"), self.updateFavorites) + self.connect(self.connectionmanager_listener, QtCore.SIGNAL("connecting"), self.updateFavorites) + + def updateFavorites(self): + self.favorites = [] + num = self.settings.setting("contacts/displayFavoritesNum") days = self.settings.setting("contacts/displayFavoritesDays") favCount = self.settings.setting("contacts/displayFavoritesCount") + for connection in self.main.active_connections.itervalues(): + if num == 1: + dynamic_favorites = None + elif num == 2: + dynamic_favorites = self.contacts_object.ContactFavorites(connection.device.id, favCount) + else: + dynamic_favorites = self.contacts_object.ContactFavorites(connection.device.id, favCount, days) + + #favField = self.database.contactFavoritesField() + + dynamic_favorites = [ (connection.device.contacts[id], 0) for id in dynamic_favorites ] + + # TODO static_favorites + self.favorites.append( (connection, dynamic_favorites, []) ) + + self.emit(QtCore.SIGNAL("favoritesUpdated")) + + def menu(self, menu): + submenu = self.settings.setting("contacts/displayFavoritesInSubmenu") + if submenu: - favorites_menu = QMenu(self.tr("&Favorites"), self.parent) - favorites_menu.setIcon(QIcon(":/im-user")) + favorites_menu = QtGui.QMenu(self.tr("&Favorites"), menu) + favorites_menu.setIcon(QtGui.QIcon(":/im-user")) menu.addMenu(favorites_menu) else: lbl = menu.addAction(self.tr("Favorites")) - lbl.setIcon(QIcon(":/im-user")) + lbl.setIcon(QtGui.QIcon(":/im-user")) lbl.setEnabled(False) favorites_menu = menu @@ -39,24 +65,14 @@ lbl.setEnabled(False) else: i = 0 - for connection in self.main.active_connections.itervalues(): - if num == 1: - dynamic_favorites = None - elif num == 2: - dynamic_favorites = self.contacts_object.ContactFavorites(connection.device.id, favCount) - else: - dynamic_favorites = self.contacts_object.ContactFavorites(connection.device.id, favCount, days) - - #favField = self.database.contactFavoritesField() - + for connection, dynamic_favorites, static_favorites in self.favorites: if dynamic_favorites: c = connection.device.connection + lbl = favorites_menu.addAction(c.address()) lbl.setIcon(c.icon()) lbl.setEnabled(False) - dynamic_favorites = [ (connection.device.contacts[id], 0) for id in dynamic_favorites ] - i = self.helper.addContactsToMenu(dynamic_favorites, favorites_menu, connection) # if dynamic_favorites and favField: # favorites_menu.addSeparator() @@ -68,7 +84,7 @@ lbl.setEnabled(False) conf = favorites_menu.addAction(self.tr("&Manage Favorites")) - conf.setIcon(QIcon(":/configure")) - conf.setProperty("type", QVariant("configureFavorites")) + conf.setIcon(QtGui.QIcon(":/configure")) + conf.setProperty("type", QtCore.QVariant("configureFavorites")) if not submenu: favorites_menu.addSeparator() Modified: branches/work/series60-remote-dbus/pc/gui/src/window/mainwindow/mainwindow.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/window/mainwindow/mainwindow.py 2012-03-12 19:04:06 UTC (rev 964) +++ branches/work/series60-remote-dbus/pc/gui/src/window/mainwindow/mainwindow.py 2012-03-12 22:43:15 UTC (rev 965) @@ -5,7 +5,6 @@ import distutils.version from PyQt4.QtCore import * from PyQt4.QtGui import * -from ...lib.favorites import FavoriteMenu from ...lib.update_checker import UpdateChecker from ..settings import SettingsDialog from ..message_queue import MessageQueue @@ -38,6 +37,7 @@ #self.database = main.database self.settings = main.settings #self.helper = main.helper + self.favorite_menu = main.favorite_menu self.initialMessageSyncComplete = False @@ -110,7 +110,9 @@ self.connect(self.connectionmanager_listener, SIGNAL("messageUpdateFinished"), self.messageUpdateFinished) self.connect(self.connectionmanager_listener, SIGNAL("connectionStateChanged"), self.updateConnection) self.connect(self.connectionmanager_listener, SIGNAL("connectionDeleted"), self.updateConnection) - + + self.connect(self.favorite_menu, SIGNAL("favoritesUpdated"), self.showFavorites) + self.show() def createMenu(self): @@ -132,7 +134,7 @@ self.messagesMenu.addSeparator() self.messagesMenu.addAction(QIcon(":/document-import"), self.tr("&Import messages..."), self, SLOT("showImportMessagesDialog()")) - self.favoritesMenu = FavoriteMenu(self.contactsMenu, self.main) + self.showFavorites() self.helpMenu.addAction(QIcon(":/phone"), self.tr("&About Open Mobile Suite"), self, SLOT("showAboutDialog()")) self.helpMenu.addAction(self.tr("About &Qt"), self.main.app, SLOT("aboutQt()")) @@ -235,7 +237,7 @@ def showFavorites(self): self.contactsMenu.clear() - self.favoritesMenu.menu(self.contactsMenu) + self.favorite_menu.menu(self.contactsMenu) def favoriteClicked(self, action): type = action.property("type").toString() Modified: branches/work/series60-remote-dbus/pc/gui/src/window/systemtrayicon.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/window/systemtrayicon.py 2012-03-12 19:04:06 UTC (rev 964) +++ branches/work/series60-remote-dbus/pc/gui/src/window/systemtrayicon.py 2012-03-12 22:43:15 UTC (rev 965) @@ -8,7 +8,6 @@ from PyQt4.QtGui import * from ..widget.Popup import Popup, PopupType from ..window.favorites import Favorites -from ..lib.favorites import FavoriteMenu class SystemTrayIcon(QSystemTrayIcon): def __init__(self, parent, main): @@ -22,9 +21,12 @@ #self.database = main.database self.settings = main.settings self.helper = main.helper + self.favorite_menu = main.favorite_menu + self.connectionmanager_listener = main.connectionmanager_listener + self.menu = QMenu(self.parent) - self.favMenu = FavoriteMenu(self.menu, main) + self.dblClickTimer = QTimer() self.dblClickTimer.setSingleShot(True) self.ignoreNextRelease = False @@ -32,15 +34,15 @@ self.updateMenu() self.setContextMenu(self.menu) - self.connect(self, SIGNAL("activated(QSystemTrayIcon::ActivationReason)"), self.clicked) + self.connect(self, SIGNAL("activated(QSystemTrayIcon::ActivationReason)"), self.clicked) # # # Update favorite list # self.connect(main, SIGNAL("favoriteListChanged"), self.addMenu) # # # Update unread message list - self.connect(main.connectionmanager_listener, SIGNAL("messageCountUpdated"), self.updateMenu) - self.connect(main.connectionmanager_listener, SIGNAL("unreadMessagesUpdated"), self.updateMenu) - self.connect(main.connectionmanager_listener, SIGNAL("connecting"), self.updateMenu) + self.connect(self.connectionmanager_listener, SIGNAL("unreadMessagesUpdated"), self.updateMenu) + self.connect(self.favorite_menu, SIGNAL("favoritesUpdated"), self.updateMenu) + # self.connect(main.connectionmanager_listener, SIGNAL("messageNew"), self.newMessage) # self.connect(main, SIGNAL("ignoreListChanged"), self.addMenu) # self.connect(main, SIGNAL("messageUnread"), self.newMessage) @@ -89,7 +91,7 @@ def updateMenu(self): self.menu.clear() - self.favMenu.menu(self.menu) + self.favorite_menu.menu(self.menu) if not self.settings.setting("contacts/ignoreAll"): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <luk...@us...> - 2012-03-12 19:04:13
|
Revision: 964 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=964&view=rev Author: lukashetzi Date: 2012-03-12 19:04:06 +0000 (Mon, 12 Mar 2012) Log Message: ----------- [WIP] Porting favorites Modified Paths: -------------- branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/contacts_object.py branches/work/series60-remote-dbus/pc/connection-manager/src/lib/database.py branches/work/series60-remote-dbus/pc/gui/src/dbus_listener/connectionmanager_listener.py branches/work/series60-remote-dbus/pc/gui/src/lib/favorites.py branches/work/series60-remote-dbus/pc/gui/src/lib/helper.py branches/work/series60-remote-dbus/pc/gui/src/pics/oxygen-icon-list branches/work/series60-remote-dbus/pc/gui/src/ui/src/resource.qrc branches/work/series60-remote-dbus/pc/gui/src/widget/ChatWidget.py branches/work/series60-remote-dbus/pc/gui/src/window/systemtrayicon.py Added Paths: ----------- branches/work/series60-remote-dbus/pc/gui/src/pics/oxygen/im-user.png branches/work/series60-remote-dbus/pc/gui/src/pics/oxygen/scalable/actions/im-user.svgz Modified: branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/contacts_object.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/contacts_object.py 2012-03-12 15:24:28 UTC (rev 963) +++ branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/contacts_object.py 2012-03-12 19:04:06 UTC (rev 964) @@ -45,7 +45,14 @@ for c in self.database.contacts(device_id = device_id, on_phone = only_contacts_from_phone, only_message_count = True): ret.append(c) return ret - + + @dbus.service.method("net.sourceforge.OpenMobileSuite.ConnectionManager", in_signature='iii', out_signature='ai') + def ContactFavorites(self, device_id, num_entries = 5, days = None): + ret = [] + for contact_id in self.database.contactFavoritesGenerator(device_id, num_entries, days): + ret.append(contact_id) + return ret + @dbus.service.method("net.sourceforge.OpenMobileSuite.ConnectionManager", in_signature='b', out_signature=_Contact.dbus_signature) def Contact(self, contact_id): self.main.openDatabaseRaiseErrorOnFailure() Modified: branches/work/series60-remote-dbus/pc/connection-manager/src/lib/database.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/src/lib/database.py 2012-03-12 15:24:28 UTC (rev 963) +++ branches/work/series60-remote-dbus/pc/connection-manager/src/lib/database.py 2012-03-12 19:04:06 UTC (rev 964) @@ -740,27 +740,36 @@ yield contact - def contactFavoritesGenerator(self, count=5, days=None): + def contactFavoritesGenerator(self, device_id = None, num_entries=5, days=None): contact, messages = range(2) - where = "" - if days: - # MySQL syntax - if self.__type == "mysql": - where = "AND DATE_SUB(CURDATE(),INTERVAL " + str(days) + " DAY) <= 'time'" - # SQLite syntax - elif self.__type == "sqlite": - where = "AND date('now','-" + str(days) + " days') <= time" + join = "" + device_where = "" + days_where = "" + + if device_id is not None: + join = "JOIN contacts c ON m.contact_id=c.contact_id " + device_where = "AND device_id='" + str(device_id) + "' " + + if days is not None: + time = QtCore.QDateTime(QtCore.QDate.currentDate().addDays(-days)).toTime_t() * 1000 + days_where = "AND time >='" + str(time) + "' " +# # MySQL syntax +# if self.__type == "mysql": +# days_where = "AND DATE_SUB(CURDATE(),INTERVAL " + str(days) + " DAY) <= 'time' " +# # SQLite syntax +# elif self.__type == "sqlite": +# days_where = "AND date('now','-" + str(days) + " days') <= time " - query = self.__queryReturn("SELECT contact_id, COUNT(*) count FROM messages " - "GROUP BY contact_id " - "HAVING contact_id NOT IN (SELECT contact_id FROM contacts WHERE contact_id_on_phone IS NULL) " - "AND contact_id NOT IN (SELECT contact_id FROM contacts WHERE favorite=1) " - + where + - "ORDER BY count DESC LIMIT 0," + str(count)) + query = self.__queryReturn("SELECT m.contact_id, COUNT(*) count FROM messages m " + join + + "GROUP BY m.contact_id " + "HAVING m.contact_id NOT IN (SELECT contact_id FROM contacts WHERE contact_id_on_phone IS NULL) " + "AND m.contact_id NOT IN (SELECT contact_id FROM contacts WHERE favorite=1) " + + days_where + device_where + + "ORDER BY count DESC LIMIT 0," + str(num_entries)) while query and query.next(): id = int(query.value(contact).toInt()[0]) - yield self.contacts(contact_id=id).next() + yield id def contactFavoritesField(self): query = self.__queryReturn("SELECT contact_id FROM contacts " Modified: branches/work/series60-remote-dbus/pc/gui/src/dbus_listener/connectionmanager_listener.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/dbus_listener/connectionmanager_listener.py 2012-03-12 15:24:28 UTC (rev 963) +++ branches/work/series60-remote-dbus/pc/gui/src/dbus_listener/connectionmanager_listener.py 2012-03-12 19:04:06 UTC (rev 964) @@ -34,6 +34,8 @@ self.connection_manager_object.connect_to_signal("MessageStateAdded", self.messageStateAdded) self.connection_manager_object.connect_to_signal("MessageReceived", self.messageReceived) + self.connection_manager_object.connect_to_signal("SetMessageReadRequested", self.messageReadRequested) + self.connection_manager_object.connect_to_signal("ConnectionVersionMismatchError", self.connectionVersionMismatchError) self.connection_manager_object.connect_to_signal("ConnectionFailed", self.connectionFailed) self.connection_manager_object.connect_to_signal("ConnectionClosed", self.connectionClosed) @@ -64,6 +66,8 @@ def connecting(self, connection_id): self.main.active_connections[connection_id].state = ConnectionState.Connecting self.emit(QtCore.SIGNAL("connectionStateChanged"), self.main.active_connections[connection_id]) + + self.emit(QtCore.SIGNAL("connecting"), connection_id) def connected(self, connection_id): self.main.active_connections[connection_id].state = ConnectionState.Connected @@ -153,7 +157,7 @@ connection.unread_messages = messages connection.connecting = False - self.emit(QtCore.SIGNAL("unreadMessagesFetched")) + self.emit(QtCore.SIGNAL("unreadMessagesUpdated"), connection_id) def messageSending(self, connection_id, message): message = Message.deserialize(message) @@ -204,11 +208,22 @@ connection = self.main.active_connections[connection_id] connection.unread_messages.append(message) self.main.popup.newMessage(message) + self.main.trayicon.updateMenu() # Fetch new messages... # We wait for 2 secs, because we want to give the phone some time to save the message in the database QtCore.QTimer.singleShot(2000, lambda : self.connection_manager_object.RequestMessageUpdate(connection_id)) + def messageReadRequested(self, connection_id, message_id): + connection = self.main.active_connections[connection_id] + + for message in connection.unread_messages[:]: + if message.id == message_id: + connection.unread_messages.remove(message) + break + + self.emit(QtCore.SIGNAL("unreadMessagesUpdated"), connection_id) + def connectionVersionMismatchError(self, connection_id, mobile_version, pc_version): connection = self.main.active_connections[connection_id] self.emit(QtCore.SIGNAL("connectionVersionMismatchError"), connection, mobile_version, pc_version) Modified: branches/work/series60-remote-dbus/pc/gui/src/lib/favorites.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/lib/favorites.py 2012-03-12 15:24:28 UTC (rev 963) +++ branches/work/series60-remote-dbus/pc/gui/src/lib/favorites.py 2012-03-12 19:04:06 UTC (rev 964) @@ -11,47 +11,64 @@ self.parent = parent self.main = main + + self.contacts_object = main.contacts_object #self.database = main.database self.settings = main.settings - #self.helper = main.helper + self.helper = main.helper - def menu(self, menu): - # TODO! - return QMenu() - + def menu(self, menu): submenu = self.settings.setting("contacts/displayFavoritesInSubmenu") num = self.settings.setting("contacts/displayFavoritesNum") days = self.settings.setting("contacts/displayFavoritesDays") favCount = self.settings.setting("contacts/displayFavoritesCount") - if num == 1: - favGen = None - elif num == 2: - favGen = self.database.contactFavoritesGenerator(favCount) - else: - favGen = self.database.contactFavoritesGenerator(favCount, days) - - favField = self.database.contactFavoritesField() - if submenu: - useMenu = QMenu(self.tr("&Favorites"), self.parent) - menu .addMenu(useMenu) + favorites_menu = QMenu(self.tr("&Favorites"), self.parent) + favorites_menu.setIcon(QIcon(":/im-user")) + menu.addMenu(favorites_menu) else: lbl = menu.addAction(self.tr("Favorites")) + lbl.setIcon(QIcon(":/im-user")) lbl.setEnabled(False) - useMenu = menu + favorites_menu = menu - i = 0 - if favGen: - i = self.helper.addContactsToMenu(favGen, useMenu) - if favGen and favField: - useMenu.addSeparator() - if favField: - self.helper.addContactsToMenu(favField, useMenu, i) - - conf = useMenu.addAction(self.tr("&Manage Favorites")) + if not self.main.active_connections: + lbl = favorites_menu.addAction(self.tr("No active connection")) + lbl.setEnabled(False) + else: + i = 0 + for connection in self.main.active_connections.itervalues(): + if num == 1: + dynamic_favorites = None + elif num == 2: + dynamic_favorites = self.contacts_object.ContactFavorites(connection.device.id, favCount) + else: + dynamic_favorites = self.contacts_object.ContactFavorites(connection.device.id, favCount, days) + + #favField = self.database.contactFavoritesField() + + if dynamic_favorites: + c = connection.device.connection + lbl = favorites_menu.addAction(c.address()) + lbl.setIcon(c.icon()) + lbl.setEnabled(False) + + dynamic_favorites = [ (connection.device.contacts[id], 0) for id in dynamic_favorites ] + + i = self.helper.addContactsToMenu(dynamic_favorites, favorites_menu, connection) + # if dynamic_favorites and favField: + # favorites_menu.addSeparator() + # if favField: + # self.helper.addContactsToMenu(favField, favorites_menu, i) + + if i == 0: + lbl = favorites_menu.addAction(self.tr("No favorites")) + lbl.setEnabled(False) + + conf = favorites_menu.addAction(self.tr("&Manage Favorites")) conf.setIcon(QIcon(":/configure")) conf.setProperty("type", QVariant("configureFavorites")) - if not self.settings.setting("contacts/displayFavoritesInSubmenu"): - useMenu.addSeparator() + if not submenu: + favorites_menu.addSeparator() Modified: branches/work/series60-remote-dbus/pc/gui/src/lib/helper.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/lib/helper.py 2012-03-12 15:24:28 UTC (rev 963) +++ branches/work/series60-remote-dbus/pc/gui/src/lib/helper.py 2012-03-12 19:04:06 UTC (rev 964) @@ -81,7 +81,7 @@ def addContactsToMenu(self, contacts, menu, connection, start=0): i = 0 - for contact, count in contacts.iteritems(): + for contact, count in contacts: messages = " (" + str(count) + ")" if count > 1 else "" if i + 1 + start < 10: action = QAction("&%d: %s%s" % (i + 1 + start, contact.visibleString(), messages), menu) Added: branches/work/series60-remote-dbus/pc/gui/src/pics/oxygen/im-user.png =================================================================== (Binary files differ) Property changes on: branches/work/series60-remote-dbus/pc/gui/src/pics/oxygen/im-user.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/work/series60-remote-dbus/pc/gui/src/pics/oxygen/scalable/actions/im-user.svgz =================================================================== (Binary files differ) Property changes on: branches/work/series60-remote-dbus/pc/gui/src/pics/oxygen/scalable/actions/im-user.svgz ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: branches/work/series60-remote-dbus/pc/gui/src/pics/oxygen-icon-list =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/pics/oxygen-icon-list 2012-03-12 15:24:28 UTC (rev 963) +++ branches/work/series60-remote-dbus/pc/gui/src/pics/oxygen-icon-list 2012-03-12 19:04:06 UTC (rev 964) @@ -24,6 +24,7 @@ actions/go-previous actions/go-up actions/im-ban-kick-user list-ignore-user +actions/im-user actions/journal-new actions/list-add actions/list-add-user Modified: branches/work/series60-remote-dbus/pc/gui/src/ui/src/resource.qrc =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/ui/src/resource.qrc 2012-03-12 15:24:28 UTC (rev 963) +++ branches/work/series60-remote-dbus/pc/gui/src/ui/src/resource.qrc 2012-03-12 19:04:06 UTC (rev 964) @@ -17,6 +17,7 @@ <file>../../lang/qt_es.qm</file> </qresource> <qresource> + <file alias="im-user">../../pics/oxygen/im-user.png</file> <file alias="zoom-in-16">../../pics/oxygen/zoom-in-16.png</file> <file alias="document-open-folder">../../pics/oxygen/document-open-folder.png</file> <file alias="connection-bluetooth">../../pics/oxygen/connection-bluetooth.png</file> Modified: branches/work/series60-remote-dbus/pc/gui/src/widget/ChatWidget.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/widget/ChatWidget.py 2012-03-12 15:24:28 UTC (rev 963) +++ branches/work/series60-remote-dbus/pc/gui/src/widget/ChatWidget.py 2012-03-12 19:04:06 UTC (rev 964) @@ -175,7 +175,7 @@ def showMessage(self, msg): if msg in self.connection.unread_messages: msg.priority = MessagePriority.Medium - self.connection.unread_messages.remove(msg) + #self.connection.unread_messages.remove(msg) print "SET READ", msg.serialize() self.connection_manager_object.SetMessageRead(self.connection.id, msg.id) Modified: branches/work/series60-remote-dbus/pc/gui/src/window/systemtrayicon.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/window/systemtrayicon.py 2012-03-12 15:24:28 UTC (rev 963) +++ branches/work/series60-remote-dbus/pc/gui/src/window/systemtrayicon.py 2012-03-12 19:04:06 UTC (rev 964) @@ -24,7 +24,7 @@ self.helper = main.helper self.menu = QMenu(self.parent) -# self.favMenu = FavoriteMenu(self.menu, main) + self.favMenu = FavoriteMenu(self.menu, main) self.dblClickTimer = QTimer() self.dblClickTimer.setSingleShot(True) self.ignoreNextRelease = False @@ -38,13 +38,15 @@ # self.connect(main, SIGNAL("favoriteListChanged"), self.addMenu) # # # Update unread message list - self.connect(main.connectionmanager_listener, SIGNAL("unreadMessagesFetched"), self.updateMenu) -# self.connect(main, SIGNAL("messageNew"), self.newMessage) + self.connect(main.connectionmanager_listener, SIGNAL("messageCountUpdated"), self.updateMenu) + self.connect(main.connectionmanager_listener, SIGNAL("unreadMessagesUpdated"), self.updateMenu) + self.connect(main.connectionmanager_listener, SIGNAL("connecting"), self.updateMenu) +# self.connect(main.connectionmanager_listener, SIGNAL("messageNew"), self.newMessage) # self.connect(main, SIGNAL("ignoreListChanged"), self.addMenu) # self.connect(main, SIGNAL("messageUnread"), self.newMessage) # self.connect(main, SIGNAL("chatOpened"), self.addMenu) # self.connect(self.connection, SIGNAL("messageRead"), self.addMenu) -# + self.connect(self.dblClickTimer, SIGNAL("timeout()"), self.emitClicked) self.connect(self.menu, SIGNAL("triggered(QAction *)"), self.contextMenuTriggered) @@ -53,14 +55,14 @@ self.show() - def newMessage(self, message): - #print message.contact(), "has open chat", self.main.chatManager.hasOpenChat(message.contact()) - if self.main.chatManager.hasOpenChat(message.contact()): - return - - #print "adding menu" - self.updateMenu() - +# def newMessage(self, message): +# #print message.contact(), "has open chat", self.main.chatManager.hasOpenChat(message.contact()) +# if self.main.chatManager.hasOpenChat(message.contact()): +# return +# +# #print "adding menu" +# self.updateMenu() +# def clicked(self, reason): if sys.platform == 'darwin': # A (left-mouse) click on Mac OS X opens the context menu, so only show the menu @@ -87,7 +89,7 @@ def updateMenu(self): self.menu.clear() - #self.favMenu.menu(self.menu) + self.favMenu.menu(self.menu) if not self.settings.setting("contacts/ignoreAll"): @@ -111,13 +113,12 @@ if sys.platform == 'darwin': self.connect(contacts_menu, SIGNAL("triggered(QAction *)"), self.contextMenuTriggered) - self.helper.addContactsToMenu(unread_contacts, contacts_menu, connection) + self.helper.addContactsToMenu(unread_contacts.items(), contacts_menu, connection) self.setIcon(QIcon(":/message-new")) else: self.setIcon(QIcon(":/phone")) else: self.setIcon(QIcon(":/phone")) - mainWindowAction = QAction(self) mainWindowAction.setProperty("type", QVariant("mainWindow")) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <luk...@us...> - 2012-03-12 15:24:40
|
Revision: 963 http://series60-remote.svn.sourceforge.net/series60-remote/?rev=963&view=rev Author: lukashetzi Date: 2012-03-12 15:24:28 +0000 (Mon, 12 Mar 2012) Log Message: ----------- handle message count updates; bugfixes Modified Paths: -------------- branches/work/series60-remote-dbus/pc/base/src/element/contact.py branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/contacts_object.py branches/work/series60-remote-dbus/pc/connection-manager/src/lib/database.py branches/work/series60-remote-dbus/pc/gui/src/dbus_listener/connectionmanager_listener.py branches/work/series60-remote-dbus/pc/gui/src/lib/proxy/contact.py branches/work/series60-remote-dbus/pc/gui/src/widget/Device/ContactTreeView.py branches/work/series60-remote-dbus/pc/gui/src/window/mainwindow/messages.py Modified: branches/work/series60-remote-dbus/pc/base/src/element/contact.py =================================================================== --- branches/work/series60-remote-dbus/pc/base/src/element/contact.py 2012-03-12 02:30:29 UTC (rev 962) +++ branches/work/series60-remote-dbus/pc/base/src/element/contact.py 2012-03-12 15:24:28 UTC (rev 963) @@ -15,12 +15,12 @@ "name" : basestring, "ignored" : bool, "favorite" : bool, - "has_messages" : bool, + "message_count" : int, "values" : [ ContactFieldValue ], "internal_values" : { str : basestring }, } - def __init__(self, id = 0, device_id = 0, id_on_phone = 0, name = "", ignored = False, favorite = False, has_messages = False): + def __init__(self, id = 0, device_id = 0, id_on_phone = 0, name = "", ignored = False, favorite = False, message_count = 0): super(Contact, self).__init__() self.id = id @@ -29,7 +29,7 @@ self.name = name self.ignored = ignored self.favorite = favorite - self.has_messages = has_messages + self.message_count = message_count def __contains__(self, field): return self.contains(field) @@ -139,3 +139,6 @@ def picture(self): return self.value("thumbnail_image")[0] + + def hasMessages(self): + return self.message_count > 0 Modified: branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/contacts_object.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/contacts_object.py 2012-03-12 02:30:29 UTC (rev 962) +++ branches/work/series60-remote-dbus/pc/connection-manager/src/dbus_service/contacts_object.py 2012-03-12 15:24:28 UTC (rev 963) @@ -39,6 +39,13 @@ dbus_ok() + @dbus.service.method("net.sourceforge.OpenMobileSuite.ConnectionManager", in_signature='ib', out_signature='a(ib)') + def ContactMessageCount(self, device_id, only_contacts_from_phone = False): + ret = [] + for c in self.database.contacts(device_id = device_id, on_phone = only_contacts_from_phone, only_message_count = True): + ret.append(c) + return ret + @dbus.service.method("net.sourceforge.OpenMobileSuite.ConnectionManager", in_signature='b', out_signature=_Contact.dbus_signature) def Contact(self, contact_id): self.main.openDatabaseRaiseErrorOnFailure() Modified: branches/work/series60-remote-dbus/pc/connection-manager/src/lib/database.py =================================================================== --- branches/work/series60-remote-dbus/pc/connection-manager/src/lib/database.py 2012-03-12 02:30:29 UTC (rev 962) +++ branches/work/series60-remote-dbus/pc/connection-manager/src/lib/database.py 2012-03-12 15:24:28 UTC (rev 963) @@ -543,7 +543,8 @@ if name.count(';') > 1: name1, name2 = name.split(';', 1) - query = self.__queryReturn("SELECT contact_id FROM contact_details cdo " + query = self.__queryReturn("SELECT cdo.contact_id FROM contact_details cdo " + "JOIN contacts c on cdo.contact_id=c.contact_id " "WHERE '" + name1 + "'=(SELECT value FROM contact_details cdi WHERE cdi.contact_id=cdo.contact_id AND type='first_name') " "AND '" + name2 + "'=(SELECT value FROM contact_details cdi WHERE cdi.contact_id=cdo.contact_id AND type='last_name') " "AND type='first_name' " @@ -552,7 +553,8 @@ if query.last(): return query.value(0).toInt()[0] - query = self.__queryReturn("SELECT contact_id FROM contact_details cdo " + query = self.__queryReturn("SELECT cdo.contact_id FROM contact_details cdo " + "JOIN contacts c on cdo.contact_id=c.contact_id " "WHERE '" + name2 + "'=(SELECT value FROM contact_details cdi WHERE cdi.contact_id=cdo.contact_id AND type='first_name') " "AND '" + name1 + "'=(SELECT value FROM contact_details cdi WHERE cdi.contact_id=cdo.contact_id AND type='last_name') " "AND type='first_name' " @@ -563,7 +565,8 @@ if name.count(' ') > 1: name1, name2 = name.split(' ', 1) - query = self.__queryReturn("SELECT contact_id FROM contact_details cdo " + query = self.__queryReturn("SELECT cdo.contact_id FROM contact_details cdo " + "JOIN contacts c on cdo.contact_id=c.contact_id " "WHERE '" + name1 + "'=(SELECT value FROM contact_details cdi WHERE cdi.contact_id=cdo.contact_id AND type='first_name') " "AND '" + name2 + "'=(SELECT value FROM contact_details cdi WHERE cdi.contact_id=cdo.contact_id AND type='last_name') " "AND type='first_name' " @@ -572,7 +575,8 @@ if query.last(): return query.value(0).toInt()[0] - query = self.__queryReturn("SELECT contact_id FROM contact_details cdo " + query = self.__queryReturn("SELECT cdo.contact_id FROM contact_details cdo " + "JOIN contacts c on cdo.contact_id=c.contact_id " "WHERE '" + name2 + "'=(SELECT value FROM contact_details cdi WHERE cdi.contact_id=cdo.contact_id AND type='first_name') " "AND '" + name1 + "'=(SELECT value FROM contact_details cdi WHERE cdi.contact_id=cdo.contact_id AND type='last_name') " "AND type='first_name' " @@ -583,19 +587,19 @@ return None - def contactByName(self, device_id, name): - id = self.contactIdByName(device_id, name) - if id: - return self.contacts(device_id = device_id, contact_id=id).next() - else: - return Contact(name=name) +# def contactByName(self, device_id, name): +# id = self.contactIdByName(device_id, name) +# if id: +# return self.contacts(device_id = device_id, contact_id=id).next() +# else: +# return Contact(name=name) - def contactByContactIdOnPhone(self, device_id, contact_id_on_phone): - id = self.contactIdFromIdOnPhone(device_id, contact_id_on_phone) - if id: - return self.contacts(device_id = device_id, contact_id=id).next() - else: - return None +# def contactByContactIdOnPhone(self, device_id, contact_id_on_phone): +# id = self.contactIdFromIdOnPhone(device_id, contact_id_on_phone) +# if id: +# return self.contacts(device_id = device_id, contact_id=id).next() +# else: +# return None def contactIdByPhone(self, device_id, phone): query = self.__queryReturn("SELECT c.contact_id FROM contact_details cd " @@ -622,7 +626,7 @@ def contactChange(self, contact): id = self.contactIdFromIdOnPhone(contact.device_id, contact.id_on_phone) - dbContact = self.contacts(device_id=contact.device_id, contact_id=id).next() + dbContact = self.contacts(device_id=contact.device_id, contact_id=id, ignore_message_count = True).next() #print "query", "UPDATE contacts SET name='" + contact.name.replace("'", "\\'") + "' WHERE contact_id='" + str(id) + "'" query = QtSql.QSqlQuery() @@ -660,18 +664,19 @@ return id, old, new - def contacts(self, device_id = None, contact_id=None, on_phone=False, ignore_message_count = False): - ID, DEVICE, IDONPHONE, NAME, IGNORE, FAVORITE = range(6) + def contacts(self, device_id = None, contact_id=None, on_phone=False, ignore_message_count = False, only_message_count = False): + if only_message_count: + # These two options conflict with each other.. + ignore_message_count = False + extra_columns = "" + group = "" + group_by = "" if not ignore_message_count: - MESSAGE_COUNT = 6 - extra_columns = ", COUNT(message_id)" - group = "JOIN messages m ON c.contact_id = m.contact_id " - group_by = " GROUP BY m.contact_id" - else: - extra_columns = "" - group = "" - group_by = "" + extra_columns = "COUNT(message_id)" + # LEFT OUTER JOIN, beacuse also the contacts without messages should be returned + group = "LEFT OUTER JOIN messages m ON c.contact_id = m.contact_id " + group_by = " GROUP BY c.contact_id" conditions = [] if device_id is not None: @@ -679,18 +684,33 @@ if on_phone: conditions.append("contact_id_on_phone!=''") if contact_id: - conditions.append("contact_id='" + str(contact_id) + "'") + conditions.append("c.contact_id='" + str(contact_id) + "'") - query = "SELECT c.contact_id, device_id, contact_id_on_phone, name, ignore, favorite" + extra_columns + \ - " FROM contacts c " + group + if only_message_count: + # The columns are contact_id and COUNT(message_id) + ID, MESSAGE_COUNT = range(2) + columns = "c.contact_id, " + extra_columns + else: + ID, DEVICE, IDONPHONE, NAME, IGNORE, FAVORITE = range(6) + columns = "c.contact_id, device_id, contact_id_on_phone, name, ignore, favorite" + if extra_columns: + MESSAGE_COUNT = 6 + columns += ", " + extra_columns + query = "SELECT " + columns + " FROM contacts c " + group + query += self.__makeWhere(conditions) query += group_by - query += " ORDER BY NAME" + if not ignore_message_count: + query += " ORDER BY NAME" query = self.__queryReturn(query) while query and query.next(): + if only_message_count: + yield ( int(query.value(ID).toInt()[0]), int(query.value(MESSAGE_COUNT).toInt()[0]) ) + continue + contact = Contact() contact.id = int(query.value(ID).toInt()[0]) contact.device_id = int(query.value(DEVICE).toInt()[0]) @@ -699,7 +719,7 @@ contact.ignored = bool(int(query.value(IGNORE).toInt()[0])) contact.favorite = bool(int(query.value(FAVORITE).toInt()[0])) if not ignore_message_count: - contact.has_messages = bool(int(query.value(MESSAGE_COUNT).toInt()[0])) + contact.message_count = int(query.value(MESSAGE_COUNT).toInt()[0]) ID_ON_PHONE, ACCOUNT, TYPE, LOCATION, CUSTOM_LOCATION, DETAIL, CUSTOM_DETAIL, PRIMARY, VALUE = range(9) fields = "SELECT detail_id_on_phone, account, type, location, custom_location, detail, custom_detail, primary_detail, value " + \ Modified: branches/work/series60-remote-dbus/pc/gui/src/dbus_listener/connectionmanager_listener.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/dbus_listener/connectionmanager_listener.py 2012-03-12 02:30:29 UTC (rev 962) +++ branches/work/series60-remote-dbus/pc/gui/src/dbus_listener/connectionmanager_listener.py 2012-03-12 15:24:28 UTC (rev 963) @@ -7,6 +7,9 @@ super(ConnectionManagerListener, self).__init__(main) self.main = main + self.log = main.log + + self.contacts_object = main.contacts_object self.connection_manager_object = main.connection_manager_object self.connection_manager_object.connect_to_signal("ConnectionRequested", self.connectionRequested) @@ -119,7 +122,28 @@ if connection.connecting: # Get unread messages... self.connection_manager_object.RequestUnreadMessages(connection.id) + + # Update the message count for each contact... + self.contacts_object.ContactMessageCount(connection.device.id, + reply_handler = lambda count_list : self.__messageCountReply(connection.device.id, count_list), + error_handler = self.__messageCountError) + def __messageCountReply(self, device_id, count_list): + device = self.main.devices[device_id] + + has_messages_updated = False + for contact_id, message_count in count_list: + if not has_messages_updated and not device.contacts[contact_id].hasMessages() and message_count > 0: + has_messages_updated = True + device.contacts[contact_id].message_count = message_count + + self.emit(QtCore.SIGNAL("messageCountUpdated"), device_id) + if has_messages_updated: + self.emit(QtCore.SIGNAL("contactHasMessagesUpdated"), device_id) + + def __messageCountError(self, error): + self.log.error("Message Count Update failed: " + error.get_dbus_message()) + def unreadMessagesCompleted(self, connection_id, messages): connection = self.main.active_connections[connection_id] messages = [ Message.deserialize(message) for message in messages ] @@ -140,6 +164,13 @@ # Show outgoing message in active chat window if there is one open self.main.chat_manager.showMessage(message) + # Update the message count for the contact + contact = device.contacts[message.contact_id] + if not contact.hasMessages(): + self.emit(QtCore.SIGNAL("contactHasMessagesUpdated"), device.id) + contact.message_count += 1 + self.emit(QtCore.SIGNAL("messageCountUpdated"), device.id) + self.emit(QtCore.SIGNAL("messageQueueChanged")) def messageStateAdded(self, connection_id, message_id, state_status, state_message, state_date): @@ -154,9 +185,16 @@ def messageReceived(self, connection_id, message): message = Message.deserialize(message) - #device = self.main.device(message.contact_id) + device = self.main.device(message.contact_id) #device.messages[message.id] = message + # Update the message count for the contact + contact = device.contacts[message.contact_id] + if not contact.hasMessages(): + self.emit(QtCore.SIGNAL("contactHasMessagesUpdated"), device.id) + contact.message_count += 1 + self.emit(QtCore.SIGNAL("messageCountUpdated"), device.id) + # Show incoming message in active chat window if there is one open # This sends also a highlight event to the open window contact_id = message.contact_id Modified: branches/work/series60-remote-dbus/pc/gui/src/lib/proxy/contact.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/lib/proxy/contact.py 2012-03-12 02:30:29 UTC (rev 962) +++ branches/work/series60-remote-dbus/pc/gui/src/lib/proxy/contact.py 2012-03-12 15:24:28 UTC (rev 963) @@ -57,7 +57,7 @@ if self.filter_removed and (contact.id_on_phone is None or contact.id_on_phone == 0): return False - if self.filter_no_messages and contact.has_messages == False: + if self.filter_no_messages and contact.hasMessages() == False: return False if self.blocked_rule == BlockedRule.Hide and contact.ignored: Modified: branches/work/series60-remote-dbus/pc/gui/src/widget/Device/ContactTreeView.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/widget/Device/ContactTreeView.py 2012-03-12 02:30:29 UTC (rev 962) +++ branches/work/series60-remote-dbus/pc/gui/src/widget/Device/ContactTreeView.py 2012-03-12 15:24:28 UTC (rev 963) @@ -9,19 +9,35 @@ class DeviceContactTreeView(QtGui.QTreeView): def __init__(self, parent): super(DeviceContactTreeView, self).__init__(parent) + + # HACK: We need Main() + main = QtGui.qApp.property("main").toPyObject() + + self.main = main + self.connectionmanager_listener = main.connectionmanager_listener - self.setModel(DeviceContactModel(self)) + self.model = DeviceContactModel(self) + + self.setModel(self.model) self.delegate = DeviceContactDelegate(self) self.delegate.contactDelegate().setSmallThumbnail() self.delegate.contactDelegate().showMobile(show = False) self.delegate.contactDelegate().showPhone(show = False) self.delegate.contactDelegate().showMail(show = False) self.setItemDelegate(self.delegate) + + self.connect(self.connectionmanager_listener, QtCore.SIGNAL("contactHasMessagesUpdated"), self.__hasMessagesUpdated) + def __hasMessagesUpdated(self, device_id): + for model_device_id, proxy_model in self.model.proxy_models.iteritems(): + if model_device_id == device_id: + proxy_model.invalidateFilter() + return + def selectDevice(self, device): index = None if device is not None: - index = self.model().findDeviceIndex(device) + index = self.model.findDeviceIndex(device) if index is not None and index.isValid(): self.setCurrentIndex(index) @@ -32,7 +48,7 @@ index = None expand_index = None if contact is not None: - index = self.model().findContactIndex(contact) + index = self.model.findContactIndex(contact) expand_index = index.parent() if index is not None and index.isValid(): Modified: branches/work/series60-remote-dbus/pc/gui/src/window/mainwindow/messages.py =================================================================== --- branches/work/series60-remote-dbus/pc/gui/src/window/mainwindow/messages.py 2012-03-12 02:30:29 UTC (rev 962) +++ branches/work/series60-remote-dbus/pc/gui/src/window/mainwindow/messages.py 2012-03-12 15:24:28 UTC (rev 963) @@ -213,7 +213,7 @@ showHistory = QtGui.QAction(self) showHistory.setText(self.tr("View &history")) showHistory.setIcon(QtGui.QIcon(":/message-history")) - showHistory.setEnabled(contact.has_messages) + showHistory.setEnabled(contact.hasMessages()) self.connect(showHistory, QtCore.SIGNAL("triggered()"), lambda : HistoryDialog(self, self.main, contact = contact)) menu.addAction(showHistory) @@ -221,7 +221,7 @@ showStatistics = QtGui.QAction(self) showStatistics.setText(self.tr("View &statistics")) showStatistics.setIcon(QtGui.QIcon(":/view-statistics")) - showStatistics.setEnabled(contact.has_messages) + showStatistics.setEnabled(contact.hasMessages()) self.connect(showStatistics, QtCore.SIGNAL("triggered()"), lambda : StatisticsDialog(self, self.main, contact = contact)) menu.addAction(showStatistics) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |