[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/pim/kcall/kcall
From: Tobias Hunger <tobias.hunger () basyskom ! de>
Date: 2007-07-23 12:08:09
Message-ID: 1185192489.915073.9488.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 691315 by hunger:
Small fixes to make things work again after the architecture rework.
M +19 -22 kcallcore.cpp
M +8 -8 kcallcore.h
M +2 -2 kcallmainwindow.cpp
M +13 -20 kcallview.cpp
M +2 -3 kcallview.h
M +9 -9 kcallview.ui
M +9 -4 main.cpp
--- trunk/playground/pim/kcall/kcall/kcallcore.cpp #691314:691315
@@ -30,6 +30,8 @@
#include <kxmlguiclient.h>
#include <kcmdlineargs.h>
+#include <Decibel/Types>
+
#include "kcallview.h"
#include "kcallcore.h"
@@ -37,16 +39,18 @@
KCallCore::KCallCore( KXMLGUIClient *client, bool readWrite, QWidget *parent,
const QString &file, const char *name )
- : mGUIClient( client ), mStatusBar( 0 ),
+ : mGUIClient( client ), mStatusBar( 0 ),
mReadWrite( readWrite ), mModified( false )
{
+ Decibel::registerTypes();
setObjectName( name );
-
+
mWidget = new QWidget( parent );
mWidget->setObjectName( name );
-
+
mIsPart = (strcmp(parent->metaObject()->className(), "KCallMainWindow") );
+ initGUI();
}
KCallCore::~KCallCore()
@@ -56,24 +60,16 @@
KAboutData *KCallCore::createAboutData()
{
- KAboutData *about = new KAboutData( "kaddressbook", 0, ki18n( "KAddressBook" ),
- "3.5", ki18n( "The KDE Address Book" ),
- KAboutData::License_GPL_V2,
- ki18n( "(c) 1997-2005, The \
KDE PIM Team" ) );
- about->addAuthor( ki18n("Tobias Koenig"), ki18n( "Current maintainer" ), \
"tokoe@kde.org" );
- about->addAuthor( ki18n("Don Sanders"), ki18n( "Original author" ) );
- about->addAuthor( ki18n("Cornelius Schumacher"),
- ki18n( "Co-maintainer, libkabc port, CSV import/export" ),
- "schumacher@kde.org" );
- about->addAuthor( ki18n("Mike Pilone"), ki18n( "GUI and framework redesign" ),
- "mpilone@slac.com" );
- about->addAuthor( ki18n("Greg Stern"), ki18n( "DCOP interface" ) );
- about->addAuthor( ki18n("Mark Westcott"), ki18n( "Contact pinning" ) );
- about->addAuthor( ki18n("Mischel Boyer de la Giroday"), ki18n( "LDAP Lookup" ),
- "michel@klaralvdalens-datakonsult.se" );
- about->addAuthor( ki18n("Steffen Hansen"), ki18n( "LDAP Lookup" ),
- "hansen@kde.org" );
+ KAboutData *about = new KAboutData( "KCall", 0, ki18n( "KCall" ),
+ "0.7.0",
+ ki18n( "The KCall phone application"),
+ KAboutData::License_GPL_V2,
+ ki18n( "(c) 2005, Mike Hauth" ) );
+ about->addAuthor( ki18n("Eva Brucherseifer"), ki18n("Developer"), \
"eva.brucherseifer@basyskom.de" ); + about->addAuthor( ki18n("Mike Hauth"), \
ki18n("Initial version"), "mike@mike-hauth.de" ); + about->addAuthor( \
ki18n("Tobias Hunger"), ki18n("Developer"), "tobias.hunger@basyskom.de" ); +
return about;
}
@@ -187,9 +183,10 @@
QVBoxLayout *topLayout = new QVBoxLayout( mWidget );
topLayout->setSpacing( 0 );
topLayout->setMargin( 0 );
-
+
KCallView* callview = new KCallView( mWidget );
callview->setObjectName("call view");
+ topLayout->addWidget(callview);
//connect( mDetails, SIGNAL( addressClicked( const QString&) ),
// this, SLOT( showContactsAddress( const QString& ) ) );
@@ -226,8 +223,8 @@
connect(mActionEditAddressee, SIGNAL(triggered(bool) ), SLOT( editContact() ));
mActionEditAddressee->setWhatsThis( i18n( "Edit a contact<p>You will be \
presented with a dialog where you can change all data about a person, including \
addresses and phone numbers." ) );
*/
-
+
// settings menu
if ( mIsPart )
{
--- trunk/playground/pim/kcall/kcall/kcallcore.h #691314:691315
@@ -16,7 +16,7 @@
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
+
#ifndef KCALLCORE_H
#define KCALLCORE_H
@@ -41,15 +41,15 @@
/** Returns parent widget */
virtual QWidget *widget() const;
-
+
static KAboutData* createAboutData();
-
+
void setStatusBar( KStatusBar *statusBar );
KStatusBar *statusBar() const;
void setModified();
void setModified( bool modified );
bool modified() const;
-
+
void restoreSettings();
void saveSettings();
KConfig *config() const;
@@ -62,18 +62,18 @@
protected:
void initGUI();
void initActions();
-
+
QWidget *mWidget;
KStatusBar *mStatusBar;
-
+
bool mReadWrite;
bool mModified;
bool mIsPart;
-
+
QAction *mActionSave;
-
+
private:
KXMLGUIClient *mGUIClient;
--- trunk/playground/pim/kcall/kcall/kcallmainwindow.cpp #691314:691315
@@ -17,7 +17,7 @@
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
+
#include <klocale.h>
#include <kstatusbar.h>
#include <kstandardaction.h>
@@ -60,7 +60,7 @@
setStandardToolBarMenuEnabled( true );
- createGUI( "kaddressbookui.rc" );
+// createGUI( "kaddressbookui.rc" );
resize( 400, 300 ); // initial size
setAutoSaveSettings();
--- trunk/playground/pim/kcall/kcall/kcallview.cpp #691314:691315
@@ -35,13 +35,13 @@
#include "vcardview.h"
#include "kcallsettings.h"
-#include "historyprovider.h"
+#include "historymodel.h"
//#include "kcallsipsettings.h"
KCallView::KCallView(QWidget *parent)
: QWidget(parent),
- m_historyProvider(0)
+ m_historyModel(0)
{
ui.setupUi(this);
@@ -85,20 +85,14 @@
updatePhonebookView();
connect(ab, SIGNAL(addressBookChanged(AddressBook*)), this, \
SLOT(updatePhonebookView()));
- //init historyListView
+ //init historyTableView
/** @todo port to decibel history api and/or save length in local settings*/
/*
KCallSipSettings::self()->config()->setGroup("CallLists");
m_historyProvider = new HistoryProvider(KCallSipSettings::maxLength());
*/
- m_historyProvider = new HistoryProvider(this);
- ui.historyListView->addColumn("Contact");
- ui.historyListView->addColumn("Type");
- ui.historyListView->addColumn("Date");
- ui.historyListView->addColumn("Duration");
- ui.historyListView->addColumn("callId",0);
- hLCallNrCol = ui.historyListView->addColumn("CallNr",0);
- setHistoryList();
+ m_historyModel = new HistoryModel(this);
+ ui.historyTableView->setModel(m_historyModel);
QVBoxLayout* vCardLayout = new QVBoxLayout( ui.info );
vCardLayout->setObjectName( "vCardLayout" );
@@ -122,8 +116,6 @@
connect( ui.phonebookList, SIGNAL(clicked(Q3ListViewItem*)), this, \
SLOT(setVCard(Q3ListViewItem*)));
connect( m_vcardView, SIGNAL( phoneNumberClicked(QString& )), this, SLOT( \
dialByInput(const QString&)));
connect( ui.acceptButton, SIGNAL(clicked()), this, SLOT(decideAcceptAction()));
-
- connect( m_historyProvider, SIGNAL(updateHistory()), this, \
SLOT(setHistoryList())); }
KCallView::~KCallView()
@@ -224,7 +216,6 @@
ui.activeCallListView->takeItem(selectedCalls.at(i));
}
- setHistoryList();
}
void KCallView::hangupCall()
@@ -246,7 +237,6 @@
ui.activeCallListView->takeItem(selectedCalls.at(i));
}
- setHistoryList();
}
void KCallView::cancelCall(QString callId)
@@ -261,8 +251,6 @@
if(call != 0)
ui.activeCallListView->takeItem(call);
-
- setHistoryList();
}
void KCallView::setCallStatus(QString callid, CallStatus status)
@@ -313,6 +301,8 @@
}
}
+#if 0
+// @todo: get the information gathered here into the historyTableView!
void KCallView::setHistoryList()
{
kDebug() << "KCallView::setHistoryList()" << endl;
@@ -385,6 +375,7 @@
tmp->setPixmap(1, statusPix[int(status)]);
}
}
+#endif
KABC::Addressee KCallView::getPersonFromNumber(QString phoneNumber)
{
@@ -446,13 +437,14 @@
QString phoneNr = "";
if(item != NULL )
{
+#if 0
if(item == ui.activeCallListView->selectedItem())
{
phoneNr = item->text(actCallNrCol);
ui.phonebookList->clearSelection();
- ui.historyListView->clearSelection();
+ ui.historyTableView->clearSelection();
}else
- if(item == ui.historyListView->selectedItem())
+ if(item == ui.historyTableView->selectedItem())
{
phoneNr = item->text(hLCallNrCol);
ui.activeCallListView->clearSelection();
@@ -462,8 +454,9 @@
{
phoneNr = item->text(pbLCallNrCol);
ui.activeCallListView->clearSelection();
- ui.historyListView->clearSelection();
+ ui.historyTableView->clearSelection();
}
+#endif
}
KABC::Addressee person = getPersonFromNumber(phoneNr);
--- trunk/playground/pim/kcall/kcall/kcallview.h #691314:691315
@@ -36,7 +36,7 @@
#include <kabc/addressee.h>
class Q3ListViewItem;
-class HistoryProvider;
+class HistoryModel;
struct KCALL_EXPORT CallDesc
{
@@ -67,7 +67,6 @@
void setCallStatus(QString callid, CallStatus status);
void updatePhonebookView();
void kCallStatus(bool online);
- void setHistoryList();
void setVCard(Q3ListViewItem* item);
void setDialTab();
void setButtonsActCalls();
@@ -87,7 +86,7 @@
QPixmap statusPix[STATUS_MAX];
VCardView *m_vcardView;
- HistoryProvider * m_historyProvider;
+ HistoryModel * m_historyModel;
KABC::AddressBook* ab;
QMap <QString, CallDesc> callsInList;
--- trunk/playground/pim/kcall/kcall/kcallview.ui #691314:691315
@@ -168,11 +168,11 @@
</widget>
</item>
<item>
- <widget class="KHistoryComboBox" name="nrInput" >
- <property name="duplicatesEnabled" >
+ <widget class="KHistoryComboBox" native="1" name="nrInput" >
+ <property name="duplicatesEnabled" stdset="0" >
<bool>false</bool>
</property>
- <property name="autoCompletion" >
+ <property name="autoCompletion" stdset="0" >
<bool>true</bool>
</property>
</widget>
@@ -293,7 +293,7 @@
<number>0</number>
</property>
<item>
- <widget class="K3ListView" name="historyListView" />
+ <widget class="QTableView" name="historyTableView" />
</item>
</layout>
</widget>
@@ -313,15 +313,15 @@
<header>k3listview.h</header>
</customwidget>
<customwidget>
- <class>KHistoryComboBox</class>
- <extends>KComboBox</extends>
- <header>khistorycombobox.h</header>
- </customwidget>
- <customwidget>
<class>K3ListViewSearchLine</class>
<extends>QWidget</extends>
<header>k3listviewsearchline.h</header>
</customwidget>
+ <customwidget>
+ <class>KHistoryComboBox</class>
+ <extends>QWidget</extends>
+ <header>khistorycombobox.h</header>
+ </customwidget>
</customwidgets>
<includes>
<include location="global" >k3listviewsearchline.h</include>
--- trunk/playground/pim/kcall/kcall/main.cpp #691314:691315
@@ -36,6 +36,7 @@
#include <kstartupinfo.h>
#include <kuniqueapplication.h>
#include <kwindowsystem.h>
+#include <kcmdlineargs.h>
#include "kcallmainwindow.h"
//#include "kaddressbook_options.h"
@@ -49,8 +50,6 @@
return options;
}
-
-
class KCallApp : public KUniqueApplication {
public:
KCallApp() : mMainWin( 0 ), mDefaultIsOpen( false ) {}
@@ -74,6 +73,7 @@
mMainWin->restore( 1 );
}
} else {
+#if 0
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
if ( args->isSet( "editor-only" ) ) {
@@ -101,8 +101,13 @@
if ( file.isEmpty() ) mDefaultIsOpen = true;
}
}
-
mMainWin->handleCommandLine();
+#else
+ mMainWin = new KCallMainWindow();
+ setMainWidget( mMainWin );
+ mMainWin->show();
+ mMainWin->restore( 0 );
+#endif
}
// Handle startup notification and window activation
@@ -112,7 +117,7 @@
static bool firstInstance = true;
if ( !firstInstance )
- KStartupInfo::setNewStartupId( mMainWin, kapp->startupId() );
+ { KStartupInfo::setNewStartupId( mMainWin, kapp->startupId() ); }
firstInstance = false;
#endif
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic