kpfileselectpage.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "kpfileselectpage.h"
00021 #include "kfilelist.h"
00022
00023 #include <qlayout.h>
00024 #include <qstringlist.h>
00025 #include <qregexp.h>
00026 #include <qheader.h>
00027 #include <klocale.h>
00028 #include <kiconloader.h>
00029
00030 KPFileSelectPage::KPFileSelectPage(QWidget *parent, const char *name)
00031 : KPrintDialogPage(parent, name)
00032 {
00033 setTitle(i18n("&Files"));
00034 m_first = true;
00035
00036 m_files = new KFileList(this);
00037
00038 QHBoxLayout *l0 = new QHBoxLayout(this, 0, 10);
00039 l0->addWidget(m_files);
00040
00041 resize(100, 100);
00042 }
00043
00044 void KPFileSelectPage::getOptions(QMap<QString,QString>& opts, bool incldef)
00045 {
00046
00047
00048 if (!incldef)
00049 {
00050 QStringList l = m_files->fileList();
00051 opts["kde-filelist"] = l.join("@@");
00052 }
00053 }
00054
00055 void KPFileSelectPage::setOptions(const QMap<QString,QString>& opts)
00056 {
00057
00058 if (m_first)
00059 {
00060 QStringList l = QStringList::split("@@", opts["kde-filelist"], false);
00061 m_files->setFileList(l);
00062
00063 m_first = false;
00064 }
00065 }
|