Commit 33083583 authored by Emmanuel Lepage's avatar Emmanuel Lepage

Fix config skeleton

parent 228bcb73
......@@ -37,6 +37,7 @@
#include "lib/configurationmanager_interface_singleton.h"
#include "lib/Contact.h"
#include "AkonadiBackend.h"
#include "conf/ConfigurationSkeleton.h"
SFLPhone* SFLPhone::m_sApp = NULL;
......@@ -75,6 +76,8 @@ bool SFLPhone::initialize()
return false;
}
ConfigurationSkeleton::self();
//Keep these template paramater or the static attribute wont be share between this and the call view, they need to be
CallModel<CallTreeItem*,QTreeWidgetItem*>* histoModel = new CallModel<CallTreeItem*,QTreeWidgetItem*>(CallModel<CallTreeItem*,QTreeWidgetItem*>::History);
histoModel->initHistory();
......@@ -193,8 +196,8 @@ void SFLPhone::setupActions()
action_displayDialpad->setCheckable(true);
action_displayVolumeControls->setCheckable(true);
action_displayVolumeControls->setChecked(/*configurationManager.getVolumeControls()*/true);
action_displayDialpad->setChecked(/*configurationManager.getDialpad()*/true);
action_displayVolumeControls->setChecked(ConfigurationSkeleton::displayVolume());
action_displayDialpad->setChecked(ConfigurationSkeleton::displayDialpad());
action_accountCreationWizard = new KAction(i18n("Account creation wizard"), this);
connect(action_accept, SIGNAL(triggered()), m_pView , SLOT(accept() ));
......
......@@ -515,6 +515,7 @@ void SFLPhoneView::displayVolumeControls(bool checked)
void SFLPhoneView::displayDialpad(bool checked)
{
qDebug() << "Max res2: " << ConfigurationSkeleton::displayDialpad() << "\n\n\n\n\n\n";
ConfigurationSkeleton::setDisplayDialpad(checked);
updateDialpad();
}
......
......@@ -286,8 +286,9 @@ void ConfigurationSkeleton::writeConfig()
configurationManager.setHookSettings(hooksSettings);
qDebug() << "Finished to write config\n";*/
readConfig();
qDebug() << "Max res: " << displayDialpad() << "\n\n\n\n\n\n";
qDebug() << "Max res3: " << ConfigurationSkeletonBase::displayDialpad() << "\n\n\n\n\n\n";
ConfigurationSkeletonBase::writeConfig();
}
// QStringList ConfigurationSkeleton::activeCodecList() const
......@@ -299,3 +300,11 @@ void ConfigurationSkeleton::writeConfig()
// {
// codecListModel->setActiveCodecList(v);
// }
// void ConfigurationSkeleton::writeConfig()
// {
// qDebug() << "Max res4: " << displayDialpad() << "\n\n\n\n\n\n";
// qDebug() << "Max res5: " << ConfigurationSkeletonBase::displayDialpad() << "\n\n\n\n\n\n";
//
// ConfigurationSkeletonBase::writeConfig();
// }
\ No newline at end of file
......@@ -62,7 +62,6 @@ public:
*/
virtual void writeConfig();
static ConfigurationSkeleton * self();
//QStringList activeCodecList() const;
......
File=sflphone-client-kde.kcfg
ClassName=ConfigurationSkeletonBase
Singleton=true
File=sflphone-client-kde.kcfg
ClassName=ConfigurationSkeletonBase
Singleton=true
Mutators=true
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
<kcfg>
<kcfgfile name="ConfigDialogKDE" />
<kcfgfile/>
<group name="main">
<!-- General Settings -->
......
......@@ -60,8 +60,8 @@ int main(int argc, char **argv)
int retVal = app.exec();
ConfigurationSkeleton conf;
conf.writeConfig();
ConfigurationSkeleton* conf = ConfigurationSkeleton::self();
conf->writeConfig();
return retVal;
}
catch(const char * msg)
......
......@@ -83,6 +83,8 @@ ContactDock::ContactDock(QWidget* parent) : QDockWidget(parent)
m_pShowHistoCK->setChecked(ConfigurationSkeleton::displayContactCallHistory());
m_pShowHistoCK->setText("Display history");
setHistoryVisible(ConfigurationSkeleton::displayContactCallHistory());
QVBoxLayout* mainLayout = new QVBoxLayout(mainWidget);
mainLayout->addWidget ( m_pSortByCBB );
......@@ -98,7 +100,7 @@ ContactDock::ContactDock(QWidget* parent) : QDockWidget(parent)
connect (AkonadiBackend::getInstance(),SIGNAL(collectionChanged()), this, SLOT(reloadContact() ));
connect (m_pContactView, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),this, SLOT(loadContactHistory(QTreeWidgetItem*) ));
connect (m_pFilterLE, SIGNAL(textChanged(QString)), this, SLOT(filter(QString) ));
connect (m_pShowHistoCK, SIGNAL(toggled(bool)), m_pCallView, SLOT(setVisible(bool) ));
connect (m_pShowHistoCK, SIGNAL(toggled(bool)), this, SLOT(setHistoryVisible(bool) ));
setWindowTitle("Contact");
}
......@@ -208,4 +210,11 @@ bool ContactTree::dropMimeData(QTreeWidgetItem *parent, int index, const QMimeDa
qDebug() << "In history import"<< QString(encodedData);
return false;
}
void ContactDock::setHistoryVisible(bool visible)
{
qDebug() << "Toggling history visibility";
m_pCallView->setVisible(visible);
ConfigurationSkeleton::setDisplayContactCallHistory(visible);
}
\ No newline at end of file
......@@ -38,6 +38,7 @@ private slots:
void reloadContact();
void loadContactHistory(QTreeWidgetItem* item);
void filter(QString text);
void setHistoryVisible(bool visible);
};
class ContactTree : public QTreeWidget {
......
......@@ -52,6 +52,7 @@ HistoryDock::HistoryDock(QWidget* parent) : QDockWidget(parent)
m_pLinkPB = new QPushButton(this);
m_pAllTimeCB->setChecked(ConfigurationSkeleton::displayDataRange());
enableDateRange(ConfigurationSkeleton::displayDataRange());
m_pSortByL->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Preferred);
m_pSortByCBB->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
......
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