diff options
author | Simon Rettberg | 2016-01-21 21:38:27 +0100 |
---|---|---|
committer | Simon Rettberg | 2016-01-21 21:38:27 +0100 |
commit | dde9c866786c9a080c346ae8417c0f73b8e8e171 (patch) | |
tree | 429460ddb2536bc7abcd2245c7904daeb8a5b2f0 | |
parent | Update translations (diff) | |
download | vmchooser2-dde9c866786c9a080c346ae8417c0f73b8e8e171.tar.gz vmchooser2-dde9c866786c9a080c346ae8417c0f73b8e8e171.tar.xz vmchooser2-dde9c866786c9a080c346ae8417c0f73b8e8e171.zip |
Scroll the item into view when selecting programatically
-rw-r--r-- | src/dialog.cpp | 1 | ||||
-rw-r--r-- | src/i18n/de.ts | 33 | ||||
-rwxr-xr-x | src/i18n/pt.ts | 3 | ||||
-rw-r--r-- | src/sessiontreeitem.cpp | 9 | ||||
-rw-r--r-- | src/vsession.cpp | 4 |
5 files changed, 23 insertions, 27 deletions
diff --git a/src/dialog.cpp b/src/dialog.cpp index 39f0d6c..17fc474 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -228,6 +228,7 @@ bool Dialog::selectSession(const QString& name) { ui->treeView->selectionModel()->clear(); ui->treeView->selectionModel()->select(index, QItemSelectionModel::Select); ui->treeView->selectionModel()->setCurrentIndex(index, QItemSelectionModel::Select); + ui->treeView->scrollTo(index); return true; } } diff --git a/src/i18n/de.ts b/src/i18n/de.ts index 093f073..cccd582 100644 --- a/src/i18n/de.ts +++ b/src/i18n/de.ts @@ -98,7 +98,7 @@ FILE can be a vmware .xml or an X .desktop file </message> <message> <source>Filter:</source> - <translation type="unfinished">Liste filtern:</translation> + <translation>Liste filtern:</translation> </message> <message> <source>Details</source> @@ -114,7 +114,7 @@ FILE can be a vmware .xml or an X .desktop file </message> <message> <source>URL Error</source> - <translation type="unfinished">Fehler beim Laden der Liste</translation> + <translation>Fehler beim Laden der Liste</translation> </message> <message> <source>Join PVS</source> @@ -122,35 +122,35 @@ FILE can be a vmware .xml or an X .desktop file </message> <message> <source>Native Linux</source> - <translation type="unfinished">Natives Linux</translation> + <translation>Natives Linux</translation> </message> <message> <source>Could not get news.</source> - <translation type="unfinished">News konnten nicht geladen werden.</translation> + <translation>News konnten nicht geladen werden.</translation> </message> <message> <source>Could not get help.</source> - <translation type="unfinished">Die Hilfe konnte nicht geladen werden.</translation> + <translation>Die Hilfe konnte nicht geladen werden.</translation> </message> <message> <source>Description</source> - <translation type="unfinished">Beschreibung</translation> + <translation>Beschreibung</translation> </message> <message> <source>Name</source> - <translation type="unfinished">Name</translation> + <translation>Name</translation> </message> <message> <source>Creator</source> - <translation type="unfinished">Zuständig</translation> + <translation>Zuständig</translation> </message> <message> <source>Operating System</source> - <translation type="unfinished">Betriebssystem</translation> + <translation>Betriebssystem</translation> </message> <message> <source>Platform</source> - <translation type="unfinished">Plattform</translation> + <translation>Plattform</translation> </message> <message> <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> @@ -166,26 +166,23 @@ p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'DejaVuSans'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Click on an item on the left side for more information</p></body></html></source> - <translation type="unfinished">Klicken Sie eine Veranstaltung an, um mehr Informationen zu erhalten</translation> + <translation>Klicken Sie eine Veranstaltung an, um mehr Informationen zu erhalten</translation> </message> -</context> -<context> - <name>QObject</name> <message> <source>Working environments for this room</source> - <translation type="unfinished">Kursumgebungen speziell für diesen Raum</translation> + <translation>Kursumgebungen speziell für diesen Raum</translation> </message> <message> <source>Templates</source> - <translation type="unfinished">Vorlagensysteme</translation> + <translation>Vorlagensysteme</translation> </message> <message> <source>Working environments</source> - <translation type="unfinished">Allgemeine Kursumgebungen</translation> + <translation>Allgemeine Kursumgebungen</translation> </message> <message> <source>X-Sessions</source> - <translation type="unfinished">Native X-Sessions</translation> + <translation>Native X-Sessions</translation> </message> </context> </TS> diff --git a/src/i18n/pt.ts b/src/i18n/pt.ts index a12fea6..f15beb2 100755 --- a/src/i18n/pt.ts +++ b/src/i18n/pt.ts @@ -203,9 +203,6 @@ p, li { white-space: pre-wrap; } <source>Vmchooser failed to run the selected session!</source> <translation>O seletor da VM falhou ao executar a sessão selecionada!</translation> </message> -</context> -<context> - <name>QObject</name> <message> <location filename="../sessiontreeitem.cpp" line="6"/> <source>Working environments for this room</source> diff --git a/src/sessiontreeitem.cpp b/src/sessiontreeitem.cpp index 65deae8..5f3c28e 100644 --- a/src/sessiontreeitem.cpp +++ b/src/sessiontreeitem.cpp @@ -1,15 +1,16 @@ #include "sessiontreeitem.h" +#include <QCoreApplication> QString SessionTreeItem::typeToName(const SectionType type) { switch (type) { case SECTION_FOR_LOCATION: - return QObject::tr("Working environments for this room"); + return QCoreApplication::instance()->translate("Dialog", "Working environments for this room"); case SECTION_TEMPLATES: - return QObject::tr("Templates"); + return QCoreApplication::instance()->translate("Dialog", "Templates"); case SECTION_GENERIC: - return QObject::tr("Working environments"); + return QCoreApplication::instance()->translate("Dialog", "Working environments"); case SECTION_XSESSION: - return QObject::tr("X-Sessions"); + return QCoreApplication::instance()->translate("Dialog", "X-Sessions"); case SECTION_NULL: return "<null>"; default: diff --git a/src/vsession.cpp b/src/vsession.cpp index f0384a0..991a117 100644 --- a/src/vsession.cpp +++ b/src/vsession.cpp @@ -227,10 +227,10 @@ bool VSession::isValid() const { int VSession::priority() const { int prio = getAttribute("priority").toInt(); - if (g_templateHandling == TEMPLATES_BUMP) { + if (g_templateHandling == TEMPLATES_BUMP && isTemplate()) { prio -= 500; } - if (g_forLocationHandling == LOCATION_BUMP) { + if (g_forLocationHandling != LOCATION_IGNORE && isForLocation()) { prio -= 1000; } return prio; |