diff options
author | Palenik Mihály <palenik.mihaly@gmail.com> | 2014-06-30 15:53:56 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-02 08:47:13 +0000 |
commit | a5cc3ce566f1a1ebd5995582efed104fb2793fb0 (patch) | |
tree | a1b688d97cb517e22fa163901aec1fdaaadfdd5b /dbaccess/source/ui/dlg | |
parent | 6a6d83ace33789de951f8655be0108f70108660e (diff) |
Convert DLG_COLLECTION_VIEW to .ui
Conflicts:
include/svtools/fileview.hxx
svtools/source/contnr/fileview.cxx
Change-Id: I78b590410ec4e55eeecd2da8ab79738f05e403b5
Reviewed-on: https://gerrit.libreoffice.org/9981
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess/source/ui/dlg')
-rw-r--r-- | dbaccess/source/ui/dlg/CollectionView.cxx | 73 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/CollectionView.hrc | 43 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/CollectionView.src | 151 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbadmin2.src | 10 |
4 files changed, 43 insertions, 234 deletions
diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx index 379e0a2544b3..6d82fc53b2d9 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -18,7 +18,6 @@ */ #include "CollectionView.hxx" -#include "CollectionView.hrc" #include <tools/debug.hxx> #include <tools/diagnose_ex.h> #include "moduledbu.hxx" @@ -60,42 +59,36 @@ OCollectionView::OCollectionView( Window * pParent ,const Reference< XContent>& _xContent ,const OUString& _sDefaultName ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext) - : ModalDialog( pParent, ModuleRes(DLG_COLLECTION_VIEW)) - , m_aFTCurrentPath( this, ModuleRes( FT_EXPLORERFILE_CURRENTPATH ) ) - , m_aNewFolder( this, ModuleRes( BTN_EXPLORERFILE_NEWFOLDER ) ) - , m_aUp( this, ModuleRes( BTN_EXPLORERFILE_UP ) ) - , m_aView( this, ModuleRes( CTRL_VIEW ), FILEVIEW_SHOW_ONLYTITLE ) - , m_aFTName( this, ModuleRes( FT_EXPLORERFILE_FILENAME ) ) - , m_aName( this, ModuleRes( ED_EXPLORERFILE_FILENAME ) ) - , m_aFL( this, ModuleRes( FL_1 ) ) - , m_aPB_OK( this, ModuleRes( BTN_EXPLORERFILE_SAVE ) ) - , m_aPB_CANCEL( this, ModuleRes( PB_CANCEL ) ) - , m_aPB_HELP( this, ModuleRes( PB_HELP ) ) - , m_sPath( ModuleRes( STR_PATHNAME ) ) + : ModalDialog( pParent, "CollectionView", "dbaccess/ui/collectionviewdialog.ui") , m_xContent(_xContent) , m_xContext(_rxContext) , m_bCreateForm(true) { - FreeResource(); + get(m_pFTCurrentPath, "currentPathLabel"); + get(m_pNewFolder, "newFolderButton"); + get(m_pUp, "upButton"); + get(m_pView, "viewTreeview"); + get(m_pName, "fileNameEntry"); + get(m_pPB_OK, "ok"); OSL_ENSURE(m_xContent.is(),"No valid content!"); - m_aView.Initialize(m_xContent,OUString()); - m_aFTCurrentPath.SetStyle( m_aFTCurrentPath.GetStyle() | WB_PATHELLIPSIS ); + m_pView->Initialize(m_xContent,OUString()); + m_pFTCurrentPath->SetStyle( m_pFTCurrentPath->GetStyle() | WB_PATHELLIPSIS ); initCurrentPath(); - m_aName.SetText(_sDefaultName); - m_aName.GrabFocus(); + m_pName->SetText(_sDefaultName); + m_pName->GrabFocus(); - m_aNewFolder.SetStyle( m_aNewFolder.GetStyle() | WB_NOPOINTERFOCUS ); - m_aUp.SetModeImage(Image(ModuleRes(IMG_NAVIGATION_BTN_UP_SC))); - m_aNewFolder.SetModeImage(Image(ModuleRes(IMG_NAVIGATION_CREATEFOLDER_SC))); + m_pNewFolder->SetStyle( m_pNewFolder->GetStyle() | WB_NOPOINTERFOCUS ); + m_pUp->SetModeImage(Image(ModuleRes(IMG_NAVIGATION_BTN_UP_SC))); + m_pNewFolder->SetModeImage(Image(ModuleRes(IMG_NAVIGATION_CREATEFOLDER_SC))); - m_aView.SetDoubleClickHdl( LINK( this, OCollectionView, Dbl_Click_FileView ) ); - m_aView.EnableAutoResize(); - m_aView.EnableDelete(true); - m_aUp.SetClickHdl( LINK( this, OCollectionView, Up_Click ) ); - m_aNewFolder.SetClickHdl( LINK( this, OCollectionView, NewFolder_Click ) ); - m_aPB_OK.SetClickHdl( LINK( this, OCollectionView, Save_Click ) ); + m_pView->SetDoubleClickHdl( LINK( this, OCollectionView, Dbl_Click_FileView ) ); + m_pView->EnableAutoResize(); + m_pView->EnableDelete(true); + m_pUp->SetClickHdl( LINK( this, OCollectionView, Up_Click ) ); + m_pNewFolder->SetClickHdl( LINK( this, OCollectionView, NewFolder_Click ) ); + m_pPB_OK->SetClickHdl( LINK( this, OCollectionView, Save_Click ) ); } OCollectionView::~OCollectionView( ) @@ -105,12 +98,12 @@ OCollectionView::~OCollectionView( ) IMPL_LINK_NOARG(OCollectionView, Save_Click) { - OUString sName = m_aName.GetText(); + OUString sName = m_pName->GetText(); if ( sName.isEmpty() ) return 0; try { - OUString sSubFolder = m_aView.GetCurrentURL(); + OUString sSubFolder = m_pView->GetCurrentURL(); sal_Int32 nIndex = sName.lastIndexOf('/') + 1; if ( nIndex ) { @@ -127,7 +120,7 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click) xChild.set(m_xContent,UNO_QUERY); } } - m_aView.Initialize(m_xContent,OUString()); + m_pView->Initialize(m_xContent,OUString()); initCurrentPath(); } sSubFolder = sName.copy(0,nIndex-1); @@ -180,7 +173,7 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click) if ( aBox.Execute() != RET_YES ) return 0; } - m_aName.SetText(sName); + m_pName->SetText(sName); EndDialog( sal_True ); } } @@ -197,7 +190,7 @@ IMPL_LINK_NOARG(OCollectionView, NewFolder_Click) { Reference<XHierarchicalNameContainer> xNameContainer(m_xContent,UNO_QUERY); if ( dbaui::insertHierachyElement(this,m_xContext,xNameContainer,OUString(),m_bCreateForm) ) - m_aView.Initialize(m_xContent,OUString()); + m_pView->Initialize(m_xContent,OUString()); } catch( const SQLException& ) { @@ -221,11 +214,11 @@ IMPL_LINK_NOARG(OCollectionView, Up_Click) if ( xNameAccess.is() ) { m_xContent.set(xNameAccess,UNO_QUERY); - m_aView.Initialize(m_xContent,OUString()); + m_pView->Initialize(m_xContent,OUString()); initCurrentPath(); } else - m_aUp.Disable(); + m_pUp->Disable(); } } catch( const Exception& ) @@ -242,7 +235,7 @@ IMPL_LINK_NOARG(OCollectionView, Dbl_Click_FileView) Reference<XNameAccess> xNameAccess(m_xContent,UNO_QUERY); if ( xNameAccess.is() ) { - OUString sSubFolder = m_aView.GetCurrentURL(); + OUString sSubFolder = m_pView->GetCurrentURL(); sal_Int32 nIndex = sSubFolder.lastIndexOf('/') + 1; sSubFolder = sSubFolder.getToken(0,'/',nIndex); if ( !sSubFolder.isEmpty() ) @@ -253,7 +246,7 @@ IMPL_LINK_NOARG(OCollectionView, Dbl_Click_FileView) if ( xContent.is() ) { m_xContent = xContent; - m_aView.Initialize(m_xContent,OUString()); + m_pView->Initialize(m_xContent,OUString()); initCurrentPath(); } } @@ -281,9 +274,9 @@ void OCollectionView::initCurrentPath() if ( m_bCreateForm && sCID.getLength() != s_sFormsCID.getLength()) sPath = sCID.copy(s_sFormsCID.getLength()); else if ( !m_bCreateForm && sCID.getLength() != s_sReportsCID.getLength() ) - sPath = sCID.copy(s_sReportsCID.getLength()); + sPath = sCID.copy(s_sReportsCID.getLength() - 2); - m_aFTCurrentPath.SetText(sPath); + m_pFTCurrentPath->SetText(sPath); Reference<XChild> xChild(m_xContent,UNO_QUERY); bEnable = xChild.is() && Reference<XNameAccess>(xChild->getParent(),UNO_QUERY).is(); } @@ -292,12 +285,12 @@ void OCollectionView::initCurrentPath() { DBG_UNHANDLED_EXCEPTION(); } - m_aUp.Enable(bEnable); + m_pUp->Enable(bEnable); } OUString OCollectionView::getName() const { - return m_aName.GetText(); + return m_pName->GetText(); } } // namespace dbaui diff --git a/dbaccess/source/ui/dlg/CollectionView.hrc b/dbaccess/source/ui/dlg/CollectionView.hrc deleted file mode 100644 index 2fc2e9148d43..000000000000 --- a/dbaccess/source/ui/dlg/CollectionView.hrc +++ /dev/null @@ -1,43 +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_COLLECTIONVIEW_HRC -#define DBAUI_COLLECTIONVIEW_HRC - -#define CTRL_VIEW 1 - -#define PB_CANCEL 1 -#define PB_HELP 1 - -#define ED_EXPLORERFILE_FILENAME 1 - -#define FT_EXPLORERFILE_CURRENTPATH 1 -#define FT_EXPLORERFILE_FILENAME 2 - -#define BTN_EXPLORERFILE_NEWFOLDER 1 -#define BTN_EXPLORERFILE_UP 2 -#define BTN_EXPLORERFILE_SAVE 3 - -#define STR_PATHNAME 1 - -#define FL_1 1 - -#endif //DBAUI_COLLECTIONVIEW_HRC - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/dlg/CollectionView.src b/dbaccess/source/ui/dlg/CollectionView.src deleted file mode 100644 index 038531574084..000000000000 --- a/dbaccess/source/ui/dlg/CollectionView.src +++ /dev/null @@ -1,151 +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 . - */ - -#include "dbu_dlg.hrc" -#include "dbaccess_helpid.hrc" -#include "CollectionView.hrc" - -#define WIN_X 200 -#define WIN_Y 192 - -#define CHECKBOX_HEIGHT 8 -#define FIXEDTEXT_HEIGHT 8 -#define RELATED_CONTROLS 4 -#define UNRELATED_CONTROLS 7 -#define EDIT_HEIGHT 12 -#define BUTTON_HEIGHT 14 -#define FIXEDLINE_HEIGHT 1 -#define IMG_SIZE 15 - -ModalDialog DLG_COLLECTION_VIEW -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Moveable = TRUE ; - Closeable = TRUE ; - HelpId = HID_EXPLORERDLG_COLLECTION ; - - Size = MAP_APPFONT ( WIN_X , WIN_Y ) ; - Text [ en-US ] = "Save" ; - - FixedText FT_EXPLORERFILE_CURRENTPATH - { - Pos = MAP_APPFONT ( UNRELATED_CONTROLS , UNRELATED_CONTROLS ) ; - Size = MAP_APPFONT ( 100 , FIXEDTEXT_HEIGHT ) ; - NoLabel = TRUE ; - }; - ImageButton BTN_EXPLORERFILE_NEWFOLDER - { - HelpID = "dbaccess:ImageButton:DLG_COLLECTION_VIEW:BTN_EXPLORERFILE_NEWFOLDER"; - TabStop = FALSE ; - Pos = MAP_APPFONT ( WIN_X - UNRELATED_CONTROLS - RELATED_CONTROLS - 2*IMG_SIZE, UNRELATED_CONTROLS ) ; - Size = MAP_APPFONT ( IMG_SIZE , IMG_SIZE ) ; - QuickHelpText [ en-US ] = "Create New Directory" ; - }; - ImageButton BTN_EXPLORERFILE_UP - { - HelpID = "dbaccess:ImageButton:DLG_COLLECTION_VIEW:BTN_EXPLORERFILE_UP"; - TabStop = TRUE ; - Pos = MAP_APPFONT ( WIN_X - UNRELATED_CONTROLS - IMG_SIZE, UNRELATED_CONTROLS ) ; - Size = MAP_APPFONT ( IMG_SIZE , IMG_SIZE ) ; - QuickHelpText [ en-US ] = "Up One Level" ; - }; - - Control CTRL_VIEW - { - TabStop = TRUE ; - Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 2*UNRELATED_CONTROLS + IMG_SIZE) ; - Size = MAP_APPFONT ( WIN_X - 2*UNRELATED_CONTROLS , WIN_Y - 6*UNRELATED_CONTROLS - BUTTON_HEIGHT - IMG_SIZE - EDIT_HEIGHT - FIXEDTEXT_HEIGHT) ; - Border = TRUE ; - }; - - FixedText FT_EXPLORERFILE_FILENAME - { - Pos = MAP_APPFONT ( UNRELATED_CONTROLS , WIN_Y - 3*UNRELATED_CONTROLS - BUTTON_HEIGHT - FIXEDLINE_HEIGHT - EDIT_HEIGHT ) ; - Size = MAP_APPFONT ( 50 , FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "File ~name:" ; - }; - Edit ED_EXPLORERFILE_FILENAME - { - HelpID = "dbaccess:Edit:DLG_COLLECTION_VIEW:ED_EXPLORERFILE_FILENAME"; - Pos = MAP_APPFONT ( RELATED_CONTROLS + UNRELATED_CONTROLS + 50 , WIN_Y - 3*UNRELATED_CONTROLS - BUTTON_HEIGHT - FIXEDLINE_HEIGHT - EDIT_HEIGHT) ; - Size = MAP_APPFONT ( WIN_X - RELATED_CONTROLS - 2*UNRELATED_CONTROLS - 50 , EDIT_HEIGHT ) ; - Border = TRUE ; - TabStop = TRUE ; - }; - - FixedLine FL_1 - { - Pos = MAP_APPFONT ( 0 , WIN_Y - 2*UNRELATED_CONTROLS - BUTTON_HEIGHT - FIXEDLINE_HEIGHT) ; - Size = MAP_APPFONT ( WIN_X , FIXEDLINE_HEIGHT ) ; - }; - - PushButton BTN_EXPLORERFILE_SAVE - { - HelpID = "dbaccess:PushButton:DLG_COLLECTION_VIEW:BTN_EXPLORERFILE_SAVE"; - Pos = MAP_APPFONT ( WIN_X - 2*UNRELATED_CONTROLS - RELATED_CONTROLS - 150, WIN_Y - UNRELATED_CONTROLS - BUTTON_HEIGHT ) ; - Size = MAP_APPFONT ( 50 , BUTTON_HEIGHT ) ; - DefButton = TRUE ; - TabStop = TRUE ; - Text [ en-US ] = "Save" ; - }; - - CancelButton PB_CANCEL - { - TabStop = TRUE ; - Pos = MAP_APPFONT ( WIN_X - 2*UNRELATED_CONTROLS - 100, WIN_Y - UNRELATED_CONTROLS - BUTTON_HEIGHT ) ; - Size = MAP_APPFONT ( 50 , BUTTON_HEIGHT ) ; - }; - - HelpButton PB_HELP - { - TabStop = TRUE ; - Pos = MAP_APPFONT ( WIN_X - UNRELATED_CONTROLS - 50, WIN_Y - UNRELATED_CONTROLS - BUTTON_HEIGHT ) ; - Size = MAP_APPFONT ( 50 , BUTTON_HEIGHT ) ; - }; - - String STR_PATHNAME - { - Text [ en-US ] = "~Path:" ; - }; -}; - -String STR_NEW_FOLDER -{ - Text [ en-US ] = "Folder" ; -}; - -Image IMG_NAVIGATION_BTN_UP_SC -{ - ImageBitmap = Bitmap { File = "fp010"; }; - MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; -}; - -Image IMG_NAVIGATION_CREATEFOLDER_SC -{ - ImageBitmap = Bitmap { File = "fp015"; }; - MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; -}; - -String STR_ALREADYEXISTOVERWRITE -{ - Text [ en-US ] = "The file already exists. Overwrite?" ; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/dlg/dbadmin2.src b/dbaccess/source/ui/dlg/dbadmin2.src index d90d6dbec530..b3d3a784e6ba 100644 --- a/dbaccess/source/ui/dlg/dbadmin2.src +++ b/dbaccess/source/ui/dlg/dbadmin2.src @@ -39,4 +39,14 @@ String STR_COULD_NOT_CREATE_DIRECTORY Text [ en-US ] = "The directory $name$ could not be created."; }; +String STR_ALREADYEXISTOVERWRITE +{ + Text [ en-US ] = "The file already exists. Overwrite?" ; +}; + +String STR_NEW_FOLDER +{ + Text [ en-US ] = "Folder" ; +}; + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |