kitchensync
kspluckerconfigwidget.ui.h
00001 /* 00002 This file is part of KitchenSync. 00003 00004 Copyright (c) 2004 Holger Hans Peter Freyther <freyther@kde.org> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 */ 00020 00021 00022 /**************************************************************************** 00023 ** ui.h extension file, included from the uic-generated form implementation. 00024 ** 00025 ** If you want to add, delete, or rename functions or slots, use 00026 ** Qt Designer to update this file, preserving your code. 00027 ** 00028 ** You should not define a constructor or destructor in this file. 00029 ** Instead, write your code in functions called init() and destroy(). 00030 ** These will automatically be called by the form's constructor and 00031 ** destructor. 00032 *****************************************************************************/ 00033 00034 void KSPluckerConfigWidget::init() 00035 { 00036 urlJava->setMode(KFile::File|KFile::LocalOnly); 00037 urlPlucker->setMode(KFile::Directory|KFile::LocalOnly); 00038 } 00039 00040 void KSPluckerConfigWidget::slotAdd() 00041 { 00042 QString file = KFileDialog::getOpenFileName(QString::null, 00043 "*.xml *.jxl|"+i18n("JPlucker Files")); 00044 00045 /* 00046 * If the Text is Valid and we add it to the ListBox if 00047 * the text is not already present 00048 */ 00049 if(!file.isEmpty() && !lstBoxFiles->findItem(file) ) 00050 lstBoxFiles->insertItem(file, 0); 00051 } 00052 00053 00054 void KSPluckerConfigWidget::slotRemove() 00055 { 00056 lstBoxFiles->removeItem( lstBoxFiles->currentItem() ); 00057 } 00058 00059 00060 void KSPluckerConfigWidget::slotConfigOk() 00061 { 00062 KSPlucker::PluckerConfig *conf = KSPlucker::PluckerConfig::self(); 00063 00064 conf->setJavaPath( urlJava->url() ); 00065 conf->setPluckerPath( urlPlucker->url() ); 00066 00067 QStringList lst; 00068 for ( uint i = 0; i < lstBoxFiles->count(); ++i ) 00069 lst.append( lstBoxFiles->text( i ) ); 00070 00071 conf->setPluckerFiles( lst ); 00072 } 00073 00074 void KSPluckerConfigWidget::readConfig() 00075 { 00076 KSPlucker::PluckerConfig *conf = KSPlucker::PluckerConfig::self(); 00077 00078 urlJava->setURL( conf->javaPath() ); 00079 urlPlucker->setURL( conf->pluckerPath() ); 00080 lstBoxFiles->insertStringList( conf->pluckerFiles() ); 00081 00082 } 00083 00084 void KSPluckerConfigWidget::slotConfigureJXL() 00085 { 00086 QString file = lstBoxFiles->currentText(); 00087 if ( file.isEmpty() ) 00088 return; 00089 00090 KSPlucker::PluckerProcessHandler p( KSPlucker::PluckerProcessHandler::Configure, true, file); 00091 p.run(); 00092 }