summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dialog.cpp10
-rw-r--r--src/ui/dialog.ui13
-rw-r--r--src/vsession.cpp14
-rw-r--r--src/vsession.h4
4 files changed, 26 insertions, 15 deletions
diff --git a/src/dialog.cpp b/src/dialog.cpp
index 798d6be..fc9a435 100644
--- a/src/dialog.cpp
+++ b/src/dialog.cpp
@@ -216,7 +216,7 @@ void Dialog::startSession(const QString& name) {
void Dialog::showSettingsPVS() {
pvsSettings_ = new QSettings("openslx", "pvs", this);
QStringList accessOptions;
- accessOptions <<trUtf8("None") << trUtf8("View Only") << trUtf8("Full");
+ accessOptions << trUtf8("None") << trUtf8("View Only") << trUtf8("Full");
ui->comboBoxLecturer->insertItems(0, accessOptions);
ui->comboBoxOthers->insertItems(0, accessOptions);
readPVSSettings();
@@ -362,7 +362,13 @@ void Dialog::treeView_selectionChanged(const QModelIndex& current, const QModelI
ui->label_os->setText(vs->getAttribute("os", "param"));
ui->label_os->setToolTip(vs->getAttribute("os", "param"));
- ui->textBrowser->setText(vs->getAttribute("long_description", "param"));
+ //ui->textBrowser->setText(vs->getAttribute("long_description", "param"));
+ QString description(vs->getAttribute("long_description", "param") + "\n\nKeywords: ");
+ for (int i = 0; i < vs->keywords().length(); ++i) {
+ description += vs->keywords()[i] + ", ";
+ }
+
+ ui->textBrowser->setText(description);
} else {
ui->label_name->setText(s->shortDescription());
diff --git a/src/ui/dialog.ui b/src/ui/dialog.ui
index bd59605..a7e7124 100644
--- a/src/ui/dialog.ui
+++ b/src/ui/dialog.ui
@@ -496,19 +496,6 @@ p, li { white-space: pre-wrap; }
</spacer>
</item>
<item>
- <widget class="QPushButton" name="pushButton">
- <property name="text">
- <string>Help</string>
- </property>
- <property name="checkable">
- <bool>false</bool>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
<widget class="QPushButton" name="pushButtonAbort">
<property name="text">
<string>Abort</string>
diff --git a/src/vsession.cpp b/src/vsession.cpp
index f8512fc..ba7a478 100644
--- a/src/vsession.cpp
+++ b/src/vsession.cpp
@@ -69,6 +69,19 @@ QString VSession::getAttribute(const QString &nodeName,
.attribute(attribute);
}
+QList<QString> VSession::keywords() const {
+ return this->keywords_;
+}
+
+void VSession::readKeywords() {
+ QDomNode keywordsNode = this->doc_.namedItem("eintrag").namedItem("keywords");
+ for (QDomElement el(keywordsNode.firstChildElement("keyword"));
+ !el.isNull();
+ el = el.nextSiblingElement("keyword")) {
+ this->keywords_.append(el.text());
+ }
+}
+
QString VSession::getNodeText(const QString& nodeName) const {
return this->doc_.namedItem(nodeName).toText().data();
}
@@ -360,6 +373,7 @@ QList<Session*> VSession::readXmlFile(const QString& filepath) {
dummy.appendChild(dummy.importNode(el, true));
VSession* e = new VSession;
if (e->init(dummy.toString(), dirName)) {
+ e->readKeywords();
retval.append(e);
}
}
diff --git a/src/vsession.h b/src/vsession.h
index 3afcd2b..50a51f7 100644
--- a/src/vsession.h
+++ b/src/vsession.h
@@ -41,6 +41,7 @@ class VSession : public Session {
QString getAttribute(const QString& nodeName,
const QString& attribute = "param") const;
+ QList<QString> keywords() const;
QString getNodeText(const QString& nodeName) const;
void addNodeWithAttribute(const QString& nodeName,
@@ -65,10 +66,13 @@ class VSession : public Session {
static void addSessionsAfterDownload(QNetworkReply* reply);
private:
+ QList<QString> keywords_;
QDomDocument doc_;
QString baseDirPath_;
QProcess *_process;
+
+ void readKeywords();
};
#endif /*VMCHOOSER_VSESSION_H_*/