Commit 7ef79e87 authored by Emmanuel Lepage's avatar Emmanuel Lepage

Port history to the new syntax

parent da6b6f09
......@@ -54,6 +54,7 @@ SFLPhone* SFLPhone::app()
SFLPhone::~SFLPhone()
{
saveState();
}
bool SFLPhone::initialize()
......@@ -68,6 +69,9 @@ bool SFLPhone::initialize()
// accept dnd
setAcceptDrops(true);
m_pContactCD = new ContactDock(this);
addDockWidget(Qt::TopDockWidgetArea,m_pContactCD);
// tell the KXmlGuiWindow that this is indeed the main widget
//setCentralWidget(view);
m_pCentralDW = new QDockWidget(this);
......@@ -85,15 +89,18 @@ bool SFLPhone::initialize()
\
");
addDockWidget(Qt::BottomDockWidgetArea,m_pCentralDW);
m_pCentralDW->setTitleBarWidget(new QWidget());
m_pCentralDW->setContentsMargins(0,0,0,0);
view->setContentsMargins(0,0,0,0);
addDockWidget(Qt::TopDockWidgetArea,m_pCentralDW);
m_pContactCD = new ContactDock(this);
addDockWidget(Qt::LeftDockWidgetArea,m_pContactCD);
m_pHistoryDW = new HistoryDock(this);
addDockWidget(Qt::RightDockWidgetArea,m_pHistoryDW);
addDockWidget(Qt::TopDockWidgetArea,m_pHistoryDW);
m_pBookmarkDW = new BookmarkDock(this);
addDockWidget(Qt::RightDockWidgetArea,m_pBookmarkDW);
addDockWidget(Qt::TopDockWidgetArea,m_pBookmarkDW);
tabifyDockWidget(m_pBookmarkDW,m_pHistoryDW);
setWindowIcon(QIcon(ICON_SFLPHONE));
setWindowTitle(i18n("SFLphone"));
......
......@@ -37,10 +37,16 @@
<label>Defines whether the main window should be displayed when receiving a message.</label>
</entry>
<entry name="displayDialpad" type="Bool">
<label>Defines whether the main window should be displayed when receiving a message.</label>
<label>Defines whether the dialpad is being shown by default</label>
</entry>
<entry name="displayVolume" type="Bool">
<label>Defines whether the main window should be displayed when receiving a message.</label>
<label>Defines whether the volume widgets are visible by default</label>
</entry>
<entry name="displayMenu" type="Bool">
<label>Defines whether the main menu is visible by default, it can be restored with "Ctrl+m"</label>
</entry>
<entry name="displayDataRange" type="Bool">
<label>Defines whether call history is restricted to a specific date range</label>
</entry>
<!-- Audio Settings -->
......
......@@ -73,20 +73,31 @@ template<typename CallWidget, typename Index> bool CallModel<CallWidget,Index>::
if (!historyInit) {
ConfigurationManagerInterface& configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
QStringList historyMap = configurationManager.getHistory().value();
qDebug() << "Call History = " << historyMap;
// QMapIterator<QString, QString> i(historyMap);
// while (i.hasNext()) {
// i.next();
// uint startTimeStamp = i.key().toUInt();
// QStringList param = i.value().split("|");
qDebug() << "\n\n\n\n\n\n\n\nCall History = " << historyMap<<"\n\n\n\n\n\n";
foreach (QString historyCallId, historyMap) {
QStringList param = historyCallId.split("|");
if (param.count() < 10) {
//If this ever change, look at the gnome client
QString history_state = param[0];
QString peer_number = param[1];
QString peer_name = param[2];
QString time_start = param[3];
QString time_stop = param[4];
QString callID = param[5];
QString accountID = param[6];
QString recordfile = param[7];
QString confID = param[8];
QString time_added = param[9];
historyCalls[time_start] = Call::buildHistoryCall(callID, time_start.toUInt(), time_stop.toUInt(), accountID, peer_name, peer_number, history_state);
addCall(historyCalls[time_start]);
}
// QString type2 = param[0];
// QString number = param[1];
// QString name = param[2];
// uint stopTimeStamp = param[3].toUInt();
// QString account = param[4];
// historyCalls[QString::number(startTimeStamp)] = Call::buildHistoryCall(generateCallId(), startTimeStamp, stopTimeStamp, account, name, number, type2);
// addCall(historyCalls[QString::number(startTimeStamp)]);
// }
}
}
historyInit = true;
return true;
......
......@@ -15,6 +15,7 @@
#include "lib/sflphone_const.h"
#include "SFLPhoneapplication.h"
#include "conf/ConfigurationDialog.h"
#include "conf/ConfigurationSkeleton.h"
#include "CallView.h"
#include <QTableView>
......@@ -56,8 +57,12 @@ int main(int argc, char **argv)
SFLPhoneApplication app;
return app.exec();
int retVal = app.exec();
ConfigurationSkeleton conf;
conf.writeConfig();
return retVal;
}
catch(const char * msg)
{
......
......@@ -6,17 +6,29 @@
#include <QtGui/QTreeWidget>
#include <QtGui/QComboBox>
#include <QtGui/QLabel>
#include <kdatewidget.h>
#include <QtGui/QCheckBox>
#include "conf/ConfigurationSkeleton.h"
HistoryDock::HistoryDock(QWidget* parent) : QDockWidget(parent)
{
m_pFilterLE = new KLineEdit();
m_pItemView = new QTreeWidget(this);
m_pSortByCBB = new QComboBox();
m_pSortByL = new QLabel();
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_pAllTimeCB->setChecked(ConfigurationSkeleton::displayDataRange());
m_pSortByL->setText("Sort by:");
m_pSortByCBB->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
QStringList sortBy;
sortBy << "Date" << "Name" << "Popularity";
m_pSortByCBB->addItems(sortBy);
QWidget* mainWidget = new QWidget(this);
setWidget(mainWidget);
......@@ -25,13 +37,31 @@ HistoryDock::HistoryDock(QWidget* parent) : QDockWidget(parent)
mainLayout->addWidget(m_pSortByL ,0,0 );
mainLayout->addWidget(m_pSortByCBB ,0,1 );
mainLayout->addWidget(m_pItemView ,1,0,1,2 );
mainLayout->addWidget(m_pFilterLE ,2,0,1,2 );
mainLayout->addWidget(m_pAllTimeCB ,1,0,1,2 );
mainLayout->addWidget(m_pFromL ,2,0,1,2 );
mainLayout->addWidget(m_pFromDW ,3,0,1,2 );
mainLayout->addWidget(m_pToL ,4,0,1,2 );
mainLayout->addWidget(m_pToDW ,5,0,1,2 );
mainLayout->addWidget(m_pItemView ,6,0,1,2 );
mainLayout->addWidget(m_pFilterLE ,7,0,1,2 );
setWindowTitle("History");
connect(m_pAllTimeCB,SIGNAL(toggled(bool)),this,SLOT(enableDateRange(bool)));
}
HistoryDock::~HistoryDock()
{
}
void HistoryDock::enableDateRange(bool enable)
{
m_pFromL->setVisible(enable);
m_pToL->setVisible(enable);
m_pFromDW->setVisible(enable);
m_pToDW->setVisible(enable);
ConfigurationSkeleton::setDisplayDataRange(enable);
}
\ No newline at end of file
......@@ -7,6 +7,8 @@ class QTreeWidget;
class KLineEdit;
class QComboBox;
class QLabel;
class KDateWidget;
class QCheckBox;
class HistoryDock : public QDockWidget {
Q_OBJECT
......@@ -18,6 +20,13 @@ private:
KLineEdit* m_pFilterLE;
QComboBox* m_pSortByCBB;
QLabel* m_pSortByL;
QLabel* m_pFromL;
QLabel* m_pToL;
KDateWidget* m_pFromDW;
KDateWidget* m_pToDW;
QCheckBox* m_pAllTimeCB;
public slots:
void enableDateRange(bool enable);
};
#endif
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment