choosedlg.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "choosedlg.h"
00013
00014 #include <qcombobox.h>
00015 #include <qfile.h>
00016 #include <qdir.h>
00017 #include <qvbox.h>
00018 #include <qlayout.h>
00019 #include <qlabel.h>
00020 #include <qlineedit.h>
00021 #include <qpushbutton.h>
00022 #include <qregexp.h>
00023 #include <qtextstream.h>
00024 #include <kapplication.h>
00025 #include <kbuttonbox.h>
00026 #include <kconfig.h>
00027 #include <kdebug.h>
00028 #include <kdialog.h>
00029 #include <klocale.h>
00030 #include <kprocess.h>
00031 #include <kstandarddirs.h>
00032 #include <qtimer.h>
00033
00034 #include "kdevpartcontroller.h"
00035 #include "kdevmainwindow.h"
00036 #include "doctreeviewwidget.h"
00037
00038 ChooseDlg::ChooseDlg(QWidget *parent, const char *name, DocTreeViewPart *part)
00039 : QDialog(parent, name, true), m_part(part)
00040 {
00041 setCaption(i18n("Documentation"));
00042
00043 QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
00044
00045 layout->addWidget(new QLabel(i18n("Choose your help subtopic:"), this));
00046 lv = new KListView(this, "topics list");
00047 lv->setMinimumWidth(600);
00048 lv->setAllColumnsShowFocus( true );
00049 lv->addColumn(i18n("Topic"));
00050 lv->addColumn(i18n("Filename"));
00051 layout->addWidget(lv);
00052
00053 connect( lv, SIGNAL ( executed(QListViewItem *) ), this, SLOT ( slotItemExecuted(QListViewItem *) ) );
00054 connect( lv, SIGNAL ( returnPressed(QListViewItem *) ), this, SLOT ( slotItemExecuted(QListViewItem *) ) );
00055 }
00056
00057
00058
00059 ChooseDlg::~ChooseDlg()
00060 {}
00061
00062 void ChooseDlg::setList(const QPtrList<IndexTreeData> *list)
00063 {
00064 QListViewItem *lvi;
00065 IndexTreeData *itd;
00066 QPtrListIterator<IndexTreeData> ptrListIterator( *list );
00067
00068 while( ptrListIterator.current() )
00069 {
00070 itd = static_cast<IndexTreeData *>(ptrListIterator.current());
00071 lvi = new QListViewItem(lv, itd->parent(), itd->fileName());
00072
00073 ++ptrListIterator;
00074 }
00075 }
00076
00077 void ChooseDlg::slotItemExecuted(QListViewItem *item)
00078 {
00079 if(item == 0) return;
00080
00081 m_part->partController()->showDocument(KURL( item->text(1) ));
00082 m_part->mainWindow()->lowerView(this);
00083
00084 close();
00085 }
00086
00087 #include "choosedlg.moc"
This file is part of the documentation for KDevelop Version 3.1.2.