Archy - Archaeology Assistant

402 - Confirm before reloading

What is the enhancement in mind? How should it look and feel?

Archy should not reload the UI without confirmation, in particular when we just choose a setting from a dropdown list. The warning is the tooltip is very easy to miss.

Please provide any additional information below.

Here's the code I've added to my local copy of config.lua for reload confirmation.

At the top of the file.

_G.StaticPopupDialogs["ARCHY_CONFIRM_RELOAD"] = {
  preferredIndex = 3,

  text = "Do you really want to reload the UI?",
  button1 = YES,
  button2 = NO,
  OnAccept = function()
      _G.ReloadUI();
  end,
  timeout = 0,
  whileDead = true,
  hideOnEscape = true,
};

In the GetGeneralOption() function:

archyTheme = {
	order = 5,
	type = "select",
	name = L["Style"],
	desc = L["The style of display for Archy.  This will reload your UI after selecting"],
	get = function() return db.general.theme end,
	set = function(_, value)
		db.general.theme = value
--		_G.ReloadUI()
		_G.StaticPopup_Show ("ARCHY_CONFIRM_RELOAD")
	end,
User When Change
LaoTseu Jul 21, 2012 at 00:42 UTC Changed description:
  In the **GetGeneralOption()** function:

  <<code lua>>
- 				archyTheme = {
+ archyTheme = {
- 					order = 5,
+ 	order = 5,
- 					type = "select",
+ 	type = "select",
- 					name = L["Style"],
+ 	name = L["Style"],
- 					desc = L["The style of display for Archy.  This will reload your UI after selecting"],
+ 	desc = L["The style of display for Archy.  This will reload your UI after selecting"],
- 					get = function() return db.general.theme end,
+ 	get = function() return db.general.theme end,
- 					set = function(_, value)
+ 	set = function(_, value)
- 						db.general.theme = value
+ 		db.general.theme = value
- --						_G.ReloadUI()
+ --		_G.ReloadUI()
- 						_G.StaticPopup_Show ("ARCHY_CONFIRM_RELOAD")
+ 		_G.StaticPopup_Show ("ARCHY_CONFIRM_RELOAD")
- 					end,
+ 	end,
  <</code>>
LaoTseu Jul 21, 2012 at 00:41 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • 2 comments
  • Avatar of KFCKeith KFCKeith Oct 17, 2012 at 18:47 UTC - 0 likes

    @Dridzt: Go

    Include a warning or prompt that Selecting this Option will force an Immediate Reload of the UI. Although, I'm not sure you're right about there not being a user option, since the Addon called Addon Control Panel has a ReLoadUI button...

  • Avatar of Dridzt Dridzt Jul 26, 2012 at 04:24 UTC - 0 likes

    The problem is that as it stands this can't be a user option whether to reloadUI or not.

    A reloadUI is triggered only when a change in options would result in a new set of secure frames needing to spawn.

    Choosing the option and then aborting the reload will just break a bunch of frames horribly.

    The only 'proper' way to do this is put the static popup on the affected config choices and revert the setting if the user changes their mind.

    Switching from a minimal to a full style theme or vice-versa and not reloading will just lead to a torrent of errors.

  • 2 comments

Facts

Last updated
Jul 21, 2012
Reported
Jul 21, 2012
Status
New - Issue has not had initial review yet.
Type
Enhancement - A change which is intended to better the project in some way
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees