Added Invite page for Web Mail Providers (Connect Friend Wizard)

Added select page style for Quick Start Wizard.
This commit is contained in:
defnax 2015-10-24 17:05:12 +02:00
parent 4b402a48a5
commit b501d91f21
17 changed files with 491 additions and 14 deletions

View File

@ -183,11 +183,26 @@ void QuickStartWizard::on_pushButtonSharesExit_clicked()
close(); close();
} }
void QuickStartWizard::on_pushButtonSystemBack_clicked() void QuickStartWizard::on_pushButtonStyleBack_clicked()
{ {
ui.pagesWizard->setCurrentIndex(2); ui.pagesWizard->setCurrentIndex(2);
} }
void QuickStartWizard::on_pushButtonStyleNext_clicked()
{
ui.pagesWizard->setCurrentIndex(4);
}
void QuickStartWizard::on_pushButtonStyleExit_clicked()
{
close();
}
void QuickStartWizard::on_pushButtonSystemBack_clicked()
{
ui.pagesWizard->setCurrentIndex(3);
}
void QuickStartWizard::on_pushButtonSystemFinish_clicked() void QuickStartWizard::on_pushButtonSystemFinish_clicked()
{ {
Settings->setStartMinimized(ui.checkBoxStartMinimized->isChecked()); Settings->setStartMinimized(ui.checkBoxStartMinimized->isChecked());
@ -390,6 +405,9 @@ QuickStartWizard::loadGeneral()
ui.checkBoxStartMinimized->setChecked(Settings->getStartMinimized()); ui.checkBoxStartMinimized->setChecked(Settings->getStartMinimized());
ui.checkBoxQuit->setChecked(Settings->value("doQuit", false).toBool()); ui.checkBoxQuit->setChecked(Settings->value("doQuit", false).toBool());
ui.rbtPageOnToolBar->setChecked(Settings->getPageButtonLoc());
ui.rbtPageOnListItem->setChecked(!Settings->getPageButtonLoc());
//ui.checkBoxQuickWizard->setChecked(settings.value(QString::fromUtf8("FirstRun"), false).toBool()); //ui.checkBoxQuickWizard->setChecked(settings.value(QString::fromUtf8("FirstRun"), false).toBool());
} }
@ -472,6 +490,8 @@ void QuickStartWizard::saveChanges()
//bool saveAddr = false; //bool saveAddr = false;
Settings->setPageButtonLoc(ui.rbtPageOnToolBar->isChecked());
RsPeerDetails detail; RsPeerDetails detail;
RsPeerId ownId = rsPeers->getOwnId(); RsPeerId ownId = rsPeers->getOwnId();

View File

@ -60,6 +60,9 @@ private Q_SLOTS:
void on_pushButtonSharesExit_clicked(); void on_pushButtonSharesExit_clicked();
void on_pushButtonSharesNext_clicked(); void on_pushButtonSharesNext_clicked();
void on_pushButtonSharesBack_clicked(); void on_pushButtonSharesBack_clicked();
void on_pushButtonStyleExit_clicked();
void on_pushButtonStyleNext_clicked();
void on_pushButtonStyleBack_clicked();
void on_pushButtonWelcomeExit_clicked(); void on_pushButtonWelcomeExit_clicked();
void on_pushButtonWelcomeNext_clicked(); void on_pushButtonWelcomeNext_clicked();
void on_pushButtonConnectionExit_clicked(); void on_pushButtonConnectionExit_clicked();

View File

@ -9,7 +9,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>445</width> <width>457</width>
<height>370</height> <height>370</height>
</rect> </rect>
</property> </property>
@ -36,7 +36,16 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<property name="margin"> <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> <number>0</number>
</property> </property>
<property name="spacing"> <property name="spacing">
@ -48,11 +57,20 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QStackedWidget" name="pagesWizard"> <widget class="QStackedWidget" name="pagesWizard">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>4</number>
</property> </property>
<widget class="QWidget" name="pageWelcome"> <widget class="QWidget" name="pageWelcome">
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<property name="margin"> <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> <number>0</number>
</property> </property>
<property name="spacing"> <property name="spacing">
@ -73,7 +91,16 @@
<enum>QFrame::Sunken</enum> <enum>QFrame::Sunken</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
<property name="margin"> <property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number> <number>4</number>
</property> </property>
<property name="spacing"> <property name="spacing">
@ -188,7 +215,16 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
<widget class="QWidget" name="pageConnection"> <widget class="QWidget" name="pageConnection">
<layout class="QGridLayout" name="gridLayout_5"> <layout class="QGridLayout" name="gridLayout_5">
<property name="margin"> <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> <number>0</number>
</property> </property>
<property name="spacing"> <property name="spacing">
@ -443,7 +479,16 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
<widget class="QWidget" name="pageShares"> <widget class="QWidget" name="pageShares">
<layout class="QGridLayout" name="gridLayout_7"> <layout class="QGridLayout" name="gridLayout_7">
<property name="margin"> <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> <number>0</number>
</property> </property>
<property name="spacing"> <property name="spacing">
@ -674,9 +719,137 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="pageStyle">
<layout class="QGridLayout" name="gridLayout_9">
<item row="0" column="0">
<widget class="QGroupBox" name="grpToolBar">
<property name="minimumSize">
<size>
<width>0</width>
<height>228</height>
</size>
</property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<property name="title">
<string>RetroShare Page Display Style</string>
</property>
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="0">
<widget class="QLabel" name="labelPageToolBar">
<property name="text">
<string>Where do you want to have the buttons for the page?</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="rbtPageOnToolBar">
<property name="text">
<string>ToolBar View</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QRadioButton" name="rbtPageOnListItem">
<property name="text">
<string>List View</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>204</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="topMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButtonStyleBack">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>&lt; Back</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonStyleNext">
<property name="text">
<string>Next &gt;</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonStyleExit">
<property name="text">
<string>Exit</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="pageSystem"> <widget class="QWidget" name="pageSystem">
<layout class="QGridLayout" name="gridLayout_16"> <layout class="QGridLayout" name="gridLayout_16">
<property name="margin"> <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> <number>0</number>
</property> </property>
<property name="spacing"> <property name="spacing">
@ -697,8 +870,17 @@ p, li { white-space: pre-wrap; }
<enum>QFrame::Sunken</enum> <enum>QFrame::Sunken</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout_15"> <layout class="QGridLayout" name="gridLayout_15">
<property name="margin"> <property name="leftMargin">
<number>4</number> <number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property> </property>
<property name="spacing"> <property name="spacing">
<number>4</number> <number>4</number>

View File

@ -103,7 +103,19 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) :
ui->requestinfolabel->hide(); ui->requestinfolabel->hide();
connect(ui->acceptNoSignGPGCheckBox,SIGNAL(toggled(bool)), ui->_options_GB,SLOT(setEnabled(bool))) ; connect(ui->acceptNoSignGPGCheckBox,SIGNAL(toggled(bool)), ui->_options_GB,SLOT(setEnabled(bool))) ;
connect(ui->addKeyToKeyring_CB,SIGNAL(toggled(bool)), ui->acceptNoSignGPGCheckBox,SLOT(setChecked(bool))) ; connect(ui->addKeyToKeyring_CB,SIGNAL(toggled(bool)), ui->acceptNoSignGPGCheckBox,SLOT(setChecked(bool))) ;
connect(ui->gmailButton, SIGNAL(clicked()), this, SLOT(inviteGmail()));
connect(ui->yahooButton, SIGNAL(clicked()), this, SLOT(inviteYahoo()));
connect(ui->outlookButton, SIGNAL(clicked()), this, SLOT(inviteOutlook()));
connect(ui->aolButton, SIGNAL(clicked()), this, SLOT(inviteAol()));
connect(ui->yandexButton, SIGNAL(clicked()), this, SLOT(inviteYandex()));
subject = tr("RetroShare Invitation");
body = GetStartedDialog::GetInviteText();
body += "\n" + GetStartedDialog::GetCutBelowText();
body += "\n\n" + QString::fromUtf8(rsPeers->GetRetroshareInvite(false).c_str());
updateStylesheet(); updateStylesheet();
} }
@ -351,6 +363,8 @@ void ConnectFriendWizard::initializePage(int id)
case Page_Rsid: case Page_Rsid:
ui->RsidPage->registerField("friendRSID*", ui->friendRsidEdit); ui->RsidPage->registerField("friendRSID*", ui->friendRsidEdit);
break; break;
case Page_WebMail:
case Page_Email: case Page_Email:
{ {
ui->EmailPage->registerField("addressEdit*", ui->addressEdit); ui->EmailPage->registerField("addressEdit*", ui->addressEdit);
@ -739,6 +753,7 @@ int ConnectFriendWizard::nextId() const
if (ui->certRadioButton->isChecked()) return Page_Cert; if (ui->certRadioButton->isChecked()) return Page_Cert;
if (ui->foffRadioButton->isChecked()) return Page_Foff; if (ui->foffRadioButton->isChecked()) return Page_Foff;
if (ui->rsidRadioButton->isChecked()) return Page_Rsid; if (ui->rsidRadioButton->isChecked()) return Page_Rsid;
if (ui->webmailRadioButton->isChecked()) return Page_WebMail;
if (ui->emailRadioButton->isChecked()) return Page_Email; if (ui->emailRadioButton->isChecked()) return Page_Email;
if (ui->friendRecommendationsRadioButton->isChecked()) return Page_FriendRecommendations; if (ui->friendRecommendationsRadioButton->isChecked()) return Page_FriendRecommendations;
return ConnectFriendWizard::Page_Foff; return ConnectFriendWizard::Page_Foff;
@ -747,6 +762,7 @@ int ConnectFriendWizard::nextId() const
case Page_Rsid: case Page_Rsid:
return error ? ConnectFriendWizard::Page_Conclusion : ConnectFriendWizard::Page_ErrorMessage; return error ? ConnectFriendWizard::Page_Conclusion : ConnectFriendWizard::Page_ErrorMessage;
case Page_Foff: case Page_Foff:
case Page_WebMail:
case Page_Email: case Page_Email:
case Page_ErrorMessage: case Page_ErrorMessage:
case Page_Conclusion: case Page_Conclusion:
@ -1214,4 +1230,29 @@ void ConnectFriendWizard::groupCurrentIndexChanged(int index)
} }
} }
//========================== WebMailPage ==================================
void ConnectFriendWizard::inviteGmail()
{
QDesktopServices::openUrl(QUrl("https://mail.google.com/mail/?view=cm&fs=1&su=" + subject + "&body=" + body , QUrl::TolerantMode));
}
void ConnectFriendWizard::inviteYahoo()
{
QDesktopServices::openUrl(QUrl("http://compose.mail.yahoo.com/?&subject=" + subject + "&body=" + body, QUrl::TolerantMode));
}
void ConnectFriendWizard::inviteOutlook()
{
QDesktopServices::openUrl(QUrl("http://mail.live.com/mail/EditMessageLight.aspx?n=&subject=" + subject + "&body=" + body, QUrl::TolerantMode));
}
void ConnectFriendWizard::inviteAol()
{
QDesktopServices::openUrl(QUrl("http://webmail.aol.com/Mail/ComposeMessage.aspx?&subject=" + subject + "&body=" + body, QUrl::TolerantMode));
}
void ConnectFriendWizard::inviteYandex()
{
QDesktopServices::openUrl(QUrl("https://mail.yandex.com/neo2/#compose/subject=" + subject + "&body=" + body, QUrl::TolerantMode));
}

View File

@ -30,7 +30,7 @@ class ConnectFriendWizard : public QWizard
Q_PROPERTY(QString titleColor READ titleColor WRITE setTitleColor) Q_PROPERTY(QString titleColor READ titleColor WRITE setTitleColor)
public: public:
enum Page { Page_Intro, Page_Text, Page_Cert, Page_ErrorMessage, Page_Conclusion, Page_Foff, Page_Rsid, Page_Email, Page_FriendRequest, Page_FriendRecommendations }; enum Page { Page_Intro, Page_Text, Page_Cert, Page_ErrorMessage, Page_Conclusion, Page_Foff, Page_Rsid, Page_WebMail, Page_Email, Page_FriendRequest, Page_FriendRecommendations };
ConnectFriendWizard(QWidget *parent = 0); ConnectFriendWizard(QWidget *parent = 0);
~ConnectFriendWizard(); ~ConnectFriendWizard();
@ -81,6 +81,14 @@ private slots:
/* ConclusionPage */ /* ConclusionPage */
void groupCurrentIndexChanged(int index); void groupCurrentIndexChanged(int index);
/* WebMailPage */
void inviteGmail();
void inviteYahoo();
void inviteOutlook();
void inviteAol();
void inviteYandex();
private: private:
// returns the translated error string for the error code (to be found in rspeers.h) // returns the translated error string for the error code (to be found in rspeers.h)
@ -109,6 +117,10 @@ private:
/* ConclusionPage */ /* ConclusionPage */
QString groupId; QString groupId;
/* WebMailPage */
QString subject;
QString body;
Ui::ConnectFriendWizard *ui; Ui::ConnectFriendWizard *ui;
}; };

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>691</width> <width>691</width>
<height>650</height> <height>644</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -56,6 +56,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QRadioButton" name="webmailRadioButton">
<property name="text">
<string>&amp;Send an Invitation by Web Mail Providers</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QRadioButton" name="emailRadioButton"> <widget class="QRadioButton" name="emailRadioButton">
<property name="text"> <property name="text">
@ -504,6 +511,210 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWizardPage" name="WebmalPage">
<property name="title">
<string>RetroShare is better with Friends </string>
</property>
<property name="subTitle">
<string>Invite your Friends from other Networks to RetroShare.</string>
</property>
<attribute name="pageId">
<string notr="true">ConnectFriendWizard::Page_WebMail</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_10">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="gmailButton">
<property name="text">
<string>GMail</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/gmail.png</normaloff>:/icons/gmail.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="yahooButton">
<property name="text">
<string>Yahoo</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/yahoo.png</normaloff>:/icons/yahoo.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="outlookButton">
<property name="text">
<string>Outlook</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/outlook.png</normaloff>:/icons/outlook.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="aolButton">
<property name="text">
<string>AOL</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/aol.png</normaloff>:/icons/aol.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="yandexButton">
<property name="text">
<string>Yandex</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/yandex.png</normaloff>:/icons/yandex.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_12">
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>444</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="ConnectFriendPage" name="EmailPage"> <widget class="ConnectFriendPage" name="EmailPage">
<property name="title"> <property name="title">
<string>Invite Friends by Email</string> <string>Invite Friends by Email</string>
@ -1353,6 +1564,7 @@ resources.</string>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="../images.qrc"/> <include location="../images.qrc"/>
<include location="../icons.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -61,5 +61,12 @@
<file>icons/user-offline_64.png</file> <file>icons/user-offline_64.png</file>
<file>icons/user-online_64.png</file> <file>icons/user-online_64.png</file>
<file>icons/yellow_biohazard64.png</file> <file>icons/yellow_biohazard64.png</file>
<file>icons/gmail.png</file>
<file>icons/yahoo.png</file>
<file>icons/outlook.png</file>
<file>icons/aol.png</file>
<file>icons/yandex.png</file>
<file>icons/tor-on.png</file>
<file>icons/tor-logo.png</file>
</qresource> </qresource>
</RCC> </RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB