summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-04-01 12:53:24 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-04-01 13:10:50 +0100
commita9dc79b35d446a966c4d18c1d23478213af58d93 (patch)
tree23efcb0f582ddb378890ea100211a55833c92b17 /dbaccess/source/ui
parent6bf6c90bf28fffcfcec968370325bb4732d228d0 (diff)
convert sql exception dialog to .ui
Change-Id: I57878f8c9fcae09e3904c4e316ffa6277625b960
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r--dbaccess/source/ui/dlg/sqlmessage.cxx59
-rw-r--r--dbaccess/source/ui/dlg/sqlmessage.hrc44
-rw-r--r--dbaccess/source/ui/dlg/sqlmessage.src69
-rw-r--r--dbaccess/source/ui/inc/dbu_dlg.hrc4
-rw-r--r--dbaccess/source/ui/inc/dbu_resource.hrc2
5 files changed, 32 insertions, 146 deletions
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx
index b66c0a59a8f5..efda8331ae51 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.cxx
+++ b/dbaccess/source/ui/dlg/sqlmessage.cxx
@@ -19,7 +19,6 @@
#include "sqlmessage.hxx"
#include "dbu_dlg.hrc"
-#include "sqlmessage.hrc"
#include <com/sun/star/sdbc/SQLException.hpp>
#include <com/sun/star/sdb/SQLContext.hpp>
#include <vcl/fixed.hxx>
@@ -293,12 +292,8 @@ namespace
class OExceptionChainDialog : public ModalDialog
{
- FixedLine m_aFrame;
- FixedText m_aListLabel;
- SvTreeListBox m_aExceptionList;
- FixedText m_aDescLabel;
- MultiLineEdit m_aExceptionText;
- OKButton m_aOK;
+ SvTreeListBox* m_pExceptionList;
+ VclMultiLineEdit* m_pExceptionText;
OUString m_sStatusLabel;
OUString m_sErrorCodeLabel;
@@ -307,36 +302,34 @@ class OExceptionChainDialog : public ModalDialog
public:
OExceptionChainDialog( Window* pParent, const ExceptionDisplayChain& _rExceptions );
- ~OExceptionChainDialog();
protected:
DECL_LINK(OnExceptionSelected, void*);
};
-OExceptionChainDialog::OExceptionChainDialog( Window* pParent, const ExceptionDisplayChain& _rExceptions )
- :ModalDialog(pParent, ModuleRes(DLG_SQLEXCEPTIONCHAIN))
- ,m_aFrame (this, ModuleRes(FL_DETAILS))
- ,m_aListLabel (this, ModuleRes(FT_ERRORLIST))
- ,m_aExceptionList (this, ModuleRes(CTL_ERRORLIST))
- ,m_aDescLabel (this, ModuleRes(FT_DESCRIPTION))
- ,m_aExceptionText (this, ModuleRes(ME_DESCRIPTION))
- ,m_aOK (this, ModuleRes(PB_OK))
- ,m_aExceptions( _rExceptions )
+OExceptionChainDialog::OExceptionChainDialog(Window* pParent, const ExceptionDisplayChain& _rExceptions)
+ : ModalDialog(pParent, "SQLExceptionDialog", "dbaccess/ui/sqlexception.ui")
+ , m_aExceptions(_rExceptions)
{
+ get(m_pExceptionList, "list");
+ Size aListSize(LogicToPixel(Size(85, 93), MAP_APPFONT));
+ m_pExceptionList->set_width_request(aListSize.Width());
+ m_pExceptionList->set_height_request(aListSize.Height());
+ get(m_pExceptionText, "description");
+ Size aTextSize(LogicToPixel(Size(125 , 93), MAP_APPFONT));
+ m_pExceptionText->set_width_request(aTextSize.Width());
+ m_pExceptionText->set_height_request(aTextSize.Height());
m_sStatusLabel = ModuleRes( STR_EXCEPTION_STATUS );
m_sErrorCodeLabel = ModuleRes( STR_EXCEPTION_ERRORCODE );
- FreeResource();
+ m_pExceptionList->SetSelectionMode(SINGLE_SELECTION);
+ m_pExceptionList->SetDragDropMode(0);
+ m_pExceptionList->EnableInplaceEditing(false);
+ m_pExceptionList->SetStyle(m_pExceptionList->GetStyle() | WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL);
- m_aExceptionList.SetSelectionMode(SINGLE_SELECTION);
- m_aExceptionList.SetDragDropMode(0);
- m_aExceptionList.EnableInplaceEditing(false);
- m_aExceptionList.SetStyle(m_aExceptionList.GetStyle() | WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL);
-
- m_aExceptionList.SetSelectHdl(LINK(this, OExceptionChainDialog, OnExceptionSelected));
- m_aExceptionList.SetNodeDefaultImages( );
- m_aExceptionText.SetReadOnly(true);
+ m_pExceptionList->SetSelectHdl(LINK(this, OExceptionChainDialog, OnExceptionSelected));
+ m_pExceptionList->SetNodeDefaultImages( );
bool bHave22018 = false;
size_t elementPos = 0;
@@ -346,7 +339,7 @@ OExceptionChainDialog::OExceptionChainDialog( Window* pParent, const ExceptionDi
++loop, ++elementPos
)
{
- lcl_insertExceptionEntry( m_aExceptionList, elementPos, *loop );
+ lcl_insertExceptionEntry( *m_pExceptionList, elementPos, *loop );
bHave22018 = loop->sSQLState.equalsAscii( "22018" );
}
@@ -362,18 +355,14 @@ OExceptionChainDialog::OExceptionChainDialog( Window* pParent, const ExceptionDi
aInfo22018.pImageProvider = aProviderFactory.getImageProvider( SQLExceptionInfo::SQL_CONTEXT );
m_aExceptions.push_back( aInfo22018 );
- lcl_insertExceptionEntry( m_aExceptionList, m_aExceptions.size() - 1, aInfo22018 );
+ lcl_insertExceptionEntry( *m_pExceptionList, m_aExceptions.size() - 1, aInfo22018 );
}
}
-OExceptionChainDialog::~OExceptionChainDialog()
-{
-}
-
IMPL_LINK_NOARG(OExceptionChainDialog, OnExceptionSelected)
{
- SvTreeListEntry* pSelected = m_aExceptionList.FirstSelected();
- OSL_ENSURE(!pSelected || !m_aExceptionList.NextSelected(pSelected), "OExceptionChainDialog::OnExceptionSelected : multi selection ?");
+ SvTreeListEntry* pSelected = m_pExceptionList->FirstSelected();
+ OSL_ENSURE(!pSelected || !m_pExceptionList->NextSelected(pSelected), "OExceptionChainDialog::OnExceptionSelected : multi selection ?");
OUString sText;
@@ -404,7 +393,7 @@ IMPL_LINK_NOARG(OExceptionChainDialog, OnExceptionSelected)
sText += aExceptionInfo.sMessage;
}
- m_aExceptionText.SetText(sText);
+ m_pExceptionText->SetText(sText);
return 0L;
}
diff --git a/dbaccess/source/ui/dlg/sqlmessage.hrc b/dbaccess/source/ui/dlg/sqlmessage.hrc
deleted file mode 100644
index 92b3270946ae..000000000000
--- a/dbaccess/source/ui/dlg/sqlmessage.hrc
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _DBAUI_SQLMESSAGE_HRC_
-#define _DBAUI_SQLMESSAGE_HRC_
-
-#define FT_ERRORLIST 1
-#define FT_DESCRIPTION 2
-
-#define ED_TEXT 1
-
-#define FL_DATA 1
-
-#define FL_DETAILS 1
-
-#define PB_OK 1
-#define PB_CANCEL 2
-
-#define CTL_ERRORLIST 1
-
-#define ME_DESCRIPTION 1
-
-#define STR_EXCEPTION_STATUS 1
-#define STR_EXCEPTION_ERRORCODE 2
-
-#endif // _DBAUI_SQLMESSAGE_HRC_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/dlg/sqlmessage.src b/dbaccess/source/ui/dlg/sqlmessage.src
index ba0b9ece4426..978f7d79435c 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.src
+++ b/dbaccess/source/ui/dlg/sqlmessage.src
@@ -19,8 +19,6 @@
#include "dbaccess_helpid.hrc"
#include "dbu_dlg.hrc"
-#include "sqlmessage.hrc"
-
Image BMP_EXCEPTION_ERROR
{
@@ -40,69 +38,14 @@ Image BMP_EXCEPTION_INFO
MaskColor = Color { Red = 0xff00 ; Green = 0x0000 ; Blue = 0xff00 ; };
};
-ModalDialog DLG_SQLEXCEPTIONCHAIN
+String STR_EXCEPTION_STATUS
{
- HelpID = "dbaccess:ModalDialog:DLG_SQLEXCEPTIONCHAIN";
- Moveable = TRUE ;
- Closeable = TRUE ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 240 , 150 ) ;
- Text [ en-US ] = "%PRODUCTNAME Base" ;
-
- FixedLine FL_DETAILS
- {
- Pos = MAP_APPFONT ( 6, 3 ) ;
- Size = MAP_APPFONT ( 228, 8 ) ;
- Text [ en-US ] = "Details";
- };
- FixedText FT_ERRORLIST
- {
- Pos = MAP_APPFONT ( 12, 12 ) ;
- Size = MAP_APPFONT ( 85, 10 ) ;
- Text [ en-US ] = "Error ~list:";
- Group = TRUE;
- };
- Control CTL_ERRORLIST
- {
- Pos = MAP_APPFONT ( 12, 25 ) ;
- Size = MAP_APPFONT ( 85, 93 ) ;
- Border = TRUE;
- TabStop = TRUE;
- HelpId = HID_SQLERROR_EXCHAIN_ERRORS;
- };
- FixedText FT_DESCRIPTION
- {
- Pos = MAP_APPFONT ( 103, 12 ) ;
- Size = MAP_APPFONT ( 125, 10 ) ;
- Text [ en-US ] = "~Description:";
- Group = TRUE;
- };
- MultiLineEdit ME_DESCRIPTION
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 103 , 25 ) ;
- Size = MAP_APPFONT ( 125 , 93 ) ;
- TabStop = TRUE ;
- VScroll = TRUE ;
- HelpId = HID_SQLERROR_EXCHAIN_TEXT;
- };
- OKButton PB_OK
- {
- Pos = MAP_APPFONT ( 95 , 130 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
+ Text [ en-US ] = "SQL Status";
+};
- String STR_EXCEPTION_STATUS
- {
- Text [ en-US ] = "SQL Status";
- };
- String STR_EXCEPTION_ERRORCODE
- {
- Text [ en-US ] = "Error code";
- };
+String STR_EXCEPTION_ERRORCODE
+{
+ Text [ en-US ] = "Error code";
};
String STR_EXPLAN_STRINGCONVERSION_ERROR
diff --git a/dbaccess/source/ui/inc/dbu_dlg.hrc b/dbaccess/source/ui/inc/dbu_dlg.hrc
index bedbae4b1846..be453354181b 100644
--- a/dbaccess/source/ui/inc/dbu_dlg.hrc
+++ b/dbaccess/source/ui/inc/dbu_dlg.hrc
@@ -96,10 +96,10 @@
#define STR_MSACCESS_MDB_FILE RID_STR_DLG_START + 52
#define STR_COMMONURL RID_STR_DLG_START + 53
#define STR_DATABASEDEFAULTNAME RID_STR_DLG_START + 54
- // FREE
+#define STR_EXCEPTION_ERRORCODE RID_STR_DLG_START + 55
#define STR_NO_ADDITIONAL_SETTINGS RID_STR_DLG_START + 56
#define STR_HOSTNAME RID_STR_DLG_START + 57
- // FREE
+#define STR_EXCEPTION_STATUS RID_STR_DLG_START + 58
#define STR_MOZILLA_PROFILE_NAME RID_STR_DLG_START + 59
#define STR_THUNDERBIRD_PROFILE_NAME RID_STR_DLG_START + 60
#define STR_EXPLAN_STRINGCONVERSION_ERROR RID_STR_DLG_START + 61
diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc
index 589fdaa025f1..61596bf80e68 100644
--- a/dbaccess/source/ui/inc/dbu_resource.hrc
+++ b/dbaccess/source/ui/inc/dbu_resource.hrc
@@ -75,8 +75,6 @@
// dialog ids
-
-#define DLG_SQLEXCEPTIONCHAIN RID_DIALOG_START + 3
#define DLG_PARAMETERS RID_DIALOG_START + 5
#define DLG_JOIN_TABADD RID_DIALOG_START + 14