[prev in list] [next in list] [prev in thread] [next in thread] 

List:       licq-cvs
Subject:    [Licq-cvs] qt-gui/src
From:       Jon Keating <emostar () users ! sourceforge ! net>
Date:       2004-07-12 1:36:20
Message-ID: E1Bjpjw-0002LE-Dg () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/licq/qt-gui/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8857

Modified Files:
	gui-defines.h mainwin.cpp optionsdlg.cpp optionsdlg.h 
	wharf.cpp 
Log Message:
Use the freedesktop.org style of docking for qt-gui. (Finally)
Don't show the registration wizard if another protocol has an owner installed.


Index: gui-defines.h
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/gui-defines.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- gui-defines.h	10 Jun 2004 13:59:43 -0000	1.24
+++ gui-defines.h	12 Jul 2004 01:36:17 -0000	1.25
@@ -64,7 +64,8 @@
 {
   DockNone = 0,
   DockDefault = 1,
-  DockThemed = 2
+  DockThemed = 2,
+  DockSmall = 3
 };
 
 

Index: mainwin.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/mainwin.cpp,v
retrieving revision 1.319
retrieving revision 1.320
diff -u -d -r1.319 -r1.320
--- mainwin.cpp	12 Jun 2004 15:08:15 -0000	1.319
+++ mainwin.cpp	12 Jul 2004 01:36:17 -0000	1.320
@@ -388,7 +388,11 @@
   licqConf.ReadNum("FrameStyle", nFrameStyle, 51);
   bool bDockIcon48;
   unsigned short nDockMode;
+#ifdef USE_KDE
+  licqConf.ReadNum("UseDock", nDockMode, (unsigned short)DockSmall);
+#else
   licqConf.ReadNum("UseDock", nDockMode, (unsigned short)DockNone);
+#endif
   m_nDockMode = (DockMode)nDockMode;
   licqConf.ReadBool("Dock64x48", bDockIcon48, false);
   char szDockTheme[64];
@@ -588,7 +592,7 @@
                     "<li><tt>%w - </tt>webpage</li></ul>");
   licqIcon = NULL;
 #ifdef USE_KDE
-  if(m_nDockMode != DockNone)
+  if (m_nDockMode != DockNone)
     licqIcon = new IconManager_KDEStyle(this, mnuSystem);
 #else
   switch (m_nDockMode)
@@ -599,10 +603,12 @@
     case DockThemed:
       licqIcon = new IconManager_Themed(this, mnuSystem, szDockTheme);
       break;
+    case DockSmall:
+      licqIcon = new IconManager_KDEStyle(this, mnuSystem);
     case DockNone:
       break;
   }
-#endif // USE_KDE
+#endif
 
    // all settings relating to localization
    licqConf.SetSection("locale");
@@ -663,17 +669,7 @@
    }
 
    // verify we exist
-   o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R);
-   bool bRegister = false;
-   if (o != NULL)
-   {
-    bRegister = ( strcmp(o->IdString(), "0") == 0);
-    gUserManager.DropOwner(LICQ_PPID);
-   }
-   else
-     bRegister = true;
-
-   if (bRegister)
+   if (gUserManager.NumOwners() == 0)
      slot_register();
    else
    {
@@ -3195,7 +3191,6 @@
   licqConf.WriteBool("showPopIdleTime", m_bPopIdleTime);
 
   licqConf.WriteNum("UseDock", (unsigned short)m_nDockMode);
-#ifndef USE_KDE
   switch(m_nDockMode)
   {
     case DockDefault:
@@ -3204,10 +3199,10 @@
     case DockThemed:
       licqConf.WriteStr("DockTheme", ((IconManager_Themed \
*)licqIcon)->Theme().latin1());  break;
+    case DockSmall:
     case DockNone:
       break;
   }
-#endif
 
   // save the column info
   licqConf.WriteNum("NumColumns", (unsigned short)colInfo.size());

Index: optionsdlg.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/optionsdlg.cpp,v
retrieving revision 1.139
retrieving revision 1.140
diff -u -d -r1.139 -r1.140
--- optionsdlg.cpp	2 May 2004 14:14:19 -0000	1.139
+++ optionsdlg.cpp	12 Jul 2004 01:36:17 -0000	1.140
@@ -232,11 +232,20 @@
       cmbDockTheme->setEnabled(false);
       rdbDockDefault->setEnabled(false);
       rdbDockThemed->setEnabled(false);
+      rdbDockSmall->setChecked(false);
+      rdbDockSmall->setEnabled(false);
       chkDockFortyEight->setEnabled(false);
       chkHidden->setEnabled(false);
       chkHidden->setChecked(false);
       break;
 #ifndef USE_KDE
+    case DockSmall:
+      chkUseDock->setChecked(true);
+      rdbDockSmall->setChecked(true);
+      chkDockFortyEight->setEnabled(false);
+      cmbDockTheme->setEnabled(false);
+      chkHidden->setEnabled(true);
+      break;
     case DockDefault:
       chkUseDock->setChecked(true);
       rdbDockDefault->setChecked(true);
@@ -261,12 +270,15 @@
       }
       break;
 #else
+    case DockSmall:
     case DockDefault:
     case DockThemed:
       chkUseDock->setChecked(true);
       cmbDockTheme->setEnabled(false);
       rdbDockDefault->setEnabled(false);
       rdbDockThemed->setEnabled(false);
+      rdbDockSmall->setChecked(true);
+      rdbDockSmall->setEnabled(false);
       chkDockFortyEight->setEnabled(false);
       chkHidden->setEnabled(true);
       break;
@@ -492,7 +504,8 @@
 
 #ifndef USE_KDE
   if (chkUseDock->isChecked() &&
-      (rdbDockDefault->isChecked() || rdbDockThemed->isChecked()) )
+      (rdbDockDefault->isChecked() || rdbDockThemed->isChecked() ||
+       rdbDockSmall->isChecked()) )
 #else
   if (chkUseDock->isChecked())
 #endif
@@ -521,6 +534,15 @@
         ((IconManager_Themed \
*)mainwin->licqIcon)->SetTheme(cmbDockTheme->currentText().local8Bit());  }
     }
+    else if (rdbDockSmall->isChecked())
+    {
+      if (mainwin->m_nDockMode != DockSmall)
+      {
+        delete mainwin->licqIcon;
+        mainwin->licqIcon = new IconManager_KDEStyle(mainwin, mainwin->mnuSystem);
+        mainwin->m_nDockMode = DockSmall;
+      }
+    }
 #else
     if(!mainwin->licqIcon)
       mainwin->licqIcon = new IconManager_KDEStyle(mainwin, mainwin->mnuSystem);
@@ -775,8 +797,11 @@
   QWhatsThis::add(chkDockFortyEight, tr("Selects between the standard 64x64 icon \
                used in the WindowMaker/Afterstep wharf "
                                         "and a shorter 64x48 icon for use in the \
Gnome/KDE panel."));  rdbDockThemed = new QRadioButton(tr("Themed Icon"), \
boxDocking); +  rdbDockSmall = new QRadioButton(tr("Small Icon"), boxDocking);
+  QWhatsThis::add(rdbDockSmall, tr("Uses the freedesktop.org standard to dock a \
small icon into the window manager.  Works with many different window managers."));  \
grpDocking->insert(rdbDockDefault);  grpDocking->insert(rdbDockThemed);
+  grpDocking->insert(rdbDockSmall);
   (void) new QLabel(tr("Theme:"), boxDocking);
   cmbDockTheme = new QComboBox(boxDocking);
   // Set the currently available themes
@@ -821,6 +846,7 @@
     cmbDockTheme->setEnabled(false);
     rdbDockDefault->setEnabled(false);
     rdbDockThemed->setEnabled(false);
+    rdbDockSmall->setEnabled(false);
     chkDockFortyEight->setEnabled(false);
 #endif
     chkHidden->setEnabled(false);
@@ -836,6 +862,7 @@
 #ifndef USE_KDE
   rdbDockDefault->setEnabled(true);
   rdbDockThemed->setEnabled(true);
+  rdbDockSmall->setEnabled(true);
   if (rdbDockDefault->isChecked())
   {
     cmbDockTheme->setEnabled(false);

Index: optionsdlg.h
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/optionsdlg.h,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- optionsdlg.h	2 May 2004 14:14:20 -0000	1.66
+++ optionsdlg.h	12 Jul 2004 01:36:17 -0000	1.67
@@ -80,7 +80,7 @@
              *chkSysBack, *chkSendFromClipboard, *chkMsgChatView, \
                *chkAutoPosReplyWin,
 	     *chkAutoSendThroughServer, *chkTabbedChatting,
              *chkEnableMainwinMouseMovement;
-   QRadioButton *rdbDockDefault, *rdbDockThemed;
+   QRadioButton *rdbDockDefault, *rdbDockThemed, *rdbDockSmall;
    QComboBox *cmbDockTheme, *cmbSortBy;
 
    // columns tab

Index: wharf.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/wharf.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- wharf.cpp	29 Dec 2003 15:20:51 -0000	1.48
+++ wharf.cpp	12 Jul 2004 01:36:17 -0000	1.49
@@ -62,6 +62,7 @@
 #undef FocusOut
 
 //#define DEBUG_WHARF
+#define SYSTEM_TRAY_REQUEST_DOCK    0
 
 /*
   Constructs a WharfIcon widget.
@@ -97,6 +98,28 @@
   hints->flags = WindowGroupHint | IconWindowHint | IconPositionHint | StateHint; // \
set the window group hint  XSetWMHints(dsp, win, hints);  // set the window hints for \
WM to use.  XFree( hints );
+
+  char buffer[128];
+  XEvent ev;
+
+  snprintf(buffer, sizeof(buffer), "_NET_SYSTEM_TRAY_S%d", x11Screen());
+  Atom a = XInternAtom(dsp, buffer, False);
+  Window systray = XGetSelectionOwner(dsp, a);
+
+  memset(&ev, 0, sizeof(ev));
+  ev.xclient.type = ClientMessage;
+  ev.xclient.window = systray;
+  ev.xclient.message_type = XInternAtom(dsp, "_NET_SYSTEM_TRAY_OPCODE", False);
+  ev.xclient.format = 32;
+  ev.xclient.data.l[0] = CurrentTime;
+  ev.xclient.data.l[1] = SYSTEM_TRAY_REQUEST_DOCK;
+  ev.xclient.data.l[2] = winId();
+  ev.xclient.data.l[3] = 0;
+  ev.xclient.data.l[4] = 0;
+
+  XSendEvent(dsp, systray, False, NoEventMask, &ev);
+  XSync(dsp, False);
+
 #endif
 
   resize (wharfIcon->width(), wharfIcon->height());
@@ -600,6 +623,29 @@
 #ifdef USE_KDE
   KWin::setSystemTrayWindowFor( winId(), _mainwin ? \
_mainwin->topLevelWidget()->winId() : qt_xrootwin() );  \
setBackgroundMode(X11ParentRelative); +#else
+  char buffer[128];
+  Display *dsp = x11Display();  // get the display
+  XEvent ev;
+
+  snprintf(buffer, sizeof(buffer), "_NET_SYSTEM_TRAY_S%d", x11Screen());
+  Atom a = XInternAtom(dsp, buffer, False);
+  Window systray = XGetSelectionOwner(dsp, a);
+
+  memset(&ev, 0, sizeof(ev));
+  ev.xclient.type = ClientMessage;
+  ev.xclient.window = systray;
+  ev.xclient.message_type = XInternAtom(dsp, "_NET_SYSTEM_TRAY_OPCODE", False);
+  ev.xclient.format = 32;
+  ev.xclient.data.l[0] = CurrentTime;
+  ev.xclient.data.l[1] = SYSTEM_TRAY_REQUEST_DOCK;
+  ev.xclient.data.l[2] = winId();
+  ev.xclient.data.l[3] = 0;
+  ev.xclient.data.l[4] = 0;
+
+  XSendEvent(dsp, systray, False, NoEventMask, &ev);
+  XSync(dsp, False);
+
 #endif
   show();
 }



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Licq-cvs mailing list
Licq-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/licq-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic