From: Max Waterman Date: Fri, 23 Apr 2010 12:47:15 +0000 (+0300) Subject: Changes: disabled selection on the route detail table X-Git-Url: https://vcs.maemo.org/git/?p=ptas;a=commitdiff_plain;h=f2cb883cd4d19afcbaf9591adda87b365a1bf913 Changes: disabled selection on the route detail table --- diff --git a/zouba/src/ui.cpp b/zouba/src/ui.cpp index 4dc3c1a..8e269c1 100644 --- a/zouba/src/ui.cpp +++ b/zouba/src/ui.cpp @@ -90,12 +90,12 @@ void Ui::setupUi( QMainWindow *mainWindow ) } m_routeStack->addStretch(); + QStringList headers( QStringList() << "How" << "Time" << "Dist" << "Dep" << "Arr" ); m_routeDetailTable = new QTableWidget(); - m_routeDetailTable->setColumnCount(6); - m_routeDetailTable->setHorizontalHeaderLabels( - QStringList() << "How" << "Time" << "Dist" << "Dep" << "Arr" << "Line" - ); + m_routeDetailTable->setColumnCount( headers.count() ); + m_routeDetailTable->setHorizontalHeaderLabels( headers ); m_routeDetailTable->resizeColumnsToContents(); + m_routeDetailTable->setSelectionMode( QAbstractItemView::NoSelection ); QHBoxLayout *topLayout = new QHBoxLayout(); topLayout->addLayout( m_routeStack ); diff --git a/zouba/src/uicontroller.cpp b/zouba/src/uicontroller.cpp index a5440a3..503c449 100644 --- a/zouba/src/uicontroller.cpp +++ b/zouba/src/uicontroller.cpp @@ -93,8 +93,6 @@ void UiController::setButtonValid( int id ) void UiController::changeDestination( int id ) { - qDebug() << "Destination button "+QString::number(id)+" clicked"; - bool destinationHasChanged = ( m_currentDestination != id ); qDebug() << "Destination has changed=" << destinationHasChanged; if ( destinationHasChanged ) { @@ -109,8 +107,6 @@ void UiController::changeDestination( int id ) void UiController::changeRoute( int id ) { - qDebug() << "Route button "+QString::number(id)+" clicked"; - bool routeHasChanged = ( m_currentRoute != id ); if ( routeHasChanged ) { displayRouteDetail( id ); @@ -127,15 +123,20 @@ void UiController::displayRouteDetail( int id ) int row=0; foreach( LegData thisLegData, legDataList ) { + QString thisHow = thisLegData.m_how; + + bool thisIsLine = ( thisHow == "LINE" ); + if ( thisIsLine ) { + thisHow = thisLegData.m_lineCode; + } QStringList tableStrings; tableStrings - << thisLegData.m_how + << thisHow << thisLegData.m_tripTime << thisLegData.m_tripDistance << thisLegData.m_departureTime - << thisLegData.m_arrivalTime - << thisLegData.m_lineCode; + << thisLegData.m_arrivalTime; int col=0; foreach( QString thisString, tableStrings ) { diff --git a/zouba/tests/ut_gpscontroller/Makefile b/zouba/tests/ut_gpscontroller/Makefile index d8f5c18..5dc138f 100644 --- a/zouba/tests/ut_gpscontroller/Makefile +++ b/zouba/tests/ut_gpscontroller/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: ut_gpscontroller -# Generated by qmake (2.01a) (Qt 4.6.2) on: Thu Apr 22 18:51:14 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Fri Apr 23 07:10:27 2010 # Project: ut_gpscontroller.pro # Template: app # Command: /usr/bin/qmake -unix -o Makefile ut_gpscontroller.pro