Source Code (Use browser search to find items of interest.)

Class Index

ksirc'GeneralPage (./kdenetwork/ksirc/pws-0.5/pws/pages.h:25)

class GeneralPage: public Page
{
    Q_OBJECT
public:
    GeneralPage(QWidget *parent = 0, const char *name = 0);
    virtual ~GeneralPage();
    virtual void dumpData();
    QMultiLineEdit *cgiext;
    QMultiLineEdit *indexnames;
    QMultiLineEdit *mimetypes;
    QLineEdit *logfile;
    QLineEdit *errorlog;
    QLineEdit *childlog;
    QLineEdit *pidfile;
public slots:
    void exam1();
};


ksirc'GeneralPage::GeneralPage() (./kdenetwork/ksirc/pws-0.5/pws/pages.cpp:40)

GeneralPage::GeneralPage(QWidget *parent, const char *name)
	: Page(parent, name)
{
    conf->setGroup("General");
    TLForm *f=new("TLForm") TLForm("general","General",this);
    KTypeLayout *l=f->layout;
    
    l->addBook("book");
    
    l->addPage("p2","MIME types");

    l->addGroup ("gg1","Index Files:",true);
    QStrList indexes;
    indexnames=(QMultiLineEdit *)(l->addMultiLineEdit("indexes","")->widget);
    conf->readListEntry("IndexNames",indexes);
    if (indexes.count()==0)
    {
        indexes.append("index.html");
        indexes.append("index.htm");
    }
    int i=0;
    for (char *ex=indexes.first();ex!=0;ex=indexes.next(),i++)
    {
        indexnames->insertLine(ex,i);
    }
    l->endGroup();//gg1

    l->addGroup ("gg2","CGI extensions:",true);
    QStrList extensions;
    cgiext=(QMultiLineEdit *)(l->addMultiLineEdit("cgiext","")->widget);
    conf->readListEntry("CGIext",extensions);
    if (extensions.count()==0)
    {
        extensions.append("cgi");
        extensions.append("pl");
    }
    i=0;
    for (char *ex=extensions.first();ex!=0;ex=extensions.next(),i++)
    {
        cgiext->insertLine(ex,i);
    }
    l->endGroup();//gg2

    l->newLine();

    l->addGroup ("gg3","Extra MIME Types:",true);
    mimetypes=(QMultiLineEdit *)(l->addMultiLineEdit("mimetypes","")->widget);
    QString mtyp=conf->readEntry("MIMETypes",
                                 "text/html { html htm shtm HTML HTM SHTML }\n"
                                 "image/jpeg { jpg jpeg JPG JPEG }\n"
                                 "image/gif { gif GIF }\n"
                                 "text/plain { * }\n");
    mimetypes->insertLine(mtyp.data(),0);
    l->endGroup();//gg3

    l->setSpawn("gg3",2,1);

    l->endGroup();//p2
    
    l->addPage("p1","Administration");

    QString home=QDir::homeDirPath();

    l->addGroup("g1","",true);
    l->addLabel ("l1","This is the place where logs and similar\n");
    l->newLine();
    l->addLabel ("l1","administrative stuff will be stored.\n");
    l->newLine();
    l->addLabel ("l1","You usually don't need to care much about this.");
    l->endGroup();//g1
    l->newLine();

    l->addGroup("g2","Directory:",true);
    QString adminDir = conf->readEntry("Logs", locateLocal("data", "pws") );
    logfile=(QLineEdit *)((l->addLineEdit("admindir", adminDir))->widget);
    QPushButton *b=(QPushButton *)(l->addButton("examinelog","...")->widget);
    QObject::connect (b,SIGNAL(clicked()),this,SLOT(exam1()));
    l->endGroup();//g2

    l->endGroup();//p1
    
    l->endGroup();//book
    
    l->activate();
}



ksirc'GeneralPage::~GeneralPage() (./kdenetwork/ksirc/pws-0.5/pws/pages.cpp:127)

GeneralPage::~GeneralPage()
{
}


ksirc'GeneralPage::dumpData() (./kdenetwork/ksirc/pws-0.5/pws/pages.cpp:131)

void GeneralPage::dumpData()
{
    conf->setGroup("General");
    QStrList indexes;
    for (int i=0; i<indexnames->numLines();i++)
    {
        if (indexnames->textLine(i) && (!QString(indexnames->textLine(i)).isEmpty()))
            indexes.append(indexnames->textLine(i));
    }
    conf->writeEntry("IndexNames",indexes);

    QStrList extensions;
    for (int i=0; i<cgiext->numLines();i++)
    {
        if (cgiext->textLine(i) && (!QString(cgiext->textLine(i)).isEmpty()))
            extensions.append(cgiext->textLine(i));
    }
    conf->writeEntry("CGIext",extensions);
    conf->writeEntry("Logs",logfile->text());

    conf->writeEntry("MIMETypes",mimetypes->text().stripWhiteSpace());
    
    conf->sync();
}


ksirc'GeneralPage::exam1() (./kdenetwork/ksirc/pws-0.5/pws/pages.cpp:156)

void GeneralPage::exam1()
{
#warning KDirDialog no longer exists...
//    QString d = KDirDialog::getDirectory( locateLocal("data", "pws"));
//    if (!d.isEmpty())
//        logfile->setText(d.data());
}