Hello

There is auto-resize patch, that resize the licq window verticaly just
to fit all the contacts.

Now handles config files and changes options dialog also.

Jaromir Malenko


diff -Naur licq-1.3.0/plugins/qt-gui/src/mainwin.cpp 
licq-1.3.0-new/plugins/qt-gui/src/mainwin.cpp
--- licq-1.3.0/plugins/qt-gui/src/mainwin.cpp   2004-09-29 16:51:42.000000000 +0200
+++ licq-1.3.0-new/plugins/qt-gui/src/mainwin.cpp       2004-10-10 17:52:41.898062128 
+0200
@@ -466,6 +466,7 @@
   licqConf.ReadBool("AutoClose", m_bAutoClose, true);
   licqConf.ReadBool("AutoPopup", m_bAutoPopup, false);
   licqConf.ReadStr("MsgPopupKey", szTemp, "none");
+  licqConf.ReadNum("AutoResize", m_nAutoResize, 0);
 
   m_MsgAutopopupKey = QString::fromLatin1(szTemp);
   if(!(!szTemp || !strcmp(szTemp, "none"))) {
@@ -487,6 +488,8 @@
             xPos, yPos, wVal, hVal);
   if (yPos > QApplication::desktop()->height() - 16) yPos = 0;
   if (xPos > QApplication::desktop()->width() - 16) xPos = 0;
+  resize(wVal, hVal);
+  move(xPos, yPos);
 
   // Check for qt-gui directory in current base dir
   if (!QDir(QString("%1/%2").arg(BASE_DIR).arg(QTGUI_DIR)).exists())
@@ -700,8 +703,6 @@
    updateGroups();
    manualAway = 0;
 
-   resize(wVal, hVal);
-   move(xPos, yPos);
    if (!m_bHidden && !bStartHidden) show();
 
    // automatically logon if requested in conf file
@@ -1553,6 +1554,9 @@
       break;
     }
   }
+  
+  // at the end of: void CMainWindow::slot_updatedUser(CICQSignal *sig)
+  updateUserWin();
 }
 
 
@@ -1732,6 +1736,20 @@
   FOR_EACH_USER_END
   userView->setUpdatesEnabled(true);
   userView->triggerUpdate();
+  
+  if (m_nAutoResize != 0) {
+    QSize size = gMainWindow->size();
+    QPoint pos = gMainWindow->pos();
+    int orig_height = size.height();
+    int base = size.height() - userView->height();
+    size.setHeight(base + userView->childCount()*18);
+    resize(size);
+    if (m_nAutoResize < 0) {
+      pos.setY(pos.y() + (orig_height - gMainWindow->size().height()));
+      move(pos);
+    }
+    resizeEvent(NULL);
+  }
 }
 
 
@@ -3187,6 +3205,7 @@
   licqConf.WriteBool("AutoClose", m_bAutoClose);
   licqConf.WriteBool("AutoPopup", m_bAutoPopup);
   licqConf.WriteStr("MsgPopupKey", m_MsgAutopopupKey.isEmpty() ? "none" : 
m_MsgAutopopupKey.latin1());
+  licqConf.WriteNum("AutoResize", m_nAutoResize);
 
   licqConf.SetSection("appearance");
   licqConf.WriteStr("Skin", skin->szSkinName);
@@ -4314,6 +4333,7 @@
     optionsDlg = new OptionsDlg(this, (OptionsDlg::tabs) tab);
     connect(optionsDlg, SIGNAL(signal_done()), this, SLOT(slot_doneOptions()));
   }
+  updateUserWin();
 }
 
 void CMainWindow::showSkinBrowser()
diff -Naur licq-1.3.0/plugins/qt-gui/src/mainwin.h 
licq-1.3.0-new/plugins/qt-gui/src/mainwin.h
--- licq-1.3.0/plugins/qt-gui/src/mainwin.h     2004-09-29 16:51:42.000000000 +0200
+++ licq-1.3.0-new/plugins/qt-gui/src/mainwin.h 2004-10-10 12:25:43.000000000 +0200
@@ -244,6 +244,7 @@
           pmAIMOffline;
   unsigned long m_nUserMenuUin;
   unsigned int positionChanges;
+  short m_nAutoResize;
   int m_nProtoNum;
   char *m_szUserMenuId;
   unsigned long m_nUserMenuPPID;
diff -Naur licq-1.3.0/plugins/qt-gui/src/optionsdlg.cpp 
licq-1.3.0-new/plugins/qt-gui/src/optionsdlg.cpp
--- licq-1.3.0/plugins/qt-gui/src/optionsdlg.cpp        2004-09-06 14:50:56.000000000 
+0200
+++ licq-1.3.0-new/plugins/qt-gui/src/optionsdlg.cpp    2004-10-10 14:34:00.000000000 
+0200
@@ -213,6 +213,10 @@
   else
     chkTabbedChatting->setEnabled(false);
 #endif
+  chkAutoResize->setChecked(mainwin->m_nAutoResize);
+  if(mainwin->m_nAutoResize) {
+    chkAutoResizeGrowUp->setChecked(mainwin->m_nAutoResize < 0);
+  }
   chkAutoPosReplyWin->setChecked(mainwin->m_bAutoPosReplyWin);
   chkAutoSendThroughServer->setChecked(mainwin->m_bAutoSendThroughServer);
   chkEnableMainwinMouseMovement->setChecked(mainwin->m_bEnableMainwinMouseMovement);
@@ -491,6 +495,8 @@
 #if QT_VERSION >= 300
   mainwin->m_bTabbedChatting = chkTabbedChatting->isChecked();
 #endif
+  if (chkAutoResize->isChecked()) mainwin->m_nAutoResize = 
chkAutoResizeGrowUp->isChecked() ? -1 : 1;
+  else mainwin->m_nAutoResize = 0;
   mainwin->m_bAutoPosReplyWin = chkAutoPosReplyWin->isChecked();
   mainwin->m_bAutoSendThroughServer = chkAutoSendThroughServer->isChecked();
   mainwin->m_bEnableMainwinMouseMovement = chkEnableMainwinMouseMovement->isChecked();
@@ -778,6 +784,13 @@
   connect(chkMsgChatView, SIGNAL(toggled(bool)), this, 
SLOT(slot_useMsgChatView(bool)));
 #endif
 
+  chkAutoResize = new QCheckBox(tr("Auto-Resize main window"), boxMainWin);
+  QWhatsThis::add(chkAutoResize, tr("Automatically resize main window to fit all 
contacts"));
+  chkAutoResizeGrowUp = new QCheckBox(tr("Fix bottom border"), boxMainWin);
+  QWhatsThis::add(chkAutoResizeGrowUp, tr("The main window grows up and the bottom 
border "
+                                         "keeps its place "));
+  connect(chkAutoResize, SIGNAL(toggled(bool)), 
SLOT(slot_useAutoResizeToggled(bool)));
+
   l = new QVBoxLayout(l);
   boxLocale = new QGroupBox(1, Horizontal, tr("Localization"), w);
   lblDefaultEncoding = new QLabel(tr("Default Encoding:"), boxLocale);
@@ -854,6 +867,11 @@
   return w;
 }
 
+void OptionsDlg::slot_useAutoResizeToggled(bool b)
+{
+  chkAutoResizeGrowUp->setEnabled(b);
+}
+
 void OptionsDlg::slot_useDockToggled(bool b)
 {
   if (!b)
diff -Naur licq-1.3.0/plugins/qt-gui/src/optionsdlg.h 
licq-1.3.0-new/plugins/qt-gui/src/optionsdlg.h
--- licq-1.3.0/plugins/qt-gui/src/optionsdlg.h  2004-07-12 03:36:17.000000000 +0200
+++ licq-1.3.0-new/plugins/qt-gui/src/optionsdlg.h      2004-10-10 15:22:18.000000000 
+0200
@@ -72,6 +72,7 @@
    QLineEdit *edtFont, *edtEditFont, *edtFrameStyle, *edtHotKey;
    QPushButton *btnFont, *btnEditFont;
    QCheckBox *chkSSList, *chkGridLines, *chkHeader, *chkAutoClose,
+             *chkAutoResize, *chkAutoResizeGrowUp,
              *chkShowDividers, *chkFontStyles, *chkUseDock, *chkDockFortyEight,
              *chkTransparent, *chkShowGroupIfNoMsg,
              *chkAutoPopup, *chkAutoRaise, *chkHidden, *chkFlashUrgent, *chkFlashAll,
@@ -144,6 +145,7 @@
   void slot_SARmsg_act(int);
   void slot_SARgroup_act(int);
   void slot_SARsave_act();
+  void slot_useAutoResizeToggled(bool);
   void slot_useProxy(bool);
   void slot_useDockToggled(bool);
   void slot_useFirewall(bool);


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Licq-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/licq-devel

Reply via email to