Exemplo n.º 1
0
void FVBoxField::setupMenu( )
{
	contextMenuObj->clear();

        if (field->dim() > 1) {
		contextMenuObj->addAction(tr("&Draw Vectors"), this, SLOT( slotDrawVectors() ) );
                QString msg("Field" + this->getName() + " may be drawn as vectors" );
                qDebug(msg.toAscii());
            } else {
            QString msg("Field" + this->getName() + " will not be drawn as vectors");
                            qDebug(msg.toAscii());
        }
	contextMenuObj->addAction(tr("&Draw Colormap"), this, SLOT( slotDrawColormap() ) );

	contextMenuObj->addSeparator();
	contextMenuObj->addAction(tr("&Add Slice"), this, SLOT( slotSlice() ) );
	
	contextMenuObj->addSeparator();
	contextMenuObj->addAction(tr("&Animate Visualisation"), this, SLOT( slotAnimate() ) );

        contextMenuObj->addSeparator();
        contextMenuObj->addAction(tr("&Reload"), this, SLOT( slotReload() ) );

        contextMenuObj->addSeparator();
	contextMenuObj->addAction(tr("De&lete"),(QWidget*) manager, SLOT(slotDelete()) );
}
Exemplo n.º 2
0
FolderPlaylist::FolderPlaylist(PlaylistCollection *collection, const QString &folder,
                               const QString &name) :
    Playlist(collection, name, "folder"),
    m_folder(folder)
{
    QTimer::singleShot(0, this, SLOT(slotReload()));
}
Exemplo n.º 3
0
void KHelpMain::createToolbar()
{
	QPixmap pixmap;
	QString pmpath;

	KToolBar *tb = new KToolBar( this );


	pixmap = kapp->getIconLoader()->loadIcon( "back.xpm" );
	tb->insertButton(pixmap, 0, SIGNAL( clicked() ),
		    helpwin, SLOT( slotBack() ),
		    FALSE, klocale->translate("Previous Document"));

	pixmap = kapp->getIconLoader()->loadIcon( "forward.xpm" );
	tb->insertButton(pixmap, 1, SIGNAL( clicked() ),
		    helpwin, SLOT( slotForward() ),
		    FALSE, klocale->translate("Next Document"));

	tb->insertSeparator();

	pixmap = kapp->getIconLoader()->loadIcon( "prev.xpm" );
	tb->insertButton(pixmap, 2, SIGNAL( clicked() ),
		    helpwin, SLOT( slotPrev() ),
		    FALSE, klocale->translate("Previous Node"));

	pixmap = kapp->getIconLoader()->loadIcon( "next.xpm" );
	tb->insertButton(pixmap, 3, SIGNAL( clicked() ),
		    helpwin, SLOT( slotNext() ),
		    FALSE, klocale->translate("Next Node"));

	pixmap = kapp->getIconLoader()->loadIcon( "up.xpm" );
	tb->insertButton(pixmap, 4, SIGNAL( clicked() ),
		    helpwin, SLOT( slotUp() ),
		    FALSE,klocale->translate( "Up one Node"));

	pixmap = kapp->getIconLoader()->loadIcon( "top.xpm" );
	tb->insertButton(pixmap, 5, SIGNAL( clicked() ),
		    helpwin, SLOT( slotTop() ),
		    FALSE, klocale->translate("Top Node"));

	tb->insertSeparator();

	pixmap = kapp->getIconLoader()->loadIcon( "contents.xpm" );
	tb->insertButton(pixmap, 6, SIGNAL( clicked() ),
		    helpwin, SLOT( slotDir() ),
		    FALSE, klocale->translate("Help Contents"));

	pixmap = kapp->getIconLoader()->loadIcon( "reload.xpm" );
	tb->insertButton(pixmap, 7, SIGNAL( clicked() ),
		helpwin, SLOT( slotReload() ),
		TRUE, klocale->translate( "Reload current document" ) );

	pixmap = kapp->getIconLoader()->loadIcon( "stop.xpm" );
	tb->insertButton(pixmap, 8, SIGNAL( clicked() ),
		    helpwin, SLOT( slotStopProcessing() ),
		    FALSE, klocale->translate("Stop"));

	tb->setBarPos( KToolBar::Top );
	toolbar = tb;
}
void BedCorrelationItemView::slotCustomContextMenuRequested(const QPoint& p) {
    QMenu* m = new QMenu(this);

    QAction* reloadA = new QAction(tr("Reload"), this);
    QAction* createA = new QAction(tr("Create BedCorrelation..."), this);
    QAction* editA = new QAction(tr("Edit..."), this);
    QAction* deleteA = new QAction(tr("Delete"), this);

    connect(reloadA, SIGNAL(activated()), this, SLOT(slotReload()));
    connect(createA, SIGNAL(activated()), this, SLOT(slotCreate()));
    connect(editA, SIGNAL(activated()), this, SLOT(slotEdit()));
    connect(deleteA, SIGNAL(activated()), this, SLOT(slotDelete()));

    m->addAction(createA);

    if (selectedIndexes().count() == 1) {
        m->insertSeparator(editA);
        m->addAction(editA);
    }

    if (selectedIndexes().count() > 0) {
        m->insertSeparator(deleteA);
        m->addAction(deleteA);
    }
    m->addAction(reloadA);
    m->exec(mapToGlobal(p));
}
void ClasticGrainSizeView::slotCustomContextMenuRequested(const QPoint& p) {
    QMenu* m = new QMenu(this);

    QAction* reloadA = new QAction(tr("Reload"), this);

    connect(reloadA, SIGNAL(activated()), this, SLOT(slotReload()));

    m->addAction(reloadA);
    m->exec(mapToGlobal(p));
}
Exemplo n.º 6
0
/**
 * Настройка обработчиков главного окна
 *
 * @author  Цалко Т.В.
 * @since   2.0
 */
void ddmMainWindow::setupEvents()
{
    // добавляем обработку нажатия кнопки выход
    connect( this->ui->quitAction, SIGNAL( triggered() ), this, SLOT( slotQuit() ) );

    // обновляем html страницу
    this->ui->reloadAction->setShortcut( QKeySequence( tr( "F5" ) ) );
    connect( this->ui->reloadAction, SIGNAL( triggered() ), this, SLOT( slotReload() ) );
    connect( this->ui->increaseZoomAction, SIGNAL( triggered() ), this, SLOT( slotIncreaseZoom() ) );
    connect( this->ui->decreaseZoomAction, SIGNAL( triggered() ), this, SLOT( slotDecreaseZoom() ) );
}
Exemplo n.º 7
0
void PdfViewer::slotReloadWhenIdle(const QString &file)
{
	Q_UNUSED(file);
	if (m_reloadTimer)
		m_reloadTimer->stop();
	else
	{
		m_reloadTimer = new QTimer(this);
		m_reloadTimer->setSingleShot(true);
		m_reloadTimer->setInterval(1500);
		connect(m_reloadTimer, SIGNAL(timeout()), this, SLOT(slotReload()));
	}
	m_reloadTimer->start();
}
Exemplo n.º 8
0
QkReferenceWidget::QkReferenceWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::QkReferenceWidget)
{
    ui->setupUi(this);

    QStringList refNames;
    refNames << "QkProgram" << "QkPeripheral" << "QkDSP";

    ui->comboRefName->addItems(refNames);
    slotReload();

    connect(ui->comboRefName, SIGNAL(currentIndexChanged(int)), this, SLOT(slotReload()));

    setWindowFlags(Qt::Tool);
    setWindowTitle("QkReference");
    resize(750,600);
}
int WebBrowser::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: slotGo(); break;
        case 1: slotFinished((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 2: slotForward(); break;
        case 3: slotBack(); break;
        case 4: slotReload(); break;
        case 5: clickFindAnswer(); break;
        case 6: clickHyperlink((*reinterpret_cast< const QUrl(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 7;
    }
    return _id;
}
Exemplo n.º 10
0
void DolphinRemoteEncoding::fillMenu()
{
    QMenu* menu = m_menu->menu();
    menu->clear();


    for (int i = 0; i < m_encodingDescriptions.size();i++) {
        QAction* action = new QAction(m_encodingDescriptions.at(i), this);
        action->setCheckable(true);
        action->setData(i);
        menu->addAction(action);
    }
    menu->addSeparator();

    menu->addAction(i18n("Reload"), this, SLOT(slotReload()), 0);
    menu->addAction(i18n("Default"), this, SLOT(slotDefault()), 0)->setCheckable(true);
    m_idDefault = m_encodingDescriptions.size() + 2;

    connect(menu, &QMenu::triggered, this, &DolphinRemoteEncoding::slotItemSelected);
}
Exemplo n.º 11
0
dlgMyBrowser::dlgMyBrowser(int *sock, int ident, QWidget *parent, const char *manual)
{
  if(opt.arg_debug) printf("dlgMyBrowser:dlgMyBrowser()\n");
  s = sock;
  id = ident;
  mainWindow = (MainWindow *) parent;
  form = new Ui_MyBrowser;
  form->setupUi(this);
#ifdef USE_WEBKIT  
  QObject::connect(form->pushButtonBack,SIGNAL(clicked())              ,this, SLOT(slotBack()));
  QObject::connect(form->pushButtonHome,SIGNAL(clicked())              ,this, SLOT(slotHome()));
  QObject::connect(form->pushButtonForward,SIGNAL(clicked())           ,this, SLOT(slotForward()));
  QObject::connect(form->pushButtonReload,SIGNAL(clicked())            ,this, SLOT(slotReload()));
  QObject::connect(form->pushButtonFind,SIGNAL(clicked())              ,this, SLOT(slotFind()));
  QObject::connect(form->lineEditPattern,SIGNAL(returnPressed())       ,this, SLOT(slotFind()));
  QObject::connect(form->browser,SIGNAL(urlChanged(const QUrl &))      ,this, SLOT(slotUrlChanged(const QUrl &)));
  QObject::connect(form->browser,SIGNAL(linkClicked(const QUrl &))     ,this, SLOT(slotLinkClicked(const QUrl &)));
  QObject::connect(form->browser,SIGNAL(titleChanged(const QString &)) ,this, SLOT(slotTitleChanged(const QString &)));
  QObject::connect(form->browser,SIGNAL(loadFinished(bool))            ,this, SLOT(slotLoadFinished(bool)));
  //QWebPage *page = form->browser->page();
  //QObject::connect(page,SIGNAL(unsupportedContent(QNetworkReply *)),this, SLOT(slotUnsupportedContent(QNetworkReply *)));
  //enabling plugins leads to problems
  //see: https://bugs.webkit.org/show_bug.cgi?id=56552 that we have reported
  if(opt.enable_webkit_plugins)
  {
    if(opt.arg_debug) printf("enable_webkit_plugins\n");
    form->browser->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
    form->browser->settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
  }
  else
  {
    if(opt.arg_debug) printf("do not enable_webkit_plugins\n");
    form->browser->settings()->setAttribute(QWebSettings::PluginsEnabled, false);
    form->browser->settings()->setAttribute(QWebSettings::JavascriptEnabled, false);
  }
#endif
  if(manual == NULL) return;
}
Exemplo n.º 12
0
void CDiaryEdit::slotIntReload()
{
    slotReload(false);
}
Exemplo n.º 13
0
void CDiaryEdit::slotReload()
{
    slotReload(true);
}
Exemplo n.º 14
0
CMapToolWidget::CMapToolWidget(QTabWidget * parent)
    : QWidget(parent)
    , path("./")
{
    setupUi(this);
    setObjectName("Maps");
    parent->addTab(this,QIcon(":/icons/iconMap16x16.png"),"");
    parent->setTabToolTip(parent->indexOf(this), tr("Maps"));

    connect(&CMapDB::self(), SIGNAL(sigChanged()), this, SLOT(slotDBChanged()));

    contextMenuKnownMaps = new QMenu(this);
    actReload = contextMenuKnownMaps->addAction(QPixmap(":/icons/iconReload16x16.png"),tr("Reload map..."),this,SLOT(slotReload()));
    actAddDEM = contextMenuKnownMaps->addAction(QPixmap(":/icons/iconDEM16x16.png"),tr("Add DEM..."),this,SLOT(slotAddDEM()));
    actDelDEM = contextMenuKnownMaps->addAction(QPixmap(":/icons/iconNoDEM16x16.png"),tr("Del. DEM..."),this,SLOT(slotDelDEM()));
    actCfgMap = contextMenuKnownMaps->addAction(QPixmap(":/icons/iconInfo16x16.png"),tr("Info/Config"),this,SLOT(slotCfgMap()));
    actDelMap = contextMenuKnownMaps->addAction(QPixmap(":/icons/iconClear16x16.png"),tr("Delete"),this,SLOT(slotDeleteKnownMap()));
    actAddTMS = contextMenuKnownMaps->addAction(QPixmap(":/icons/iconAdd16x16.png"),tr("Add TMS map..."),this,SLOT(slotAddTmsMap()));;

    connect(treeKnownMapsStream,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(slotContextMenuKnownMaps(const QPoint&)));
    connect(treeKnownMapsStream,SIGNAL(itemClicked(QTreeWidgetItem*, int)),this,SLOT(slotKnownMapClicked(QTreeWidgetItem*, int)));
    connect(treeKnownMapsStream,SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)),this,SLOT(slotKnownMapDoubleClicked(QTreeWidgetItem*, int)));

    connect(treeKnownMapsRaster,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(slotContextMenuKnownMaps(const QPoint&)));
    connect(treeKnownMapsRaster,SIGNAL(itemClicked(QTreeWidgetItem*, int)),this,SLOT(slotKnownMapClicked(QTreeWidgetItem*, int)));
    connect(treeKnownMapsRaster,SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)),this,SLOT(slotKnownMapDoubleClicked(QTreeWidgetItem*, int)));

    connect(treeKnownMapsVector,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(slotContextMenuKnownMaps(const QPoint&)));
    connect(treeKnownMapsVector,SIGNAL(itemClicked(QTreeWidgetItem*, int)),this,SLOT(slotKnownMapClicked(QTreeWidgetItem*, int)));
    connect(treeKnownMapsVector,SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)),this,SLOT(slotKnownMapDoubleClicked(QTreeWidgetItem*, int)));

    contextMenuSelectedMaps = new QMenu(this);
    contextMenuSelectedMaps->addAction(QPixmap(":/icons/iconFileSave16x16.png"),tr("Export"),this,SLOT(slotExportMap()));
    contextMenuSelectedMaps->addAction(QPixmap(":/icons/iconClear16x16.png"),tr("Delete"),this,SLOT(slotDeleteSelectedMap()));
    connect(listSelectedMaps,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(slotContextMenuSelectedMaps(const QPoint&)));
    connect(listSelectedMaps,SIGNAL(itemDoubleClicked(QListWidgetItem*)),this,SLOT(slotSelectedMapClicked(QListWidgetItem*)));
    connect(listSelectedMaps,SIGNAL(itemClicked(QListWidgetItem*)),this,SLOT(slotSelectMap(QListWidgetItem*)));

    connect(pushExportMap, SIGNAL(clicked()), this, SLOT(slotExportMap()));

    tabWidget->setTabIcon(eTabStream, QIcon(":/icons/iconStream22x22.png"));
    tabWidget->setTabText(eTabStream,tr("Stream"));
    tabWidget->setTabIcon(eTabRaster, QIcon(":/icons/iconRaster22x22.png"));
    tabWidget->setTabText(eTabRaster,tr("Raster"));
    tabWidget->setTabIcon(eTabVector, QIcon(":/icons/iconVector22x22.png"));
    tabWidget->setTabText(eTabVector,tr("Vector"));

}
Exemplo n.º 15
0
void PdfViewer::createActions()
{
	// File
    m_fileOpenAction = new QAction(Icon("document-open"), tr("&Open...", "Action: open file"), this);
#ifndef QT_NO_SHORTCUT
    m_fileOpenAction->setShortcut(QKeySequence::Open);
#endif // QT_NO_SHORTCUT
	m_fileOpenAction->setObjectName("file_open");
	connect(m_fileOpenAction, SIGNAL(triggered()), this, SLOT(slotOpenFile()));
#ifndef QT_NO_SHORTCUT
	ShortcutHandler::instance()->addAction(m_fileOpenAction);
#endif // QT_NO_SHORTCUT

    m_ReloadDocAction = new QAction(Icon("reload3"), tr("Re&load...", "Action: reload file"), this);
#ifndef QT_NO_SHORTCUT
    m_ReloadDocAction->setShortcut(tr("Ctrl+L"));
#endif // QT_NO_SHORTCUT
    m_ReloadDocAction->setObjectName("file_reload");
    connect(m_ReloadDocAction, SIGNAL(triggered()), this, SLOT(slotReload()));
#ifndef QT_NO_SHORTCUT
    ShortcutHandler::instance()->addAction(m_ReloadDocAction);
#endif // QT_NO_SHORTCUT

    m_fileSaveCopyAction = new QAction(Icon("document-save-as"), tr("&Save a Copy...", "Action: save a copy of the open file"), this);
#ifndef QT_NO_SHORTCUT
    m_fileSaveCopyAction->setShortcut(tr("Ctrl+Shift+S"));
#endif // QT_NO_SHORTCUT
    m_fileSaveCopyAction->setEnabled(false);
	m_fileSaveCopyAction->setObjectName("file_save_copy");
	connect(m_fileSaveCopyAction, SIGNAL(triggered()), this, SLOT(slotSaveCopy()));
#ifndef QT_NO_SHORTCUT
	ShortcutHandler::instance()->addAction(m_fileSaveCopyAction);
#endif // QT_NO_SHORTCUT

	m_printAction = m_pdfView->action(PdfView::Print);
	m_printAction->setIcon(Icon("document-print"));
#ifndef QT_NO_SHORTCUT
	ShortcutHandler::instance()->addAction(m_printAction);
#endif // QT_NO_SHORTCUT

    m_quitAction = new QAction(Icon("application-exit"), tr("&Quit", "Action: quit the application"), this);
#ifndef QT_NO_SHORTCUT
    m_quitAction->setShortcut(QKeySequence::Quit);
#endif // QT_NO_SHORTCUT
	m_quitAction->setObjectName("application_exit");
//	connect(m_quitAction, SIGNAL(triggered()), qApp, SLOT(closeAllWindows()));
	connect(m_quitAction, SIGNAL(triggered()), this, SLOT(close()));
#ifndef QT_NO_SHORTCUT
	ShortcutHandler::instance()->addAction(m_quitAction);
#endif // QT_NO_SHORTCUT

	// Edit
	m_findAction = new QAction(Icon("edit-find"), tr("&Find...", "Action"), this);
#ifndef QT_NO_SHORTCUT
	m_findAction->setShortcut(QKeySequence::Find);
#endif // QT_NO_SHORTCUT
	m_findAction->setEnabled(false);
	m_findAction->setObjectName("edit_find");
	connect(m_findAction, SIGNAL(triggered()), this, SLOT(slotFind()));
#ifndef QT_NO_SHORTCUT
	ShortcutHandler::instance()->addAction(m_findAction);
#endif // QT_NO_SHORTCUT

	m_findNextAction = new QAction(tr("Find &Next", "Action"), this);
#ifndef QT_NO_SHORTCUT
	m_findNextAction->setShortcut(QKeySequence::FindNext);
#endif // QT_NO_SHORTCUT
	m_findNextAction->setEnabled(false);
	m_findNextAction->setObjectName("edit_find_next");
	connect(m_findNextAction, SIGNAL(triggered()), this, SLOT(slotFindNext()));
#ifndef QT_NO_SHORTCUT
	ShortcutHandler::instance()->addAction(m_findNextAction);
#endif // QT_NO_SHORTCUT

	m_findPreviousAction = new QAction(tr("Find &Previous", "Action"), this);
#ifndef QT_NO_SHORTCUT
	m_findPreviousAction->setShortcut(QKeySequence::FindPrevious);
#endif // QT_NO_SHORTCUT
	m_findPreviousAction->setEnabled(false);
	m_findPreviousAction->setObjectName("edit_find_previous");
	connect(m_findPreviousAction, SIGNAL(triggered()), this, SLOT(slotFindPrevious()));
#ifndef QT_NO_SHORTCUT
	ShortcutHandler::instance()->addAction(m_findPreviousAction);
#endif // QT_NO_SHORTCUT

	// View
	m_zoomInAction = m_pdfView->action(PdfView::ZoomIn);
	m_zoomInAction->setIcon(Icon("zoom-in"));
#ifndef QT_NO_SHORTCUT
	ShortcutHandler::instance()->addAction(m_zoomInAction);
#endif // QT_NO_SHORTCUT

	m_zoomOutAction = m_pdfView->action(PdfView::ZoomOut);
	m_zoomOutAction->setIcon(Icon("zoom-out"));
#ifndef QT_NO_SHORTCUT
	ShortcutHandler::instance()->addAction(m_zoomOutAction);
#endif // QT_NO_SHORTCUT

	m_zoomAction = m_pdfView->action(PdfView::Zoom);

	m_showPresentationAction = new QAction(Icon("view-presentation"), tr("P&resentation", "Action"), this);
#ifndef QT_NO_SHORTCUT
	m_showPresentationAction->setShortcut(tr("Ctrl+Shift+P"));
#endif // QT_NO_SHORTCUT
	m_showPresentationAction->setEnabled(false);
	m_showPresentationAction->setObjectName("view_presentation");
	connect(m_showPresentationAction, SIGNAL(triggered()), this, SLOT(slotShowPresentation()));
#ifndef QT_NO_SHORTCUT
	ShortcutHandler::instance()->addAction(m_showPresentationAction);
#endif // QT_NO_SHORTCUT

	// Go
	m_goToStartAction = m_pdfView->action(PdfView::GoToStartOfDocument);
	m_goToStartAction->setIcon(Icon("go-first"));
#ifndef QT_NO_SHORTCUT
	ShortcutHandler::instance()->addAction(m_goToStartAction);
#endif // QT_NO_SHORTCUT

	m_goToEndAction = m_pdfView->action(PdfView::GoToEndOfDocument);
	m_goToEndAction->setIcon(Icon("go-last"));
#ifndef QT_NO_SHORTCUT
	ShortcutHandler::instance()->addAction(m_goToEndAction);
#endif // QT_NO_SHORTCUT

	m_goToPreviousPageAction = m_pdfView->action(PdfView::GoToPreviousPage);
	m_goToPreviousPageAction->setIcon(Icon("go-previous"));
#ifndef QT_NO_SHORTCUT
	ShortcutHandler::instance()->addAction(m_goToPreviousPageAction);
#endif // QT_NO_SHORTCUT

	m_goToNextPageAction = m_pdfView->action(PdfView::GoToNextPage);
	m_goToNextPageAction->setIcon(Icon("go-next"));
#ifndef QT_NO_SHORTCUT
	ShortcutHandler::instance()->addAction(m_goToNextPageAction);
#endif // QT_NO_SHORTCUT

	m_goToPageAction = m_pdfView->action(PdfView::GoToPage);

    m_amkhlvDnAction = m_pdfView->action(PdfView::AmkhlvDn);
    m_amkhlvUpAction = m_pdfView->action(PdfView::AmkhlvUp);
    m_amkhlvDnFAction = m_pdfView->action(PdfView::AmkhlvDnF);
    m_amkhlvUpFAction = m_pdfView->action(PdfView::AmkhlvUpF);
    m_amkhlvRtAction = m_pdfView->action(PdfView::AmkhlvRt);
    m_amkhlvLtAction = m_pdfView->action(PdfView::AmkhlvLt);
    m_amkhlvRtFAction = m_pdfView->action(PdfView::AmkhlvRtF);
    m_amkhlvLtFAction = m_pdfView->action(PdfView::AmkhlvLtF);
    m_ReturnBackAction = m_pdfView->action(PdfView::ReturnBack);
    m_ReturnBackAction->setIcon(Icon("stock_undo"));

#ifndef QT_NO_SHORTCUT
	ShortcutHandler::instance()->addAction(m_amkhlvDnAction);
	ShortcutHandler::instance()->addAction(m_amkhlvDnFAction);
	ShortcutHandler::instance()->addAction(m_amkhlvRtAction);
	ShortcutHandler::instance()->addAction(m_amkhlvRtFAction);
#endif // QT_NO_SHORTCUT
#ifndef QT_NO_SHORTCUT
	ShortcutHandler::instance()->addAction(m_amkhlvUpAction);
	ShortcutHandler::instance()->addAction(m_amkhlvUpFAction);
	ShortcutHandler::instance()->addAction(m_amkhlvLtAction);
	ShortcutHandler::instance()->addAction(m_amkhlvLtFAction);
    ShortcutHandler::instance()->addAction(m_ReturnBackAction);
    ShortcutHandler::instance()->addAction(m_ReloadDocAction);
#endif // QT_NO_SHORTCUT


	// Tools
	m_mouseBrowseAction = m_pdfView->action(PdfView::MouseToolBrowse);
	m_mouseBrowseAction->setIcon(Icon("input-mouse"));
#ifndef QT_NO_SHORTCUT
	m_mouseBrowseAction->setShortcut(tr("Ctrl+1"));
	ShortcutHandler::instance()->addAction(m_mouseBrowseAction);
#endif // QT_NO_SHORTCUT

	m_mouseMagnifyAction = m_pdfView->action(PdfView::MouseToolMagnify);
	m_mouseMagnifyAction->setIcon(Icon("page-zoom"));
#ifndef QT_NO_SHORTCUT
	m_mouseMagnifyAction->setShortcut(tr("Ctrl+2"));
	ShortcutHandler::instance()->addAction(m_mouseMagnifyAction);
#endif // QT_NO_SHORTCUT

	m_mouseSelectionAction = m_pdfView->action(PdfView::MouseToolSelection);
	m_mouseSelectionAction->setIcon(Icon("select-rectangular"));
#ifndef QT_NO_SHORTCUT
	m_mouseSelectionAction->setShortcut(tr("Ctrl+3"));
	ShortcutHandler::instance()->addAction(m_mouseSelectionAction);
#endif // QT_NO_SHORTCUT

	m_mouseTextSelectionAction = m_pdfView->action(PdfView::MouseToolTextSelection);
	m_mouseTextSelectionAction->setIcon(Icon("draw-text"));
#ifndef QT_NO_SHORTCUT
	m_mouseTextSelectionAction->setShortcut(tr("Ctrl+4"));
	ShortcutHandler::instance()->addAction(m_mouseTextSelectionAction);
#endif // QT_NO_SHORTCUT

	// Settings
    m_settingsTextAAAction = new QAction(tr("&Text Antialias", "Action: enable/disable antialias"), this);
    m_settingsTextAAAction->setCheckable(true);
    connect(m_settingsTextAAAction, SIGNAL(toggled(bool)), this, SLOT(slotToggleTextAA(bool)));

    m_settingsGfxAAAction = new QAction(tr("&Graphics Antialias", "Action: enable/disable antialias"), this);
    m_settingsGfxAAAction->setCheckable(true);
    connect(m_settingsGfxAAAction, SIGNAL(toggled(bool)), this, SLOT(slotToggleGfxAA(bool)));

	QMenu *settingsRenderMenu = new QMenu(tr("&Render Backend", "Menu title"), this);
	m_settingsRenderBackendGrp = new QActionGroup(settingsRenderMenu);
	m_settingsRenderBackendGrp->setExclusive(true);
	QAction *action = settingsRenderMenu->addAction(tr("&Splash", "Action: select render backend"));
	action->setCheckable(true);
	action->setChecked(true);
	action->setData(qVariantFromValue(int(Poppler::Document::SplashBackend)));
	m_settingsRenderBackendGrp->addAction(action);
	action = settingsRenderMenu->addAction(tr("&Arthur", "Action: select render backend"));
	action->setCheckable(true);
	action->setData(qVariantFromValue(int(Poppler::Document::ArthurBackend)));
	m_settingsRenderBackendGrp->addAction(action);
	connect(m_settingsRenderBackendGrp, SIGNAL(triggered(QAction*)), this, SLOT(slotRenderBackend(QAction*)));
	m_renderBackendAction = new QAction(tr("&Render Backend", "Menu title"), this);
	m_renderBackendAction->setMenu(settingsRenderMenu);

	m_configureAction = new QAction(Icon("configure"), tr("&Configure %1...", "Action: show configuration dialog").arg(QCoreApplication::applicationName()), this);
	connect(m_configureAction, SIGNAL(triggered()), this, SLOT(slotConfigure()));
}
Exemplo n.º 16
0
void KHelpMain::createMenu()
{
    KStdAccel stdAccel;
	fileMenu = new QPopupMenu;
	CHECK_PTR( fileMenu );
	fileMenu->insertItem( klocale->translate("&New Help Window"), this,
                        SLOT( slotCloneWindow() ), stdAccel.openNew() );
	fileMenu->insertSeparator();
	fileMenu->insertItem( klocale->translate("&Open File..."), helpwin,
                        SLOT(slotOpenFile()), stdAccel.open() );
//	fileMenu->insertItem( klocale->translate("Open UR&L..."), helpwin,
//                        SLOT(slotOpenURL()) );
	fileMenu->insertItem( klocale->translate("&Reload"), helpwin,
                        SLOT(slotReload()) );
	fileMenu->insertSeparator();
	fileMenu->insertItem( klocale->translate("&Search"), helpwin,
                        SLOT(slotSearch()) );
	fileMenu->insertSeparator();
	fileMenu->insertItem( klocale->translate("&Print..."), helpwin,
                        SLOT(slotPrint()), stdAccel.print() );
	fileMenu->insertSeparator();
	idClose = fileMenu->insertItem(klocale->translate("&Close"),this,
                        SLOT(slotClose()), stdAccel.close()); // CC :!!!!!
	fileMenu->insertItem( klocale->translate("&Quit"), this,
                        SLOT(slotQuit()), stdAccel.quit() );

	editMenu = new QPopupMenu;
	CHECK_PTR( editMenu );
	idCopy = editMenu->insertItem(klocale->translate("&Copy"), helpwin,
                        SLOT(slotCopy()), stdAccel.copy() );
	editMenu->insertItem(klocale->translate("&Find..."), helpwin,
                        SLOT(slotFind()), stdAccel.find() );
	editMenu->insertItem(klocale->translate("Find &next"), helpwin,
                        SLOT(slotFindNext()), Key_F3 );

	gotoMenu = new QPopupMenu;
	CHECK_PTR( gotoMenu );
	idBack = gotoMenu->insertItem( klocale->translate("&Back"), helpwin,
                        SLOT(slotBack()) );
	idForward = gotoMenu->insertItem( klocale->translate("&Forward"), helpwin,
                        SLOT(slotForward()) );
	gotoMenu->insertSeparator();
	idDir = gotoMenu->insertItem( klocale->translate("&Contents"), helpwin,
                        SLOT(slotDir()) );
	idTop = gotoMenu->insertItem( klocale->translate("&Top"), helpwin,
                        SLOT(slotTop()) );
	idUp = gotoMenu->insertItem( klocale->translate("&Up"), helpwin,
                        SLOT(slotUp()) );
	idPrev = gotoMenu->insertItem( klocale->translate("&Previous"), helpwin,
                        SLOT(slotPrev()) );
	idNext = gotoMenu->insertItem( klocale->translate("&Next"), helpwin,
                        SLOT(slotNext()) );

	bookmarkMenu = new QPopupMenu;
	CHECK_PTR( bookmarkMenu );
	connect( bookmarkMenu, SIGNAL( activated( int ) ),
			helpwin, SLOT( slotBookmarkSelected( int ) ) );
	connect( bookmarkMenu, SIGNAL( highlighted( int ) ),
			helpwin, SLOT( slotBookmarkHighlighted( int ) ) );

	optionsMenu = new QPopupMenu;
	CHECK_PTR( optionsMenu );
	optionsMenu->setCheckable( true );
	optionsMenu->insertItem( klocale->translate("&General Preferences..."), this,
			SLOT(slotOptionsGeneral()) );
	optionsMenu->insertSeparator();
	optionsMenu->insertItem(klocale->translate( "Show &Toolbar"), this,
                        SLOT(slotOptionsToolbar()));

	optionsMenu->insertItem( klocale->translate("Show &Location"), this,
                        SLOT(slotOptionsLocation()) );
	optionsMenu->insertItem( klocale->translate("Show Status&bar"), this,
		SLOT(slotOptionsStatusbar()) );
	optionsMenu->insertSeparator();
	optionsMenu->insertItem( klocale->translate("&Save Options"), this,
                        SLOT(slotOptionsSave()) );

	QString at = klocale->translate("KDE Help System\n");
	at+= klocale->translate("Version ");
	at+= KDEHELP_VERSION;
	at+=klocale->translate("\n\nCopyright (c) 1997 Martin Jones <*****@*****.**>"\
	"\n\nThis program is licensed under the GNU General Public License (GPL)."\
	"\nKDEHelp comes with ABSOLUTELY NO WARRANY to the extent permitted by applicable law.");

	QPopupMenu *helpMenu = kapp->getHelpMenu( true, at );
/*
	QPopupMenu *helpMenu = new QPopupMenu;
	CHECK_PTR( helpMenu );
	helpMenu->insertItem( klocale->translate("&Using KDE Help"), this,
                        SLOT(slotUsingHelp()) ); 
	helpMenu->insertSeparator();
	helpMenu->insertItem( klocale->translate("&About"), this, SLOT(slotAbout()) );
*/
	menu = new KMenuBar( this );
	CHECK_PTR( menu );
	menu->insertItem( klocale->translate("&File"), fileMenu );
	menu->insertItem( klocale->translate("&Edit"), editMenu );
	menu->insertItem( klocale->translate("&Goto"), gotoMenu );
	menu->insertItem( klocale->translate("&Bookmarks"), bookmarkMenu );
	menu->insertItem( klocale->translate("&Options"), optionsMenu );
	menu->insertSeparator();
	menu->insertItem( klocale->translate("&Help"), helpMenu );
}
Exemplo n.º 17
0
void FolderPlaylist::setFolder(const QString &s)
{
    m_folder = s;
    QTimer::singleShot(0, this, SLOT(slotReload()));
}
Exemplo n.º 18
0
void ndManager::setupActions()
{
    //File Menu
    QMenu *fileMenu = menuBar()->addMenu(tr("&File"));

    mNewAction = fileMenu->addAction(tr("&New..."));
    mNewAction->setIcon(QPixmap(":/shared-icons/document-new"));
    mNewAction->setShortcut(QKeySequence::New);
    connect(mNewAction, SIGNAL(triggered()), this, SLOT(slotNewFile()));


    mOpenAction = fileMenu->addAction(tr("&Open..."));
    mOpenAction->setIcon(QPixmap(":/shared-icons/document-open"));
    mOpenAction->setShortcut(QKeySequence::Open);
    connect(mOpenAction, SIGNAL(triggered()), this, SLOT(slotFileOpen()));

    mFileOpenRecent = new QRecentFileAction(this);
    QSettings settings;
    mFileOpenRecent->setRecentFiles(settings.value(QLatin1String("Recent Files"),QStringList()).toStringList());
    fileMenu->addAction(mFileOpenRecent);
    connect(mFileOpenRecent, SIGNAL(recentFileSelected(QString)), this, SLOT(slotFileOpenRecent(QString)));
    connect(mFileOpenRecent, SIGNAL(recentFileListChanged()), this, SLOT(slotSaveRecentFiles()));

    mUseTemplateAction = fileMenu->addAction(tr("Use &Template..."));
    connect(mUseTemplateAction, SIGNAL(triggered()), this, SLOT(slotImport()));

    fileMenu->addSeparator();
    mSaveAction = fileMenu->addAction(tr("Save..."));
    mSaveAction->setIcon(QPixmap(":/shared-icons/document-save"));
    mSaveAction->setShortcut(QKeySequence::Save);
    connect(mSaveAction, SIGNAL(triggered()), this, SLOT(slotSave()));

    mSaveAsAction = fileMenu->addAction(tr("&Save As..."));
    mSaveAsAction->setIcon(QPixmap(":/shared-icons/document-save-as"));
    mSaveAsAction->setShortcut(QKeySequence::SaveAs);
    connect(mSaveAsAction, SIGNAL(triggered()), this, SLOT(slotSaveAs()));


    mSaveAsDefaultAction = fileMenu->addAction(tr("Save as &Default"));
    connect(mSaveAsDefaultAction, SIGNAL(triggered()), this, SLOT(slotSaveDefault()));

    mReloadAction = fileMenu->addAction(tr("&Reload"));
    mReloadAction->setShortcut(Qt::Key_F5);
    connect(mReloadAction, SIGNAL(triggered()), this, SLOT(slotReload()));


    fileMenu->addSeparator();


    mCloseAction = fileMenu->addAction(tr("Close"));
    mCloseAction->setIcon(QPixmap(":/shared-icons/document-close"));
    mCloseAction->setShortcut(QKeySequence::Close);
    connect(mCloseAction, SIGNAL(triggered()), this, SLOT(slotFileClose()));


    fileMenu->addSeparator();

    mQuitAction = fileMenu->addAction(tr("Quit"));
    mQuitAction->setIcon(QPixmap(":/shared-icons/window-close"));
    mQuitAction->setShortcut(QKeySequence::Quit);
    connect(mQuitAction, SIGNAL(triggered()), this, SLOT(close()));


    QMenu *actionMenu = menuBar()->addMenu(tr("&Actions"));
    mQueryAction = actionMenu->addAction(tr("&Query"));
#ifndef Q_OS_UNIX
    mQueryAction->setEnabled(false);
#endif
    connect(mQueryAction, SIGNAL(triggered()), this, SLOT(slotQuery()));

    //mProcessingManager = actionMenu->addAction(tr("Show Processing Manager"));

    QMenu *settingsMenu = menuBar()->addMenu(tr("&Settings"));

    //Settings
    mExpertMode = settingsMenu->addAction(tr("&Expert Mode"));
    mExpertMode->setCheckable(true);
    connect(mExpertMode, SIGNAL(triggered(bool)), this, SLOT(slotExpertMode()));
    settingsMenu->addSeparator();

    settings.beginGroup("General");
    if ( settings.contains("expertMode")) mExpertMode->setChecked(settings.value("expertMode").toBool());
	 else mExpertMode->setChecked(true);
    settings.endGroup();

    viewMainToolBar = settingsMenu->addAction(tr("Show Main Toolbar"));

    viewMainToolBar->setCheckable(true);
    viewMainToolBar->setChecked(true);
    connect(viewMainToolBar,SIGNAL(triggered()), this,SLOT(slotViewMainToolBar()));


    viewStatusBar = settingsMenu->addAction(tr("Show StatusBar"));
    viewStatusBar->setCheckable(true);
    connect(viewStatusBar,SIGNAL(triggered()), this,SLOT(slotViewStatusBar()));
    viewStatusBar->setChecked(true);

    QMenu *helpMenu = menuBar()->addMenu(tr("Help"));
    QAction *handbook = helpMenu->addAction(tr("Handbook"));
    handbook->setShortcut(Qt::Key_F1);
    connect(handbook,SIGNAL(triggered()), this,SLOT(slotHanbook()));

    QAction *about = helpMenu->addAction(tr("About"));
    connect(about,SIGNAL(triggered()), this,SLOT(slotAbout()));

    mMainToolBar->addAction(mNewAction);
    mMainToolBar->addAction(mOpenAction);
    mMainToolBar->addAction(mSaveAction);

    resize(800,600);
}