From dde9c866786c9a080c346ae8417c0f73b8e8e171 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 21 Jan 2016 21:38:27 +0100 Subject: Scroll the item into view when selecting programatically --- src/dialog.cpp | 1 + src/i18n/de.ts | 33 +++++++++++++++------------------ src/i18n/pt.ts | 3 --- src/sessiontreeitem.cpp | 9 +++++---- 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 Filter: - Liste filtern: + Liste filtern: Details @@ -114,7 +114,7 @@ FILE can be a vmware .xml or an X .desktop file URL Error - Fehler beim Laden der Liste + Fehler beim Laden der Liste Join PVS @@ -122,35 +122,35 @@ FILE can be a vmware .xml or an X .desktop file Native Linux - Natives Linux + Natives Linux Could not get news. - News konnten nicht geladen werden. + News konnten nicht geladen werden. Could not get help. - Die Hilfe konnte nicht geladen werden. + Die Hilfe konnte nicht geladen werden. Description - Beschreibung + Beschreibung Name - Name + Name Creator - Zuständig + Zuständig Operating System - Betriebssystem + Betriebssystem Platform - Plattform + Plattform <!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> - Klicken Sie eine Veranstaltung an, um mehr Informationen zu erhalten + Klicken Sie eine Veranstaltung an, um mehr Informationen zu erhalten - - - QObject Working environments for this room - Kursumgebungen speziell für diesen Raum + Kursumgebungen speziell für diesen Raum Templates - Vorlagensysteme + Vorlagensysteme Working environments - Allgemeine Kursumgebungen + Allgemeine Kursumgebungen X-Sessions - Native X-Sessions + Native X-Sessions 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; } Vmchooser failed to run the selected session! O seletor da VM falhou ao executar a sessão selecionada! - - - QObject Working environments for this room 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 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 ""; 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; -- cgit v1.2.3-55-g7522