add block button on incoming contact request

Accepting and discarding was already possible but not blocking
requests from somebody (banning it). This is now possible when
looking at an incoming contact request by clicking on a red button.

Change-Id: I89914beaf27713cabece02de107569b1e1f851d0
Reviewed-by: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
diff --git a/contactrequestwidget.cpp b/contactrequestwidget.cpp
index b8cb31c..930645d 100644
--- a/contactrequestwidget.cpp
+++ b/contactrequestwidget.cpp
@@ -60,3 +60,12 @@
     setCurrentContactRequest(nullptr);
     emit choiceMade();
 }
+
+void ContactRequestWidget::on_blockCRButton_clicked()
+{
+    if (cr_ != nullptr) {
+        cr_->block();
+    }
+    setCurrentContactRequest(nullptr);
+    emit choiceMade();
+}
diff --git a/contactrequestwidget.h b/contactrequestwidget.h
index 75da142..f808cc4 100644
--- a/contactrequestwidget.h
+++ b/contactrequestwidget.h
@@ -42,6 +42,7 @@
 private slots:
     void on_acceptCRButton_clicked();
     void on_discardCRButton_clicked();
+    void on_blockCRButton_clicked();
 
 private:
     Ui::ContactRequestWidget *ui;
diff --git a/contactrequestwidget.ui b/contactrequestwidget.ui
index 1803971..2b2d0b3 100644
--- a/contactrequestwidget.ui
+++ b/contactrequestwidget.ui
@@ -81,6 +81,36 @@
        </spacer>
       </item>
       <item>
+       <widget class="QPushButton" name="blockCRButton">
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>30</height>
+         </size>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">padding-left: 15px;
+padding-right: 15px;</string>
+        </property>
+        <property name="text">
+         <string>Block</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="horizontalSpacer_2">
+        <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="discardCRButton">
         <property name="minimumSize">
          <size>
diff --git a/ringthemeutils.h b/ringthemeutils.h
index 0f8c962..1d021fe 100644
--- a/ringthemeutils.h
+++ b/ringthemeutils.h
@@ -26,5 +26,7 @@
 static const QColor lightBlack_ {63, 63, 63};
 static const QColor grey_ {192, 192, 192};
 static const QColor red_ {251, 72, 71};
+static const QColor lightRed_ {252, 91, 90};
+static const QColor darkRed_ {219, 55, 54};
 
 }
diff --git a/stylesheet.css b/stylesheet.css
index 25443df..de3ee94 100644
--- a/stylesheet.css
+++ b/stylesheet.css
@@ -304,6 +304,13 @@
     font: 14px;
 }
 
+QPushButton#blockCRButton{
+    background-color: rgb(251, 72, 71);
+    border: 0px;
+    color: white;
+    font: 14px;
+}
+
 QPushButton#nextButton:hover, QPushButton#playButton:hover, QPushButton#clearHistoryButton:hover,
 QPushButton#checkUpdateButton:hover, QPushButton#doTransferButton:hover, QPushButton#photoButton:hover,
 QPushButton#takePhotoButton:hover, QPushButton#importButton:hover,
@@ -315,6 +322,11 @@
     background-color: #4dc6d6;
 }
 
+QPushButton#blockCRButton:hover{
+    background-color: rgb(252, 91, 90);
+}
+
+
 QPushButton#nextButton:pressed, QPushButton#playButton:pressed, QPushButton#clearHistoryButton:pressed,
 QPushButton#checkUpdateButton:pressed, QPushButton#doTransferButton:pressed, QPushButton#photoButton:pressed,
 QPushButton#takePhotoButton:pressed, QPushButton#importButton:pressed,
@@ -325,6 +337,9 @@
 QPushButton#sendContactRequestButton:pressed, QPushButton#acceptCRButton:pressed, QPushButton#discardCRButton:pressed{
     background-color: #34acbd;
 }
+QPushButton#blockCRButton:pressed{
+    background-color: rgb(219, 55, 54);
+}
 
 QLineEdit#usernameEdit:enabled, QLineEdit#passwordEdit:enabled, QLineEdit#confirmPasswordEdit:enabled,
 QLineEdit#pinEdit:enabled, QLineEdit#fullNameEdit:enabled{