From b82f42d8cf43db14a13a8a064873884fafc2deb1 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Mon, 14 Jan 2013 22:21:11 +0000 Subject: When the user is editing text or selecting from a combo box, don't immediately close the dialog if he or she presses the escape or enter keys. Revert the value if the user presses escape. Properly handle the base for uint preferences. Fix a NULL pointer dereference. Add a gchar_free_to_qstring utility routine which creates a QString from a g_malloced string and frees it. svn path=/trunk/; revision=47083 --- ui/qt/preferences_dialog.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ui/qt/preferences_dialog.h') diff --git a/ui/qt/preferences_dialog.h b/ui/qt/preferences_dialog.h index 981378ea17..b00b60d4a1 100644 --- a/ui/qt/preferences_dialog.h +++ b/ui/qt/preferences_dialog.h @@ -35,6 +35,7 @@ #include #include +#include namespace Ui { class PreferencesDialog; @@ -50,17 +51,25 @@ public: protected: void showEvent(QShowEvent *evt); + void keyPressEvent(QKeyEvent *evt); private: void updateItem(QTreeWidgetItem &item); Ui::PreferencesDialog *pd_ui_; + int cur_pref_type_; + QLineEdit *cur_line_edit_; + QString saved_string_pref_; + QComboBox *cur_combo_box_; + int saved_combo_idx_; // QHash pref_item_hash_; private slots: void on_prefsTree_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous); void on_advancedSearchLineEdit_textEdited(const QString &search_str); void on_advancedTree_itemActivated(QTreeWidgetItem *item, int column); + void lineEditPrefDestroyed(); + void enumPrefDestroyed(); void uintPrefEditingFinished(); void enumPrefCurrentIndexChanged(int index); void stringPrefEditingFinished(); -- cgit v1.2.3