/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you wish to add, delete or rename functions or slots use
** Qt 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 <qfiledialog.h>
#include <qmessagebox.h>

void MainForm::init() {
    pole->setHidden(true);
}


void MainForm::Ports_set()
{
    bool elka;
    elka = portbuton1->isChecked();
    if (elka) {
	allport->setEnabled(true);
	textLabel17->setEnabled(false);
	textLabel18->setEnabled(false);	
	userport->setEnabled(false);
	botsport->setEnabled(false);	
    } else {
	allport->setEnabled(false);
	textLabel17->setEnabled(true);
	textLabel18->setEnabled(true);
	userport->setEnabled(true);
	botsport->setEnabled(true);
    }	
}


void MainForm::V_hosting()
{
    bool evh = evirtual->isChecked();
    if (evh) {
	textLabel20->setEnabled(true);
	textLabel21->setEnabled(true);
	virhost->setEnabled(true);
	virip->setEnabled(true);
    } else {
	textLabel20->setEnabled(false);
	textLabel21->setEnabled(false);
	virhost->setEnabled(false);
	virip->setEnabled(false);	
    }	
}


void MainForm::Keep_logs()
{
    bool keeplog = keeplogs->isChecked();
    if (keeplog) {
	textLabel1_2->setEnabled(true);
	logformat->setEnabled(true);
    } else {
	textLabel1_2->setEnabled(false);
	logformat->setEnabled(false);	
    }
}


void MainForm::Enable_filesys()
{
    bool efilesys = filesys->isChecked();
    if (efilesys) 
	groupBox4->setEnabled(true);
    else
	groupBox4->setEnabled(false);
}


void MainForm::Enable_notes()
{
    bool enotes = notes->isChecked();
    if (enotes)
	groupBox5->setEnabled(true);
    else
	groupBox5->setEnabled(false);
}


void MainForm::Add_server()
{
    bool vid = unibt->isChecked();
    QString fidi;
    if (vid)
	fidi = unibgserver->text( unibgserver->currentItem() );
    else 
	fidi = custumserver->text();
    servers->insertItem(fidi,0);
}


void MainForm::Remove_server()
{
    servers->removeItem( servers->currentItem() );
}


void MainForm::Choise_server()
{
    bool mouse = unibt->isChecked();
    if (mouse) {
	unibgserver->setEnabled(true);
	custumserver->setEnabled(false);
    } else { 
	unibgserver->setEnabled(false);
	custumserver->setEnabled(true);
    }	
}


void MainForm::Bul_lang()
{
    QMessageBox::critical( 0, "Eggdrop.conf Creator",
    QString("This option is invalid for now\n") +
	"Visit http://free.top.bg/tcl/eggcreator/ and look for update\n\n");
}


void MainForm::Create_File()
{
    int elka;
    int zona;
    pole->clear();
    pole->insert("#############################################\n");
    pole->insert("# This file created by Eggdrop.conf Creator #\n");
    pole->insert("#############################################\n\n");
    pole->insert(QString( "set username \"%1\"\n").arg(username->text()));
    pole->insert(QString( "set admin \"%1\"\n").arg(botadmin->text()));
    pole->insert(QString( "set network \"%1\"\n").arg(mreja->text()));
    pole->insert(QString("set timezone \"%1\"\n").arg(vreme->text(vreme->currentItem())));
    pole->insert("set offset \"5\"\n");
    pole->insert("#set env(TZ) \"$timezone $offset\"\n");
    if( evirtual->isChecked() ) {
	pole->insert(QString("set my-hostname \"%1\"\n").arg(virhost->text()));
	pole->insert(QString("set my-ip \"%1\"\n").arg(virip->text()));
    } else {
	pole->insert(QString("#set my-hostname \"%1\"\n").arg(virhost->text()));
	pole->insert(QString("#set my-ip \"%1\"\n").arg(virip->text()));
    }
    pole->insert("#addlang \"english\"\n\n");
    pole->insert("##### LOG FILES #####\n");
    pole->insert(QString("set max-logs %1\n").arg(maxlogs->value()));
    pole->insert(QString("set max-logsize %1\n").arg(logmaxsize->value()));
    pole->insert(QString("set quick-logs 0\n"));
    pole->insert(QString("logfile %1 * \"%2\"\n").arg(logflags->text()).arg(Logfilename->text()));
    pole->insert(QString("logfile %1 %2 \"%3\"\n").arg(chanlogflags->text()).arg(channame->text()).arg(chanlogfile->text()));
    pole->insert("set log-time 1\n");
    if ( keeplogs->isChecked() ) 
	pole->insert("set keep-all-logs 1\n");
    else
	pole->insert("set keep-all-logs 0\n");
    pole->insert(QString("set logfile-suffix \"%1\"\n").arg(logformat->text()));
    pole->insert("set switch-logfiles-at 300\n");
    pole->insert("set quiet-save 0\n");
    pole->insert(QString("set console \"%1\"\n\n").arg(cflags->text()));
    pole->insert("##### FILES AND DIRECTORIES #####\n");
    pole->insert(QString("set userfile \"%1\"\n").arg(userfile->text()));
    pole->insert("set sort-users 0\n");
    pole->insert(QString("set help-path \"%1\"\n").arg(helpdir->text()));
    pole->insert(QString("set text-path \"%1\"\n").arg(textdir->text()));
    pole->insert(QString("set temp-path \"%1\"\n").arg(tempdir->text()));
    pole->insert(QString("set motd \"%1\"\n").arg(modtdir->text()));
    pole->insert("set userfile-perm 0600\n\n");
    pole->insert("##### BOTNET #####\n");
    pole->insert(QString("set botnet-nick \"%1\"\n").arg(botnetnick->text()));
    if ( portbuton1->isChecked() ) {
	pole->insert(QString("listen %1 all\n").arg(allport->text()));
    } else {
	pole->insert(QString("listen %1 users\n").arg(userport->text()));
	pole->insert(QString("listen %1 bots\n").arg(botsport->text()));
    }
    pole->insert("set protect-telnet 0\n");
    pole->insert("set dcc-sanitycheck 0\n");
    pole->insert("set ident-timeout 5\n");
    pole->insert("set require-p 0\n");
    pole->insert("set open-telnets 0\n");
    pole->insert("set stealth-telnets 0\n");
    pole->insert("set use-telnet-banner 0\n");
    pole->insert("set connect-timeout 15\n");
    pole->insert("set dcc-flood-thr 3\n");
    pole->insert("set telnet-flood 5:60\n");
    pole->insert("set paranoid-telnet-flood 1\n");
    pole->insert("set resolve-timeout 15\n\n");
    pole->insert("##### MORE ADVANCED STUFF #####\n");
    pole->insert("#set firewall \"proxy:178\"\n");
    pole->insert("#set firewall \"!sun-barr.ebay:3666\"\n");
    pole->insert("#set nat-ip \"127.0.0.1\"\n");
    pole->insert("#set reserved-portrange 2010:2020\n");
    pole->insert("set ignore-time 15\n");
    pole->insert("set hourly-updates 00\n");
    pole->insert(QString("set owner \"%1\"\n").arg(botowner->text()));
    pole->insert("set notify-newusers \"$owner\"\n");
    pole->insert(QString("set default-flags \"%1\"\n").arg(dflags->text()));
    pole->insert("set whois-fields \"url birthday\"\n");
    pole->insert("set remote-boots 2\n");
    pole->insert("set share-unlinks 1\n");
    pole->insert("set die-on-sighup 0\n");
    pole->insert("set die-on-sigterm 1\n");
    pole->insert("unbind dcc n tcl *dcc:tcl\n");
    pole->insert("unbind dcc n set *dcc:set\n");
    pole->insert("set must-be-owner 0\n");
    pole->insert("unbind dcc n simul *dcc:simul\n");
    pole->insert("set max-dcc 50\n");
    pole->insert("set dcc-portrange 1024:65535\n");
    pole->insert("set enable-simul 1\n");
    pole->insert("set allow-dk-cmds 1\n");
    pole->insert("set dupwait-timeout 5\n\n");
    pole->insert("########## MODULES ##########\n");
    pole->insert(QString("set mod-path \"%1\"\n\n").arg(moddir->text()));
    pole->insert("#### DNS MODULE #####\n");
    if ( dns->isChecked() )
	pole->insert("loadmodule dns\n");
    else
	pole->insert("#loadmodule dns\n");
    pole->insert("\n##### CHANNELS MODULE #####\n");
    if ( channels->isChecked() )
	pole->insert("loadmodule channels\n");
    else
	pole->insert("#loadmodule channels\n");
    pole->insert(QString("set chanfile \"%1\"\n").arg(chanfile->text()));
    pole->insert("set ban-time 120\n");
    pole->insert("set exempt-time 60\n");
    pole->insert("set invite-time 60\n");
    pole->insert("# set force-expire 0\n");
    pole->insert("set share-greet 0\n");
    pole->insert("set use-info 1\n");
    pole->insert("set global-flood-chan 10:60\n");
    pole->insert("set global-flood-deop 3:10\n");
    pole->insert("set global-flood-kick 3:10\n");
    pole->insert("set global-flood-join 5:60\n");
    pole->insert("set global-flood-ctcp 3:60\n");
    pole->insert("set global-flood-nick 5:60\n");
    pole->insert("set global-aop-delay 5:30\n");
    pole->insert("set global-idle-kick 0\n");
    pole->insert("set global-chanmode \"nt\"\n");
    pole->insert("set global-stopnethack-mode 0\n");
    pole->insert("set global-revenge-mode 1\n");
    pole->insert("set global-chanset {\n");
    pole->insert("\t-autoop\t\t-autovoice\n");
    pole->insert("\t-bitch\t\t+cycle\n");
    pole->insert("\t+dontkickops\t+dynamicbans\n");
    pole->insert("\t+dynamicexempts\t+dynamicinvites\n");
    pole->insert("\t-enforcebans\t+greet\n");
    pole->insert("\t-inactive\t-nodesynch\n");
    pole->insert("\t-protectfriends\t+protectops\n");
    pole->insert("\t-revenge\t-revengebot\n");
    pole->insert("\t-secret\t\t-seen\n");
    pole->insert("\t+shared\t\t+statuslog\n");
    pole->insert("\t+userbans\t+userexempts\n");
    pole->insert("\t+userinvites\n}\n");
    pole->insert(QString("channel add %1 {\n").arg(channame->text()));
    pole->insert(QString("\tchanmode \"%1\"\n").arg(chanmode->text()));
    pole->insert(QString("\tidle-kick %1\n").arg(idlekick->text()));
    pole->insert(QString("\tstopnethack-mode %1\n").arg(comboBox2->text(comboBox2->currentItem())));
    pole->insert(QString("\trevenge-mode %1\n").arg(revengemode->text(revengemode->currentItem())));
    pole->insert(QString("\taop-delay %1\n").arg(aopdelay->text()));
    pole->insert(QString("\tneed-op { %1 }\n").arg(needop->text()));
    pole->insert(QString("\tneed-invite { %1 }\n").arg(needinvite->text()));
    pole->insert(QString("\tneed-key { %1 }\n").arg(needkey->text()));
    pole->insert(QString("\tneed-unban { %1 }\n").arg(needunban->text()));
    pole->insert(QString("\tneed-limit { %1 }\n").arg(needlimit->text()));
    pole->insert(QString("\tflood-chan %1\n").arg(floodchan->text()));
    pole->insert(QString("\tflood-deop %1\n").arg(flooddeop->text()));
    pole->insert(QString("\tflood-kick %1\n").arg(floodkick->text()));
    pole->insert(QString("\tflood-join %1\n").arg(floodjoin->text()));
    pole->insert(QString("\tflood-ctcp %1\n").arg(floodctcp->text()));
    pole->insert(QString("\tflood-nick %1\n").arg(floodnick->text()));
    pole->insert("}\n");
    if ( enforcebans->isChecked() )
	pole->insert(QString("channel set %1 +enforcebans\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -enforcebans\n").arg(channame->text()));
    if  ( dynamicbans->isChecked() )
	pole->insert(QString("channel set %1 +dynamicbans\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -dynamicbans\n").arg(channame->text()));
    if ( userbans->isChecked() )
	pole->insert(QString("channel set %1 +userbans\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -userbans\n").arg(channame->text()));
    if ( dynamicexempts->isChecked() )
	pole->insert(QString("channel set %1 +dynamicexempts\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -dynamicexempts\n").arg(channame->text()));
    if ( userexempts->isChecked() )
	pole->insert(QString("channel set %1 +userexempts\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -userexempts\n").arg(channame->text()));
    if ( dynamicinvites->isChecked() )
	pole->insert(QString("channel set %1 +dynamicinvites\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -dynamicinvites\n").arg(channame->text()));
    if ( userinvites->isChecked() )
	pole->insert(QString("channel set %1 +userinvites\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -userinvites\n").arg(channame->text()));
        if ( autoop->isChecked() )
	pole->insert(QString("channel set %1 +autoop\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -autoop\n").arg(channame->text()));
    if ( bitch->isChecked() )
	pole->insert(QString("channel set %1 +bitch\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -bitch\n").arg(channame->text()));
    if ( greet->isChecked() )
	pole->insert(QString("channel set %1 +greet\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -greet\n").arg(channame->text()));
    if ( protectops->isChecked() )
	pole->insert(QString("channel set %1 +protectops\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -protectops\n").arg(channame->text()));
    if ( protectfriends->isChecked() )
	pole->insert(QString("channel set %1 +protectfriends\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -protectfriends\n").arg(channame->text()));
        if ( statuslog->isChecked() )
	pole->insert(QString("channel set %1 +statuslog\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -statuslog\n").arg(channame->text()));
    if ( revenge->isChecked() )
	pole->insert(QString("channel set %1 +revenge\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -revenge\n").arg(channame->text()));
        if ( revengebot->isChecked() )
	pole->insert(QString("channel set %1 +revengebot\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -revengebot\n").arg(channame->text()));
        if ( autovoice->isChecked() )
	pole->insert(QString("channel set %1 +autovoice\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -autovoice\n").arg(channame->text()));
        if ( secret->isChecked() )
	pole->insert(QString("channel set %1 +secret\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -secret\n").arg(channame->text()));
        if ( shared->isChecked() )
	pole->insert(QString("channel set %1 +shared\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -shared\n").arg(channame->text()));
        if ( cycle->isChecked() )
	pole->insert(QString("channel set %1 +cycle\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -cycle\n").arg(channame->text()));
        if ( dontkickops->isChecked() )
	pole->insert(QString("channel set %1 +dontkickops\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -dontkickops\n").arg(channame->text()));
    if ( inactive->isChecked() )
	pole->insert(QString("channel set %1 +inactive\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -inactive\n").arg(channame->text()));
        if ( seen->isChecked() )
	pole->insert(QString("channel set %1 +seen\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -seen\n").arg(channame->text()));
        if ( nodesynch->isChecked() )
	pole->insert(QString("channel set %1 +nodesynch\n").arg(channame->text()));
    else
	pole->insert(QString("channel set %1 -nodesynch\n").arg(channame->text()));
    pole->insert("\n##### SERVER MODULE #####\n");
    if ( server->isChecked() )
	pole->insert("loadmodule server\n");
    else
	pole->insert("#loadmodule server\n");
    pole->insert("set net-type 5\n");
    pole->insert(QString("set nick \"%1\"\n").arg(nickname->text()));
    pole->insert(QString("set altnick \"%1\"\n").arg(altnickname->text()));
    pole->insert(QString("set realname \"%1\"\n").arg(realname->text()));
    pole->insert("set init-server { putserv \"MODE $botnick +i-ws\" }\n");
    pole->insert("set default-port 6667\n");
    pole->insert("set servers {\n");
    zona = servers->numRows();
    for (elka = 0; elka < zona; elka++) {
	QString mama = servers->text(elka);
	pole->insert(QString("\t%1\n").arg(mama));
    }
    pole->insert("}\n");
    pole->insert("set keep-nick 1\n");
    pole->insert("set strict-host 0\n");
    pole->insert("set quiet-reject 1\n");
    pole->insert("set lowercase-ctcp 0\n");
    pole->insert("set answer-ctcp 3\n");
    pole->insert("set flood-msg 5:60\n");
    pole->insert("set flood-ctcp 3:60\n");
    pole->insert("set never-give-up 1\n");
    pole->insert("set strict-servernames 0\n");
    pole->insert("set server-cycle-wait 60\n");
    pole->insert("set server-timeout 60\n");
    pole->insert("set servlimit 0\n");
    pole->insert("set check-stoned 1\n");
    pole->insert("set use-console-r 0\n");
    pole->insert("set debug-output 0\n");
    pole->insert("set serverror-quit 1\n");
    pole->insert("set max-queue-msg 300\n");
    pole->insert("set trigger-on-ignore 0\n");
    pole->insert("set double-mode 0\n");
    pole->insert("set double-server 0\n");
    pole->insert("set double-help 0\n");
    pole->insert("set optimize-kicks 1\n");
    pole->insert("\n##### SERVER MODULE - net-type 5 specific features (other networks) #####\n");
    pole->insert("#set check-mode-r 1\n");
    pole->insert("#set nick-len 9\n");
    pole->insert("\n##### CTCP MODULE #####\n");
    if ( ctcp->isChecked() )
	pole->insert("loadmodule ctcp\n");
    else
	pole->insert("#loadmodule ctcp\n");
    pole->insert("set ctcp-mode 0\n");
    pole->insert("\n##### IRC MODULE #####\n");
    if ( irc->isChecked() )
	pole->insert("loadmodule irc\n");
    else
	pole->insert("#loadmodule irc\n");
    pole->insert("set bounce-bans 1\n");
    pole->insert("set bounce-modes 0\n");
    pole->insert("set max-bans 20\n");
    pole->insert("set max-modes 30\n");
    pole->insert("set kick-fun 0\nset ban-fun 0\nset learn-users 0\n");
    pole->insert("set wait-split 600\nset wait-info 180\n");
    pole->insert("set mode-buf-length 200\n");
    pole->insert("#unbind msg - hello *msg:hello\n");
    pole->insert("#bind msg - myword *msg:hello\n");
    pole->insert("unbind msg - ident *msg:ident\n");
    pole->insert("unbind msg - addhost *msg:addhost\n");
    pole->insert("#bind msg - myidentword *msg:ident\n");
    pole->insert("set no-chanrec-info 0\n");
    pole->insert("\n##### IRC MODULE - net-type 1 specific features (IRCnet) #####\n");
    pole->insert("set bounce-exempts 0\nset bounce-invites 0\n");
    pole->insert("set max-exempts 20\nset max-invites 20\n");
    pole->insert("# set use-exempts 0\n# set use-invites 0\n");
    pole->insert("set prevent-mixing 1\n");
    pole->insert("\n##### IRC MODULE - net-type 5 specific features (other networks) #####\n");
    pole->insert("#set kick-method 1\n#set modes-per-line 3\n");
    pole->insert("#set include-lk 1\n#set use-354 0\n#set rfc-compliant 1\n");
    pole->insert("\n##### TRANSFER MODULE #####\n");
    if ( transfer->isChecked() )
	pole->insert("loadmodule transfer\n");
    else
	pole->insert("#loadmodule transfer\n");
    pole->insert("set max-dloads 3\nset dcc-block 1024\n");
    pole->insert("set copy-to-tmp 1\nset xfer-timeout 30\n");
    pole->insert("\n##### SHARE MODULE #####\n");
    if ( share->isChecked() )
	pole->insert("loadmodule share\n");
    else
	pole->insert("#loadmodule share\n");
    pole->insert("#set allow-resync 0\n#set resync-time 900\n");
    pole->insert("#set private-global 0\n#set private-globals \"mnot\"\n");
    pole->insert("#set private-user 0\n#set override-bots 0\n");
    pole->insert("\n##### COMPRESS MODULE #####\n");
    if ( compress->isChecked() )
	pole->insert("loadmodule compress\n");
    else
	pole->insert("#loadmodule compress\n");
    pole->insert("#set share-compressed 1\n");
    pole->insert("#set compress-level 9\n");
    pole->insert("\n##### FILESYSTEM MODULE #####\n");
    if ( filesys->isChecked() )
	pole->insert("loadmodule filesys\n");
    else
	pole->insert("#loadmodule filesys\n");
    pole->insert(QString("set files-path \"%1\"\n").arg(filespath->text()));
    pole->insert(QString("set incoming-path \"%1\"\n").arg(incomingpath->text()));
    pole->insert("set upload-to-pwd 0\n");
    pole->insert("set filedb-path \"\"\n");
    pole->insert("set max-file-users 20\n");
    pole->insert(QString("set max-filesize %1\n").arg(maxfilesize->text()));
    pole->insert("\n##### NOTES MODULE #####\n");
    if ( notes->isChecked() )
	pole->insert("loadmodule notes\n");
    else
	pole->insert("#loadmodule notes\n");
    pole->insert(QString("set notefile \"%1\"\n").arg(notesfile->text()));
    pole->insert(QString("set max-notes %1\n").arg(maxnotes->text()));
    pole->insert(QString("set note-life %1\n").arg(keepnotes->text()));
    pole->insert("set allow-fwd 0\nset notify-users 1\n");
    pole->insert("set notify-onjoin 1\n");
    pole->insert("\n##### CONSOLE MODULE #####\n");
    if ( console->isChecked() )
	pole->insert("loadmodule console\n");
    else
	pole->insert("#loadmodule console\n");
    pole->insert("set console-autosave 0\n");
    pole->insert("set force-channel 0\nset info-party 0\n");
    pole->insert("\n##### WOOBIE MODULE #####\n");
    if ( woobie->isChecked() )
	pole->insert("loadmodule woobie\n");
    else
	pole->insert("#loadmodule woobie\n");
    pole->insert("\n##### SEEN MODULE #####\n");
    if ( seen->isChecked() )
	pole->insert("loadmodule seen\n");
    else
	pole->insert("#loadmodule seen\n");
    pole->insert("\n##### BLOWFISH MODULE #####\n");
    if ( blowfish->isChecked() )
	pole->insert("checkmodule blowfish\n");
    else
	pole->insert("#checkmodule blowfish\n");
    pole->insert("\n##### ASSOC MODULE #####\n");
    if ( assoc->isChecked() )
	pole->insert("loadmodule assoc\n");
    else
	pole->insert("#loadmodule assoc\n");
    pole->insert("\n##### WIRE MODULE #####\n");
    if ( wire->isChecked() )
	pole->insert("loadmodule wire\n");
    else
	pole->insert("#loadmodule wire\n");
    pole->insert("\n##### UPTIME MODULE #####\n");
    if ( uptime->isChecked() )
	pole->insert("loadmodule uptime\n");
    else
	pole->insert("#loadmodule uptime\n");
    pole->insert("\n##### SCRIPTS #####\n");
    pole->insert("source scripts/alltools.tcl\n");
    pole->insert("source scripts/action.fix.tcl\n");
    pole->insert("source scripts/compat.tcl\n");
    pole->insert("source scripts/userinfo.tcl\n");
    pole->insert("loadhelp userinfo.help\n");
}    


void MainForm::Preview_win()
{
    Create_File();
    PrevForm *preForm = new PrevForm(this,"Preview", TRUE);
    preForm->pregled->setText(pole->text());
    preForm->exec();
}


void MainForm::About_Show()
{
 About *abForm = new About(this,"About", TRUE);
 abForm->exec();
}


void MainForm::Save_file()
{
    Create_File();
    QString filename = QFileDialog::getSaveFileName(QString::null, "Config (*.conf)", this, "File Save", "Egg Save");
    QFile file(filename);
    file.open( IO_WriteOnly );
    QTextStream stream( &file );
    stream << pole->text();
    file.close();
}


void MainForm::pomogni()
{
    QMessageBox::information( 0, "Eggdrop.conf Creator",
    QString("Always hate create help file :)"));
}


syntax highlighted by Code2HTML, v. 0.9.1