Skip to content

Commit

Permalink
Merge pull request #65 from cwh42/master
Browse files Browse the repository at this point in the history
Add handler for Shift-F1 to show advanced keyboard shortcuts
  • Loading branch information
cwh42 committed Nov 21, 2016
2 parents d7ec67d + 07edabd commit 5cb91cd
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 4 deletions.
4 changes: 2 additions & 2 deletions VERSION.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SET(VERSION_MAJOR "2")
SET(VERSION_MINOR "46")
SET(VERSION_PATCH "30")
SET(VERSION_MINOR "47")
SET(VERSION_PATCH "0")
SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${GIT_SHA1_VERSION}" )

##### This is need for the libyui core, ONLY.
Expand Down
2 changes: 1 addition & 1 deletion package/libyui-qt-doc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
%define so_version 7

Name: %{parent}-doc
Version: 2.46.30
Version: 2.47.0
Release: 0
Source: %{parent}-%{version}.tar.bz2

Expand Down
6 changes: 6 additions & 0 deletions package/libyui-qt.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Nov 9 16:56:49 UTC 2016 - cwh@suse.com

- Add handler for Shift-F1 to show advanced keyboard shortcuts (bsc#1010039)
- 2.47.0

-------------------------------------------------------------------
Mon Oct 17 21:22:16 UTC 2016 - igonzalezsosa@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/libyui-qt.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: libyui-qt
Version: 2.46.30
Version: 2.47.0
Release: 0
Source: %{name}-%{version}.tar.bz2

Expand Down
57 changes: 57 additions & 0 deletions src/YQWizard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ YQWizard::YQWizard( YWidget * parent,
, _abortButtonLabel( abortButtonLabel )
, _nextButtonLabel( nextButtonLabel )
, _helpDlg ( NULL )
, _hotkeysDlg ( NULL )
, _relNotesDlg ( NULL )
{
setObjectName( "wizard" );
Expand Down Expand Up @@ -196,6 +197,7 @@ YQWizard::~YQWizard()
}

delete _helpDlg;
delete _hotkeysDlg;
delete _relNotesDlg;

QY2Styler::styler()->unregisterWidget( this );
Expand Down Expand Up @@ -873,6 +875,13 @@ QLayout *YQWizard::layoutButtonBox( QWidget * parent )
connect( _helpAction, &pclass( _helpAction )::triggered,
this, &pclass( this )::showHelp );

// Help action to be able to react to Shift-F1 to show hotkeys
_hotkeysAction = new QAction( this );
_hotkeysAction->setShortcut( Qt::ShiftModifier + Qt::Key_F1 );
addAction( _hotkeysAction );

connect( _hotkeysAction, &pclass( _hotkeysAction )::triggered,
this, &pclass( this )::showHotkeys );

hbox->addSpacing( 10 );

Expand Down Expand Up @@ -1097,6 +1106,51 @@ void YQWizard::showHelp()
}


void YQWizard::showHotkeys()
{
/**
* Help text to be shown after pressing Shift-F1 listing the advanced
* keyboard shortcuts available in the Qt-UI
**/
_qHotkeysText = _(
"<h1>Advanced Hotkeys</h1>"
"<dl>"
"<dt>Print Screen</dt>"
"<dd>Take and save a screenshot. May not be available when YaST is running under "
"some desktop environments.</dd>"
"<dt>Shift-F4</dt>"
"<dd>Enable/disable the color palette optimized for vision impaired users.</dd>"
"<dt>Shift-F7</dt>"
"<dd>Enable/disable logging of debug messages.</dd>"
"<dt>Shift-F8</dt>"
"<dd>Open a file dialog to save log files to a non-standard location.</dd>"
"<dt>Ctrl-Shift-Alt-D</dt>"
"<dd>Send a DebugEvent. YaST modules can react on this by executing "
"special debugging actions. Result depends on the specific YaST-module.</dd>"
"<dt>Ctrl-Shift-Alt-M</dt>"
"<dd>Start/Stop macro recorder.</dd>"
"<dt>Ctrl-Shift-Alt-P</dt>"
"<dd>Replay macro.</dd>"
"<dt>Ctrl-Shift-Alt-S</dt>"
"<dd>Show style sheet editor.</dd>"
"<dt>Ctrl-Shift-Alt-T</dt>"
"<dd>Dump widget tree to the log file.</dd>"
"<dt>Ctrl-Alt-Shift-X</dt>"
"<dd>Open a terminal window (xterm). Useful for VNC installations.</dd>"
"<dt>Ctrl-Shift-Alt-Y</dt>"
"<dd>Show widget tree browser.</dd>"
"</dl>"
);

if (!_hotkeysDlg)
_hotkeysDlg = new QY2HelpDialog ( _qHotkeysText , NULL );

_hotkeysDlg->show();
_hotkeysDlg->raise();
_hotkeysDlg->activateWindow();
}


void YQWizard::showReleaseNotes()
{
if (!_relNotesDlg)
Expand Down Expand Up @@ -1367,6 +1421,9 @@ void YQWizard::retranslateInternalButtons()
if ( _helpDlg )
_helpDlg->retranslate();

if ( _hotkeysDlg )
_hotkeysDlg->retranslate();

if ( _relNotesDlg )
_relNotesDlg->retranslate();

Expand Down
8 changes: 8 additions & 0 deletions src/YQWizard.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,11 @@ public slots:
**/
void showHelp();

/**
* Show an overview of the power-user hotkeys
**/
void showHotkeys();

/**
* Show the current wizard steps, if there are any. If there are none,
* nothing happens.
Expand Down Expand Up @@ -570,8 +575,10 @@ protected slots:

QString _currentStepID;
QString _qHelpText;
QString _qHotkeysText;

QY2HelpDialog * _helpDlg;
QY2HelpDialog * _hotkeysDlg;
QY2RelNotesDialog * _relNotesDlg;

QStackedWidget * _sideBar;
Expand All @@ -581,6 +588,7 @@ protected slots:
static std::string _releaseNotesButtonLabel;
YQWizardButton * _helpButton;
QAction * _helpAction;
QAction * _hotkeysAction;
QPushButton * _stepsButton;
QPushButton * _treeButton;
QFrame * _treePanel;
Expand Down

0 comments on commit 5cb91cd

Please sign in to comment.