diff options
author | Richard Nelson <none@none> | 2010-04-01 11:47:21 -0700 |
---|---|---|
committer | Richard Nelson <none@none> | 2010-04-01 11:47:21 -0700 |
commit | 7b4046df83e4353bdade8fbc39387a7bbb3f498d (patch) | |
tree | 2a33ba96f17375830b9e2931a1ebbdc687380ee3 /indra/newview | |
parent | 2bb03e5edb5572de1ea31c66f439c8cde9cd2197 (diff) |
EXT-3531 - Ctrl-P does not work reliably on login
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/lllocationinputctrl.cpp | 1 | ||||
-rw-r--r-- | indra/newview/lltoastalertpanel.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llurllineeditorctrl.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llurllineeditorctrl.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewercontrol.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llviewermenu.h | 1 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 129 |
8 files changed, 49 insertions, 109 deletions
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index ba50287ebd..ad2e594b49 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -227,7 +227,6 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) params.default_text(LLStringUtil::null); params.max_length_bytes(p.max_chars); params.keystroke_callback(boost::bind(&LLComboBox::onTextEntry, this, _1)); - params.handle_edit_keys_directly(true); params.commit_on_focus_lost(false); params.follows.flags(FOLLOWS_ALL); mTextEntry = LLUICtrlFactory::create<LLURLLineEditor>(params); diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index c3ccb9380b..986ccdf19b 100644 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -281,9 +281,6 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal mLineEditor->setText(edit_text_contents); mLineEditor->setMaxTextLength(STD_STRING_STR_LEN - 1); - // make sure all edit keys get handled properly (DEV-22396) - mLineEditor->setHandleEditKeysDirectly(TRUE); - LLToastPanel::addChild(mLineEditor); mLineEditor->setDrawAsterixes(is_password); diff --git a/indra/newview/llurllineeditorctrl.cpp b/indra/newview/llurllineeditorctrl.cpp index 258c3ddd75..1d2687a8c2 100644 --- a/indra/newview/llurllineeditorctrl.cpp +++ b/indra/newview/llurllineeditorctrl.cpp @@ -72,7 +72,7 @@ void LLURLLineEditor::cut() if( need_to_rollback ) { rollback.doRollback( this ); - reportBadKeystroke(); + LLUI::reportBadKeystroke(); } else if( mKeystrokeCallback ) @@ -96,8 +96,3 @@ void LLURLLineEditor::copyEscapedURLToClipboard() gClipboard.copyFromString( text_to_copy ); } -// Makes UISndBadKeystroke sound -void LLURLLineEditor::reportBadKeystroke() -{ - make_ui_sound("UISndBadKeystroke"); -} diff --git a/indra/newview/llurllineeditorctrl.h b/indra/newview/llurllineeditorctrl.h index 618f29dfbf..ebe417e855 100644 --- a/indra/newview/llurllineeditorctrl.h +++ b/indra/newview/llurllineeditorctrl.h @@ -55,8 +55,6 @@ protected: private: // util function to escape selected text and copy it to clipboard void copyEscapedURLToClipboard(); - // send a beep signal if keystroke is bad. As it is private at LLLineEditor we need own function - void reportBadKeystroke(); // Helper class to do rollback if needed class LLURLLineEditorRollback diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 23349ab916..b2b7e653e4 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -74,6 +74,7 @@ #include "llnavigationbar.h" #include "llfloatertools.h" #include "llpaneloutfitsinventory.h" +#include "llpanellogin.h" #ifdef TOGGLE_HACKED_GODLIKE_VIEWER BOOL gHackGodmode = FALSE; @@ -443,6 +444,12 @@ bool handleVelocityInterpolate(const LLSD& newvalue) return true; } +bool handleForceShowGrid(const LLSD& newvalue) +{ + LLPanelLogin::refreshLocation( false ); + return true; +} + bool toggle_agent_pause(const LLSD& newvalue) { if ( newvalue.asBoolean() ) @@ -648,6 +655,7 @@ void settings_setup_listeners() gSavedSettings.getControl("ShowNavbarFavoritesPanel")->getSignal()->connect(boost::bind(&toggle_show_favorites_panel, _2)); gSavedSettings.getControl("ShowDebugAppearanceEditor")->getSignal()->connect(boost::bind(&toggle_show_appearance_editor, _2)); gSavedSettings.getControl("ShowObjectRenderingCost")->getSignal()->connect(boost::bind(&toggle_show_object_render_cost, _2)); + gSavedSettings.getControl("ForceShowGrid")->getSignal()->connect(boost::bind(&handleForceShowGrid, _2)); } #if TEST_CACHED_CONTROL diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 3a6aed01ce..eae60b4d85 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -136,6 +136,7 @@ extern BOOL gDebugWindowProc; LLMenuBarGL *gMenuBarView = NULL; LLViewerMenuHolderGL *gMenuHolder = NULL; LLMenuGL *gPopupMenuView = NULL; +LLMenuGL *gEditMenu = NULL; LLMenuBarGL *gLoginMenuBarView = NULL; // Pie menus @@ -383,8 +384,10 @@ void init_menus() /// /// Context menus /// + const widget_registry_t& registry = LLViewerMenuHolderGL::child_registry_t::instance(); + gEditMenu = LLUICtrlFactory::createFromFile<LLMenuGL>("menu_edit.xml", gMenuHolder, registry); gMenuAvatarSelf = LLUICtrlFactory::createFromFile<LLContextMenu>( "menu_avatar_self.xml", gMenuHolder, registry); gMenuAvatarOther = LLUICtrlFactory::createFromFile<LLContextMenu>( @@ -5182,10 +5185,6 @@ void toggle_debug_menus(void*) { BOOL visible = ! gSavedSettings.getBOOL("UseDebugMenus"); gSavedSettings.setBOOL("UseDebugMenus", visible); - if(visible) - { - //LLFirstUse::useDebugMenus(); - } show_debug_menus(); } diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index d3c34f0de4..d72ea00077 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -157,6 +157,7 @@ extern const std::string SAVE_INTO_INVENTORY; extern LLMenuBarGL* gMenuBarView; //extern LLView* gMenuBarHolder; +extern LLMenuGL* gEditMenu; extern LLMenuGL* gPopupMenuView; extern LLViewerMenuHolderGL* gMenuHolder; extern LLMenuBarGL* gLoginMenuBarView; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 85c961f34a..6fb1a054ed 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2145,12 +2145,14 @@ void LLViewerWindow::draw() // Takes a single keydown event, usually when UI is visible BOOL LLViewerWindow::handleKey(KEY key, MASK mask) { + // hide tooltips on keypress + LLToolTipMgr::instance().blockToolTips(); + if (gFocusMgr.getKeyboardFocus() && !(mask & (MASK_CONTROL | MASK_ALT)) && !gFocusMgr.getKeystrokesOnly()) { // We have keyboard focus, and it's not an accelerator - if (key < 0x80) { // Not a special key, so likely (we hope) to generate a character. Let it fall through to character handler first. @@ -2158,68 +2160,49 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) } } - // hide tooltips on keypress - LLToolTipMgr::instance().blockToolTips(); - - // Explicit hack for debug menu. - if ((MASK_ALT & mask) && - (MASK_CONTROL & mask) && - ('D' == key || 'd' == key)) + // let menus handle navigation keys for navigation + if ((gMenuBarView && gMenuBarView->handleKey(key, mask, TRUE)) + ||(gLoginMenuBarView && gLoginMenuBarView->handleKey(key, mask, TRUE)) + ||(gMenuHolder && gMenuHolder->handleKey(key, mask, TRUE))) { - toggle_debug_menus(NULL); + return TRUE; } - // Explicit hack for debug menu. - if ((mask == (MASK_SHIFT | MASK_CONTROL)) && - ('G' == key || 'g' == key)) + // give menus a chance to handle modified (Ctrl, Alt) shortcut keys before current focus + // as long as focus isn't locked + if (mask & (MASK_CONTROL | MASK_ALT) && !gFocusMgr.focusLocked()) { - if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) //on splash page + if ((gMenuBarView && gMenuBarView->handleAcceleratorKey(key, mask)) + ||(gLoginMenuBarView && gLoginMenuBarView->handleAcceleratorKey(key, mask))) { - BOOL visible = ! gSavedSettings.getBOOL("ForceShowGrid"); - gSavedSettings.setBOOL("ForceShowGrid", visible); - - // Initialize visibility (and don't force visibility - use prefs) - LLPanelLogin::refreshLocation( false ); + return TRUE; } } - // Debugging view for unified notifications: CTRL-SHIFT-5 - // *FIXME: Having this special-cased right here (just so this can be invoked from the login screen) sucks. - if ((MASK_SHIFT & mask) - && (!(MASK_ALT & mask)) - && (MASK_CONTROL & mask) - && ('5' == key)) + // give floaters first chance to handle TAB key + // so frontmost floater gets focus + // if nothing has focus, go to first or last UI element as appropriate + if (key == KEY_TAB && (mask & MASK_CONTROL || gFocusMgr.getKeyboardFocus() == NULL)) { - //LLFloaterNotificationConsole::showInstance(); - LLFloaterReg::showInstance("notifications_console"); - return TRUE; - } + if (gMenuHolder) gMenuHolder->hideMenus(); - // handle escape key - //if (key == KEY_ESCAPE && mask == MASK_NONE) - //{ + // if CTRL-tabbing (and not just TAB with no focus), go into window cycle mode + gFloaterView->setCycleMode((mask & MASK_CONTROL) != 0); - // *TODO: get this to play well with mouselook and hidden - // cursor modes, etc, and re-enable. - //if (gFocusMgr.getMouseCapture()) - //{ - // gFocusMgr.setMouseCapture(NULL); - // return TRUE; - //} - //} - - // let menus handle navigation keys - if (gMenuBarView && gMenuBarView->handleKey(key, mask, TRUE)) - { - return TRUE; - } - // let menus handle navigation keys - if (gLoginMenuBarView && gLoginMenuBarView->handleKey(key, mask, TRUE)) - { + // do CTRL-TAB and CTRL-SHIFT-TAB logic + if (mask & MASK_SHIFT) + { + mRootView->focusPrevRoot(); + } + else + { + mRootView->focusNextRoot(); + } return TRUE; } - //some of context menus use this container, let context menu handle navigation keys - if(gMenuHolder && gMenuHolder->handleKey(key, mask, TRUE)) + + // hidden edit menu for cut/copy/paste + if (gEditMenu && gEditMenu->handleAcceleratorKey(key, mask)) { return TRUE; } @@ -2284,50 +2267,10 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) return TRUE; } - // Topmost view gets a chance before the hierarchy - // *FIX: get rid of this? - //LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); - //if (top_ctrl) - //{ - // if( top_ctrl->handleKey( key, mask, TRUE ) ) - // { - // return TRUE; - // } - //} - - // give floaters first chance to handle TAB key - // so frontmost floater gets focus - if (key == KEY_TAB) - { - // if nothing has focus, go to first or last UI element as appropriate - if (mask & MASK_CONTROL || gFocusMgr.getKeyboardFocus() == NULL) - { - if (gMenuHolder) gMenuHolder->hideMenus(); - - // if CTRL-tabbing (and not just TAB with no focus), go into window cycle mode - gFloaterView->setCycleMode((mask & MASK_CONTROL) != 0); - // do CTRL-TAB and CTRL-SHIFT-TAB logic - if (mask & MASK_SHIFT) - { - mRootView->focusPrevRoot(); - } - else - { - mRootView->focusNextRoot(); - } - return TRUE; - } - } - - // give menus a chance to handle keys - if (gMenuBarView && gMenuBarView->handleAcceleratorKey(key, mask)) - { - return TRUE; - } - - // give menus a chance to handle keys - if (gLoginMenuBarView && gLoginMenuBarView->handleAcceleratorKey(key, mask)) + // give menus a chance to handle unmodified accelerator keys + if ((gMenuBarView && gMenuBarView->handleAcceleratorKey(key, mask)) + ||(gLoginMenuBarView && gLoginMenuBarView->handleAcceleratorKey(key, mask))) { return TRUE; } |