editcatalogdlg.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 "editcatalogdlg.h" 00021 00022 #include <qlabel.h> 00023 00024 #include <klineedit.h> 00025 #include <kurlrequester.h> 00026 #include <kurlcompletion.h> 00027 00028 #include "docutils.h" 00029 #include "kdevdocumentationplugin.h" 00030 00031 EditCatalogDlg::EditCatalogDlg(DocumentationPlugin *plugin, QWidget* parent, 00032 const char* name, bool modal, WFlags fl) 00033 :EditCatalogBase(parent,name, modal,fl), m_plugin(plugin) 00034 { 00035 if (m_plugin->hasCapability(DocumentationPlugin::CustomDocumentationTitles)) 00036 { 00037 titleLabel->setEnabled(true); 00038 titleEdit->setEnabled(true); 00039 } 00040 locationURL->setMode(m_plugin->catalogLocatorProps().first); 00041 locationURL->setFilter(m_plugin->catalogLocatorProps().second); 00042 } 00043 00044 EditCatalogDlg::~EditCatalogDlg() 00045 { 00046 } 00047 00048 /*$SPECIALIZATION$*/ 00049 void EditCatalogDlg::locationURLChanged(const QString &text) 00050 { 00051 titleEdit->setText(m_plugin->catalogTitle(DocUtils::noEnvURL(text))); 00052 } 00053 00054 void EditCatalogDlg::accept() 00055 { 00056 QDialog::accept(); 00057 } 00058 00059 QString EditCatalogDlg::title() const 00060 { 00061 return titleEdit->text(); 00062 } 00063 00064 QString EditCatalogDlg::url() const 00065 { 00066 return DocUtils::envURL(locationURL); 00067 } 00068 00069 void EditCatalogDlg::setTitle(const QString &title) 00070 { 00071 titleEdit->setText(title); 00072 } 00073 00074 void EditCatalogDlg::setURL(const QString &url) 00075 { 00076 locationURL->setURL(url); 00077 } 00078 00079 #include "editcatalogdlg.moc"