Ejemplo n.º 1
0
HashingBase &HashingBase::operator=(const HashingBase &H)
{
	destroyAll();
	free(m_table);
	copyAll(H);
	return *this;
}
Ejemplo n.º 2
0
Dlist<T>::Dlist(const Dlist &l)
{
    //std::cout << "Copy constructor called\n\n";
    this->first = new node;
    this->last = new node;
    makeEmpty();
    copyAll(l);
}
Ejemplo n.º 3
0
void MainWindow::createActions()
{
    newAct = new QAction(tr("&New"), this);
//    newAct = QAction(QIcon(":/images/new.png"), tr("&New"), this);
    newAct->setShortcuts(QKeySequence::New);
    newAct->setStatusTip(tr("Create a new file"));
    connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));

    openAct = new QAction(tr("&Open"), this);
//    openAct = QAction(QIcon(":/images/open.png"), tr("&Open"), this);
    openAct->setShortcuts(QKeySequence::Open);
    openAct->setStatusTip(tr("Open an existing file"));
    connect(openAct, SIGNAL(triggered()), this, SLOT(open()));

    saveAct = new QAction(tr("&Save"), this);
//    saveAct = QAction(QIcon(":/images/save.png"), tr("&Save"), this);
    saveAct->setShortcuts(QKeySequence::Save);
    saveAct->setStatusTip(tr("Create a new file"));
    connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));

    saveAsAct = new QAction(tr("&SaveAs"), this);
    saveAsAct->setShortcuts(QKeySequence::SaveAs);
    saveAsAct->setStatusTip(tr("Create a new file as"));
    connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));


    exitAct = new QAction(tr("&Exit"), this);
    exitAct->setShortcuts(QKeySequence::Quit);
    exitAct->setStatusTip(tr("Close the program"));
    connect(exitAct, SIGNAL(triggered()), this, SLOT(exitAll()));

    aboutAct = new QAction(tr("&About"), this);
    aboutAct->setStatusTip(tr("Show the About box"));
    connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));


    selectAllAct = new QAction(tr("&SelectAll"), this);
    selectAllAct->setShortcuts(QKeySequence::SelectAll);
    selectAllAct->setStatusTip(tr("Select and All"));
    connect(selectAllAct, SIGNAL(triggered()), this, SLOT(selectAll()));

    copyAllAct = new QAction(tr("&CopyAll"), this);
    copyAllAct->setStatusTip(tr("Select and Copy All"));
    connect(copyAllAct, SIGNAL(triggered()), this, SLOT(copyAll()));

    copyTextAct = new QAction(tr("&Copy"), this);
    copyTextAct->setShortcuts(QKeySequence::Copy);
    copyTextAct->setStatusTip(tr("Copy the text"));
    connect(copyTextAct, SIGNAL(triggered()), this, SLOT(copyText()));

    pasteTextAct = new QAction(tr("&Paste"), this);
    pasteTextAct->setShortcuts(QKeySequence::Paste);
    pasteTextAct->setStatusTip(tr("Select All"));
    connect(pasteTextAct, SIGNAL(triggered()), this, SLOT(pasteText()));

}
Ejemplo n.º 4
0
// ----------------- CodeDialog
CodeDialog::CodeDialog(QWidget *parent) :
    QDialog(parent),
    m_impl(new CodeDialogPrivate)
{
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    QVBoxLayout *vBoxLayout = new QVBoxLayout;

    // Edit tool bar
    QToolBar *toolBar = new QToolBar;

    const QIcon saveIcon = createIconSet(QLatin1String("filesave.png"));
    QAction *saveAction = toolBar->addAction(saveIcon, tr("Save..."));
    connect(saveAction, SIGNAL(triggered()), this, SLOT(slotSaveAs()));

    const QIcon copyIcon = createIconSet(QLatin1String("editcopy.png"));
    QAction *copyAction = toolBar->addAction(copyIcon, tr("Copy All"));
    connect(copyAction, SIGNAL(triggered()), this, SLOT(copyAll()));

    QAction *findAction = toolBar->addAction(
                              TextEditFindWidget::findIconSet(),
                              tr("&Find in Text..."),
                              m_impl->m_findWidget, SLOT(activate()));
    findAction->setShortcut(QKeySequence::Find);

    vBoxLayout->addWidget(toolBar);

    // Edit
    m_impl->m_textEdit->setReadOnly(true);
    m_impl->m_textEdit->setMinimumSize(QSize(
                                           m_impl->m_findWidget->minimumSize().width(),
                                           500));
    vBoxLayout->addWidget(m_impl->m_textEdit);

    // Find
    m_impl->m_findWidget->setTextEdit(m_impl->m_textEdit);
    vBoxLayout->addWidget(m_impl->m_findWidget);

    // Button box
    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));

    // Disable auto default
    QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
    closeButton->setAutoDefault(false);
    vBoxLayout->addWidget(buttonBox);

    setLayout(vBoxLayout);
}
Ejemplo n.º 5
0
void
Widget::contextMenu(QMenu* menu) const
{
    if(!menu) return;
    QAction* a;
    a=menu->addAction(tr("&Copy"),this,SLOT(copy()));
    a->setEnabled(canCopy());
    a=menu->addAction(tr("&Paste"),this,SLOT(paste()));
    a->setEnabled(canPaste());
    menu->addSeparator();
    a=menu->addAction(tr("Copy &All"),this,SLOT(copyAll()));
    menu->addSeparator();
    a=menu->addAction(tr("C&lear Scrollback"),this,SLOT(clearScrollback()));
    a=menu->addAction(tr("Rese&t Terminal"),this,SLOT(reset()));
    a=menu->addAction(tr("&Restart Session"),this,SLOT(restart()));
}
Ejemplo n.º 6
0
//void OutputText::contextMenuEvent(QContextMenuEvent* e)
QPopupMenu* OutputText::createPopupMenu(const QPoint&)
{
    KPopupMenu* popup = new KPopupMenu;

    int id = popup->insertItem(i18n("Show Internal Commands"),
                               this,
                               SLOT(toggleShowInternalCommands()));

    popup->setItemChecked(id, parent_->showInternalCommands_);
    popup->setWhatsThis(
        id,
        i18n(
            "Controls if commands issued internally by KDevelop "
            "will be shown or not.<br>"
            "This option will affect only future commands, it won't "
            "add or remove already issued commands from the view."));

    popup->insertItem(i18n("Copy All"),
                      this,
                      SLOT(copyAll()));


    return popup;
}
void CLexiconReadWindow::initActions() {
    qDebug() << "CLexiconReadWindow::initActions";

    BtActionCollection* ac = actionCollection();
    CReadWindow::initActions();
    CLexiconReadWindow::insertKeyboardActions(ac);

    m_actions.backInHistory = dynamic_cast<BtToolBarPopupAction*>(
                                  ac->action(CResMgr::displaywindows::general::backInHistory::actionName) );
    Q_ASSERT(m_actions.backInHistory);
    addAction(m_actions.backInHistory);

    m_actions.forwardInHistory = dynamic_cast<BtToolBarPopupAction*>(
                                     ac->action(CResMgr::displaywindows::general::forwardInHistory::actionName) );
    Q_ASSERT(m_actions.forwardInHistory);
    addAction(m_actions.forwardInHistory);

    QAction* qaction;

    qaction = ac->action("nextEntry");
    QObject::connect(qaction, SIGNAL(triggered()), this, SLOT( nextEntry() ) );
    addAction(qaction);

    qaction = ac->action("previousEntry");
    QObject::connect(qaction, SIGNAL(triggered()), this, SLOT( previousEntry() ) );
    addAction(qaction);

    m_actions.selectAll = ac->action("selectAll");
    Q_ASSERT(m_actions.selectAll);

    m_actions.findText = ac->action("findText");
    Q_ASSERT(m_actions.findText);

    m_actions.findStrongs = ac->action(CResMgr::displaywindows::general::findStrongs::actionName);
    QObject::connect(m_actions.findStrongs, SIGNAL(triggered()), this, SLOT(openSearchStrongsDialog()) );
    addAction(m_actions.findStrongs);

    m_actions.copy.reference = ac->action("copyReferenceOnly");
    QObject::connect(m_actions.copy.reference, SIGNAL(triggered()), displayWidget()->connectionsProxy(), SLOT(copyAnchorOnly()) );
    addAction(m_actions.copy.reference);

    m_actions.copy.entry = ac->action("copyEntryWithText");
    QObject::connect(m_actions.copy.entry, SIGNAL(triggered()), displayWidget()->connectionsProxy(), SLOT(copyAll()) );
    addAction(m_actions.copy.entry);

    Q_ASSERT(ac->action("copySelectedText"));
    m_actions.copy.selectedText = ac->action("copySelectedText");

    m_actions.save.entryAsPlain = new QAction(tr("Entry as plain text"), ac );
    QObject::connect(m_actions.save.entryAsPlain, SIGNAL(triggered()), this, SLOT(saveAsPlain()) );
    addAction(m_actions.save.entryAsPlain);

    m_actions.save.entryAsHTML = ac->action("saveHtml");
    QObject::connect(m_actions.save.entryAsHTML, SIGNAL(triggered()), this, SLOT(saveAsHTML()));
    addAction(m_actions.save.entryAsHTML);

    m_actions.print.reference = ac->action("printReferenceOnly");
    QObject::connect(m_actions.print.reference, SIGNAL(triggered()), this, SLOT(printAnchorWithText()));
    addAction(m_actions.print.reference);

    m_actions.print.entry = ac->action("printEntryWithText");
    QObject::connect(m_actions.print.entry, SIGNAL(triggered()), this, SLOT(printAll()));
    addAction(m_actions.print.entry);

    // init with the user defined settings
    qDebug() << "call CBTConfig::setupAccelSettings(CBTConfig::lexiconWindow, ac); and end CLexiconReadWindow::initActions";
    CBTConfig::setupAccelSettings(CBTConfig::lexiconWindow, ac);
}
Ejemplo n.º 8
0
HashingBase::HashingBase(const HashingBase &H)
{
	copyAll(H);
}
void CLexiconReadWindow::initActions()
{
	qDebug("CLexiconReadWindow::initActions");

	KActionCollection* ac = actionCollection();
	CLexiconReadWindow::insertKeyboardActions(ac);
	CReadWindow::initActions();

	
	m_actions.backInHistory = dynamic_cast<KToolBarPopupAction*>(
		ac->action(CResMgr::displaywindows::general::backInHistory::actionName) );
	Q_ASSERT(m_actions.backInHistory);

	m_actions.forwardInHistory = dynamic_cast<KToolBarPopupAction*>(
		 ac->action(CResMgr::displaywindows::general::forwardInHistory::actionName) );
	Q_ASSERT(m_actions.forwardInHistory);


	KAction* kaction;

	kaction = new KAction(tr("Next entry"), ac );
	kaction->setShortcut( CResMgr::displaywindows::lexiconWindow::nextEntry::accel);
	QObject::connect(kaction, SIGNAL(triggered()), this, SLOT( nextEntry() ) );
	ac->addAction("nextEntry", kaction);

	kaction = new KAction(tr("Previous entry"), ac );
	kaction->setShortcut( CResMgr::displaywindows::lexiconWindow::previousEntry::accel);
	QObject::connect(kaction, SIGNAL(triggered()), this, SLOT( previousEntry() ) );
	ac->addAction("previousEntry", kaction);


	m_actions.selectAll = qobject_cast<KAction*>(ac->action("selectAll"));
	//TODO: Q_ASSERT(m_actions.selectAll);

	m_actions.findText = qobject_cast<KAction*>(ac->action("findText"));
	//TODO: Q_ASSERT(m_actions.findText);
	

	m_actions.findStrongs = new KAction(
		KIcon(CResMgr::displaywindows::general::findStrongs::icon),
		tr("Strong's Search"),
		ac
		);
	m_actions.findStrongs->setShortcut(CResMgr::displaywindows::general::findStrongs::accel);
	QObject::connect(m_actions.findStrongs, SIGNAL(triggered()), this, SLOT(openSearchStrongsDialog()) );
	ac->addAction(CResMgr::displaywindows::general::findStrongs::actionName, m_actions.findStrongs);

	m_actions.copy.reference = new KAction(tr("Reference only"), ac );
	QObject::connect(m_actions.copy.reference, SIGNAL(triggered()), displayWidget()->connectionsProxy(), SLOT(copyAnchorOnly()) );
	ac->addAction("copyReferenceOnly", m_actions.copy.reference);

	m_actions.copy.entry = new KAction(tr("Entry with text"), ac );
	QObject::connect(m_actions.copy.entry, SIGNAL(triggered()), displayWidget()->connectionsProxy(), SLOT(copyAll()) );
	ac->addAction("copyEntryWithText", m_actions.copy.entry);

	Q_ASSERT(ac->action("copySelectedText"));
	m_actions.copy.selectedText = qobject_cast<KAction*>(ac->action("copySelectedText"));
	
	m_actions.save.entryAsPlain = new KAction(tr("Entry as plain text"), ac );
	QObject::connect(m_actions.save.entryAsPlain, SIGNAL(triggered()), this, SLOT(saveAsPlain()) );
	ac->addAction("saveEntryAsPlain", m_actions.save.entryAsPlain);

	m_actions.save.entryAsHTML = new KAction(tr("Entry as HTML"), ac );
	QObject::connect(m_actions.save.entryAsHTML, SIGNAL(triggered()), this, SLOT(saveAsHTML()));
	ac->addAction("saveEntryAsHTML", m_actions.save.entryAsHTML);

	m_actions.print.reference = new KAction(tr("Reference only"), ac);
	QObject::connect(m_actions.print.reference, SIGNAL(triggered()), this, SLOT(printAnchorWithText()));
	ac->addAction("printReferenceOnly", m_actions.print.reference);

	m_actions.print.entry = new KAction(tr("Entry with text"), ac);
	QObject::connect(m_actions.print.entry, SIGNAL(triggered()), this, SLOT(printAll()));
	ac->addAction("printEntryWithText", m_actions.print.entry);

	// init with the user defined settings
	qDebug("call CBTConfig::setupAccelSettings(CBTConfig::lexiconWindow, ac); and end CLexiconReadWindow::initActions");
	CBTConfig::setupAccelSettings(CBTConfig::lexiconWindow, ac);
};
int main(int argc, char *argv[])
/* Process command line. */
{
boolean drop, move, copy;
struct sigaction sigSpec;
setlinebuf(stdout);
setlinebuf(stderr);

ZeroVar(&sigSpec);
sigSpec.sa_handler = sigStopSignaled;
sigSpec.sa_flags = SA_RESTART;
if (sigaction(SIGUSR1, &sigSpec, NULL) < 0)
    errnoAbort("can't set SIGUSR1 handler");

optionInit(&argc, argv, optionSpecs);
drop = optionExists("drop");
move = optionExists("move");
copy = optionExists("copy");
gReload = optionExists("reload");
if (move || copy) 
    {
    if (argc != 3)
        usage();
    }
else if (argc != 2)
    usage();
if ((drop+move+copy) > 1)
    errAbort("can only specify one of -drop, -move, or -copy");

gbVerbInit(optionInt("verbose", 0));
if (gbVerbose >= 6)
    sqlMonitorEnable(JKSQL_TRACE);
if (drop)
    dropAll(argv[1]);
else if (move)
    moveAll(argv[1], argv[2]);
else if (copy)
    copyAll(argv[1], argv[2]);
else
    {
    char *reloadList = optionVal("reloadList", NULL);
    gDatabase = argv[1];
    gOptions = dbLoadOptionsParse(gDatabase);
    gForceIgnoreDelete = optionExists("forceIgnoreDelete");
    if (optionExists("rebuildDerived"))
        gOptions.flags |= DBLOAD_BYPASS_GBLOADED|DBLOAD_REBUILD_DERIVED;

    gMaxShrinkage = optionFloat("maxShrinkage", 0.1);

    
    gGbdbGenBank = optionVal("gbdbGenBank", NULL);
    if (gGbdbGenBank == NULL)
        gGbdbGenBank = gbConfGet(gOptions.conf, "gbdb.genbank");
    if (gGbdbGenBank == NULL)
        gGbdbGenBank = "/gbdb/genbank";
    gWorkDir = optionVal("workdir", "work/load");

    if (gOptions.flags & DBLOAD_DRY_RUN)
        printf("*** using dry run mode ***\n");
    gbLoadRna(reloadList);
    }

return 0;
}