mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8728 Help Menu : Add search issues and create new issue
This commit is contained in:
parent
8d3f41ded8
commit
4366e53733
@ -41,6 +41,8 @@ CAF_CMD_SOURCE_INIT( RicHelpCommandLineFeature, "RicHelpCommandLineFeature" );
|
||||
CAF_CMD_SOURCE_INIT( RicHelpSummaryCommandLineFeature, "RicHelpSummaryCommandLineFeature" );
|
||||
CAF_CMD_SOURCE_INIT( RicHelpOpenUsersGuideFeature, "RicHelpOpenUsersGuideFeature" );
|
||||
CAF_CMD_SOURCE_INIT( RicSearchHelpFeature, "RicSearchHelpFeature" );
|
||||
CAF_CMD_SOURCE_INIT( RicSearchIssuesHelpFeature, "RicSearchIssuesHelpFeature" );
|
||||
CAF_CMD_SOURCE_INIT( RicCreateNewIssueHelpFeature, "RicCreateNewIssueHelpFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -308,3 +310,65 @@ void RicSearchHelpFeature::setupActionLook( QAction* actionToSetup )
|
||||
|
||||
applyShortcutWithHintToAction( actionToSetup, QKeySequence::HelpContents );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicSearchIssuesHelpFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSearchIssuesHelpFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
QString usersGuideUrl = "https://github.com/OPM/ResInsight/issues";
|
||||
|
||||
if ( !QDesktopServices::openUrl( usersGuideUrl ) )
|
||||
{
|
||||
QErrorMessage* errorHandler = QErrorMessage::qtHandler();
|
||||
errorHandler->showMessage( "Failed open browser with the following url\n\n" + usersGuideUrl );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSearchIssuesHelpFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText( "Search Issues" );
|
||||
actionToSetup->setIcon( QIcon( ":/HelpCircle.svg" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicCreateNewIssueHelpFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateNewIssueHelpFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
QString usersGuideUrl = "https://github.com/OPM/ResInsight/issues/new";
|
||||
|
||||
if ( !QDesktopServices::openUrl( usersGuideUrl ) )
|
||||
{
|
||||
QErrorMessage* errorHandler = QErrorMessage::qtHandler();
|
||||
errorHandler->showMessage( "Failed open browser with the following url\n\n" + usersGuideUrl );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateNewIssueHelpFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText( "Create New Issue" );
|
||||
actionToSetup->setIcon( QIcon( ":/HelpCircle.svg" ) );
|
||||
}
|
||||
|
@ -84,3 +84,29 @@ protected:
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicSearchIssuesHelpFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicCreateNewIssueHelpFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
||||
|
@ -561,6 +561,8 @@ void RiuMainWindow::createMenus()
|
||||
helpMenu->addSeparator();
|
||||
helpMenu->addAction( cmdFeatureMgr->action( "RicHelpOpenUsersGuideFeature" ) );
|
||||
helpMenu->addAction( cmdFeatureMgr->action( "RicSearchHelpFeature" ) );
|
||||
helpMenu->addAction( cmdFeatureMgr->action( "RicSearchIssuesHelpFeature" ) );
|
||||
helpMenu->addAction( cmdFeatureMgr->action( "RicCreateNewIssueHelpFeature" ) );
|
||||
|
||||
connect( helpMenu, SIGNAL( aboutToShow() ), SLOT( slotRefreshHelpActions() ) );
|
||||
}
|
||||
|
@ -356,6 +356,8 @@ void RiuPlotMainWindow::createMenus()
|
||||
helpMenu->addSeparator();
|
||||
helpMenu->addAction( cmdFeatureMgr->action( "RicHelpOpenUsersGuideFeature" ) );
|
||||
helpMenu->addAction( cmdFeatureMgr->action( "RicSearchHelpFeature" ) );
|
||||
helpMenu->addAction( cmdFeatureMgr->action( "RicSearchIssuesHelpFeature" ) );
|
||||
helpMenu->addAction( cmdFeatureMgr->action( "RicCreateNewIssueHelpFeature" ) );
|
||||
|
||||
connect( helpMenu, SIGNAL( aboutToShow() ), SLOT( slotRefreshHelpActions() ) );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user