diff options
Diffstat (limited to 'dbaccess/source/ui/dlg/indexdialog.cxx')
-rw-r--r-- | dbaccess/source/ui/dlg/indexdialog.cxx | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx index fa24be183a09..160eafa192ec 100644 --- a/dbaccess/source/ui/dlg/indexdialog.cxx +++ b/dbaccess/source/ui/dlg/indexdialog.cxx @@ -65,21 +65,21 @@ namespace dbaui const Reference< XNameAccess >& _rxIndexes, const Reference< XConnection >& _rxConnection, const Reference< XComponentContext >& _rxContext) - : GenericDialogController(pParent, "dbaccess/ui/indexdesigndialog.ui", "IndexDesignDialog") + : GenericDialogController(pParent, u"dbaccess/ui/indexdesigndialog.ui"_ustr, u"IndexDesignDialog"_ustr) , m_xConnection(_rxConnection) , m_bEditingActive(false) , m_bEditAgain(false) , m_bNoHandlerCall(false) , m_xContext(_rxContext) - , m_xActions(m_xBuilder->weld_toolbar("ACTIONS")) - , m_xIndexList(m_xBuilder->weld_tree_view("INDEX_LIST")) - , m_xIndexDetails(m_xBuilder->weld_label("INDEX_DETAILS")) - , m_xDescriptionLabel(m_xBuilder->weld_label("DESC_LABEL")) - , m_xDescription(m_xBuilder->weld_label("DESCRIPTION")) - , m_xUnique(m_xBuilder->weld_check_button("UNIQUE")) - , m_xFieldsLabel(m_xBuilder->weld_label("FIELDS_LABEL")) - , m_xClose(m_xBuilder->weld_button("close")) - , m_xTable(m_xBuilder->weld_container("FIELDS")) + , m_xActions(m_xBuilder->weld_toolbar(u"ACTIONS"_ustr)) + , m_xIndexList(m_xBuilder->weld_tree_view(u"INDEX_LIST"_ustr)) + , m_xIndexDetails(m_xBuilder->weld_label(u"INDEX_DETAILS"_ustr)) + , m_xDescriptionLabel(m_xBuilder->weld_label(u"DESC_LABEL"_ustr)) + , m_xDescription(m_xBuilder->weld_label(u"DESCRIPTION"_ustr)) + , m_xUnique(m_xBuilder->weld_check_button(u"UNIQUE"_ustr)) + , m_xFieldsLabel(m_xBuilder->weld_label(u"FIELDS_LABEL"_ustr)) + , m_xClose(m_xBuilder->weld_button(u"close"_ustr)) + , m_xTable(m_xBuilder->weld_container(u"FIELDS"_ustr)) , m_xTableCtrlParent(m_xTable->CreateChildFrame()) , m_xFields(VclPtr<IndexFieldsControl>::Create(m_xTableCtrlParent)) { @@ -92,7 +92,7 @@ namespace dbaui m_xActions->connect_clicked(LINK(this, DbaIndexDialog, OnIndexAction)); - m_xIndexList->connect_changed(LINK(this, DbaIndexDialog, OnIndexSelected)); + m_xIndexList->connect_selection_changed(LINK(this, DbaIndexDialog, OnIndexSelected)); m_xIndexList->connect_editing(LINK(this, DbaIndexDialog, OnEntryEditing), LINK(this, DbaIndexDialog, OnEntryEdited)); @@ -116,7 +116,7 @@ namespace dbaui fillIndexList(); - m_xUnique->connect_clicked(LINK(this, DbaIndexDialog, OnModifiedClick)); + m_xUnique->connect_toggled(LINK(this, DbaIndexDialog, OnModifiedClick)); m_xFields->SetModifyHdl(LINK(this, DbaIndexDialog, OnModified)); m_xClose->connect_clicked(LINK(this, DbaIndexDialog, OnCloseDialog)); @@ -141,7 +141,7 @@ namespace dbaui void DbaIndexDialog::updateToolbox() { - m_xActions->set_item_sensitive("ID_INDEX_NEW", !m_bEditingActive); + m_xActions->set_item_sensitive(u"ID_INDEX_NEW"_ustr, !m_bEditingActive); int nSelected = m_xIndexList->get_selected_index(); bool bSelectedAnything = nSelected != -1; @@ -149,17 +149,17 @@ namespace dbaui { // is the current entry modified? Indexes::const_iterator aSelectedPos = m_xIndexes->begin() + m_xIndexList->get_id(nSelected).toUInt32(); - m_xActions->set_item_sensitive("ID_INDEX_SAVE", aSelectedPos->isModified() || aSelectedPos->isNew()); - m_xActions->set_item_sensitive("ID_INDEX_RESET", aSelectedPos->isModified() || aSelectedPos->isNew()); + m_xActions->set_item_sensitive(u"ID_INDEX_SAVE"_ustr, aSelectedPos->isModified() || aSelectedPos->isNew()); + m_xActions->set_item_sensitive(u"ID_INDEX_RESET"_ustr, aSelectedPos->isModified() || aSelectedPos->isNew()); bSelectedAnything = !aSelectedPos->bPrimaryKey; } else { - m_xActions->set_item_sensitive("ID_INDEX_SAVE", false); - m_xActions->set_item_sensitive("ID_INDEX_RESET", false); + m_xActions->set_item_sensitive(u"ID_INDEX_SAVE"_ustr, false); + m_xActions->set_item_sensitive(u"ID_INDEX_RESET"_ustr, false); } - m_xActions->set_item_sensitive("ID_INDEX_DROP", bSelectedAnything); - m_xActions->set_item_sensitive("ID_INDEX_RENAME", bSelectedAnything); + m_xActions->set_item_sensitive(u"ID_INDEX_DROP"_ustr, bSelectedAnything); + m_xActions->set_item_sensitive(u"ID_INDEX_RENAME"_ustr, bSelectedAnything); } void DbaIndexDialog::fillIndexList() @@ -409,7 +409,7 @@ namespace dbaui updateToolbox(); } - IMPL_LINK(DbaIndexDialog, OnIndexAction, const OString&, rClicked, void) + IMPL_LINK(DbaIndexDialog, OnIndexAction, const OUString&, rClicked, void) { if (rClicked == "ID_INDEX_NEW") OnNewIndex(); @@ -451,8 +451,8 @@ namespace dbaui Indexes::const_iterator aSelected = m_xIndexes->begin() + m_xIndexList->get_id(*xSelected).toUInt32(); if (aSelected->isModified() || aSelected->isNew()) { - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(m_xDialog.get(), "dbaccess/ui/saveindexdialog.ui")); - std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog("SaveIndexDialog")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(m_xDialog.get(), u"dbaccess/ui/saveindexdialog.ui"_ustr)); + std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog(u"SaveIndexDialog"_ustr)); nResponse = xQuery->run(); } } @@ -537,28 +537,28 @@ namespace dbaui bool DbaIndexDialog::implSaveModified(bool _bPlausibility) { - if (m_xPreviousSelection) - { - // try to commit the previously selected index - if (m_xFields->IsModified() && !m_xFields->SaveModified()) - return false; + if (!m_xPreviousSelection) + return true; - Indexes::iterator aPreviouslySelected = m_xIndexes->begin() + m_xIndexList->get_id(*m_xPreviousSelection).toUInt32(); + // try to commit the previously selected index + if (m_xFields->IsModified() && !m_xFields->SaveModified()) + return false; - // the unique flag - aPreviouslySelected->bUnique = m_xUnique->get_active(); - if (m_xUnique->get_state_changed_from_saved()) - aPreviouslySelected->setModified(true); + Indexes::iterator aPreviouslySelected = m_xIndexes->begin() + m_xIndexList->get_id(*m_xPreviousSelection).toUInt32(); - // the fields - m_xFields->commitTo(aPreviouslySelected->aFields); - if (m_xFields->GetSavedValue() != aPreviouslySelected->aFields) - aPreviouslySelected->setModified(true); + // the unique flag + aPreviouslySelected->bUnique = m_xUnique->get_active(); + if (m_xUnique->get_state_changed_from_saved()) + aPreviouslySelected->setModified(true); - // plausibility checks - if (_bPlausibility && !implCheckPlausibility(aPreviouslySelected)) - return false; - } + // the fields + m_xFields->commitTo(aPreviouslySelected->aFields); + if (m_xFields->GetSavedValue() != aPreviouslySelected->aFields) + aPreviouslySelected->setModified(true); + + // plausibility checks + if (_bPlausibility && !implCheckPlausibility(aPreviouslySelected)) + return false; return true; } @@ -615,7 +615,7 @@ namespace dbaui return true; } - IMPL_LINK_NOARG(DbaIndexDialog, OnModifiedClick, weld::Button&, void) + IMPL_LINK_NOARG(DbaIndexDialog, OnModifiedClick, weld::Toggleable&, void) { OnModified(*m_xFields); } @@ -641,7 +641,7 @@ namespace dbaui m_xUnique->set_sensitive(!aSelectedIndex->bPrimaryKey); m_xUnique->save_state(); - m_xFields->initializeFrom(aSelectedIndex->aFields); + m_xFields->initializeFrom(std::vector(aSelectedIndex->aFields)); m_xFields->Enable(!aSelectedIndex->bPrimaryKey); m_xFields->SaveValue(); |