2016-01-19 22:59:11 -05:00
|
|
|
#include <QToolButton>
|
|
|
|
|
2013-07-18 19:32:12 +00:00
|
|
|
#include <retroshare-gui/mainpage.h>
|
2013-10-09 09:31:40 +00:00
|
|
|
#include "common/FloatingHelpBrowser.h"
|
2013-07-18 19:32:12 +00:00
|
|
|
|
2014-05-10 02:38:47 +00:00
|
|
|
MainPage::MainPage(QWidget *parent , Qt::WindowFlags flags ) : QWidget(parent, flags)
|
2013-07-18 19:32:12 +00:00
|
|
|
{
|
2013-10-09 09:31:40 +00:00
|
|
|
mHelpBrowser = NULL ;
|
2014-05-10 02:38:47 +00:00
|
|
|
mIcon = QIcon();
|
|
|
|
mName = "";
|
|
|
|
mHelp = "";
|
2013-07-19 12:18:58 +00:00
|
|
|
}
|
|
|
|
|
2016-01-19 22:59:11 -05:00
|
|
|
void MainPage::registerHelpButton(QToolButton *button,const QString& help_html_txt)
|
2013-07-18 19:32:12 +00:00
|
|
|
{
|
2013-10-09 09:31:40 +00:00
|
|
|
if (mHelpBrowser == NULL)
|
|
|
|
mHelpBrowser = new FloatingHelpBrowser(this, button) ;
|
2016-01-19 22:59:11 -05:00
|
|
|
|
|
|
|
float S = QFontMetricsF(button->font()).height() ;
|
|
|
|
button->setIconSize(QSize(S,S)) ;
|
2013-07-18 19:32:12 +00:00
|
|
|
|
2013-10-09 09:31:40 +00:00
|
|
|
mHelpBrowser->setHelpText(help_html_txt) ;
|
2013-07-19 12:18:58 +00:00
|
|
|
}
|
2013-07-18 19:32:12 +00:00
|
|
|
|