LibreOffice Module sc (master)  1
textimportoptions.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #undef SC_DLLIMPLEMENTATION
21 
22 #include <textimportoptions.hxx>
23 #include <svx/langbox.hxx>
24 #include <vcl/svapp.hxx>
25 #include <vcl/settings.hxx>
27 
29  : GenericDialogController(pParent, "modules/scalc/ui/textimportoptions.ui", "TextImportOptionsDialog")
30  , m_xBtnOk(m_xBuilder->weld_button("ok"))
31  , m_xRbAutomatic(m_xBuilder->weld_radio_button("automatic"))
32  , m_xRbCustom(m_xBuilder->weld_radio_button("custom"))
33  , m_xBtnConvertDate(m_xBuilder->weld_check_button("convertdata"))
34  , m_xBtnKeepAsking(m_xBuilder->weld_check_button("keepasking"))
35  , m_xLbCustomLang(new SvxLanguageBox(m_xBuilder->weld_combo_box("lang")))
36 {
37  init();
38 }
39 
41 {
42 }
43 
45 {
46  if (m_xRbAutomatic->get_active())
47  return LANGUAGE_SYSTEM;
48 
49  return m_xLbCustomLang->get_active_id();
50 }
51 
53 {
54  return m_xBtnConvertDate->get_active();
55 }
56 
58 {
59  return m_xBtnKeepAsking->get_active();
60 }
61 
63 {
64  m_xBtnOk->connect_clicked(LINK(this, ScTextImportOptionsDlg, OKHdl));
66  m_xRbAutomatic->connect_toggled(aLink);
67  m_xRbCustom->connect_toggled(aLink);
68 
69  m_xRbAutomatic->set_active(true);
70 
71  m_xLbCustomLang->SetLanguageList(
72  SvxLanguageListFlags::ALL | SvxLanguageListFlags::ONLY_KNOWN, false);
73 
75  m_xLbCustomLang->set_active_id(eLang);
76  m_xLbCustomLang->set_sensitive(false);
77 }
78 
80 {
81  m_xDialog->response(RET_OK);
82 }
83 
85 {
86  if (&rBtn == m_xRbAutomatic.get())
87  {
88  m_xLbCustomLang->set_sensitive(false);
89  }
90  else if (&rBtn == m_xRbCustom.get())
91  {
92  m_xLbCustomLang->set_sensitive(true);
93  }
94 }
95 
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~ScTextImportOptionsDlg() override
std::unique_ptr< weld::Button > m_xBtnOk
LanguageType getLanguageType(bool bResolveSystem=true) const
static const AllSettings & GetSettings()
ScTextImportOptionsDlg(weld::Window *pParent)
std::unique_ptr< weld::RadioButton > m_xRbCustom
std::unique_ptr< weld::CheckButton > m_xBtnKeepAsking
std::unique_ptr< weld::RadioButton > m_xRbAutomatic
const LanguageTag & GetLanguageTag() const
#define LANGUAGE_SYSTEM
std::unique_ptr< weld::CheckButton > m_xBtnConvertDate
LanguageType getLanguageType() const
IMPL_LINK_NOARG(ScTextImportOptionsDlg, OKHdl, weld::Button &, void)
std::unique_ptr< SvxLanguageBox > m_xLbCustomLang
RET_OK
Reference< XExecutableDialog > m_xDialog
bool isDateConversionSet() const
IMPL_LINK(ScTextImportOptionsDlg, RadioHdl, weld::ToggleButton &, rBtn, void)