Changes: layout change ready for multiple routes; change table selection modes
authorMax Waterman <david.waterman@nokia.com>
Mon, 19 Apr 2010 14:47:31 +0000 (17:47 +0300)
committerMax Waterman <david.waterman@nokia.com>
Mon, 19 Apr 2010 14:47:31 +0000 (17:47 +0300)
zouba/debian/changelog
zouba/debian/files
zouba/src/messagetable.cpp
zouba/src/ui.cpp
zouba/src/ui.h

index c694d2c..81a5e73 100644 (file)
@@ -1,3 +1,10 @@
+zouba (0.6) unstable; urgency=low
+
+  * Changed layout in preparation for multiple routes
+  * Changed the selection mode for the tables
+
+ -- Max Waterman <davidmaxwaterman@fastmail.co.uk>  Mon, 19 Apr 2010 17:38:00 +0200
+
 zouba (0.5) unstable; urgency=low
 
   * Changed package description
index b584481..7f196be 100644 (file)
@@ -1 +1 @@
-zouba_0.5_armel.deb user/navigation extra
+zouba_0.6_armel.deb user/navigation extra
index 032bcd2..8d0fa38 100644 (file)
@@ -11,6 +11,7 @@ MessageTable::MessageTable( QWidget *parent ) :
 {
   setHorizontalHeaderLabels( QStringList() << "Messages" );
   verticalHeader()->hide();
+  setSelectionMode( QAbstractItemView::NoSelection );
 
   for ( int row=0; row<NumberOfRows; ++row ) {
     QTableWidgetItem *newRow = new QTableWidgetItem();
index 7660ee0..7b7c3e8 100644 (file)
@@ -14,6 +14,7 @@
 #include <QMenuBar>
 #include <QHBoxLayout>
 #include <QVBoxLayout>
+#include <QGridLayout>
 #include <QSizePolicy>
 #include <QInputDialog>
 #include <QDebug>
@@ -77,7 +78,6 @@ void Ui::setupUi( QMainWindow *mainWindow )
   homeButton->setObjectName( QString::fromUtf8("homeButton") );
   homeButton->setText( "GPS->HOME" );
   homeButton->setEnabled(false);
-  homeButton->setFixedSize( QSize( ButtonWidth, ButtonHeight ) );
 
   QRadioButton *workButton = new QRadioButton();
   workButton->setObjectName( QString::fromUtf8("workButton") );
@@ -89,21 +89,20 @@ void Ui::setupUi( QMainWindow *mainWindow )
   destinationButtons->addButton( workButton, WorkButtonId );
   destinationButtons->setExclusive( true );
 
-  buttonLayout = new QVBoxLayout();
-  buttonLayout->addWidget( homeButton );
-  buttonLayout->addWidget( workButton );
-  buttonLayout->addStretch();
-
   routeTable = new QTableWidget( 1, 2 );
   QStringList columnHeaders;
   columnHeaders << "Time" << "Bus";
   routeTable->setHorizontalHeaderLabels( columnHeaders );
   routeTable->verticalHeader()->hide();
+  routeTable->setSelectionMode( QAbstractItemView::SingleSelection );
 
   QHBoxLayout *topLayout = new QHBoxLayout();
-  topLayout->addLayout( buttonLayout );
   topLayout->addWidget( routeTable );
 
+  buttonLayout = new QGridLayout();
+  buttonLayout->addWidget( homeButton, 0, 0 );
+  buttonLayout->addWidget( workButton, 0, 1 );
+
   messageTable = new MessageTable();
   messageTable->setObjectName( QString::fromUtf8("messageTable") );
   messageTable->hide();
@@ -111,6 +110,7 @@ void Ui::setupUi( QMainWindow *mainWindow )
   QVBoxLayout *mainLayout = new QVBoxLayout();
   mainLayout->addLayout( topLayout );
   mainLayout->addWidget( messageTable );
+  mainLayout->addLayout( buttonLayout );
 
   centralWidget->setLayout( mainLayout );
 }
index ecaee4f..318ceb1 100644 (file)
@@ -10,6 +10,7 @@ class QButtonGroup;
 class MessageTable;
 class QHBoxLayout;
 class QVBoxLayout;
+class QGridLayout;
 class QMenu;
 class QAction;
 class Location;
@@ -32,18 +33,13 @@ public:
     ScreenWidth=800,
     ScreenHeight=480
   };
-  enum {
-   ButtonWidth=300,
-   ButtonHeight=70
-  };
-
 
   QWidget *centralWidget;
   QButtonGroup *destinationButtons;
   QTableWidget *routeTable;
   static MessageTable *messageTable;
   QHBoxLayout *mainLayout;
-  QVBoxLayout *buttonLayout;
+  QGridLayout *buttonLayout;
   QMenu       *menu;
   QAction     *toggleMessagesAction;
   QAction     *toggleFakeGpsAction;