/* Copyright (C) 2000, 2001, 2002 Dawit Alemayehu This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #define HAVE_TERMIOS_H 1 #define HAVE_GRANTPT 1 #include #ifdef HAVE_PTY_H #include #endif #ifdef HAVE_TERMIOS_H #include #endif #ifdef HAVE_STROPTS #include #endif #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_LIBUTIL_H #include #endif #ifdef HAVE_UTIL_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "rsyncconfigdialog.h" /* * RsyncConfigDialog implementation */ RsyncConfigDialog::RsyncConfigDialog(TQWidget* tqparent, const char* name, const TQString& caption, const TQString& text, const TQString& localfolder, const TQString& remotefolder, int syncmode, bool modal) : KDialogBase(KDialogBase::Plain, caption, KDialogBase::Cancel | KDialogBase::Ok, KDialogBase::Ok, tqparent, name, modal), mAutoClose(true), mAutoReset(false), mCancelled(false), mAllowCancel(true), mAllowTextEdit(false), mShown(false) { #ifdef TQ_WS_X11 KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); #endif mShowTimer = new TQTimer(this); showButton(KDialogBase::Close, false); mCancelText = actionButton(KDialogBase::Cancel)->text(); TQFrame* mainWidget = plainPage(); TQVBoxLayout* tqlayout = new TQVBoxLayout(mainWidget, 10); mLabel = new TQLabel(TQString("") + text + TQString("
")+i18n("Setting up synchronization for local folder")+TQString("
") + localfolder, mainWidget); tqlayout->addWidget(mLabel); // Create an exclusive button group TQButtonGroup *tqlayoutg = new TQButtonGroup( 1, Qt::Horizontal, i18n("Synchronization Method")+TQString(":"), mainWidget); tqlayout->addWidget( tqlayoutg ); tqlayoutg->setExclusive( TRUE ); // Insert radiobuttons rsync_rb1 = new TQRadioButton(i18n("&Utilize rsync + ssh for upload to remote server\nExample: servername:/path/to/remote/folder"), tqlayoutg); rsync_rb2 = new TQRadioButton(i18n("&Utilize rsync + ssh for download from remote server\nExample: servername:/path/to/remote/folder"), tqlayoutg); rsync_rb3 = new TQRadioButton(i18n("&Utilize unison + ssh for bidirectional synchronization with remote server\nExample: ssh://servername//path/to/remote/folder"), tqlayoutg); if (syncmode == 1) rsync_rb1->setChecked( TRUE ); else if (syncmode == 2) rsync_rb2->setChecked( TRUE ); else if (syncmode == 3) rsync_rb3->setChecked( TRUE ); //(void)new TQRadioButton( "R&adiobutton 2", tqlayoutg ); //(void)new TQRadioButton( "Ra&diobutton 3", tqlayoutg ); // Create an exclusive button group TQButtonGroup *tqlayoutm = new TQButtonGroup( 1, Qt::Horizontal, i18n("Remote Folder")+TQString(":"), mainWidget); tqlayout->addWidget( tqlayoutm ); tqlayoutg->setExclusive( TRUE ); m_rsync_txt = new TQLineEdit(tqlayoutm); if (remotefolder.isEmpty() == false) { m_rsync_txt->setText(remotefolder); } m_rsync_txt->setFocus(); } int RsyncConfigDialog::getSyncMode() { if (rsync_rb1->isChecked() == true) return 1; else if (rsync_rb2->isChecked() == true) return 2; else if (rsync_rb3->isChecked() == true) return 3; } TQLineEdit* RsyncConfigDialog::lineEdit() { return m_rsync_txt; } const TQLineEdit* RsyncConfigDialog::lineEdit() const { return m_rsync_txt; } #include "rsyncconfigdialog.moc"