diff --git a/callwidget.cpp b/callwidget.cpp index 803ff15c2b39abda0ead3fa71ecaa396a348d647..6cfd20c1cb3532d5d11c96a50d1f7e454d626779 100644 --- a/callwidget.cpp +++ b/callwidget.cpp @@ -335,7 +335,7 @@ CallWidget::findRingAccount() } if (!found) { ui->ringIdLabel->setText(tr("NO RING ACCOUNT FOUND")); - WizardDialog *wizardDialog = new WizardDialog(); + auto wizardDialog = new WizardDialog(); wizardDialog->exec(); delete wizardDialog; } @@ -719,3 +719,9 @@ CallWidget::on_copyCMButton_clicked() auto text = ui->contactMethodComboBox->currentText(); QApplication::clipboard()->setText(text); } + +void +CallWidget::on_shareButton_clicked() +{ + Utils::InvokeMailto("Contact me on Ring", QStringLiteral("My RingId is : ") + ui->ringIdLabel->text()); +} diff --git a/callwidget.h b/callwidget.h index 2129fe10f6329e1626553861978c17f00a38d1ae..9cc0e84328074c55f6ce2c13091e21f1b0d1a8d4 100644 --- a/callwidget.h +++ b/callwidget.h @@ -81,6 +81,7 @@ private slots: void on_imBackButton_clicked(); void on_copyCMButton_clicked(); void on_smartList_clicked(const QModelIndex &index); + void on_shareButton_clicked(); private slots: void callIncoming(Call* call); diff --git a/callwidget.ui b/callwidget.ui index 76285e7768bd68d009c1c587979d9b3a76c768b1..271517a95462da4b9c1ee50673baaa402520827b 100644 --- a/callwidget.ui +++ b/callwidget.ui @@ -579,44 +579,125 @@ - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 14 - - - - QFrame::Box - - + + + 0 - - id - - - Qt::AlignCenter - - - 5 - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 14 + + + + QFrame::Box + + + 0 + + + id + + + Qt::AlignCenter + + + 5 + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 5 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Share your ring id + + + + + + + :/images/ic_share_white.png:/images/ic_share_white.png + + + + 30 + 25 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + @@ -1398,6 +1479,7 @@ 0 + stackedWidget diff --git a/images/ic_share_white.png b/images/ic_share_white.png new file mode 100644 index 0000000000000000000000000000000000000000..22a8783e70f01488cb1396f18645fef00c7bb299 Binary files /dev/null and b/images/ic_share_white.png differ diff --git a/ressources.qrc b/ressources.qrc index 1a9ac2e6a20d5ecfc8ac139a008003ddf9f1e3ed..d2769bfc9fa17eea415a47da0b5b8db0902e3740 100644 --- a/ressources.qrc +++ b/ressources.qrc @@ -47,5 +47,6 @@ images/ic_pause_white.svg images/ic_content_copy_white.svg images/ic_voicemail_white.svg + images/ic_share_white.png diff --git a/stylesheet.css b/stylesheet.css index c9a2ef9c806e2b5d2de999abef491589e40348f9..50fe32a890b713f35137a95cb3b3958b18697ef4 100644 --- a/stylesheet.css +++ b/stylesheet.css @@ -130,17 +130,17 @@ QPushButton#hangupButton:pressed{ } -QPushButton#addToContactButton, QPushButton#imBackButton, QPushButton#copyCMButton{ +QPushButton#addToContactButton, QPushButton#imBackButton, QPushButton#copyCMButton, QPushButton#shareButton{ background-color: #414141; border-radius: 15px; border:solid 1px; } -QPushButton#imBackButton:hover, QPushButton#copyCMButton:hover{ +QPushButton#imBackButton:hover, QPushButton#copyCMButton:hover, QPushButton#shareButton:hover{ background-color: #515151; } -QPushButton#imBackButton:pressed, QPushButton#copyCMButton:pressed{ +QPushButton#imBackButton:pressed, QPushButton#copyCMButton:pressed, QPushButton#shareButton:pressed{ background-color: #313131; } @@ -178,5 +178,14 @@ QWidget#welcomePage, QWidget#messagingPage{ } QPushButton#wizardButton{ - background: transparent; + background-color: #3AC0D2; + border: 0px; +} + +QPushButton#wizardButton:hover{ + background-color: #4dc6d6; +} + +QPushButton#wizardButton:pressed{ + background-color: #34acbd; } diff --git a/utils.cpp b/utils.cpp index 962492ba0a05c6befb2d7299e3654150edc5127f..556f0129bcaa05acf55e2d757168f6510aea296d 100644 --- a/utils.cpp +++ b/utils.cpp @@ -161,3 +161,12 @@ Utils::GetCurrentUserName() { #endif } +void +Utils::InvokeMailto(const QString& subject, + const QString& body, + const QString& attachement) { + auto addr = QString("mailto:?subject=%1&body=%2").arg(subject).arg(body); + if (not attachement.isEmpty()) + addr += QString("&attachement=%1").arg(attachement); + ShellExecute(nullptr, L"open", addr.toStdWString().c_str(), NULL, NULL, SW_SHOWNORMAL); +} diff --git a/utils.h b/utils.h index 506bf4eabe1b4606713ad39b5d15aeee796b8e50..36489149783bb4cf350fe71ac5e54d642b4c5f01 100644 --- a/utils.h +++ b/utils.h @@ -41,5 +41,6 @@ public: static QString GenGUID(); static QString GetISODate(); static QString GetCurrentUserName(); + static void InvokeMailto(const QString& subject, const QString& body, const QString& attachement = QString()); }; diff --git a/wizarddialog.cpp b/wizarddialog.cpp index 18ae9bdd4b8a3cb44eae54dd0f7b404801d2f107..c3258b70ee681f1d11c5d30e22c4f4d827fc31b7 100644 --- a/wizarddialog.cpp +++ b/wizarddialog.cpp @@ -32,12 +32,13 @@ WizardDialog::WizardDialog(QWidget *parent) : { ui->setupUi(this); - setFixedSize(this->width(),this->height()); + Qt::WindowFlags flags = windowFlags(); + flags = flags & (~Qt::WindowContextHelpButtonHint); - ui->wizardButton->setEnabled(false); + setWindowFlags(flags); QPixmap logo(":/images/logo-ring-standard-coul.png"); - ui->ringLogo->setPixmap(logo.scaledToHeight(100, Qt::SmoothTransformation)); + ui->ringLogo->setPixmap(logo.scaledToHeight(65, Qt::SmoothTransformation)); ui->ringLogo->setAlignment(Qt::AlignHCenter); ui->usernameEdit->setText(Utils::GetCurrentUserName()); @@ -60,7 +61,10 @@ WizardDialog::accept() Utils::CreateStartupLink(); auto account = AccountModel::instance().add(ui->usernameEdit->text(), Account::Protocol::RING); - account->setDisplayName(ui->usernameEdit->text()); + if (not ui->usernameEdit->text().isEmpty()) + account->setDisplayName(ui->usernameEdit->text()); + else + account->setDisplayName(tr("Unknown")); AccountModel::instance().ip2ip()->setRingtonePath(Utils::GetRingtonePath()); account->setRingtonePath(Utils::GetRingtonePath()); account->setUpnpEnabled(true); @@ -77,12 +81,6 @@ WizardDialog::endSetup(Account* a) QDialog::accept(); } -void -WizardDialog::on_usernameEdit_textChanged(const QString &arg1) -{ - ui->wizardButton->setEnabled(!arg1.isEmpty()); -} - void WizardDialog::closeEvent(QCloseEvent *event) { diff --git a/wizarddialog.h b/wizarddialog.h index 7ccca86d1ee2c0c3e12c3def9831e6bea5744587..87a4cb658bf1fb73dc50d58862ad39607ec91cc6 100644 --- a/wizarddialog.h +++ b/wizarddialog.h @@ -38,7 +38,6 @@ public: protected slots: void closeEvent(QCloseEvent *event); private slots: - void on_usernameEdit_textChanged(const QString &arg1); void accept(); private: diff --git a/wizarddialog.ui b/wizarddialog.ui index 819d5cd9e61cbf98e1a864b2d464df095c31a4a9..f038ffb054281c87923eca3f09105d94ac823dc8 100644 --- a/wizarddialog.ui +++ b/wizarddialog.ui @@ -6,10 +6,22 @@ 0 0 - 602 - 352 + 500 + 246 + + + 0 + 0 + + + + + 500 + 246 + + @@ -433,581 +445,223 @@ :/images/ring.png:/images/ring.png + + 0 + + + + + Qt::Vertical + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + + + + false + + + - - - 0 + + + Qt::Vertical + + + + 20 + 10 + + + + + + + + + 12 + + + + Choose your username: + + + Qt::AlignCenter + + + true + + + + + + + + 200 + 0 + + + + + 200 + 16777215 + + + + + 11 + + + + Qt::AlignCenter + + + true + + + + + + + Qt::Vertical + + + + 5 + 10 + + + + + + + + + 0 + 0 + + + + + 85 + 30 + + + + + 85 + 30 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 127 + 127 + 127 + + + + + + + 127 + 127 + 127 + + + + + + + + + 11 + 50 + false + + + + true + + + Next + + + false + + + + + + + Qt::Vertical + + + + 10 + 5 + - - - - Qt::Horizontal - - - - 100 - 20 - - - - - - - - - 0 - 0 - - - - - - - false - - - - - - - Qt::AlignCenter - - - true - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - 0 - 0 - 0 - - - - - - - 121 - 243 - 242 - - - - - - - 237 - 255 - 255 - - - - - - - 179 - 249 - 248 - - - - - - - 60 - 121 - 121 - - - - - - - 80 - 162 - 161 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 121 - 243 - 242 - - - - - - - 0 - 0 - 0 - - - - - - - 188 - 249 - 248 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - 121 - 243 - 242 - - - - - - - 237 - 255 - 255 - - - - - - - 179 - 249 - 248 - - - - - - - 60 - 121 - 121 - - - - - - - 80 - 162 - 161 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 121 - 243 - 242 - - - - - - - 0 - 0 - 0 - - - - - - - 188 - 249 - 248 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 60 - 121 - 121 - - - - - - - 121 - 243 - 242 - - - - - - - 237 - 255 - 255 - - - - - - - 179 - 249 - 248 - - - - - - - 60 - 121 - 121 - - - - - - - 80 - 162 - 161 - - - - - - - 60 - 121 - 121 - - - - - - - 255 - 255 - 255 - - - - - - - 60 - 121 - 121 - - - - - - - 121 - 243 - 242 - - - - - - - 121 - 243 - 242 - - - - - - - 0 - 0 - 0 - - - - - - - 121 - 243 - 242 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - Join the Ring - - - true - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 10 - 10 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 30 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - - 12 - - - - Choose your username: - - - Qt::AlignCenter - - - true - - - - +