[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.5/kdeedu/parley/src/statistics
From:       Daniel Laidig <d.laidig () gmx ! de>
Date:       2010-05-28 20:52:40
Message-ID: 20100528205240.B5F89AC8C2 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1131732 by laidig:

only show the grades that are relevant for the current language selection

 M  +2 -7      lessonstatistics.cpp  
 M  +0 -1      lessonstatistics.h  
 M  +10 -0     statisticsmainwindow.cpp  
 M  +1 -0      statisticsmainwindow.h  


--- branches/KDE/4.5/kdeedu/parley/src/statistics/lessonstatistics.cpp \
#1131731:1131732 @@ -105,17 +105,12 @@
     GradeDelegate* delegate = new GradeDelegate(this);
     for (int i = 2; i < model->columnCount(QModelIndex()); i++) {
         setItemDelegateForColumn(i, delegate);
-        //setColumnWidth(i, 200);
+        setColumnWidth(i, 150);
     }
-    header()->resizeSections(QHeaderView::ResizeToContents);
+//    header()->resizeSections(QHeaderView::ResizeToContents);
     header()->setResizeMode(QHeaderView::Interactive);
 }
 
-void LessonStatisticsView::showGrades(int, int)
-{
-    // TODO: only show the corresponding grades
-}
-
 void LessonStatisticsView::removeGrades()
 {
     QModelIndex selectedIndex = selectionModel()->currentIndex();
--- branches/KDE/4.5/kdeedu/parley/src/statistics/lessonstatistics.h #1131731:1131732
@@ -29,7 +29,6 @@
 public:
     LessonStatisticsView(QWidget *parent);
     void setModel(Editor::ContainerModel *model);
-    void showGrades(int languageFrom, int languageTo);
 
 private Q_SLOTS:
     void removeGrades();
--- branches/KDE/4.5/kdeedu/parley/src/statistics/statisticsmainwindow.cpp \
#1131731:1131732 @@ -81,6 +81,7 @@
     m_statisticsModel->setDocument(doc);
     m_ui->lessonStatistics->setModel(m_statisticsModel);
     m_ui->lessonStatistics->expandToDepth(0);
+    m_ui->lessonStatistics->resizeColumnToContents(0);
 }
 
 void StatisticsMainWindow::initActions()
@@ -193,6 +194,7 @@
     emit languagesChanged(questionLanguage, solutionLangauge);
     //m_ui->lessonStatistics->showGrades(current->data(Qt::UserRole).toInt(), \
                current->data(Qt::UserRole+1).toInt());
     kDebug() << "set languages: " << current->data(Qt::UserRole).toInt() << \
current->data(Qt::UserRole+1).toInt(); +    updateVisibleColumns();
 }
 
 void StatisticsMainWindow::practiceModeSelected(int mode)
@@ -203,6 +205,14 @@
     showConjugationOptions(mode == Prefs::EnumPracticeMode::ConjugationPractice);
 }
 
+void StatisticsMainWindow::updateVisibleColumns()
+{
+    int solutionLanguage = Prefs::solutionLanguage();
+    for (int i = 2; i < m_ui->lessonStatistics->header()->count(); i++) {
+        m_ui->lessonStatistics->setColumnHidden(i, (i-2) != solutionLanguage);
+    }
+}
+
 void StatisticsMainWindow::showConjugationOptions(bool visible)
 {
     if (!m_conjugationOptions && !visible) {
--- branches/KDE/4.5/kdeedu/parley/src/statistics/statisticsmainwindow.h \
#1131731:1131732 @@ -43,6 +43,7 @@
     void configurePractice();
     void languagesChanged();
     void practiceModeSelected(int mode);
+    void updateVisibleColumns();
 
 private:
     void initActions();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic