Skip to content
This repository
Browse code

Merge branch '1.6-stable'

  • Loading branch information...
commit 6c85fc1533b45441985a69a2e57572c5046dcfb9 2 parents 7e7dbba + 1badf05
Anders Olofsson authored April 30, 2012
1  licq/doc/CHANGELOG
@@ -14,6 +14,7 @@ o ICQ: Fix packets not being sent for sequence numbers above 0x7fff
14 14
 o Qt4-Gui: Handle meta key in global hotkeys
15 15
 o Qt4-Gui: Fix global hotkeys to work with Caps-/Numlock active
16 16
 o Qt4-Gui: Fix crash on message right click without spell checking
  17
+o Qt4-Gui: Update title of user dialogs when alias/name changes
17 18
 
18 19
 
19 20
 New in 1.6.0
7  qt4-gui/src/contactlist/contactuserdata.cpp
@@ -31,6 +31,7 @@
31 31
 #include <licq/contactlist/user.h>
32 32
 #include <licq/icq/icq.h>
33 33
 #include <licq/icq/user.h>
  34
+#include <licq/plugin/pluginmanager.h>
34 35
 #include <licq/pluginsignal.h>
35 36
 #include <licq/socket.h>
36 37
 #include <licq/userevents.h>
@@ -499,12 +500,10 @@ bool ContactUserData::setData(const QVariant& value, int role)
499 500
     u->SetKeepAliasOnUpdate(true);
500 501
     u->setAlias(myAlias.toUtf8().data());
501 502
 
502  
-    // Daemon doesn't send signal when alias is changed so trigger update from here
503  
-    updateText(*u);
504  
-    updateSorting();
  503
+    Licq::gPluginManager.pushPluginSignal(new Licq::PluginSignal(
  504
+        Licq::PluginSignal::SignalUser, Licq::PluginSignal::UserBasic, myUserId));
505 505
   }
506 506
 
507  
-  emit dataChanged(this);
508 507
   return true;
509 508
 }
510 509
 
3  qt4-gui/src/core/licqgui.cpp
@@ -53,6 +53,7 @@
53 53
 extern "C"
54 54
 {
55 55
 #include <X11/X.h>
  56
+#include <X11/XKBlib.h>
56 57
 #include <X11/Xlib.h>
57 58
 #include <X11/Xutil.h>
58 59
 
@@ -504,7 +505,7 @@ bool LicqGui::x11EventFilter(XEvent* event)
504 505
   {
505 506
     Display* dsp = QX11Info::display();
506 507
     unsigned int mod = event->xkey.state & (ControlMask | ShiftMask | Mod1Mask | Mod4Mask);
507  
-    unsigned int keysym = XKeycodeToKeysym(dsp, event->xkey.keycode, 0);
  508
+    unsigned int keysym = XkbKeycodeToKeysym(dsp, event->xkey.keycode, 0, 0);
508 509
 
509 510
     if (keysym == Support::keyToXSym(myPopupMessageKey) &&
510 511
         mod == Support::keyToXMod(myPopupMessageKey))
36  qt4-gui/src/dialogs/historydlg.cpp
... ...
@@ -1,6 +1,6 @@
1 1
 /*
2 2
  * This file is part of Licq, an instant messaging client for UNIX.
3  
- * Copyright (C) 2007-2011 Licq developers
  3
+ * Copyright (C) 2007-2012 Licq developers <licq-dev@googlegroups.com>
4 4
  *
5 5
  * Licq is free software; you can redistribute it and/or modify
6 6
  * it under the terms of the GNU General Public License as published by
@@ -162,16 +162,7 @@ HistoryDlg::HistoryDlg(const Licq::UserId& userId, QWidget* parent)
162 162
   {
163 163
     Licq::UserReadGuard u(myUserId);
164 164
 
165  
-    QString name = tr("INVALID USER");
166  
-
167  
-    if (u.isLocked())
168  
-    {
169  
-      name = QString::fromUtf8(u->getFullName().c_str());
170  
-      if (!name.isEmpty())
171  
-        name = " (" + name + ")";
172  
-      name.prepend(QString::fromUtf8(u->getAlias().c_str()));
173  
-    }
174  
-    setWindowTitle(tr("Licq - History ") + name);
  165
+    setTitle(*u);
175 166
 
176 167
     bool validHistory = false;
177 168
 
@@ -281,6 +272,29 @@ void HistoryDlg::updatedUser(const Licq::UserId& userId, unsigned long subSignal
281 272
     if (event != NULL && argument > 0 && argument > (*(--myHistoryList.end()))->Id())
282 273
       addMsg(event);
283 274
   }
  275
+  else if (subSignal == Licq::PluginSignal::UserBasic)
  276
+  {
  277
+    Licq::UserReadGuard u(myUserId);
  278
+    setTitle(*u);
  279
+  }
  280
+}
  281
+
  282
+void HistoryDlg::setTitle(const Licq::User* user)
  283
+{
  284
+  QString name;
  285
+  if (user == NULL)
  286
+  {
  287
+    name = tr("INVALID USER");
  288
+  }
  289
+  else
  290
+  {
  291
+    name = QString::fromUtf8(user->getFullName().c_str());
  292
+    if (!name.isEmpty())
  293
+      name = " (" + name + ")";
  294
+    name.prepend(QString::fromUtf8(user->getAlias().c_str()));
  295
+  }
  296
+
  297
+  setWindowTitle(tr("Licq - History ") + name);
284 298
 }
285 299
 
286 300
 void HistoryDlg::eventSent(const Licq::Event* event)
9  qt4-gui/src/dialogs/historydlg.h
... ...
@@ -1,6 +1,6 @@
1 1
 /*
2 2
  * This file is part of Licq, an instant messaging client for UNIX.
3  
- * Copyright (C) 2007-2011 Licq developers <licq-dev@googlegroups.com>
  3
+ * Copyright (C) 2007-2012 Licq developers <licq-dev@googlegroups.com>
4 4
  *
5 5
  * Licq is free software; you can redistribute it and/or modify
6 6
  * it under the terms of the GNU General Public License as published by
@@ -147,6 +147,13 @@ private slots:
147 147
    */
148 148
   void showHistory();
149 149
 
  150
+  /**
  151
+   * Update window title
  152
+   *
  153
+   * @param @user The user object
  154
+   */
  155
+  void setTitle(const Licq::User* user);
  156
+
150 157
   Licq::UserId myUserId;
151 158
   bool myIsOwner;
152 159
   QString myContactName;
37  qt4-gui/src/userdlg/userdlg.cpp
... ...
@@ -1,6 +1,6 @@
1 1
 /*
2 2
  * This file is part of Licq, an instant messaging client for UNIX.
3  
- * Copyright (C) 2008-2011 Licq developers
  3
+ * Copyright (C) 2008-2012 Licq developers <licq-dev@googlegroups.com>
4 4
  *
5 5
  * Licq is free software; you can redistribute it and/or modify
6 6
  * it under the terms of the GNU General Public License as published by
@@ -102,18 +102,10 @@ UserDlg::UserDlg(const Licq::UserId& userId, QWidget* parent)
102 102
      Licq::UserReadGuard user(myUserId);
103 103
     if (user.isLocked())
104 104
     {
105  
-      QString name = QString::fromUtf8(user->getFullName().c_str());
106  
-      if (!name.isEmpty())
107  
-        name = " (" + name + ")";
108  
-      myBasicTitle = tr("Licq - Info ") + QString::fromUtf8(user->getAlias().c_str()) + name;
109  
-
110 105
       myUserInfo->load(*user);
111 106
       myUserSettings->load(*user);
112 107
     }
113  
-    else
114  
-    {
115  
-      myBasicTitle = tr("Licq - Info ") + tr("INVALID USER");
116  
-    }
  108
+    setBasicTitle(*user);
117 109
   }
118 110
   resetCaption();
119 111
 
@@ -232,10 +224,35 @@ void UserDlg::userUpdated(const Licq::UserId& userId, unsigned long subSignal)
232 224
   if (!user.isLocked())
233 225
     return;
234 226
 
  227
+  if (subSignal == Licq::PluginSignal::UserBasic)
  228
+    setBasicTitle(*user);
  229
+
235 230
   myUserInfo->userUpdated(*user, subSignal);
236 231
   myUserSettings->userUpdated(*user, subSignal);
237 232
 }
238 233
 
  234
+void UserDlg::setBasicTitle(const Licq::User* user)
  235
+{
  236
+  bool wasBasicTitle = (windowTitle() == myBasicTitle);
  237
+
  238
+  QString name;
  239
+  if (user == NULL)
  240
+  {
  241
+    name = tr("INVALID USER");
  242
+  }
  243
+  else
  244
+  {
  245
+    name = QString::fromUtf8(user->getFullName().c_str());
  246
+    if (!name.isEmpty())
  247
+      name = " (" + name + ")";
  248
+    name.prepend(QString::fromUtf8(user->getAlias().c_str()));
  249
+  }
  250
+
  251
+  myBasicTitle = tr("Licq - Info ") + name;
  252
+  if (wasBasicTitle)
  253
+    resetCaption();
  254
+}
  255
+
239 256
 void UserDlg::doneFunction(const Licq::Event* event)
240 257
 {
241 258
   if (!event->Equals(myIcqEventTag))
10  qt4-gui/src/userdlg/userdlg.h
... ...
@@ -1,6 +1,6 @@
1 1
 /*
2 2
  * This file is part of Licq, an instant messaging client for UNIX.
3  
- * Copyright (C) 2008-2010 Licq developers
  3
+ * Copyright (C) 2008-2012 Licq developers <licq-dev@googlegroups.com>
4 4
  *
5 5
  * Licq is free software; you can redistribute it and/or modify
6 6
  * it under the terms of the GNU General Public License as published by
@@ -31,6 +31,7 @@
31 31
 namespace Licq
32 32
 {
33 33
 class Event;
  34
+class User;
34 35
 }
35 36
 
36 37
 namespace LicqQtGui
@@ -176,6 +177,13 @@ private slots:
176 177
   void resetCaption();
177 178
 
178 179
 private:
  180
+  /**
  181
+   * Update base part of window title
  182
+   *
  183
+   * @param @user The user object
  184
+   */
  185
+  void setBasicTitle(const Licq::User* user);
  186
+
179 187
   Licq::UserId myUserId;
180 188
   bool myIsOwner;
181 189
   unsigned long myIcqEventTag;

0 notes on commit 6c85fc1

Please sign in to comment.
Something went wrong with that request. Please try again.