summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2016-01-04 11:07:53 +0100
committerSimon Rettberg2016-01-04 11:07:53 +0100
commit42cd0a3f7e3b502693c1ef4be2a57886c86b006a (patch)
treeb6655340f987f9ef7c2d737420f64aa4d0cac80f
parentUpdate vmware icon (diff)
downloadvmchooser2-42cd0a3f7e3b502693c1ef4be2a57886c86b006a.tar.gz
vmchooser2-42cd0a3f7e3b502693c1ef4be2a57886c86b006a.tar.xz
vmchooser2-42cd0a3f7e3b502693c1ef4be2a57886c86b006a.zip
Update images
-rw-r--r--src/command_line_options.cpp6
-rw-r--r--src/dialog.cpp139
-rw-r--r--src/dialog.h12
-rw-r--r--src/images.qrc1
-rw-r--r--src/img/amiga.pngbin2382 -> 1986 bytes
-rw-r--r--src/img/amiga2.pngbin4380 -> 4135 bytes
-rw-r--r--src/img/atari.pngbin1726 -> 1353 bytes
-rw-r--r--src/img/beos.pngbin2474 -> 2012 bytes
-rw-r--r--src/img/bsd.pngbin7697 -> 7482 bytes
-rw-r--r--src/img/debian.pngbin1823 -> 1652 bytes
-rw-r--r--src/img/dosbox.pngbin9743 -> 6728 bytes
-rw-r--r--src/img/fedora.pngbin2069 -> 1927 bytes
-rw-r--r--src/img/gentoo.pngbin4315 -> 4039 bytes
-rw-r--r--src/img/gnome.pngbin1304 -> 983 bytes
-rw-r--r--src/img/kde.pngbin6568 -> 6230 bytes
-rw-r--r--src/img/linux.pngbin4896 -> 4456 bytes
-rw-r--r--src/img/locked.pngbin1901 -> 1610 bytes
-rw-r--r--src/img/lxde.pngbin8685 -> 4510 bytes
-rw-r--r--src/img/macos.pngbin1437 -> 1317 bytes
-rw-r--r--src/img/mess.pngbin2341 -> 2199 bytes
-rw-r--r--src/img/msdos.pngbin11611 -> 8316 bytes
-rw-r--r--src/img/none.pngbin187 -> 85 bytes
-rw-r--r--src/img/openslx-logo.pngbin17520 -> 12682 bytes
-rw-r--r--src/img/opensolaris.pngbin3725 -> 2566 bytes
-rw-r--r--src/img/os2.pngbin4715 -> 3993 bytes
-rw-r--r--src/img/osx.pngbin3061 -> 2910 bytes
-rw-r--r--src/img/qemu.pngbin3653 -> 2854 bytes
-rw-r--r--src/img/redhat.pngbin1947 -> 1780 bytes
-rw-r--r--src/img/riscos.pngbin2802 -> 2471 bytes
-rw-r--r--src/img/riscos_orig.pngbin6048 -> 5376 bytes
-rw-r--r--src/img/solaris.pngbin3683 -> 3139 bytes
-rw-r--r--src/img/suse.pngbin1559 -> 1361 bytes
-rw-r--r--src/img/term.pngbin18052 -> 15645 bytes
-rw-r--r--src/img/title_l.pngbin9187 -> 6172 bytes
-rw-r--r--src/img/title_r.pngbin3390 -> 2274 bytes
-rw-r--r--src/img/ubuntu.pngbin1232 -> 1092 bytes
-rw-r--r--src/img/unknown.pngbin6276 -> 5845 bytes
-rw-r--r--src/img/virtualbox.pngbin8688 -> 8261 bytes
-rw-r--r--src/img/vm-mix.pngbin0 -> 7051 bytes
-rw-r--r--src/img/vmware.pngbin10024 -> 9383 bytes
-rw-r--r--src/img/win2000.pngbin1582 -> 1397 bytes
-rw-r--r--src/img/win311.pngbin2872 -> 2223 bytes
-rw-r--r--src/img/win7.pngbin7619 -> 7286 bytes
-rw-r--r--src/img/win8.pngbin5080 -> 2294 bytes
-rw-r--r--src/img/windows.pngbin5636 -> 5359 bytes
-rw-r--r--src/img/winxp.pngbin5365 -> 5023 bytes
-rw-r--r--src/img/xfce.pngbin5326 -> 5183 bytes
-rw-r--r--src/main.cpp23
-rw-r--r--src/ui/dialog.ui76
-rw-r--r--src/vsession.h2
50 files changed, 181 insertions, 78 deletions
diff --git a/src/command_line_options.cpp b/src/command_line_options.cpp
index b5cc8a6..3a9cbc5 100644
--- a/src/command_line_options.cpp
+++ b/src/command_line_options.cpp
@@ -21,13 +21,14 @@ CommandLineOptions::CommandLineOptions(int argc, char * const argv[]) {
{"url", required_argument, NULL, 'u'},
{"version", no_argument, NULL, 'v'},
{"xpath", required_argument, NULL, 'x'},
+ {"tab", required_argument, NULL, 'T'},
{0, 0, 0, 0}
};
int c;
// Again, please sort alphabetically in getopt_long call and switch statement
- while ((c = getopt_long(argc, argv, "b:c:Dd:Ff:hP:pSs:t:u:vx:?", longOptions, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, "b:c:Dd:Ff:hP:pSs:t:T:u:vx:?", longOptions, NULL)) != -1) {
switch (c) {
case 'b':
options.insert("base", optarg);
@@ -66,6 +67,9 @@ CommandLineOptions::CommandLineOptions(int argc, char * const argv[]) {
case 't':
options.insert("theme", optarg);
break;
+ case 'T':
+ options.insert("tab", optarg);
+ break;
case 'u':
options.insert("url", optarg);
break;
diff --git a/src/dialog.cpp b/src/dialog.cpp
index 605aeb4..8572c67 100644
--- a/src/dialog.cpp
+++ b/src/dialog.cpp
@@ -20,11 +20,15 @@
#include "vsession.h"
#include "choosersettings.h"
-Dialog::Dialog(QWidget *parent)
+Dialog::Dialog(int defaultTab, QWidget *parent)
: QDialog(parent), ui(new Ui::Dialog) {
model_[0] = new SessionTreeModel(parent);
model_[1] = new SessionTreeModel(parent);
model_[2] = new SessionTreeModel(parent);
+ if (defaultTab < 0 || defaultTab > TAB_COUNT) defaultTab = TAB_ALL_VMS;
+ defaultTab_ = defaultTab;
+ qDebug() << "Default tab: " << defaultTab;
+ userInteracted_ = false;
ui->setupUi(this);
@@ -43,23 +47,23 @@ Dialog::Dialog(QWidget *parent)
connect(centerTimer_, SIGNAL(timeout()), this, SLOT(onCenterTimer()));
centerTimer_->start(1000);
- activeTab_ = 2;
- ui->tabButtonAllClasses->setChecked(true);
-
ui->helpBox->hide();
ui->newsBox->hide();
- oldRow_ = 0; // this is the old row (when switching to a new tab)
-
this->addStatusString(STR_LOADING);
/*
* TODO: why connect signal/slot when no item was loaded yet?
+ * TODO: Change "TODO" in the above line to "QUESTION", as it's just that
QObject::connect(ui->treeView->selectionModel(), SIGNAL(currentChanged ( const QModelIndex&, const QModelIndex&)),
this, SLOT(treeView_selectionChanged(const QModelIndex&, const QModelIndex&)));
*/
- this->onTabButtonChanged(2);
+ this->onTabButtonChanged(0);
+ this->selectPreviousSession();
+ //activeTab_ = 2;
+ //ui->tabButtonAllClasses->setChecked(true);
+
// TODO: Implement bug report dialog :)
ui->buttonBugReport->setEnabled(false);
@@ -82,8 +86,9 @@ void Dialog::changeEvent(QEvent *e) {
}
}
-void Dialog::on_treeView_doubleClicked(QModelIndex index)
+void Dialog::on_treeView_doubleClicked(const QModelIndex& index)
{
+ userInteracted_ = true;
// this method gets called when a Session has been selected to start
SessionTreeItem* item =
@@ -155,6 +160,7 @@ void Dialog::addItems(const QList<Session*>& entries, int tab) {
setListModel(this->model_[tab]);
}
model_[tab]->updateView();
+ selectPreviousSession();
}
void Dialog::addStatusString(const int status) {
@@ -184,13 +190,14 @@ void Dialog::on_pushButtonAbort_clicked() {
}
void Dialog::on_pushButtonStart_clicked() {
+ userInteracted_ = true;
this->on_treeView_doubleClicked(ui->treeView->selectionModel()->currentIndex());
}
bool Dialog::selectSession(const QString& name) {
QModelIndex root(ui->treeView->rootIndex());
- for (int tab = 0; tab <= 2; ++tab) {
+ for (int tab = 0; tab <= TAB_COUNT; ++tab) {
for (int i = 0; i < model_[tab]->rowCount(root); ++i) {
QModelIndex index = model_[tab]->index(i, 0, root);
if (!index.isValid()) {
@@ -218,16 +225,28 @@ bool Dialog::selectSession(const QString& name) {
}
void Dialog::selectPreviousSession() {
- if (ChooserSettings::getSetting("last-session").isEmpty()) {
- this->onTabButtonChanged(2);
- } else {
+ if (userInteracted_) {
+ qDebug() << "Not selecting previous session as user interacted or session was already selected";
+ return;
+ }
+ if (!ChooserSettings::getSetting("last-session").isEmpty()) {
+ qDebug() << "Trying to select last session: " << ChooserSettings::getSetting("last-session");
ui->treeView->clearSelection();
- if (!selectSession(ChooserSettings::getSetting("last-session"))) {
- // could not find last session, change to last used tab
- this->onTabButtonChanged(ChooserSettings::getSetting("last-tab").toInt());
+ if (selectSession(ChooserSettings::getSetting("last-session"))) {
+ qDebug() << "Success";
+ userInteracted_ = true;
+ return;
}
}
- //setListModel(this->model_[this->activeTab_]);
+ // could not find last session, change to last used tab
+ if (!ChooserSettings::getSetting("last-tab").isEmpty()) {
+ qDebug() << "Trying to select last tab " << ChooserSettings::getSetting("last-tab");
+ this->onTabButtonChanged(ChooserSettings::getSetting("last-tab").toInt());
+ } else {
+ qDebug() << "Selected default tab " << defaultTab_;
+ // Select default tab
+ this->onTabButtonChanged(defaultTab_);
+ }
}
void Dialog::startSession(const QString& name) {
@@ -294,23 +313,17 @@ void Dialog::addSessionsAfterDownload(QNetworkReply* reply) {
QString temp_filename;
if (reply->error() != QNetworkReply::NoError) {
- if (debugMode) {
- qDebug() << "Error reading from URL: " << reply->error();
- }
+ qDebug() << "Error reading from URL: " << reply->error();
QFile backup_file(xml_filename);
if (!backup_file.open(QIODevice::ReadOnly)) {
- if (debugMode) {
- qDebug() << "Cannot read backup file " << xml_filename << " either";
- }
+ qDebug() << "Cannot read backup file " << xml_filename << " either";
this->removeStatusString(STR_LOADING);
this->addStatusString(STR_URL_ERROR);
return;
}
- if (debugMode) {
- qDebug() << "Using backup file " << xml_filename;
- }
+ qDebug() << "Using backup file " << xml_filename;
backup_file.close();
temp_filename = xml_filename;
@@ -334,7 +347,8 @@ void Dialog::addSessionsAfterDownload(QNetworkReply* reply) {
if (!sessions.isEmpty()) {
qSort(sessions.begin(), sessions.end(), myLessThan);
- this->addItems(sessions, 2); // TODO: No magic number; handle user specific classes
+ this->addItems(sessions, TAB_ALL_VMS);
+ // TODO: Filter user's classes and add to tab[TAB_MY_COURSES]
} else {
this->addStatusString(STR_NO_ITEMS);
}
@@ -344,6 +358,11 @@ void Dialog::addSessionsAfterDownload(QNetworkReply* reply) {
// select last-session
selectPreviousSession();
+ userInteracted_ = true;
+}
+
+void Dialog::on_treeView_clicked(const QModelIndex&) {
+ userInteracted_ = true;
}
void Dialog::treeView_selectionChanged(const QModelIndex& current, const QModelIndex&) {
@@ -360,43 +379,50 @@ void Dialog::treeView_selectionChanged(const QModelIndex& current, const QModelI
return;
}
+ QString description;
if (s->type() == Session::VSESSION) {
const VSession* vs = (VSession*) s;
- ui->label_name->setText(vs->getAttribute("short_description", "param"));
- ui->label_name->setToolTip(vs->getAttribute("short_description", "param"));
-
ui->label_creator->setText(vs->getAttribute("creator", "param"));
ui->label_creator->setToolTip(vs->getAttribute("creator", "param"));
- ui->label_os->setText(vs->getAttribute("os", "param"));
- ui->label_os->setToolTip(vs->getAttribute("os", "param"));
+ ui->label_os->setText(vs->getAttribute("os_name", "param"));
+ ui->label_os->setToolTip(vs->getAttribute("os_name", "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);
+ ui->label_platform->setText(vs->getAttribute("virtualizer_name", "param"));
+ ui->label_platform->setToolTip(vs->getAttribute("virtualizer_name", "param"));
+ if (vs->keywords().length() > 0) {
+ description = "\n\nKeywords: ";
+ for (int i = 0; i < vs->keywords().length(); ++i) {
+ description += vs->keywords()[i] + ", ";
+ }
+ }
} else {
- ui->label_name->setText(s->shortDescription());
ui->label_creator->setText("");
+ ui->label_creator->setToolTip("");
ui->label_os->setText(QCoreApplication::instance()->translate("Dialog", "Native Linux"));
- ui->textBrowser->setPlainText(QCoreApplication::instance()->translate("Dialog", "Linux X session running on this machine without virtualization."));
+ ui->label_platform->setText("Linux");
+ ui->label_platform->setToolTip("");
}
+ ui->label_name->setText(s->shortDescription());
+ ui->label_name->setToolTip(s->shortDescription());
+ ui->textBrowser->setPlainText(s->description() + description);
}
void Dialog::on_tabButtonLocal_clicked() {
- onTabButtonChanged(0);
+ userInteracted_ = true;
+ onTabButtonChanged(TAB_NATIVE);
}
void Dialog::on_tabButtonMyClasses_clicked() {
- onTabButtonChanged(1);
+ userInteracted_ = true;
+ onTabButtonChanged(TAB_MY_COURSES);
}
void Dialog::on_tabButtonAllClasses_clicked() {
- onTabButtonChanged(2);
+ userInteracted_ = true;
+ onTabButtonChanged(TAB_ALL_VMS);
}
void Dialog::onTabButtonChanged(int tab) {
@@ -418,9 +444,6 @@ void Dialog::onTabButtonChanged(int tab) {
this->ui->filterEdit->setText("");
}
- // save old row
- //oldRow_ = ui->treeView->selectionModel()->currentIndex().row();
-
// load the new list
setListModel(model_[tab]);
this->activeTab_ = tab;
@@ -428,28 +451,38 @@ void Dialog::onTabButtonChanged(int tab) {
ui->treeView->selectionModel()->clearSelection();
ui->treeView->selectionModel()->select(ui->treeView->model()->index(0, 0, ui->treeView->rootIndex()), QItemSelectionModel::Select);
ui->treeView->selectionModel()->setCurrentIndex(ui->treeView->model()->index(0, 0, ui->treeView->rootIndex()), QItemSelectionModel::Select);
- //treeView_selectionChanged(ui->treeView->model()->index(oldRow_, 0, ui->treeView->rootIndex()), ui->treeView->model()->index(0, 0, ui->treeView->rootIndex()));
}
void Dialog::on_filterEdit_textChanged() {
- SessionTreeModel *newModel;
+ if (activeTab_ < 0 || activeTab_ >= TAB_COUNT) return;
+ SessionTreeModel *newModel = NULL;
+ userInteracted_ = true;
// filter the current model
- if (ui->filterEdit->text() != "" && ui->filterEdit->text().replace(" ", "").length() > 2) {
- newModel = new SessionTreeModel(this);
- newModel->addItems(this->model_[activeTab_]->lookForItem(ui->filterEdit->text()));
- } else {
+ if (!ui->filterEdit->text().isEmpty() && ui->filterEdit->text().replace(" ", "").length() > 2) {
+ if (model_[activeTab_] != NULL) {
+ newModel = new SessionTreeModel(this);
+ newModel->addItems(this->model_[activeTab_]->lookForItem(ui->filterEdit->text()));
+ }
+ }
+ if (newModel == NULL) {
newModel = model_[activeTab_];
}
- setListModel(newModel);
+ if (newModel != NULL) {
+ setListModel(newModel);
+ }
}
void Dialog::setListModel(QAbstractItemModel *model) {
+ QAbstractItemModel *old = NULL;
if (ui->treeView->model() == model_[0] || ui->treeView->model() == model_[1] || ui->treeView->model() == model_[2]) {
} else {
- ui->treeView->model()->deleteLater();
+ old = ui->treeView->model();
}
ui->treeView->setModel(model);
+ if (old != NULL) {
+ old->deleteLater();
+ }
// reconnect the treeModel
QObject::connect(ui->treeView->selectionModel(), SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)),
diff --git a/src/dialog.h b/src/dialog.h
index 59d2e48..04ee40f 100644
--- a/src/dialog.h
+++ b/src/dialog.h
@@ -24,8 +24,12 @@ class Dialog : public QDialog {
static const int STR_URL_ERROR = 1;
static const int STR_NO_ITEMS = 2;
static const int STR__MAX = 3;
+ static const int TAB_NATIVE = 0;
+ static const int TAB_MY_COURSES = 1;
+ static const int TAB_ALL_VMS = 2;
+ static const int TAB_COUNT = 3;
public: // Public methods
- explicit Dialog(QWidget *parent = 0);
+ explicit Dialog(int defaultTab = -1, QWidget *parent = 0);
~Dialog();
void addItems(const QList<Session*>&, int tab);
void addStatusString(const int status);
@@ -46,7 +50,8 @@ class Dialog : public QDialog {
QTimer *centerTimer_;
QString autoStartEntry_;
int activeTab_;
- int oldRow_;
+ int defaultTab_;
+ bool userInteracted_;
QString strings_[STR__MAX];
void onTabButtonChanged(int tab);
void configClearButton();
@@ -56,7 +61,8 @@ class Dialog : public QDialog {
private slots:
void on_pushButtonStart_clicked();
void on_pushButtonAbort_clicked();
- void on_treeView_doubleClicked(QModelIndex index);
+ void on_treeView_clicked(const QModelIndex& index);
+ void on_treeView_doubleClicked(const QModelIndex& index);
void on_tabButtonLocal_clicked();
void on_tabButtonMyClasses_clicked();
void on_tabButtonAllClasses_clicked();
diff --git a/src/images.qrc b/src/images.qrc
index a70331c..286cd53 100644
--- a/src/images.qrc
+++ b/src/images.qrc
@@ -39,5 +39,6 @@
<file alias="winxp">img/winxp.png</file>
<file alias="win2000">img/win2000.png</file>
<file alias="dos">img/msdos.png</file>
+ <file alias="vm-mix">img/vm-mix.png</file>
</qresource>
</RCC>
diff --git a/src/img/amiga.png b/src/img/amiga.png
index 0291875..0dc5474 100644
--- a/src/img/amiga.png
+++ b/src/img/amiga.png
Binary files differ
diff --git a/src/img/amiga2.png b/src/img/amiga2.png
index d90af56..f455999 100644
--- a/src/img/amiga2.png
+++ b/src/img/amiga2.png
Binary files differ
diff --git a/src/img/atari.png b/src/img/atari.png
index 419dd16..d8a044e 100644
--- a/src/img/atari.png
+++ b/src/img/atari.png
Binary files differ
diff --git a/src/img/beos.png b/src/img/beos.png
index 11834fa..7613643 100644
--- a/src/img/beos.png
+++ b/src/img/beos.png
Binary files differ
diff --git a/src/img/bsd.png b/src/img/bsd.png
index 8b26986..ac370ca 100644
--- a/src/img/bsd.png
+++ b/src/img/bsd.png
Binary files differ
diff --git a/src/img/debian.png b/src/img/debian.png
index b1ebf06..6df0f6d 100644
--- a/src/img/debian.png
+++ b/src/img/debian.png
Binary files differ
diff --git a/src/img/dosbox.png b/src/img/dosbox.png
index 73a0f4c..db82dae 100644
--- a/src/img/dosbox.png
+++ b/src/img/dosbox.png
Binary files differ
diff --git a/src/img/fedora.png b/src/img/fedora.png
index 870716f..ccfdd7d 100644
--- a/src/img/fedora.png
+++ b/src/img/fedora.png
Binary files differ
diff --git a/src/img/gentoo.png b/src/img/gentoo.png
index 9505c79..47e059b 100644
--- a/src/img/gentoo.png
+++ b/src/img/gentoo.png
Binary files differ
diff --git a/src/img/gnome.png b/src/img/gnome.png
index d2f09cd..50514f4 100644
--- a/src/img/gnome.png
+++ b/src/img/gnome.png
Binary files differ
diff --git a/src/img/kde.png b/src/img/kde.png
index 6e29013..ae01d2f 100644
--- a/src/img/kde.png
+++ b/src/img/kde.png
Binary files differ
diff --git a/src/img/linux.png b/src/img/linux.png
index fd76d28..57807ad 100644
--- a/src/img/linux.png
+++ b/src/img/linux.png
Binary files differ
diff --git a/src/img/locked.png b/src/img/locked.png
index 414a9be..4aaade6 100644
--- a/src/img/locked.png
+++ b/src/img/locked.png
Binary files differ
diff --git a/src/img/lxde.png b/src/img/lxde.png
index 69b0f9e..f804d8e 100644
--- a/src/img/lxde.png
+++ b/src/img/lxde.png
Binary files differ
diff --git a/src/img/macos.png b/src/img/macos.png
index f4dd5f0..a78e3f2 100644
--- a/src/img/macos.png
+++ b/src/img/macos.png
Binary files differ
diff --git a/src/img/mess.png b/src/img/mess.png
index cb98f10..8940dab 100644
--- a/src/img/mess.png
+++ b/src/img/mess.png
Binary files differ
diff --git a/src/img/msdos.png b/src/img/msdos.png
index d6c004b..dd80dcf 100644
--- a/src/img/msdos.png
+++ b/src/img/msdos.png
Binary files differ
diff --git a/src/img/none.png b/src/img/none.png
index e6fc91a..059d565 100644
--- a/src/img/none.png
+++ b/src/img/none.png
Binary files differ
diff --git a/src/img/openslx-logo.png b/src/img/openslx-logo.png
index 7e40912..3eaec83 100644
--- a/src/img/openslx-logo.png
+++ b/src/img/openslx-logo.png
Binary files differ
diff --git a/src/img/opensolaris.png b/src/img/opensolaris.png
index e70051b..15ec66f 100644
--- a/src/img/opensolaris.png
+++ b/src/img/opensolaris.png
Binary files differ
diff --git a/src/img/os2.png b/src/img/os2.png
index 5a74de3..dcdef78 100644
--- a/src/img/os2.png
+++ b/src/img/os2.png
Binary files differ
diff --git a/src/img/osx.png b/src/img/osx.png
index 12a7ea3..99ce5c2 100644
--- a/src/img/osx.png
+++ b/src/img/osx.png
Binary files differ
diff --git a/src/img/qemu.png b/src/img/qemu.png
index a154cec..fadac31 100644
--- a/src/img/qemu.png
+++ b/src/img/qemu.png
Binary files differ
diff --git a/src/img/redhat.png b/src/img/redhat.png
index 437ca10..15a872a 100644
--- a/src/img/redhat.png
+++ b/src/img/redhat.png
Binary files differ
diff --git a/src/img/riscos.png b/src/img/riscos.png
index 2c4573e..7103dce 100644
--- a/src/img/riscos.png
+++ b/src/img/riscos.png
Binary files differ
diff --git a/src/img/riscos_orig.png b/src/img/riscos_orig.png
index 1b9752f..a334524 100644
--- a/src/img/riscos_orig.png
+++ b/src/img/riscos_orig.png
Binary files differ
diff --git a/src/img/solaris.png b/src/img/solaris.png
index 8433849..0acc4cb 100644
--- a/src/img/solaris.png
+++ b/src/img/solaris.png
Binary files differ
diff --git a/src/img/suse.png b/src/img/suse.png
index 1472b93..8e00d23 100644
--- a/src/img/suse.png
+++ b/src/img/suse.png
Binary files differ
diff --git a/src/img/term.png b/src/img/term.png
index f4c0200..f9d6989 100644
--- a/src/img/term.png
+++ b/src/img/term.png
Binary files differ
diff --git a/src/img/title_l.png b/src/img/title_l.png
index 900dd86..e1f5499 100644
--- a/src/img/title_l.png
+++ b/src/img/title_l.png
Binary files differ
diff --git a/src/img/title_r.png b/src/img/title_r.png
index 8ca9347..62bef1d 100644
--- a/src/img/title_r.png
+++ b/src/img/title_r.png
Binary files differ
diff --git a/src/img/ubuntu.png b/src/img/ubuntu.png
index b43c137..9224412 100644
--- a/src/img/ubuntu.png
+++ b/src/img/ubuntu.png
Binary files differ
diff --git a/src/img/unknown.png b/src/img/unknown.png
index 21ccd9c..2a76545 100644
--- a/src/img/unknown.png
+++ b/src/img/unknown.png
Binary files differ
diff --git a/src/img/virtualbox.png b/src/img/virtualbox.png
index 21bee21..c911799 100644
--- a/src/img/virtualbox.png
+++ b/src/img/virtualbox.png
Binary files differ
diff --git a/src/img/vm-mix.png b/src/img/vm-mix.png
new file mode 100644
index 0000000..4d60441
--- /dev/null
+++ b/src/img/vm-mix.png
Binary files differ
diff --git a/src/img/vmware.png b/src/img/vmware.png
index 5da57e6..72f6105 100644
--- a/src/img/vmware.png
+++ b/src/img/vmware.png
Binary files differ
diff --git a/src/img/win2000.png b/src/img/win2000.png
index 85073c1..55791ec 100644
--- a/src/img/win2000.png
+++ b/src/img/win2000.png
Binary files differ
diff --git a/src/img/win311.png b/src/img/win311.png
index b527bf4..6be2f0f 100644
--- a/src/img/win311.png
+++ b/src/img/win311.png
Binary files differ
diff --git a/src/img/win7.png b/src/img/win7.png
index 3552207..7824718 100644
--- a/src/img/win7.png
+++ b/src/img/win7.png
Binary files differ
diff --git a/src/img/win8.png b/src/img/win8.png
index ad3b0c3..9b4dded 100644
--- a/src/img/win8.png
+++ b/src/img/win8.png
Binary files differ
diff --git a/src/img/windows.png b/src/img/windows.png
index 50dc89f..ec653a9 100644
--- a/src/img/windows.png
+++ b/src/img/windows.png
Binary files differ
diff --git a/src/img/winxp.png b/src/img/winxp.png
index 0dce300..f7cff22 100644
--- a/src/img/winxp.png
+++ b/src/img/winxp.png
Binary files differ
diff --git a/src/img/xfce.png b/src/img/xfce.png
index 41c8d21..39e4012 100644
--- a/src/img/xfce.png
+++ b/src/img/xfce.png
Binary files differ
diff --git a/src/main.cpp b/src/main.cpp
index b3dbce1..83c93de 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -45,6 +45,7 @@ int main(int argc, char *argv[]) {
" -v, --version print version and exit\n"
" -h, --help print usage information and exit\n"
" -S, --runscript change path to run-virt.sh\n"
+ " -T --tab default tab (0=xsession, 1=my vms, 2=all vms)\n"
"\nFILE can be a vmware .xml or an X .desktop file\n").toUtf8().data());
if (cmdOptions.contains("error")) {
@@ -99,13 +100,14 @@ int main(int argc, char *argv[]) {
QSettings settings(confFile, QSettings::IniFormat);
settings.setIniCodec("UTF-8");
- QString defaultSession;
- if (cmdOptions.contains("default")) {
- defaultSession = cmdOptions.value("default");
- } else if (settings.contains("default")) {
- defaultSession = settings.value("default").toString();
- } else {
- defaultSession = ChooserSettings::getSetting("last-session");
+ if (ChooserSettings::getSetting("last-session").isEmpty()) {
+ QString defaultSession;
+ if (cmdOptions.contains("default")) {
+ defaultSession = cmdOptions.value("default");
+ } else if (settings.contains("default")) {
+ defaultSession = settings.value("default").toString();
+ }
+ ChooserSettings::setSetting("last-session", defaultSession);
}
if (cmdOptions.contains("xpath")) {
@@ -197,10 +199,15 @@ int main(int argc, char *argv[]) {
basePath = settings.value("path").toString();
}
+ int defaultTab = -1;
+ if (cmdOptions.contains("tab")) {
+ defaultTab = cmdOptions.value("tab").toInt();
+ }
+
/* read session files */
QList<Session*> xsessions(XSession::readSessions(xSessionPath));
- Dialog w;
+ Dialog w(defaultTab);
/* DOWNLOAD VSESSIONS */
HttpXmlDownloader httpxmldownloader;
diff --git a/src/ui/dialog.ui b/src/ui/dialog.ui
index 6ff8d9d..5be8154 100644
--- a/src/ui/dialog.ui
+++ b/src/ui/dialog.ui
@@ -132,8 +132,8 @@ margin-bottom:0px;}</string>
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Loading...&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVuSans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans'; font-size:10pt;&quot;&gt;Loading...&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@@ -164,8 +164,8 @@ p, li { white-space: pre-wrap; }
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Loading...&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVuSans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans'; font-size:10pt;&quot;&gt;Loading...&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@@ -197,9 +197,25 @@ p, li { white-space: pre-wrap; }
</property>
<item>
<widget class="QPushButton" name="tabButtonLocal">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>Local</string>
</property>
+ <property name="icon">
+ <iconset resource="../images.qrc">
+ <normaloff>:/linux</normaloff>:/linux</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>40</width>
+ <height>40</height>
+ </size>
+ </property>
<property name="checkable">
<bool>true</bool>
</property>
@@ -207,6 +223,12 @@ p, li { white-space: pre-wrap; }
</item>
<item>
<widget class="QPushButton" name="tabButtonMyClasses">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>My Classes</string>
</property>
@@ -217,9 +239,25 @@ p, li { white-space: pre-wrap; }
</item>
<item>
<widget class="QPushButton" name="tabButtonAllClasses">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>All Classes</string>
</property>
+ <property name="icon">
+ <iconset resource="../images.qrc">
+ <normaloff>:/vm-mix</normaloff>:/vm-mix</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>40</width>
+ <height>40</height>
+ </size>
+ </property>
<property name="checkable">
<bool>true</bool>
</property>
@@ -328,7 +366,7 @@ border:1px solid #999;
</sizepolicy>
</property>
<property name="text">
- <string>Description:</string>
+ <string>Description</string>
</property>
</widget>
</item>
@@ -348,7 +386,7 @@ border:1px solid #999;
</sizepolicy>
</property>
<property name="text">
- <string>Name:</string>
+ <string>Name</string>
</property>
</widget>
</item>
@@ -361,7 +399,7 @@ border:1px solid #999;
</sizepolicy>
</property>
<property name="text">
- <string>Creator:</string>
+ <string>Creator</string>
</property>
</widget>
</item>
@@ -374,7 +412,14 @@ border:1px solid #999;
</sizepolicy>
</property>
<property name="text">
- <string>Operating System:</string>
+ <string>Operating System</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Platform</string>
</property>
</widget>
</item>
@@ -394,7 +439,7 @@ border:1px solid #999;
</sizepolicy>
</property>
<property name="text">
- <string/>
+ <string notr="true"/>
</property>
</widget>
</item>
@@ -407,7 +452,7 @@ border:1px solid #999;
</sizepolicy>
</property>
<property name="text">
- <string/>
+ <string notr="true"/>
</property>
</widget>
</item>
@@ -420,7 +465,14 @@ border:1px solid #999;
</sizepolicy>
</property>
<property name="text">
- <string/>
+ <string notr="true"/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_platform">
+ <property name="text">
+ <string notr="true"/>
</property>
</widget>
</item>
@@ -434,7 +486,7 @@ border:1px solid #999;
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVuSans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:11pt;&quot;&gt;Click on an item on the left side for more infos.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
diff --git a/src/vsession.h b/src/vsession.h
index e542818..22f3a94 100644
--- a/src/vsession.h
+++ b/src/vsession.h
@@ -30,7 +30,7 @@ class VSession : public Session {
}
QString description() const {
- return getAttribute("description");
+ return getAttribute("long_description");
}
QIcon icon() const;