Skip to content
Snippets Groups Projects
Select Git revision
  • 11119e51f67b38a0d937eb105cea7d59d8d01b6d
  • master default protected
  • beta/202506161038
  • stable/20250613.0
  • nightly/20250613.0
  • beta/202506101658
  • stable/20250610.0
  • nightly/20250610.0
  • beta/202506091027
  • beta/202506061543
  • nightly/20250605.0
  • beta/202506051039
  • beta/202506051002
  • beta/202506041611
  • beta/202506041335
  • beta/202505231812
  • stable/20250523.0
  • nightly/20250523.0
  • nightly/20250515.0
  • nightly/20250510.0
  • nightly/20250509.1
  • nightly/20250509.0
22 results

make-client.py

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    HistoryDock.cpp 10.73 KiB
    #include "HistoryDock.h"
    
    #include <QtGui/QVBoxLayout>
    #include <kicon.h>
    #include <klineedit.h>
    #include <QtGui/QTreeWidget>
    #include <QtGui/QComboBox>
    #include <QtGui/QPushButton>
    #include <QtGui/QLabel>
    #include <kdatewidget.h>
    #include <QHeaderView>
    #include <QtGui/QCheckBox>
    #include <QDate>
    #include "SFLPhone.h"
    #include "widgets/HistoryTreeItem.h"
    #include "conf/ConfigurationSkeleton.h"
    #include "AkonadiBackend.h"
    #include "lib/sflphone_const.h"
    
    class QNumericTreeWidgetItem : public QTreeWidgetItem {
       public:
          QNumericTreeWidgetItem(QTreeWidget* parent):QTreeWidgetItem(parent),widget(0),weight(-1){}
          QNumericTreeWidgetItem(QTreeWidgetItem* parent):QTreeWidgetItem(parent),widget(0),weight(-1){}
          HistoryTreeItem* widget;
          int weight;
       private:
          bool operator<(const QTreeWidgetItem & other) const {
             int column = treeWidget()->sortColumn();
             if (dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)) {
                if (widget !=0 && dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)->widget != 0)
                   return widget->getTimeStamp() < dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)->widget->getTimeStamp();
                else if (weight > 0 && dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)->weight > 0)
                   return weight > dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)->weight;
             }
             return text(column) < other.text(column);
          }
    };
    
    HistoryDock::HistoryDock(QWidget* parent) : QDockWidget(parent)
    {
       setMinimumSize(250,0);
       setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
       m_pFilterLE   = new KLineEdit();
       m_pItemView   = new HistoryTree(this);
       m_pSortByCBB  = new QComboBox();
       m_pSortByL    = new QLabel("Sort by:");
       m_pFromL      = new QLabel("From:");
       m_pToL        = new QLabel("To:");
       m_pFromDW     = new KDateWidget();
       m_pToDW       = new KDateWidget();
       m_pAllTimeCB  = new QCheckBox("Display all");
       m_pLinkPB     = new QPushButton(this);
       
       m_pAllTimeCB->setChecked(ConfigurationSkeleton::displayDataRange());
    
       m_pSortByL->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Preferred);
       m_pSortByCBB->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
       m_pLinkPB->setMaximumSize(20,9999999);
       m_pLinkPB->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding);
       m_pLinkPB->setCheckable(true);
       
       m_pItemView->headerItem()->setText(0,"Calls"          );
       m_pItemView->header    ()->setClickable(true          );
       m_pItemView->header    ()->setSortIndicatorShown(true );
       m_pItemView->setAlternatingRowColors(true             );
       m_pItemView->setAcceptDrops( true                     );
       m_pItemView->setDragEnabled( true                     );
    
       m_pFilterLE->setPlaceholderText("Filter");
       m_pFilterLE->setClearButtonShown(true);