summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/inc/directsql.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-09-15 20:18:38 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-09-17 10:04:38 +0200
commit573562e72a5fd85b75006fbc8869c73903a6e504 (patch)
tree866cfff40b7974ab4a9541214a93c104c10f593b /dbaccess/source/ui/inc/directsql.hxx
parenta944d4c2aacafdac78eabd7fb0f8909a66d935eb (diff)
weld DirectSQLDialog
Change-Id: I8f97068bb38a1fb888d60251f8f25506044c8451 Reviewed-on: https://gerrit.libreoffice.org/78970 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess/source/ui/inc/directsql.hxx')
-rw-r--r--dbaccess/source/ui/inc/directsql.hxx53
1 files changed, 37 insertions, 16 deletions
diff --git a/dbaccess/source/ui/inc/directsql.hxx b/dbaccess/source/ui/inc/directsql.hxx
index 03e31bb7e2ec..545d23dd79ad 100644
--- a/dbaccess/source/ui/inc/directsql.hxx
+++ b/dbaccess/source/ui/inc/directsql.hxx
@@ -24,6 +24,7 @@
#include <sal/log.hxx>
#include <vcl/dialog.hxx>
+#include <vcl/weld.hxx>
#include <svtools/editsyntaxhighlighter.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
@@ -34,41 +35,56 @@
#include <unotools/eventlisteneradapter.hxx>
#include <osl/mutex.hxx>
-#include <svtools/editbrowsebox.hxx>
+#include <svx/weldeditview.hxx>
namespace dbaui
{
+ class SQLEditView : public WeldEditView
+ {
+ private:
+ void DoBracketHilight(sal_uInt16 nKey);
+ public:
+ SQLEditView();
+ virtual bool KeyInput(const KeyEvent& rKEvt) override;
+ };
// DirectSQLDialog
class DirectSQLDialog final
- :public ModalDialog
- ,public ::utl::OEventListenerAdapter
+ : public weld::GenericDialogController
+ , public ::utl::OEventListenerAdapter
{
::osl::Mutex m_aMutex;
- VclPtr<MultiLineEditSyntaxHighlight> m_pSQL;
- VclPtr<PushButton> m_pExecute;
- VclPtr<ListBox> m_pSQLHistory;
- VclPtr<VclMultiLineEdit> m_pStatus;
- VclPtr<CheckBox> m_pShowOutput;
- VclPtr<VclMultiLineEdit> m_pOutput;
- VclPtr<PushButton> m_pClose;
+ std::unique_ptr<weld::Button> m_xExecute;
+ std::unique_ptr<weld::ComboBox> m_xSQLHistory;
+ std::unique_ptr<weld::TextView> m_xStatus;
+ std::unique_ptr<weld::CheckButton> m_xShowOutput;
+ std::unique_ptr<weld::TextView> m_xOutput;
+ std::unique_ptr<weld::Button> m_xClose;
+ std::unique_ptr<SQLEditView> m_xSQL;
+ std::unique_ptr<weld::CustomWeld> m_xSQLEd;
+
+ Timer m_aUpdateDataTimer;
+ const SyntaxHighlighter m_aHighlighter;
+ const svtools::ColorConfig m_aColorConfig;
typedef std::deque< OUString > StringQueue;
StringQueue m_aStatementHistory; // previous statements
StringQueue m_aNormalizedHistory; // previous statements, normalized to be used in the list box
sal_Int32 m_nStatusCount;
+ bool m_bInUpdate;
css::uno::Reference< css::sdbc::XConnection >
m_xConnection;
+ ImplSVEvent* m_pClosingEvent;
+
public:
DirectSQLDialog(
- vcl::Window* _pParent,
+ weld::Window* _pParent,
const css::uno::Reference< css::sdbc::XConnection >& _rxConn);
virtual ~DirectSQLDialog() override;
- virtual void dispose() override;
/// number of history entries
sal_Int32 getHistorySize() const;
@@ -77,14 +93,19 @@ namespace dbaui
void executeCurrent();
void switchToHistory(sal_Int32 _nHistoryPos);
+ Color GetColorValue(TokenType aToken);
+
+ void UpdateData();
+
// OEventListenerAdapter
virtual void _disposing( const css::lang::EventObject& _rSource ) override;
- DECL_LINK( OnExecute, Button*, void );
+ DECL_LINK( OnExecute, weld::Button&, void );
DECL_LINK( OnClose, void*, void );
- DECL_LINK( OnCloseClick, Button*, void );
- DECL_LINK( OnListEntrySelected, ListBox&, void );
- DECL_LINK( OnStatementModified, Edit&, void );
+ DECL_LINK( OnCloseClick, weld::Button&, void );
+ DECL_LINK( OnListEntrySelected, weld::ComboBox&, void );
+ DECL_LINK( OnStatementModified, LinkParamNone*, void );
+ DECL_LINK( ImplUpdateDataHdl, Timer*, void );
/// adds a statement to the statement history
void implAddToStatementHistory(const OUString& _rStatement);