summaryrefslogtreecommitdiffstats
path: root/examples/extension/mainform.ui.h
blob: c531b997bc0b072cbd707a7a8df56940b694c3e2 (plain)
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
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you wish to add, delete or rename functions use TQt Designer which will
** update this file, preserving your code. Create an init() function in place
** of a constructor, and a destroy() function in place of a destructor.
*****************************************************************************/
#include "dialogform.h"
#include "extension.h"
#include <qapplication.h>
#include <qcheckbox.h>
#include <qlineedit.h>

void MainForm::init()
{
    sessions = FALSE;
    logging = FALSE;
    log_filename = TQString::null;
    log_errors = TRUE;
    log_actions = TRUE;
}

void MainForm::optionsDlg()
{
    DialogForm *dlg = new DialogForm( this, "dialog", TRUE );
    Extension *ext = (Extension*)dlg->extension()->qt_cast( "Extension" );
    if ( !ext )
	return;
    dlg->sessionsCheckBox->setChecked( sessions );
    dlg->loggingCheckBox->setChecked( logging );
    ext->logfileLineEdit->setText( log_filename );
    ext->logErrorsCheckBox->setChecked( log_errors );

    if ( dlg->exec() ) {
	sessions = dlg->sessionsCheckBox->isChecked();
	logging = dlg->loggingCheckBox->isChecked();
	log_filename = ext->logfileLineEdit->text();
	log_errors = ext->logErrorsCheckBox->isChecked();
    }
}


void MainForm::quit()
{
    TQApplication::exit( 0 );
}