Merge pull request #711 from RetroPooh/test2

homepage: add webhelp and move quickstartwizard from settings general
This commit is contained in:
csoler 2017-03-03 22:37:16 +01:00 committed by GitHub
commit 556aae6ce7
7 changed files with 149 additions and 74 deletions

View File

@ -25,6 +25,7 @@
#include "gui/notifyqt.h"
#include "gui/msgs/MessageComposer.h"
#include "gui/connect/ConnectFriendWizard.h"
#include <gui/QuickStartWizard.h>
#include "gui/connect/FriendRecommendDialog.h"
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
@ -51,6 +52,7 @@ HomePage::HomePage(QWidget *parent) :
updateOwnCert();
connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addFriend()));
connect(ui->LoadCertFileButton, SIGNAL(clicked()), this, SLOT(loadCert()));
QAction *CopyAction = new QAction(QIcon(),tr("Copy your Cert to Clipboard"), this);
connect(CopyAction, SIGNAL(triggered()), this, SLOT(copyCert()));
@ -61,6 +63,9 @@ HomePage::HomePage(QWidget *parent) :
QAction *SendAction = new QAction(QIcon(),tr("Send via Email"), this);
connect(SendAction, SIGNAL(triggered()), this, SLOT(runEmailClient()));
QAction *WebMailAction = new QAction(QIcon(),tr("Invite via WebMail"), this);
connect(WebMailAction, SIGNAL(triggered()), this, SLOT(webMail()));
QAction *RecAction = new QAction(QIcon(),tr("Recommend friends to each others"), this);
connect(RecAction, SIGNAL(triggered()), this, SLOT(recommendFriends()));
@ -68,10 +73,15 @@ HomePage::HomePage(QWidget *parent) :
menu->addAction(CopyAction);
menu->addAction(SaveAction);
menu->addAction(SendAction);
menu->addAction(WebMailAction);
menu->addAction(RecAction);
ui->shareButton->setMenu(menu);
connect(ui->runStartWizard_PB,SIGNAL(clicked()), this,SLOT(runStartWizard())) ;
connect(ui->openwebhelp,SIGNAL(clicked()), this,SLOT(openWebHelp())) ;
ui->runStartWizard_PB->hide(); // until future rework
int S = QFontMetricsF(font()).height();
QString help_str = tr(
" <h1><img width=\"%1\" src=\":/icons/help_64.png\">&nbsp;&nbsp;Welcome to Retroshare!</h1>\
@ -169,3 +179,29 @@ void HomePage::addFriend()
connwiz.setStartId(ConnectFriendWizard::Page_Text);
connwiz.exec ();
}
void HomePage::webMail()
{
ConnectFriendWizard connwiz (this);
connwiz.setStartId(ConnectFriendWizard::Page_WebMail);
connwiz.exec ();
}
void HomePage::loadCert()
{
ConnectFriendWizard connwiz (this);
connwiz.setStartId(ConnectFriendWizard::Page_Cert);
connwiz.exec ();
}
void HomePage::runStartWizard()
{
QuickStartWizard(this).exec();
}
void HomePage::openWebHelp()
{
QDesktopServices::openUrl(QUrl(QString("https://retroshare.readthedocs.io")));
}

View File

@ -47,14 +47,17 @@ public:
virtual QString pageName() const { return tr("Home") ; } //MainPage
virtual QString helpText() const { return ""; } //MainPage
private slots:
void updateOwnCert();
void runEmailClient();
void copyCert();
void saveCert();
void addFriend();
void webMail();
void loadCert();
void runStartWizard() ;
void openWebHelp() ;
void recommendFriends();
void addFriend();
private:
Ui::HomePage *ui;

View File

@ -59,22 +59,49 @@
</widget>
</item>
<item>
<widget class="QToolButton" name="helpButton">
<widget class="QToolButton" name="LoadCertFileButton">
<property name="text">
<string>...</string>
<string>Add certificate file</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
<normaloff>:/icons/svg/folders1.svg</normaloff>:/icons/svg/folders1.svg</iconset>
</property>
<property name="checkable">
<bool>true</bool>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="5" column="1">
<widget class="QFrame" name="addFrame">
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item row="3" column="1" colspan="2">
<layout class="QGridLayout" name="gridLayout">
<property name="topMargin">
@ -86,7 +113,7 @@
<property name="verticalSpacing">
<number>2</number>
</property>
<item row="2" column="0" colspan="2">
<item row="2" column="0" colspan="4">
<widget class="QPlainTextEdit" name="userCertEdit">
<property name="font">
<font>
@ -113,28 +140,7 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="userCertLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="text">
<string>The text below is your own Retroshare certificate. Send it to your friends</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="1" column="3">
<widget class="QToolButton" name="shareButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@ -166,26 +172,43 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QToolButton" name="helpButton">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="userCertLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="text">
<string>The text below is your own Retroshare certificate. Send it to your friends</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="1">
<widget class="QFrame" name="addFrame">
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QLabel" name="label_2">
<property name="font">
@ -222,11 +245,35 @@ private and secure decentralized communication platform.
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="runStartWizard_PB">
<property name="text">
<string>Launch startup wizard</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/tools_wizard.png</normaloff>:/images/tools_wizard.png</iconset>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QPushButton" name="openwebhelp">
<property name="text">
<string>Open Web Help</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/settings/webinterface.svg</normaloff>:/icons/settings/webinterface.svg</iconset>
</property>
</widget>
</item>
</layout>
<zorder>label</zorder>
<zorder>addFrame</zorder>
<zorder>label_2</zorder>
<zorder>addframe</zorder>
<zorder>runStartWizard_PB</zorder>
<zorder>openwebhelp</zorder>
</widget>
<resources>
<include location="icons.qrc"/>

View File

@ -82,6 +82,8 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) :
// (csoler) I'm hiding this, since it is not needed anymore with the new Home page.
ui->userFrame->hide();
ui->userFileFrame->hide(); // in homepage dropmenu now
// this define comes from Qt example. I don't have mac, so it wasn't tested
#ifndef Q_OS_MAC
setWizardStyle(ModernStyle);
@ -133,12 +135,8 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) :
else
{
ui->userFrame->hide(); // certificates page - top half with own cert and it's functions
ui->horizontalLayout_13->hide(); // Advanced options - key sign, whitelist, direct source ...
AdvancedVisible=false;
ui->emailLabel->hide(); // is it ever used?
ui->emailEdit->hide();
ui->trustLabel->hide();
ui->trustEdit->hide();
}
@ -557,6 +555,14 @@ void ConnectFriendWizard::initializePage(int id)
ui->ipLabel->setPixmap(QPixmap(":/images/anonymous_128_blue.png").scaledToHeight(S*2,Qt::SmoothTransformation));
ui->ipLabel->setToolTip("This is a Hidden node - you need tor/i2p proxy to connect");
}
if(peerDetails.email.empty())
{
ui->emailLabel->hide(); // is it ever used?
ui->emailEdit->hide();
}
ui->ipEdit->setTextInteractionFlags(Qt::TextSelectableByMouse);
}
break;
case Page_FriendRequest:

View File

@ -30,7 +30,6 @@
#include <util/misc.h>
#include <QSystemTrayIcon>
#include "rsharesettings.h"
#include <gui/QuickStartWizard.h>
/** Constructor */
GeneralPage::GeneralPage(QWidget * parent, Qt::WindowFlags flags) :
@ -39,7 +38,6 @@ GeneralPage::GeneralPage(QWidget * parent, Qt::WindowFlags flags) :
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
/* Hide platform specific features */
#ifdef Q_OS_WIN
@ -91,7 +89,7 @@ GeneralPage::GeneralPage(QWidget * parent, Qt::WindowFlags flags) :
connect(ui.autoLogin, SIGNAL(toggled(bool)), this,SLOT(updateAutoLogin())) ;
connect(ui.chkRunRetroshareAtSystemStartup, SIGNAL(toggled(bool)), this,SLOT(updateRunRSOnBoot())) ;
connect(ui.chkRunRetroshareAtSystemStartupMinimized, SIGNAL(toggled(bool)), this,SLOT(updateRunRSOnBoot())) ;
connect(ui.runStartWizard_PB, SIGNAL(clicked()), this,SLOT(runStartWizard())) ;
//connect(ui.runStartWizard_PB, SIGNAL(clicked()), this,SLOT(runStartWizard())) ;
connect(ui.checkAdvanced, SIGNAL(toggled(bool)), this,SLOT(updateAdvancedMode())) ;
connect(ui.registerRetroShareProtocol, SIGNAL(toggled(bool)), this,SLOT(updateRegisterRSProtocol())) ;
}
@ -100,10 +98,6 @@ GeneralPage::GeneralPage(QWidget * parent, Qt::WindowFlags flags) :
GeneralPage::~GeneralPage()
{
}
void GeneralPage::runStartWizard()
{
QuickStartWizard(this).exec();
}
void GeneralPage::updateAdvancedMode()
{

View File

@ -45,7 +45,7 @@ public:
virtual QString helpText() const { return ""; }
public slots:
void runStartWizard() ;
//void runStartWizard() ;
void updateAdvancedMode();
void updateUseLocalServer() ;
void updateMaxTimeBeforeIdle();

View File

@ -217,17 +217,6 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="runStartWizard_PB">
<property name="text">
<string>Launch startup wizard</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/tools_wizard.png</normaloff>:/images/tools_wizard.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
<resources>