summaryrefslogtreecommitdiffstats
path: root/konversation/src/topiccombobox.cpp
blob: 2b71e9a05487affbcc3347a6224ed09703b36ffa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
  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
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
*/

/*
  begin:     Don Nov 21 2002
  copyright: (C) 2002 by Dario Abatianni
  email:     eisfuchs@tigress.com
*/

#include "topiccombobox.h"


TopicComboBox::TopicComboBox(QWidget* parent) :
KComboBox(parent,"topic_combo_box")
{
    connect(this,SIGNAL(activated(int)),this,SLOT(topicActivated(int)));
    connect(this,SIGNAL(returnPressed(const QString&)),this,SLOT(topicActivated(const QString&)));
}

TopicComboBox::~TopicComboBox()
{
}

void TopicComboBox::topicActivated(const QString& newTopic)
{
    emit topicChanged(newTopic);
}

void TopicComboBox::topicActivated(int index)
{
    emit topicChanged(text(index).section(' ',1));
}

void TopicComboBox::insertStringList(const QStringList& list)
{
    KComboBox::insertStringList(list);

    setEditText(list[0].section(' ',1));
}

void TopicComboBox::wheelEvent(QWheelEvent *ev)
{
    ev->ignore();
}

#include "topiccombobox.moc"