Changes: disabled selection on the route detail table
authorMax Waterman <david.waterman@nokia.com>
Fri, 23 Apr 2010 12:47:15 +0000 (15:47 +0300)
committerMax Waterman <david.waterman@nokia.com>
Fri, 23 Apr 2010 12:47:15 +0000 (15:47 +0300)
zouba/src/ui.cpp
zouba/src/uicontroller.cpp
zouba/tests/ut_gpscontroller/Makefile

index 4dc3c1a..8e269c1 100644 (file)
@@ -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 );
index a5440a3..503c449 100644 (file)
@@ -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 ) {
index d8f5c18..5dc138f 100644 (file)
@@ -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