~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to parts/documentation/docconfiglistview.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2006-05-23 18:39:42 UTC
  • Revision ID: james.westby@ubuntu.com-20060523183942-hucifbvh68k2bwz7
Tags: upstream-3.3.2
Import upstream version 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2004 by Alexander Dymo                                  *
 
3
 *   cloudtemple@mksat.net                                                 *
 
4
 *                                                                         *
 
5
 *   This program is free software; you can redistribute it and/or modify  *
 
6
 *   it under the terms of the GNU General Public License as published by  *
 
7
 *   the Free Software Foundation; either version 2 of the License, or     *
 
8
 *   (at your option) any later version.                                   *
 
9
 *                                                                         *
 
10
 *   This program is distributed in the hope that it will be useful,       *
 
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
13
 *   GNU General Public License for more details.                          *
 
14
 *                                                                         *
 
15
 *   You should have received a copy of the GNU General Public License     *
 
16
 *   along with this program; if not, write to the                         *
 
17
 *   Free Software Foundation, Inc.,                                       *
 
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 
19
 ***************************************************************************/
 
20
#include "docconfiglistview.h"
 
21
 
 
22
#include <klocale.h>
 
23
 
 
24
#include "kdevdocumentationplugin.h"
 
25
 
 
26
DocConfigListView::DocConfigListView(QWidget *parent, const char *name)
 
27
     :KListView(parent, name)
 
28
{
 
29
//    setSorting(-1);
 
30
    addColumn(i18n("TOC"));
 
31
    addColumn(i18n("Index"));
 
32
    addColumn(i18n("Search"));
 
33
    addColumn(i18n("Title"));
 
34
//    addColumn(i18n("URL"));
 
35
    setColumnWidthMode(0, QListView::Maximum);
 
36
    setColumnWidthMode(1, QListView::Maximum);
 
37
    setColumnWidthMode(2, QListView::Maximum);
 
38
    setColumnWidthMode(3, QListView::Maximum);
 
39
//    setColumnWidthMode(4, QListView::Maximum);
 
40
    setAllColumnsShowFocus(true);
 
41
    setResizeMode( QListView::LastColumn );
 
42
 
 
43
    connect(this, SIGNAL(clicked(QListViewItem*, const QPoint&, int)),
 
44
        this, SLOT(clickedItem(QListViewItem*, const QPoint&, int )));
 
45
}
 
46
 
 
47
DocConfigListView::~DocConfigListView()
 
48
{
 
49
}
 
50
 
 
51
void DocConfigListView::clickedItem(QListViewItem *item, const QPoint &// pnt
 
52
                                    , int c)
 
53
{
 
54
    if (!item)
 
55
        return;
 
56
    ConfigurationItem *cfg = dynamic_cast<ConfigurationItem*>(item);
 
57
    if (!cfg)
 
58
        return;
 
59
    if (c == 0)
 
60
    {
 
61
        cfg->setContents(!cfg->contents());
 
62
        if (!cfg->contents())
 
63
            cfg->setIndex(false);
 
64
    }
 
65
    if ((c == 1) && (cfg->indexPossible()))
 
66
        cfg->setIndex(!cfg->index());
 
67
    else if ((c == 2)  && (cfg->fullTextSearchPossible()))
 
68
        cfg->setFullTextSearch(!cfg->fullTextSearch());
 
69
    repaintItem(item);
 
70
}
 
71
 
 
72
#include "docconfiglistview.moc"