From d50d653686ba56ec206892da4c8d35a86178a182 Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Tue, 31 Jul 2012 23:27:47 +0300
Subject: add links support to quests window.

---
 src/gui/questswindow.cpp | 3 +++
 src/gui/questswindow.h   | 2 ++
 2 files changed, 5 insertions(+)

(limited to 'src')

diff --git a/src/gui/questswindow.cpp b/src/gui/questswindow.cpp
index fdda10562..5ffdf45c5 100644
--- a/src/gui/questswindow.cpp
+++ b/src/gui/questswindow.cpp
@@ -31,6 +31,7 @@
 #include "gui/widgets/layouthelper.h"
 #include "gui/widgets/extendedlistbox.h"
 #include "gui/widgets/extendednamesmodel.h"
+#include "gui/widgets/itemlinkhandler.h"
 #include "gui/widgets/scrollarea.h"
 #include "gui/widgets/textfield.h"
 
@@ -87,6 +88,7 @@ QuestsWindow::QuestsWindow() :
     mQuestsListBox(new ExtendedListBox(mQuestsModel)),
     mQuestScrollArea(new ScrollArea(mQuestsListBox,
         getOptionBool("showlistbackground"))),
+    mItemLinkHandler(new ItemLinkHandler),
     mText(new BrowserBox(BrowserBox::AUTO_WRAP)),
     mTextScrollArea(new ScrollArea(mText,
         getOptionBool("showtextbackground"))),
@@ -109,6 +111,7 @@ QuestsWindow::QuestsWindow() :
 
     mQuestScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
     mText->setOpaque(false);
+    mText->setLinkHandler(mItemLinkHandler);
     mTextScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
     mQuestsListBox->setWidth(500);
     if (gui->getNpcFont()->getHeight() < 20)
diff --git a/src/gui/questswindow.h b/src/gui/questswindow.h
index 4694acb8d..5b7babb5d 100644
--- a/src/gui/questswindow.h
+++ b/src/gui/questswindow.h
@@ -34,6 +34,7 @@
 class Button;
 class BrowserBox;
 class ExtendedListBox;
+class ItemLinkHandler;
 class ScrollArea;
 class QuestsModel;
 
@@ -70,6 +71,7 @@ class QuestsWindow : public Window, public gcn::ActionListener
         QuestsModel *mQuestsModel;
         ExtendedListBox *mQuestsListBox;
         ScrollArea *mQuestScrollArea;
+        ItemLinkHandler *mItemLinkHandler;
         BrowserBox *mText;
         ScrollArea *mTextScrollArea;
         Button *mCloseButton;
-- 
cgit v1.2.3-70-g09d2