diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2014-08-01 23:26:03 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2014-08-02 11:47:11 +0000 |
commit | 3b71e0cb1c71efd4d24f5de837d743bba007ff9e (patch) | |
tree | 117cd59b469e6f13020181db84a2a3711d0a73ba /dbaccess/source/ui/dlg | |
parent | 958a95d052002120a9e3871fe3e3fb2cbaa33bdb (diff) |
TAB_PAGE_USERADMIN conversion to .ui
Change-Id: I65ae56bee3e66ec0b19e40fa23ac02a8ec1afbf8
Reviewed-on: https://gerrit.libreoffice.org/10681
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'dbaccess/source/ui/dlg')
-rw-r--r-- | dbaccess/source/ui/dlg/UserAdmin.cxx | 46 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/UserAdmin.hrc | 37 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/UserAdmin.hxx | 11 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/UserAdmin.src | 84 |
4 files changed, 25 insertions, 153 deletions
diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx index 4c3eb4df340a..bd852b0e88d5 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.cxx +++ b/dbaccess/source/ui/dlg/UserAdmin.cxx @@ -18,7 +18,6 @@ */ #include "UserAdmin.hxx" -#include "UserAdmin.hrc" #include "UITools.hxx" #include "dbu_dlg.hrc" #include <comphelper/types.hxx> @@ -111,23 +110,20 @@ IMPL_LINK( OPasswordDialog, ModifiedHdl, Edit *, pEdit ) // OUserAdmin OUserAdmin::OUserAdmin(Window* pParent,const SfxItemSet& _rAttrSet) - : OGenericAdministrationPage( pParent, ModuleRes(TAB_PAGE_USERADMIN), _rAttrSet) - ,m_FL_USER( this , ModuleRes(FL_USER)) - ,m_FT_USER( this , ModuleRes(FT_USER)) - ,m_LB_USER( this , ModuleRes(LB_USER)) - ,m_PB_NEWUSER( this , ModuleRes(PB_NEWUSER)) - ,m_PB_CHANGEPWD( this , ModuleRes(PB_CHANGEPWD)) - ,m_PB_DELETEUSER( this , ModuleRes(PB_DELETEUSER)) - ,m_FL_TABLE_GRANTS( this , ModuleRes(FL_TABLE_GRANTS)) - ,m_TableCtrl( this , ModuleRes(CTRL_TABLE_GRANTS)) + : OGenericAdministrationPage( pParent, "UserAdminPage", "dbaccess/ui/useradminpage.ui", _rAttrSet) + ,m_TableCtrl(get<VclAlignment>("table"), WB_TABSTOP) { - m_LB_USER.SetSelectHdl(LINK(this, OUserAdmin, ListDblClickHdl)); + m_TableCtrl.Show(); + get(m_pUSER, "user"); + get(m_pNEWUSER, "add"); + get(m_pCHANGEPWD, "changepass"); + get(m_pDELETEUSER, "delete"); - m_PB_NEWUSER.SetClickHdl(LINK(this, OUserAdmin, UserHdl)); - m_PB_CHANGEPWD.SetClickHdl(LINK(this, OUserAdmin, UserHdl)); - m_PB_DELETEUSER.SetClickHdl(LINK(this, OUserAdmin, UserHdl)); + m_pUSER->SetSelectHdl(LINK(this, OUserAdmin, ListDblClickHdl)); - FreeResource(); + m_pNEWUSER->SetClickHdl(LINK(this, OUserAdmin, UserHdl)); + m_pCHANGEPWD->SetClickHdl(LINK(this, OUserAdmin, UserHdl)); + m_pDELETEUSER->SetClickHdl(LINK(this, OUserAdmin, UserHdl)); } OUserAdmin::~OUserAdmin() @@ -139,7 +135,7 @@ void OUserAdmin::FillUserNames() { if(m_xConnection.is()) { - m_LB_USER.Clear(); + m_pUSER->Clear(); Reference<XDatabaseMetaData> xMetaData = m_xConnection->getMetaData(); @@ -150,15 +146,15 @@ void OUserAdmin::FillUserNames() // first we need the users if ( m_xUsers.is() ) { - m_LB_USER.Clear(); + m_pUSER->Clear(); m_aUserNames = m_xUsers->getElementNames(); const OUString* pBegin = m_aUserNames.getConstArray(); const OUString* pEnd = pBegin + m_aUserNames.getLength(); for(;pBegin != pEnd;++pBegin) - m_LB_USER.InsertEntry(*pBegin); + m_pUSER->InsertEntry(*pBegin); - m_LB_USER.SelectEntryPos(0); + m_pUSER->SelectEntryPos(0); if(m_xUsers->hasByName(m_UserName)) { Reference<XAuthorizable> xAuth; @@ -173,11 +169,11 @@ void OUserAdmin::FillUserNames() } Reference<XAppend> xAppend(m_xUsers,UNO_QUERY); - m_PB_NEWUSER.Enable(xAppend.is()); + m_pNEWUSER->Enable(xAppend.is()); Reference<XDrop> xDrop(m_xUsers,UNO_QUERY); - m_PB_DELETEUSER.Enable(xDrop.is()); + m_pDELETEUSER->Enable(xDrop.is()); - m_PB_CHANGEPWD.Enable(m_xUsers.is()); + m_pCHANGEPWD->Enable(m_xUsers.is()); m_TableCtrl.Enable(m_xUsers.is()); } @@ -191,7 +187,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton ) { try { - if(pButton == &m_PB_NEWUSER) + if(pButton == m_pNEWUSER) { SfxPasswordDialog aPwdDlg(this); aPwdDlg.ShowExtras(SHOWEXTRAS_ALL); @@ -209,7 +205,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton ) } } } - else if(pButton == &m_PB_CHANGEPWD) + else if(pButton == m_pCHANGEPWD) { OUString sName = GetUser(); @@ -271,7 +267,7 @@ IMPL_LINK( OUserAdmin, ListDblClickHdl, ListBox *, /*pListBox*/ ) OUString OUserAdmin::GetUser() { - return m_LB_USER.GetSelectEntry(); + return m_pUSER->GetSelectEntry(); } void OUserAdmin::fillControls(::std::vector< ISaveValueWrapper* >& /*_rControlList*/) diff --git a/dbaccess/source/ui/dlg/UserAdmin.hrc b/dbaccess/source/ui/dlg/UserAdmin.hrc deleted file mode 100644 index 59771087dd8d..000000000000 --- a/dbaccess/source/ui/dlg/UserAdmin.hrc +++ /dev/null @@ -1,37 +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_USERADMIN_HRC -#define DBAUI_USERADMIN_HRC - -#define FT_USER 1 - -#define LB_USER 1 - -#define FL_TABLE_GRANTS 1 -#define FL_USER 2 - -#define CTRL_TABLE_GRANTS 1 - -#define PB_NEWUSER 2 -#define PB_CHANGEPWD 3 -#define PB_DELETEUSER 4 - -#endif // DBAUI_USERADMIN_HRC - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/dlg/UserAdmin.hxx b/dbaccess/source/ui/dlg/UserAdmin.hxx index 96022dbd8976..8d8115cce534 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.hxx +++ b/dbaccess/source/ui/dlg/UserAdmin.hxx @@ -41,13 +41,10 @@ namespace dbaui class OUserAdmin : public OGenericAdministrationPage { protected: - FixedLine m_FL_USER; - FixedText m_FT_USER; - ListBox m_LB_USER; - PushButton m_PB_NEWUSER; - PushButton m_PB_CHANGEPWD; - PushButton m_PB_DELETEUSER; - FixedLine m_FL_TABLE_GRANTS; + ListBox *m_pUSER; + PushButton *m_pNEWUSER; + PushButton *m_pCHANGEPWD; + PushButton *m_pDELETEUSER; OTableGrantControl m_TableCtrl; // show the grant rights of one user ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection; diff --git a/dbaccess/source/ui/dlg/UserAdmin.src b/dbaccess/source/ui/dlg/UserAdmin.src index a17fbb627326..d9216faf031c 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.src +++ b/dbaccess/source/ui/dlg/UserAdmin.src @@ -17,93 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "UserAdmin.hrc" #include "dbu_dlg.hrc" #include "dbaccess_helpid.hrc" -#define WINDOW_SIZE_X 260 -#define WINDOW_SIZE_Y 185 - -TabPage TAB_PAGE_USERADMIN -{ - SVLook = TRUE ; - HelpId = HID_TAB_PAGE_USERADMIN ; - Size = MAP_APPFONT ( WINDOW_SIZE_X , WINDOW_SIZE_Y ) ; - Hide = TRUE; - - FixedLine FL_USER - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 8, 8) ; - Text [ en-US ] = "User selection"; - }; - - FixedText FT_USER - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 90 , 10 ) ; - Text [ en-US ] = "Us~er:"; - }; - - ListBox LB_USER - { - Border = TRUE ; - Pos = MAP_APPFONT ( 108 , 13) ; - Size = MAP_APPFONT ( 105 , 97 ) ; - TabStop = TRUE ; - HScroll = TRUE ; - Sort = TRUE ; - DropDown = TRUE ; - HelpId = HID_TAB_PAGE_LBUSER ; - }; - - PushButton PB_NEWUSER - { - Pos = MAP_APPFONT ( 12 , 29 ) ; - Size = MAP_APPFONT ( 70 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - HelpId = HID_TAB_PAGE_PBUSER ; - Text [ en-US ] = "~Add User..."; - }; - - PushButton PB_CHANGEPWD - { - Pos = MAP_APPFONT ( 95 , 29 ) ; - Size = MAP_APPFONT ( 70 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - HelpId = HID_TAB_PAGE_PBCHGPWD ; - Text [ en-US ] = "Change ~Password..."; - }; - - PushButton PB_DELETEUSER - { - Pos = MAP_APPFONT ( WINDOW_SIZE_X - 82 , 29 ) ; - Size = MAP_APPFONT ( 70 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - HelpId = HID_TAB_PAGE_PBUSERDELETE ; - Text [ en-US ] = "~Delete User..."; - }; - - FixedLine FL_TABLE_GRANTS - { - Pos = MAP_APPFONT ( 6 , 52 ) ; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 8, 8) ; - Text [ en-US ] = "Access rights for selected user"; - }; - - Control CTRL_TABLE_GRANTS - { - Pos = MAP_APPFONT ( 12 , 63 ) ; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 22, WINDOW_SIZE_Y - 75 ); - Border = TRUE ; - TabStop = TRUE ; - HelpId = HID_TAB_PAGE_TBLGRANTS ; - }; -}; - QueryBox QUERY_USERADMIN_DELETE_USER { Buttons = WB_YES_NO ; |