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

@ -103,7 +103,19 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) :
ui->requestinfolabel->hide();
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();
}
@ -351,6 +363,8 @@ void ConnectFriendWizard::initializePage(int id)
case Page_Rsid:
ui->RsidPage->registerField("friendRSID*", ui->friendRsidEdit);
break;
case Page_WebMail:
case Page_Email:
{
ui->EmailPage->registerField("addressEdit*", ui->addressEdit);
@ -739,6 +753,7 @@ int ConnectFriendWizard::nextId() const
if (ui->certRadioButton->isChecked()) return Page_Cert;
if (ui->foffRadioButton->isChecked()) return Page_Foff;
if (ui->rsidRadioButton->isChecked()) return Page_Rsid;
if (ui->webmailRadioButton->isChecked()) return Page_WebMail;
if (ui->emailRadioButton->isChecked()) return Page_Email;
if (ui->friendRecommendationsRadioButton->isChecked()) return Page_FriendRecommendations;
return ConnectFriendWizard::Page_Foff;
@ -747,6 +762,7 @@ int ConnectFriendWizard::nextId() const
case Page_Rsid:
return error ? ConnectFriendWizard::Page_Conclusion : ConnectFriendWizard::Page_ErrorMessage;
case Page_Foff:
case Page_WebMail:
case Page_Email:
case Page_ErrorMessage:
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)
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();
@ -81,6 +81,14 @@ private slots:
/* ConclusionPage */
void groupCurrentIndexChanged(int index);
/* WebMailPage */
void inviteGmail();
void inviteYahoo();
void inviteOutlook();
void inviteAol();
void inviteYandex();
private:
// returns the translated error string for the error code (to be found in rspeers.h)
@ -109,6 +117,10 @@ private:
/* ConclusionPage */
QString groupId;
/* WebMailPage */
QString subject;
QString body;
Ui::ConnectFriendWizard *ui;
};

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>691</width>
<height>650</height>
<height>644</height>
</rect>
</property>
<property name="windowTitle">
@ -56,6 +56,13 @@
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="webmailRadioButton">
<property name="text">
<string>&amp;Send an Invitation by Web Mail Providers</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="emailRadioButton">
<property name="text">
@ -504,6 +511,210 @@
</item>
</layout>
</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">
<property name="title">
<string>Invite Friends by Email</string>
@ -1353,6 +1564,7 @@ resources.</string>
</customwidgets>
<resources>
<include location="../images.qrc"/>
<include location="../icons.qrc"/>
</resources>
<connections/>
</ui>