Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Лабы / 3 / 6-7.tar / 6-7 / 6-7 / net_mail / compose.ui

.h
Скачиваний:
16
Добавлен:
17.04.2013
Размер:
1 Кб
Скачать
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you want to add, delete, or rename functions or slots, use
** Qt Designer to update this file, preserving your code.
**
** You should not define a constructor or destructor in this file.
** Instead, write your code in functions called init() and destroy().
** These will automatically be called by the form's constructor and
** destructor.
*****************************************************************************/


void Compose::saveMessage()
{
    if (fromEdit->text().isEmpty() || toEdit->text().isEmpty()){
		QMessageBox::information( this, "Compose",
	     "Please, fill 'from' and 'to' fields." );
		return;
    }
    NMessage *nmsg = new NMessage();
    nmsg->from = fromEdit->text();
    nmsg->to = toEdit->text();
    nmsg->time = time(NULL);
    nmsg->subject = subjectEdit->text();
    nmsg->date = ctime(&nmsg->time);
    nmsg->content = textEdit->text();
    nmsg->header = "";
    nmsg->msg_id = "";
    nmsg->folder = FLDR_OUTBOX;
    
    nmail->insertMessage(nmsg);
    
    mailform->updateFolder();
    close();
}


void Compose::cancelMessage()
{
    close();
}


void Compose::on_show()
{
	fromEdit->setText(s_from);
	toEdit->setText(s_to);
	subjectEdit->setText(s_subject);
	textEdit->setText(s_text);

	s_from = "";
	s_to = "";
	s_subject = "";
	s_text = "";
}


Соседние файлы в папке net_mail