summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp2
-rw-r--r--microkde/kdecore/klocale.cpp2
-rw-r--r--microkde/kresources/configpage.cpp7
-rw-r--r--microkde/kresources/configwidget.h2
4 files changed, 5 insertions, 8 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index e88706e..505cbf4 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1749,193 +1749,193 @@ void KABCore::initGUI()
ExportMenu = new QPopupMenu( this );
syncMenu = new QPopupMenu( this );
changeMenu= new QPopupMenu( this );
beamMenu= new QPopupMenu( this );
//US since we have no splitter for the embedded system, setup
// a layout with two frames. One left and one right.
QBoxLayout *topLayout;
// = new QHBoxLayout( this );
// QBoxLayout *topLayout = (QBoxLayout*)layout();
// QWidget *mainBox = new QWidget( this );
// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox);
#ifdef DESKTOP_VERSION
topLayout = new QHBoxLayout( this );
mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
topLayout->addWidget(mMiniSplitter );
mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter );
mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
mViewManager = new ViewManager( this, mExtensionBarSplitter );
mDetails = new ViewContainer( mMiniSplitter );
mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
#else
if ( QApplication::desktop()->width() > 480 ) {
topLayout = new QHBoxLayout( this );
mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
} else {
topLayout = new QHBoxLayout( this );
mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this);
mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
}
topLayout->addWidget(mMiniSplitter );
mViewManager = new ViewManager( this, mMiniSplitter );
mDetails = new ViewContainer( mMiniSplitter );
mExtensionManager = new ExtensionManager( this, mMiniSplitter );
#endif
//eh->hide();
// topLayout->addWidget(mExtensionManager );
/*US
#ifndef KAB_NOSPLITTER
QHBoxLayout *topLayout = new QHBoxLayout( this );
//US topLayout->setSpacing( KDialogBase::spacingHint() );
topLayout->setSpacing( 10 );
mDetailsSplitter = new QSplitter( this );
QVBox *viewSpace = new QVBox( mDetailsSplitter );
mViewManager = new ViewManager( this, viewSpace );
viewSpace->setStretchFactor( mViewManager, 1 );
mDetails = new ViewContainer( mDetailsSplitter );
topLayout->addWidget( mDetailsSplitter );
topLayout->setStretchFactor( mDetailsSplitter, 100 );
#else //KAB_NOSPLITTER
QHBoxLayout *topLayout = new QHBoxLayout( this );
//US topLayout->setSpacing( KDialogBase::spacingHint() );
topLayout->setSpacing( 10 );
// mDetailsSplitter = new QSplitter( this );
QVBox *viewSpace = new QVBox( this );
mViewManager = new ViewManager( this, viewSpace );
viewSpace->setStretchFactor( mViewManager, 1 );
mDetails = new ViewContainer( this );
topLayout->addWidget( viewSpace );
// topLayout->setStretchFactor( mDetailsSplitter, 100 );
topLayout->addWidget( mDetails );
#endif //KAB_NOSPLITTER
*/
syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
syncManager->setBlockSave(false);
connect(syncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
QString sync_file = sentSyncFile();
- qDebug("KABCore::initGUI()::setting tmp sync file to:%s ",sync_file.latin1());
+ //qDebug("KABCore::initGUI()::setting tmp sync file to:%s ",sync_file.latin1());
syncManager->setDefaultFileName( sync_file );
//connect(syncManager , SIGNAL( ), this, SLOT( ) );
#endif //KAB_EMBEDDED
initActions();
#ifdef KAB_EMBEDDED
addActionsManually();
//US make sure the export and import menues are initialized before creating the xxPortManager.
mXXPortManager = new XXPortManager( this, this );
// LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() );
//mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget);
// mActionQuit->plug ( mMainWindow->toolBar());
//mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() );
//mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget);
// mIncSearchWidget->hide();
connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
SLOT( incrementalSearch( const QString& ) ) );
connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) );
connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) );
mJumpButtonBar = new JumpButtonBar( this, this );
topLayout->addWidget( mJumpButtonBar );
//US topLayout->setStretchFactor( mJumpButtonBar, 10 );
// mMainWindow->getIconToolBar()->raise();
#endif //KAB_EMBEDDED
}
void KABCore::initActions()
{
//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
#ifndef KAB_EMBEDDED
connect( QApplication::clipboard(), SIGNAL( dataChanged() ),
SLOT( clipboardDataChanged() ) );
#endif //KAB_EMBEDDED
// file menu
mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() );
//mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() );
mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager,
SLOT( printView() ), actionCollection(), "kaddressbook_print" );
mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails,
SLOT( printView() ), actionCollection(), "kaddressbook_print2" );
mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this,
SLOT( save() ), actionCollection(), "file_sync" );
mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this,
SLOT( newContact() ), actionCollection(), "file_new_contact" );
mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0,
this, SLOT( mailVCard() ),
actionCollection(), "file_mail_vcard");
mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this,
SLOT( export2phone() ), actionCollection(),
"kaddressbook_ex2phone" );
mActionBeamVCard = 0;
mActionBeam = 0;
#ifndef DESKTOP_VERSION
if ( Ir::supported() ) {
mActionBeamVCard = new KAction( i18n( "Beam v&Card(s)..." ), "beam", 0, this,
SLOT( beamVCard() ), actionCollection(),
"kaddressbook_beam_vcard" );
mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this,
SLOT( beamMySelf() ), actionCollection(),
"kaddressbook_beam_myself" );
}
#endif
mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0,
this, SLOT( editContact2() ),
actionCollection(), "file_properties" );
#ifdef KAB_EMBEDDED
// mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() );
mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0,
mMainWindow, SLOT( exit() ),
actionCollection(), "quit" );
#endif //KAB_EMBEDDED
// edit menu
if ( mIsPart ) {
mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this,
SLOT( copyContacts() ), actionCollection(),
diff --git a/microkde/kdecore/klocale.cpp b/microkde/kdecore/klocale.cpp
index aec74fa..7f31ab1 100644
--- a/microkde/kdecore/klocale.cpp
+++ b/microkde/kdecore/klocale.cpp
@@ -1,107 +1,107 @@
#include <qregexp.h>
#include <qapplication.h>
#include "kdebug.h"
#include "kcalendarsystemgregorian.h"
#include "klocale.h"
#include <qstringlist.h>
-#define COLLECT_TRANSLATION
+//#define COLLECT_TRANSLATION
QDict<QString> *mLocaleDict = 0;
void setLocaleDict( QDict<QString> * dict )
{
mLocaleDict = dict;
}
#ifdef COLLECT_TRANSLATION
QStringList missingTrans;
QStringList existingTrans1;
QStringList existingTrans2;
void addMissing(const char *text)
{
QString mis ( text );
if ( !missingTrans.contains( mis ) )
missingTrans.append(mis);
}
void addExist(const char *text,QString trans )
{
//return;
QString mis ( text );
if ( !existingTrans1.contains( mis ) ) {
existingTrans1.append(mis);
existingTrans2.append(trans);
}
}
#include <qfile.h>
#include <qtextstream.h>
#include <qtextcodec.h>
#endif
void dumpMissing()
{
#ifdef COLLECT_TRANSLATION
QString fileName = "/tmp/usernewtrans.txt";
QFile file( fileName );
if (!file.open( IO_WriteOnly ) ) {
return ;
}
QTextStream ts( &file );
ts.setCodec( QTextCodec::codecForName("utf8") );
int i;
for ( i = 0; i< missingTrans.count(); ++i ) {
QString text = missingTrans[i].replace( QRegExp("\n"),"\\n" );
ts << "{ \""<<text<< "\",\""<< text <<"\" },\n";
}
file.close();
{
QString fileName = "/tmp/usertrans.txt";
QFile file( fileName );
if (!file.open( IO_WriteOnly ) ) {
return ;
}
QTextStream ts( &file );
ts.setCodec( QTextCodec::codecForName("utf8") );
int i;
for ( i = 0; i< existingTrans1.count(); ++i ) {
QString text = existingTrans1[i].replace( QRegExp("\n"),"\\n" );
QString text2 = existingTrans2[i].replace( QRegExp("\n"),"\\n" );
ts << "{ \""<<text<< "\",\""<< text2 <<"\" },\n";
}
file.close();
}
#endif
}
QString i18n(const char *text)
{
if ( ! mLocaleDict ) {
#ifdef COLLECT_TRANSLATION
addMissing( text );
#endif
return QString( text );
}
else {
QString* ret = mLocaleDict->find(QString(text)) ;
if ( ret == 0 ) {
#ifdef COLLECT_TRANSLATION
addMissing( text );
#endif
return QString( text );
}
else {
diff --git a/microkde/kresources/configpage.cpp b/microkde/kresources/configpage.cpp
index 533be51..011e47e 100644
--- a/microkde/kresources/configpage.cpp
+++ b/microkde/kresources/configpage.cpp
@@ -364,170 +364,167 @@ void ConfigPage::slotRemove()
QListViewItem *item = mListView->currentItem();
ConfigViewItem *confItem = static_cast<ConfigViewItem*>( item );
if ( !confItem )
return;
if ( confItem->standard() ) {
KMessageBox::sorry( this, i18n( "You cannot remove your standard resource!\n Please select a new standard resource first." ) );
return;
}
mCurrentManager->remove( confItem->resource() );
if ( item == mLastItem )
mLastItem = 0;
mListView->takeItem( item );
delete item;
emit changed( true );
}
void ConfigPage::slotEdit()
{
if ( !mCurrentManager )
return;
QListViewItem *item = mListView->currentItem();
ConfigViewItem *configItem = static_cast<ConfigViewItem*>( item );
if ( !configItem )
return;
Resource *resource = configItem->resource();
ConfigDialog dlg( this, mFamily, resource, "KRES::ConfigDialog" );
if ( dlg.exec() ) {
configItem->setText( 0, resource->resourceName() );
configItem->setText( 1, resource->type() );
if ( configItem->standard() && configItem->readOnly() ) {
KMessageBox::sorry( this, i18n( "You cannot use a read-only<br> resource as standard!" ) );
configItem->setStandard( false );
}
mCurrentManager->resourceChanged( resource );
emit changed( true );
}
}
void ConfigPage::slotStandard()
{
if ( !mCurrentManager )
return;
ConfigViewItem *item = static_cast<ConfigViewItem*>( mListView->currentItem() );
if ( !item )
return;
if ( item->readOnly() ) {
KMessageBox::sorry( this, i18n( "You cannot use a read-only<br>resource as standard!" ) );
return;
}
if ( !item->isOn() ) {
KMessageBox::sorry( this, i18n( "You cannot use an inactive<br>resource as standard!" ) );
return;
}
QListViewItem *it = mListView->firstChild();
while ( it != 0 ) {
ConfigViewItem *configItem = static_cast<ConfigViewItem*>( it );
if ( configItem->standard() )
configItem->setStandard( false );
it = it->itemBelow();
}
item->setStandard( true );
mCurrentManager->setStandardResource( item->resource() );
emit changed( true );
}
void ConfigPage::slotSelectionChanged()
{
bool state = ( mListView->currentItem() != 0 );
mRemoveButton->setEnabled( state );
mEditButton->setEnabled( state );
mStandardButton->setEnabled( state );
}
void ConfigPage::resourceAdded( Resource* resource )
{
qDebug("ConfigPage::resourceAdded : %s", resource->resourceName().latin1());
- kdDebug(5650) << "ConfigPage::resourceAdded( " << resource->resourceName() << " )" << endl;
ConfigViewItem *item = new ConfigViewItem( mListView, resource );
// FIXME: this sucks. This should be in the config file,
// or application-dependent, in which case it's always Off
item->setOn( false );
mLastItem = item;
emit changed( true );
}
void ConfigPage::resourceModified( Resource* resource )
{
qDebug("ConfigPage::resourceModified : %s", resource->resourceName().latin1());
- kdDebug(5650) << "ConfigPage::resourceModified( " << resource->resourceName() << " )" << endl;
}
void ConfigPage::resourceDeleted( Resource* resource )
{
qDebug("ConfigPage::resourceDeleted : %s", resource->resourceName().latin1());
- kdDebug(5650) << "ConfigPage::resourceDeleted( " << resource->resourceName() << " )" << endl;
}
void ConfigPage::slotItemClicked( QListViewItem *item )
{
ConfigViewItem *configItem = static_cast<ConfigViewItem *>( item );
if ( !configItem ) return;
if ( configItem->standard() && !configItem->isOn() ) {
KMessageBox::sorry( this, i18n( "You cannot deactivate the<br>standard resource. Choose<br>another standard resource first." ) );
configItem->setOn( true );
return;
}
if ( configItem->isOn() != configItem->resource()->isActive() ) {
emit changed( true );
}
}
void ConfigPage::saveResourceSettings()
{
- qDebug("ConfigPage::saveResourceSettings() begin");
+ //qDebug("ConfigPage::saveResourceSettings() begin");
if ( mCurrentManager ) {
QListViewItem *item = mListView->firstChild();
while ( item ) {
ConfigViewItem *configItem = static_cast<ConfigViewItem*>( item );
// check if standard resource
if ( configItem->standard() && !configItem->readOnly() &&
configItem->isOn() ) {
mCurrentManager->setStandardResource( configItem->resource() );
}
// check if active or passive resource
configItem->resource()->setActive( configItem->isOn() );
item = item->nextSibling();
}
mCurrentManager->writeConfig( mCurrentConfig );
if ( !mCurrentManager->standardResource() )
KMessageBox::sorry( this, i18n( "There is no valid standard resource!<br>Please select one which is neither read-only nor inactive." ) );
}
- qDebug("ConfigPage::saveResourceSettings() end");
+ //qDebug("ConfigPage::saveResourceSettings() end");
}
//US #include "configpage.moc"
diff --git a/microkde/kresources/configwidget.h b/microkde/kresources/configwidget.h
index b97e278..aecdda9 100644
--- a/microkde/kresources/configwidget.h
+++ b/microkde/kresources/configwidget.h
@@ -1,61 +1,61 @@
/*
This file is part of libkresources.
Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef KRESOURCES_CONFIGWIDGET_H
#define KRESOURCES_CONFIGWIDGET_H
#include <qwidget.h>
#include <kconfig.h>
#include "resource.h"
namespace KRES {
class ConfigWidget : public QWidget
{
Q_OBJECT
public:
ConfigWidget( QWidget *parent = 0, const char *name = 0 );
/**
Sets the widget to 'edit' mode. Reimplement this method if you are
interested in the mode change (to disable some GUI element for
example). By default the widget is in 'create new' mode.
*/
virtual void setInEditMode( bool value );
public slots:
virtual void loadSettings( Resource *resource );
virtual void saveSettings( Resource *resource );
signals:
void setReadOnly( bool value );
void setPersistentReadOnly( bool value );
-
+ void setIncludeInSync(bool);
protected:
Resource* mResource;
};
}
#endif