summaryrefslogtreecommitdiff
path: root/dbaccess
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
parent6bf6c90bf28fffcfcec968370325bb4732d228d0 (diff)
convert sql exception dialog to .ui
Change-Id: I57878f8c9fcae09e3904c4e316ffa6277625b960
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/UIConfig_dbaccess.mk1
-rw-r--r--dbaccess/inc/dbaccess_helpid.hrc2
-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
-rw-r--r--dbaccess/uiconfig/ui/sqlexception.ui165
8 files changed, 198 insertions, 148 deletions
diff --git a/dbaccess/UIConfig_dbaccess.mk b/dbaccess/UIConfig_dbaccess.mk
index 2caa8d8086f0..0eafe1281455 100644
--- a/dbaccess/UIConfig_dbaccess.mk
+++ b/dbaccess/UIConfig_dbaccess.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \
dbaccess/uiconfig/ui/savedialog \
dbaccess/uiconfig/ui/specialsettingspage \
dbaccess/uiconfig/ui/sortdialog \
+ dbaccess/uiconfig/ui/sqlexception \
dbaccess/uiconfig/ui/tablesfilterdialog \
dbaccess/uiconfig/ui/tablesfilterpage \
dbaccess/uiconfig/ui/tablesjoindialog \
diff --git a/dbaccess/inc/dbaccess_helpid.hrc b/dbaccess/inc/dbaccess_helpid.hrc
index 99a2a5dc033d..5128e46ec05d 100644
--- a/dbaccess/inc/dbaccess_helpid.hrc
+++ b/dbaccess/inc/dbaccess_helpid.hrc
@@ -144,8 +144,6 @@
#define HID_BROWSER_TABLE_CREATE_DESIGN "DBACCESS_HID_BROWSER_TABLE_CREATE_DESIGN"
#define HID_BROWSER_TABLE_EDIT "DBACCESS_HID_BROWSER_TABLE_EDIT"
#define HID_BROWSER_TABLE_DELETE "DBACCESS_HID_BROWSER_TABLE_DELETE"
-#define HID_SQLERROR_EXCHAIN_ERRORS "DBACCESS_HID_SQLERROR_EXCHAIN_ERRORS"
-#define HID_SQLERROR_EXCHAIN_TEXT "DBACCESS_HID_SQLERROR_EXCHAIN_TEXT"
#define HID_TAB_WIZ_COLUMN_SELECT "DBACCESS_HID_TAB_WIZ_COLUMN_SELECT"
#define HID_TAB_WIZ_TYPE_SELECT "DBACCESS_HID_TAB_WIZ_TYPE_SELECT"
#define HID_TAB_NAMEMATCHING_COLS_AVAIL "DBACCESS_HID_TAB_NAMEMATCHING_COLS_AVAIL"
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
diff --git a/dbaccess/uiconfig/ui/sqlexception.ui b/dbaccess/uiconfig/ui/sqlexception.ui
new file mode 100644
index 000000000000..fec358597332
--- /dev/null
+++ b/dbaccess/uiconfig/ui/sqlexception.ui
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <object class="GtkDialog" id="SQLExceptionDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">%PRODUCTNAME Base</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Error _list:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">list:border</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Description:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">description:border</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="vscrollbar_policy">always</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="description:border">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="editable">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="svtlo-SvTreeListBox" id="list:border">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Details</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">ok</action-widget>
+ </action-widgets>
+ </object>
+</interface>