Changeset 4474
- Timestamp:
- 07/03/06 04:27:11 (2 years ago)
- Location:
- trunk/qt-gui/src
- Files:
-
- 8 modified
-
mainwin.cpp (modified) (2 diffs)
-
mainwin.h (modified) (1 diff)
-
mledit.cpp (modified) (2 diffs)
-
mledit.h (modified) (1 diff)
-
optionsdlg.cpp (modified) (3 diffs)
-
optionsdlg.h (modified) (1 diff)
-
usereventdlg.cpp (modified) (5 diffs)
-
usereventdlg.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt-gui/src/mainwin.cpp
r4472 r4474 448 448 licqConf.ReadBool("MainWinSticky", m_bMainWinSticky, false); 449 449 licqConf.ReadBool("MsgWinSticky", m_bMsgWinSticky, false); 450 licqConf.ReadBool("SingleLineChatMode", m_bSingleLineChatMode, false); 450 451 451 452 licqConf.ReadStr("ReceiveMessageColor", szTemp, "red"); … … 3641 3642 licqConf.WriteBool("MainWinSticky", m_bMainWinSticky); 3642 3643 licqConf.WriteBool("MsgWinSticky", m_bMsgWinSticky); 3644 licqConf.WriteBool("SingleLineChatMode", m_bSingleLineChatMode); 3643 3645 3644 3646 licqConf.WriteNum("ChatMessageStyle", m_nMsgStyle); -
trunk/qt-gui/src/mainwin.h
r4443 r4474 157 157 m_bMainWinSticky, 158 158 m_bMsgWinSticky, 159 m_bSingleLineChatMode, 159 160 m_bShowUserIcons; 160 161 -
trunk/qt-gui/src/mledit.cpp
r4454 r4474 47 47 setWordWrap(NoWrap); 48 48 } 49 50 QAccel *a = new QAccel( this );51 a->connectItem(a->insertItem(Key_Enter + CTRL),52 this, SIGNAL(signal_CtrlEnterPressed()));53 a->connectItem(a->insertItem(Key_Return + CTRL),54 this, SIGNAL(signal_CtrlEnterPressed()));55 49 56 50 if (editFont) … … 183 177 clear(); 184 178 break; 179 case Key_Return: 180 case Key_Enter: 181 emit signal_CtrlEnterPressed(); 182 break; 185 183 default: 186 184 QMultiLineEdit::keyPressEvent(e); -
trunk/qt-gui/src/mledit.h
r3246 r4474 15 15 void GotoEnd(); 16 16 17 using QMultiLineEdit::hasMarkedText; 18 using QMultiLineEdit::markedText; 17 using QMultiLineEdit::newLine; // make newLine() public 19 18 20 19 void setBackground(const QColor&); -
trunk/qt-gui/src/optionsdlg.cpp
r4472 r4474 243 243 chkMainWinSticky->setChecked(mainwin->m_bMainWinSticky); 244 244 chkMsgWinSticky->setChecked(mainwin->m_bMsgWinSticky); 245 chkSingleLineChatMode->setChecked(mainwin->m_bSingleLineChatMode); 245 246 popEmail->setChecked(mainwin->m_bPopEmail); 246 247 popPhone->setChecked(mainwin->m_bPopPhone); … … 541 542 mainwin->changeMainWinSticky(chkMainWinSticky->isChecked()); 542 543 mainwin->m_bMsgWinSticky = chkMsgWinSticky->isChecked(); 544 mainwin->m_bSingleLineChatMode = chkSingleLineChatMode->isChecked(); 543 545 544 546 mainwin->m_bPopEmail= popEmail->isChecked(); … … 825 827 "with your mouse")); 826 828 829 chkSingleLineChatMode = new QCheckBox(tr("Single line chat mode"), boxMainWin); 830 QWhatsThis::add(chkSingleLineChatMode, tr("In single line chat mode you send messages with Enter " 831 "and insert new lines with Ctrl+Enter, opposite of the normal mode")); 832 827 833 chkMsgChatView = new QCheckBox(tr("Chatmode Messageview"), boxMainWin); 828 834 QWhatsThis::add(chkMsgChatView, tr("Show the current chat history in Send Window")); -
trunk/qt-gui/src/optionsdlg.h
r4472 r4474 94 94 *chkAlwaysShowONU, *chkScrollBar, *chkShowExtIcons, 95 95 *chkSysBack, *chkSendFromClipboard, *chkMsgChatView, *chkAutoPosReplyWin, 96 *chkFlashTaskbar, *chkAutoSendThroughServer, *chkTabbedChatting,97 *chkMainWinSticky, *chkMsgWinSticky,96 *chkFlashTaskbar, *chkAutoSendThroughServer, *chkTabbedChatting, 97 *chkMainWinSticky, *chkMsgWinSticky, *chkSingleLineChatMode, 98 98 *chkEnableMainwinMouseMovement, *chkShowHistory, *chkSendTN; 99 99 QRadioButton *rdbDockDefault, *rdbDockThemed, *rdbDockSmall; -
trunk/qt-gui/src/usereventdlg.cpp
r4452 r4474 32 32 #include <qcheckbox.h> 33 33 #include <qdatetime.h> 34 #include <qevent.h> 34 35 #include <qfileinfo.h> 35 36 #include <qvbox.h> … … 1779 1780 1780 1781 mleSend = new MLEditWrap(true, splView, true); 1782 mleSend->installEventFilter(this); // Enables send with enter 1783 1781 1784 if (mainwin->m_bMsgChatView) 1782 1785 { … … 1797 1800 UserSendCommon::~UserSendCommon() 1798 1801 { 1802 } 1803 1804 #undef KeyPress 1805 bool UserSendCommon::eventFilter(QObject *watched, QEvent *e) 1806 { 1807 if (watched == mleSend) 1808 { 1809 // If we're in single line chat mode we send messages with Enter and 1810 // insert new lines with Ctrl+Enter. 1811 if (mainwin->m_bSingleLineChatMode && e->type() == QEvent::KeyPress) 1812 { 1813 QKeyEvent *key = static_cast<QKeyEvent*>(e); 1814 const bool isEnter = (key->key() == Key_Enter || key->key() == Key_Return); 1815 if (isEnter) 1816 { 1817 if (key->state() & ControlButton) 1818 mleSend->newLine(); 1819 else 1820 btnSend->animateClick(); 1821 return true; // filter the event out 1822 } 1823 } 1824 return false; 1825 } 1826 else 1827 return UserEventCommon::eventFilter(watched, e); 1799 1828 } 1800 1829 … … 2835 2864 edtItem = new CInfoField(mainWidget, false); 2836 2865 h_lay->addWidget(edtItem); 2866 edtItem->installEventFilter(this); 2837 2867 2838 2868 m_sBaseTitle += tr(" - URL"); … … 2848 2878 UserSendUrlEvent::~UserSendUrlEvent() 2849 2879 { 2880 } 2881 2882 bool UserSendUrlEvent::eventFilter(QObject *watched, QEvent *e) 2883 { 2884 if (watched == edtItem) 2885 { 2886 if (e->type() == QEvent::KeyPress) 2887 { 2888 QKeyEvent *key = static_cast<QKeyEvent*>(e); 2889 const bool isEnter = (key->key() == Key_Enter || key->key() == Key_Return); 2890 if (isEnter && (mainwin->m_bSingleLineChatMode || key->state() & ControlButton)) 2891 { 2892 btnSend->animateClick(); 2893 return true; // filter the event out 2894 } 2895 } 2896 return false; 2897 } 2898 else 2899 return UserSendCommon::eventFilter(watched, e); 2850 2900 } 2851 2901 -
trunk/qt-gui/src/usereventdlg.h
r4452 r4474 258 258 const char *name = 0); 259 259 virtual ~UserSendCommon(); 260 virtual bool eventFilter(QObject *watched, QEvent *e); 260 261 261 262 void setText(const QString& txt); … … 356 357 const char *_szId, unsigned long _nPPID, QWidget *parent = 0); 357 358 virtual ~UserSendUrlEvent(); 359 virtual bool eventFilter(QObject *watched, QEvent *e); 358 360 359 361 void setUrl(const QString& url, const QString& description);
