diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-11-27 12:40:15 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-11-27 12:51:39 +0100 |
commit | 872d76228fc440d22924b69a391f027dbdc8e693 (patch) | |
tree | 8c62817deff6b6636bb04d353af8be2ff7cc5052 /cui | |
parent | 602b746330d21ae1b9c0fc60eb0980ed92cd5680 (diff) |
Introduce a Restart dialog that allows to automatically restart LO
...instead of just telling the user to restart manually.
The one existing dialog (duplicated into svtools and cui) that got replaced by
this is the dialog asking to restart when the choice of JVM changed. There are
more similar dialogs that would benefit from replacing them, like
RID_SVX_MSGBOX_OPTIONS_RESTART (cui/source/options/optjava.src), but that one is
called when closing a dialog nested within the Options dialog, and calling
OfficeRestartManger.requestRestart in such a nested situation still leads to a
crash.
The design idea is that when more similar dialogs are replaced, restartdialog.ui
contains a list of hidden GtkLables with the appropriate prose why a restart is
required in the given case, and restartdialog.hxx's RestartReason enum contains
corresponding values that will show exactly one of those GtkLables.
The new svtools/uiconfig/ui/restartdialog.ui is probably still pretty rough and
could benefit from some UX love.
Change-Id: Id939188ee22f24301a8a3598b83afb31339bded5
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/cuires.hrc | 2 | ||||
-rw-r--r-- | cui/source/options/optjava.cxx | 6 | ||||
-rw-r--r-- | cui/source/options/optjava.src | 7 |
3 files changed, 5 insertions, 10 deletions
diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc index c497fda23f2f..1e14f8238f1c 100644 --- a/cui/source/inc/cuires.hrc +++ b/cui/source/inc/cuires.hrc @@ -24,7 +24,7 @@ // Resource-Id's ------------------------------------------------------------ -#define RID_SVX_MSGBOX_JAVA_RESTART (RID_SVX_START + 0) +// RID_SVX_START + 0 unused #define RID_SVX_MSGBOX_OPTIONS_RESTART (RID_SVX_START + 1) #define RID_SVX_MSGBOX_LANGUAGE_RESTART (RID_SVX_START + 2) #define RID_CUI_DIALOG_COLORPICKER (RID_SVX_START + 3) diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 32d944186f71..821bb9284dfc 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -32,6 +32,7 @@ #include <vcl/waitobj.hxx> #include <unotools/pathoptions.hxx> #include <svtools/imagemgr.hxx> +#include "svtools/restartdialog.hxx" #include "svtools/treelistentry.hxx" #include <sfx2/filedlghelper.hxx> #include <comphelper/processfactory.hxx> @@ -662,8 +663,9 @@ sal_Bool SvxJavaOptionsPage::FillItemSet( SfxItemSet& /*rCoreSet*/ ) if ( bRunning || ( ( pInfo->nRequirements & JFW_REQUIRE_NEEDRESTART ) == JFW_REQUIRE_NEEDRESTART ) ) { - WarningBox aWarnBox( this, CUI_RES( RID_SVX_MSGBOX_JAVA_RESTART ) ); - aWarnBox.Execute(); + svtools::executeRestartDialog( + comphelper::getProcessComponentContext(), this, + svtools::RESTART_REASON_JAVA); } eErr = jfw_setSelectedJRE( pInfo ); diff --git a/cui/source/options/optjava.src b/cui/source/options/optjava.src index 77cd195386ba..4ee27517a2bf 100644 --- a/cui/source/options/optjava.src +++ b/cui/source/options/optjava.src @@ -290,13 +290,6 @@ ErrorBox RID_SVXERR_JRE_FAILED_VERSION Message [ en-US ] = "The Java runtime environment you selected is not the required version.\nPlease select a different folder." ; }; -WarningBox RID_SVX_MSGBOX_JAVA_RESTART -{ - BUTTONS = WB_OK ; - DEFBUTTON = WB_DEF_OK ; - Message [ en-US ] = "For the selected Java runtime environment to work properly, %PRODUCTNAME must be restarted.\nPlease restart %PRODUCTNAME now." ; -}; - WarningBox RID_SVX_MSGBOX_OPTIONS_RESTART { BUTTONS = WB_OK ; |