[Chinese-commits] [fqterm] 31/76: quickdialog: set the port to default when portCheck untoggled

Boyuan Yang hosiet-guest at moszumanska.debian.org
Thu Oct 27 03:16:59 UTC 2016


This is an automated email from the git hooks/post-receive script.

hosiet-guest pushed a commit to branch master
in repository fqterm.

commit 60c1e9e08f37c57afe651e213014f50472157e39
Author: Iru Dog <mytbk920423 at gmail.com>
Date:   Wed May 28 23:01:40 2014 +0800

    quickdialog: set the port to default when portCheck untoggled
---
 src/ui/quickdialog.cpp | 12 ++++++++++++
 src/ui/quickdialog.h   |  1 +
 src/ui/quickdialog.ui  | 19 +------------------
 3 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/src/ui/quickdialog.cpp b/src/ui/quickdialog.cpp
index 1ac3888..e54c840 100644
--- a/src/ui/quickdialog.cpp
+++ b/src/ui/quickdialog.cpp
@@ -99,6 +99,18 @@ void quickDialog::connectSlots() {
   FQ_VERIFY(connect(ui_.advPushButton, SIGNAL(clicked()), this, SLOT(onAdvance())));
   FQ_VERIFY(connect(ui_.connectPushButton, SIGNAL(clicked()), this, SLOT(onConnect())));
   FQ_VERIFY(connect(ui_.closePushButton, SIGNAL(clicked()), this, SLOT(onClose())));
+  FQ_VERIFY(connect(ui_.portCheck, SIGNAL(toggled(bool)), this, SLOT(portCheckToggled(bool))));
+}
+
+void quickDialog::portCheckToggled(bool checked)
+{
+  if (checked){
+    ui_.portEdit->setEnabled(true);
+  }else{
+    ui_.portEdit->setEnabled(false);
+    int index = ui_.protocolComboBox->currentIndex();
+    ui_.portEdit->setText(QString("%1").arg(ports[index]));
+  }
 }
 
 void quickDialog::listChanged(int index) {
diff --git a/src/ui/quickdialog.h b/src/ui/quickdialog.h
index bbcae89..35a0e73 100644
--- a/src/ui/quickdialog.h
+++ b/src/ui/quickdialog.h
@@ -51,6 +51,7 @@ class quickDialog: public QDialog {
   void onConnect(); //
   void onClose();
   void onSelectProtocol(int index);
+  void portCheckToggled(bool);
 
  private:
 
diff --git a/src/ui/quickdialog.ui b/src/ui/quickdialog.ui
index dafb87b..03fa6fc 100644
--- a/src/ui/quickdialog.ui
+++ b/src/ui/quickdialog.ui
@@ -186,22 +186,5 @@
   <tabstop>closePushButton</tabstop>
  </tabstops>
  <resources/>
- <connections>
-  <connection>
-   <sender>portCheck</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>portEdit</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>151</x>
-     <y>54</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>203</x>
-     <y>54</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
+ <connections/>
 </ui>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/chinese/fqterm.git



More information about the Chinese-commits mailing list