added custom highlighting (in the settings: behaviour -> highlight)
[quassel.git] / src / client / clientsettings.cpp
index 2bf6412..1c3c5cf 100644 (file)
@@ -78,21 +78,50 @@ QVariant CoreAccountSettings::accountValue(const QString &key, const QVariant &d
   return localValue(QString("%1/%2/%3").arg(Client::currentCoreAccount().toInt()).arg(_subgroup).arg(key), def);
 }
 
+void CoreAccountSettings::setJumpKeyMap(const QHash<int, BufferId> &keyMap) {
+  QVariantMap variants;
+  QHash<int, BufferId>::const_iterator mapIter = keyMap.constBegin();
+  while(mapIter != keyMap.constEnd()) {
+    variants[QString::number(mapIter.key())] = qVariantFromValue(mapIter.value());
+    mapIter++;
+  }
+  setLocalValue("JumpKeyMap", variants);
+}
+
+QHash<int, BufferId> CoreAccountSettings::jumpKeyMap() {
+  QHash<int, BufferId> keyMap;
+  QVariantMap variants = localValue("JumpKeyMap", QVariant()).toMap();
+  QVariantMap::const_iterator mapIter = variants.constBegin();
+  while(mapIter != variants.constEnd()) {
+    keyMap[mapIter.key().toInt()] = mapIter.value().value<BufferId>();
+    mapIter++;
+  }
+  return keyMap;
+}
+
 void CoreAccountSettings::removeAccount(AccountId id) {
   removeLocalKey(QString("%1").arg(id.toInt()));
 }
 
+
 /***********************************************************************************************/
+// NotificationSettings:
+
+NotificationSettings::NotificationSettings() : ClientSettings("Notification") {
+}
+
+void NotificationSettings::setHighlightList(const QVariantList &highlightList) {
+  setLocalValue("highlightList", highlightList);
+}
 
-BufferSettings::BufferSettings(BufferId bufferId)
-  : CoreAccountSettings(QString("Buffers/%1").arg(bufferId.toInt()))
-{
+QVariantList NotificationSettings::highlightList() {
+  return localValue("highlightList").toList();
 }
 
-void BufferSettings::setLastSeen(QDateTime seenDate) {
-  setAccountValue("LastSeen", seenDate);
+void NotificationSettings::setHighlightCurrentNick(const bool &highlightCurrentNick) {
+  setLocalValue("highlightCurrentNick", highlightCurrentNick);
 }
 
-QDateTime BufferSettings::lastSeen() {
-  return accountValue("LastSeen", QDateTime()).value<QDateTime>();
+bool NotificationSettings::highlightCurrentNick() {
+  return localValue("highlightCurrentNick", true).toBool();
 }