summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-03-13 20:41:07 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-03-13 20:48:49 +0000
commit534425bfcd4c1ac08c780f417b1dd99baeac99b0 (patch)
tree1bd69a5f4912afef2096cf8a5760e5a966ab2842 /extensions
parent0a508c70745a9c8074878015a0300763f7265399 (diff)
convert new data type dialog to .ui
Change-Id: Ia354e003903c20435947e82afa293a34a367773a
Diffstat (limited to 'extensions')
-rw-r--r--extensions/AllLangResTarget_pcr.mk1
-rw-r--r--extensions/UIConfig_spropctrlr.mk1
-rw-r--r--extensions/source/propctrlr/formresid.hrc1
-rw-r--r--extensions/source/propctrlr/newdatatype.cxx21
-rw-r--r--extensions/source/propctrlr/newdatatype.hrc32
-rw-r--r--extensions/source/propctrlr/newdatatype.hxx18
-rw-r--r--extensions/source/propctrlr/newdatatype.src69
-rw-r--r--extensions/uiconfig/spropctrlr/ui/datatypedialog.ui110
8 files changed, 125 insertions, 128 deletions
diff --git a/extensions/AllLangResTarget_pcr.mk b/extensions/AllLangResTarget_pcr.mk
index e6d54956dcf4..3548617e3711 100644
--- a/extensions/AllLangResTarget_pcr.mk
+++ b/extensions/AllLangResTarget_pcr.mk
@@ -30,7 +30,6 @@ $(eval $(call gb_SrsTarget_add_files,pcr/res,\
extensions/source/propctrlr/pcrmiscres.src \
extensions/source/propctrlr/selectlabeldialog.src \
extensions/source/propctrlr/formlinkdialog.src \
- extensions/source/propctrlr/newdatatype.src \
))
$(eval $(call gb_SrsTarget_add_nonlocalizable_files,pcr/res,\
diff --git a/extensions/UIConfig_spropctrlr.mk b/extensions/UIConfig_spropctrlr.mk
index 318666867459..26c84f168760 100644
--- a/extensions/UIConfig_spropctrlr.mk
+++ b/extensions/UIConfig_spropctrlr.mk
@@ -11,6 +11,7 @@ $(eval $(call gb_UIConfig_UIConfig,modules/spropctrlr))
$(eval $(call gb_UIConfig_add_uifiles,modules/spropctrlr,\
extensions/uiconfig/spropctrlr/ui/controlfontdialog \
+ extensions/uiconfig/spropctrlr/ui/datatypedialog \
extensions/uiconfig/spropctrlr/ui/taborder \
))
diff --git a/extensions/source/propctrlr/formresid.hrc b/extensions/source/propctrlr/formresid.hrc
index e5260bf9746e..befc4fc3911e 100644
--- a/extensions/source/propctrlr/formresid.hrc
+++ b/extensions/source/propctrlr/formresid.hrc
@@ -281,7 +281,6 @@
#define RID_DLG_TABORDER ( RID_PROPCONTROLLER_START + 1 )
#define RID_DLG_FORMLINKS ( RID_PROPCONTROLLER_START + 2 )
#define RID_DLG_SELECTION ( RID_PROPCONTROLLER_START + 3 )
-#define RID_DLG_NEW_DATA_TYPE ( RID_PROPCONTROLLER_START + 4 )
// - ImageLists
diff --git a/extensions/source/propctrlr/newdatatype.cxx b/extensions/source/propctrlr/newdatatype.cxx
index 28c95cbb4036..43638d7f103c 100644
--- a/extensions/source/propctrlr/newdatatype.cxx
+++ b/extensions/source/propctrlr/newdatatype.cxx
@@ -18,12 +18,9 @@
*/
#include "newdatatype.hxx"
-#include "newdatatype.hrc"
-
#include "modulepcr.hxx"
#include "formresid.hrc"
-
namespace pcr
{
@@ -33,16 +30,14 @@ namespace pcr
NewDataTypeDialog::NewDataTypeDialog( Window* _pParent, const OUString& _rNameBase, const ::std::vector< OUString >& _rProhibitedNames )
- :ModalDialog( _pParent, PcrRes( RID_DLG_NEW_DATA_TYPE ) )
- ,m_aLabel ( this, PcrRes( FT_LABEL ) )
- ,m_aName ( this, PcrRes( ED_NAME ) )
- ,m_aOK ( this, PcrRes( PB_OK ) )
- ,m_aCancel ( this, PcrRes( PB_CANCEL ) )
- ,m_aProhibitedNames( _rProhibitedNames.begin(), _rProhibitedNames.end() )
+ : ModalDialog( _pParent, "DataTypeDialog",
+ "modules/spropctrlr/ui/datatypedialog.ui" )
+ , m_aProhibitedNames( _rProhibitedNames.begin(), _rProhibitedNames.end() )
{
- FreeResource();
+ get(m_pName, "entry");
+ get(m_pOK, "ok");
- m_aName.SetModifyHdl( LINK( this, NewDataTypeDialog, OnNameModified ) );
+ m_pName->SetModifyHdl( LINK( this, NewDataTypeDialog, OnNameModified ) );
// find an initial name
// for this, first remove trailing digits
@@ -68,7 +63,7 @@ namespace pcr
}
while ( m_aProhibitedNames.find( sInitialName ) != m_aProhibitedNames.end() );
- m_aName.SetText( sInitialName );
+ m_pName->SetText( sInitialName );
OnNameModified( NULL );
}
@@ -79,7 +74,7 @@ namespace pcr
bool bNameIsOK = ( !sCurrentName.isEmpty() )
&& ( m_aProhibitedNames.find( sCurrentName ) == m_aProhibitedNames.end() );
- m_aOK.Enable( bNameIsOK );
+ m_pOK->Enable( bNameIsOK );
return 0L;
}
diff --git a/extensions/source/propctrlr/newdatatype.hrc b/extensions/source/propctrlr/newdatatype.hrc
deleted file mode 100644
index d79582286b8a..000000000000
--- a/extensions/source/propctrlr/newdatatype.hrc
+++ /dev/null
@@ -1,32 +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 EXTENSIONS_SOURCE_PROPCTRLR_NEWDATATYPE_HRC
-#define EXTENSIONS_SOURCE_PROPCTRLR_NEWDATATYPE_HRC
-
-#define FT_LABEL 1
-
-#define ED_NAME 2
-
-#define PB_OK 1
-#define PB_CANCEL 2
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/propctrlr/newdatatype.hxx b/extensions/source/propctrlr/newdatatype.hxx
index 3d895ca9edef..5c83d6989ea7 100644
--- a/extensions/source/propctrlr/newdatatype.hxx
+++ b/extensions/source/propctrlr/newdatatype.hxx
@@ -31,26 +31,20 @@
namespace pcr
{
-
-
-
//= NewDataTypeDialog
-
class NewDataTypeDialog : public ModalDialog
{
private:
- FixedText m_aLabel;
- Edit m_aName;
- OKButton m_aOK;
- CancelButton m_aCancel;
+ Edit* m_pName;
+ OKButton* m_pOK;
- ::std::set< OUString >
- m_aProhibitedNames;
+ ::std::set< OUString > m_aProhibitedNames;
public:
- NewDataTypeDialog( Window* _pParent, const OUString& _rNameBase, const ::std::vector< OUString >& _rProhibitedNames );
+ NewDataTypeDialog(Window* _pParent, const OUString& _rNameBase,
+ const ::std::vector< OUString >& _rProhibitedNames );
- inline OUString GetName() const { return m_aName.GetText(); }
+ OUString GetName() const { return m_pName->GetText(); }
private:
DECL_LINK( OnNameModified, void* );
diff --git a/extensions/source/propctrlr/newdatatype.src b/extensions/source/propctrlr/newdatatype.src
deleted file mode 100644
index 1aaaa0be44e4..000000000000
--- a/extensions/source/propctrlr/newdatatype.src
+++ /dev/null
@@ -1,69 +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 .
- */
-
-#include "formresid.hrc"
-#include "newdatatype.hrc"
-
-#define DIALOG_WIDTH 150
-#define DIALOG_HEIGHT 55
-#define BUTTON_WIDTH 50
-#define BUTTON_HEIGHT 14
-
-ModalDialog RID_DLG_NEW_DATA_TYPE
-{
- HelpID = "extensions:ModalDialog:RID_DLG_NEW_DATA_TYPE";
- OutputSize = TRUE ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( DIALOG_WIDTH, DIALOG_HEIGHT ) ;
-
- Text [ en-US ] = "New Data Type";
-
- FixedText FT_LABEL
- {
- Pos = MAP_APPFONT( 6, 6 );
- Size = MAP_APPFONT( DIALOG_WIDTH - 2 * 6, 8 );
-
- Text [ en-US ] = "Type a name for the new data type:";
- };
-
- Edit ED_NAME
- {
- HelpID = "extensions:Edit:RID_DLG_NEW_DATA_TYPE:ED_NAME";
- Pos = MAP_APPFONT( 6, 17 );
- Size = MAP_APPFONT( DIALOG_WIDTH - 2 * 6, 12 );
- Border = TRUE;
- };
-
- OKButton PB_OK
- {
- Pos = MAP_APPFONT( DIALOG_WIDTH - 6 - BUTTON_WIDTH - 3 - BUTTON_WIDTH, 35 );
- Size = MAP_APPFONT( BUTTON_WIDTH, BUTTON_HEIGHT );
- DefButton = TRUE;
- };
-
- CancelButton PB_CANCEL
- {
- Pos = MAP_APPFONT( DIALOG_WIDTH - 6 - BUTTON_WIDTH, 35 );
- Size = MAP_APPFONT( BUTTON_WIDTH, BUTTON_HEIGHT );
- };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/uiconfig/spropctrlr/ui/datatypedialog.ui b/extensions/uiconfig/spropctrlr/ui/datatypedialog.ui
new file mode 100644
index 000000000000..3508d2d67fc7
--- /dev/null
+++ b/extensions/uiconfig/spropctrlr/ui/datatypedialog.ui
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <object class="GtkDialog" id="DataTypeDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">New Data Type</property>
+ <property name="type_hint">normal</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>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">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">1</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="GtkGrid" id="grid2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">start</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="label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Type a name for the new data type:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">entry</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="GtkEntry" id="entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="invisible_char">•</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>
+ <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-widget response="0">cancel</action-widget>
+ </action-widgets>
+ </object>
+</interface>