ArchiverWindow::ArchiverWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::ArchiverWindow)
    , m_busy(false)
{
    ui->setupUi(this);

    // Set the archive model
    m_model = new ArchiveModel(this);
    ui->treeView->setModel(m_model);

    connect(ui->actionFileNew, SIGNAL(triggered()),
            this, SLOT(slotFileNew()));
    connect(ui->actionFileOpen, SIGNAL(triggered()),
            this, SLOT(slotFileOpen()));
    connect(ui->actionFileSaveAs, SIGNAL(triggered()),
            this, SLOT(slotFileSaveAs()));
    connect(ui->actionFileQuit, SIGNAL(triggered()),
            this, SLOT(close()));
    connect(ui->actionActionAddFile, SIGNAL(triggered()),
            this, SLOT(slotActionAddFile()));
    connect(ui->actionActionAddFolder, SIGNAL(triggered()),
            this, SLOT(slotActionAddFolder()));
    connect(ui->actionActionDelete, SIGNAL(triggered()),
            this, SLOT(slotActionDelete()));
    connect(ui->actionActionExtract, SIGNAL(triggered()),
            this, SLOT(slotActionExtract()));
    connect(ui->actionHelpAbout, SIGNAL(triggered()),
            this, SLOT(slotHelpAbout()));
}
void TravelWorkbench::initActions()
{
   BEGIN;

   CoaAction *action;

   //action = GETACTION (CoaDefaultActions::actionApplicationSettings);
   //QObject::connect (action, SIGNAL(triggered()), this, SLOT(slotFileNewContact()));

   action = GETACTION (CoaDefaultActions::actionFileNew);
   QObject::connect (action, SIGNAL(triggered()), this, SLOT(slotFileNew()));

   action = GETACTION (CoaDefaultActions::actionFileOpen);
   QObject::connect (action, SIGNAL(triggered()), this, SLOT(slotFileOpen()));

   action = GETACTION (CoaDefaultActions::actionFileSave);
   QObject::connect (action, SIGNAL(triggered()), this, SLOT(slotFileSave()));

   action = GETACTION (CoaDefaultActions::actionFileSaveAs);
   QObject::connect (action, SIGNAL(triggered()), this, SLOT(slotFileSaveAs()));

   action = GETACTION (CoaDefaultActions::actionFileSaveAll);
   QObject::connect (action, SIGNAL(triggered()), this, SLOT(slotFileSaveAll()));

   action = GETACTION (CoaDefaultActions::actionFileClose);
   QObject::connect (action, SIGNAL(triggered()), this, SLOT(slotFileClose()));

   action = GETACTION (CoaDefaultActions::actionFileCloseAll);
   QObject::connect (action, SIGNAL(triggered()), this, SLOT(slotFileCloseAll()));

   action = 0;
}
Ejemplo n.º 3
0
void KgpgApp::initActions()
{
        KStdAction::openNew(TQT_TQOBJECT(this), TQT_SLOT(slotFileNew()), actionCollection());
        KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(slotFileOpen()), actionCollection());
        KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(slotFileSaveAs()), actionCollection());
        KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(slotFileQuit()), actionCollection());
        KStdAction::cut(TQT_TQOBJECT(this), TQT_SLOT(slotEditCut()), actionCollection());
        KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(slotEditCopy()), actionCollection());
        KStdAction::paste(TQT_TQOBJECT(this), TQT_SLOT(slotEditPaste()), actionCollection());
	KStdAction::selectAll(TQT_TQOBJECT(this), TQT_SLOT(slotSelectAll()), actionCollection());
	KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(slotOptions()), actionCollection(),"kgpg_config");

        //KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection());
        //KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(slotConfigureToolbars()), actionCollection());

        fileSave = KStdAction::save(TQT_TQOBJECT(this), TQT_SLOT(slotFileSave()), actionCollection());
        (void) new TDEAction(i18n("&Encrypt File..."), "encrypted", 0,TQT_TQOBJECT(this), TQT_SLOT(slotFilePreEnc()), actionCollection(),"file_encrypt");
        (void) new TDEAction(i18n("&Decrypt File..."), "decrypted", 0,TQT_TQOBJECT(this), TQT_SLOT(slotFilePreDec()), actionCollection(),"file_decrypt");
	(void) new TDEAction(i18n("&Open Key Manager"), "kgpg", 0,TQT_TQOBJECT(this), TQT_SLOT(slotKeyManager()), actionCollection(),"key_manage");
        editUndo = KStdAction::undo(TQT_TQOBJECT(this), TQT_SLOT(slotundo()), actionCollection());
        editRedo = KStdAction::redo(TQT_TQOBJECT(this), TQT_SLOT(slotredo()), actionCollection());
        //(void) new TDEAction(i18n("&Manage Keys"), "kgpg_manage", CTRL+Key_K,TQT_TQOBJECT(this), TQT_SLOT(slotManageKey()), actionCollection(),"keys_manage");
        (void) new TDEAction(i18n("&Generate Signature..."),0, TQT_TQOBJECT(this), TQT_SLOT(slotPreSignFile()), actionCollection(), "sign_generate");
        (void) new TDEAction(i18n("&Verify Signature..."),0, TQT_TQOBJECT(this), TQT_SLOT(slotPreVerifyFile()), actionCollection(), "sign_verify");
        (void) new TDEAction(i18n("&Check MD5 Sum..."), 0,TQT_TQOBJECT(this), TQT_SLOT(slotCheckMd5()), actionCollection(), "sign_check");
	KStdAction::print(TQT_TQOBJECT(this), TQT_SLOT(slotFilePrint()), actionCollection());

    // comment out for now, only confusing
	//encodingAction=new TDEToggleAction(i18n("&Unicode (utf-8) Encoding"), 0, 0,this, TQT_SLOT(slotSetCharset()),actionCollection(),"charsets");
}
Ejemplo n.º 4
0
Archivo: app.cpp Proyecto: speakman/qlc
void App::initMenuBar()
{
	///////////////////////////////////////////////////////////////////
	// File Menu
	m_fileMenu = new QPopupMenu();
	m_fileMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/filenew.png")),
			       "&New", this, SLOT(slotFileNew()),
			       CTRL+Key_N, ID_FILE_NEW);

	m_fileMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/fileopen.png")),
			       "&Open...", this, SLOT(slotFileOpen()),
			       CTRL+Key_O, ID_FILE_OPEN);

	m_fileMenu->insertSeparator();

	m_fileMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/filesave.png")),
			       "&Save", this, SLOT(slotFileSave()),
			       CTRL+Key_S, ID_FILE_SAVE);

	m_fileMenu->insertItem("Save As...", this, SLOT(slotFileSaveAs()),
			       0, ID_FILE_SAVE_AS);

	m_fileMenu->insertSeparator();

	m_fileMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/exit.png")),
			       "E&xit", this, SLOT(slotFileQuit()),
			       CTRL+Key_Q, ID_FILE_QUIT);

	///////////////////////////////////////////////////////////////////
	// Window Menu
	m_windowMenu = new QPopupMenu();
	connect(m_windowMenu, SIGNAL(aboutToShow()),
		this, SLOT(slotRefreshWindowMenu()));

	///////////////////////////////////////////////////////////////////
	// Help menu
	m_helpMenu = new QPopupMenu();
	m_helpMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/help.png")),
			       "Index...", this, SLOT(slotHelpIndex()),
			       SHIFT + Key_F1, ID_HELP_INDEX);
	m_helpMenu->insertSeparator();
	m_helpMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/Q.png")),
			       "About...", this, SLOT(slotHelpAbout()),
			       0, ID_HELP_ABOUT);

	m_helpMenu->insertItem("About Qt...", this, SLOT(slotHelpAboutQt()),
			       0, ID_HELP_ABOUT_QT);

	///////////////////////////////////////////////////////////////////
	// Menubar configuration
	menuBar()->insertItem("File", m_fileMenu);
	menuBar()->insertItem("Window", m_windowMenu);
	menuBar()->insertSeparator();
	menuBar()->insertItem("Help", m_helpMenu);

	menuBar()->setSeparator(QMenuBar::InWindowsStyle);
}
Ejemplo n.º 5
0
int BrowserMainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: loadPage((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 1: slotHome(); break;
        case 2: save(); break;
        case 3: slotLoadProgress((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 4: slotUpdateStatusbar((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 5: slotUpdateWindowTitle((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 6: slotUpdateWindowTitle(); break;
        case 7: loadUrl((*reinterpret_cast< const QUrl(*)>(_a[1]))); break;
        case 8: slotPreferences(); break;
        case 9: slotFileNew(); break;
        case 10: slotFileOpen(); break;
        case 11: slotFilePrintPreview(); break;
        case 12: slotFilePrint(); break;
        case 13: slotPrivateBrowsing(); break;
        case 14: slotFileSaveAs(); break;
        case 15: slotEditFind(); break;
        case 16: slotEditFindNext(); break;
        case 17: slotEditFindPrevious(); break;
        case 18: slotShowBookmarksDialog(); break;
        case 19: slotAddBookmark(); break;
        case 20: slotViewZoomIn(); break;
        case 21: slotViewZoomOut(); break;
        case 22: slotViewResetZoom(); break;
        case 23: slotViewZoomTextOnly((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 24: slotViewToolbar(); break;
        case 25: slotViewBookmarksBar(); break;
        case 26: slotViewStatusbar(); break;
        case 27: slotViewPageSource(); break;
        case 28: slotViewFullScreen((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 29: slotWebSearch(); break;
        case 30: slotToggleInspector((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 31: slotAboutApplication(); break;
        case 32: slotDownloadManager(); break;
        case 33: slotSelectLineEdit(); break;
        case 34: slotAboutToShowBackMenu(); break;
        case 35: slotAboutToShowForwardMenu(); break;
        case 36: slotAboutToShowWindowMenu(); break;
        case 37: slotOpenActionUrl((*reinterpret_cast< QAction*(*)>(_a[1]))); break;
        case 38: slotShowWindow(); break;
        case 39: slotSwapFocus(); break;
        case 40: printRequested((*reinterpret_cast< QWebFrame*(*)>(_a[1]))); break;
        case 41: geometryChangeRequested((*reinterpret_cast< const QRect(*)>(_a[1]))); break;
        case 42: updateToolbarActionText((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 43: updateBookmarksToolbarActionText((*reinterpret_cast< bool(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 44;
    }
    return _id;
}
Ejemplo n.º 6
0
Archivo: app.cpp Proyecto: speakman/qlc
void App::initToolBar()
{
  m_toolbar = new QToolBar(this, "Workspace");

  new QToolButton(QPixmap(QString(PIXMAPS) + QString("/filenew.xpm")), "New...",
		  0, this, SLOT(slotFileNew()), m_toolbar);

  new QToolButton(QPixmap(QString(PIXMAPS) + QString("/fileopen.xpm")), "Load...",
		  0, this, SLOT(slotFileOpen()), m_toolbar);

  new QToolButton(QPixmap(QString(PIXMAPS) + QString("/filesave.xpm")), "Save",
		  0, this, SLOT(slotFileSave()), m_toolbar);
}
Ejemplo n.º 7
0
void KVerbosApp::initActions()
{
  fileNewWindow = new KAction(i18n("New &Window"), "window_new.png", 0, this, SLOT(slotFileNewWindow()), actionCollection(),"file_new_window");
  fileNew = KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection());
  fileOpen = KStdAction::open(this, SLOT(slotFileOpen()), actionCollection());
  fileOpenRecent = KStdAction::openRecent(this, SLOT(slotFileOpenRecent(const KURL&)), actionCollection());
  fileOpenStandard = new KAction(i18n("Open &Standard Verb File"), "fileopen.png", 0, this, SLOT(slotFileOpenStandard()), actionCollection(),"file_open_standard");
  fileSave = KStdAction::save(this, SLOT(slotFileSave()), actionCollection());
  fileSaveAs = KStdAction::saveAs(this, SLOT(slotFileSaveAs()), actionCollection());
  fileClose = KStdAction::close(this, SLOT(slotFileClose()), actionCollection());
  filePrint = KStdAction::print(this, SLOT(slotFilePrint()), actionCollection());
  fileQuit = KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection());
  editCut = KStdAction::cut(this, SLOT(slotEditCut()), actionCollection());
  editCopy = KStdAction::copy(this, SLOT(slotEditCopy()), actionCollection());
  editPaste = KStdAction::paste(this, SLOT(slotEditPaste()), actionCollection());
  editErfassen = new KAction(i18n("E&nter New Verb..."), 0, 0, this, SLOT(slotEditErfassen()), actionCollection(),"edit_erfassen");
  editBearbeiten = new KAction(i18n("&Edit Verb List..."), 0, 0, this, SLOT(slotEditBearbeiten()), actionCollection(), "edit_bearbeiten");

  settingOptions = new KAction(i18n("&Configure KVerbos..."), 0, 0, this, SLOT(slotSettingsOptions()), actionCollection(), "settings_options");
  userUsername = new KAction(i18n("&Username..."), 0, 0, this, SLOT(slotSettingsUsername()), actionCollection(), "user_username");
  userResults = new KAction(i18n("&Results"), 0, 0, this, SLOT(slotUserResults()), actionCollection(), "user_results");
 
  fileNewWindow->setToolTip(i18n("Opens a new application window"));
  fileOpenStandard->setToolTip(i18n("Opens the standard KVerbos verb file"));
  fileNew->setToolTip(i18n("Creates a new document"));
  fileOpen->setToolTip(i18n("Opens an existing document"));
  fileOpenRecent->setToolTip(i18n("Opens a recently used file"));
  fileSave->setToolTip(i18n("Saves the actual document"));
  fileSaveAs->setToolTip(i18n("Saves the actual document as..."));
  fileClose->setToolTip(i18n("Closes the actual document"));
  filePrint ->setToolTip(i18n("Prints out the actual document"));
  fileQuit->setToolTip(i18n("Quits the application"));
  editCut->setToolTip(i18n("Cuts the selected section and puts it to the clipboard"));
  editCopy->setToolTip(i18n("Copies the selected section to the clipboard"));
  editPaste->setToolTip(i18n("Pastes the clipboard contents to actual position"));
  editErfassen->setToolTip(i18n("Add new verbs."));
  editBearbeiten->setToolTip(i18n("Edit the list of verbs."));
  settingOptions->setToolTip(i18n("Change some options of the program"));
  userUsername->setToolTip(i18n("Enter your name as the username"));
  userResults->setToolTip(i18n("These are your latest results."));

  // icons
  editBearbeiten->setIcon("edit.png");
  editErfassen->setIcon("editclear.png");
  settingOptions->setIcon("configure.png");
  userUsername->setIcon("kverbosuser.png");
  userResults->setIcon("kverbosuser.png");
  
  setupGUI();
}
Ejemplo n.º 8
0
void editor::initActions()
{
	fileNew = new QAction(QIcon(":/icons/filenew.png"),tr("&New"),this);
	fileNew->setShortcut(tr("Ctrl+N"));
	fileNew->setStatusTip(tr("Create a new image"));
  connect(fileNew, SIGNAL(triggered()), this, SLOT(slotFileNew()));
	  	
	fileOpen = new QAction(QIcon(":/icons/fileopen.png"),tr("&Open"),this);
	fileOpen->setShortcut(tr("Ctrl+O"));
	fileOpen->setStatusTip(tr("Open an image file"));
  connect(fileOpen, SIGNAL(triggered()), this, SLOT(slotFileOpen()));
	
	fileSave = new QAction(QIcon(":/icons/filesave.png"),tr("&Save file .."),this);
  fileSave->setStatusTip(tr("Save the file under the same name and format"));
  connect(fileSave, SIGNAL(triggered()), this, SLOT(slotFileSave()));
	
	fileSaveImage = new QAction(tr("Save &Image file .."),this);
  fileSaveImage->setStatusTip(tr("Save the file in PNG format"));
  connect(fileSaveImage, SIGNAL(triggered()), this, SLOT(slotFileSaveImage()));
	
	fileSaveTemplate = new QAction(("Save &Template .."),this);
  fileSaveTemplate->setStatusTip(tr("Save template file "));
  connect(fileSaveTemplate, SIGNAL(triggered()), this, SLOT(slotFileSaveTemplate()));
	
	fileQuit = new QAction(tr("Quit"),this);
	fileQuit->setShortcut(tr("Ctrl+Q"));
  fileQuit->setStatusTip(tr("Quits the editor"));
  connect(fileQuit, SIGNAL(triggered()), this, SLOT(slotFileQuit()));
		
	clearAll= new QAction(QIcon(":/icons/eraser.png"),tr("Clear &All"),this);
  clearAll->setShortcut(tr("Ctrl+A"));
  clearAll->setStatusTip(tr("Delete all objects and fill the background with the background color"));
  connect(clearAll, SIGNAL(triggered()), ev, SLOT(slotClearAll()));

	copy= new QAction(tr("Copy"),this);
  copy->setShortcut(tr("Ctrl+C"));
  connect(copy, SIGNAL(triggered()), ev->getScene(), SLOT(slotCopy()));

	paste= new QAction(tr("Paste"),this);
	paste->setShortcut(tr("Ctrl+V"));
    connect(paste, SIGNAL(triggered()), ev->getScene(), SLOT(slotPaste()));

	deleteAction=new QAction(tr("&Delete"),this);
	deleteAction->setShortcut(tr("Del"));
    connect(deleteAction, SIGNAL(triggered()), ev->getScene(), SLOT(slotDeleteItem()));

	dump= new QAction(tr("dump"),this);
  connect(dump, SIGNAL(triggered()), ev, SLOT(slotDump()));
}
void TravelWorkbench::initialize()
{
   CoaWorkbench::initialize();
   initActions();

#ifdef Q_WS_MAC
   slotSwitchToSDIMode();
   slotFileNew(); //create a first, empty window
#else
   slotSwitchToMDIMode();
   //slotFileNew(); //create a first, empty window
#endif


}
Ejemplo n.º 10
0
Archivo: app.cpp Proyecto: speakman/qlc
//
// Create & fill toolbar
//
void App::initToolBar()
{
  m_toolbar = new QToolBar(this, "Workspace");

  QString dir;
  settings()->get(KEY_SYSTEM_DIR, dir);
  dir += QString("/") + PIXMAPPATH;
  
  m_newTB = new QToolButton(QPixmap(dir + QString("/filenew.xpm")), 
			    "New workspace", 0, 
			    this, SLOT(slotFileNew()), m_toolbar);

  m_openTB = new QToolButton(QPixmap(dir + QString("/fileopen.xpm")), 
			     "Open existing workspace", 0, 
			     this, SLOT(slotFileOpen()), m_toolbar);

  m_saveTB = new QToolButton(QPixmap(dir + QString("/filesave.xpm")), 
			     "Save current workspace", 0, 
			     this, SLOT(slotFileSave()), m_toolbar);

  m_toolbar->addSeparator();

  m_dmTB = new QToolButton(QPixmap(dir + QString("/device.xpm")), 
			   "Device manager", 0, 
			   this, SLOT(slotViewDeviceManager()), m_toolbar);

  m_vcTB = new QToolButton(QPixmap(dir + QString("/virtualconsole.xpm")), 
			   "Virtual console", 0, 
			   this, SLOT(slotViewVirtualConsole()), m_toolbar);
  
  m_ftTB = new QToolButton(QPixmap(dir + QString("/chaser.png")),
			   "Function manager", 0,
			   this, SLOT(slotViewFunctionTree()), m_toolbar);

  m_toolbar->addSeparator();

  m_panicTB = new QToolButton(QPixmap(dir + QString("/panic.xpm")), 
			      "Panic!", 0, this, SLOT(slotPanic()), m_toolbar);

  m_blackOutTB = new QToolButton(QPixmap(dir + QString("/blackout.xpm")), 
				 "Blackout", 0, this,
				 SLOT(slotToggleBlackOut()), m_toolbar);

  m_modeTB = new QToolButton(QPixmap(dir + QString("/unlocked.xpm")),
                             "Design Mode; All editing features enabled",
                             0, this, SLOT(slotSetMode()), m_toolbar);

}
Ejemplo n.º 11
0
JuffEd::JuffEd() : Juff::PluginNotifier(), Juff::DocHandlerInt() {
	mw_ = new JuffMW();
	initActions();
	
	viewer_ = new Juff::DocViewer(this);
	mw_->setMainWidget(viewer_);
	settingsDlg_ = new SettingsDlg(mw_);
	connect(settingsDlg_, SIGNAL(applied()), SLOT(onSettingsApplied()));
	
	connect(viewer_, SIGNAL(docActivated(Juff::Document*)), SLOT(onDocActivated(Juff::Document*)));
	connect(mw_, SIGNAL(closeRequested(bool&)), SLOT(onCloseRequested(bool&)));
	
	// UI must be initialized before engines and plugins because 
	// we need menus to be already created when loading engines and plugins.
	initUI();
	
	loadEngines();
	
	pluginMgr_ = new PluginManager(this, this);
	// buildUI() *must* go before loadPlugins() because
	// it creates structures and widgets expected by loadPlugins()
	buildUI();
	
	loadPlugins();
	
	search_ = new SearchEngine(this, mw_);
	
	setSessionName( MainSettings::get( MainSettings::LastSession ) );
	if ( !loadSession() ) {
		slotFileNew();
	}
	
	if ( viewer_->docCount(Juff::PanelAll) == 0 ) {
		openDoc("", Juff::PanelLeft);
		viewer_->hidePanel(Juff::PanelRight);
	}
	else if ( viewer_->docCount(Juff::PanelLeft) == 0 ) {
		viewer_->hidePanel(Juff::PanelLeft);
	}
	else if ( viewer_->docCount(Juff::PanelRight) == 0 ) {
		viewer_->hidePanel(Juff::PanelRight);
	}
	
	onSettingsApplied();

    mw_->restoreState();
}
Ejemplo n.º 12
0
void JuffEd::initActions() {
	CommandStorageInt* st = Juff::Utils::commandStorage();
	
	st->addAction(FILE_NEW,         tr("&New"),     this, SLOT(slotFileNew()));
	st->addAction(FILE_OPEN,        tr("&Open"),    this, SLOT(slotFileOpen()));
	st->addAction(FILE_SAVE,        tr("&Save"),    this, SLOT(slotFileSave()));
	st->addAction(FILE_SAVE_AS,     tr("Save as"), this, SLOT(slotFileSaveAs()));
	st->addAction(FILE_SAVE_ALL,    tr("Save all"), this, SLOT(slotFileSaveAll()));
	st->addAction(FILE_RELOAD,      tr("&Reload"),  this, SLOT(slotFileReload()));
	st->addAction(FILE_RENAME,      tr("Rename"),  this, SLOT(slotFileRename()));
	st->addAction(FILE_CLOSE,       tr("Close"),  this, SLOT(slotFileClose()));
	st->addAction(FILE_CLOSE_ALL,   tr("Close All"),  this, SLOT(slotFileCloseAll()));
	st->addAction(FILE_PRINT,       tr("&Print"),  this, SLOT(slotFilePrint()));
	st->addAction(FILE_EXIT,        tr("Exit"),  this, SLOT(slotFileExit()));
	
	st->addAction(SESSION_NEW,      tr("New session"), this, SLOT(slotSessionNew()));
	st->addAction(SESSION_OPEN,     tr("Open session"), this, SLOT(slotSessionOpen()));
	st->addAction(SESSION_SAVE,     tr("Save session as..."), this, SLOT(slotSessionSaveAs()));
	
	st->addAction(EDIT_UNDO,        tr("Undo"), this, SLOT(slotEditUndo()));
	st->addAction(EDIT_REDO,        tr("Redo"), this, SLOT(slotEditRedo()));
	st->addAction(EDIT_CUT,         tr("Cut"), this, SLOT(slotEditCut()));
	st->addAction(EDIT_COPY,        tr("Copy"), this, SLOT(slotEditCopy()));
	st->addAction(EDIT_PASTE,       tr("Paste"), this, SLOT(slotEditPaste()));
	
	st->addAction(SEARCH_FIND,      tr("Find"), this, SLOT(slotFind()));
	st->addAction(SEARCH_FIND_NEXT, tr("Find next"), this, SLOT(slotFindNext()));
	st->addAction(SEARCH_FIND_PREV, tr("Find previous"), this, SLOT(slotFindPrev()));
	st->addAction(SEARCH_REPLACE,   tr("Replace"), this, SLOT(slotReplace()));
	st->addAction(SEARCH_GOTO_LINE, tr("Go to line"), this, SLOT(slotGotoLine()));
	st->addAction(SEARCH_GOTO_FILE, tr("Go to file"), this, SLOT(slotGotoFile()));
	
	st->addAction(VIEW_ZOOM_IN,      tr("Zoom In"), this, SLOT(slotZoomIn()));
	st->addAction(VIEW_ZOOM_OUT,     tr("Zoom Out"), this, SLOT(slotZoomOut()));
	st->addAction(VIEW_ZOOM_100,     tr("Zoom 100%"), this, SLOT(slotZoom100()));
	st->addAction(VIEW_FULLSCREEN,   tr("Fullscreen"), this, SLOT(slotFullscreen()));
	
	st->addAction(TOOLS_SETTINGS,    tr("Settings"), this, SLOT(slotSettings()));
	st->addAction(HELP_ABOUT,        tr("About"), mw_, SLOT(slotAbout()));
	st->addAction(HELP_ABOUT_QT,     tr("About Qt"), mw_, SLOT(slotAboutQt()));
}
Ejemplo n.º 13
0
int App::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: clipboardChanged(); break;
        case 1: slotFileNew(); break;
        case 2: slotFileOpen(); break;
        case 3: slotFileSave(); break;
        case 4: slotFileSaveAs(); break;
        case 5: slotFileQuit(); break;
        case 6: slotHelpIndex(); break;
        case 7: slotHelpAbout(); break;
        case 8: slotHelpAboutQt(); break;
        default: ;
        }
        _id -= 9;
    }
    return _id;
}
Ejemplo n.º 14
0
void Freecell::initMenuBar()
{
    ///////////////////////////////////////////////////////////////////
    // MENUBAR

    ///////////////////////////////////////////////////////////////////
    // menuBar entry fileMenu

#ifdef QTOPIA
    fileMenu = QSoftMenuBar::menuFor(this);
#else
    fileMenu = menuBar()->addMenu("&File");
#endif

    fileMenu->addAction("Rotate", this, SLOT(slotFileRotate()));
    fileMenu->addAction("New Game", this, SLOT(slotFileNew()));
    fileMenu->addAction("Select Game", this, SLOT(slotFileSelect()));
    fileMenu->addAction("Statistic", this, SLOT(slotFileStatistic()));
    fileMenu->addAction("Options", this, SLOT(slotFileOptions()));
    fileMenu->addAction("Exit", this, SLOT(slotFileQuit()));

    ///////////////////////////////////////////////////////////////////
    // menuBar entry protocolMenu
    protocolMenu = new QMenu();
    protocolMenu->addAction("Start Protocol", this, SLOT(slotProtocolStart()));
    protocolMenu->addAction("Stop Protocol", this, SLOT(slotProtocolStop()));

    ///////////////////////////////////////////////////////////////////
    // menuBar entry viewMenu
    //viewMenu=new QPopupMenu();
    //viewMenu->setCheckable(true);
    //viewMenu->insertItem("Tool&bar", this, SLOT(slotViewToolBar()), 0, ID_VIEW_TOOLBAR);
    //viewMenu->insertItem("&Statusbar", this, SLOT(slotViewStatusBar()), 0, ID_VIEW_STATUSBAR);

    //viewMenu->setItemChecked(ID_VIEW_TOOLBAR, true);
    //viewMenu->setItemChecked(ID_VIEW_STATUSBAR, true);

    ///////////////////////////////////////////////////////////////////
    // EDIT YOUR APPLICATION SPECIFIC MENUENTRIES HERE

    ///////////////////////////////////////////////////////////////////
    // menuBar entry helpMenu
    helpMenu = new QMenu();
    helpMenu->addAction("About...", this, SLOT(slotHelpAbout()));

    ///////////////////////////////////////////////////////////////////
    // MENUBAR CONFIGURATION
    // set menuBar() the current menuBar 

//  menuBar()->insertItem("&File", fileMenu);
//  menuBar()->insertItem("&Protocol", protocolMenu);
//
//  menuBar()->insertSeparator();
//  menuBar()->insertItem("&Help", helpMenu);

    ///////////////////////////////////////////////////////////////////
    // CONNECT THE SUBMENU SLOTS WITH SIGNALS

    connect(fileMenu, SIGNAL(highlighted(int)), SLOT(statusCallback(int)));
    connect(protocolMenu, SIGNAL(highlighted(int)), SLOT(statusCallback(int)));
    connect(helpMenu, SIGNAL(highlighted(int)), SLOT(statusCallback(int)));

}
Ejemplo n.º 15
0
Archivo: app.cpp Proyecto: speakman/qlc
void App::initToolBar()
{
  m_toolbar = new QToolBar(this, "Workspace");

  QString dir;
  settings()->get(KEY_SYSTEM_DIR, dir);
  dir += QString("/") + PIXMAPPATH;
  
  new QToolButton(QPixmap(dir + QString("/filenew.xpm")), "New workspace; clear everything", 0, this, SLOT(slotFileNew()), m_toolbar);

  new QToolButton(QPixmap(dir + QString("/fileopen.xpm")), "Open existing workspace", 0, this, SLOT(slotFileOpen()), m_toolbar);

  new QToolButton(QPixmap(dir + QString("/filesave.xpm")), "Save current workspace", 0, this, SLOT(slotFileSave()), m_toolbar);

  m_toolbar->addSeparator();

  new QToolButton(QPixmap(dir + QString("/device.xpm")), "View device manager", 0, this, SLOT(slotViewDeviceManager()), m_toolbar);

  new QToolButton(QPixmap(dir + QString("/virtualconsole.xpm")), "View virtual console", 0, this, SLOT(slotViewVirtualConsole()), m_toolbar);


  QToolBar* vc = new QToolBar(this, "Virtual Console toolbar");

  new QToolButton(QPixmap(dir + QString("/panic.xpm")), "Panic; Shut down all running functions", 0, this, SLOT(slotPanic()), vc);

  m_modeButton = new QToolButton(QPixmap(dir + QString("/unlocked.xpm")), "Design Mode; All editing features enabled", 0, this, SLOT(slotModeButtonClicked()), vc);
}
Ejemplo n.º 16
0
void PMShell::setupActions( )
{
//   m_helpMenu = new KHelpMenu( this, PMFactory::aboutData( ), true,
//                               actionCollection( ) );

   KStdAction::openNew( this, SLOT( slotFileNew( ) ), actionCollection( ) );
   KStdAction::open( this, SLOT( slotFileOpen( ) ), actionCollection( ) );
   m_pRecent = KStdAction::openRecent( this, SLOT( slotOpenRecent( const KURL& ) ),
                                       actionCollection( ) );
   KStdAction::save( this, SLOT( slotFileSave( ) ), actionCollection( ) );
   KStdAction::saveAs( this, SLOT( slotFileSaveAs( ) ), actionCollection( ) );

   KStdAction::revert( this, SLOT( slotFileRevert( ) ), actionCollection( ) );
   KStdAction::print( this, SLOT( slotFilePrint( ) ), actionCollection( ) );

   KStdAction::close( this, SLOT( slotFileClose( ) ), actionCollection( ) );
   KStdAction::quit( this, SLOT( close( ) ), actionCollection( ) );

   m_pPathAction = new KToggleAction( i18n( "Show &Path" ), 0, this,
                               SLOT( slotShowPath( ) ), actionCollection( ),
                               "options_show_path" );
   m_pPathAction->setCheckedState(i18n("Hide &Path"));

   m_pStatusbarAction = KStdAction::showStatusbar( this, SLOT( slotShowStatusbar( ) ),
                                                   actionCollection( ) );

   KStdAction::saveOptions( this, SLOT( saveOptions( ) ), actionCollection( ) );

   KStdAction::keyBindings( this, SLOT( slotConfigureKeys( ) ),
                            actionCollection( ) );
   KStdAction::configureToolbars( this, SLOT( slotConfigureToolbars( ) ),
                                  actionCollection( ) );
   KStdAction::preferences( this, SLOT( slotSettings( ) ), actionCollection( ) );

   m_pNewTopViewAction = new KAction( i18n( "New Top View" ), 0, this,
                                      SLOT( slotNewTopView( ) ),
                                      actionCollection( ), "view_new_topview" );
   m_pNewBottomViewAction = new KAction( i18n( "New Bottom View" ), 0, this,
                                         SLOT( slotNewBottomView( ) ),
                                         actionCollection( ), "view_new_bottomview" );
   m_pNewLeftViewAction = new KAction( i18n( "New Left View" ), 0, this,
                                       SLOT( slotNewLeftView( ) ),
                                       actionCollection( ), "view_new_leftview" );
   m_pNewRightViewAction = new KAction( i18n( "New Right View" ), 0, this,
                                        SLOT( slotNewRightView( ) ),
                                        actionCollection( ), "view_new_rightview" );
   m_pNewFrontViewAction = new KAction( i18n( "New Front View" ), 0, this,
                                        SLOT( slotNewFrontView( ) ),
                                        actionCollection( ), "view_new_frontview" );
   m_pNewBackViewAction = new KAction( i18n( "New Back View" ), 0, this,
                                       SLOT( slotNewBackView( ) ),
                                       actionCollection( ), "view_new_back_view" );
   m_pNewCameraViewAction = new KAction( i18n( "New Camera View" ), 0, this,
                                         SLOT( slotNewCameraView( ) ),
                                         actionCollection( ), "view_new_cameraview" );

   m_pNewTreeViewAction = new KAction( i18n( "New Object Tree" ), 0, this,
                              SLOT( slotNewTreeView( ) ), actionCollection( ),
                              "view_new_treeview" );
   m_pNewDialogViewAction = new KAction( i18n( "New Properties View" ), 0, this,
                             SLOT( slotNewDialogView( ) ), actionCollection( ),
                             "view_new_dialogview" );

#ifdef KPM_WITH_OBJECT_LIBRARY
   m_pNewLibraryBrowserAction = new KAction( i18n( "New Library Browser" ), 0, this,
                                    SLOT( slotNewLibraryBrowserView( ) ), actionCollection( ),
                                    "view_new_librarybrowser" );
#endif

   // Creating the view layouts menu
   m_pViewLayoutsAction = new KActionMenu( i18n( "View Layouts" ),
                                           actionCollection( ), "view_layouts_menu" );
   KPopupMenu* menu = m_pViewLayoutsAction->popupMenu( );
   connect( menu, SIGNAL( aboutToShow( ) ), SLOT( slotViewsMenuAboutToShow( ) ) );
   PMViewLayoutManager::theManager( )->fillPopupMenu( menu );
   connect( menu, SIGNAL( activated( int ) ), SLOT( slotSelectedLayout( int ) ) );

   m_pSaveViewLayoutAction = new KAction( i18n( "Save View Layout..." ), 0, this,
                                          SLOT( slotSaveViewLayout( ) ),
                                          actionCollection( ), "save_view_layout" );
}
Ejemplo n.º 17
0
Archivo: app.cpp Proyecto: speakman/qlc
//
// Menu bar
//
void App::initMenuBar()
{
  QString dir;
  settings()->get(KEY_SYSTEM_DIR, dir);
  dir += QString("/") + PIXMAPPATH;

  ///////////////////////////////////////////////////////////////////
  // File Menu
  m_fileMenu = new QPopupMenu();
  m_fileMenu->insertItem(QPixmap(dir + QString("/filenew.xpm")),
			 "&New", this, SLOT(slotFileNew()),
			 CTRL+Key_N, ID_FILE_NEW);
  m_fileMenu->insertItem(QPixmap(dir + QString("/fileopen.xpm")), 
			 "&Open...", this, SLOT(slotFileOpen()), 
			 CTRL+Key_O, ID_FILE_OPEN);
  m_fileMenu->insertSeparator();
  m_fileMenu->insertItem(QPixmap(dir + QString("/filesave.xpm")),
			 "&Save", this, SLOT(slotFileSave()), 
			 CTRL+Key_S, ID_FILE_SAVE);
  m_fileMenu->insertItem("Save &As...", this, SLOT(slotFileSaveAs()), 
			 0, ID_FILE_SAVE_AS);
  m_fileMenu->insertSeparator();
  m_fileMenu->insertItem(QPixmap(dir + QString("/settings.xpm")),
			 "Se&ttings...", this, SLOT(slotFileSettings()), 
			 0, ID_FILE_SETTINGS);
  m_fileMenu->insertSeparator();
  m_fileMenu->insertItem(QPixmap(dir + QString("/exit.xpm")),
			 "E&xit", this, SLOT(slotFileQuit()), 
			 CTRL+Key_Q, ID_FILE_QUIT);
  
  connect(m_fileMenu, SIGNAL(aboutToShow()), 
	  this, SLOT(slotRefreshMenus()));

  ///////////////////////////////////////////////////////////////////
  // Tools Menu
  m_toolsMenu = new QPopupMenu();
  m_toolsMenu->setCheckable(true);
  m_toolsMenu->insertItem(QPixmap(dir + QString("/device.xpm")),
			  "Device Manager", this,
			  SLOT(slotViewDeviceManager()),
			  CTRL + Key_M, ID_VIEW_DEVICE_MANAGER);
  m_toolsMenu->insertItem(QPixmap(dir + QString("/virtualconsole.xpm")), 
			  "Virtual Console", this, 
			  SLOT(slotViewVirtualConsole()), 
			  CTRL + Key_V, ID_VIEW_VIRTUAL_CONSOLE);
  m_toolsMenu->insertSeparator();
  m_toolsMenu->insertItem(QPixmap(dir + QString("/chaser.png")), 
			  "Function Manager", this, 
			  SLOT(slotViewFunctionTree()),
			  CTRL + Key_F, ID_VIEW_FUNCTION_TREE);
  m_toolsMenu->insertItem(QPixmap(dir + QString("/bus.xpm")),
			  "Bus Properties", this, 
			  SLOT(slotViewBusProperties()), CTRL + Key_B,
			  ID_VIEW_BUS_PROPERTIES);
  m_toolsMenu->insertSeparator();
  m_toolsMenu->insertItem(QPixmap(dir + QString("/panic.xpm")), "Panic!", 
			  this, SLOT(slotPanic()), CTRL + Key_P,
			  ID_FUNCTIONS_PANIC);

  connect(m_toolsMenu, SIGNAL(aboutToShow()), 
	  this, SLOT(slotRefreshMenus()));

  ////////////////////////////////////////////////////////////////////
  // Mode menu
  m_modeMenu = new QPopupMenu();
  m_modeMenu->setCheckable(true);
  m_modeMenu->insertItem(QPixmap(dir + QString("/unlocked.xpm")),
			 "Design", this,
			 SLOT(slotSetDesignMode()), CTRL + Key_D,
			 ID_FUNCTIONS_MODE_DESIGN);

  m_modeMenu->insertItem(QPixmap(dir + QString("/locked.xpm")),
			 "Operate", this,
			 SLOT(slotSetOperateMode()), CTRL + Key_R,
			 ID_FUNCTIONS_MODE_OPERATE);

  connect(m_modeMenu, SIGNAL(aboutToShow()),
	  this, SLOT(slotRefreshMenus()));

  ///////////////////////////////////////////////////////////////////
  // Window Menu
  m_windowMenu = new QPopupMenu();
  connect(m_windowMenu, SIGNAL(aboutToShow()), 
	  this, SLOT(slotRefreshMenus()));
  
  connect(m_windowMenu, SIGNAL(activated(int)),
	  this, SLOT(slotWindowMenuCallback(int)));

  ///////////////////////////////////////////////////////////////////
  // Help menu
  m_helpMenu = new QPopupMenu();
  m_helpMenu->setCheckable(true);
  m_helpMenu->insertItem(QPixmap(dir + QString("/help.xpm")),
			 "Index...", this, SLOT(slotHelpIndex()),
			 SHIFT + Key_F1, ID_HELP_INDEX);
  m_helpMenu->insertSeparator();
  m_helpMenu->insertItem(QPixmap(dir + QString("/Q.xpm")),
			 "About...", this, SLOT(slotHelpAbout()),
			 0, ID_HELP_ABOUT);
  m_helpMenu->insertItem(QPixmap(dir + QString("/qt.xpm")),
			 "About Qt...", this, SLOT(slotHelpAboutQt()),
			 0, ID_HELP_ABOUT_QT);
  m_helpMenu->insertSeparator();
  m_helpMenu->insertItem(QPixmap(dir + QString("")),
			 "Show Tooltips", this, SLOT(slotHelpTooltips()),
			 0, ID_HELP_TOOLTIPS);

  ///////////////////////////////////////////////////////////////////
  // Menubar configuration
  menuBar()->insertItem("&File", m_fileMenu);
  menuBar()->insertItem("&Tools", m_toolsMenu);
  m_toolsMenu->insertItem("&Mode", m_modeMenu);
  menuBar()->insertItem("&Window", m_windowMenu);
  menuBar()->insertSeparator();  	
  menuBar()->insertItem("&Help", m_helpMenu);

  menuBar()->setSeparator(QMenuBar::InWindowsStyle);
}
Ejemplo n.º 18
0
Freecell::Freecell(QWidget * parent, Qt::WFlags flags)
:  QMainWindow(parent, flags)
    , rotation(90)
{
    FILE *f;

    // create ~/.qfreecell  
    QDir d("/tmp");
    char buffer[200];

    // save location of binary
    d.cdUp();
    strcpy(game_directory, (d.path()).toLatin1().data());

    strcpy(directory, QDir::homePath().toLatin1().data());
    strcat(directory, "/.qfreecell");

    d.setPath(directory);
    if (!d.exists())            // create directories if not exists
    {
        printf("Creating ~/.qfreecell...\n");
        d.mkdir(directory);
        sprintf(buffer, "%s/protocols", directory);
    }
    //Init statistics

    pstatistics = new CStatistics(this, "", false);
    protocol_file = new QString();
    protocol_fd = NULL;

    // first set configuration to default   
    opt.empty_file = new char[200];
    opt.background_file = new char[200];
    opt.background_enabled = new bool;
    opt.background_color = new QColor(0, 128, 0);
    opt.num_freecells = new int;
    opt.spinbox_freecells_min = new int;

    // set picture filename of freecells
    strcpy(opt.empty_file, directory);
    strcat(opt.empty_file, "/freecells/");
    strcat(opt.empty_file, DEFAULT_FREECELL);

    // set background filename
    strcpy(opt.background_file, directory);
    strcat(opt.background_file, "/backgrounds/");
    strcat(opt.background_file, DEFAULT_BACKGROUND);

    // enable backgrounds
    *opt.background_enabled = true;

    // set number of free cells to 4
    *opt.num_freecells = 4;

    //////////////////////////////
    // now read configuration file

    sprintf(buffer, "%s/configuration", directory);
    f = fopen(buffer, "r");
    if (f != NULL) {
        unsigned int i;
        while (fgets(buffer, 200, f) != NULL) {
            i = 0;
            while (buffer[i++] != '\0')
                if (buffer[i - 1] == '\n')
                    buffer[i - 1] = '\0';
            for (i = 0; i < strlen(buffer); i++)
                if (buffer[i] == '=')
                    break;

            if (memcmp(buffer, "background picture", 18) == 0)
                strcpy(opt.background_file, buffer + i + 1);
            if (memcmp(buffer, "freecell", 8) == 0)
                strcpy(opt.empty_file, buffer + i + 1);
            if (memcmp(buffer, "background enabled", 18) == 0)
                if (buffer[i + 1] == '1')
                    *opt.background_enabled = true;
                else
                    *opt.background_enabled = false;
        }
        fclose(f);
    }
    ///////////////////////////////////////////////////////////////////
    // call inits to invoke all other construction parts
    initMenuBar();
    initToolBar();
    initStatusBar();

    initDoc();
    initView();

    slotFileNew();
}
Ejemplo n.º 19
0
void KstApp::initActions() {

  fileNewWindow = new KAction(i18n("New &Window"), 0, 0,
                              this, SLOT(slotFileNewWindow()),
                              actionCollection(),"file_new_window");

  fileOpenNew = KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection());
  fileOpenNew->setWhatsThis(i18n("Open Kst plot file."));

  fileSave = KStdAction::save(   this, SLOT(slotFileSave()), actionCollection());
  fileSave->setWhatsThis(i18n("Save to current Kst plot file."));

  fileSaveAs = KStdAction::saveAs( this, SLOT(slotFileSaveAs()), actionCollection());
  fileSaveAs->setWhatsThis(i18n("Save to new Kst plot file."));

  fileClose = KStdAction::close(  this, SLOT(slotFileClose()), actionCollection());
  fileClose->setWhatsThis(i18n("Close Kst."));

  fileQuit = KStdAction::quit(   this, SLOT(slotFileClose()), actionCollection());
  fileQuit->setWhatsThis(i18n("Quit Kst."));

  fileKeyBindings = KStdAction::keyBindings(this, SLOT(slotConfigureKeys()), actionCollection());
  fileKeyBindings->setWhatsThis(i18n("Bring up a dialog box\n"
                                     "to configure shortcuts."));

  filePreferences = KStdAction::preferences(this, SLOT(slotPreferences()), actionCollection());
  filePreferences->setWhatsThis(i18n("Bring up a dialog box\n"
                                     "to configure Kst settings."));

  fileCopy = KStdAction::copy(this, SLOT(slotCopy()), actionCollection());
  fileCopy->setWhatsThis(i18n("Copy cursor position to the clipboard."));

  /************/
  filePrint = KStdAction::print(this, SLOT(slotFilePrint()),
                                actionCollection());
  filePrint->setToolTip(i18n("Print"));
  filePrint->setWhatsThis(i18n("Print current display"));

  /************/
  ToolBarAction = KStdAction::showToolbar(this, SLOT(slotViewToolBar()),
                                          actionCollection());
  ToolBarAction->setWhatsThis(i18n("Toggle Toolbar"));
  connect(ToolBarAction, SIGNAL(activated()), this, SLOT(setSettingsDirty()));

  /************/
  StatusBarAction = KStdAction::showStatusbar(this, SLOT(slotViewStatusBar()),
                                              actionCollection());
  StatusBarAction->setWhatsThis(i18n("Toggle Statusbar"));
  connect(StatusBarAction, SIGNAL(activated()), this, SLOT(setSettingsDirty()));

  /************/
  KStdAction::open(this, SLOT(slotFileOpen()), actionCollection());

  /************/
  recent = KStdAction::openRecent(this, SLOT(slotFileOpenRecent(const KURL &)),
                           actionCollection());
  recent->setWhatsThis(i18n("Open a recently used Kst plot."));

  /************/
  PauseAction = new KToggleAction(i18n("P&ause"),"player_pause",0,
                                  actionCollection(), "pause_action");
  PauseAction->setToolTip(i18n("Pause"));
  PauseAction->setWhatsThis(i18n("When paused, new data will not be read."));

  /************/
  TiedZoomAction = new KAction(i18n("&Tied Zoom"),"kst_zoomtie",0,
                               view, SLOT(toggleTiedZoom()),
                               actionCollection(), "zoomtie_action");
  TiedZoomAction->setToolTip(i18n("Toggle tied zoom"));
  TiedZoomAction->setWhatsThis(i18n("Apply zoom actions to all plots\n"
                                     "(not just the active one)."));

  /************/
  XYZoomAction = new KRadioAction(i18n("XY Mouse &Zoom"), "kst_zoomxy",0,
                                  actionCollection(), "zoomxy_action");
  XYZoomAction->setExclusiveGroup("zoom");
  XYZoomAction->setToolTip(i18n("XY mouse zoom"));
  XYZoomAction->setWhatsThis(i18n("XY zoom: mouse zooming effects\n"
                                  "both X and Y axis"));
  XYZoomAction->setChecked(true);

  /************/
  XZoomAction = new KRadioAction(i18n("&X Mouse Zoom"), "kst_zoomx",0,
                                 actionCollection(), "zoomx_action");
  XZoomAction->setExclusiveGroup("zoom");
  XZoomAction->setToolTip(i18n("X mouse zoom"));
  XZoomAction->setWhatsThis(i18n("X zoom: Mouse zooming effects only the\n"
                                 "X axis (CTRL-mouse also does this)"));

  /************/
  YZoomAction = new KRadioAction(i18n("&Y Mouse Zoom"), "kst_zoomy",0,
                                  actionCollection(), "zoomy_action");
  YZoomAction->setExclusiveGroup("zoom");
  YZoomAction->setToolTip(i18n("Y mouse zoom"));
  YZoomAction->setWhatsThis(i18n("Y zoom: Mouse zooming effects only the\n"
                                 "Y axis (SHIFT-mouse also does this)"));

  /************/
  TextAction = new KRadioAction(i18n("&Label Editor"), "text",0,
                                  actionCollection(), "label_action");

  TextAction->setExclusiveGroup("zoom");
  TextAction->setToolTip(i18n("Label Editor"));
  TextAction->setWhatsThis(i18n("Use the mouse to create and edit labels."));

  /************/
  FilterDialogAction = new KAction(i18n("Edit &Filters"), 0, 0,
                                 this, SLOT(showFilterListEditor()),
                                 actionCollection(), "filterdialog_action");
  FilterDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                        "to edit filters."));

  /************/
  PlotDialogAction = new KAction(i18n("Edit &Plots"), "kst_editplots", 0,
                                 this, SLOT(showPlotDialog()),
                                 actionCollection(), "plotdialog_action");
  PlotDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                      "to edit plot settings."));

  /************/
  DataManagerAction = new KAction(i18n("&Data Manager"), "kst_datamanager", 0,
                                  dataManager, SLOT(show_I()),
                                  actionCollection(), "datamanager_action");
  DataManagerAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                       "to manage data."));

  /************/
  VectorDialogAction = new KAction(i18n("Edit &Vectors"), 0, 0,
                                 KstVectorDialogI::globalInstance(),
                                 SLOT(show_I()), actionCollection(),
                                 "vectordialog_action");
  VectorDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                        "to edit or create vectors."));

  /************/
  CurveDialogAction = new KAction(i18n("Edit &Curves"), 0, 0,
                                  KstCurveDialogI::globalInstance(),
                                  SLOT(show_I()), actionCollection(),
                                  "curvedialog_action");
  CurveDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                       "to edit or create curves."));

  /************/
  EqDialogAction = new KAction(i18n("Edit &Equations"), 0, 0,
                               KstEqDialogI::globalInstance(), SLOT(show_I()),
                               actionCollection(), "eqdialog_action");
  EqDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                    "to edit or create equations."));

  /************/
  HsDialogAction = new KAction(i18n("Edit &Histograms"), 0, 0,
                               KstHsDialogI::globalInstance(),
                               SLOT(show_I()), actionCollection(),
                               "hsdialog_action");
  HsDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                    "to edit or create histograms."));

  /************/
  PsdDialogAction = new KAction(i18n("Edit Power &Spectra"), 0, 0,
                                KstPsdDialogI::globalInstance(),
                                SLOT(show_I()), actionCollection(),
                                "psddialog_action");
  PsdDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                     "to edit or create power spectra."));

  /************/
  PluginDialogAction = new KAction(i18n("Edit &Plugins"), 0, 0,
                                   KstPluginDialogI::globalInstance(),
                                   SLOT(show_I()), actionCollection(),
                                   "plugindialog_action");
  PluginDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                        "to use plugins."));

  /************/
  ChangeFileDialogAction = new KAction(i18n("Change Data &File"),
                                       "kst_changefile", 0, this,
                                       SLOT(showChangeFileDialog()),
                                       actionCollection(),
                                       "changefiledialog_action");
  ChangeFileDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                            "to change input files."));

  /************/
  ViewScalarsDialogAction = new KAction(i18n("View &Scalars"),
                                       0, 0, this,
                                       SLOT(showViewScalarsDialog()),
                                       actionCollection(),
                                       "viewscalarsdialog_action");
  ViewScalarsDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                            "to view scalar values."));
  
  /************/
  ViewVectorsDialogAction = new KAction(i18n("View Vec&tors"),
                                       0, 0, this,
                                       SLOT(showViewVectorsDialog()),
                                       actionCollection(),
                                       "viewvectorsdialog_action");
  ViewVectorsDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                            "to view vector values."));
  
  /************/
  ChangeNptsDialogAction = new KAction(i18n("Change Data Sample &Ranges"),
                                       "kst_changenpts", 0, this,
                                       SLOT(showChangeNptsDialog()),
                                       actionCollection(),
                                       "changenptsdialog_action");
  ChangeNptsDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                            "to change data sample ranges."));

  /************/
  QuickCurvesDialogAction = new KAction(i18n("Quickly Create New Curve"),
                                       "kst_quickcurves", 0, this,
                                       SLOT(showQuickCurvesDialog()),
                                       actionCollection(),
                                       "quickcurvesdialog_action");
  QuickCurvesDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                           "to create a data curve\n"
                                           "and put it in a plot."));
  /************/
  QuickPSDDialogAction = new KAction(i18n("Quickly Create New PSD"),
                                     "kst_quickpsd", 0,
                                     this, SLOT(showQuickPSDDialog()),
                                     actionCollection(),
                                     "quickpsddialog_action");
  QuickPSDDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                          "to create a PSD\n"
                                          "and put it in a plot."));

  /************/
  EventMonitorAction = new KAction(i18n("Edit Event &Monitoring"),
                                     0, 0,
                                     KstEventMonitorI::globalInstance(), 
                                     SLOT(show_I()),
                                     actionCollection(),
                                     "eventmonitor_action");
  EventMonitorAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                          "to edit event monitoring."));
  
  /************/
  GraphFileDialogAction = new KAction(i18n("Export to Graphics File..."),
                                  "kst_graphfile", 0,
                                  this, SLOT(showGraphFileDialog()),
                                  actionCollection(),
                                  "graphfiledialog_action");
  GraphFileDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                           "to export the plot as a\n"
                                           "graphics file."));

  /************/
  _vectorSaveAction = new KAction(i18n("Save Vectors to Disk..."),
                                  0, 0,
                                  vectorSaveDialog, SLOT(show()),
                                  actionCollection(),
                                  "vectorsavedialog_action");
  _vectorSaveAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                       "to save vectors to text files."));

  /************/
  SamplesDownAction = new KAction(i18n("&Back 1 Screen"),
                                  "kst_back",
                                  KAccel::stringToKey("Ctrl+Left"),
                                  this, SLOT(samplesDown()),
                                  actionCollection(),
                                  "samplesdown_action");
  //SamplesDownAction->setToolTip(i18n("Back"));
  SamplesDownAction->setWhatsThis(i18n("Reduce the starting frame by\n"
                                       "the current number of frames."));

  /************/
  SamplesUpAction = new KAction(i18n("&Advance 1 Screen"),
                                "kst_advance",
                                KAccel::stringToKey("Ctrl+Right"),
                                this, SLOT(samplesUp()),
                                actionCollection(),
                                "samplesup_action");

  //SamplesUpAction->setToolTip(i18n("Advance"));
  SamplesUpAction->setWhatsThis(i18n("Increase the starting frame by\n"
                                     "the current number of frames."));

  /************/
  SamplesFromEndAction = new KAction(i18n("Read From &End"),
                                     "1rightarrow",
                                     KAccel::stringToKey("Shift+Ctrl+Right"),
                                     this, SLOT(samplesEnd()),
                                     actionCollection(),
                                     "samplesend_action");
  SamplesFromEndAction->setToolTip(i18n("Read from end"));
  SamplesFromEndAction->setWhatsThis(i18n("Read current data from end of file."));

  /************/
  PluginManagerAction = new KAction(i18n("&Plugins..."), 0, 0,
                                 this, SLOT(showPluginManager()),
                                 actionCollection(), "pluginmanager_action");
  PluginManagerAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                           "to manage plugins."));


  /************/
  ExtensionManagerAction = new KAction(i18n("&Extensions..."), 0, 0,
                                 this, SLOT(showExtensionManager()),
                                 actionCollection(), "extensionmanager_action");
  ExtensionManagerAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                           "to manage extensions."));


  /************/
  DataWizardAction = new KAction(i18n("Data &Wizard..."), "kst_datawizard", 0,
                                 this, SLOT(showDataWizard()),
                                 actionCollection(), "datawizard_action");
  DataWizardAction->setWhatsThis(i18n("Bring up a wizard\n"
                                           "to easily load data."));


  /************/
  DebugDialogAction = new KAction(i18n("Debug Kst..."), 0, 0,
                                 this, SLOT(showDebugDialog()),
                                 actionCollection(), "debug_action");
  DebugDialogAction->setWhatsThis(i18n("Bring up a dialog\n"
                                           "to display debugging information."));


  /************/
  DataMode = new KToggleAction(i18n("Data Mode"), "kst_datamode", 0,
                                 this, SLOT(toggleDataMode()),
                                 actionCollection(), "datamode_action");
  DataMode->setWhatsThis(i18n("Toggle between cursor mode and data mode."));

  /************/
  _reloadAction = new KAction(i18n("Reload"), "reload", Key_F5, this, SLOT(reload()),
                              actionCollection(), "reload");
  _reloadAction->setWhatsThis(i18n("Reload the data from file."));

  createGUI();
}
Ejemplo n.º 20
0
Archivo: app.cpp Proyecto: speakman/qlc
void App::initMenuBar()
{
  ///////////////////////////////////////////////////////////////////
  // File Menu
  m_fileMenu = new QPopupMenu();
  m_fileMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/filenew.xpm")),
			 "&New", this, SLOT(slotFileNew()), 
			 CTRL+Key_N, ID_FILE_NEW);

  m_fileMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/fileopen.xpm")), 
			 "&Open...", this, SLOT(slotFileOpen()), 
			 CTRL+Key_O, ID_FILE_OPEN);

  m_fileMenu->insertSeparator();

  m_fileMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/filesave.xpm")),
			 "&Save", this, SLOT(slotFileSave()), 
			 CTRL+Key_S, ID_FILE_SAVE);

  m_fileMenu->insertItem("Save As...", this, SLOT(slotFileSaveAs()), 
			 0, ID_FILE_SAVE_AS);

  m_fileMenu->insertSeparator();

  m_fileMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/exit.xpm")),
			 "E&xit", this, SLOT(slotFileQuit()), 
			 CTRL+Key_Q, ID_FILE_QUIT);

  ///////////////////////////////////////////////////////////////////
  // Edit Menu
  m_editMenu = new QPopupMenu();
  m_editMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/add.xpm")),
			 "Add &Channel...", this, SLOT(slotEmpty()),
			 CTRL+Key_C, ID_EDIT_ADD_CHANNEL);

  m_editMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/remove.xpm")),
			 "&Remove Channel", this, SLOT(slotEmpty()),
			 CTRL+Key_R, ID_EDIT_REMOVE_CHANNEL);

  m_editMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/edit.xpm")),
			 "Edit C&hannel...", this, SLOT(slotEmpty()),
			 CTRL+Key_H, ID_EDIT_CHANNEL);

  m_editMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/up.xpm")),
			 "Raise Channel", this, SLOT(slotEmpty()),
			 CTRL+Key_Up, ID_EDIT_RAISE_CHANNEL);

  m_editMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/down.xpm")),
			 "Lower Channel", this, SLOT(slotEmpty()),
			 CTRL+Key_Down, ID_EDIT_LOWER_CHANNEL);

  m_editMenu->insertSeparator();

  m_editMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/add.xpm")),
			 "&Add Capability...", this, SLOT(slotEmpty()),
			 CTRL+Key_A, ID_EDIT_ADD_CAPABILITY);

  m_editMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/remove.xpm")),
			 "R&emove Capability", this, SLOT(slotEmpty()),
			 CTRL+Key_E, ID_EDIT_REMOVE_CAPABILITY);

  m_editMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/edit.xpm")),
			 "Ed&it Capability...", this, SLOT(slotEmpty()),
			 CTRL+Key_I, ID_EDIT_CAPABILITY);

  connect(m_editMenu, SIGNAL(activated(int)),
	  this, SLOT(slotEditMenuActivated(int)));

  connect(m_editMenu, SIGNAL(aboutToShow()), 
	  this, SLOT(slotRefreshEditMenu()));
  
  ///////////////////////////////////////////////////////////////////
  // Window Menu
  m_windowMenu = new QPopupMenu();
  connect(m_windowMenu, SIGNAL(aboutToShow()), 
	  this, SLOT(slotRefreshWindowMenu()));
  
  ///////////////////////////////////////////////////////////////////
  // Help menu
  m_helpMenu = new QPopupMenu();
  m_helpMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/help.xpm")),
			 "About...", this, SLOT(slotHelpAbout()), 
			 0, ID_HELP_ABOUT);

  m_helpMenu->insertItem(QPixmap(QString(PIXMAPS) + QString("/qt.xpm")),
			 "About Qt...", this, SLOT(slotHelpAboutQt()), 
			 0, ID_HELP_ABOUT_QT);

  ///////////////////////////////////////////////////////////////////
  // Menubar configuration
  menuBar()->insertItem("File", m_fileMenu);
  menuBar()->insertItem("Edit", m_editMenu);
  menuBar()->insertItem("Window", m_windowMenu);
  menuBar()->insertSeparator();
  menuBar()->insertItem("Help", m_helpMenu);

  menuBar()->setSeparator(QMenuBar::InWindowsStyle);
}
Ejemplo n.º 21
0
Archivo: app.cpp Proyecto: speakman/qlc
void App::initMenuBar()
{
  QString dir;
  settings()->get(KEY_SYSTEM_DIR, dir);
  dir += QString("/") + PIXMAPPATH;

  ///////////////////////////////////////////////////////////////////
  // File Menu
  m_fileMenu = new QPopupMenu();
  m_fileMenu->insertItem(QPixmap(dir + QString("/filenew.xpm")),
			 "&New", this, SLOT(slotFileNew()), CTRL+Key_N, ID_FILE_NEW);
  m_fileMenu->insertItem(QPixmap(dir + QString("/fileopen.xpm")), 
			 "&Open...", this, SLOT(slotFileOpen()), CTRL+Key_O, ID_FILE_OPEN);
  m_fileMenu->insertSeparator();
  m_fileMenu->insertItem(QPixmap(dir + QString("/filesave.xpm")),
			 "&Save", this, SLOT(slotFileSave()), CTRL+Key_S, ID_FILE_SAVE);
  m_fileMenu->insertItem("Save &As...", this, SLOT(slotFileSaveAs()), 0, ID_FILE_SAVE_AS);
  m_fileMenu->insertSeparator();
  m_fileMenu->insertItem(QPixmap(dir + QString("/info.xpm")),
			 "Se&ttings...", this, SLOT(slotFileSettings()), 0, ID_FILE_SETTINGS);
  m_fileMenu->insertSeparator();
  m_fileMenu->insertItem(QPixmap(dir + QString("/exit.xpm")),
			 "E&xit", this, SLOT(slotFileQuit()), CTRL+Key_Q, ID_FILE_QUIT);
  
  ///////////////////////////////////////////////////////////////////
  // View Menu
  m_toolsMenu = new QPopupMenu();
  m_toolsMenu->setCheckable(true);
  m_toolsMenu->insertItem(QPixmap(dir + QString("/device.xpm")), 
			  "Device Manager", this, SLOT(slotViewDeviceManager()), CTRL + Key_D, ID_VIEW_DEVICE_MANAGER);
  m_toolsMenu->insertItem(QPixmap(dir + QString("/virtualconsole.xpm")), 
			  "Virtual Console", this, SLOT(slotViewVirtualConsole()), CTRL + Key_G, ID_VIEW_VIRTUAL_CONSOLE);
  m_toolsMenu->insertSeparator();
  m_toolsMenu->insertItem(QPixmap(dir + QString("/deviceclasseditor.xpm")), 
			  "Device Class Editor", this, SLOT(slotViewDeviceClassEditor()), CTRL + Key_E, ID_VIEW_DEVICE_CLASS_EDITOR);
  m_toolsMenu->insertItem(QPixmap(dir + QString("/function.xpm")), 
			  "Function Tree", this, SLOT(slotViewFunctionTree()), CTRL + Key_F, ID_VIEW_FUNCTION_TREE);
  m_toolsMenu->insertSeparator();
  m_toolsMenu->insertItem(QPixmap(dir + QString("/panic.xpm")), "Panic!", this, SLOT(slotPanic()), CTRL + Key_C, ID_FUNCTIONS_PANIC);
  connect(m_toolsMenu, SIGNAL(aboutToShow()), this, SLOT(slotRefreshToolsMenu()));

  ///////////////////////////////////////////////////////////////////
  // Window Menu
  m_windowMenu = new QPopupMenu();
  connect(m_windowMenu, SIGNAL(aboutToShow()), this, SLOT(slotRefreshWindowMenu()));
  
  ///////////////////////////////////////////////////////////////////
  // Help menu
  m_helpMenu = new QPopupMenu();
  m_helpMenu->insertItem(QPixmap(dir + QString("/help.xpm")),
			 "About...", this, SLOT(slotHelpAbout()), 0, ID_HELP_ABOUT);
  m_helpMenu->insertItem(QPixmap(dir + QString("/qt.xpm")),
			 "About Qt...", this, SLOT(slotHelpAboutQt()), 0, ID_HELP_ABOUT_QT);

  ///////////////////////////////////////////////////////////////////
  // Menubar configuration
  menuBar()->insertItem("&File", m_fileMenu);
  menuBar()->insertItem("&Tools", m_toolsMenu);
  menuBar()->insertItem("&Window", m_windowMenu);
  menuBar()->insertSeparator();  	
  menuBar()->insertItem("&Help", m_helpMenu);

  menuBar()->setSeparator(QMenuBar::InWindowsStyle);
}