added warning about number of destinations in msg composer and in IdDialog

This commit is contained in:
csoler 2020-11-14 13:37:49 +01:00
parent c32f90f84d
commit 9e94057a66
4 changed files with 1106 additions and 933 deletions

View File

@ -2387,6 +2387,10 @@ void IdDialog::sendMsg()
if(selected_items.empty())
return ;
if(selected_items.size() > 20)
if(QMessageBox::warning(nullptr,tr("Too many identities"),tr("<p>It is not recommended to send a message to more than 20 persons at once. Large scale diffusion of data (including friend invitations) are much more efficiently handled by forums. Click ok to proceed anyway.</p>"),QMessageBox::Ok|QMessageBox::Cancel,QMessageBox::Cancel)==QMessageBox::Cancel)
return;
MessageComposer *nMsgDialog = MessageComposer::newMsg();
if (nMsgDialog == NULL)
return;

View File

@ -134,6 +134,7 @@ MessageComposer::MessageComposer(QWidget *parent, Qt::WindowFlags flags)
m_completer = NULL;
ui.distantFrame->hide();
ui.sizeLimitFrame->hide();
ui.respond_to_CB->hide();
ui.fromLabel->hide();
@ -395,6 +396,11 @@ void MessageComposer::updateCells(int,int)
ui.distantFrame->hide() ;
ui.fromLabel->hide();
}
if(rowCount > 20)
ui.sizeLimitFrame->show();
else
ui.sizeLimitFrame->hide();
}
void MessageComposer::processSettings(bool bLoad)
@ -2770,7 +2776,10 @@ void MessageComposer::showTagLabels()
ui.tagLayout->addStretch();
}
}
void MessageComposer::on_closeSizeLimitFrameButton_clicked()
{
ui.sizeLimitFrame->setVisible(false);
}
void MessageComposer::on_closeInfoFrameButton_clicked()
{
ui.distantFrame->setVisible(false);

View File

@ -164,6 +164,7 @@ private slots:
void tagRemoveAll();
void on_closeInfoFrameButton_clicked();
void on_closeSizeLimitFrameButton_clicked();
static QString inviteMessage();

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>896</width>
<height>706</height>
<width>1008</width>
<height>755</height>
</rect>
</property>
<property name="windowTitle">
@ -18,8 +18,8 @@
<normaloff>:/icons/mail/compose.png</normaloff>:/icons/mail/compose.png</iconset>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="centralwidgetGLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QSplitter" name="centralwidgetHSplitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -176,16 +176,183 @@
</layout>
</widget>
</widget>
<widget class="QWidget" name="">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QGridLayout" name="messageTitleGLayout">
<item row="3" column="1">
<layout class="QHBoxLayout" name="tagHLayout">
<item>
<widget class="QPushButton" name="tagButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Tags</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/mail/tags.png</normaloff>:/icons/mail/tags.png</iconset>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="tagLayout"/>
</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>
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Subject:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="titleEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Tags:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="GxsIdChooser" name="respond_to_CB">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="fromLabel">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>From:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QTableWidget" name="recipientWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>68</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>68</height>
</size>
</property>
<property name="tabKeyNavigation">
<bool>false</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<attribute name="horizontalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>25</number>
</attribute>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QSplitter" name="messageSplitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QWidget" name="layoutWidget">
<layout class="QGridLayout" name="messageGLayout">
<property name="verticalSpacing">
<number>2</number>
</property>
<item row="4" column="0">
<widget class="QWidget" name="">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QFrame" name="toolBarFrame">
<property name="maximumSize">
<size>
@ -705,20 +872,7 @@
</layout>
</widget>
</item>
<item row="6" column="0">
<widget class="MimeTextEdit" name="msgText">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>4</horstretch>
<verstretch>4</verstretch>
</sizepolicy>
</property>
<property name="textInteractionFlags">
<set>Qt::TextEditorInteraction</set>
</property>
</widget>
</item>
<item row="5" column="0">
<item>
<widget class="QFrame" name="distantFrame">
<property name="palette">
<palette>
@ -830,6 +984,9 @@
<property name="text">
<string notr="true">Distant messages stay into your Outbox until an acknowledgement of receipt has been received.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -869,172 +1026,172 @@ border-image: url(:/images/closepressed.png)
</layout>
</widget>
</item>
<item row="2" column="0">
<layout class="QGridLayout" name="messageTitleGLayout">
<item row="3" column="1">
<layout class="QHBoxLayout" name="tagHLayout">
<item>
<widget class="QPushButton" name="tagButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<widget class="QFrame" name="sizeLimitFrame">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>178</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>178</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>178</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>178</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="toolTip">
<string>Tags</string>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/mail/tags.png</normaloff>:/icons/mail/tags.png</iconset>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="flat">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<layout class="QHBoxLayout" name="distantFrameHLayout_2">
<property name="leftMargin">
<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>
<item>
<widget class="QLabel" name="sizeLimitInfoPixmap">
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/info16.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="sizeLimitInfoLabel">
<property name="text">
<string notr="true">Sending messages to more than 20 people at once is not recommended. If you need to send invites, dedicated forums is what you need.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="tagLayout"/>
</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>
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Subject:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="titleEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Tags:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="GxsIdChooser" name="respond_to_CB">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="fromLabel">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>From:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QTableWidget" name="recipientWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>68</height>
</size>
</property>
<widget class="QToolButton" name="closeSizeLimitFrameButton">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>68</height>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="tabKeyNavigation">
<bool>false</bool>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
<property name="toolTip">
<string>Close</string>
</property>
<property name="styleSheet">
<string notr="true">QToolButton
{
border-image: url(:/images/closenormal.png)
}
QToolButton:hover
{
border-image: url(:/images/closehover.png)
}
QToolButton:pressed {
border-image: url(:/images/closepressed.png)
}</string>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>22</number>
</attribute>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="MimeTextEdit" name="msgText">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>4</horstretch>
<verstretch>4</verstretch>
</sizepolicy>
</property>
<property name="textInteractionFlags">
<set>Qt::TextEditorInteraction</set>
</property>
</widget>
</item>
</layout>
</widget>
@ -1115,6 +1272,9 @@ border-image: url(:/images/closepressed.png)
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
@ -1124,8 +1284,8 @@ border-image: url(:/images/closepressed.png)
<rect>
<x>0</x>
<y>0</y>
<width>896</width>
<height>21</height>
<width>1008</width>
<height>25</height>
</rect>
</property>
</widget>
@ -1227,27 +1387,27 @@ border-image: url(:/images/closepressed.png)
</widget>
<customwidgets>
<customwidget>
<class>HashBox</class>
<extends>QScrollArea</extends>
<header location="global">gui/common/HashBox.h</header>
<container>1</container>
<class>GxsIdChooser</class>
<extends>QComboBox</extends>
<header>gui/gxs/GxsIdChooser.h</header>
</customwidget>
<customwidget>
<class>MimeTextEdit</class>
<extends>QTextEdit</extends>
<header location="global">gui/common/MimeTextEdit.h</header>
</customwidget>
<customwidget>
<class>GxsIdChooser</class>
<extends>QComboBox</extends>
<header>gui/gxs/GxsIdChooser.h</header>
</customwidget>
<customwidget>
<class>FriendSelectionWidget</class>
<extends>QWidget</extends>
<header>gui/common/FriendSelectionWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>HashBox</class>
<extends>QScrollArea</extends>
<header location="global">gui/common/HashBox.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>titleEdit</tabstop>
@ -1261,9 +1421,8 @@ border-image: url(:/images/closepressed.png)
<tabstop>hashBox</tabstop>
</tabstops>
<resources>
<include location="../emojione.qrc"/>
<include location="../images.qrc"/>
<include location="../icons.qrc"/>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>