-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaboutfriendform_8cpp_source.html
262 lines (260 loc) · 37.1 KB
/
aboutfriendform_8cpp_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>qTox: src/widget/about/aboutfriendform.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">qTox
 <span id="projectnumber">Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_c570470bf3e4213fb57699dd2e921b84.html">widget</a></li><li class="navelem"><a class="el" href="dir_b208ea380aede249978a38d71ce4cf36.html">about</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">aboutfriendform.cpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="aboutfriendform_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> Copyright © 2019 by The qTox Project Contributors</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span> </div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> This file is part of qTox, a Qt-based graphical interface for Tox.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"></span> </div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> qTox is libre software: you can redistribute it and/or modify</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> it under the terms of the GNU General Public License as published by</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> the Free Software Foundation, either version 3 of the License, or</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> (at your option) any later version.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"></span> </div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> qTox is distributed in the hope that it will be useful,</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> GNU General Public License for more details.</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"></span> </div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> You should have received a copy of the GNU General Public License</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> along with qTox. If not, see <http://www.gnu.org/licenses/>.</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment">*/</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  </div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include "<a class="code" href="aboutfriendform_8h.html">aboutfriendform.h</a>"</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "<a class="code" href="gui_8h.html">src/widget/gui.h</a>"</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include "ui_aboutfriendform.h"</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include "<a class="code" href="core_8h.html">src/core/core.h</a>"</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include "<a class="code" href="style_8h.html">src/widget/style.h</a>"</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  </div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <QFileDialog></span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include <QMessageBox></span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  </div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="classAboutFriendForm.html#ad92c7a6c4b38cb98dab059408edceb3e"> 29</a></span> <a class="code" href="classAboutFriendForm.html#ad92c7a6c4b38cb98dab059408edceb3e">AboutFriendForm::AboutFriendForm</a>(std::unique_ptr<IAboutFriend> _about, QWidget* parent)</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  : QDialog(parent)</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  , ui(new <a class="code" href="namespaceUi.html">Ui</a>::<a class="code" href="classAboutFriendForm.html">AboutFriendForm</a>)</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  , about{std::move(_about)}</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> {</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  ui->setupUi(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  ui->label_4->hide();</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  ui->aliases->hide();</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  </div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  connect(ui->buttonBox, &QDialogButtonBox::accepted, <span class="keyword">this</span>, &<a class="code" href="classAboutFriendForm.html#afa3c8800f9d1f5bdbd5a4baee477af69">AboutFriendForm::onAcceptedClicked</a>);</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  connect(ui->autoacceptfile, &QCheckBox::clicked, <span class="keyword">this</span>, &<a class="code" href="classAboutFriendForm.html#a36d85127a07b1ef8e38500f82318d5b8">AboutFriendForm::onAutoAcceptDirClicked</a>);</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  connect(ui->autoacceptcall, SIGNAL(activated(<span class="keywordtype">int</span>)), <span class="keyword">this</span>, SLOT(onAutoAcceptCallClicked(<span class="keywordtype">void</span>)));</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  connect(ui->autogroupinvite, &QCheckBox::clicked, <span class="keyword">this</span>, &<a class="code" href="classAboutFriendForm.html#a1c4afef8f3d5cc01401e174feab3485d">AboutFriendForm::onAutoGroupInvite</a>);</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  connect(ui->selectSaveDir, &QPushButton::clicked, <span class="keyword">this</span>, &<a class="code" href="classAboutFriendForm.html#a923ab453125399e93c2b77db4fea3a1d">AboutFriendForm::onSelectDirClicked</a>);</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  connect(ui->removeHistory, &QPushButton::clicked, <span class="keyword">this</span>, &<a class="code" href="classAboutFriendForm.html#a43f6177b8c53e0d45babb404e8122734">AboutFriendForm::onRemoveHistoryClicked</a>);</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  about->connectTo_autoAcceptDirChanged(<span class="keyword">this</span>, [=](<span class="keyword">const</span> QString& dir){ onAutoAcceptDirChanged(dir); });</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  </div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="keyword">const</span> QString dir = about->getAutoAcceptDir();</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  ui->autoacceptfile->setChecked(!dir.isEmpty());</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  </div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  ui->removeHistory->setEnabled(about->isHistoryExistence());</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  </div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> index = <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(about->getAutoAcceptCall());</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  ui->autoacceptcall->setCurrentIndex(index);</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  </div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  ui->selectSaveDir->setEnabled(ui->autoacceptfile->isChecked());</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  ui->autogroupinvite->setChecked(about->getAutoGroupInvite());</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  </div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="keywordflow">if</span> (ui->autoacceptfile->isChecked()) {</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  ui->selectSaveDir->setText(about->getAutoAcceptDir());</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  }</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  </div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keyword">const</span> QString name = about->getName();</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  setWindowTitle(name);</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  ui->userName->setText(name);</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  ui->publicKey->setText(about->getPublicKey().toString());</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  ui->publicKey->setCursorPosition(0); <span class="comment">// scroll textline to left</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  ui->note->setPlainText(about->getNote());</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  ui->statusMessage->setText(about->getStatusMessage());</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  ui->avatar->setPixmap(about->getAvatar());</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  </div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  connect(&<a class="code" href="classGUI.html#a78ab376fe2c917e5dc0199f634d963d8">GUI::getInstance</a>(), &<a class="code" href="classGUI.html#accb465b2f61367d2fc6f0757d3e4e9e3">GUI::themeReload</a>, <span class="keyword">this</span>, &<a class="code" href="classAboutFriendForm.html#a96d3ceadd9bb2e1d9acf198efa320e91">AboutFriendForm::reloadTheme</a>);</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  </div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  reloadTheme();</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> }</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  </div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="keyword">static</span> QString getAutoAcceptDir(<span class="keyword">const</span> QString& dir)</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> {</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="comment">//: popup title</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <span class="keyword">const</span> QString title = AboutFriendForm::tr(<span class="stringliteral">"Choose an auto-accept directory"</span>);</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keywordflow">return</span> QFileDialog::getExistingDirectory(Q_NULLPTR, title, dir);</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> }</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  </div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="classAboutFriendForm.html#a36d85127a07b1ef8e38500f82318d5b8"> 82</a></span> <span class="keywordtype">void</span> <a class="code" href="classAboutFriendForm.html#a36d85127a07b1ef8e38500f82318d5b8">AboutFriendForm::onAutoAcceptDirClicked</a>()</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> {</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keyword">const</span> QString dir = [&]{</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keywordflow">if</span> (!<a class="code" href="classAboutFriendForm.html#a56b596531bb5895f3b47326cc275df42">ui</a>->autoacceptfile->isChecked()) {</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="keywordflow">return</span> QString{};</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  }</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  </div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keywordflow">return</span> getAutoAcceptDir(<a class="code" href="classAboutFriendForm.html#ae875b47a5353ceb080dcc308d2441633">about</a>->getAutoAcceptDir());</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  }();</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  </div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <a class="code" href="classAboutFriendForm.html#ae875b47a5353ceb080dcc308d2441633">about</a>->setAutoAcceptDir(dir);</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span> }</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  </div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="classAboutFriendForm.html#a96d3ceadd9bb2e1d9acf198efa320e91"> 95</a></span> <span class="keywordtype">void</span> <a class="code" href="classAboutFriendForm.html#a96d3ceadd9bb2e1d9acf198efa320e91">AboutFriendForm::reloadTheme</a>()</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> {</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  setStyleSheet(<a class="code" href="classStyle.html#a0ef91fd7007fb061d38c9c82396dabd3">Style::getStylesheet</a>(<span class="stringliteral">"window/general.css"</span>));</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span> }</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  </div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="classAboutFriendForm.html#abd4787403f3b010bccf8ace0af5175a4"> 100</a></span> <span class="keywordtype">void</span> <a class="code" href="classAboutFriendForm.html#abd4787403f3b010bccf8ace0af5175a4">AboutFriendForm::onAutoAcceptDirChanged</a>(<span class="keyword">const</span> QString& path)</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span> {</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keyword">const</span> <span class="keywordtype">bool</span> enabled = !path.isNull();</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <a class="code" href="classAboutFriendForm.html#a56b596531bb5895f3b47326cc275df42">ui</a>->autoacceptfile->setChecked(enabled);</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <a class="code" href="classAboutFriendForm.html#a56b596531bb5895f3b47326cc275df42">ui</a>->selectSaveDir->setEnabled(enabled);</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <a class="code" href="classAboutFriendForm.html#a56b596531bb5895f3b47326cc275df42">ui</a>->selectSaveDir->setText(enabled ? path : tr(<span class="stringliteral">"Auto-accept for this contact is disabled"</span>));</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span> }</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  </div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  </div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="classAboutFriendForm.html#a6f2c0b79e0af8dc8aa3bd31bbe727ff3"> 109</a></span> <span class="keywordtype">void</span> <a class="code" href="classAboutFriendForm.html#a6f2c0b79e0af8dc8aa3bd31bbe727ff3">AboutFriendForm::onAutoAcceptCallClicked</a>()</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span> {</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> index = <a class="code" href="classAboutFriendForm.html#a56b596531bb5895f3b47326cc275df42">ui</a>->autoacceptcall->currentIndex();</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="keyword">const</span> IFriendSettings::AutoAcceptCallFlags flag{index};</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <a class="code" href="classAboutFriendForm.html#ae875b47a5353ceb080dcc308d2441633">about</a>->setAutoAcceptCall(flag);</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span> }</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  </div>
<div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="classAboutFriendForm.html#a1c4afef8f3d5cc01401e174feab3485d"> 119</a></span> <span class="keywordtype">void</span> <a class="code" href="classAboutFriendForm.html#a1c4afef8f3d5cc01401e174feab3485d">AboutFriendForm::onAutoGroupInvite</a>()</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span> {</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <a class="code" href="classAboutFriendForm.html#ae875b47a5353ceb080dcc308d2441633">about</a>->setAutoGroupInvite(<a class="code" href="classAboutFriendForm.html#a56b596531bb5895f3b47326cc275df42">ui</a>->autogroupinvite->isChecked());</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span> }</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  </div>
<div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="classAboutFriendForm.html#a923ab453125399e93c2b77db4fea3a1d"> 124</a></span> <span class="keywordtype">void</span> <a class="code" href="classAboutFriendForm.html#a923ab453125399e93c2b77db4fea3a1d">AboutFriendForm::onSelectDirClicked</a>()</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> {</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keyword">const</span> QString dir = getAutoAcceptDir(<a class="code" href="classAboutFriendForm.html#ae875b47a5353ceb080dcc308d2441633">about</a>->getAutoAcceptDir());</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <a class="code" href="classAboutFriendForm.html#ae875b47a5353ceb080dcc308d2441633">about</a>->setAutoAcceptDir(dir);</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span> }</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  </div>
<div class="line"><a name="l00133"></a><span class="lineno"><a class="line" href="classAboutFriendForm.html#afa3c8800f9d1f5bdbd5a4baee477af69"> 133</a></span> <span class="keywordtype">void</span> <a class="code" href="classAboutFriendForm.html#afa3c8800f9d1f5bdbd5a4baee477af69">AboutFriendForm::onAcceptedClicked</a>()</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span> {</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <a class="code" href="classAboutFriendForm.html#ae875b47a5353ceb080dcc308d2441633">about</a>->setNote(<a class="code" href="classAboutFriendForm.html#a56b596531bb5895f3b47326cc275df42">ui</a>->note->toPlainText());</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span> }</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  </div>
<div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="classAboutFriendForm.html#a43f6177b8c53e0d45babb404e8122734"> 138</a></span> <span class="keywordtype">void</span> <a class="code" href="classAboutFriendForm.html#a43f6177b8c53e0d45babb404e8122734">AboutFriendForm::onRemoveHistoryClicked</a>()</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span> {</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <span class="keyword">const</span> <span class="keywordtype">bool</span> retYes = <a class="code" href="classGUI.html#aa3b39480266a0808615eb065dd9a8dec">GUI::askQuestion</a>(tr(<span class="stringliteral">"Confirmation"</span>),</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  tr(<span class="stringliteral">"Are you sure to remove %1 chat history?"</span>).arg(<a class="code" href="classAboutFriendForm.html#ae875b47a5353ceb080dcc308d2441633">about</a>->getName()),</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="comment">/* defaultAns = */</span> <span class="keyword">false</span>, <span class="comment">/* warning = */</span> <span class="keyword">true</span>, <span class="comment">/* yesno = */</span> <span class="keyword">true</span>);</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <span class="keywordflow">if</span> (!retYes) {</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  }</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  </div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="keyword">const</span> <span class="keywordtype">bool</span> result = <a class="code" href="classAboutFriendForm.html#ae875b47a5353ceb080dcc308d2441633">about</a>->clearHistory();</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  </div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="keywordflow">if</span> (!result) {</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <a class="code" href="classGUI.html#ab1c1a41d742cabece0bdde6e020a80b7">GUI::showWarning</a>(tr(<span class="stringliteral">"History removed"</span>),</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  tr(<span class="stringliteral">"Failed to remove chat history with %1!"</span>).arg(<a class="code" href="classAboutFriendForm.html#ae875b47a5353ceb080dcc308d2441633">about</a>->getName()).toHtmlEscaped());</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  }</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  </div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  emit <a class="code" href="classAboutFriendForm.html#adc87c4f1eb5cd20c31b8da90b4597378">histroyRemoved</a>();</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  </div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <a class="code" href="classAboutFriendForm.html#a56b596531bb5895f3b47326cc275df42">ui</a>->removeHistory->setEnabled(<span class="keyword">false</span>); <span class="comment">// For know clearly to has removed the history</span></div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span> }</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  </div>
<div class="line"><a name="l00160"></a><span class="lineno"><a class="line" href="classAboutFriendForm.html#aac21ed333b05afc7bdaad8623bf7f17e"> 160</a></span> <a class="code" href="classAboutFriendForm.html#aac21ed333b05afc7bdaad8623bf7f17e">AboutFriendForm::~AboutFriendForm</a>()</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span> {</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  <span class="keyword">delete</span> <a class="code" href="classAboutFriendForm.html#a56b596531bb5895f3b47326cc275df42">ui</a>;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span> }</div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="astyle_8h_html"><div class="ttname"><a href="style_8h.html">style.h</a></div></div>
<div class="ttc" id="aclassAboutFriendForm_html_a6f2c0b79e0af8dc8aa3bd31bbe727ff3"><div class="ttname"><a href="classAboutFriendForm.html#a6f2c0b79e0af8dc8aa3bd31bbe727ff3">AboutFriendForm::onAutoAcceptCallClicked</a></div><div class="ttdeci">void onAutoAcceptCallClicked()</div><div class="ttdef"><b>Definition:</b> <a href="aboutfriendform_8cpp_source.html#l00109">aboutfriendform.cpp:109</a></div></div>
<div class="ttc" id="aclassAboutFriendForm_html_abd4787403f3b010bccf8ace0af5175a4"><div class="ttname"><a href="classAboutFriendForm.html#abd4787403f3b010bccf8ace0af5175a4">AboutFriendForm::onAutoAcceptDirChanged</a></div><div class="ttdeci">void onAutoAcceptDirChanged(const QString &path)</div><div class="ttdef"><b>Definition:</b> <a href="aboutfriendform_8cpp_source.html#l00100">aboutfriendform.cpp:100</a></div></div>
<div class="ttc" id="aclassAboutFriendForm_html_a96d3ceadd9bb2e1d9acf198efa320e91"><div class="ttname"><a href="classAboutFriendForm.html#a96d3ceadd9bb2e1d9acf198efa320e91">AboutFriendForm::reloadTheme</a></div><div class="ttdeci">void reloadTheme()</div><div class="ttdef"><b>Definition:</b> <a href="aboutfriendform_8cpp_source.html#l00095">aboutfriendform.cpp:95</a></div></div>
<div class="ttc" id="aclassAboutFriendForm_html_aac21ed333b05afc7bdaad8623bf7f17e"><div class="ttname"><a href="classAboutFriendForm.html#aac21ed333b05afc7bdaad8623bf7f17e">AboutFriendForm::~AboutFriendForm</a></div><div class="ttdeci">~AboutFriendForm()</div><div class="ttdef"><b>Definition:</b> <a href="aboutfriendform_8cpp_source.html#l00160">aboutfriendform.cpp:160</a></div></div>
<div class="ttc" id="aclassAboutFriendForm_html_a36d85127a07b1ef8e38500f82318d5b8"><div class="ttname"><a href="classAboutFriendForm.html#a36d85127a07b1ef8e38500f82318d5b8">AboutFriendForm::onAutoAcceptDirClicked</a></div><div class="ttdeci">void onAutoAcceptDirClicked()</div><div class="ttdef"><b>Definition:</b> <a href="aboutfriendform_8cpp_source.html#l00082">aboutfriendform.cpp:82</a></div></div>
<div class="ttc" id="aclassGUI_html_aa3b39480266a0808615eb065dd9a8dec"><div class="ttname"><a href="classGUI.html#aa3b39480266a0808615eb065dd9a8dec">GUI::askQuestion</a></div><div class="ttdeci">static bool askQuestion(const QString &title, const QString &msg, bool defaultAns=false, bool warning=true, bool yesno=true)</div><div class="ttdoc">Asks the user a question with Ok/Cancel or Yes/No buttons.</div><div class="ttdef"><b>Definition:</b> <a href="gui_8cpp_source.html#l00169">gui.cpp:169</a></div></div>
<div class="ttc" id="aclassAboutFriendForm_html_ad92c7a6c4b38cb98dab059408edceb3e"><div class="ttname"><a href="classAboutFriendForm.html#ad92c7a6c4b38cb98dab059408edceb3e">AboutFriendForm::AboutFriendForm</a></div><div class="ttdeci">AboutFriendForm(std::unique_ptr< IAboutFriend > about, QWidget *parent=nullptr)</div><div class="ttdef"><b>Definition:</b> <a href="aboutfriendform_8cpp_source.html#l00029">aboutfriendform.cpp:29</a></div></div>
<div class="ttc" id="aclassGUI_html_a78ab376fe2c917e5dc0199f634d963d8"><div class="ttname"><a href="classGUI.html#a78ab376fe2c917e5dc0199f634d963d8">GUI::getInstance</a></div><div class="ttdeci">static GUI & getInstance()</div><div class="ttdoc">Returns the singleton instance.</div><div class="ttdef"><b>Definition:</b> <a href="gui_8cpp_source.html#l00056">gui.cpp:56</a></div></div>
<div class="ttc" id="anamespaceUi_html"><div class="ttname"><a href="namespaceUi.html">Ui</a></div><div class="ttdef"><b>Definition:</b> <a href="filetransferwidget_8h_source.html#l00030">filetransferwidget.h:30</a></div></div>
<div class="ttc" id="aclassAboutFriendForm_html_ae875b47a5353ceb080dcc308d2441633"><div class="ttname"><a href="classAboutFriendForm.html#ae875b47a5353ceb080dcc308d2441633">AboutFriendForm::about</a></div><div class="ttdeci">const std::unique_ptr< IAboutFriend > about</div><div class="ttdef"><b>Definition:</b> <a href="aboutfriendform_8h_source.html#l00043">aboutfriendform.h:43</a></div></div>
<div class="ttc" id="aclassGUI_html_accb465b2f61367d2fc6f0757d3e4e9e3"><div class="ttname"><a href="classGUI.html#accb465b2f61367d2fc6f0757d3e4e9e3">GUI::themeReload</a></div><div class="ttdeci">void themeReload()</div></div>
<div class="ttc" id="aclassAboutFriendForm_html_a1c4afef8f3d5cc01401e174feab3485d"><div class="ttname"><a href="classAboutFriendForm.html#a1c4afef8f3d5cc01401e174feab3485d">AboutFriendForm::onAutoGroupInvite</a></div><div class="ttdeci">void onAutoGroupInvite()</div><div class="ttdoc">Sets the AutoGroupinvite status and saves the settings.</div><div class="ttdef"><b>Definition:</b> <a href="aboutfriendform_8cpp_source.html#l00119">aboutfriendform.cpp:119</a></div></div>
<div class="ttc" id="aclassAboutFriendForm_html_a923ab453125399e93c2b77db4fea3a1d"><div class="ttname"><a href="classAboutFriendForm.html#a923ab453125399e93c2b77db4fea3a1d">AboutFriendForm::onSelectDirClicked</a></div><div class="ttdeci">void onSelectDirClicked()</div><div class="ttdef"><b>Definition:</b> <a href="aboutfriendform_8cpp_source.html#l00124">aboutfriendform.cpp:124</a></div></div>
<div class="ttc" id="aclassGUI_html_ab1c1a41d742cabece0bdde6e020a80b7"><div class="ttname"><a href="classGUI.html#ab1c1a41d742cabece0bdde6e020a80b7">GUI::showWarning</a></div><div class="ttdeci">static void showWarning(const QString &title, const QString &msg)</div><div class="ttdoc">Show a warning to the user.</div><div class="ttdef"><b>Definition:</b> <a href="gui_8cpp_source.html#l00130">gui.cpp:130</a></div></div>
<div class="ttc" id="aclassStyle_html_a0ef91fd7007fb061d38c9c82396dabd3"><div class="ttname"><a href="classStyle.html#a0ef91fd7007fb061d38c9c82396dabd3">Style::getStylesheet</a></div><div class="ttdeci">static const QString getStylesheet(const QString &filename, const QFont &baseFont=QFont())</div><div class="ttdef"><b>Definition:</b> <a href="style_8cpp_source.html#l00165">style.cpp:165</a></div></div>
<div class="ttc" id="aclassAboutFriendForm_html_a56b596531bb5895f3b47326cc275df42"><div class="ttname"><a href="classAboutFriendForm.html#a56b596531bb5895f3b47326cc275df42">AboutFriendForm::ui</a></div><div class="ttdeci">Ui::AboutFriendForm * ui</div><div class="ttdef"><b>Definition:</b> <a href="aboutfriendform_8h_source.html#l00042">aboutfriendform.h:42</a></div></div>
<div class="ttc" id="aclassAboutFriendForm_html_a43f6177b8c53e0d45babb404e8122734"><div class="ttname"><a href="classAboutFriendForm.html#a43f6177b8c53e0d45babb404e8122734">AboutFriendForm::onRemoveHistoryClicked</a></div><div class="ttdeci">void onRemoveHistoryClicked()</div><div class="ttdef"><b>Definition:</b> <a href="aboutfriendform_8cpp_source.html#l00138">aboutfriendform.cpp:138</a></div></div>
<div class="ttc" id="aclassAboutFriendForm_html_adc87c4f1eb5cd20c31b8da90b4597378"><div class="ttname"><a href="classAboutFriendForm.html#adc87c4f1eb5cd20c31b8da90b4597378">AboutFriendForm::histroyRemoved</a></div><div class="ttdeci">void histroyRemoved()</div></div>
<div class="ttc" id="aclassAboutFriendForm_html"><div class="ttname"><a href="classAboutFriendForm.html">AboutFriendForm</a></div><div class="ttdef"><b>Definition:</b> <a href="aboutfriendform_8h_source.html#l00033">aboutfriendform.h:33</a></div></div>
<div class="ttc" id="acore_8h_html"><div class="ttname"><a href="core_8h.html">core.h</a></div></div>
<div class="ttc" id="aclassAboutFriendForm_html_afa3c8800f9d1f5bdbd5a4baee477af69"><div class="ttname"><a href="classAboutFriendForm.html#afa3c8800f9d1f5bdbd5a4baee477af69">AboutFriendForm::onAcceptedClicked</a></div><div class="ttdeci">void onAcceptedClicked()</div><div class="ttdoc">Called when user clicks the bottom OK button, save all settings.</div><div class="ttdef"><b>Definition:</b> <a href="aboutfriendform_8cpp_source.html#l00133">aboutfriendform.cpp:133</a></div></div>
<div class="ttc" id="aaboutfriendform_8h_html"><div class="ttname"><a href="aboutfriendform_8h.html">aboutfriendform.h</a></div></div>
<div class="ttc" id="agui_8h_html"><div class="ttname"><a href="gui_8h.html">gui.h</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>