KDevelop API Documentation

docconfiglistview.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Alexander Dymo                                  *
00003  *   cloudtemple@mksat.net                                                 *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #include "docconfiglistview.h"
00021 
00022 #include <klocale.h>
00023 
00024 #include "kdevdocumentationplugin.h"
00025 
00026 DocConfigListView::DocConfigListView(QWidget *parent, const char *name)
00027      :KListView(parent, name)
00028 {
00029     setSorting(-1);
00030     addColumn(i18n("TOC"));
00031     addColumn(i18n("Index"));
00032     addColumn(i18n("Search"));
00033     addColumn(i18n("Title"));    
00034 //    addColumn(i18n("URL"));
00035     setColumnWidthMode(0, QListView::Maximum);
00036     setColumnWidthMode(1, QListView::Maximum);
00037     setColumnWidthMode(2, QListView::Maximum);
00038     setColumnWidthMode(3, QListView::Maximum);
00039 //    setColumnWidthMode(4, QListView::Maximum);
00040     setAllColumnsShowFocus(true);
00041 
00042     connect(this, SIGNAL(clicked(QListViewItem*, const QPoint&, int)),
00043         this, SLOT(clickedItem(QListViewItem*, const QPoint&, int )));
00044 }
00045 
00046 DocConfigListView::~DocConfigListView()
00047 {
00048 }
00049 
00050 void DocConfigListView::clickedItem(QListViewItem *item, const QPoint &pnt, int c)
00051 {
00052     if (!item)
00053         return;
00054     ConfigurationItem *cfg = dynamic_cast<ConfigurationItem*>(item);
00055     if (!cfg)
00056         return;
00057     if (c == 0)
00058     {
00059         cfg->setContents(!cfg->contents());
00060         if (!cfg->contents())
00061             cfg->setIndex(false);
00062     }
00063     if ((c == 1) && (cfg->indexPossible()))
00064         cfg->setIndex(!cfg->index());
00065     else if ((c == 2)  && (cfg->fullTextSearchPossible()))
00066         cfg->setFullTextSearch(!cfg->fullTextSearch());
00067     repaintItem(item);
00068 }
00069 
00070 #include "docconfiglistview.moc"
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:22:39 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003