[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[vidalia-svn] r3125: Add a method to ControlPasswordInputDialog for hiding the "R (vidalia/trunk/src/vidalia)



Author: edmanm
Date: 2008-09-21 17:21:40 -0400 (Sun, 21 Sep 2008)
New Revision: 3125

Modified:
   vidalia/trunk/src/vidalia/controlpasswordinputdialog.cpp
   vidalia/trunk/src/vidalia/controlpasswordinputdialog.h
Log:
Add a method to ControlPasswordInputDialog for hiding the "Reset" button if we
can't find a running tor.exe.


Modified: vidalia/trunk/src/vidalia/controlpasswordinputdialog.cpp
===================================================================
--- vidalia/trunk/src/vidalia/controlpasswordinputdialog.cpp	2008-09-21 21:20:33 UTC (rev 3124)
+++ vidalia/trunk/src/vidalia/controlpasswordinputdialog.cpp	2008-09-21 21:21:40 UTC (rev 3125)
@@ -41,6 +41,19 @@
   passwordEdited(QString());
 }
 
+void
+ControlPasswordInputDialog::setResetEnabled(bool enabled)
+{
+  if (enabled) {
+    ui.buttonBox->setStandardButtons(ui.buttonBox->standardButtons()
+                                      | QDialogButtonBox::Reset);
+  } else {
+    ui.buttonBox->setStandardButtons(ui.buttonBox->standardButtons()
+                                      & ~QDialogButtonBox::Reset);
+    
+  }
+}
+
 QString
 ControlPasswordInputDialog::password() const
 {

Modified: vidalia/trunk/src/vidalia/controlpasswordinputdialog.h
===================================================================
--- vidalia/trunk/src/vidalia/controlpasswordinputdialog.h	2008-09-21 21:20:33 UTC (rev 3124)
+++ vidalia/trunk/src/vidalia/controlpasswordinputdialog.h	2008-09-21 21:21:40 UTC (rev 3125)
@@ -8,6 +8,13 @@
 **  terms described in the LICENSE file.
 */
 
+/*
+** \file controlpasswordinputdialog.h
+** \version $Id$
+** \brief Prompts the user to enter their control port password, and gives
+** them the option to save or attempt to reset it.
+*/
+
 #include <QDialog>
 #include <QString>
 
@@ -33,6 +40,11 @@
    */
   bool isSavePasswordChecked() const;
 
+  /** If <b>enabled</b> is true, then the "Reset" button will be visible on
+   * the password input dialog. Otherwise, the "Reset" button will be hidden.
+   */
+  void setResetEnabled(bool enabled);
+
 protected slots:
   /** Called when one of the QDialogButtonBox's buttons is clicked. The dialog
    * is closed if <b>button</b> is the "Ok", "Cancel", or "Reset" button, and