
8 семестр / Готовая курсовая работа / ММиВА. Курсовая работа
.pdf1093 |
{ |
1094 |
QMessageBox::critical(this, "Ошибка", exc.what()); |
1095 |
} |
1096 |
} |
1097 |
|
1098 |
void MainWindow::on_clear_all_and_disable_autoupdate_triggered() |
1099 |
{ |
1100 |
std::lock_guard<std::mutex> main_lock(main_mutex); |
1101 |
clear_all(); |
1102 |
} |
1103 |
|
1104 |
void MainWindow::on_show_message_statistics_triggered() |
1105 |
{ |
1106 |
std::lock_guard<std::mutex> main_lock(main_mutex); |
1107 |
try |
1108 |
{ |
1109 |
int n_folders = ui->folders_tree->topLevelItemCount(), n_messages = 0, |
|
n_unseen_messages = 0, n_attachments = 0; |
1110 |
for (int row = 0; row < ui->folders_tree->topLevelItemCount(); ++row) |
1111 |
{ |
1112 |
n_folders += get_number_of_folders_recursive(ui->folders_tree- |
|
>topLevelItem(row)); |
1113 |
n_messages += ui->folders_tree->topLevelItem(row)->text(2).toInt(); |
1114 |
n_unseen_messages += ui->folders_tree->topLevelItem(row)->text(1).toInt(); |
1115 |
} |
1116 |
unsigned long long size = 0; |
1117 |
constexpr unsigned long long kb = 1 << 10, mb = kb << 10, gb = mb << 10; |
1118 |
for (auto message_size : this->messages_sizes) |
1119 |
{ |
1120 |
size += message_size.second; |
1121 |
} |
1122 |
std::string size_s; |
1123 |
if (size >= gb) |
1124 |
{ |
1125 |
size = size * 100 / gb; |
1126 |
size_s = std::to_string(size / 100) + "." + std::to_string(size % 100) + " |
|
ГиБ"; |
1127 |
} |
1128 |
else if (size >= mb) |
1129 |
{ |
1130 |
size = size * 100 / mb; |
1131 |
size_s = std::to_string(size / 100) + "." + std::to_string(size % 100) + " |
|
МиБ"; |
1132 |
} |
1133 |
else if (size >= kb) |
1134 |
{ |
1135 |
size = size * 100 / kb; |
1136 |
size_s = std::to_string(size / 100) + "." + std::to_string(size % 100) + " |
|
КиБ"; |
1137 |
} |
1138 |
else |
1139 |
{ |
1140 |
size_s = std::to_string(size) + " Б"; |
1141 |
} |
1142 |
QString s = QString::fromStdString("Общее число папок, включая вложенные: " + |
|
std::to_string(n_folders) + |
1143 |
"\nОбщее число писем во всех папках: " + |
|
std::to_string(n_messages) + |
1144 |
"\nОбщее число непрочитанных писем: " + |
|
std::to_string(n_unseen_messages) + |
1145 |
"\nОбщий размер закэшированных сообщений с |
|
вложениями: " + size_s); |
1146 |
QMessageBox::information(this, "Статистика", s); |
1147 |
} |
1148 |
catch (const std::exception &exc) |
1149 |
{ |
1150 |
QMessageBox::critical(this, "Ошибка", exc.what()); |
1151 |
} |
1152 |
} |
1153 |
|
1154 |
int MainWindow::get_number_of_folders_recursive(QTreeWidgetItem *twi) |
71
1155 |
{ |
1156 |
int n = twi->childCount(); |
1157 |
if (twi) |
1158 |
{ |
1159 |
for (int c = 0, child_count = twi->childCount(); c < child_count; ++c) |
1160 |
{ |
1161 |
n += get_number_of_folders_recursive(twi->child(c)); |
1162 |
} |
1163 |
} |
1164 |
return n; |
1165 |
} |
1166 |
|
1167 |
void MainWindow::on_show_about_window_triggered() |
1168 |
{ |
1169 |
try |
1170 |
{ |
1171 |
QMessageBox::about(this, "О программе", |
1172 |
"Курсовая работа по дисциплине ММиВА (СПбГУТ)\n" |
1173 |
"Тема: Разработка клиентского ПО для получения и " |
1174 |
"отправки почтовых сообщений\n" |
1175 |
"Выполнил студент группы ИКПИ-84\n" |
1176 |
"Коваленко Леонид\n" |
1177 |
"Санкт-Петербург\n" |
1178 |
"2022 год"); |
1179 |
} |
1180 |
catch (const std::exception &exc) |
1181 |
{ |
1182 |
QMessageBox::critical(this, "Ошибка", exc.what()); |
1183 |
} |
1184 |
} |
1185 |
|
1186 |
void MainWindow::on_folders_tree_itemClicked(QTreeWidgetItem *, |
1187 |
int) // not use arguments because |
|
concurrent programming! |
1188 |
{ |
1189 |
std::lock_guard<std::mutex> main_lock(main_mutex); |
1190 |
folder_chosen_ui(); |
1191 |
} |
1192 |
|
1193 |
void MainWindow::on_messages_table_itemClicked(QTableWidgetItem *) |
1194 |
{ |
1195 |
std::lock_guard<std::mutex> main_lock(main_mutex); |
1196 |
try |
1197 |
{ |
1198 |
QTableWidgetItem *current_message_id = ui->messages_table->item(ui- |
|
>messages_table->currentRow(), 7); |
1199 |
if (current_message_id == nullptr || current_message_id->text().isEmpty()) |
1200 |
{ |
1201 |
ui->current_message->setDocument(&this->empty_text_document); |
1202 |
ui->status_bar->showMessage("Message ID выбранного сообщения не найден"); |
1203 |
return; |
1204 |
} |
1205 |
std::string current_message_id_s = current_message_id->text().toStdString(); |
1206 |
if (this->messages_ids_to_text_documents.find(current_message_id_s) == |
1207 |
this->messages_ids_to_text_documents.end()) |
1208 |
{ |
1209 |
ui->current_message->setDocument(&this->empty_text_document); |
1210 |
ui->status_bar->showMessage("Тело выбранного сообщения не найдено"); |
1211 |
return; |
1212 |
} |
1213 |
ui->current_message->setDocument(&this- |
|
>messages_ids_to_text_documents[current_message_id_s]); |
1214 |
ui->status_bar->showMessage("Сообщение открыто"); |
1215 |
} |
1216 |
catch (const std::exception &exc) |
1217 |
{ |
1218 |
QMessageBox::critical(this, "Ошибка", exc.what()); |
1219 |
} |
1220 |
} |
1221 |
|
1222 |
void MainWindow::on_search_query_textChanged(const QString &query) |
72
1223 |
{ |
1224 |
ui->messages_table->setCurrentCell(-1, -1); |
1225 |
if (query == "") |
1226 |
{ |
1227 |
return; |
1228 |
} |
1229 |
std::lock_guard<std::mutex> main_lock(main_mutex); |
1230 |
auto find_items = ui->messages_table->findItems(query, Qt::MatchContains); |
1231 |
std::unordered_set<int> rows; |
1232 |
for (qsizetype i = 0, n = find_items.size(); i < n; ++i) |
1233 |
{ |
1234 |
auto item = find_items.at(i); |
1235 |
item->setSelected(true); |
1236 |
rows.insert(item->row()); |
1237 |
} |
1238 |
ui->status_bar->showMessage("Найдено " + QString::number(rows.size()) + " |
|
сообщений"); |
1239 |
} |
1240 |
|
1241 |
void MainWindow::on_search_query_returnPressed() |
1242 |
{ |
1243 |
MainWindow::on_search_query_textChanged(ui->search_query->text()); |
1244 |
} |
1245 |
|
1246 |
std::string MainWindow::get_current_datetime_as_string() |
1247 |
{ |
1248 |
char buffer[256]; |
1249 |
std::time_t t = std::time(nullptr); |
1250 |
if (std::strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", |
|
std::localtime(&t))) |
1251 |
{ |
1252 |
return std::string(buffer); |
1253 |
} |
1254 |
return "[undefined]"; |
1255 |
} |
1256 |
|
1257 |
std::string MainWindow::local_date_time_as_string(const |
|
boost::local_time::local_date_time &ldt) |
1258 |
{ |
1259 |
char buffer[256]; |
1260 |
auto dt_tm = boost::local_time::to_tm(ldt); |
1261 |
if (strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", &dt_tm)) |
1262 |
{ |
1263 |
return std::string(buffer); |
1264 |
} |
1265 |
return "[undefined]"; |
1266 |
} |
1267 |
|
1268 |
void MainWindow::closeEvent(QCloseEvent *event) |
1269 |
{ |
1270 |
std::lock_guard<std::mutex> main_lock(main_mutex); |
1271 |
if (QMessageBox::question(this, "Внимание", "Вы уверены, что хотите выйти?", |
|
QMessageBox::Yes | QMessageBox::No, |
1272 |
QMessageBox::No) == QMessageBox::Yes) |
1273 |
{ |
1274 |
clear_all(); |
1275 |
event->accept(); |
1276 |
} |
1277 |
else |
1278 |
{ |
1279 |
event->ignore(); |
1280 |
} |
1281 |
} |
1282 |
|
1283 |
void MainWindow::clear_all() |
1284 |
{ |
1285 |
try |
1286 |
{ |
1287 |
imap_settings.set_autoupdate(false); |
1288 |
ui->folders_tree->clear(); |
1289 |
ui->messages_table->clearContents(); |
73
1290 |
ui->messages_table->setRowCount(0); |
1291 |
ui->current_message->setDocument(&this->empty_text_document); |
1292 |
ui->logs_text_edit->clear(); |
1293 |
ui->search_query->clear(); |
1294 |
ui->status_bar->clearMessage(); |
1295 |
update_status = true; |
1296 |
update_status_message.clear(); |
1297 |
folders.clear(); |
1298 |
current_item.clear(); |
1299 |
messages_sizes.clear(); |
1300 |
messages.clear(); |
1301 |
messages_ids_to_uids.clear(); |
1302 |
messages_ids_to_text_documents.clear(); |
1303 |
uids_to_messages_ids.clear(); |
1304 |
mailboxes_to_messages_ids.clear(); |
1305 |
} |
1306 |
catch (...) |
1307 |
{ |
1308 |
} |
1309 |
} |
Модуль «main.cpp»
1 #include <QApplication>
2
3 #include "mainwindow.h"
4
5int main(int argc, char *argv[])
6{
7setlocale(LC_ALL, "Russian");
8QApplication a(argc, argv);
9MainWindow w;
10w.show();
11return a.exec();
12}
74
Исходный код оконных форм
Оконная форма «mainwindow.ui»
1<?xml version="1.0" encoding="UTF-8"?><ui version="4.0"><class>MainWindow</class><widget class="QMainWindow" name="MainWindow"><property name="geometry"><rect><x>0</x><y>0</y><width>960</width><height>660</height></rect></p roperty><property name="windowTitle"><string>Почтовый клиент</string></property><property name="windowIcon"><iconset resource="resources.qrc"><normaloff>:/icons/icons/appicon.png</normaloff>:/icons/icons /appicon.png</iconset></property><widget class="QWidget" name="centralwidget"><layout class="QVBoxLayout" name="verticalLayout"><item><widget class="QSplitter" name="vertical_splitter"><property name="orientation"><enum>Qt::Vertical</enum></property><widget class="QSplitter" name="horizontal_splitter"><property name="orientation"><enum>Qt::Horizontal</enum></property><widget class="QTreeWidget" name="folders_tree"><property name="sizePolicy"><sizepolicy hsizetype="Expanding" vsizetype="Expanding"><horstretch>0</horstretch><verstretch>0</verstretch></sizepolicy ></property><property name="frameShadow"><enum>QFrame::Raised</enum></property><property name="editTriggers"><set>QAbstractItemView::NoEditTriggers</set></property><property name="expandsOnDoubleClick"><bool>false</bool></property><attribute name="headerStretchLastSection"><bool>false</bool></attribute><column><property name="text"><string>Папка</string></property></column><column><property name="text"><string>Число непрочитанных</string></property></column><column><property name="text"><string>Общее число писем</string></property></column><column><property name="text"><string>Исходное название папки</string></property></column></widget><widget class="QWidget" name="messages_widget"><layout class="QVBoxLayout" name="vertical_layout_2"><item><widget class="QTableWidget" name="messages_table"><property name="sizePolicy"><sizepolicy hsizetype="Expanding" vsizetype="Expanding"><horstretch>0</horstretch><verstretch>0</verstretch></sizepolicy ></property><property name="frameShadow"><enum>QFrame::Raised</enum></property><property name="editTriggers"><set>QAbstractItemView::NoEditTriggers</set></property><property name="selectionBehavior"><enum>QAbstractItemView::SelectRows</enum></property><attribu te name="horizontalHeaderHighlightSections"><bool>false</bool></attribute><attribute name="horizontalHeaderShowSortIndicator" stdset="0"><bool>true</bool></attribute><attribute name="verticalHeaderHighlightSections"><bool>false</bool></attribute><column><property name="text"><string>Тема</string></property></column><column><property name="text"><string>Отправитель</string></property></column><column><property name="text"><string>Дата</string></property></column><column><property name="text"><string>Получатели</string></property></column><column><property name="text"><string>Число вложений</string></property></column><column><property name="text"><string>Размер сообщения с вложениями</string></property></column><column><property name="text"><string>UID</string></property></column><column><property name="text"><string>Message ID</string></property></column></widget></item><item><widget class="QLineEdit" name="search_query"><property name="placeholderText"><string>Поиск сообщения</string></property><property name="clearButtonEnabled"><bool>true</bool></property></widget></item></layout></widge t></widget><widget class="QTextEdit" name="current_message"><property name="frameShadow"><enum>QFrame::Raised</enum></property><property name="undoRedoEnabled"><bool>false</bool></property><property name="readOnly"><bool>true</bool></property><property name="acceptRichText"><bool>false</bool></property><property name="textInteractionFlags"><set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMo use|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse< /set></property></widget><widget class="QPlainTextEdit" name="logs_text_edit"><property name="maximumSize"><size><width>16777215</width><height>100</height></size></property> <property name="frameShadow"><enum>QFrame::Raised</enum></property><property name="readOnly"><bool>true</bool></property></widget></widget></item></layout></widget ><widget class="QMenuBar" name="menubar"><property name="geometry"><rect><x>0</x><y>0</y><width>960</width><height>30</height></rect></pr operty><widget class="QMenu" name="menu"><property name="title"><string>Главное</string></property><addaction
75
name="update_folders_and_messages"/><addaction name="set_up_account"/><addaction name="separator"/><addaction name="exit_program"/></widget><widget class="QMenu" name="menu_2"><property name="title"><string>Папки</string></property><addaction name="add_folder"/><addaction name="rename_folder"/><addaction name="delete_selected_folder"/></widget><widget class="QMenu" name="menu_3"><property name="title"><string>Сообщения</string></property><addaction name="send_message"/><addaction name="download_attachment"/><addaction name="separator"/><addaction name="copy_selected_message"/><addaction name="delete_selected_message"/></widget><widget class="QMenu" name="menu_4"><property name="title"><string>Дополнительно</string></property><addaction name="clear_all_and_disable_autoupdate"/><addaction name="show_message_statistics"/><addaction name="show_about_window"/></widget><addaction name="menu"/><addaction name="menu_2"/><addaction name="menu_3"/><addaction name="menu_4"/></widget><widget class="QStatusBar" name="status_bar"/><action name="send_message"><property name="icon"><iconset resource="resources.qrc"><normaloff>:/icons/icons/send_message.png</normaloff>:/icons/ icons/send_message.png</iconset></property><property name="text"><string>Отправить сообщение</string></property><property name="shortcut"><string>Ctrl+M</string></property></action><action name="update_folders_and_messages"><property name="icon"><iconset resource="resources.qrc"><normaloff>:/icons/icons/refresh.png</normaloff>:/icons/icons /refresh.png</iconset></property><property name="text"><string>Обновить папки с сообщениями</string></property><property name="shortcut"><string>Ctrl+R</string></property></action><action name="show_message_statistics"><property name="icon"><iconset resource="resources.qrc"><normaloff>:/icons/icons/statistics.png</normaloff>:/icons/ic ons/statistics.png</iconset></property><property name="text"><string>Статистика</string></property><property name="shortcut"><string>Ctrl+S</string></property></action><action name="show_about_window"><property name="icon"><iconset resource="resources.qrc"><normaloff>:/icons/icons/about.png</normaloff>:/icons/icons/a bout.png</iconset></property><property name="text"><string>О
программе</string></property></action><action name="add_folder"><property name="icon"><iconset resource="resources.qrc"><normaloff>:/icons/icons/add_folder.png</normaloff>:/icons/ic ons/add_folder.png</iconset></property><property name="text"><string>Добавить папку</string></property><property name="shortcut"><string>Ctrl+F</string></property></action><action name="delete_selected_folder"><property name="icon"><iconset resource="resources.qrc"><normaloff>:/icons/icons/delete_folder.png</normaloff>:/icons /icons/delete_folder.png</iconset></property><property name="text"><string>Удалить выбранную папку</string></property></action><action name="exit_program"><property name="icon"><iconset resource="resources.qrc"><normaloff>:/icons/icons/exit.png</normaloff>:/icons/icons/ex it.png</iconset></property><property name="text"><string>Выйти из программы</string></property></action><action name="set_up_account"><property name="icon"><iconset resource="resources.qrc"><normaloff>:/icons/icons/settings.png</normaloff>:/icons/icon s/settings.png</iconset></property><property name="text"><string>Настроить учетную запись</string></property></action><action name="delete_selected_message"><property name="icon"><iconset resource="resources.qrc"><normaloff>:/icons/icons/delete_message.png</normaloff>:/icon s/icons/delete_message.png</iconset></property><property name="text"><string>Удалить выбранные сообщения безвозвратно</string></property></action><action name="rename_folder"><property name="icon"><iconset resource="resources.qrc"><normaloff>:/icons/icons/rename_folder.png</normaloff>:/icons /icons/rename_folder.png</iconset></property><property name="text"><string>Переименовать выбранную папку</string></property></action><action name="clear_all_and_disable_autoupdate"><property name="icon"><iconset resource="resources.qrc"><normaloff>:/icons/icons/delete_all.png</normaloff>:/icons/ic ons/delete_all.png</iconset></property><property name="text"><string>Очистить все и отключить автообновление</string></property></action><action name="download_attachment"><property name="icon"><iconset resource="resources.qrc"><normaloff>:/icons/icons/get_attachment.png</normaloff>:/icon s/icons/get_attachment.png</iconset></property><property name="text"><string>Скачать вложение выбранного сообщения</string></property></action><action name="copy_selected_message"><property name="icon"><iconset resource="resources.qrc"><normaloff>:/icons/icons/copy_message.png</normaloff>:/icons/ icons/copy_message.png</iconset></property><property name="text"><string>Скопировать выбранные сообщения в
76
папку...</string></property></action></widget><tabstops><tabstop>folders_tree</tabstop
><tabstop>messages_table</tabstop><tabstop>current_message</tabstop><tabstop>logs_text _edit</tabstop></tabstops><resources><include location="resources.qrc"/></resources><connections/></ui>
Оконная форма «send_message_dialog.ui»
1<?xml version="1.0" encoding="UTF-8"?><ui version="4.0"><class>SendMessageDialog</class><widget class="QDialog" name="SendMessageDialog"><property name="geometry"><rect><x>0</x><y>0</y><width>832</width><height>585</height></rect></p roperty><property name="windowTitle"><string>Отправить сообщение</string></property><property name="windowIcon"><iconset resource="resources.qrc"><normaloff>:/icons/icons/send_message.png</normaloff>:/icons/ icons/send_message.png</iconset></property><property name="sizeGripEnabled"><bool>true</bool></property><property name="modal"><bool>true</bool></property><layout class="QFormLayout" name="formLayout"><property name="fieldGrowthPolicy"><enum>QFormLayout::AllNonFixedFieldsGrow</enum></property><pr operty name="rowWrapPolicy"><enum>QFormLayout::DontWrapRows</enum></property><property name="horizontalSpacing"><number>10</number></property><property name="verticalSpacing"><number>10</number></property><property name="leftMargin"><number>10</number></property><property name="topMargin"><number>10</number></property><property name="rightMargin"><number>10</number></property><property name="bottomMargin"><number>10</number></property><item row="0" column="0"><widget class="QLabel" name="subject_label"><property name="text"><string>Тема сообщения:</string></property></widget></item><item row="0" column="1"><widget class="QLineEdit" name="subject_line_edit"><property name="text"><string>Привет, мир! Hello, world!</string></property></widget></item><item row="1" column="0"><widget class="QLabel" name="recipients_label"><property name="text"><string>Получатели:</string></property></widget></item><item row="1" column="1"><widget class="QLineEdit" name="recipients_line_edit"><property name="text"><string>robert.wayne.alx@yandex.ru, robert.wayne.alx@ya.ru</string></property></widget></item><item row="2" column="0"><widget class="QLabel" name="cc_recipients_label"><property name="text"><string>Получатели копии:</string></property></widget></item><item row="2" column="1"><widget class="QLineEdit" name="cc_recipients_line_edit"><property name="text"><string>robert.wayne.alx@yandex.by, robert.wayne.alx@yandex.com</string></property></widget></item><item row="3" column="0"><widget class="QLabel" name="bcc_recipients_label"><property name="text"><string>Получатели скрытой копии:</string></property></widget></item><item row="3" column="1"><widget class="QLineEdit" name="bcc_recipients_line_edit"><property name="text"><string>robert.wayne.alx@yandex.ua, robert.wayne.alx@yandex.kz</string></property></widget></item><item row="6" column="0"><widget class="QLabel" name="content_label"><property name="text"><string>Текст сообщения:</string></property></widget></item><item row="7" column="0" colspan="2"><widget class="QPlainTextEdit" name="content_text_edit"><property name="minimumSize"><size><width>0</width><height>0</height></size></property><property name="frameShadow"><enum>QFrame::Raised</enum></property><property name="lineWrapMode"><enum>QPlainTextEdit::NoWrap</enum></property><property name="plainText"><string>Привет, мир!
2Hello, world!
3</string></property></widget></item><item row="12" column="0"><widget class="QLabel" name="attachment_label"><property name="text"><string>Вложения:</string></property></widget></item><item row="12" column="1"><widget class="QWidget" name="widget" native="true"><property name="sizePolicy"><sizepolicy hsizetype="Preferred" vsizetype="Preferred"><horstretch>0</horstretch><verstretch>0</verstretch></sizepolicy ></property><property name="minimumSize"><size><width>0</width><height>40</height></size></property><layout class="QHBoxLayout" name="horizontalLayout"><property name="spacing"><number>10</number></property><property name="leftMargin"><number>0</number></property><property name="topMargin"><number>0</number></property><property name="rightMargin"><number>0</number></property><property name="bottomMargin"><number>0</number></property><item><widget class="QPushButton" name="add_attachment"><property name="minimumSize"><size><width>0</width><height>30</height></size></property><propert y name="text"><string>Добавить
77
вложение</string></property></widget></item><item><widget class="QPushButton" name="remove_attachment"><property name="minimumSize"><size><width>0</width><height>30</height></size></property><propert y name="text"><string>Удалить вложение</string></property></widget></item></layout></widget></item><item row="13" column="0" colspan="2"><widget class="QTableWidget" name="attachments_table"><property name="frameShadow"><enum>QFrame::Raised</enum></property><property name="editTriggers"><set>QAbstractItemView::NoEditTriggers</set></property><property name="selectionMode"><enum>QAbstractItemView::SingleSelection</enum></property><proper ty name="selectionBehavior"><enum>QAbstractItemView::SelectRows</enum></property><attribu te name="horizontalHeaderHighlightSections"><bool>false</bool></attribute><attribute name="horizontalHeaderShowSortIndicator" stdset="0"><bool>false</bool></attribute><attribute name="verticalHeaderHighlightSections"><bool>false</bool></attribute><column><property name="text"><string>Имя файла</string></property></column><column><property name="text"><string>Размер файла</string></property></column><column><property name="text"><string>Путь к файлу</string></property></column></widget></item><item row="15" column="0" colspan="2"><widget class="QDialogButtonBox" name="button_box"><property name="orientation"><enum>Qt::Horizontal</enum></property><property name="standardButtons"><set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set></prope rty></widget></item><item row="4" column="1"><widget class="QLabel" name="note_label"><property name="text"><string>(получатели указываются через запятую либо пробел)</string></property><property name="alignment"><set>Qt::AlignCenter</set></property></widget></item></layout></widge t><resources><include location="resources.qrc"/></resources><connections><connection><sender>button_box</sen der><signal>accepted()</signal><receiver>SendMessageDialog</receiver><slot>accept()</s lot><hints><hint type="sourcelabel"><x>248</x><y>254</y></hint><hint type="destinationlabel"><x>157</x><y>274</y></hint></hints></connection><connection><s ender>button_box</sender><signal>rejected()</signal><receiver>SendMessageDialog</recei ver><slot>reject()</slot><hints><hint type="sourcelabel"><x>316</x><y>260</y></hint><hint type="destinationlabel"><x>286</x><y>274</y></hint></hints></connection></connections> </ui>
Оконная форма «settings_dialog.ui»
1<?xml version="1.0" encoding="UTF-8"?><ui version="4.0"><class>SettingsDialog</class><widget class="QDialog" name="SettingsDialog"><property name="geometry"><rect><x>0</x><y>0</y><width>540</width><height>360</height></rect></p roperty><property name="windowTitle"><string>Настройки</string></property><property name="windowIcon"><iconset resource="resources.qrc"><normaloff>:/icons/icons/settings.png</normaloff>:/icons/icon s/settings.png</iconset></property><property name="modal"><bool>true</bool></property><widget class="QDialogButtonBox" name="button_box"><property name="geometry"><rect><x>329</x><y>315</y><width>201</width><height>35</height></rect> </property><property name="orientation"><enum>Qt::Horizontal</enum></property><property name="standardButtons"><set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set></prope rty></widget><widget class="QLineEdit" name="imap_server_line_edit"><property name="geometry"><rect><x>80</x><y>80</y><width>170</width><height>30</height></rect></ property></widget><widget class="QLabel" name="imap_label"><property name="geometry"><rect><x>10</x><y>50</y><width>240</width><height>24</height></rect></ property><property name="text"><string>Настройки IMAP</string></property><property name="alignment"><set>Qt::AlignCenter</set></property></widget><widget class="QLabel" name="imap_server_label"><property name="geometry"><rect><x>10</x><y>80</y><width>70</width><height>25</height></rect></p roperty><property name="text"><string>Сервер:</string></property></widget><widget class="QLabel" name="imap_port_label"><property name="geometry"><rect><x>10</x><y>120</y><width>70</width><height>25</height></rect></ property><property name="text"><string>Порт:</string></property></widget><widget class="QComboBox" name="mail_server_combo_box"><property name="geometry"><rect><x>340</x><y>10</y><width>190</width><height>30</height></rect>< /property><item><property name="text"><string>Yandex</string></property></item><item><property name="text"><string>Gmail</string></property></item><item><property
78
name="text"><string>Mail.ru</string></property></item></widget><widget class="QLabel" name="imap_password_label"><property name="geometry"><rect><x>10</x><y>200</y><width>70</width><height>25</height></rect></ property><property name="text"><string>Пароль:</string></property></widget><widget class="QLabel" name="imap_login_label"><property name="geometry"><rect><x>10</x><y>160</y><width>70</width><height>25</height></rect></ property><property name="text"><string>Логин:</string></property></widget><widget class="QLineEdit" name="imap_password_line_edit"><property name="geometry"><rect><x>80</x><y>200</y><width>170</width><height>30</height></rect>< /property><property name="echoMode"><enum>QLineEdit::Password</enum></property></widget><widget class="QLineEdit" name="imap_login_line_edit"><property name="geometry"><rect><x>80</x><y>160</y><width>170</width><height>30</height></rect>< /property><property name="clearButtonEnabled"><bool>false</bool></property></widget><widget class="QLabel" name="smtp_label"><property name="geometry"><rect><x>290</x><y>50</y><width>240</width><height>24</height></rect>< /property><property name="text"><string>Настройки SMTP</string></property><property name="alignment"><set>Qt::AlignCenter</set></property></widget><widget class="QLabel" name="smtp_port_label"><property name="geometry"><rect><x>290</x><y>120</y><width>70</width><height>25</height></rect>< /property><property name="text"><string>Порт:</string></property></widget><widget class="QLineEdit" name="smtp_password_line_edit"><property name="geometry"><rect><x>360</x><y>200</y><width>170</width><height>30</height></rect> </property><property name="echoMode"><enum>QLineEdit::Password</enum></property></widget><widget class="QLabel" name="smtp_server_label"><property name="geometry"><rect><x>290</x><y>80</y><width>70</width><height>25</height></rect></ property><property name="text"><string>Сервер:</string></property></widget><widget class="QLabel" name="smtp_login_label"><property name="geometry"><rect><x>290</x><y>160</y><width>70</width><height>25</height></rect>< /property><property name="text"><string>Логин:</string></property></widget><widget class="QLineEdit" name="smtp_login_line_edit"><property name="geometry"><rect><x>360</x><y>160</y><width>170</width><height>30</height></rect> </property></widget><widget class="QLabel" name="smtp_password_label"><property name="geometry"><rect><x>290</x><y>200</y><width>70</width><height>25</height></rect>< /property><property name="text"><string>Пароль:</string></property></widget><widget class="QLineEdit" name="smtp_server_line_edit"><property name="geometry"><rect><x>360</x><y>80</y><width>170</width><height>30</height></rect>< /property></widget><widget class="QSpinBox" name="autoupdate_spin_box"><property name="geometry"><rect><x>170</x><y>280</y><width>60</width><height>30</height></rect>< /property><property name="alignment"><set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set></propert y><property name="correctionMode"><enum>QAbstractSpinBox::CorrectToNearestValue</enum></property>< property name="minimum"><number>1</number></property><property name="maximum"><number>86400</number></property></widget><widget class="QCheckBox" name="autoupdate_check_box"><property name="geometry"><rect><x>10</x><y>280</y><width>171</width><height>30</height></rect>< /property><property name="text"><string>Автообновление:</string></property></widget><widget class="QLabel" name="seconds_label"><property name="geometry"><rect><x>230</x><y>285</y><width>25</width><height>25</height></rect>< /property><property name="text"><string>с.</string></property><property name="alignment"><set>Qt::AlignCenter</set></property></widget><widget class="QLabel" name="mail_server_label"><property name="geometry"><rect><x>20</x><y>10</y><width>310</width><height>30</height></rect></ property><property name="text"><string>Выставить настройки автоматически:</string></property></widget><widget class="QSpinBox" name="imap_port_spin_box"><property name="geometry"><rect><x>80</x><y>120</y><width>171</width><height>30</height></rect>< /property><property name="correctionMode"><enum>QAbstractSpinBox::CorrectToNearestValue</enum></property>< property name="minimum"><number>0</number></property><property name="maximum"><number>65535</number></property><property name="value"><number>993</number></property></widget><widget class="QSpinBox" name="smtp_port_spin_box"><property name="geometry"><rect><x>360</x><y>120</y><width>171</width><height>30</height></rect> </property><property name="correctionMode"><enum>QAbstractSpinBox::CorrectToNearestValue</enum></property>< property name="minimum"><number>0</number></property><property
79
name="maximum"><number>65535</number></property><property name="value"><number>465</number></property></widget><widget class="QComboBox" name="imap_auth_combo_box"><property name="geometry"><rect><x>80</x><y>240</y><width>170</width><height>30</height></rect>< /property><item><property name="text"><string>START_TLS</string></property></item><item><property name="text"><string>LOGIN</string></property></item></widget><widget class="QLabel" name="imap_auth_label"><property name="geometry"><rect><x>10</x><y>240</y><width>70</width><height>25</height></rect></ property><property name="text"><string>Auth:</string></property></widget><widget class="QLabel" name="smtp_auth_label"><property name="geometry"><rect><x>290</x><y>240</y><width>70</width><height>25</height></rect>< /property><property name="text"><string>Auth:</string></property></widget><widget class="QComboBox" name="smtp_auth_combo_box"><property name="geometry"><rect><x>360</x><y>240</y><width>170</width><height>30</height></rect> </property><item><property name="text"><string>START_TLS</string></property></item><item><property name="text"><string>LOGIN</string></property></item><item><property name="text"><string>NONE</string></property></item></widget><widget class="QLabel" name="smtp_name_label"><property name="geometry"><rect><x>290</x><y>280</y><width>70</width><height>25</height></rect>< /property><property name="text"><string>Имя:</string></property></widget><widget class="QLineEdit" name="smtp_name_line_edit"><property name="geometry"><rect><x>360</x><y>280</y><width>170</width><height>30</height></rect> </property></widget></widget><tabstops><tabstop>mail_server_combo_box</tabstop><tabsto p>imap_server_line_edit</tabstop><tabstop>imap_port_spin_box</tabstop><tabstop>imap_lo gin_line_edit</tabstop><tabstop>imap_password_line_edit</tabstop><tabstop>imap_auth_co mbo_box</tabstop><tabstop>autoupdate_check_box</tabstop><tabstop>autoupdate_spin_box</ tabstop><tabstop>smtp_server_line_edit</tabstop><tabstop>smtp_port_spin_box</tabstop>< tabstop>smtp_login_line_edit</tabstop><tabstop>smtp_password_line_edit</tabstop><tabst op>smtp_auth_combo_box</tabstop><tabstop>smtp_name_line_edit</tabstop></tabstops><reso urces><include location="resources.qrc"/></resources><connections><connection><sender>button_box</sen der><signal>accepted()</signal><receiver>SettingsDialog</receiver><slot>accept()</slot ><hints><hint type="sourcelabel"><x>248</x><y>254</y></hint><hint type="destinationlabel"><x>157</x><y>274</y></hint></hints></connection><connection><s ender>button_box</sender><signal>rejected()</signal><receiver>SettingsDialog</receiver ><slot>reject()</slot><hints><hint type="sourcelabel"><x>316</x><y>260</y></hint><hint type="destinationlabel"><x>286</x><y>274</y></hint></hints></connection></connections> </ui>
80