- Scrollbar added to column selector
authorlvaatamoinen <lassi.vaatamoinen@ixonos.com>
Thu, 7 Jan 2010 15:22:18 +0000 (15:22 +0000)
committerlvaatamoinen <lassi.vaatamoinen@ixonos.com>
Thu, 7 Jan 2010 15:22:18 +0000 (15:22 +0000)
- TODO: Kinetic scrolling to be implemented in the selector.

git-svn-id: file:///svnroot/qtrapids/trunk@58 42ac0dd5-4c8c-4c71-bb3e-ecdfe252ffda

src/client/ColumnSelectorDialog.cpp
src/client/DownloadView.cpp

index 153199a..4e26acd 100644 (file)
@@ -18,6 +18,8 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
+#include <QScrollArea>
+#include <QGroupBox>
 #include <QGridLayout>
 #include <QTreeWidgetItem>
 #include <QCheckBox>
@@ -34,13 +36,26 @@ ColumnSelectorDialog::ColumnSelectorDialog(QTreeWidget *treewidget, QWidget* par
        treeWidget_(treewidget),
        checkBoxes_()
 {
+       QScrollArea *scrollArea = new QScrollArea(this);
+       scrollArea->setWidgetResizable(true);
+       //scrollArea->setProperty("FingerScrollable", false);
        QBoxLayout *verticalBox = new QBoxLayout(QBoxLayout::TopToBottom);
        grid_ = new QGridLayout;
        QCheckBox *cbox = NULL;
 
-       setLayout(verticalBox);
-       verticalBox->addLayout(grid_);
+/// @TODO Kineticscrolling (Fingerscrollable does not work in Qt 4.6, only in 4.5)     
+#ifdef Q_WS_HILDON
+   //Specific hildon/Maemo5 code here 
+#endif
 
+       // Create scrollable checkbox dialog to allow proper viewing on Maemo:
+       verticalBox->addWidget(scrollArea);
+       // A "temporary" widget for containing QScrollArea stuff
+       QWidget* scrollAreaWidgetContents = new QWidget(); 
+       scrollAreaWidgetContents->setLayout(grid_);
+       scrollArea->setWidget(scrollAreaWidgetContents);
+       setLayout(verticalBox);
+       
        if (treeWidget_ != NULL) {
                QTreeWidgetItem *item = treeWidget_->headerItem();
 
index 7416ecb..275d268 100644 (file)
@@ -200,24 +200,24 @@ void DownloadView::restoreView()
 QString DownloadView::GetStatusString(TorrentStatus::Id status)
 {
        switch (status) {
-       case TorrentStatus::QUEUED_FOR_CHECKING :
-               return tr("Queued");
-       case TorrentStatus::CHECKING_FILES :
-               return tr("Checking");
-       case TorrentStatus::DOWNLOADING_METADATA :
-               return tr("DL meta");
-       case TorrentStatus::DOWNLOADING :
-               return tr("Downloading");
-       case TorrentStatus::FINISHED :
-               return tr("Finished");
-       case TorrentStatus::SEEDING :
-               return tr("Seeding");
-       case TorrentStatus::ALLOCATING :
-               return tr("Allocating");
-       case TorrentStatus::CHECKING_RESUME_DATA :
-               return tr("Checking resume");
-       default:
-               return tr("N/A");
+               case TorrentStatus::QUEUED_FOR_CHECKING :
+                       return tr("Queued");
+               case TorrentStatus::CHECKING_FILES :
+                       return tr("Checking");
+               case TorrentStatus::DOWNLOADING_METADATA :
+                       return tr("DL meta");
+               case TorrentStatus::DOWNLOADING :
+                       return tr("Downloading");
+               case TorrentStatus::FINISHED :
+                       return tr("Finished");
+               case TorrentStatus::SEEDING :
+                       return tr("Seeding");
+               case TorrentStatus::ALLOCATING :
+                       return tr("Allocating");
+               case TorrentStatus::CHECKING_RESUME_DATA :
+                       return tr("Checking resume");
+               default:
+                       return tr("N/A");
        }
 }
 
@@ -228,18 +228,18 @@ QColor DownloadView::GetStatusColor(TorrentStatus::Id status)
        QColor yellow(255,174,0);
 
        switch (status) {
-       case TorrentStatus::QUEUED_FOR_CHECKING :
-       case TorrentStatus::CHECKING_FILES :
-       case TorrentStatus::DOWNLOADING_METADATA :
-       case TorrentStatus::ALLOCATING :
-       case TorrentStatus::CHECKING_RESUME_DATA:
-               return yellow;
-       case TorrentStatus::DOWNLOADING :
-       case TorrentStatus::FINISHED :
-       case TorrentStatus::SEEDING :
-               return green;
-       default:
-               return QColor();
+               case TorrentStatus::QUEUED_FOR_CHECKING :
+               case TorrentStatus::CHECKING_FILES :
+               case TorrentStatus::DOWNLOADING_METADATA :
+               case TorrentStatus::ALLOCATING :
+               case TorrentStatus::CHECKING_RESUME_DATA:
+                       return yellow;
+               case TorrentStatus::DOWNLOADING :
+               case TorrentStatus::FINISHED :
+               case TorrentStatus::SEEDING :
+                       return green;
+               default:
+                       return QColor();
        }
 }