#include <QtCore/QCoreApplication>
#include <QDebug>
+#include <QInputDialog>
#include "listitemdetaildelegate.h"
m_elv1db->m_type_query = 0;
+ m_in_search = false;
+ m_type_query_temp = 0;
+
connect(m_elv1db, SIGNAL(group_by_finished()), this, SLOT(elv1db_finised()));
connect(m_elv1db, SIGNAL(detail_finished()), this, SLOT(elv1db_detail_finised()));
connect(m_elv1db, SIGNAL(start_indicator()), this, SLOT(start_indicator()));
delete this->m_contacts_widget;
delete this->m_contact_detail;
delete this->m_elv1db;
+ delete this->m_no_search;
}
void MainWindow::cellClicked(int row, int col){
(t_cache.year()!=ef->get_startdate().year()) ){
QListWidgetItem *header = new QListWidgetItem();
- header->setData(Qt::DisplayRole, ef->get_startdate().toString());
+ header->setData(Qt::DisplayRole, ef->get_startdate().toString().toUtf8());
m_contact_detail->addItem(header);
t_cache=ef->get_startdate();
connect(m_clear_log,SIGNAL(triggered()), this, SLOT(clearLog()));
connect(m_options, SIGNAL(triggered()), this, SLOT(dlgOptions()));*/
+ QAction *m_search = this->menuBar()->addAction("Search");
+ connect(m_search,SIGNAL(triggered()), this, SLOT(dlgSearch()));
+
+ m_no_search = this->menuBar()->addAction("Search is Off");
+ connect(m_no_search,SIGNAL(triggered()), this, SLOT(noSearch()));
+
QAction *m_about = this->menuBar()->addAction("About");
QAction *m_about_qt = this->menuBar()->addAction("About Qt");
}
+void MainWindow::noSearch(){
+ if (m_in_search){
+ m_contacts_widget->setEnabled(false);
+ m_no_search->setText("Search is Off");
+ m_elv1db->m_type_query = m_type_query_temp;
+ m_in_search = false;
+ m_elv1db->start();
+ }
+}
+
+void MainWindow::dlgSearch(){
+ bool ok;
+ QString text = QInputDialog::getText(this, tr("Search"),
+ tr("Give me a contact name to do a search :"), QLineEdit::Normal,
+ *m_elv1db->m_search_val, &ok);
+ if (ok && !text.isEmpty() && !text.trimmed().isEmpty()){
+ m_no_search->setText("Search is On");
+ m_in_search = true;
+ this->doSearch(text);
+ }
+}
+
+void MainWindow::doSearch(QString val){
+ m_contacts_widget->setEnabled(false);
+ *m_elv1db->m_search_val = val;
+ m_elv1db->m_type_query = 2;
+ m_elv1db->start();
+}
+
void MainWindow::select_all_call(){ //ring/tel/ring, spirit/skype, gabble/jabber
m_contacts_widget->setEnabled(false);
m_elv1db->m_all_call = true;
+ m_type_query_temp = 0;
m_elv1db->start();
}
void MainWindow::select_gsm_calls(){ //ring/tel/ring
m_contacts_widget->setEnabled(false);
m_elv1db->m_all_call = false;
+ m_type_query_temp = 0;
m_elv1db->start();
}
m_about.setWindowTitle("About");
m_about.setText(
"<font size=4>VN Call History</font><br>"
- "<font size=3>Version : 0.0.1 (09/28/2011)</font><br>"
+ "<font size=3>Version : 0.0.2 (09/29/2011)</font><br>"
"Author : Cuong Le <a href=\"mailto:metacuong@gmail.com\">metacuong@gmail.com</a><br>"
"<font size=2>"
"Homepage : <a href=\"http://vncallhistory.garage.maemo.org/\">http://vncallhistory.garage.maemo.org/</a><br>"