From eed01f610f39cf3e4e64401dd2dcb36bb9b5e806 Mon Sep 17 00:00:00 2001 From: Jonathan Marten Date: Fri, 10 Apr 2009 16:24:18 +0000 Subject: [PATCH] Ensure that the default for "Use custom templates in this folder" is off. Make the "Insert command" button in the templates dialogue into a proper menu button, using QPushButton::setMenu(). Eliminate "No newline at end of file" warning for stringutil.h CCBUG:184307 svn path=/trunk/KDE/kdepim/; revision=951937 --- stringutil.h | 2 +- templatesconfiguration_kfg.kcfg | 1 + templatesinsertcommand.cpp | 14 ++++---------- templatesinsertcommand.h | 1 - 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/stringutil.h b/stringutil.h index 2aad08c75..6b10e9355 100644 --- a/stringutil.h +++ b/stringutil.h @@ -158,4 +158,4 @@ namespace StringUtil } -#endif \ No newline at end of file +#endif diff --git a/templatesconfiguration_kfg.kcfg b/templatesconfiguration_kfg.kcfg index 9cee9e497..b7dc8ea33 100644 --- a/templatesconfiguration_kfg.kcfg +++ b/templatesconfiguration_kfg.kcfg @@ -9,6 +9,7 @@ + false diff --git a/templatesinsertcommand.cpp b/templatesinsertcommand.cpp index 60f38e97c..efdcff9ed 100644 --- a/templatesinsertcommand.cpp +++ b/templatesinsertcommand.cpp @@ -33,9 +33,7 @@ TemplatesInsertCommand::TemplatesInsertCommand( QWidget *parent, const char *nam : QPushButton( parent ) { setObjectName( name ); - setText( i18n( "&Insert Command..." ) ); - connect( this, SIGNAL( clicked() ), - this, SLOT( slotClicked() ) ); + setText( i18n( "&Insert Command" ) ); KAction *action; KActionMenu *menu; @@ -44,7 +42,7 @@ TemplatesInsertCommand::TemplatesInsertCommand( QWidget *parent, const char *nam connect( mapper, SIGNAL( mapped(int) ), this, SLOT( slotMapped(int) ) ); - mMenu = new KActionMenu( i18n( "Insert Command..." ), this ); + mMenu = new KActionMenu( i18n( "Insert Command" ), this ); // ****************************************************** menu = new KActionMenu( i18n( "Original Message" ), mMenu ); @@ -371,16 +369,12 @@ TemplatesInsertCommand::TemplatesInsertCommand( QWidget *parent, const char *nam connect(action,SIGNAL(triggered(bool)),mapper,SLOT(map())); mapper->setMapping( action, CDebugOff ); menu->addAction( action ); -} -TemplatesInsertCommand::~TemplatesInsertCommand() -{ + setMenu( mMenu->menu() ); } -void TemplatesInsertCommand::slotClicked() +TemplatesInsertCommand::~TemplatesInsertCommand() { - QSize ps = mMenu->menu()->sizeHint(); - mMenu->menu()->popup( mapToGlobal( QPoint( 0, -(ps.height()) ) ) ); } void TemplatesInsertCommand::slotMapped( int cmd ) diff --git a/templatesinsertcommand.h b/templatesinsertcommand.h index 60e4381e9..867762319 100644 --- a/templatesinsertcommand.h +++ b/templatesinsertcommand.h @@ -50,7 +50,6 @@ class TemplatesInsertCommand : public QPushButton void insertCommand( const QString& cmd, int adjustCursor = 0 ); public slots: - void slotClicked(); void slotMapped( int cmd ); protected: