Move QueryDialog to svtools
Move QueryDialog from cui to a public svtools header. This is in preparation of using the class directly and dropping the AbstractQueryDialog abstraction altogether. The dialog can e.g. be triggered like this: * start Writer * Ctrl+Shift+S for "Save As" * select "Text (.txt)" for the file type * press OK (Resetting the profile ensures the dialog gets shown in case the "Don't show again" checkbox has been ticked previously.) Change-Id: I57bdade32c21c7ab40c5a4c90bd86e8dea5d2fad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210136 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
@@ -140,7 +140,6 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
|
||||
cui/source/dialogs/screenshotannotationdlg \
|
||||
cui/source/dialogs/pastedlg \
|
||||
cui/source/dialogs/postdlg \
|
||||
cui/source/dialogs/querydialog \
|
||||
cui/source/dialogs/QrCodeGenDialog \
|
||||
cui/source/dialogs/GraphicTestsDialog \
|
||||
cui/source/dialogs/ImageViewerDialog \
|
||||
|
||||
@@ -184,7 +184,6 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
|
||||
cui/uiconfig/ui/querydeletehatchdialog \
|
||||
cui/uiconfig/ui/querydeletelineenddialog \
|
||||
cui/uiconfig/ui/querydeletelinestyledialog \
|
||||
cui/uiconfig/ui/querydialog \
|
||||
cui/uiconfig/ui/queryduplicatedialog \
|
||||
cui/uiconfig/ui/querynoloadedfiledialog \
|
||||
cui/uiconfig/ui/querynosavefiledialog \
|
||||
|
||||
@@ -89,7 +89,4 @@ inline constexpr OUString RID_SVXBMP_TOTD_DRAW = u"res/tipoftheday_d.png"_ustr;
|
||||
inline constexpr OUString RID_SVXBMP_TOTD_IMPRESS = u"res/tipoftheday_i.png"_ustr;
|
||||
inline constexpr OUString RID_SVXBMP_TOTD_SOFFICE = u"res/tipoftheday.png"_ustr;
|
||||
|
||||
inline constexpr OUString RID_CUIBMP_QUERY = u"res/query.png"_ustr;
|
||||
inline constexpr OUString RID_CUIBMP_WARN = u"res/warn.png"_ustr;
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|
||||
|
||||
@@ -97,11 +97,12 @@
|
||||
#include <DiagramDialog.hxx>
|
||||
#include <fileextcheckdlg.hxx>
|
||||
#include <TextColumnsPage.hxx>
|
||||
#include <querydialog.hxx>
|
||||
#include <welcomedlg.hxx>
|
||||
|
||||
#include <MacroManagerDialog.hxx>
|
||||
|
||||
#include <svtools/querydialog.hxx>
|
||||
|
||||
using namespace ::com::sun::star::frame;
|
||||
using namespace ::com::sun::star::container;
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <svtools/svtdllapi.h>
|
||||
#include <vcl/weld/Button.hxx>
|
||||
#include <vcl/weld/CheckButton.hxx>
|
||||
#include <vcl/weld/DialogController.hxx>
|
||||
@@ -25,7 +26,7 @@
|
||||
#include <vcl/weld/Label.hxx>
|
||||
#include <vcl/weld/Window.hxx>
|
||||
|
||||
class QueryDialog final : public weld::GenericDialogController
|
||||
class SVT_DLLPUBLIC QueryDialog final : public weld::GenericDialogController
|
||||
{
|
||||
private:
|
||||
std::unique_ptr<weld::Label> m_pTitle;
|
||||
@@ -113,6 +113,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
|
||||
svtools/source/dialogs/insdlg \
|
||||
svtools/source/dialogs/PlaceEditDialog \
|
||||
svtools/source/dialogs/prnsetup \
|
||||
svtools/source/dialogs/querydialog \
|
||||
svtools/source/dialogs/restartdialog \
|
||||
svtools/source/dialogs/ServerDetailsControls \
|
||||
svtools/source/filter/SvFilterOptionsDialog \
|
||||
|
||||
@@ -30,6 +30,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svt,\
|
||||
svtools/uiconfig/ui/placeedit \
|
||||
svtools/uiconfig/ui/printersetupdialog \
|
||||
svtools/uiconfig/ui/querydeletedialog \
|
||||
svtools/uiconfig/ui/querydialog \
|
||||
svtools/uiconfig/ui/restartdialog \
|
||||
svtools/uiconfig/ui/scrollbars \
|
||||
svtools/uiconfig/ui/spinfieldcontrol \
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rtl/ustring.hxx>
|
||||
|
||||
inline constexpr OUString BMP_IMPRESS_SC = u"res/sx03123.png"_ustr;
|
||||
inline constexpr OUString BMP_BITMAP_SC = u"res/sx03125.png"_ustr;
|
||||
inline constexpr OUString BMP_CALC_SC = u"res/sx03126.png"_ustr;
|
||||
@@ -122,6 +124,8 @@ inline constexpr OUString BMP_PRIMARYKEY = u"svtools/res/ed06.png"_ustr;
|
||||
inline constexpr OUString BMP_CURRENT_PRIMARYKEY = u"svtools/res/ed07.png"_ustr;
|
||||
inline constexpr OUString BMP_FILTER = u"svtools/res/ed08.png"_ustr;
|
||||
inline constexpr OUString BMP_HEADERFOOTER = u"svtools/res/ed09.png"_ustr;
|
||||
inline constexpr OUString BMP_QUERY = u"res/query.png"_ustr;
|
||||
inline constexpr OUString BMP_WARN = u"res/warn.png"_ustr;
|
||||
|
||||
inline constexpr OUString BMP_TAB_LOCK = u"cmd/sc_lock.png"_ustr;
|
||||
|
||||
|
||||
@@ -17,13 +17,14 @@
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
*/
|
||||
|
||||
#include <querydialog.hxx>
|
||||
#include <bitmaps.hlst>
|
||||
|
||||
#include <svtools/querydialog.hxx>
|
||||
#include <vcl/weld/Builder.hxx>
|
||||
|
||||
QueryDialog::QueryDialog(weld::Window* pParent, const OUString& sTitle, const OUString& sText,
|
||||
const OUString& sQuestion, bool bHideShowAgain)
|
||||
: GenericDialogController(pParent, u"cui/ui/querydialog.ui"_ustr, u"QueryDialog"_ustr)
|
||||
: GenericDialogController(pParent, u"svt/ui/querydialog.ui"_ustr, u"QueryDialog"_ustr)
|
||||
, m_pTitle(m_xBuilder->weld_label(u"lbTitle"_ustr))
|
||||
, m_pText(m_xBuilder->weld_label(u"lbText"_ustr))
|
||||
, m_pQuestion(m_xBuilder->weld_label(u"lbQuestion"_ustr))
|
||||
@@ -37,7 +38,7 @@ QueryDialog::QueryDialog(weld::Window* pParent, const OUString& sTitle, const OU
|
||||
m_pTitle->set_label(sTitle);
|
||||
m_pText->set_label(sText);
|
||||
m_pQuestion->set_label(sQuestion);
|
||||
m_pImage->set_from_icon_name(RID_CUIBMP_QUERY);
|
||||
m_pImage->set_from_icon_name(BMP_QUERY);
|
||||
|
||||
if (bHideShowAgain)
|
||||
m_pCheckBox->hide();
|
||||
@@ -57,6 +58,6 @@ void QueryDialog::SetNoLabel(const OUString& rLabel)
|
||||
m_pNo->set_visible(false);
|
||||
}
|
||||
|
||||
void QueryDialog::SetTypeWarn() { m_pImage->set_from_icon_name(RID_CUIBMP_WARN); }
|
||||
void QueryDialog::SetTypeWarn() { m_pImage->set_from_icon_name(BMP_WARN); }
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
@@ -118,7 +118,6 @@ constexpr auto SUPPORTED_UI_FILES = frozen::make_unordered_set<std::u16string_vi
|
||||
u"cui/ui/querydeletehatchdialog.ui",
|
||||
u"cui/ui/querydeletelineenddialog.ui",
|
||||
u"cui/ui/querydeletelinestyledialog.ui",
|
||||
u"cui/ui/querydialog.ui",
|
||||
u"cui/ui/queryduplicatedialog.ui",
|
||||
u"cui/ui/querysavelistdialog.ui",
|
||||
u"cui/ui/queryupdategalleryfilelistdialog.ui",
|
||||
@@ -375,6 +374,7 @@ constexpr auto SUPPORTED_UI_FILES = frozen::make_unordered_set<std::u16string_vi
|
||||
u"svt/ui/addresstemplatedialog.ui",
|
||||
u"svt/ui/placeedit.ui",
|
||||
u"svt/ui/printersetupdialog.ui",
|
||||
u"svt/ui/querydialog.ui",
|
||||
u"svt/ui/restartdialog.ui",
|
||||
u"svx/ui/acceptrejectchangesdialog.ui",
|
||||
u"svx/ui/addconditiondialog.ui",
|
||||
|
||||
Reference in New Issue
Block a user