Source Code (Use browser search to find items of interest.)
Class Index
killustrator'DocumentInfo (./koffice/killustrator/share/DocumentInfo.h:33)
class DocumentInfo : public QDialog {
Q_OBJECT
protected:
DocumentInfo (GDocument* doc, QWidget* parent = 0L, const char* name = 0L);
public:
static void showInfo (GDocument* doc);
public slots:
void acceptClicked();
private:
QLineEdit *edKeyWd, *edComnt;
GDocument *gdoc;
};
killustrator'DocumentInfo::DocumentInfo() (./koffice/killustrator/share/DocumentInfo.cc:45)
DocumentInfo::DocumentInfo (GDocument* doc, QWidget* parent,
const char* name) :
QDialog (parent, name, true) {
QPushButton* button;
gdoc = doc;
setCaption (i18n ("Document Info"));
QVBoxLayout *vl = new QVBoxLayout (this, 4);
QMultiLineEdit* textfield = new QMultiLineEdit (this);
textfield->setReadOnly (true);
vl->addWidget (textfield, 1);
QLabel *lbKeyWd = new QLabel(i18n("Keywords:"),this);
lbKeyWd->setFixedHeight (lbKeyWd->sizeHint ().height ());
vl->addWidget(lbKeyWd);
edKeyWd= new QLineEdit(this);
edKeyWd->setFixedHeight (edKeyWd->sizeHint ().height ());
vl->addWidget(edKeyWd);
QLabel *lbComment = new QLabel(i18n("Comment:"),this);
lbComment->setFixedHeight (lbComment->sizeHint ().height ());
vl->addWidget(lbComment);
edComnt= new QLineEdit(this);
edComnt->setFixedHeight (edComnt->sizeHint ().height ());
// copy comments from GDocument
// edComnt->setText("Comment text dummy");
vl->addWidget(edComnt);
// a separator
KSeparator* sep = new KSeparator (this);
vl->addWidget (sep);
// the standard buttons
KButtonBox *bbox = new KButtonBox (this);
button = bbox->addButton (i18n ("Ok"));
connect (button, SIGNAL (clicked ()), this, SLOT (acceptClicked() ));
button = bbox->addButton (i18n ("Cancel"));
connect (button, SIGNAL (clicked ()), SLOT (reject ()));
bbox->layout ();
bbox->setMinimumSize (bbox->sizeHint ());
vl->addWidget (bbox);
vl->activate ();
adjustSize ();
setMinimumSize (430, 400);
setMaximumSize (430, 400);
QString s;
doc->printInfo (s);
textfield->setText ((const char *) s);
doc->getKeywords(s);
s.replace( QRegExp("""),"\"" );
s.replace( QRegExp("&"), "&" );
edKeyWd->setText((const char *)s);
doc->getComment(s);
s.replace( QRegExp("""),"\"" );
s.replace( QRegExp("&"), "&" );
edComnt->setText((const char *)s);
}
killustrator'DocumentInfo::showInfo() (./koffice/killustrator/share/DocumentInfo.cc:111)
void DocumentInfo::showInfo (GDocument* doc) {
DocumentInfo dialog (doc, 0L);
dialog.exec ();
}
killustrator'DocumentInfo::acceptClicked() (./koffice/killustrator/share/DocumentInfo.cc:117)
void DocumentInfo::acceptClicked() {
QString s;
s = edComnt->text();
s.replace( QRegExp("&"), "&" );
s.replace( QRegExp("\""),""" );
gdoc->setComment ( s );
s = edKeyWd->text();
s.replace( QRegExp("&"), "&" );
s.replace( QRegExp("\""),""" );
gdoc->setKeywords( s );
accept();
}