diff options
Diffstat (limited to 'konq-plugins/rsync/rsyncconfigdialog.cpp')
-rw-r--r-- | konq-plugins/rsync/rsyncconfigdialog.cpp | 162 |
1 files changed, 162 insertions, 0 deletions
diff --git a/konq-plugins/rsync/rsyncconfigdialog.cpp b/konq-plugins/rsync/rsyncconfigdialog.cpp new file mode 100644 index 0000000..f990fc8 --- /dev/null +++ b/konq-plugins/rsync/rsyncconfigdialog.cpp @@ -0,0 +1,162 @@ +/* + Copyright (C) 2000, 2001, 2002 Dawit Alemayehu <[email protected]> + + 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 <unistd.h> +#include <sys/types.h> +#include <signal.h> +#include <sys/socket.h> +#include <sys/un.h> +#include <errno.h> +#include <sys/time.h> +#include <sys/resource.h> +#include <sys/ioctl.h> +#include <sys/stat.h> +#include <fcntl.h> + +#define HAVE_TERMIOS_H 1 +#define HAVE_GRANTPT 1 + +#include <stdlib.h> +#ifdef HAVE_PTY_H +#include <pty.h> +#endif +#ifdef HAVE_TERMIOS_H +#include <termios.h> +#endif +#ifdef HAVE_STROPTS +#include <stropts.h> +#endif +#ifdef HAVE_SYS_IOCTL_H +#include <sys/ioctl.h> +#endif +#ifdef HAVE_LIBUTIL_H +#include <libutil.h> +#endif +#ifdef HAVE_UTIL_H +#include <util.h> +#endif + +#include <qfile.h> +#include <qtimer.h> +#include <qapplication.h> +#include <qpushbutton.h> +#include <qhbox.h> +#include <qwhatsthis.h> +#include <qiconview.h> +#include <qpainter.h> +#include <qpixmap.h> +#include <qlabel.h> +#include <qlayout.h> +#include <qpushbutton.h> +#include <qstring.h> +#include <qregexp.h> +#include <qstyle.h> +#include <qtimer.h> +#include <qgroupbox.h> +#include <qradiobutton.h> +#include <qbuttongroup.h> + +#include <kdebug.h> +#include <klocale.h> +#include <kinstance.h> + +#include <kwin.h> +#include <kaction.h> +#include <kpopupmenu.h> +#include <kmessagebox.h> +#include <kiconloader.h> +#include <kprogressbox.h> +#include <kpassdlg.h> +#include <klistview.h> +#include <kapplication.h> +#include <kconfigdialog.h> + +#include <kdirlister.h> +#include <kstandarddirs.h> +#include <klistviewsearchline.h> +#include <kiconviewsearchline.h> +#include <konq_dirpart.h> +#include <konq_propsview.h> +#include <kstaticdeleter.h> +#include <kgenericfactory.h> +#include <kparts/browserextension.h> + +#include "rsyncconfigdialog.h" + +/* + * RsyncConfigDialog implementation + */ +RsyncConfigDialog::RsyncConfigDialog(QWidget* parent, const char* name, + const QString& caption, const QString& text, + const QString& localfolder, const QString& remotefolder, + bool modal) + : KDialogBase(KDialogBase::Plain, caption, KDialogBase::Cancel | KDialogBase::Ok, + KDialogBase::Ok, parent, name, modal), + mAutoClose(true), + mAutoReset(false), + mCancelled(false), + mAllowCancel(true), + mAllowTextEdit(false), + mShown(false) +{ +#ifdef Q_WS_X11 + KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); +#endif + mShowTimer = new QTimer(this); + + showButton(KDialogBase::Close, false); + mCancelText = actionButton(KDialogBase::Cancel)->text(); + + QFrame* mainWidget = plainPage(); + QVBoxLayout* layout = new QVBoxLayout(mainWidget, 10); + mLabel = new QLabel(QString("<b>") + text + QString("</b><br>Setting up synchronization for local folder<br><i>") + localfolder, mainWidget); + layout->addWidget(mLabel); + + // Create an exclusive button group + QButtonGroup *layoutg = new QButtonGroup( 1, QGroupBox::Horizontal, "Synchronization Method:", mainWidget); + layout->addWidget( layoutg ); + layoutg->setExclusive( TRUE ); + + // Insert radiobuttons + QRadioButton *rsync_rb = new QRadioButton("&Utilize rsync + ssh\nExample: servername:/path/to/remote/folder", layoutg); + rsync_rb->setChecked( TRUE ); + //(void)new QRadioButton( "R&adiobutton 2", layoutg ); + //(void)new QRadioButton( "Ra&diobutton 3", layoutg ); + + // Create an exclusive button group + QButtonGroup *layoutm = new QButtonGroup( 1, QGroupBox::Horizontal, "Remote Folder:", mainWidget); + layout->addWidget( layoutm ); + layoutg->setExclusive( TRUE ); + + m_rsync_txt = new QLineEdit(layoutm); + if (remotefolder.isEmpty() == false) { + m_rsync_txt->setText(remotefolder); + } + m_rsync_txt->setFocus(); +} + +QLineEdit* RsyncConfigDialog::lineEdit() +{ + return m_rsync_txt; +} + +const QLineEdit* RsyncConfigDialog::lineEdit() const +{ + return m_rsync_txt; +} + +#include "rsyncconfigdialog.moc" |