@ -27,8 +27,8 @@
# include <kexipart.h>
# include <kexipart.h>
# include <kexiactioncategories.h>
# include <kexiactioncategories.h>
# include < k listview.h>
# include < tde listview.h>
# include < k action.h>
# include < tde action.h>
# include <kiconloader.h>
# include <kiconloader.h>
# include <kdebug.h>
# include <kdebug.h>
# include <kstdguiitem.h>
# include <kstdguiitem.h>
@ -41,7 +41,7 @@
# include <tqtooltip.h>
# include <tqtooltip.h>
# include <tqwidgetstack.h>
# include <tqwidgetstack.h>
# include <widget/utils/ k listviewitemtemplate.h>
# include <widget/utils/ tde listviewitemtemplate.h>
# include <widget/kexibrowser.h>
# include <widget/kexibrowser.h>
# include <widget/kexibrowseritem.h>
# include <widget/kexibrowseritem.h>
# include <kexiutils/utils.h>
# include <kexiutils/utils.h>
@ -194,7 +194,7 @@ public:
TQListViewItem * item = new ActionSelectorDialogListItem ( " noaction " , this , i18n ( " No action " ) ) ;
TQListViewItem * item = new ActionSelectorDialogListItem ( " noaction " , this , i18n ( " No action " ) ) ;
const TQPixmap noIcon ( KexiUtils : : emptyIcon ( KIcon : : Small ) ) ;
const TQPixmap noIcon ( KexiUtils : : emptyIcon ( KIcon : : Small ) ) ;
item - > setPixmap ( 0 , noIcon ) ;
item - > setPixmap ( 0 , noIcon ) ;
item = new ActionSelectorDialogListItem ( " k action" , this , i18n ( " Application actions " ) ) ;
item = new ActionSelectorDialogListItem ( " tde action" , this , i18n ( " Application actions " ) ) ;
item - > setPixmap ( 0 , SmallIcon ( " form_action " ) ) ;
item - > setPixmap ( 0 , SmallIcon ( " form_action " ) ) ;
KexiPart : : PartInfoList * pl = Kexi : : partManager ( ) . partInfoList ( ) ;
KexiPart : : PartInfoList * pl = Kexi : : partManager ( ) . partInfoList ( ) ;
@ -331,7 +331,7 @@ class KexiActionSelectionDialog::KexiActionSelectionDialogPrivate
{
{
public :
public :
KexiActionSelectionDialogPrivate ( )
KexiActionSelectionDialogPrivate ( )
: kactionPageWidget( 0 ) , k actionListView( 0 ) , objectsListView ( 0 )
: tdeactionPageWidget( 0 ) , tde actionListView( 0 ) , objectsListView ( 0 )
, currentFormActionsPageWidget ( 0 )
, currentFormActionsPageWidget ( 0 )
, currentFormActionsListView ( 0 )
, currentFormActionsListView ( 0 )
, secondAnd3rdColumnMainWidget ( 0 )
, secondAnd3rdColumnMainWidget ( 0 )
@ -376,8 +376,8 @@ public:
KexiMainWindow * mainWin ;
KexiMainWindow * mainWin ;
TQString actionWidgetName ;
TQString actionWidgetName ;
ActionCategoriesListView * actionCategoriesListView ; //!< for column #1
ActionCategoriesListView * actionCategoriesListView ; //!< for column #1
TQWidget * k actionPageWidget;
TQWidget * tde actionPageWidget;
TDEActionsListView * k actionListView; //!< for column #2
TDEActionsListView * tde actionListView; //!< for column #2
KexiBrowser * objectsListView ; //!< for column #2
KexiBrowser * objectsListView ; //!< for column #2
TQWidget * currentFormActionsPageWidget ; //!< for column #2
TQWidget * currentFormActionsPageWidget ; //!< for column #2
CurrentFormActionsListView * currentFormActionsListView ; //!< for column #2
CurrentFormActionsListView * currentFormActionsListView ; //!< for column #2
@ -419,9 +419,9 @@ KexiActionSelectionDialog::KexiActionSelectionDialog(KexiMainWindow* mainWin, TQ
\ ______________________________________________ /
\ ______________________________________________ /
glyr
glyr
[ a ] - TQWidgetStack * secondAnd3rdColumnStack ,
[ a ] - TQWidgetStack * secondAnd3rdColumnStack ,
- for displaying TDEActions , the stack contains d - > k actionPageWidget TQWidget
- for displaying TDEActions , the stack contains d - > tde actionPageWidget TQWidget
- for displaying objects , the stack contains secondAnd3rdColumnMainWidget TQWidget and TQGridLayout * secondAnd3rdColumnGrLyr
- for displaying objects , the stack contains secondAnd3rdColumnMainWidget TQWidget and TQGridLayout * secondAnd3rdColumnGrLyr
- k actionPageWidget contains only a TQVBoxLayout and label + k actionListView
- tde actionPageWidget contains only a TQVBoxLayout and label + tde actionListView
*/
*/
d - > glyr = new TQGridLayout ( mainWidget , 2 , 2 , KDialog : : marginHint ( ) , KDialog : : spacingHint ( ) ) ;
d - > glyr = new TQGridLayout ( mainWidget , 2 , 2 , KDialog : : marginHint ( ) , KDialog : : spacingHint ( ) ) ;
d - > glyr - > setRowStretch ( 1 , 1 ) ;
d - > glyr - > setRowStretch ( 1 , 1 ) ;
@ -495,9 +495,9 @@ KexiActionSelectionDialog::KexiActionSelectionDialog(KexiMainWindow* mainWin, TQ
KexiPart : : Info * partInfo = action . decodeString ( actionType , actionArg , ok ) ;
KexiPart : : Info * partInfo = action . decodeString ( actionType , actionArg , ok ) ;
if ( ok ) {
if ( ok ) {
d - > actionCategoriesListView - > selectAction ( actionType ) ;
d - > actionCategoriesListView - > selectAction ( actionType ) ;
if ( actionType = = " k action" ) {
if ( actionType = = " tde action" ) {
d - > k actionListView- > selectAction ( actionArg ) ;
d - > tde actionListView- > selectAction ( actionArg ) ;
d - > k actionListView- > setFocus ( ) ;
d - > tde actionListView- > setFocus ( ) ;
}
}
else if ( actionType = = " currentForm " ) {
else if ( actionType = = " currentForm " ) {
d - > currentFormActionsListView - > selectAction ( actionArg ) ;
d - > currentFormActionsListView - > selectAction ( actionArg ) ;
@ -574,34 +574,34 @@ void KexiActionSelectionDialog::slotActionToExecuteItemSelected(TQListViewItem*)
void KexiActionSelectionDialog : : slotActionCategorySelected ( TQListViewItem * item )
void KexiActionSelectionDialog : : slotActionCategorySelected ( TQListViewItem * item )
{
{
ActionSelectorDialogListItem * simpleItem = dynamic_cast < ActionSelectorDialogListItem * > ( item ) ;
ActionSelectorDialogListItem * simpleItem = dynamic_cast < ActionSelectorDialogListItem * > ( item ) ;
// simple case: part-less item, e.g. k action:
// simple case: part-less item, e.g. tde action:
if ( simpleItem ) {
if ( simpleItem ) {
d - > updateSelectActionToBeExecutedMessage ( simpleItem - > data ) ;
d - > updateSelectActionToBeExecutedMessage ( simpleItem - > data ) ;
TQString selectActionToBeExecutedMsg (
TQString selectActionToBeExecutedMsg (
i18n ( " &Select action to be executed after clicking \" %1 \" button: " ) ) ; // msg for a label
i18n ( " &Select action to be executed after clicking \" %1 \" button: " ) ) ; // msg for a label
if ( simpleItem - > data = = " k action" ) {
if ( simpleItem - > data = = " tde action" ) {
if ( ! d - > k actionPageWidget) {
if ( ! d - > tde actionPageWidget) {
//create lbl+list view with a vlayout
//create lbl+list view with a vlayout
d - > k actionPageWidget = new TQWidget ( ) ;
d - > tde actionPageWidget = new TQWidget ( ) ;
d - > k actionPageWidget- > setSizePolicy ( TQSizePolicy : : Minimum , TQSizePolicy : : Minimum ) ;
d - > tde actionPageWidget- > setSizePolicy ( TQSizePolicy : : Minimum , TQSizePolicy : : Minimum ) ;
TQVBoxLayout * vlyr = new TQVBoxLayout ( d - > k actionPageWidget, 0 , KDialog : : spacingHint ( ) ) ;
TQVBoxLayout * vlyr = new TQVBoxLayout ( d - > tde actionPageWidget, 0 , KDialog : : spacingHint ( ) ) ;
d - > k actionListView = new TDEActionsListView ( d - > k actionPageWidget, d - > mainWin ) ;
d - > tde actionListView = new TDEActionsListView ( d - > tde actionPageWidget, d - > mainWin ) ;
d - > k actionListView- > init ( ) ;
d - > tde actionListView- > init ( ) ;
TQLabel * lbl = new TQLabel ( d - > k actionListView, selectActionToBeExecutedMsg . arg ( d - > actionWidgetName ) ,
TQLabel * lbl = new TQLabel ( d - > tde actionListView, selectActionToBeExecutedMsg . arg ( d - > actionWidgetName ) ,
d - > k actionPageWidget) ;
d - > tde actionPageWidget) ;
lbl - > setAlignment ( TQt : : AlignTop | TQt : : AlignLeft | TQt : : WordBreak ) ;
lbl - > setAlignment ( TQt : : AlignTop | TQt : : AlignLeft | TQt : : WordBreak ) ;
lbl - > setMinimumHeight ( lbl - > fontMetrics ( ) . height ( ) * 2 ) ;
lbl - > setMinimumHeight ( lbl - > fontMetrics ( ) . height ( ) * 2 ) ;
vlyr - > addWidget ( lbl ) ;
vlyr - > addWidget ( lbl ) ;
vlyr - > addWidget ( d - > k actionListView) ;
vlyr - > addWidget ( d - > tde actionListView) ;
d - > secondAnd3rdColumnStack - > addWidget ( d - > k actionPageWidget) ;
d - > secondAnd3rdColumnStack - > addWidget ( d - > tde actionPageWidget) ;
connect ( d - > k actionListView, TQT_SIGNAL ( executed ( TQListViewItem * ) ) ,
connect ( d - > tde actionListView, TQT_SIGNAL ( executed ( TQListViewItem * ) ) ,
this , TQT_SLOT ( slotTDEActionItemExecuted ( TQListViewItem * ) ) ) ;
this , TQT_SLOT ( slotTDEActionItemExecuted ( TQListViewItem * ) ) ) ;
connect ( d - > k actionListView, TQT_SIGNAL ( selectionChanged ( TQListViewItem * ) ) ,
connect ( d - > tde actionListView, TQT_SIGNAL ( selectionChanged ( TQListViewItem * ) ) ,
this , TQT_SLOT ( slotTDEActionItemSelected ( TQListViewItem * ) ) ) ;
this , TQT_SLOT ( slotTDEActionItemSelected ( TQListViewItem * ) ) ) ;
}
}
d - > setActionToExecuteSectionVisible ( false ) ;
d - > setActionToExecuteSectionVisible ( false ) ;
d - > raiseWidget ( d - > k actionPageWidget) ;
d - > raiseWidget ( d - > tde actionPageWidget) ;
slotTDEActionItemSelected ( d - > k actionListView- > selectedItem ( ) ) ; //to refresh column #3
slotTDEActionItemSelected ( d - > tde actionListView- > selectedItem ( ) ) ; //to refresh column #3
}
}
else if ( simpleItem - > data = = " currentForm " ) {
else if ( simpleItem - > data = = " currentForm " ) {
if ( ! d - > currentFormActionsPageWidget ) {
if ( ! d - > currentFormActionsPageWidget ) {
@ -669,12 +669,12 @@ KexiFormEventAction::ActionData KexiActionSelectionDialog::currentAction() const
KexiFormEventAction : : ActionData data ;
KexiFormEventAction : : ActionData data ;
ActionSelectorDialogListItem * simpleItem = dynamic_cast < ActionSelectorDialogListItem * > (
ActionSelectorDialogListItem * simpleItem = dynamic_cast < ActionSelectorDialogListItem * > (
d - > actionCategoriesListView - > selectedItem ( ) ) ;
d - > actionCategoriesListView - > selectedItem ( ) ) ;
// simple case: part-less item, e.g. k action:
// simple case: part-less item, e.g. tde action:
if ( simpleItem ) {
if ( simpleItem ) {
if ( simpleItem - > data = = " k action" ) {
if ( simpleItem - > data = = " tde action" ) {
if ( d - > k actionListView- > selectedItem ( ) ) {
if ( d - > tde actionListView- > selectedItem ( ) ) {
data . string = TQString ( " k action:" )
data . string = TQString ( " tde action:" )
+ dynamic_cast < ActionSelectorDialogListItem * > ( d - > k actionListView- > selectedItem ( ) ) - > data ;
+ dynamic_cast < ActionSelectorDialogListItem * > ( d - > tde actionListView- > selectedItem ( ) ) - > data ;
return data ;
return data ;
}
}
}
}