summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Side-by-side diff
Diffstat (limited to 'kaddressbook') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp3
-rw-r--r--kaddressbook/viewmanager.cpp2
-rw-r--r--kaddressbook/views/colorlistbox.cpp7
-rw-r--r--kaddressbook/views/colorlistbox.h1
-rw-r--r--kaddressbook/views/configurecardviewdialog.cpp4
-rw-r--r--kaddressbook/views/configuretableviewdialog.cpp4
6 files changed, 18 insertions, 3 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 5ef61b1..e34951a 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -378,49 +378,49 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
#ifndef KAB_EMBEDDED
connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
mXXPortManager, SLOT( importVCard( const KURL& ) ) );
connect( mDetails, SIGNAL( browse( const QString& ) ),
SLOT( browse( const QString& ) ) );
mAddressBookService = new KAddressBookService( this );
#endif //KAB_EMBEDDED
mMessageTimer = new QTimer( this );
connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) );
mEditorDialog = 0;
createAddresseeEditorDialog( this );
setModified( false );
mBRdisabled = false;
#ifndef DESKTOP_VERSION
infrared = 0;
#endif
//toggleBeamReceive( );
- //mMainWindow->toolBar()->show();
+ mMainWindow->toolBar()->show();
// we have a toolbar repainting error on the Zaurus when starting KA/Pi
QTimer::singleShot( 10, this , SLOT ( updateToolBar()));
}
void KABCore::updateToolBar()
{
static int iii = 0;
++iii;
mMainWindow->toolBar()->repaintMe();
if ( iii < 4 )
QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar()));
}
KABCore::~KABCore()
{
// save();
//saveSettings();
//KABPrefs::instance()->writeConfig();
delete AddresseeConfig::instance();
mAddressBook = 0;
KABC::StdAddressBook::close();
delete syncManager;
#ifndef DESKTOP_VERSION
if ( infrared )
@@ -2152,48 +2152,49 @@ void KABCore::addActionsManually()
mIncSearchWidget = new IncSearchWidget( tb );
// tb->insertWidget(-1, 0, mIncSearchWidget);
#ifndef DESKTOP_VERSION
} else {
//US setup toolbar
QPEMenuBar *menuBarTB = new QPEMenuBar( tb );
QPopupMenu *popupBarTB = new QPopupMenu( this );
menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB);
tb->insertWidget(-1, 0, menuBarTB);
mIncSearchWidget = new IncSearchWidget( tb );
tb->enableMoving(false);
popupBarTB->insertItem( i18n("&File"), fileMenu );
popupBarTB->insertItem( i18n("&Edit"), editMenu );
popupBarTB->insertItem( i18n("&View"), viewMenu );
popupBarTB->insertItem( i18n("&Settings"), settingsMenu );
popupBarTB->insertItem( i18n("Synchronize"), syncMenu );
mViewManager->getFilterAction()->plug ( popupBarTB);
//popupBarTB->insertItem( i18n("&Change selected"), changeMenu );
popupBarTB->insertItem( i18n("&Help"), helpMenu );
if (QApplication::desktop()->width() > 320 ) {
// mViewManager->getFilterAction()->plug ( tb);
}
}
#endif
+ mIncSearchWidget->setSize();
// mActionQuit->plug ( mMainWindow->toolBar());
//US Now connect the actions with the menue entries.
#ifdef DESKTOP_VERSION
mActionPrint->plug( fileMenu );
mActionPrintDetails->plug( fileMenu );
fileMenu->insertSeparator();
#endif
mActionMail->plug( fileMenu );
fileMenu->insertSeparator();
mActionNewContact->plug( editMenu );
mActionNewContact->plug( tb );
mActionEditAddressee->plug( editMenu );
editMenu->insertSeparator();
// if ((KGlobal::getDesktopSize() > KGlobal::Small ) ||
// (!KABPrefs::instance()->mMultipleViewsAtOnce ))
mActionEditAddressee->plug( tb );
// fileMenu->insertSeparator();
mActionSave->plug( fileMenu );
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index 86f0f3d..0614d06 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -683,49 +683,49 @@ void ViewManager::initActions()
#else //KAB_EMBEDDED
action->plug(viewmenu);
#endif //KAB_EMBEDDED
mActionDeleteView = new KAction( i18n( "Delete View" ), "view_remove", 0,
this, SLOT( deleteView() ),
mCore->actionCollection(), "view_delete" );
#ifndef KAB_EMBEDDED
mActionDeleteView->setWhatsThis( i18n( "By pressing this button you can delete the actual view, which you have added before." ) );
#else //KAB_EMBEDDED
mActionDeleteView->plug(viewmenu);
viewmenu->insertSeparator();
#endif //KAB_EMBEDDED
#ifndef KAB_EMBEDDED
action = new KAction( i18n( "Refresh View" ), "reload", 0, this,
SLOT( refreshView(const QString &) ), mCore->actionCollection(),
"view_refresh" );
action->setWhatsThis( i18n( "The view will be refreshed by pressing this button." ) );
#else //KAB_EMBEDDED
action = new KAction( i18n( "Refresh View" ), "reload", 0, this,
SLOT( refreshView()), mCore->actionCollection(),
"view_refresh" );
action->plug(viewmenu);
- viewmenu->insertSeparator();
+ //viewmenu->insertSeparator();
#endif //KAB_EMBEDDED
action = new KAction( i18n( "Edit &Filters..." ), "filter", 0, this,
SLOT( configureFilters() ), mCore->actionCollection(),
"options_edit_filters" );
mActionSelectFilter = new KSelectAction( i18n( "Select Filter" ), "filter", mCore->actionCollection(), "select_filter" );
#if KDE_VERSION >= 309
mActionSelectFilter->setMenuAccelsEnabled( false );
#endif
connect( mActionSelectFilter, SIGNAL( activated( int ) ),
SLOT( setActiveFilter( int ) ) );
#ifdef KAB_EMBEDDED
action->plug(settingsmenu);
mActionSelectFilter->plug(viewmenu,0);
#endif //KAB_EMBEDDED
}
void ViewManager::initGUI()
{
QHBoxLayout *layout = new QHBoxLayout( this, 0, 0 );
mViewWidgetStack = new QWidgetStack( this );
diff --git a/kaddressbook/views/colorlistbox.cpp b/kaddressbook/views/colorlistbox.cpp
index c243fa0..7386207 100644
--- a/kaddressbook/views/colorlistbox.cpp
+++ b/kaddressbook/views/colorlistbox.cpp
@@ -11,91 +11,96 @@
* 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 <qpainter.h>
#include <kcolordialog.h>
#ifndef KAB_EMBEDDED
#include <kcolordrag.h>
#endif //KAB_EMBEDDED
#include "colorlistbox.h"
ColorListBox::ColorListBox( QWidget *parent, const char *name, WFlags f )
:KListBox( parent, name, f ), mCurrentOnDragEnter(-1)
{
connect( this, SIGNAL(selected(int)), this, SLOT(newColor(int)) );
+ connect( this, SIGNAL(clicked(QListBoxItem *)), this, SLOT(slotNewColor(QListBoxItem *)) );
setAcceptDrops( true);
}
void ColorListBox::setEnabled( bool state )
{
if( state == isEnabled() )
{
return;
}
QListBox::setEnabled( state );
for( uint i=0; i<count(); i++ )
{
updateItem( i );
}
}
void ColorListBox::setColor( uint index, const QColor &color )
{
if( index < count() )
{
ColorListItem *colorItem = (ColorListItem*)item(index);
colorItem->setColor(color);
updateItem( colorItem );
}
}
QColor ColorListBox::color( uint index ) const
{
if( index < count() )
{
ColorListItem *colorItem = (ColorListItem*)item(index);
return( colorItem->color() );
}
else
{
return( black );
}
}
-
+void ColorListBox::slotNewColor(QListBoxItem * i)
+{
+ if ( i )
+ newColor( index( i ) );
+}
void ColorListBox::newColor( int index )
{
if( isEnabled() == false )
{
return;
}
if( (uint)index < count() )
{
QColor c = color( index );
#ifndef KAB_EMBEDDED
if( KColorDialog::getColor( c, this ) != QDialog::Rejected )
{
setColor( index, c );
}
#else //KAB_EMBEDDED
KColorDialog* k = new KColorDialog( this );
k->setColor( c );
int res = k->exec();
if ( res ) {
setColor( index, k->getColor() );
}
delete k;
diff --git a/kaddressbook/views/colorlistbox.h b/kaddressbook/views/colorlistbox.h
index 4a0e705..bb91484 100644
--- a/kaddressbook/views/colorlistbox.h
+++ b/kaddressbook/views/colorlistbox.h
@@ -27,48 +27,49 @@ class QDragEnterEvent;
class QDragLeaveEvent;
class QDragMoveEvent;
class QDropEvent;
class ColorListBox : public KListBox
{
Q_OBJECT
public:
ColorListBox( QWidget *parent=0, const char * name=0, WFlags f=0 );
void setColor( uint index, const QColor &color );
QColor color( uint index ) const;
public slots:
virtual void setEnabled( bool state );
protected:
void dragEnterEvent( QDragEnterEvent *e );
void dragLeaveEvent( QDragLeaveEvent *e );
void dragMoveEvent( QDragMoveEvent *e );
void dropEvent( QDropEvent *e );
private slots:
void newColor( int index );
+ void slotNewColor(QListBoxItem * i);
private:
int mCurrentOnDragEnter;
};
class ColorListItem : public QListBoxItem
{
public:
ColorListItem( const QString &text, const QColor &color=Qt::black );
const QColor &color( void );
void setColor( const QColor &color );
protected:
virtual void paint( QPainter * );
virtual int height( const QListBox * ) const;
virtual int width( const QListBox * ) const;
private:
QColor mColor;
int mBoxWidth;
};
diff --git a/kaddressbook/views/configurecardviewdialog.cpp b/kaddressbook/views/configurecardviewdialog.cpp
index 366e54c..e0fbd21 100644
--- a/kaddressbook/views/configurecardviewdialog.cpp
+++ b/kaddressbook/views/configurecardviewdialog.cpp
@@ -194,53 +194,57 @@ void CardViewLookNFeelPage::setTextFont()
bool ok;
QFont fout = KFontDialog::getFont( f, ok);
if ( ok )
updateFontLabel( fout, lTextFont );
#endif //KAB_EMBEDDED
}
void CardViewLookNFeelPage::setHeaderFont()
{
QFont f( lHeaderFont->font() );
#ifndef KAB_EMBEDDED
if ( KFontDialog::getFont( f,false, this ) == QDialog::Accepted )
updateFontLabel( f, lHeaderFont );
#else //KAB_EMBEDDED
bool ok;
QFont fout = KFontDialog::getFont( f, ok);
if ( ok )
updateFontLabel( fout, lHeaderFont );
#endif //KAB_EMBEDDED
}
void CardViewLookNFeelPage::enableFonts()
{
vbFonts->setEnabled( cbEnableCustomFonts->isChecked() );
+ if ( cbEnableCustomFonts->isChecked() )
+ vbFonts->setFocus();
}
void CardViewLookNFeelPage::enableColors()
{
lbColors->setEnabled( cbEnableCustomColors->isChecked() );
+ if ( cbEnableCustomColors->isChecked() )
+ lbColors->setFocus();
}
void CardViewLookNFeelPage::initGUI()
{
int spacing = KDialog::spacingHint();
int margin = KDialog::marginHint();
QTabWidget *tabs = new QTabWidget( this );
// Layout
QVBox *loTab = new QVBox( this, "layouttab" );
loTab->setSpacing( spacing );
loTab->setMargin( margin );
QGroupBox *gbGeneral = new QGroupBox( 1, Qt::Horizontal, i18n("General"), loTab );
cbDrawSeps = new QCheckBox( i18n("Draw &separators"), gbGeneral );
QHBox *hbSW = new QHBox( gbGeneral );
QLabel *lSW = new QLabel( i18n("Separator &width:"), hbSW );
sbSepWidth = new QSpinBox( 1, 50, 1, hbSW );
lSW->setBuddy( sbSepWidth);
diff --git a/kaddressbook/views/configuretableviewdialog.cpp b/kaddressbook/views/configuretableviewdialog.cpp
index 8bcceb2..0e36abd 100644
--- a/kaddressbook/views/configuretableviewdialog.cpp
+++ b/kaddressbook/views/configuretableviewdialog.cpp
@@ -189,53 +189,57 @@ void LookAndFeelPage::setTextFont()
bool ok;
QFont fout = KFontDialog::getFont( f, ok);
if ( ok )
updateFontLabel( fout, lTextFont );
#endif //KAB_EMBEDDED
}
void LookAndFeelPage::setHeaderFont()
{
QFont f( lHeaderFont->font() );
#ifndef KAB_EMBEDDED
if ( KFontDialog::getFont( f,false, this ) == QDialog::Accepted )
updateFontLabel( f, lHeaderFont );
#else //KAB_EMBEDDED
bool ok;
QFont fout = KFontDialog::getFont( f, ok);
if ( ok )
updateFontLabel( fout, lHeaderFont );
#endif //KAB_EMBEDDED
}
void LookAndFeelPage::enableFonts()
{
vbFonts->setEnabled( cbEnableCustomFonts->isChecked() );
+ if ( cbEnableCustomFonts->isChecked() )
+ vbFonts->setFocus();
}
void LookAndFeelPage::enableColors()
{
lbColors->setEnabled( cbEnableCustomColors->isChecked() );
+ if ( cbEnableCustomColors->isChecked() )
+ lbColors->setFocus();
}
void LookAndFeelPage::initGUI()
{
int spacing = KDialog::spacingHint();
int margin = KDialog::marginHint();
QTabWidget *tabs = new QTabWidget( this );
// General
QVBox *generalTab = new QVBox( this, "generaltab" );
generalTab->setSpacing( spacing );
generalTab->setMargin( margin );
QButtonGroup *group = new QButtonGroup(1, Qt::Horizontal,
i18n("Row Separator"), generalTab);
mAlternateButton = new QRadioButton(i18n("Alternating backgrounds"),
group, "mAlternateButton");
mLineButton = new QRadioButton(i18n("Single line"), group, "mLineButton");
mNoneButton = new QRadioButton(i18n("None"), group, "mNoneButton");
mBackgroundBox = new QCheckBox(i18n("Enable background image:"), generalTab,