Kaydet (Commit) 77d6f58d authored tarafından Caolán McNamara's avatar Caolán McNamara

convert text import options to .ui

Change-Id: Ice6228f0548507b0400c25f40d8aa7cb557c8088
üst 3b238706
......@@ -99,7 +99,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
sc/source/ui/dbgui/pvfundlg.src \
sc/source/ui/dbgui/dapitype.src \
sc/source/ui/dbgui/imoptdlg.src \
sc/source/ui/dbgui/textimportoptions.src \
sc/source/ui/dbgui/scendlg.src \
sc/source/ui/dbgui/outline.src \
sc/source/ui/dbgui/validate.src \
......
......@@ -11,6 +11,7 @@ $(eval $(call gb_UI_UI,modules/scalc))
$(eval $(call gb_UI_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/printeroptions \
sc/uiconfig/scalc/ui/textimportoptions \
))
# vim: set noet sw=4 ts=4:
......@@ -1084,7 +1084,7 @@
#define RID_SCDLG_TABPROTECTION (SC_DIALOGS_START + 148)
#define RID_SCDLG_RETYPEPASS (SC_DIALOGS_START + 150)
#define RID_SCDLG_RETYPEPASS_INPUT (SC_DIALOGS_START + 151)
#define RID_SCDLG_TEXT_IMPORT_OPTIONS (SC_DIALOGS_START + 152)
#define RID_POPUP_FILTER (SC_DIALOGS_START + 153)
#define RID_SCDLG_TAB_BG_COLOR (SC_DIALOGS_START + 154)
#define RID_SCDLG_DATABAR (SC_DIALOGS_START + 155)
......
......@@ -336,7 +336,7 @@ public:
SvStream* pInStream, int nId,
ScImportAsciiCall eCall) = 0;
virtual AbstractScTextImportOptionsDlg * CreateScTextImportOptionsDlg( Window* pParent, int nId ) = 0;
virtual AbstractScTextImportOptionsDlg * CreateScTextImportOptionsDlg(Window* pParent) = 0;
virtual AbstractScAutoFormatDlg * CreateScAutoFormatDlg( Window* pParent, //add for ScAutoFormatDlg
ScAutoFormat* pAutoFormat,
......
......@@ -668,23 +668,12 @@ AbstractScImportAsciiDlg * ScAbstractDialogFactory_Impl::CreateScImportAsciiDlg
}
// ScImportAsciiDlg end
AbstractScTextImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScTextImportOptionsDlg( Window* pParent, int nId )
AbstractScTextImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScTextImportOptionsDlg(Window* pParent)
{
ScTextImportOptionsDlg* pDlg = NULL;
switch (nId)
{
case RID_SCDLG_TEXT_IMPORT_OPTIONS:
pDlg = new ScTextImportOptionsDlg(pParent);
break;
default:
;
}
return pDlg ? new AbstractScTextImportOptionsDlg_Impl(pDlg) : NULL;
ScTextImportOptionsDlg* pDlg = new ScTextImportOptionsDlg(pParent);
return new AbstractScTextImportOptionsDlg_Impl(pDlg);
}
AbstractScAutoFormatDlg * ScAbstractDialogFactory_Impl::CreateScAutoFormatDlg( Window* pParent,
ScAutoFormat* pAutoFormat,
const ScAutoFormatData* pSelFormatData,
......
......@@ -401,7 +401,7 @@ public:
SvStream* pInStream, int nId,
ScImportAsciiCall eCall);
virtual AbstractScTextImportOptionsDlg * CreateScTextImportOptionsDlg( Window* pParent, int nId );
virtual AbstractScTextImportOptionsDlg * CreateScTextImportOptionsDlg(Window* pParent);
virtual AbstractScAutoFormatDlg * CreateScAutoFormatDlg( Window* pParent, //add for ScAutoFormatDlg
ScAutoFormat* pAutoFormat,
......
......@@ -32,27 +32,18 @@
//------------------------------------------------------------------------
#include "textimportoptions.hxx"
#include "textimportoptions.hrc"
#include "scresid.hxx"
#include "vcl/window.hxx"
#include "vcl/msgbox.hxx"
#include "vcl/svapp.hxx"
#include "vcl/msgbox.hxx"
#include "vcl/window.hxx"
ScTextImportOptionsDlg::ScTextImportOptionsDlg(Window* pParent) :
ModalDialog(pParent, ScResId(RID_SCDLG_TEXT_IMPORT_OPTIONS)),
maBtnOk(this, ScResId(BTN_OK)),
maBtnCancel(this, ScResId(BTN_CANCEL)),
maBtnHelp(this, ScResId(BTN_HELP)),
maFlChooseLang(this, ScResId(FL_CHOOSE_LANG)),
maRbAutomatic(this, ScResId(RB_AUTOMATIC)),
maRbCustom(this, ScResId(RB_CUSTOM)),
maLbCustomLang(this, ScResId(LB_CUSTOM_LANG)),
maFlOption(this, ScResId(FL_OPTION)),
maBtnConvertDate(this, ScResId(BTN_CONVERT_DATE))
ScTextImportOptionsDlg::ScTextImportOptionsDlg(Window* pParent)
: ModalDialog(pParent, "TextImportOptionsDialog", "modules/scalc/ui/textimportoptions.ui")
{
FreeResource();
get(m_pBtnOk, "ok");
get(m_pRbAutomatic, "automatic");
get(m_pRbCustom, "custom");
get(m_pBtnConvertDate, "convertdata");
get(m_pLbCustomLang, "lang");
init();
}
......@@ -67,33 +58,33 @@ short ScTextImportOptionsDlg::Execute()
LanguageType ScTextImportOptionsDlg::getLanguageType() const
{
if (maRbAutomatic.IsChecked())
if (m_pRbAutomatic->IsChecked())
return LANGUAGE_SYSTEM;
return maLbCustomLang.GetSelectLanguage();
return m_pLbCustomLang->GetSelectLanguage();
}
bool ScTextImportOptionsDlg::isDateConversionSet() const
{
return maBtnConvertDate.IsChecked();
return m_pBtnConvertDate->IsChecked();
}
void ScTextImportOptionsDlg::init()
{
Link aLink = LINK( this, ScTextImportOptionsDlg, OKHdl );
maBtnOk.SetClickHdl(aLink);
m_pBtnOk->SetClickHdl(aLink);
aLink = LINK( this, ScTextImportOptionsDlg, RadioHdl );
maRbAutomatic.SetClickHdl(aLink);
maRbCustom.SetClickHdl(aLink);
m_pRbAutomatic->SetClickHdl(aLink);
m_pRbCustom->SetClickHdl(aLink);
maRbAutomatic.Check(true);
m_pRbAutomatic->Check(true);
maLbCustomLang.SetLanguageList(
m_pLbCustomLang->SetLanguageList(
LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, false, false);
LanguageType eLang = Application::GetSettings().GetLanguage();
maLbCustomLang.SelectLanguage(eLang);
maLbCustomLang.Disable();
m_pLbCustomLang->SelectLanguage(eLang);
m_pLbCustomLang->Disable();
}
IMPL_LINK_NOARG(ScTextImportOptionsDlg, OKHdl)
......@@ -104,13 +95,13 @@ IMPL_LINK_NOARG(ScTextImportOptionsDlg, OKHdl)
IMPL_LINK( ScTextImportOptionsDlg, RadioHdl, RadioButton*, pBtn )
{
if (pBtn == &maRbAutomatic)
if (pBtn == m_pRbAutomatic)
{
maLbCustomLang.Disable();
m_pLbCustomLang->Disable();
}
else if (pBtn == &maRbCustom)
else if (pBtn == m_pRbCustom)
{
maLbCustomLang.Enable();
m_pLbCustomLang->Enable();
}
return 0;
}
......
/*
* 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 "textimportoptions.hrc"
ModalDialog RID_SCDLG_TEXT_IMPORT_OPTIONS
{
HelpID = "sc:ModalDialog:RID_SCDLG_TEXT_IMPORT_OPTIONS";
Text [ en-US ] = "Import Options" ;
Size = MAP_APPFONT ( 230 , 101 ) ;
Moveable = TRUE ;
Closeable = TRUE ;
OutputSize = TRUE ;
OKButton BTN_OK
{
Pos = MAP_APPFONT ( 175, 6 ) ;
Size = MAP_APPFONT ( 50, 14 ) ;
DefButton = TRUE ;
};
CancelButton BTN_CANCEL
{
Pos = MAP_APPFONT ( 175, 23 ) ;
Size = MAP_APPFONT ( 50, 14 ) ;
};
HelpButton BTN_HELP
{
Pos = MAP_APPFONT ( 175, 43 ) ;
Size = MAP_APPFONT ( 50, 14 ) ;
};
FixedLine FL_CHOOSE_LANG
{
Pos = MAP_APPFONT( 6, 3 ) ;
Size = MAP_APPFONT( 165, 14 ) ;
Text [ en-US ] = "Select the language to use for import" ;
};
RadioButton RB_AUTOMATIC
{
HelpID = "sc:RadioButton:RID_SCDLG_TEXT_IMPORT_OPTIONS:RB_AUTOMATIC";
Pos = MAP_APPFONT( 12, 20 ) ;
Size = MAP_APPFONT( 159, 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Automatic" ;
};
RadioButton RB_CUSTOM
{
HelpID = "sc:RadioButton:RID_SCDLG_TEXT_IMPORT_OPTIONS:RB_CUSTOM";
Pos = MAP_APPFONT( 12, 34 ) ;
Size = MAP_APPFONT( 159, 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Custom" ;
};
ListBox LB_CUSTOM_LANG
{
HelpID = "sc:ListBox:RID_SCDLG_TEXT_IMPORT_OPTIONS:LB_CUSTOM_LANG";
Pos = MAP_APPFONT( 20, 50 ) ;
Size = MAP_APPFONT( 140, 120 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
Sort = TRUE ;
};
FixedLine FL_OPTION
{
Pos = MAP_APPFONT( 6, 70 );
Size = MAP_APPFONT( 165, 14 );
Text [ en-US ] = "Options" ;
};
CheckBox BTN_CONVERT_DATE
{
HelpID = "sc:CheckBox:RID_SCDLG_TEXT_IMPORT_OPTIONS:BTN_CONVERT_DATE";
Pos = MAP_APPFONT( 12, 86 );
Size = MAP_APPFONT( 159, 10 );
TabStop = TRUE ;
Text [ en-US ] = "Detect special numbers (such as dates)." ;
};
};
/*
* 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 <sc.hrc>
#define BTN_OK 1
#define BTN_CANCEL 2
#define BTN_HELP 3
#define FL_CHOOSE_LANG 4
#define RB_AUTOMATIC 5
#define RB_CUSTOM 6
#define LB_CUSTOM_LANG 7
#define FL_OPTION 8
#define BTN_CONVERT_DATE 9
......@@ -50,20 +50,14 @@ private:
void init();
private:
OKButton maBtnOk;
CancelButton maBtnCancel;
HelpButton maBtnHelp;
OKButton* m_pBtnOk;
FixedLine maFlChooseLang;
RadioButton* m_pRbAutomatic;
RadioButton* m_pRbCustom;
RadioButton maRbAutomatic;
RadioButton maRbCustom;
SvxLanguageBox* m_pLbCustomLang;
SvxLanguageBox maLbCustomLang;
FixedLine maFlOption;
CheckBox maBtnConvertDate;
CheckBox* m_pBtnConvertDate;
DECL_LINK(OKHdl, void *);
......
......@@ -236,8 +236,8 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException)
else
{
// HTML import.
::std::auto_ptr<AbstractScTextImportOptionsDlg> pDlg(
pFact->CreateScTextImportOptionsDlg(NULL, RID_SCDLG_TEXT_IMPORT_OPTIONS));
boost::scoped_ptr<AbstractScTextImportOptionsDlg> pDlg(
pFact->CreateScTextImportOptionsDlg(NULL));
if (pDlg->Execute() == RET_OK)
{
......
......@@ -309,8 +309,8 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
// this for html pasting only, but in the future it may
// make sense to do it for other data types too.
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
::std::auto_ptr<AbstractScTextImportOptionsDlg> pDlg(
pFact->CreateScTextImportOptionsDlg(NULL, RID_SCDLG_TEXT_IMPORT_OPTIONS));
boost::scoped_ptr<AbstractScTextImportOptionsDlg> pDlg(
pFact->CreateScTextImportOptionsDlg(NULL));
if (pDlg->Execute() == RET_OK)
{
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment