Previous server connection history

This adds the ability to select previous servers from a list to connect
to.

You can remove items from the drop down by selecting them and pressing
delete.

If you connect to a new host it will be added to the previous hosts.

It will remember the last host connected to in the dropdown.
This commit is contained in:
Matt Lowe 2015-07-28 00:33:37 +02:00
parent c0bb640a37
commit 1ca24b2597
2 changed files with 105 additions and 13 deletions

View file

@ -7,12 +7,22 @@
class QLabel;
class QPushButton;
class QCheckBox;
class QComboBox;
class QRadioButton;
class DeleteHighlightedItemWhenShiftDelPressedEventFilter : public QObject
{
Q_OBJECT
protected:
bool eventFilter(QObject *obj, QEvent *event);
};
class DlgConnect : public QDialog {
Q_OBJECT
public:
DlgConnect(QWidget *parent = 0);
QString getHost() const { return hostEdit->text(); }
QString getHost() const;
int getPort() const { return portEdit->text().toInt(); }
QString getPlayerName() const { return playernameEdit->text(); }
QString getPassword() const { return passwordEdit->text(); }
@ -20,10 +30,14 @@ private slots:
void actOk();
void actCancel();
void passwordSaved(int state);
void previousHostSelected(bool state);
void newHostSelected(bool state);
private:
QLabel *hostLabel, *portLabel, *playernameLabel, *passwordLabel;
QLineEdit *hostEdit, *portEdit, *playernameEdit, *passwordEdit;
QCheckBox *savePasswordCheckBox, *autoConnectCheckBox;
QComboBox *previousHosts;
QRadioButton *newHostButton, *previousHostButton;
};
#endif