void AnnoqtConfEditor::createActions() { newAct = new QAction( QIcon( ":/filenew.xpm" ), tr( "&New" ), this ); newAct->setShortcut( tr( "Ctrl+N" ) ); newAct->setStatusTip( tr( "Create a new file" ) ); connect( newAct, SIGNAL( triggered() ), this, SLOT( slotNewConfiguration() ) ); openAct = new QAction( QIcon( ":/fileopen.xpm" ), tr( "&Open..." ), this ); openAct->setShortcut( tr( "Ctrl+O" ) ); openAct->setStatusTip( tr( "Open an existing file" ) ); connect( openAct, SIGNAL( triggered() ), this, SLOT( slotOpen() ) ); saveAct = new QAction( QIcon( ":/filesave.xpm" ), tr( "&Save" ), this ); saveAct->setShortcut( tr( "Ctrl+S" ) ); saveAct->setStatusTip( tr( "Save the document to disk" ) ); connect( saveAct, SIGNAL( triggered() ), this, SLOT( slotSave() ) ); saveAsAct = new QAction( tr( "Save &As..." ), this ); saveAsAct->setStatusTip( tr( "Save the document under a new name" ) ); connect( saveAsAct, SIGNAL( triggered() ), this, SLOT( slotSaveAs() ) ); exitAct = new QAction( tr( "E&xit" ), this ); exitAct->setShortcut( tr( "Ctrl+Q" ) ); exitAct->setStatusTip( tr( "Exit the application" ) ); connect( exitAct, SIGNAL( triggered() ), this, SLOT( close() ) ); cutAct = new QAction( QIcon( ":/editcut.xpm" ), tr( "Cu&t" ), this ); cutAct->setShortcut( tr( "Ctrl+X" ) ); cutAct->setStatusTip( tr( "Cut the current selection's contents to the " "clipboard" ) ); connect( cutAct, SIGNAL( triggered() ), this, SLOT( slotCut() ) ); addItemAction = new QAction( QIcon( ":/item.xpm" ), tr( "New entity type" ), this ); addItemAction->setShortcut( tr( "Ctrl+E" ) ); addItemAction->setStatusTip( tr( "Add a new entity type" ) ); connect( addItemAction, SIGNAL( triggered() ), this, SLOT( slotAddItemAction() ) ); aboutAct = new QAction( tr( "&About" ), this ); aboutAct->setStatusTip( tr( "Show the application's About box" ) ); connect( aboutAct, SIGNAL( triggered() ), this, SLOT( slotAbout() ) ); aboutQtAct = new QAction( tr( "About &Qt" ), this ); aboutQtAct->setStatusTip( tr( "Show the Qt library's About box" ) ); connect( aboutQtAct, SIGNAL( triggered() ), qApp, SLOT( aboutQt() ) ); cutAct->setEnabled( true ); }
// private void kpMainWindow::setupEditMenuActions () { KActionCollection *ac = actionCollection (); // Undo/Redo // CONFIG: need GUI m_commandHistory = new kpCommandHistory (true/*read config*/, this); if (m_configFirstTime) { // (so that cfg-file-editing user can modify in the meantime) m_commandHistory->writeConfig (); } m_actionCut = KStdAction::cut (this, SLOT (slotCut ()), ac); m_actionCopy = KStdAction::copy (this, SLOT (slotCopy ()), ac); m_actionPaste = KStdAction::paste (this, SLOT (slotPaste ()), ac); m_actionPasteInNewWindow = new KAction (i18n ("Paste in &New Window"), Qt::CTRL + Qt::SHIFT + Qt::Key_V, this, SLOT (slotPasteInNewWindow ()), ac, "edit_paste_in_new_window"); //m_actionDelete = KStdAction::clear (this, SLOT (slotDelete ()), ac); m_actionDelete = new KAction (i18n ("&Delete Selection"), 0, this, SLOT (slotDelete ()), ac, "edit_clear"); m_actionSelectAll = KStdAction::selectAll (this, SLOT (slotSelectAll ()), ac); m_actionDeselect = KStdAction::deselect (this, SLOT (slotDeselect ()), ac); m_actionCopyToFile = new KAction (i18n ("C&opy to File..."), 0, this, SLOT (slotCopyToFile ()), ac, "edit_copy_to_file"); m_actionPasteFromFile = new KAction (i18n ("Paste &From File..."), 0, this, SLOT (slotPasteFromFile ()), ac, "edit_paste_from_file"); m_editMenuDocumentActionsEnabled = false; enableEditMenuDocumentActions (false); // Paste should always be enabled, as long as there is something paste // (independent of whether we have a document or not) connect (QApplication::clipboard (), SIGNAL (dataChanged ()), this, SLOT (slotEnablePaste ())); slotEnablePaste (); }
// decoupled from resetActions in toplevel.cpp // as resetActions simply uses the action groups // specified in the ui.rc file void KEBApp::createActions() { m_actionsImpl = new ActionsImpl(this, GlobalBookmarkManager::self()->model()); connect(m_actionsImpl->testLinkHolder(), SIGNAL(setCancelEnabled(bool)), this, SLOT(setCancelTestsEnabled(bool))); connect(m_actionsImpl->favIconHolder(), SIGNAL(setCancelEnabled(bool)), this, SLOT(setCancelFavIconUpdatesEnabled(bool))); // save and quit should probably not be in the toplevel??? (void) KStandardAction::quit( this, SLOT( close() ), actionCollection()); KStandardAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), actionCollection()); (void) KStandardAction::configureToolbars( this, SLOT( slotConfigureToolbars() ), actionCollection()); if (m_browser) { (void) KStandardAction::open( m_actionsImpl, SLOT( slotLoad() ), actionCollection()); (void) KStandardAction::saveAs( m_actionsImpl, SLOT( slotSaveAs() ), actionCollection()); } (void) KStandardAction::cut(m_actionsImpl, SLOT( slotCut() ), actionCollection()); (void) KStandardAction::copy(m_actionsImpl, SLOT( slotCopy() ), actionCollection()); (void) KStandardAction::paste(m_actionsImpl, SLOT( slotPaste() ), actionCollection()); // actions KAction* m_actionsImplDelete = actionCollection()->addAction("delete"); m_actionsImplDelete->setIcon(KIcon("edit-delete")); m_actionsImplDelete->setText(i18n("&Delete")); m_actionsImplDelete->setShortcut(Qt::Key_Delete); connect(m_actionsImplDelete, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotDelete() )); KAction* m_actionsImplRename = actionCollection()->addAction("rename"); m_actionsImplRename->setIcon(KIcon("edit-rename")); m_actionsImplRename->setText(i18n("Rename")); m_actionsImplRename->setShortcut(Qt::Key_F2); connect(m_actionsImplRename, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotRename() )); KAction* m_actionsImplChangeURL = actionCollection()->addAction("changeurl"); m_actionsImplChangeURL->setIcon(KIcon("edit-rename")); m_actionsImplChangeURL->setText(i18n("C&hange Location")); m_actionsImplChangeURL->setShortcut(Qt::Key_F3); connect(m_actionsImplChangeURL, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotChangeURL() )); KAction* m_actionsImplChangeComment = actionCollection()->addAction("changecomment"); m_actionsImplChangeComment->setIcon(KIcon("edit-rename")); m_actionsImplChangeComment->setText(i18n("C&hange Comment")); m_actionsImplChangeComment->setShortcut(Qt::Key_F4); connect(m_actionsImplChangeComment, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotChangeComment() )); KAction* m_actionsImplChangeIcon = actionCollection()->addAction("changeicon"); m_actionsImplChangeIcon->setIcon(KIcon("preferences-desktop-icons")); m_actionsImplChangeIcon->setText(i18n("Chan&ge Icon...")); connect(m_actionsImplChangeIcon, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotChangeIcon() )); KAction* m_actionsImplUpdateFavIcon = actionCollection()->addAction("updatefavicon"); m_actionsImplUpdateFavIcon->setText(i18n("Update Favicon")); connect(m_actionsImplUpdateFavIcon, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotUpdateFavIcon() )); KAction* m_actionsImplRecursiveSort = actionCollection()->addAction("recursivesort"); m_actionsImplRecursiveSort->setText(i18n("Recursive Sort")); connect(m_actionsImplRecursiveSort, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotRecursiveSort() )); KAction* m_actionsImplNewFolder = actionCollection()->addAction("newfolder"); m_actionsImplNewFolder->setIcon(KIcon("folder-new")); m_actionsImplNewFolder->setText(i18n("&New Folder...")); m_actionsImplNewFolder->setShortcut(Qt::CTRL+Qt::Key_N); connect(m_actionsImplNewFolder, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotNewFolder() )); KAction* m_actionsImplNewBookmark = actionCollection()->addAction("newbookmark"); m_actionsImplNewBookmark->setIcon(KIcon("bookmark-new")); m_actionsImplNewBookmark->setText(i18n("&New Bookmark")); connect(m_actionsImplNewBookmark, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotNewBookmark() )); KAction* m_actionsImplInsertSeparator = actionCollection()->addAction("insertseparator"); m_actionsImplInsertSeparator->setText(i18n("&Insert Separator")); m_actionsImplInsertSeparator->setShortcut(Qt::CTRL+Qt::Key_I); connect(m_actionsImplInsertSeparator, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotInsertSeparator() )); KAction* m_actionsImplSort = actionCollection()->addAction("sort"); m_actionsImplSort->setText(i18n("&Sort Alphabetically")); connect(m_actionsImplSort, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotSort() )); KAction* m_actionsImplSetAsToolbar = actionCollection()->addAction("setastoolbar"); m_actionsImplSetAsToolbar->setIcon(KIcon("bookmark-toolbar")); m_actionsImplSetAsToolbar->setText(i18n("Set as T&oolbar Folder")); connect(m_actionsImplSetAsToolbar, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotSetAsToolbar() )); KAction* m_actionsImplExpandAll = actionCollection()->addAction("expandall"); m_actionsImplExpandAll->setText(i18n("&Expand All Folders")); connect(m_actionsImplExpandAll, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExpandAll() )); KAction* m_actionsImplCollapseAll = actionCollection()->addAction("collapseall"); m_actionsImplCollapseAll->setText(i18n("Collapse &All Folders")); connect(m_actionsImplCollapseAll, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotCollapseAll() )); KAction* m_actionsImplOpenLink = actionCollection()->addAction("openlink"); m_actionsImplOpenLink->setIcon(KIcon("document-open")); m_actionsImplOpenLink->setText(i18n("&Open in Konqueror")); connect(m_actionsImplOpenLink, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotOpenLink() )); KAction* m_actionsImplTestSelection = actionCollection()->addAction("testlink"); m_actionsImplTestSelection->setIcon(KIcon("bookmarks")); m_actionsImplTestSelection->setText(i18n("Check &Status")); connect(m_actionsImplTestSelection, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotTestSelection() )); KAction* m_actionsImplTestAll = actionCollection()->addAction("testall"); m_actionsImplTestAll->setText(i18n("Check Status: &All")); connect(m_actionsImplTestAll, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotTestAll() )); KAction* m_actionsImplUpdateAllFavIcons = actionCollection()->addAction("updateallfavicons"); m_actionsImplUpdateAllFavIcons->setText(i18n("Update All &Favicons")); connect(m_actionsImplUpdateAllFavIcons, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotUpdateAllFavIcons() )); KAction* m_actionsImplCancelAllTests = actionCollection()->addAction("canceltests"); m_actionsImplCancelAllTests->setText(i18n("Cancel &Checks")); connect(m_actionsImplCancelAllTests, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotCancelAllTests() )); KAction* m_actionsImplCancelFavIconUpdates = actionCollection()->addAction("cancelfaviconupdates"); m_actionsImplCancelFavIconUpdates->setText(i18n("Cancel &Favicon Updates")); connect(m_actionsImplCancelFavIconUpdates, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotCancelFavIconUpdates() )); KAction* m_actionsImplImportNS = actionCollection()->addAction("importNS"); m_actionsImplImportNS->setObjectName( QLatin1String("NS" )); m_actionsImplImportNS->setIcon(KIcon("netscape")); m_actionsImplImportNS->setText(i18n("Import &Netscape Bookmarks...")); connect(m_actionsImplImportNS, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() )); KAction* m_actionsImplImportOpera = actionCollection()->addAction("importOpera"); m_actionsImplImportOpera->setObjectName( QLatin1String("Opera" )); m_actionsImplImportOpera->setIcon(KIcon("opera")); m_actionsImplImportOpera->setText(i18n("Import &Opera Bookmarks...")); connect(m_actionsImplImportOpera, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() )); /* KAction* m_actionsImplImportCrashes = actionCollection()->addAction("importCrashes"); m_actionsImplImportCrashes->setObjectName( QLatin1String("Crashes" )); m_actionsImplImportCrashes->setText(i18n("Import All &Crash Sessions as Bookmarks...")); connect(m_actionsImplImportCrashes, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() )); */ KAction* m_actionsImplImportGaleon = actionCollection()->addAction("importGaleon"); m_actionsImplImportGaleon->setObjectName( QLatin1String("Galeon" )); m_actionsImplImportGaleon->setText(i18n("Import &Galeon Bookmarks...")); connect(m_actionsImplImportGaleon, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() )); KAction* m_actionsImplImportKDE2 = actionCollection()->addAction("importKDE2"); m_actionsImplImportKDE2->setObjectName( QLatin1String("KDE2" )); m_actionsImplImportKDE2->setIcon(KIcon("kde")); m_actionsImplImportKDE2->setText(i18n("Import &KDE 2 or KDE 3 Bookmarks...")); connect(m_actionsImplImportKDE2, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() )); KAction* m_actionsImplImportIE = actionCollection()->addAction("importIE"); m_actionsImplImportIE->setObjectName( QLatin1String("IE" )); m_actionsImplImportIE->setText(i18n("Import &Internet Explorer Bookmarks...")); connect(m_actionsImplImportIE, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() )); KAction* m_actionsImplImportMoz = actionCollection()->addAction("importMoz"); m_actionsImplImportMoz->setObjectName( QLatin1String("Moz" )); m_actionsImplImportMoz->setIcon(KIcon("mozilla")); m_actionsImplImportMoz->setText(i18n("Import &Mozilla Bookmarks...")); connect(m_actionsImplImportMoz, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() )); KAction* m_actionsImplExportNS = actionCollection()->addAction("exportNS"); m_actionsImplExportNS->setIcon(KIcon("netscape")); m_actionsImplExportNS->setText(i18n("Export &Netscape Bookmarks")); connect(m_actionsImplExportNS, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExportNS() )); KAction* m_actionsImplExportOpera = actionCollection()->addAction("exportOpera"); m_actionsImplExportOpera->setIcon(KIcon("opera")); m_actionsImplExportOpera->setText(i18n("Export &Opera Bookmarks...")); connect(m_actionsImplExportOpera, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExportOpera() )); KAction* m_actionsImplExportHTML = actionCollection()->addAction("exportHTML"); m_actionsImplExportHTML->setIcon(KIcon("text-html")); m_actionsImplExportHTML->setText(i18n("Export &HTML Bookmarks...")); connect(m_actionsImplExportHTML, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExportHTML() )); KAction* m_actionsImplExportIE = actionCollection()->addAction("exportIE"); m_actionsImplExportIE->setText(i18n("Export &Internet Explorer Bookmarks...")); connect(m_actionsImplExportIE, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExportIE() )); KAction* m_actionsImplExportMoz = actionCollection()->addAction("exportMoz"); m_actionsImplExportMoz->setIcon(KIcon("mozilla")); m_actionsImplExportMoz->setText(i18n("Export &Mozilla Bookmarks...")); connect(m_actionsImplExportMoz, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExportMoz() )); }
KRegExpEditorPrivate::KRegExpEditorPrivate(TQWidget *parent, const char *name) : TQWidget(parent, name), _updating( false ), _autoVerify( true ) { setMinimumSize(730,300); TQDockArea* area = new TQDockArea(Qt::Horizontal, TQDockArea::Normal, this ); area->setMinimumSize(2,2); TQDockArea* verArea1 = new TQDockArea(Qt::Vertical, TQDockArea::Normal, this ); verArea1->setMinimumSize(2,2); TQDockArea* verArea2 = new TQDockArea(Qt::Vertical, TQDockArea::Reverse, this ); verArea2->setMinimumSize(2,2); // The DockWindows. _regExpButtons = new RegExpButtons( area, "KRegExpEditorPrivate::regExpButton" ); _verifyButtons = new VerifyButtons( area, "KRegExpEditorPrivate::VerifyButtons" ); _auxButtons = new AuxButtons( area, "KRegExpEditorPrivate::AuxButtons" ); _userRegExps = new UserDefinedRegExps( verArea1, "KRegExpEditorPrivate::userRegExps" ); _userRegExps->setResizeEnabled( true ); TQWhatsThis::add( _userRegExps, i18n( "In this window you will find predefined regular expressions. Both regular expressions " "you have developed and saved, and regular expressions shipped with the system." )); // Editor window _editor = new TQSplitter(Qt::Vertical, this, "KRegExpEditorPrivate::_editor" ); _scrolledEditorWindow = new RegExpScrolledEditorWindow( _editor, "KRegExpEditorPrivate::_scrolledEditorWindow" ); TQWhatsThis::add( _scrolledEditorWindow, i18n( "In this window you will develop your regular expressions. " "Select one of the actions from the action buttons above, and click the mouse in this " "window to insert the given action.")); _info = new InfoPage( this, "_info" ); _verifier = new Verifier( _editor, "KRegExpEditorPrivate::_verifier" ); connect( _verifier, TQT_SIGNAL( textChanged() ), this, TQT_SLOT( maybeVerify() ) ); TQWhatsThis::add( _verifier, i18n("Type in some text in this window, and see what the regular expression you have developed matches.<p>" "Each second match will be colored in red and each other match will be colored blue, simply so you " "can distinguish them from each other.<p>" "If you select part of the regular expression in the editor window, then this part will be " "highlighted - This allows you to <i>debug</i> your regular expressions") ); _editor->hide(); _editor->setSizes( TQValueList<int>() << _editor->height()/2 << _editor->height()/2 ); TQVBoxLayout *topLayout = new TQVBoxLayout( this, 0, 6, "KRegExpEditorPrivate::topLayout" ); topLayout->addWidget( area ); TQHBoxLayout* rows = new TQHBoxLayout; // I need to cal addLayout explicit to get stretching right. topLayout->addLayout( rows, 1 ); rows->addWidget( verArea1 ); rows->addWidget( _editor, 1 ); rows->addWidget( _info, 1 ); rows->addWidget( verArea2 ); // Connect the buttons connect( _regExpButtons, TQT_SIGNAL( clicked( int ) ), _scrolledEditorWindow, TQT_SLOT( slotInsertRegExp( int ) ) ); connect( _regExpButtons, TQT_SIGNAL( doSelect() ), _scrolledEditorWindow, TQT_SLOT( slotDoSelect() ) ); connect( _userRegExps, TQT_SIGNAL( load( RegExp* ) ), _scrolledEditorWindow, TQT_SLOT( slotInsertRegExp( RegExp* ) ) ); connect( _regExpButtons, TQT_SIGNAL( clicked( int ) ), _userRegExps, TQT_SLOT( slotUnSelect() ) ); connect( _regExpButtons, TQT_SIGNAL( doSelect() ), _userRegExps, TQT_SLOT( slotUnSelect() ) ); connect( _userRegExps, TQT_SIGNAL( load( RegExp* ) ), _regExpButtons, TQT_SLOT( slotUnSelect() ) ); connect( _scrolledEditorWindow, TQT_SIGNAL( doneEditing() ), _regExpButtons, TQT_SLOT( slotSelectNewAction() ) ); connect( _scrolledEditorWindow, TQT_SIGNAL( doneEditing() ), _userRegExps, TQT_SLOT( slotSelectNewAction() ) ); connect( _regExpButtons, TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( slotShowEditor() ) ); connect( _userRegExps, TQT_SIGNAL( load( RegExp* ) ), this, TQT_SLOT( slotShowEditor() ) ); connect( _regExpButtons, TQT_SIGNAL( doSelect() ), this, TQT_SLOT( slotShowEditor() ) ); connect( _scrolledEditorWindow, TQT_SIGNAL( savedRegexp() ), _userRegExps, TQT_SLOT( slotPopulateUserRegexps() ) ); connect( _auxButtons, TQT_SIGNAL( undo() ), this, TQT_SLOT( slotUndo() ) ); connect( _auxButtons, TQT_SIGNAL( redo() ), this, TQT_SLOT( slotRedo() ) ); connect( _auxButtons, TQT_SIGNAL( cut() ), _scrolledEditorWindow, TQT_SLOT( slotCut() ) ); connect( _auxButtons, TQT_SIGNAL( copy() ), _scrolledEditorWindow, TQT_SLOT( slotCopy() ) ); connect( _auxButtons, TQT_SIGNAL( paste() ), _scrolledEditorWindow, TQT_SLOT( slotPaste() ) ); connect( _auxButtons, TQT_SIGNAL( save() ), _scrolledEditorWindow, TQT_SLOT( slotSave() ) ); connect( _verifyButtons, TQT_SIGNAL( autoVerify( bool ) ), this, TQT_SLOT( setAutoVerify( bool ) ) ); connect( _verifyButtons, TQT_SIGNAL( verify() ), this, TQT_SLOT( doVerify() ) ); connect( _verifyButtons, TQT_SIGNAL( changeSyntax( const TQString& ) ), this, TQT_SLOT( setSyntax( const TQString& ) ) ); connect( this, TQT_SIGNAL( canUndo( bool ) ), _auxButtons, TQT_SLOT( slotCanUndo( bool ) ) ); connect( this, TQT_SIGNAL( canRedo( bool ) ), _auxButtons, TQT_SLOT( slotCanRedo( bool ) ) ); connect( _scrolledEditorWindow, TQT_SIGNAL( anythingSelected( bool ) ), _auxButtons, TQT_SLOT( slotCanCut( bool ) ) ); connect( _scrolledEditorWindow, TQT_SIGNAL( anythingSelected( bool ) ), _auxButtons, TQT_SLOT( slotCanCopy( bool ) ) ); connect( _scrolledEditorWindow, TQT_SIGNAL( anythingOnClipboard( bool ) ), _auxButtons, TQT_SLOT( slotCanPaste( bool ) ) ); connect( _scrolledEditorWindow, TQT_SIGNAL( canSave( bool ) ), _auxButtons, TQT_SLOT( slotCanSave( bool ) ) ); connect( _scrolledEditorWindow, TQT_SIGNAL( verifyRegExp() ), this, TQT_SLOT( maybeVerify() ) ); connect( _verifyButtons, TQT_SIGNAL( loadVerifyText( const TQString& ) ), this, TQT_SLOT( setVerifyText( const TQString& ) ) ); // connect( _verifier, TQT_SIGNAL( countChanged( int ) ), _verifyButtons, TQT_SLOT( setMatchCount( int ) ) ); // TQt anchors do not work for <pre>...</pre>, thefore scrolling to next/prev match // do not work. Enable this when they work. // connect( _verifyButtons, TQT_SIGNAL( gotoFirst() ), _verifier, TQT_SLOT( gotoFirst() ) ); // connect( _verifyButtons, TQT_SIGNAL( gotoPrev() ), _verifier, TQT_SLOT( gotoPrev() ) ); // connect( _verifyButtons, TQT_SIGNAL( gotoNext() ), _verifier, TQT_SLOT( gotoNext() ) ); // connect( _verifyButtons, TQT_SIGNAL( gotoLast() ), _verifier, TQT_SLOT( gotoLast() ) ); // connect( _verifier, TQT_SIGNAL( goForwardPossible( bool ) ), _verifyButtons, TQT_SLOT( enableForwardButtons( bool ) ) ); // connect( _verifier, TQT_SIGNAL( goBackwardPossible( bool ) ), _verifyButtons, TQT_SLOT( enableBackwardButtons( bool ) ) ); _auxButtons->slotCanPaste( false ); _auxButtons->slotCanCut( false ); _auxButtons->slotCanCopy( false ); _auxButtons->slotCanSave( false ); // Line Edit TQHBoxLayout* layout = new TQHBoxLayout( topLayout, 6 ); TQLabel* label = new TQLabel( i18n("ASCII syntax:"), this ); layout->addWidget( label ); clearButton = new TQToolButton( this ); const TQString icon( TQString::fromLatin1( TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase" ) ); TQIconSet clearIcon = SmallIconSet( icon ); clearButton->setIconSet( clearIcon ); layout->addWidget( clearButton ); TQToolTip::add( clearButton, i18n("Clear expression") ); _regexpEdit = new TQLineEdit( this ); layout->addWidget( _regexpEdit ); TQWhatsThis::add( _regexpEdit, i18n( "This is the regular expression in ASCII syntax. You are likely only " "to be interested in this if you are a programmer, and need to " "develop a regular expression using TQRegExp.<p>" "You may develop your regular expression both by using the graphical " "editor, and by typing the regular expression in this line edit.") ); #ifdef TQT_ONLY TQPixmap pix( "icons/error.png" ); #else TQPixmap pix = TDEGlobal::iconLoader()->loadIcon(locate("data", TQString::fromLatin1("kregexpeditor/pics/error.png") ), TDEIcon::Toolbar ); #endif _error = new TQLabel( this ); _error->setPixmap( pix ); layout->addWidget( _error ); _error->hide(); _timer = new TQTimer(this); connect( _scrolledEditorWindow, TQT_SIGNAL( change() ), this, TQT_SLOT( slotUpdateLineEdit() ) ); connect( _regexpEdit, TQT_SIGNAL(textChanged( const TQString& ) ), this, TQT_SLOT( slotTriggerUpdate() ) ); connect( _timer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTimeout() ) ); connect( clearButton, TQT_SIGNAL( clicked() ), _regexpEdit, TQT_SLOT( clear() ) ); // Push an initial empty element on the stack. _undoStack.push( _scrolledEditorWindow->regExp() ); _redoStack.setAutoDelete( true ); TQAccel* accel = new TQAccel( this ); accel->connectItem( accel->insertItem( CTRL+Key_Z ), this, TQT_SLOT( slotUndo() ) ); accel->connectItem( accel->insertItem( CTRL+Key_R ), this, TQT_SLOT( slotRedo() ) ); setSyntax( TQString::fromLatin1( "TQt" ) ); }
KOEditorAttachments::KOEditorAttachments( int spacing, QWidget *parent ) : QWidget( parent ) { QBoxLayout *topLayout = new QHBoxLayout( this ); topLayout->setSpacing( spacing ); QLabel *label = new QLabel( i18nc( "@label", "Attachments:" ), this ); topLayout->addWidget( label ); mAttachments = new AttachmentIconView( this ); mAttachments->setWhatsThis( i18nc( "@info:whatsthis", "Displays items (files, mail, etc.) that " "have been associated with this event or to-do." ) ); mAttachments->setItemsMovable( false ); mAttachments->setSelectionMode( Q3IconView::Extended ); topLayout->addWidget( mAttachments ); connect( mAttachments, SIGNAL(returnPressed(Q3IconViewItem *)), SLOT(showAttachment(Q3IconViewItem *)) ); connect( mAttachments, SIGNAL(doubleClicked(Q3IconViewItem *)), SLOT(showAttachment(Q3IconViewItem *)) ); connect( mAttachments, SIGNAL(itemRenamed(Q3IconViewItem *,const QString &)), SLOT(slotItemRenamed(Q3IconViewItem *,const QString &)) ); connect( mAttachments, SIGNAL(dropped(QDropEvent *,const Q3ValueList<Q3IconDragItem> &)), SLOT(dropped(QDropEvent *,const Q3ValueList<Q3IconDragItem> &)) ); connect( mAttachments, SIGNAL(selectionChanged()), SLOT(selectionChanged()) ); connect( mAttachments, SIGNAL(contextMenuRequested(Q3IconViewItem *,const QPoint &)), SLOT(contextMenu(Q3IconViewItem *,const QPoint &)) ); QPushButton *addButton = new QPushButton( this ); addButton->setIcon( KIcon( "list-add" ) ); addButton->setToolTip( i18nc( "@info:tooltip", "Add an attachment" ) ); addButton->setWhatsThis( i18nc( "@info:whatsthis", "Shows a dialog used to select an attachment " "to add to this event or to-do as link or as " "inline data." ) ); topLayout->addWidget( addButton ); connect( addButton, SIGNAL(clicked()), SLOT(slotAdd()) ); mRemoveBtn = new QPushButton( this ); mRemoveBtn->setIcon( KIcon( "list-remove" ) ); mRemoveBtn->setToolTip( i18nc( "@info:tooltip", "Remove the selected attachment" ) ); mRemoveBtn->setWhatsThis( i18nc( "@info:whatsthis", "Removes the attachment selected in the " "list above from this event or to-do." ) ); topLayout->addWidget( mRemoveBtn ); connect( mRemoveBtn, SIGNAL(clicked()), SLOT(slotRemove()) ); KActionCollection *ac = new KActionCollection( this ); ac->addAssociatedWidget( this ); mPopupMenu = new KMenu( this ); mOpenAction = new KAction( i18nc( "@action:inmenu open the attachment in a viewer", "&Open" ), this ); connect( mOpenAction, SIGNAL(triggered(bool)), this, SLOT(slotShow()) ); ac->addAction( "view", mOpenAction ); mPopupMenu->addAction( mOpenAction ); mPopupMenu->addSeparator(); mCopyAction = KStandardAction::copy( this, SLOT(slotCopy()), ac ); mPopupMenu->addAction( mCopyAction ); mCutAction = KStandardAction::cut( this, SLOT(slotCut()), ac ); mPopupMenu->addAction( mCutAction ); KAction *action = KStandardAction::paste( this, SLOT(slotPaste()), ac ); mPopupMenu->addAction( action ); mPopupMenu->addSeparator(); mDeleteAction = new KAction( i18nc( "@action:inmenu remove the attachment", "&Remove" ), this ); connect( mDeleteAction, SIGNAL(triggered(bool)), this, SLOT(slotRemove()) ); ac->addAction( "remove", mDeleteAction ); mPopupMenu->addAction( mDeleteAction ); mPopupMenu->addSeparator(); mEditAction = new KAction( i18nc( "@action:inmenu show a dialog used to edit the attachment", "&Properties..." ), this ); connect( mEditAction, SIGNAL(triggered(bool)), this, SLOT(slotEdit()) ); ac->addAction( "edit", mEditAction ); mPopupMenu->addAction( mEditAction ); selectionChanged(); setAcceptDrops( true ); }