summaryrefslogtreecommitdiffstats
path: root/src/customconnectdialog.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-24 11:49:27 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-24 11:49:27 -0500
commitc3f8ee64e905cdb103b5bfa07525fb4e85c31120 (patch)
tree46eabe44a1b3af79971dcafb743a104af8e18e69 /src/customconnectdialog.cpp
downloadkasablanca-c3f8ee64e905cdb103b5bfa07525fb4e85c31120.tar.gz
kasablanca-c3f8ee64e905cdb103b5bfa07525fb4e85c31120.zip
Initial import of kasablanca 0.4.0.2
Diffstat (limited to 'src/customconnectdialog.cpp')
-rwxr-xr-xsrc/customconnectdialog.cpp74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/customconnectdialog.cpp b/src/customconnectdialog.cpp
new file mode 100755
index 0000000..a445780
--- /dev/null
+++ b/src/customconnectdialog.cpp
@@ -0,0 +1,74 @@
+/***************************************************************************
+ customconnectdialog.cpp - description
+ -------------------
+ begin : Mit Aug 20 2003
+ copyright : (C) 2003 by mkulke
+ email : sikor_sxe@radicalapproach.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program 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. *
+ * *
+ ***************************************************************************/
+
+#include <klocale.h>
+
+#include <qstring.h>
+#include <qlineedit.h>
+#include <qradiobutton.h>
+#include <qcombobox.h>
+#include <qcheckbox.h>
+
+#include "kbsiteinfo.h"
+#include "customconnectdialog.h"
+
+CustomConnectDialog::CustomConnectDialog(QWidget *parent, const char *name ) : KDialogBase(parent, name,
+ true, i18n( "Custom Site" ), KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help, KDialogBase::Ok, true)
+{
+ setHelp("ftphelp");
+ mp_dialog = new KasablancaCustomConnectDialog(this);
+ setMainWidget(mp_dialog);
+
+ connect(mp_dialog->AnonymousCheckBox, SIGNAL(toggled(bool)), SLOT(SLOT_AnonymousToggled(bool)));
+}
+
+CustomConnectDialog::~CustomConnectDialog()
+{
+}
+
+void CustomConnectDialog::slotOk()
+{
+ mp_site->SetName(mp_dialog->InfoEdit->text());
+ mp_site->SetInfo(mp_dialog->InfoEdit->text());
+ mp_site->SetUser(mp_dialog->UserLineEdit->text());
+ mp_site->SetPass(mp_dialog->PassLineEdit->text());
+ mp_site->SetTls(mp_dialog->EncryptionComboBox->currentItem());
+ mp_site->SetPasv(mp_dialog->ModeComboBox->currentItem() ^ 1);
+ mp_site->SetDefaultDirectory(mp_dialog->DefaultDirectoryEdit->text());
+ mp_site->SetAlternativeFxp(mp_dialog->AlternativeFxpCheckBox->isOn());
+ mp_site->SetCorrectPasv(mp_dialog->CorrectPasvCheckBox->isOn());
+
+ accept();
+}
+
+void CustomConnectDialog::SLOT_AnonymousToggled(bool on)
+{
+ mp_dialog->UserLineEdit->setEnabled(!on);
+ mp_dialog->PassLineEdit->setEnabled(!on);
+
+ if(on) {
+ m_user = mp_dialog->UserLineEdit->text();
+ m_pass = mp_dialog->PassLineEdit->text();
+ mp_dialog->UserLineEdit->setText("anonymous");
+ mp_dialog->PassLineEdit->setText("some@email.org");
+ }
+ else
+ {
+ mp_dialog->UserLineEdit->setText(m_user);
+ mp_dialog->PassLineEdit->setText(m_pass);
+ }
+}