55#include < QtCore/QStringListModel>
66#include < QtWidgets/QComboBox>
77#include < QtCore/QTimer>
8- #ifndef BINARYNINJAUI_BINDINGS
9- #include < QtCore/QThread>
10- #endif
118#include " binaryninjaapi.h"
129#include " uitypes.h"
10+ #include " typecompletioncombobox.h"
1311
1412
1513#ifdef BINARYNINJAUI_BINDINGS
@@ -24,30 +22,6 @@ class ParseTypeThread;
2422 \ingroup uiapi
2523*/
2624
27- /* !
28-
29- \ingroup typedialog
30- */
31- class BINARYNINJAUIAPI GetTypesListThread : public QThread
32- {
33- Q_OBJECT
34-
35- QStringList m_allTypes;
36- std::function<void ()> m_completeFunc;
37- std::mutex m_mutex;
38- bool m_done;
39- BinaryNinja::TypeContainer m_typeContainer;
40-
41- protected:
42- virtual void run () override ;
43-
44- public:
45- GetTypesListThread (BinaryNinja::TypeContainer typeContainer, const std::function<void ()>& completeFunc);
46- void cancel ();
47-
48- const QStringList& getTypes () const { return m_allTypes; }
49- };
50-
5125Q_DECLARE_METATYPE (BinaryNinja::QualifiedNameAndType);
5226
5327/* ! QThread subclass for handling type string parsing to avoid UI interruptions.
@@ -80,16 +54,13 @@ class BINARYNINJAUIAPI TypeDialog : public QDialog
8054{
8155 Q_OBJECT
8256
83- QComboBox * m_combo;
57+ TypeCompletionComboBox * m_combo;
8458 QStringListModel* m_model;
8559 QLabel* m_prompt;
8660 QString m_promptText;
8761 std::optional<BinaryNinja::TypeContainer> m_typeContainer;
8862 bool m_resultValid = true ;
8963 bool m_resolved = false ;
90- QStringList m_historyEntries;
91- int m_historySize;
92- GetTypesListThread* m_updateThread = nullptr ;
9364 BinaryNinja::QualifiedNameAndType m_type;
9465 QPushButton* m_acceptButton;
9566 QTimer* m_updateTimer;
@@ -99,7 +70,6 @@ class BINARYNINJAUIAPI TypeDialog : public QDialog
9970 QString m_parseError;
10071
10172 void commitHistory ();
102- void customEvent (QEvent* event);
10373 void saveLocation ();
10474 void reject ();
10575 void accept ();
0 commit comments