104
105
//-----------------------------------
105
DocumentsEditor::DocumentsEditor( KoDocument *part, QWidget *parent )
106
: ViewBase( part, parent )
106
DocumentsEditor::DocumentsEditor(KoPart *part, KoDocument *doc, QWidget *parent)
107
: ViewBase(part, doc, parent)
115
116
m_view->setEditTriggers( m_view->editTriggers() | QAbstractItemView::EditKeyPressed );
117
connect( model(), SIGNAL( executeCommand( KUndo2Command* ) ), part, SLOT( addCommand( KUndo2Command* ) ) );
118
connect( model(), SIGNAL( executeCommand( KUndo2Command* ) ), doc, SLOT( addCommand( KUndo2Command* ) ) );
119
120
connect( m_view, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ), this, SLOT( slotCurrentChanged( const QModelIndex & ) ) );
213
214
void DocumentsEditor::setupGui()
215
216
QString name = "documentseditor_edit_list";
216
actionEditDocument = new KAction(KIcon( "document-properties" ), i18n("Edit..."), this);
217
actionEditDocument = new KAction(koIcon("document-properties"), i18n("Edit..."), this);
217
218
actionCollection()->addAction("edit_documents", actionEditDocument );
218
219
// actionEditDocument->setShortcut( KShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_I ) );
219
220
connect( actionEditDocument, SIGNAL( triggered( bool ) ), SLOT( slotEditDocument() ) );
220
221
addAction( name, actionEditDocument );
222
actionViewDocument = new KAction(KIcon( "document-preview" ), i18nc("@action View a document", "View..."), this);
223
actionViewDocument = new KAction(koIcon("document-preview"), i18nc("@action View a document", "View..."), this);
223
224
actionCollection()->addAction("view_documents", actionViewDocument );
224
225
// actionViewDocument->setShortcut( KShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_I ) );
225
226
connect( actionViewDocument, SIGNAL( triggered( bool ) ), SLOT( slotViewDocument() ) );
226
227
addAction( name, actionViewDocument );
229
/* actionDeleteSelection = new KAction(KIcon( "edit-delete" ), i18n("Delete"), this);
230
/* actionDeleteSelection = new KAction(koIcon("edit-delete"), i18n("Delete"), this);
230
231
actionCollection()->addAction("delete_selection", actionDeleteSelection );
231
232
actionDeleteSelection->setShortcut( KShortcut( Qt::Key_Delete ) );
232
233
connect( actionDeleteSelection, SIGNAL( triggered( bool ) ), SLOT( slotDeleteSelection() ) );