summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2014-08-01 23:26:03 +0200
committerDavid Tardon <dtardon@redhat.com>2014-08-02 11:47:11 +0000
commit3b71e0cb1c71efd4d24f5de837d743bba007ff9e (patch)
tree117cd59b469e6f13020181db84a2a3711d0a73ba /dbaccess
parent958a95d052002120a9e3871fe3e3fb2cbaa33bdb (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')
-rw-r--r--dbaccess/UIConfig_dbaccess.mk1
-rw-r--r--dbaccess/source/ui/control/TableGrantCtrl.cxx4
-rw-r--r--dbaccess/source/ui/dlg/UserAdmin.cxx46
-rw-r--r--dbaccess/source/ui/dlg/UserAdmin.hrc37
-rw-r--r--dbaccess/source/ui/dlg/UserAdmin.hxx11
-rw-r--r--dbaccess/source/ui/dlg/UserAdmin.src84
-rw-r--r--dbaccess/source/ui/inc/TableGrantCtrl.hxx2
-rw-r--r--dbaccess/uiconfig/ui/useradminpage.ui196
8 files changed, 225 insertions, 156 deletions
diff --git a/dbaccess/UIConfig_dbaccess.mk b/dbaccess/UIConfig_dbaccess.mk
index 6f1751b07a38..522c0096229d 100644
--- a/dbaccess/UIConfig_dbaccess.mk
+++ b/dbaccess/UIConfig_dbaccess.mk
@@ -55,6 +55,7 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \
dbaccess/uiconfig/ui/textconnectionsettings \
dbaccess/uiconfig/ui/textpage \
dbaccess/uiconfig/ui/useradmindialog \
+ dbaccess/uiconfig/ui/useradminpage \
))
# vim: set noet sw=4 ts=4:
diff --git a/dbaccess/source/ui/control/TableGrantCtrl.cxx b/dbaccess/source/ui/control/TableGrantCtrl.cxx
index 9cbc3306ac78..abf2d5f489f4 100644
--- a/dbaccess/source/ui/control/TableGrantCtrl.cxx
+++ b/dbaccess/source/ui/control/TableGrantCtrl.cxx
@@ -46,8 +46,8 @@ const sal_uInt16 COL_DROP = 8;
// OTableGrantControl
-OTableGrantControl::OTableGrantControl( Window* pParent,const ResId& _RsId)
- :EditBrowseBox( pParent,_RsId, EBBF_SMART_TAB_TRAVEL | EBBF_NOROWPICTURE )
+OTableGrantControl::OTableGrantControl( Window* pParent, WinBits nBits)
+ :EditBrowseBox( pParent, EBBF_SMART_TAB_TRAVEL | EBBF_NOROWPICTURE, nBits )
,m_pCheckCell( NULL )
,m_pEdit( NULL )
,m_nDataPos( 0 )
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 ;
diff --git a/dbaccess/source/ui/inc/TableGrantCtrl.hxx b/dbaccess/source/ui/inc/TableGrantCtrl.hxx
index d3ad8835ae84..32e0f519ad94 100644
--- a/dbaccess/source/ui/inc/TableGrantCtrl.hxx
+++ b/dbaccess/source/ui/inc/TableGrantCtrl.hxx
@@ -59,7 +59,7 @@ class OTableGrantControl : public ::svt::EditBrowseBox
ImplSVEvent * m_nDeactivateEvent;
public:
- OTableGrantControl( Window* pParent,const ResId& _RsId);
+ OTableGrantControl( Window* pParent, WinBits nBits);
virtual ~OTableGrantControl();
void UpdateTables();
void setUserName(const OUString& _sUserName);
diff --git a/dbaccess/uiconfig/ui/useradminpage.ui b/dbaccess/uiconfig/ui/useradminpage.ui
new file mode 100644
index 000000000000..58907e6f0a23
--- /dev/null
+++ b/dbaccess/uiconfig/ui/useradminpage.ui
@@ -0,0 +1,196 @@
+<?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>