/* This file is part of the Keep project Copyright (C) 2005 Jean-Rémy Falleri Keep is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Keep is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Keep; if not, write to the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "advancedbackupconfigdialog.h" #include #include #include #include #include #include #include #include #include #include #include #include AdvancedBackupConfigDialog::AdvancedBackupConfigDialog(TQWidget *tqparent):KDialogBase(Plain, i18n("Advanced Backup Configuration"), Help|Ok, Ok, tqparent, "advancedBackupConfigDialog", true, false) { TQGridLayout *topLayout = new TQGridLayout(plainPage()); m_advancedBackupConfigView = new AdvancedBackupConfigView(plainPage()); topLayout->addWidget( m_advancedBackupConfigView,0,0 ); m_advancedBackupConfigView->optionList->availableListBox()->insertStringList(allOptionList()); resize( TQSize(350,450).expandedTo(tqminimumSizeHint()) ); } TQStringList AdvancedBackupConfigDialog::optionList() { TQStringList options; for (uint i=0;ioptionList->selectedListBox()->count();i++) { options.append(m_advancedBackupConfigView->optionList->selectedListBox()->text(i)); } return options; } void AdvancedBackupConfigDialog::setOptionList(TQStringList optionList) { TQStringList alloptions = allOptionList(); TQStringList available; for ( TQStringList::Iterator it = alloptions.begin(); it != alloptions.end(); ++it ) { if ( optionList.grep(*it).size() == 0 ) { available.append(*it); } } m_advancedBackupConfigView->optionList->availableListBox()->clear(); m_advancedBackupConfigView->optionList->availableListBox()->insertStringList(available); m_advancedBackupConfigView->optionList->selectedListBox()->clear(); m_advancedBackupConfigView->optionList->selectedListBox()->insertStringList(optionList); } TQStringList AdvancedBackupConfigDialog::allOptionList() { TQStringList options; options.append("--no-hard-links"); options.append("--exclude-special-files"); options.append("--exclude-device-files"); options.append("--exclude-fifos"); options.append("--exclude-symbolic-links"); options.append("--exclude-sockets"); options.append("--never-drop-acls"); options.append("--no-compare-inode"); options.append("--no-file-statistics"); options.append("--preserve-numerical-ids"); options.append("--ssh-no-compression"); options.append("--no-compression"); options.append("--include-special-files"); options.append("--include-symbolic-links"); return options; } #include "advancedbackupconfigdialog.moc"