Kaydet (Commit) b29c078c authored tarafından Jan Holesovsky's avatar Jan Holesovsky

Convert template manager dialog to .ui + adapt code.

Change-Id: I854abb47c2d22206ed5581373b3e841f221672e3
üst bd20500c
......@@ -631,6 +631,12 @@
<glade-widget-class title="Template Thumbnail View" name="sfxlo-TemplateLocalView"
generic-name="Template Icon View" parent="GtkIconView"
icon-name="widget-gtk-iconview"/>
<glade-widget-class title="Template Search View" name="sfxlo-TemplateSearchView"
generic-name="Template Icon View" parent="GtkIconView"
icon-name="widget-gtk-iconview"/>
<glade-widget-class title="Template Remote View" name="sfxlo-TemplateRemoteView"
generic-name="Template Icon View" parent="GtkIconView"
icon-name="widget-gtk-iconview"/>
<glade-widget-class title="Driver List Control" name="cuilo-DriverListControl"
generic-name="DriverListControl" parent="GtkEntry"
......
......@@ -8,7 +8,7 @@
*/
#define NUM_TEMPLATE_NAMES 10
#define TEMPL_LOC_OFFSET 2190
#define TEMPL_LOC_OFFSET 2210
#define STR_TEMPLATE_NAME1_DEF (TEMPL_LOC_OFFSET + 1)
#define STR_TEMPLATE_NAME2_DEF (TEMPL_LOC_OFFSET + 2)
......
......@@ -429,8 +429,17 @@ public:
sal_Bool IsItemEnabled( sal_uInt16 nItemId ) const;
void TriggerItem( sal_uInt16 nItemId, sal_Bool bShift = sal_False, sal_Bool bCtrl = sal_False );
void ShowItem( sal_uInt16 nItemId, sal_Bool bVisible = sal_True );
void HideItem( sal_uInt16 nItemId ) { ShowItem( nItemId, sal_False ); }
/// Shows or hides items.
void ShowItem(sal_uInt16 nItemId, sal_Bool bVisible = sal_True);
/// Overload to provide ShowItem via command id.
void ShowItem(const OUString& rCommand, bool bVisible = true) { ShowItem(GetItemId(rCommand), bVisible); }
/// Convenience method to hide items (via ShowItem).
void HideItem(sal_uInt16 nItemId) { ShowItem( nItemId, sal_False ); }
/// Overload to provide HideItem via command id.
void HideItem(const OUString& rCommand) { ShowItem(rCommand, false); }
sal_Bool IsItemVisible( sal_uInt16 nItemId ) const;
sal_Bool IsItemReallyVisible( sal_uInt16 nItemId ) const;
......
......@@ -54,7 +54,6 @@ $(eval $(call gb_SrsTarget_add_files,sfx/res,\
sfx2/source/doc/doctempl.src \
sfx2/source/doc/new.src \
sfx2/source/doc/templatelocnames.src \
sfx2/source/doc/templatedlg.src \
sfx2/source/menu/menu.src \
sfx2/source/sidebar/Sidebar.src \
sfx2/source/view/view.src \
......
......@@ -13,6 +13,8 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\
sfx2/uiconfig/ui/alienwarndialog \
sfx2/uiconfig/ui/bookmarkdialog \
sfx2/uiconfig/ui/checkin \
sfx2/uiconfig/ui/cmisinfopage \
sfx2/uiconfig/ui/cmisline \
sfx2/uiconfig/ui/custominfopage \
sfx2/uiconfig/ui/descriptioninfopage \
sfx2/uiconfig/ui/documentfontspage \
......@@ -31,12 +33,11 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\
sfx2/uiconfig/ui/searchdialog \
sfx2/uiconfig/ui/securityinfopage \
sfx2/uiconfig/ui/singletabdialog \
sfx2/uiconfig/ui/startcenter \
sfx2/uiconfig/ui/versionsofdialog \
sfx2/uiconfig/ui/versioncommentdialog \
sfx2/uiconfig/ui/versionscmis \
sfx2/uiconfig/ui/startcenter \
sfx2/uiconfig/ui/cmisinfopage \
sfx2/uiconfig/ui/cmisline \
sfx2/uiconfig/ui/templatedlg \
))
# vim: set noet sw=4 ts=4:
......@@ -18,6 +18,8 @@
#include <vcl/tabpage.hxx>
#include <com/sun/star/frame/XDesktop2.hpp>
#include <sfx2/templateabstractview.hxx>
class Edit;
class PopupMenu;
class SfxTemplateInfoDlg;
......@@ -59,8 +61,6 @@ private:
void writeSettings ();
virtual void Resize ();
DECL_LINK(TBXViewHdl, void*);
DECL_LINK(TBXActionHdl, void*);
DECL_LINK(TBXTemplateHdl, void*);
......@@ -134,10 +134,12 @@ private:
void syncRepositories () const;
/// Return filter according to the currently selected tab page.
FILTER_APPLICATION getCurrentFilter();
private:
TabControl maTabControl;
TabPage maTabPage;
TabControl *mpTabControl;
Edit *mpSearchEdit;
ToolBox *mpViewBar;
......
......@@ -16,6 +16,7 @@
#include <tools/urlobj.hxx>
#include <ucbhelper/content.hxx>
#include <ucbhelper/commandenvironment.hxx>
#include <vcl/builder.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/task/InteractionHandler.hpp>
......@@ -53,6 +54,11 @@ TemplateRemoteView::TemplateRemoteView (Window *pParent, WinBits nWinStyle, bool
m_xCmdEnv = new ucbhelper::CommandEnvironment( xGlobalInteractionHandler, Reference< XProgressHandler >() );
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeTemplateRemoteView(Window *pParent, VclBuilder::stringmap &)
{
return new TemplateRemoteView(pParent, WB_VSCROLL, false);
}
TemplateRemoteView::~TemplateRemoteView ()
{
}
......
......@@ -8,14 +8,20 @@
*/
#include "templatesearchview.hxx"
#include "templatesearchviewitem.hxx"
#include <vcl/builder.hxx>
TemplateSearchView::TemplateSearchView (Window *pParent, WinBits nWinStyle)
: ThumbnailView(pParent,nWinStyle)
{
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeTemplateSearchView(Window *pParent, VclBuilder::stringmap &)
{
return new TemplateSearchView(pParent);
}
TemplateSearchView::~TemplateSearchView ()
{
}
......
......@@ -163,8 +163,30 @@
#define STR_QRYTEMPL_UPDATE_BTN (RID_SFX_DOC_START+128)
#define STR_QRYTEMPL_KEEP_BTN (RID_SFX_DOC_START+129)
#define STR_ACTION_SORT_NAME (RID_SFX_DOC_START+130)
#define STR_ACTION_REFRESH (RID_SFX_DOC_START+131)
#define STR_ACTION_DEFAULT (RID_SFX_DOC_START+132)
#define STR_MOVE_NEW (RID_SFX_DOC_START+133)
#define STR_INPUT_NEW (RID_SFX_DOC_START+134)
#define STR_REPOSITORY_LOCAL (RID_SFX_DOC_START+135)
#define STR_REPOSITORY_NEW (RID_SFX_DOC_START+136)
#define STR_MSG_ERROR_LOCAL_MOVE (RID_SFX_DOC_START+137)
#define STR_MSG_ERROR_REMOTE_MOVE (RID_SFX_DOC_START+138)
#define STR_MSG_ERROR_EXPORT (RID_SFX_DOC_START+139)
#define STR_MSG_ERROR_IMPORT (RID_SFX_DOC_START+140)
#define STR_MSG_ERROR_DELETE_TEMPLATE (RID_SFX_DOC_START+141)
#define STR_MSG_ERROR_DELETE_FOLDER (RID_SFX_DOC_START+142)
#define STR_MSG_ERROR_REPOSITORY_NAME (RID_SFX_DOC_START+143)
#define STR_MSG_ERROR_SELECT_FOLDER (RID_SFX_DOC_START+144)
#define STR_INPUT_TEMPLATE_NEW (RID_SFX_DOC_START+145)
#define STR_QMSG_SEL_FOLDER_DELETE (RID_SFX_DOC_START+146)
#define STR_QMSG_TEMPLATE_OVERWRITE (RID_SFX_DOC_START+147)
#define STR_QMSG_SEL_TEMPLATE_DELETE (RID_SFX_DOC_START+148)
#define IMG_ACTION_SORT (RID_SFX_DOC_START+149)
#define IMG_ACTION_REFRESH (RID_SFX_DOC_START+150)
// please update to the last id
#define ACT_SFX_DOC_END STR_QRYTEMPL_KEEP_BTN
#define ACT_SFX_DOC_END IMG_ACTION_REFRESH
#if ACT_SFX_DOC_END > RID_SFX_DOC_END
#error resource overflow in #line, #file
#endif
......
......@@ -431,6 +431,116 @@ String STR_QRYTEMPL_KEEP_BTN
Text [ en-US ] = "~Keep Old Styles";
};
// ******************************************************************* EOF
String STR_ACTION_SORT_NAME
{
Text [ en-US ] = "Sort by name";
};
String STR_ACTION_REFRESH
{
Text [ en-US ] = "Refresh";
};
String STR_ACTION_DEFAULT
{
Text [ x-comment ] = "leave ending space";
Text [ en-US ] = "Reset Default Template ";
};
String STR_MOVE_NEW
{
Text [ en-US ] = "New folder";
};
String STR_INPUT_NEW
{
Text [ en-US ] = "Enter folder name:";
};
String STR_REPOSITORY_LOCAL
{
Text [ en-US ] = "Local";
};
String STR_REPOSITORY_NEW
{
Text [ en-US ] = "New Repository";
};
String STR_MSG_ERROR_LOCAL_MOVE
{
Text [ en-US ] = "Error moving the following templates to $1.\n$2" ;
};
String STR_MSG_ERROR_REMOTE_MOVE
{
Text [ en-US ] = "Error moving the following templates from repository $1 to folder $2.\n$3" ;
};
String STR_MSG_ERROR_EXPORT
{
Text [ en-US ] = "Error exporting the following templates:\n$1";
};
String STR_MSG_ERROR_IMPORT
{
Text [ en-US ] = "Error importing the following templates to $1:\n$2";
};
String STR_MSG_ERROR_DELETE_TEMPLATE
{
Text [ en-US ] = "The following templates cannot be deleted:\n$1";
};
String STR_MSG_ERROR_DELETE_FOLDER
{
Text [ en-US ] = "The following folders cannot be deleted:\n$1";
};
String STR_MSG_ERROR_REPOSITORY_NAME
{
Text [ en-US ] = "Failed to create repository \"$1\".\nA repository with this name may already exist.";
};
String STR_MSG_ERROR_SELECT_FOLDER
{
Text [ en-US ] = "Select the destination folder(s) to save the template.";
};
String STR_INPUT_TEMPLATE_NEW
{
Text [ en-US ] = "Enter template name:";
};
String STR_QMSG_SEL_FOLDER_DELETE
{
Text [ en-US ] = "Do you want to delete the selected folders?";
};
String STR_QMSG_TEMPLATE_OVERWRITE
{
Text [ en-US ] = "A template named $1 already exist in $2. Do you want to overwrite it?";
};
String STR_QMSG_SEL_TEMPLATE_DELETE
{
Text [ en-US ] = "Do you want to delete the selected templates?";
};
Image IMG_ACTION_SORT
{
ImageBitmap = Bitmap
{
File = "sortascending.png";
};
};
Image IMG_ACTION_REFRESH
{
ImageBitmap = Bitmap
{
File = "reload.png";
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
/* -*- 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/.
*/
#define TAB_CONTROL 1
#define FILTER_DOCS 3
#define FILTER_PRESENTATIONS 4
#define FILTER_SHEETS 5
#define FILTER_DRAWS 6
#define TEMPLATE_VIEW 7
#define TBX_ACTION_VIEW 8
#define TOOLBARS 9
#define TBI_TEMPLATE_IMPORT 10
#define TBX_ACTION_ACTION 11
#define TBI_TEMPLATE_SEARCH 12
#define TBI_TEMPLATE_ACTION 13
#define TBX_ACTION_TEMPLATES 14
#define TBI_TEMPLATE_EDIT 15
#define TBI_TEMPLATE_PROPERTIES 16
#define TBI_TEMPLATE_MOVE 17
#define TBI_TEMPLATE_DELETE 18
#define TBI_TEMPLATE_DEFAULT 19
#define TBI_TEMPLATE_EXPORT 20
#define MNI_ACTION_REFRESH 22
#define MNI_ACTION_SORT_NAME 23
#define TBI_TEMPLATE_FOLDER_DEL 25
#define TBI_TEMPLATE_REPOSITORY 26
#define MNI_ACTION_DEFAULT 27
#define TBI_TEMPLATE_SAVE 28
#define TBI_TEMPLATE_FOLDER_NEW 29
#define TBI_TEMPLATE_OPEN 30
#define TBI_TEMPLATE_LINK 31
#define STR_ACTION_REFRESH 263
#define STR_ACTION_SORT_NAME 264
#define MNI_MOVE_NEW 265
#define MNI_MOVE_FOLDER_BASE 267
#define STR_MOVE_NEW 268
#define STR_INPUT_NEW 271
#define STR_REPOSITORY_LOCAL 272
#define STR_REPOSITORY_NEW 273
#define MNI_REPOSITORY_LOCAL 274
#define MNI_REPOSITORY_NEW 275
#define MNI_REPOSITORY_BASE 276
#define STR_ACTION_DEFAULT 277
#define STR_MSG_ERROR_LOCAL_MOVE 278
#define STR_MSG_ERROR_REMOTE_MOVE 279
#define STR_MSG_ERROR_IMPORT 280
#define STR_MSG_ERROR_EXPORT 281
#define STR_MSG_ERROR_DELETE_TEMPLATE 282
#define STR_MSG_ERROR_DELETE_FOLDER 283
#define STR_MSG_ERROR_REPOSITORY_NAME 284
#define STR_MSG_ERROR_SAVE_SELECT 285
#define STR_MSG_ERROR_SELECT_FOLDER 286
#define STR_INPUT_TEMPLATE_NEW 288
#define STR_QMSG_SEL_FOLDER_DELETE 289
#define STR_QMSG_TEMPLATE_OVERWRITE 290
#define STR_QMSG_SEL_TEMPLATE_DELETE 291
#define IMG_ACTION_SORT 304
#define IMG_ACTION_REFRESH 305
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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/.
*/
#include "doc.hrc"
#include "templatedlg.hrc"
#include "helpid.hrc"
String STR_ACTION_SORT_NAME
{
Text [ en-US ] = "Sort by name";
};
String STR_ACTION_REFRESH
{
Text [ en-US ] = "Refresh";
};
String STR_ACTION_DEFAULT
{
Text [ x-comment ] = "leave ending space";
Text [ en-US ] = "Reset Default Template ";
};
String STR_MOVE_NEW
{
Text [ en-US ] = "New folder";
};
String STR_INPUT_NEW
{
Text [ en-US ] = "Enter folder name:";
};
String STR_REPOSITORY_LOCAL
{
Text [ en-US ] = "Local";
};
String STR_REPOSITORY_NEW
{
Text [ en-US ] = "New Repository";
};
String STR_MSG_ERROR_LOCAL_MOVE
{
Text [ en-US ] = "Error moving the following templates to $1.\n$2" ;
};
String STR_MSG_ERROR_REMOTE_MOVE
{
Text [ en-US ] = "Error moving the following templates from repository $1 to folder $2.\n$3" ;
};
String STR_MSG_ERROR_EXPORT
{
Text [ en-US ] = "Error exporting the following templates:\n$1";
};
String STR_MSG_ERROR_IMPORT
{
Text [ en-US ] = "Error importing the following templates to $1:\n$2";
};
String STR_MSG_ERROR_DELETE_TEMPLATE
{
Text [ en-US ] = "The following templates cannot be deleted:\n$1";
};
String STR_MSG_ERROR_DELETE_FOLDER
{
Text [ en-US ] = "The following folders cannot be deleted:\n$1";
};
String STR_MSG_ERROR_REPOSITORY_NAME
{
Text [ en-US ] = "Failed to create repository \"$1\".\nA repository with this name may already exist.";
};
String STR_MSG_ERROR_SELECT_FOLDER
{
Text [ en-US ] = "Select the destination folder(s) to save the template.";
};
String STR_INPUT_TEMPLATE_NEW
{
Text [ en-US ] = "Enter template name:";
};
String STR_QMSG_SEL_FOLDER_DELETE
{
Text [ en-US ] = "Do you want to delete the selected folders?";
};
String STR_QMSG_TEMPLATE_OVERWRITE
{
Text [ en-US ] = "A template named $1 already exist in $2. Do you want to overwrite it?";
};
String STR_QMSG_SEL_TEMPLATE_DELETE
{
Text [ en-US ] = "Do you want to delete the selected templates?";
};
TabPage TAB_TEMPLATE_MANAGER
{
Size = MAP_APPFONT( 290, 220 );
Hide = TRUE;
Control TEMPLATE_VIEW
{
Pos = MAP_APPFONT( 0, 20 );
Size = MAP_APPFONT( 290, 200 );
TabStop = TRUE;
};
ToolBox TBX_ACTION_VIEW
{
SVLook = TRUE ;
TabStop = TRUE ;
Pos = MAP_APPFONT ( 4 , 0 ) ;
ItemList =
{
ToolBoxItem
{
Identifier = TBI_TEMPLATE_REPOSITORY;
Text [ en-US ] = "Repository";
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actionview026.png" ; };
};
};
ToolBoxItem
{
Identifier = TBI_TEMPLATE_IMPORT ;
Hide = TRUE;
Text [ en-US ] = "Import" ;
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actionview010.png" ; };
};
};
ToolBoxItem
{
Identifier = TBI_TEMPLATE_FOLDER_DEL;
Hide = TRUE;
Text [ en-US ] = "Delete";
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actionview025.png" ; };
};
};
ToolBoxItem
{
Identifier = TBI_TEMPLATE_SAVE;
Hide = TRUE;
Text [ en-US ] = "Save";
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actionview028.png" ; };
};
};
ToolBoxItem
{
Identifier = TBI_TEMPLATE_FOLDER_NEW;
Text [ en-US ] = "New folder";
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actionview029.png"; };
};
};
};
};
ToolBox TBX_ACTION_ACTION
{
SVLook = TRUE ;
Pos = MAP_APPFONT ( 4 , 0 ) ;
ItemList =
{
ToolBoxItem
{
Identifier = TBI_TEMPLATE_SEARCH;
Text [en-US] = "Search";
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actionaction012.png" ; };
};
};
ToolBoxItem
{
Identifier = TBI_TEMPLATE_ACTION;
Text [en-US] = "Action Menu";
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actionaction013.png" ; };
};
};
ToolBoxItem
{
Identifier = TBI_TEMPLATE_LINK;
Text [en-US] = "Get more templates for %PRODUCTNAME";
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actionview010.png" ; };
};
};
};
};
ToolBox TBX_ACTION_TEMPLATES
{
SVLook = TRUE ;
TabStop = TRUE ;
Pos = MAP_APPFONT ( 4 , 0 ) ;
Hide = TRUE;
ItemList =
{
ToolBoxItem
{
Identifier = TBI_TEMPLATE_SAVE;
Hide = TRUE;
Text [ en-US ] = "Save";
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actionview028.png" ; };
};
};
ToolBoxItem
{
Identifier = TBI_TEMPLATE_OPEN;
Text [ en-US ] = "Open";
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actionview030.png"; };
};
};
ToolBoxItem
{
Identifier = TBI_TEMPLATE_EDIT;
Text [ en-US ] = "Edit";
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actiontemplates019.png" ; };
};
};
ToolBoxItem
{
Identifier = TBI_TEMPLATE_PROPERTIES;
Text [ en-US ] = "Properties";
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actiontemplates016.png" ; };
};
};
ToolBoxItem
{
Identifier = TBI_TEMPLATE_DEFAULT;
Text [ en-US ] = "Set as default";
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actiontemplates015.png" ; };
};
};
ToolBoxItem
{
Identifier = TBI_TEMPLATE_MOVE;
Text [ en-US ] = "Move to folder" ;
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actiontemplates017.png" ; };
};
};
ToolBoxItem
{
Identifier = TBI_TEMPLATE_EXPORT;
Text [ en-US ] = "Export";
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actiontemplates020.png" ; };
};
};
ToolBoxItem
{
Identifier = TBI_TEMPLATE_DELETE;
Text [ en-US ] = "Delete";
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actiontemplates018.png" ; };
};
};
};
};
Image IMG_ACTION_SORT
{
ImageBitmap = Bitmap
{
File = "sortascending.png";
};
};
Image IMG_ACTION_REFRESH
{
ImageBitmap = Bitmap
{
File = "reload.png";
};
};
};
ModelessDialog DLG_TEMPLATE_MANAGER
{
OutputSize = TRUE;
SVLook = TRUE;
Moveable = TRUE;
Closeable = TRUE;
Sizeable = TRUE;
Hide = TRUE;
Size = MAP_APPFONT ( 290 , 250 );
Text [en-US] = "Template Manager";
TabControl TAB_CONTROL
{
OutputSize = TRUE;
Size = MAP_APPFONT( 290, 250 );
Pos = MAP_APPFONT( 0, 0 );
PageList =
{
PageItem
{
Identifier = FILTER_DOCS;
Text [ en-US ] = "Documents";
};
PageItem
{
Identifier = FILTER_SHEETS;
Text [ en-US ] = "Spreadsheets";
};
PageItem
{
Identifier = FILTER_PRESENTATIONS;
Text [ en-US ] = "Presentations";
};
PageItem
{
Identifier = FILTER_DRAWS;
Text [ en-US ] = "Drawings";
};
};
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
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