Kaydet (Commit) 3b71e0cb authored tarafından Szymon Kłos's avatar Szymon Kłos Kaydeden (comit) David Tardon

TAB_PAGE_USERADMIN conversion to .ui

Change-Id: I65ae56bee3e66ec0b19e40fa23ac02a8ec1afbf8
Reviewed-on: https://gerrit.libreoffice.org/10681Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst 958a95d0
...@@ -55,6 +55,7 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \ ...@@ -55,6 +55,7 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \
dbaccess/uiconfig/ui/textconnectionsettings \ dbaccess/uiconfig/ui/textconnectionsettings \
dbaccess/uiconfig/ui/textpage \ dbaccess/uiconfig/ui/textpage \
dbaccess/uiconfig/ui/useradmindialog \ dbaccess/uiconfig/ui/useradmindialog \
dbaccess/uiconfig/ui/useradminpage \
)) ))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
...@@ -46,8 +46,8 @@ const sal_uInt16 COL_DROP = 8; ...@@ -46,8 +46,8 @@ const sal_uInt16 COL_DROP = 8;
// OTableGrantControl // OTableGrantControl
OTableGrantControl::OTableGrantControl( Window* pParent,const ResId& _RsId) OTableGrantControl::OTableGrantControl( Window* pParent, WinBits nBits)
:EditBrowseBox( pParent,_RsId, EBBF_SMART_TAB_TRAVEL | EBBF_NOROWPICTURE ) :EditBrowseBox( pParent, EBBF_SMART_TAB_TRAVEL | EBBF_NOROWPICTURE, nBits )
,m_pCheckCell( NULL ) ,m_pCheckCell( NULL )
,m_pEdit( NULL ) ,m_pEdit( NULL )
,m_nDataPos( 0 ) ,m_nDataPos( 0 )
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
*/ */
#include "UserAdmin.hxx" #include "UserAdmin.hxx"
#include "UserAdmin.hrc"
#include "UITools.hxx" #include "UITools.hxx"
#include "dbu_dlg.hrc" #include "dbu_dlg.hrc"
#include <comphelper/types.hxx> #include <comphelper/types.hxx>
...@@ -111,23 +110,20 @@ IMPL_LINK( OPasswordDialog, ModifiedHdl, Edit *, pEdit ) ...@@ -111,23 +110,20 @@ IMPL_LINK( OPasswordDialog, ModifiedHdl, Edit *, pEdit )
// OUserAdmin // OUserAdmin
OUserAdmin::OUserAdmin(Window* pParent,const SfxItemSet& _rAttrSet) OUserAdmin::OUserAdmin(Window* pParent,const SfxItemSet& _rAttrSet)
: OGenericAdministrationPage( pParent, ModuleRes(TAB_PAGE_USERADMIN), _rAttrSet) : OGenericAdministrationPage( pParent, "UserAdminPage", "dbaccess/ui/useradminpage.ui", _rAttrSet)
,m_FL_USER( this , ModuleRes(FL_USER)) ,m_TableCtrl(get<VclAlignment>("table"), WB_TABSTOP)
,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))
{ {
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_pUSER->SetSelectHdl(LINK(this, OUserAdmin, ListDblClickHdl));
m_PB_CHANGEPWD.SetClickHdl(LINK(this, OUserAdmin, UserHdl));
m_PB_DELETEUSER.SetClickHdl(LINK(this, OUserAdmin, UserHdl));
FreeResource(); m_pNEWUSER->SetClickHdl(LINK(this, OUserAdmin, UserHdl));
m_pCHANGEPWD->SetClickHdl(LINK(this, OUserAdmin, UserHdl));
m_pDELETEUSER->SetClickHdl(LINK(this, OUserAdmin, UserHdl));
} }
OUserAdmin::~OUserAdmin() OUserAdmin::~OUserAdmin()
...@@ -139,7 +135,7 @@ void OUserAdmin::FillUserNames() ...@@ -139,7 +135,7 @@ void OUserAdmin::FillUserNames()
{ {
if(m_xConnection.is()) if(m_xConnection.is())
{ {
m_LB_USER.Clear(); m_pUSER->Clear();
Reference<XDatabaseMetaData> xMetaData = m_xConnection->getMetaData(); Reference<XDatabaseMetaData> xMetaData = m_xConnection->getMetaData();
...@@ -150,15 +146,15 @@ void OUserAdmin::FillUserNames() ...@@ -150,15 +146,15 @@ void OUserAdmin::FillUserNames()
// first we need the users // first we need the users
if ( m_xUsers.is() ) if ( m_xUsers.is() )
{ {
m_LB_USER.Clear(); m_pUSER->Clear();
m_aUserNames = m_xUsers->getElementNames(); m_aUserNames = m_xUsers->getElementNames();
const OUString* pBegin = m_aUserNames.getConstArray(); const OUString* pBegin = m_aUserNames.getConstArray();
const OUString* pEnd = pBegin + m_aUserNames.getLength(); const OUString* pEnd = pBegin + m_aUserNames.getLength();
for(;pBegin != pEnd;++pBegin) 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)) if(m_xUsers->hasByName(m_UserName))
{ {
Reference<XAuthorizable> xAuth; Reference<XAuthorizable> xAuth;
...@@ -173,11 +169,11 @@ void OUserAdmin::FillUserNames() ...@@ -173,11 +169,11 @@ void OUserAdmin::FillUserNames()
} }
Reference<XAppend> xAppend(m_xUsers,UNO_QUERY); 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); 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()); m_TableCtrl.Enable(m_xUsers.is());
} }
...@@ -191,7 +187,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton ) ...@@ -191,7 +187,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton )
{ {
try try
{ {
if(pButton == &m_PB_NEWUSER) if(pButton == m_pNEWUSER)
{ {
SfxPasswordDialog aPwdDlg(this); SfxPasswordDialog aPwdDlg(this);
aPwdDlg.ShowExtras(SHOWEXTRAS_ALL); aPwdDlg.ShowExtras(SHOWEXTRAS_ALL);
...@@ -209,7 +205,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton ) ...@@ -209,7 +205,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton )
} }
} }
} }
else if(pButton == &m_PB_CHANGEPWD) else if(pButton == m_pCHANGEPWD)
{ {
OUString sName = GetUser(); OUString sName = GetUser();
...@@ -271,7 +267,7 @@ IMPL_LINK( OUserAdmin, ListDblClickHdl, ListBox *, /*pListBox*/ ) ...@@ -271,7 +267,7 @@ IMPL_LINK( OUserAdmin, ListDblClickHdl, ListBox *, /*pListBox*/ )
OUString OUserAdmin::GetUser() OUString OUserAdmin::GetUser()
{ {
return m_LB_USER.GetSelectEntry(); return m_pUSER->GetSelectEntry();
} }
void OUserAdmin::fillControls(::std::vector< ISaveValueWrapper* >& /*_rControlList*/) void OUserAdmin::fillControls(::std::vector< ISaveValueWrapper* >& /*_rControlList*/)
......
/* -*- 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: */
...@@ -41,13 +41,10 @@ namespace dbaui ...@@ -41,13 +41,10 @@ namespace dbaui
class OUserAdmin : public OGenericAdministrationPage class OUserAdmin : public OGenericAdministrationPage
{ {
protected: protected:
FixedLine m_FL_USER; ListBox *m_pUSER;
FixedText m_FT_USER; PushButton *m_pNEWUSER;
ListBox m_LB_USER; PushButton *m_pCHANGEPWD;
PushButton m_PB_NEWUSER; PushButton *m_pDELETEUSER;
PushButton m_PB_CHANGEPWD;
PushButton m_PB_DELETEUSER;
FixedLine m_FL_TABLE_GRANTS;
OTableGrantControl m_TableCtrl; // show the grant rights of one user OTableGrantControl m_TableCtrl; // show the grant rights of one user
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection;
......
...@@ -17,93 +17,9 @@ ...@@ -17,93 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "UserAdmin.hrc"
#include "dbu_dlg.hrc" #include "dbu_dlg.hrc"
#include "dbaccess_helpid.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 QueryBox QUERY_USERADMIN_DELETE_USER
{ {
Buttons = WB_YES_NO ; Buttons = WB_YES_NO ;
......
...@@ -59,7 +59,7 @@ class OTableGrantControl : public ::svt::EditBrowseBox ...@@ -59,7 +59,7 @@ class OTableGrantControl : public ::svt::EditBrowseBox
ImplSVEvent * m_nDeactivateEvent; ImplSVEvent * m_nDeactivateEvent;
public: public:
OTableGrantControl( Window* pParent,const ResId& _RsId); OTableGrantControl( Window* pParent, WinBits nBits);
virtual ~OTableGrantControl(); virtual ~OTableGrantControl();
void UpdateTables(); void UpdateTables();
void setUserName(const OUString& _sUserName); void setUserName(const OUString& _sUserName);
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkBox" id="UserAdminPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="border_width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Us_er:</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="user">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">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="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkButton" id="add">
<property name="label" translatable="yes">_Add User...</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">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="changepass">
<property name="label" translatable="yes">Change _Password...</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="delete">
<property name="label" translatable="yes">_Delete User...</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">User selection</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="table">
<property name="height_request">150</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<placeholder/>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Access rights for selected user</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</interface>
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