Vidalia 0.2.10
|
00001 /* 00002 ** This file is part of Vidalia, and is subject to the license terms in the 00003 ** LICENSE file, found in the top level directory of this distribution. If you 00004 ** did not receive the LICENSE file with this file, you may obtain it from the 00005 ** Vidalia source package distributed by the Vidalia Project at 00006 ** http://www.vidalia-project.net/. No part of Vidalia, including this file, 00007 ** may be copied, modified, propagated, or distributed except according to the 00008 ** terms described in the LICENSE file. 00009 */ 00010 00011 /* 00012 ** \file ControlPasswordInputDialog.h 00013 ** \version $Id: ControlPasswordInputDialog.h 3735 2009-04-28 20:28:01Z edmanm $ 00014 ** \brief Prompts the user to enter their control port password, and gives 00015 ** them the option to save or attempt to reset it. 00016 */ 00017 00018 #ifndef _CONTROLPASSWORDINPUTDIALOG_H 00019 #define _CONTROLPASSWORDINPUTDIALOG_H 00020 00021 #include "ui_ControlPasswordInputDialog.h" 00022 00023 #include <QDialog> 00024 #include <QString> 00025 00026 00027 class ControlPasswordInputDialog : public QDialog 00028 { 00029 Q_OBJECT 00030 00031 public: 00032 /** Default constructor. 00033 */ 00034 ControlPasswordInputDialog(QWidget *parent = 0); 00035 00036 /** Returns the password entered in the dialog. If the dialog was dismissed 00037 * with the "Cancel" button, then the returned QString will be empty. 00038 */ 00039 QString password() const; 00040 00041 /** Returns true if the "Remember my password" checkbox was checked at the 00042 * time the dialog was dismissed. 00043 */ 00044 bool isSavePasswordChecked() const; 00045 00046 /** If <b>enabled</b> is true, then the "Reset" button will be visible on 00047 * the password input dialog. Otherwise, the "Reset" button will be hidden. 00048 */ 00049 void setResetEnabled(bool enabled); 00050 00051 signals: 00052 /** Emitted when the user clicks on the "Help" dialog button. 00053 */ 00054 void helpRequested(const QString &topic); 00055 00056 protected slots: 00057 /** Called when one of the QDialogButtonBox's buttons is clicked. The dialog 00058 * is closed if <b>button</b> is the "Ok", "Cancel", or "Reset" button, and 00059 * the clicked button's QDialogButtonBox::StandardButton enum value is 00060 * returned as the dialog's result code. 00061 */ 00062 void clicked(QAbstractButton *button); 00063 00064 /** Called when the user changes the password QLineEdit. If the password is 00065 * empty, then the "Ok" button will be disabled. Otherwise, it is enabled. 00066 */ 00067 void passwordEdited(const QString &text); 00068 00069 protected: 00070 /** Adjusts the size of the input dialog when it is displayed. */ 00071 virtual void setVisible(bool visible); 00072 00073 private: 00074 Ui::ControlPasswordInputDialog ui; /**< Qt Designer generated object. */ 00075 }; 00076 00077 #endif 00078