File indexing completed on 2024-05-12 17:16:11
0001 /*************************************************************************** 0002 * Copyright (C) 2005-2009 by Rajko Albrecht * 0003 * ral@alwins-world.de * 0004 * * 0005 * This program is free software; you can redistribute it and/or modify * 0006 * it under the terms of the GNU General Public License as published by * 0007 * the Free Software Foundation; either version 2 of the License, or * 0008 * (at your option) any later version. * 0009 * * 0010 * This program is distributed in the hope that it will be useful, * 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0013 * GNU General Public License for more details. * 0014 * * 0015 * You should have received a copy of the GNU General Public License * 0016 * along with this program; if not, write to the * 0017 * Free Software Foundation, Inc., * 0018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 0019 ***************************************************************************/ 0020 #include "importdir_logmsg.h" 0021 0022 #include "svnqt/version_check.h" 0023 0024 #include <KLocalizedString> 0025 #include <QCheckBox> 0026 0027 0028 Importdir_logmsg::Importdir_logmsg(QWidget *parent) 0029 : Commitmsg_impl(parent) 0030 { 0031 m_createDirBox = new QCheckBox(this); 0032 hideKeepsLock(true); 0033 createDirboxDir(); 0034 addItemWidget(m_createDirBox); 0035 m_createDirBox->setChecked(true); 0036 QHBoxLayout *tmpLayout = new QHBoxLayout(); 0037 m_noIgnore = new QCheckBox(this); 0038 m_noIgnore->setText(i18n("No ignore")); 0039 m_noIgnore->setToolTip(i18n("If set, add files or directories that match ignore patterns.")); 0040 tmpLayout->addWidget(m_noIgnore); 0041 //LogmessageDataLayout->addWidget(m_createDirBox); 0042 if (svn::Version::version_major() > 1 || svn::Version::version_minor() > 4) { 0043 m_ignoreUnknownNodes = new QCheckBox(this); 0044 m_ignoreUnknownNodes->setText(i18n("Ignore unknown node types")); 0045 m_ignoreUnknownNodes->setToolTip(i18n("Should files with unknown node types be ignored")); 0046 m_ignoreUnknownNodes->setWhatsThis(i18n("Ignore files of which the node type is unknown, such as device files and pipes.")); 0047 tmpLayout->addWidget(m_ignoreUnknownNodes); 0048 //addItemWidget(m_ignoreUnknownNodes); 0049 } else { 0050 m_ignoreUnknownNodes = nullptr; 0051 } 0052 QSpacerItem *m_leftspacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); 0053 tmpLayout->addItem(m_leftspacer); 0054 if (layout()) { 0055 layout()->addItem(tmpLayout); 0056 } 0057 } 0058 0059 Importdir_logmsg::~Importdir_logmsg() 0060 { 0061 } 0062 0063 bool Importdir_logmsg::noIgnore() 0064 { 0065 return m_noIgnore->isChecked(); 0066 } 0067 0068 bool Importdir_logmsg::ignoreUnknownNodes() 0069 { 0070 return m_ignoreUnknownNodes ? m_ignoreUnknownNodes->isChecked() : false; 0071 } 0072 0073 bool Importdir_logmsg::createDir() 0074 { 0075 return m_createDirBox->isChecked(); 0076 } 0077 0078 void Importdir_logmsg::createDirboxDir(const QString &which) 0079 { 0080 m_createDirBox->setText(i18n("Create subdirectory %1 on import", (which.isEmpty() ? i18n("(Last part)") : which))); 0081 }