mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-14 08:59:50 -05:00
added some delay in the showHelp() feature
This commit is contained in:
parent
12246e369b
commit
3230e55f04
@ -1,4 +1,5 @@
|
|||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
#include <retroshare-gui/mainpage.h>
|
#include <retroshare-gui/mainpage.h>
|
||||||
#include "common/FloatingHelpBrowser.h"
|
#include "common/FloatingHelpBrowser.h"
|
||||||
@ -27,11 +28,12 @@ void MainPage::registerHelpButton(QToolButton *button, const QString& help_html_
|
|||||||
|
|
||||||
void MainPage::showEvent(QShowEvent *s)
|
void MainPage::showEvent(QShowEvent *s)
|
||||||
{
|
{
|
||||||
if(Settings->getPageFirstTimeDisplay(mHelpCodeName) && mHelpBrowser!=NULL)
|
if(!Settings->getPageAlreadyDisplayed(mHelpCodeName) && mHelpBrowser!=NULL)
|
||||||
{
|
{
|
||||||
mHelpBrowser->show();
|
// I use a timer to make sure that the GUI is able to process that.
|
||||||
|
QTimer::singleShot(1000, mHelpBrowser,SLOT(show()));
|
||||||
|
|
||||||
Settings->setPageFirstTimeDisplay(mHelpCodeName,false);
|
Settings->setPageAlreadyDisplayed(mHelpCodeName,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget::showEvent(s);
|
QWidget::showEvent(s);
|
||||||
|
@ -36,7 +36,7 @@ public:
|
|||||||
void setHelpText(const QString &helpText);
|
void setHelpText(const QString &helpText);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void showHelp(bool state);
|
void showHelp(bool state=false);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void textChanged();
|
void textChanged();
|
||||||
|
@ -1161,13 +1161,13 @@ void RshareSettings::setWebinterfaceAllowAllIps(bool allow_all)
|
|||||||
setValueToGroup("Webinterface", "allowAllIps", allow_all);
|
setValueToGroup("Webinterface", "allowAllIps", allow_all);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RshareSettings::getPageFirstTimeDisplay(const QString& page_name)
|
bool RshareSettings::getPageAlreadyDisplayed(const QString& page_name)
|
||||||
{
|
{
|
||||||
return valueFromGroup("PageDisplayed",page_name,true).toBool();
|
return valueFromGroup("PageAlreadyDisplayed",page_name,false).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RshareSettings::setPageFirstTimeDisplay(const QString& page_name,bool b)
|
void RshareSettings::setPageAlreadyDisplayed(const QString& page_name,bool b)
|
||||||
{
|
{
|
||||||
return setValueToGroup("PageDisplayed",page_name,b);
|
return setValueToGroup("PageAlreadyDisplayed",page_name,b);
|
||||||
}
|
}
|
||||||
|
@ -336,8 +336,8 @@ public:
|
|||||||
// proxy function that computes the best icon size among sizes passed as array, to match the recommended size on screen.
|
// proxy function that computes the best icon size among sizes passed as array, to match the recommended size on screen.
|
||||||
int computeBestIconSize(int n_sizes, int *sizes, int recommended_size);
|
int computeBestIconSize(int n_sizes, int *sizes, int recommended_size);
|
||||||
|
|
||||||
bool getPageFirstTimeDisplay(const QString& page_code) ;
|
bool getPageAlreadyDisplayed(const QString& page_code) ;
|
||||||
void setPageFirstTimeDisplay(const QString& page_code,bool b) ;
|
void setPageAlreadyDisplayed(const QString& page_code,bool b) ;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/** Default constructor. */
|
/** Default constructor. */
|
||||||
|
Loading…
Reference in New Issue
Block a user