From cca7060385c8cde97767b8cdd1a60d45b08df440 Mon Sep 17 00:00:00 2001 From: dockes Date: Sun, 15 Oct 2006 13:07:45 +0000 Subject: [PATCH] dbl click in spell win to add to ssearch --- src/qtgui/rclmain_w.cpp | 4 +++- src/qtgui/spell_w.cpp | 10 +++++++++- src/qtgui/spell_w.h | 6 +++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/qtgui/rclmain_w.cpp b/src/qtgui/rclmain_w.cpp index 6f78b3de..cc96677d 100644 --- a/src/qtgui/rclmain_w.cpp +++ b/src/qtgui/rclmain_w.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.2 2006-10-11 14:16:26 dockes Exp $ (C) 2005 J.F.Dockes"; +static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.3 2006-10-15 13:07:45 dockes Exp $ (C) 2005 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -394,6 +394,8 @@ void RclMain::showSpellDialog() spellform = new SpellW(0, tr("Spell expansion"), WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu); + connect(spellform, SIGNAL(wordSelect(QString)), + this, SLOT(ssearchAddTerm(QString))); spellform->show(); } else { // Close and reopen, in hope that makes us visible... diff --git a/src/qtgui/spell_w.cpp b/src/qtgui/spell_w.cpp index cd305707..10c45c16 100644 --- a/src/qtgui/spell_w.cpp +++ b/src/qtgui/spell_w.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: spell_w.cpp,v 1.1 2006-10-11 14:16:26 dockes Exp $ (C) 2005 J.F.Dockes"; +static char rcsid[] = "@(#$Id: spell_w.cpp,v 1.2 2006-10-15 13:07:45 dockes Exp $ (C) 2005 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -48,6 +48,8 @@ void SpellW::init() connect(expandPB, SIGNAL(clicked()), this, SLOT(doExpand())); connect(clearPB, SIGNAL(clicked()), baseWordLE, SLOT(clear())); connect(dismissPB, SIGNAL(clicked()), this, SLOT(close())); + connect(suggsTE, SIGNAL(doubleClicked(int, int)), + this, SLOT(textDoubleClicked(int, int))); } void SpellW::doExpand() @@ -92,3 +94,9 @@ void SpellW::wordChanged(const QString &text) clearPB->setEnabled(true); } } + +void SpellW::textDoubleClicked(int, int) +{ + if (suggsTE->hasSelectedText()) + emit(wordSelect(suggsTE->selectedText())); +} diff --git a/src/qtgui/spell_w.h b/src/qtgui/spell_w.h index c96ab605..ff7d3ad5 100644 --- a/src/qtgui/spell_w.h +++ b/src/qtgui/spell_w.h @@ -1,6 +1,6 @@ #ifndef _ASPELL_W_H_INCLUDED_ #define _ASPELL_W_H_INCLUDED_ -/* @(#$Id: spell_w.h,v 1.1 2006-10-11 14:16:26 dockes Exp $ (C) 2006 J.F.Dockes */ +/* @(#$Id: spell_w.h,v 1.2 2006-10-15 13:07:45 dockes Exp $ (C) 2006 J.F.Dockes */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,10 +36,10 @@ public: public slots: virtual void doExpand(); virtual void wordChanged(const QString&); - // virtual void textDoubleClicked(int, int); + virtual void textDoubleClicked(int, int); signals: - // void wordSelect(QString); + void wordSelect(QString); private: void init();