summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLubos Dolezel <lubos@dolezel.info>2015-06-02 22:03:32 +0200
committerLubos Dolezel <lubos@dolezel.info>2015-06-02 22:03:32 +0200
commitf9183105745653ccdc137126aa8f4f1269014af2 (patch)
tree56c606a58849846ed7a2471bc3714bf226ae6ea1
parentbf8bdac13a2d399ddded91de4bfb05e8dad0a0c8 (diff)
downloadtwinkle-f9183105745653ccdc137126aa8f4f1269014af2.tar
twinkle-f9183105745653ccdc137126aa8f4f1269014af2.tar.gz
twinkle-f9183105745653ccdc137126aa8f4f1269014af2.tar.lz
twinkle-f9183105745653ccdc137126aa8f4f1269014af2.tar.xz
twinkle-f9183105745653ccdc137126aa8f4f1269014af2.zip
Ported getaddressform to Qt4
-rw-r--r--src/gui/CMakeLists.txt4
-rw-r--r--src/gui/addresslistviewitem.cpp41
-rw-r--r--src/gui/addresslistviewitem.h36
-rw-r--r--src/gui/addresstablemodel.cpp103
-rw-r--r--src/gui/addresstablemodel.h46
-rw-r--r--src/gui/getaddressform.cpp72
-rw-r--r--src/gui/getaddressform.h4
-rw-r--r--src/gui/getaddressform.ui799
8 files changed, 604 insertions, 501 deletions
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index 38b6c8c..b1e8926 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -55,7 +55,7 @@ qt4_wrap_cpp(twinkle_MOC
address_finder.h
qt_translator.h
core_strings.h
- addresslistviewitem.h
+ addresstablemodel.h
yesnodialog.h
command_args.h
messageformview.h
@@ -108,7 +108,7 @@ set(TWINKLE_GUI-SRCS
wizardform.cpp
address_finder.cpp
- addresslistviewitem.cpp
+ addresstablemodel.cpp
buddylistview.cpp
deregisterform.cpp
dtmfform.cpp
diff --git a/src/gui/addresslistviewitem.cpp b/src/gui/addresslistviewitem.cpp
deleted file mode 100644
index c757be0..0000000
--- a/src/gui/addresslistviewitem.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- Copyright (C) 2005-2009 Michel de Boer <michel@twinklephone.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include "addresslistviewitem.h"
-
-// Columns
-#define COL_ADDR_NAME 0
-#define COL_ADDR_PHONE 1
-#define COL_ADDR_REMARK 2
-
-AddressListViewItem::AddressListViewItem(Q3ListView *parent, const t_address_card &card) :
- Q3ListViewItem(parent, card.get_display_name().c_str(),
- card.sip_address.c_str(), card.remark.c_str()),
- address_card(card)
-{}
-
-t_address_card AddressListViewItem::getAddressCard(void) const {
- return address_card;
-}
-
-void AddressListViewItem::update(const t_address_card &card) {
- address_card = card;
- setText(COL_ADDR_NAME, card.get_display_name().c_str());
- setText(COL_ADDR_PHONE, card.sip_address.c_str());
- setText(COL_ADDR_REMARK, card.remark.c_str());
-}
diff --git a/src/gui/addresslistviewitem.h b/src/gui/addresslistviewitem.h
deleted file mode 100644
index c001943..0000000
--- a/src/gui/addresslistviewitem.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- Copyright (C) 2005-2009 Michel de Boer <michel@twinklephone.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef _ADDRESSLISTVIEWITEM_H
-#define _ADDRESSLISTVIEWITEM_H
-
-#include "address_book.h"
-#include "q3listview.h"
-
-class AddressListViewItem : public Q3ListViewItem {
-private:
- t_address_card address_card;
-
-public:
- AddressListViewItem(Q3ListView *parent, const t_address_card &card);
- t_address_card getAddressCard(void) const;
- void update(const t_address_card &card);
-};
-
-
-#endif
diff --git a/src/gui/addresstablemodel.cpp b/src/gui/addresstablemodel.cpp
new file mode 100644
index 0000000..2e7120c
--- /dev/null
+++ b/src/gui/addresstablemodel.cpp
@@ -0,0 +1,103 @@
+/*
+ Copyright (C) 2015 Lubos Dolezel <lubos@dolezel.info>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include "addresstablemodel.h"
+#include <QtDebug>
+
+// Columns
+#define COL_ADDR_NAME 0
+#define COL_ADDR_PHONE 1
+#define COL_ADDR_REMARK 2
+
+AddressTableModel::AddressTableModel(QObject *parent, const list<t_address_card>& data)
+ : QAbstractTableModel(parent)
+{
+ m_data = QList<t_address_card>::fromStdList(data);
+}
+
+int AddressTableModel::rowCount(const QModelIndex &parent) const
+{
+ return m_data.size();
+}
+
+int AddressTableModel::columnCount(const QModelIndex &parent) const
+{
+ return 3;
+}
+
+QVariant AddressTableModel::data(const QModelIndex &index, int role) const
+{
+ if (role != Qt::DisplayRole)
+ return QVariant();
+
+ const int row = index.row();
+ switch (index.column())
+ {
+ case COL_ADDR_NAME:
+ return QString::fromStdString(m_data[row].get_display_name());
+ case COL_ADDR_PHONE:
+ return QString::fromStdString(m_data[row].sip_address);
+ case COL_ADDR_REMARK:
+ return QString::fromStdString(m_data[row].remark);
+ default:
+ return QVariant();
+ }
+}
+
+QVariant AddressTableModel::headerData(int section, Qt::Orientation orientation, int role) const
+{
+ if (role != Qt::DisplayRole)
+ return QVariant();
+
+ switch (section)
+ {
+ case COL_ADDR_NAME:
+ return tr("Name");
+ case COL_ADDR_PHONE:
+ return tr("Phone");
+ case COL_ADDR_REMARK:
+ return tr("Remark");
+ default:
+ return QVariant();
+ }
+}
+
+void AddressTableModel::appendAddress(const t_address_card& card)
+{
+ qDebug() << "Appending contact" << QString::fromStdString(card.get_display_name());
+
+ beginInsertRows(QModelIndex(), m_data.size(), m_data.size());
+ m_data << card;
+ endInsertRows();
+}
+
+void AddressTableModel::removeAddress(int index)
+{
+ beginRemoveRows(QModelIndex(), index, index);
+
+ m_data.removeAt(index);
+
+ endRemoveRows();
+}
+
+void AddressTableModel::modifyAddress(int index, const t_address_card& card)
+{
+ m_data[index] = card;
+ emit dataChanged(createIndex(index, 0), createIndex(index, 2));
+}
+
diff --git a/src/gui/addresstablemodel.h b/src/gui/addresstablemodel.h
new file mode 100644
index 0000000..847ee05
--- /dev/null
+++ b/src/gui/addresstablemodel.h
@@ -0,0 +1,46 @@
+/*
+ Copyright (C) 2015 Lubos Dolezel <lubos@dolezel.info>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#ifndef _ADDRESSTABLEMODEL_H
+#define _ADDRESSTABLEMODEL_H
+
+#include "address_book.h"
+#include <QAbstractTableModel>
+#include <QList>
+
+class AddressTableModel : public QAbstractTableModel
+{
+private:
+ QList<t_address_card> m_data;
+
+public:
+ AddressTableModel(QObject *parent, const list<t_address_card>& data);
+ virtual int rowCount(const QModelIndex &parent) const;
+ virtual int columnCount(const QModelIndex &parent) const;
+ virtual QVariant data(const QModelIndex &index, int role) const;
+ virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+
+ void appendAddress(const t_address_card& card);
+ void removeAddress(int index);
+ void modifyAddress(int index, const t_address_card& card);
+
+ t_address_card getAddress(int index) { return m_data[index]; }
+};
+
+
+#endif
diff --git a/src/gui/getaddressform.cpp b/src/gui/getaddressform.cpp
index ec350e4..dd45263 100644
--- a/src/gui/getaddressform.cpp
+++ b/src/gui/getaddressform.cpp
@@ -21,7 +21,7 @@
#include "sys_settings.h"
#include "gui.h"
#include "address_book.h"
-#include "addresslistviewitem.h"
+#include "addresstablemodel.h"
#include "addresscardform.h"
#define TAB_KABC 0
#define TAB_LOCAL 1
@@ -45,6 +45,9 @@ GetAddressForm::GetAddressForm(QWidget *parent, const char *name, bool modal)
{
setupUi(this);
init();
+
+ m_model = new AddressTableModel(this, ab_local->get_address_list());
+ localListView->setModel(m_model);
}
GetAddressForm::~GetAddressForm()
@@ -67,7 +70,6 @@ void GetAddressForm::init()
addressTabWidget->setTabEnabled(tabKABC, false);
addressTabWidget->setCurrentPage(TAB_LOCAL);
#endif
- loadLocalAddresses();
}
void GetAddressForm::reload()
@@ -137,20 +139,6 @@ void GetAddressForm::loadAddresses()
#endif
}
-void GetAddressForm::loadLocalAddresses()
-{
- localListView->clear();
- const list<t_address_card> &address_list = ab_local->get_address_list();
-
- for(list<t_address_card>::const_iterator i = address_list.begin(); i != address_list.end(); i++)
- {
- new AddressListViewItem(localListView, *i);
- }
-
- Q3ListViewItem *first = localListView->firstChild();
- if (first) localListView->setSelected(first, true);
-}
-
void GetAddressForm::selectAddress()
{
if (addressTabWidget->currentPageIndex() == TAB_KABC) {
@@ -182,12 +170,12 @@ void GetAddressForm::selectKABCAddress()
void GetAddressForm::selectLocalAddress()
{
- AddressListViewItem *item = dynamic_cast<AddressListViewItem *>(
- localListView->selectedItem());
- if (item) {
- t_address_card card = item->getAddressCard();
- emit(card.get_display_name().c_str(), card.sip_address.c_str());
-
+ QModelIndexList sel = localListView->selectionModel()->selectedRows();
+ if (!sel.isEmpty())
+ {
+ t_address_card card = m_model->getAddress(sel[0].row());
+ emit(QString::fromStdString(card.get_display_name()), QString::fromStdString(card.sip_address));
+
// Signal display name and url combined.
t_display_url du(t_url(card.sip_address), card.get_display_name());
emit address(du.encode().c_str());
@@ -215,10 +203,11 @@ void GetAddressForm::toggleSipOnly(bool on)
void GetAddressForm::addLocalAddress()
{
t_address_card card;
- AddressCardForm f;
+ AddressCardForm f(this);
if (f.exec(card)) {
ab_local->add_address(card);
- new AddressListViewItem(localListView, card);
+
+ m_model->appendAddress(card);
string error_msg;
if (!ab_local->save(error_msg)) {
@@ -229,33 +218,34 @@ void GetAddressForm::addLocalAddress()
void GetAddressForm::deleteLocalAddress()
{
- AddressListViewItem *item = dynamic_cast<AddressListViewItem *>(
- localListView->selectedItem());
- if (item) {
- t_address_card card = item->getAddressCard();
- if (ab_local->del_address(card)) {
- delete item;
-
- string error_msg;
- if (!ab_local->save(error_msg)) {
- ui->cb_show_msg(error_msg, MSG_CRITICAL);
- }
+ QModelIndexList sel = localListView->selectionModel()->selectedRows();
+ if (sel.isEmpty())
+ return;
+
+ t_address_card card = m_model->getAddress(sel[0].row());
+
+ if (ab_local->del_address(card)) {
+ m_model->removeAddress(sel[0].row());
+
+ string error_msg;
+ if (!ab_local->save(error_msg)) {
+ ui->cb_show_msg(error_msg, MSG_CRITICAL);
}
}
}
void GetAddressForm::editLocalAddress()
{
- AddressListViewItem *item = dynamic_cast<AddressListViewItem *>(
- localListView->selectedItem());
- if (!item) return;
+ QModelIndexList sel = localListView->selectionModel()->selectedRows();
+ if (sel.isEmpty())
+ return;
- t_address_card oldCard = item->getAddressCard();
+ t_address_card oldCard = m_model->getAddress(sel[0].row());
t_address_card newCard = oldCard;
- AddressCardForm f;
+ AddressCardForm f(this);
if (f.exec(newCard)) {
if (ab_local->update_address(oldCard, newCard)) {
- item->update(newCard);
+ m_model->modifyAddress(sel[0].row(), newCard);
string error_msg;
if (!ab_local->save(error_msg)) {
diff --git a/src/gui/getaddressform.h b/src/gui/getaddressform.h
index c55ce06..7c480d1 100644
--- a/src/gui/getaddressform.h
+++ b/src/gui/getaddressform.h
@@ -3,6 +3,8 @@
#include "ui_getaddressform.h"
#include "user.h"
+class AddressTableModel;
+
class GetAddressForm : public QDialog, public Ui::GetAddressForm
{
Q_OBJECT
@@ -16,7 +18,6 @@ public slots:
void reload();
void show();
void loadAddresses();
- void loadLocalAddresses();
void selectAddress();
void selectKABCAddress();
void selectLocalAddress();
@@ -30,6 +31,7 @@ signals:
void address(const QString &);
private:
void *addrBook;
+ AddressTableModel* m_model;
};
#endif
diff --git a/src/gui/getaddressform.ui b/src/gui/getaddressform.ui
index e8c525a..c288384 100644
--- a/src/gui/getaddressform.ui
+++ b/src/gui/getaddressform.ui
@@ -1,388 +1,427 @@
<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0" stdsetdef="1">
- <author></author>
- <comment></comment>
- <exportmacro></exportmacro>
- <class>GetAddressForm</class>
- <widget class="QDialog" name="GetAddressForm">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>655</width>
- <height>474</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Twinkle - Select address</string>
- </property>
- <layout class="QVBoxLayout">
- <item>
- <widget class="QTabWidget" name="addressTabWidget">
- <property name="tabShape">
- <enum>QTabWidget::Rounded</enum>
- </property>
- <widget class="QWidget" name="tabKABC">
- <attribute name="title">
- <string>&amp;KAddressBook</string>
- </attribute>
- <layout class="QVBoxLayout">
- <item>
- <widget class="Q3ListView" name="addressListView">
- <property name="resizePolicy">
- <enum>Q3ScrollView::Manual</enum>
- </property>
- <property name="allColumnsShowFocus">
- <bool>true</bool>
- </property>
- <property name="showSortIndicator">
- <bool>true</bool>
- </property>
- <property name="itemMargin">
- <number>1</number>
- </property>
- <property name="resizeMode">
- <enum>Q3ListView::LastColumn</enum>
- </property>
- <property name="whatsThis" stdset="0">
- <string>This list of addresses is taken from &lt;b&gt;KAddressBook&lt;/b&gt;. Contacts for which you did not provide a phone number are not shown here. To add, delete or modify address information you have to use KAddressBook.</string>
- </property>
- <column>
- <property name="text">
- <string>Name</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizable">
- <bool>true</bool>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Type</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizable">
- <bool>true</bool>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Phone</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizable">
- <bool>true</bool>
- </property>
- </column>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout">
- <item>
- <widget class="QCheckBox" name="sipOnlyCheckBox">
- <property name="text">
- <string>&amp;Show only SIP addresses</string>
- </property>
- <property name="shortcut">
- <string>Alt+S</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>Check this option when you only want to see contacts with SIP addresses, i.e. starting with &quot;&lt;b&gt;sip:&lt;/b&gt;&quot;.</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="spacer16">
- <property name="sizeHint">
- <size>
- <width>201</width>
- <height>20</height>
- </size>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Expanding</enum>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout">
- <item>
- <widget class="QPushButton" name="reloadPushButton">
- <property name="text">
- <string>&amp;Reload</string>
- </property>
- <property name="shortcut">
- <string>Alt+R</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>Reload the list of addresses from KAddressbook.</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="spacer59">
- <property name="sizeHint">
- <size>
- <width>491</width>
- <height>20</height>
- </size>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Expanding</enum>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- </layout>
+<ui version="4.0">
+ <class>GetAddressForm</class>
+ <widget class="QDialog" name="GetAddressForm">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>655</width>
+ <height>474</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Twinkle - Select address</string>
+ </property>
+ <layout class="QVBoxLayout">
+ <item>
+ <widget class="QTabWidget" name="addressTabWidget">
+ <property name="tabShape">
+ <enum>QTabWidget::Rounded</enum>
+ </property>
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tabKABC">
+ <attribute name="title">
+ <string>&amp;KAddressBook</string>
+ </attribute>
+ <layout class="QVBoxLayout">
+ <item>
+ <widget class="QTableView" name="addressListView">
+ <property name="whatsThis">
+ <string>This list of addresses is taken from &lt;b&gt;KAddressBook&lt;/b&gt;. Contacts for which you did not provide a phone number are not shown here. To add, delete or modify address information you have to use KAddressBook.</string>
+ </property>
+ <property name="selectionMode">
+ <enum>QAbstractItemView::SingleSelection</enum>
+ </property>
+ <property name="selectionBehavior">
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ <property name="columnCount" stdset="0">
+ <number>3</number>
+ </property>
+ <property name="allColumnsShowFocus" stdset="0">
+ <bool>true</bool>
+ </property>
+ <property name="showSortIndicator" stdset="0">
+ <bool>true</bool>
+ </property>
+ <property name="itemMargin" stdset="0">
+ <number>1</number>
+ </property>
+ <attribute name="verticalHeaderVisible">
+ <bool>false</bool>
+ </attribute>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout">
+ <item>
+ <widget class="QCheckBox" name="sipOnlyCheckBox">
+ <property name="whatsThis">
+ <string>Check this option when you only want to see contacts with SIP addresses, i.e. starting with &quot;&lt;b&gt;sip:&lt;/b&gt;&quot;.</string>
+ </property>
+ <property name="text">
+ <string>&amp;Show only SIP addresses</string>
+ </property>
+ <property name="shortcut">
+ <string>Alt+S</string>
+ </property>
</widget>
- <widget class="QWidget" name="tabLocal">
- <attribute name="title">
- <string>&amp;Local address book</string>
- </attribute>
- <layout class="QVBoxLayout">
- <item>
- <widget class="Q3ListView" name="localListView">
- <property name="allColumnsShowFocus">
- <bool>true</bool>
- </property>
- <property name="showSortIndicator">
- <bool>true</bool>
- </property>
- <property name="resizeMode">
- <enum>Q3ListView::LastColumn</enum>
- </property>
- <property name="whatsThis" stdset="0">
- <string>Contacts in the local address book of Twinkle.</string>
- </property>
- <column>
- <property name="text">
- <string>Name</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizable">
- <bool>true</bool>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Phone</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizable">
- <bool>true</bool>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Remark</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizable">
- <bool>true</bool>
- </property>
- </column>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout">
- <item>
- <widget class="QPushButton" name="addPushButton">
- <property name="text">
- <string>&amp;Add</string>
- </property>
- <property name="shortcut">
- <string>Alt+A</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>Add a new contact to the local address book.</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="deletePushButton">
- <property name="text">
- <string>&amp;Delete</string>
- </property>
- <property name="shortcut">
- <string>Alt+D</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>Delete a contact from the local address book.</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="editPushButton">
- <property name="text">
- <string>&amp;Edit</string>
- </property>
- <property name="shortcut">
- <string>Alt+E</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>Edit a contact from the local address book.</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="spacer97">
- <property name="sizeHint">
- <size>
- <width>161</width>
- <height>20</height>
- </size>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Expanding</enum>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- </layout>
+ </item>
+ <item>
+ <spacer name="spacer16">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>201</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout">
+ <item>
+ <widget class="QPushButton" name="reloadPushButton">
+ <property name="whatsThis">
+ <string>Reload the list of addresses from KAddressbook.</string>
+ </property>
+ <property name="text">
+ <string>&amp;Reload</string>
+ </property>
+ <property name="shortcut">
+ <string>Alt+R</string>
+ </property>
</widget>
+ </item>
+ <item>
+ <spacer name="spacer59">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>491</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tabLocal">
+ <attribute name="title">
+ <string>&amp;Local address book</string>
+ </attribute>
+ <layout class="QVBoxLayout">
+ <item>
+ <widget class="QTableView" name="localListView">
+ <property name="whatsThis">
+ <string>Contacts in the local address book of Twinkle.</string>
+ </property>
+ <property name="selectionMode">
+ <enum>QAbstractItemView::SingleSelection</enum>
+ </property>
+ <property name="selectionBehavior">
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ <property name="columnCount" stdset="0">
+ <number>3</number>
+ </property>
+ <property name="allColumnsShowFocus" stdset="0">
+ <bool>true</bool>
+ </property>
+ <property name="showSortIndicator" stdset="0">
+ <bool>true</bool>
+ </property>
+ <attribute name="verticalHeaderVisible">
+ <bool>false</bool>
+ </attribute>
</widget>
- </item>
- <item>
+ </item>
+ <item>
<layout class="QHBoxLayout">
- <item>
- <spacer name="spacer5">
- <property name="sizeHint">
- <size>
- <width>378</width>
- <height>20</height>
- </size>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Expanding</enum>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="okPushButton">
- <property name="text">
- <string>&amp;OK</string>
- </property>
- <property name="shortcut">
- <string>Alt+O</string>
- </property>
- <property name="default">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="cancelPushButton">
- <property name="text">
- <string>&amp;Cancel</string>
- </property>
- <property name="shortcut">
- <string>Alt+C</string>
- </property>
- </widget>
- </item>
+ <item>
+ <widget class="QPushButton" name="addPushButton">
+ <property name="whatsThis">
+ <string>Add a new contact to the local address book.</string>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ <property name="shortcut">
+ <string>Alt+A</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="deletePushButton">
+ <property name="whatsThis">
+ <string>Delete a contact from the local address book.</string>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ <property name="shortcut">
+ <string>Alt+D</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="editPushButton">
+ <property name="whatsThis">
+ <string>Edit a contact from the local address book.</string>
+ </property>
+ <property name="text">
+ <string>&amp;Edit</string>
+ </property>
+ <property name="shortcut">
+ <string>Alt+E</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="spacer97">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>161</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
- </item>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout">
+ <item>
+ <spacer name="spacer5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>378</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="okPushButton">
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="shortcut">
+ <string>Alt+O</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cancelPushButton">
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="shortcut">
+ <string>Alt+C</string>
+ </property>
+ </widget>
+ </item>
</layout>
- </widget>
- <layoutdefault spacing="6" margin="11"/>
- <pixmapfunction></pixmapfunction>
- <tabstops>
- <tabstop>addressListView</tabstop>
- <tabstop>sipOnlyCheckBox</tabstop>
- <tabstop>reloadPushButton</tabstop>
- <tabstop>addressTabWidget</tabstop>
- <tabstop>localListView</tabstop>
- <tabstop>addPushButton</tabstop>
- <tabstop>deletePushButton</tabstop>
- <tabstop>editPushButton</tabstop>
- <tabstop>okPushButton</tabstop>
- <tabstop>cancelPushButton</tabstop>
- </tabstops>
- <includes>
- <include location="local">user.h</include>
- </includes>
- <connections>
- <connection>
- <sender>okPushButton</sender>
- <signal>clicked()</signal>
- <receiver>GetAddressForm</receiver>
- <slot>selectAddress()</slot>
- </connection>
- <connection>
- <sender>cancelPushButton</sender>
- <signal>clicked()</signal>
- <receiver>GetAddressForm</receiver>
- <slot>reject()</slot>
- </connection>
- <connection>
- <sender>addressListView</sender>
- <signal>doubleClicked(Q3ListViewItem*)</signal>
- <receiver>GetAddressForm</receiver>
- <slot>selectKABCAddress()</slot>
- </connection>
- <connection>
- <sender>sipOnlyCheckBox</sender>
- <signal>toggled(bool)</signal>
- <receiver>GetAddressForm</receiver>
- <slot>toggleSipOnly(bool)</slot>
- </connection>
- <connection>
- <sender>reloadPushButton</sender>
- <signal>clicked()</signal>
- <receiver>GetAddressForm</receiver>
- <slot>reload()</slot>
- </connection>
- <connection>
- <sender>localListView</sender>
- <signal>doubleClicked(Q3ListViewItem*)</signal>
- <receiver>GetAddressForm</receiver>
- <slot>selectLocalAddress()</slot>
- </connection>
- <connection>
- <sender>addPushButton</sender>
- <signal>clicked()</signal>
- <receiver>GetAddressForm</receiver>
- <slot>addLocalAddress()</slot>
- </connection>
- <connection>
- <sender>deletePushButton</sender>
- <signal>clicked()</signal>
- <receiver>GetAddressForm</receiver>
- <slot>deleteLocalAddress()</slot>
- </connection>
- <connection>
- <sender>editPushButton</sender>
- <signal>clicked()</signal>
- <receiver>GetAddressForm</receiver>
- <slot>editLocalAddress()</slot>
- </connection>
- </connections>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <tabstops>
+ <tabstop>addressListView</tabstop>
+ <tabstop>sipOnlyCheckBox</tabstop>
+ <tabstop>reloadPushButton</tabstop>
+ <tabstop>addressTabWidget</tabstop>
+ <tabstop>localListView</tabstop>
+ <tabstop>addPushButton</tabstop>
+ <tabstop>deletePushButton</tabstop>
+ <tabstop>editPushButton</tabstop>
+ <tabstop>okPushButton</tabstop>
+ <tabstop>cancelPushButton</tabstop>
+ </tabstops>
+ <includes>
+ <include location="local">user.h</include>
+ </includes>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>okPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>GetAddressForm</receiver>
+ <slot>selectAddress()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>496</x>
+ <y>458</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>cancelPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>GetAddressForm</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>583</x>
+ <y>458</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>addressListView</sender>
+ <signal>doubleClicked(QModelIndex)</signal>
+ <receiver>GetAddressForm</receiver>
+ <slot>selectKABCAddress()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>33</x>
+ <y>61</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>sipOnlyCheckBox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>GetAddressForm</receiver>
+ <slot>toggleSipOnly(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>34</x>
+ <y>365</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>reloadPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>GetAddressForm</receiver>
+ <slot>reload()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>34</x>
+ <y>392</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>addPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>GetAddressForm</receiver>
+ <slot>addLocalAddress()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>34</x>
+ <y>393</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>deletePushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>GetAddressForm</receiver>
+ <slot>deleteLocalAddress()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>121</x>
+ <y>393</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>editPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>GetAddressForm</receiver>
+ <slot>editLocalAddress()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>208</x>
+ <y>393</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>localListView</sender>
+ <signal>doubleClicked(QModelIndex)</signal>
+ <receiver>GetAddressForm</receiver>
+ <slot>selectLocalAddress()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>33</x>
+ <y>61</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
</ui>