示例#1
0
ndManager::ndManager()
    :QMainWindow(0),
      mainDock(0),
      importedFile(false),
      newFile(false),
      managerView(0L),
      parameterView(0)
{

    setObjectName("NDManager");
    mMainToolBar = new QToolBar();
    mMainToolBar->setObjectName("maintoolbar");

    addToolBar(mMainToolBar);

    //Create a ndManagereDoc which will hold the document manipulated by the application.
    doc = new ndManagerDoc(this);

    //Setup the actions
    setupActions();

    initStatusBar();
    //Disable some actions at startup (see the ndManager.rc file)
    slotStateChanged("initState");

    slotViewStatusBar();
    readSettings();
}
示例#2
0
文件: kmouth.cpp 项目: KDE/kmouth
void KMouthApp::readOptions()
{
    KConfigGroup cg(config, "General Options");

    // bar status settings
    bool bViewMenubar = cg.readEntry("Show Menubar", true);
    viewMenuBar->setChecked(bViewMenubar);
    slotViewMenuBar();

    // FIXME: Toolbar disabled so it will compile.
    // bool bViewToolbar = cg.readEntry("Show Toolbar", QVariant(true)).toBool();
    // viewToolBar->setChecked(bViewToolbar);
    // slotViewToolBar();

    bool bViewPhrasebookbar = cg.readEntry("Show Phrasebook Bar", true);
    viewPhrasebookBar->setChecked(bViewPhrasebookbar);

    bool bViewStatusbar = cg.readEntry("Show Statusbar", true);
    viewStatusBar->setChecked(bViewStatusbar);
    slotViewStatusBar();

    // bar position settings
    // FIXME:
    // KToolBar::BarPosition toolBarPos;
    // toolBarPos=(KToolBar::BarPosition) cg.readEntry("ToolBarPos", int(KToolBar::Top));
    // toolBar("mainToolBar")->setBarPos(toolBarPos);

    QSize size = cg.readEntry("Geometry", QSize());
    if (!size.isEmpty()) {
        resize(size);
    }

    optionsDialog->readOptions(config.data());

    toolBar(QLatin1String("mainToolBar"))->applySettings(config->group("mainToolBar"));
    toolBar(QLatin1String("phrasebookBar"))->applySettings(config->group("phrasebookBar"));

    slotPhrasebookConfirmed();
    if (phraseList != 0)
        phraseList->readCompletionOptions(config.data());
}
示例#3
0
文件: kmouth.cpp 项目: KDE/kmouth
void KMouthApp::initActions()
{
// The "File" menu
    fileOpen = actionCollection()->addAction(QLatin1String("file_open"));
    fileOpen->setIcon(KIcon(QLatin1String("document-open")));
    fileOpen->setText(i18n("&Open as History..."));
    fileOpen->setShortcuts(KStandardShortcut::open());
    connect(fileOpen, SIGNAL(triggered(bool)), this, SLOT(slotFileOpen()));
    fileOpen->setToolTip(i18n("Opens an existing file as history"));
    fileOpen->setWhatsThis(i18n("Opens an existing file as history"));

    fileSaveAs = actionCollection()->addAction(QLatin1String("file_save_as"));
    fileSaveAs->setIcon(KIcon(QLatin1String("document-save")));
    fileSaveAs->setText(i18n("Save &History As..."));
    fileSaveAs->setShortcuts(KStandardShortcut::save());
    connect(fileSaveAs, SIGNAL(triggered(bool)), this, SLOT(slotFileSaveAs()));
    fileSaveAs->setToolTip(i18n("Saves the actual history as..."));
    fileSaveAs->setWhatsThis(i18n("Saves the actual history as..."));

    filePrint = actionCollection()->addAction(QLatin1String("file_print"));
    filePrint->setIcon(KIcon(QLatin1String("document-print")));
    filePrint->setText(i18n("&Print History..."));
    filePrint->setShortcuts(KStandardShortcut::print());
    connect(filePrint, SIGNAL(triggered(bool)), this, SLOT(slotFilePrint()));
    filePrint->setToolTip(i18n("Prints out the actual history"));
    filePrint->setWhatsThis(i18n("Prints out the actual history"));

    fileQuit = KStandardAction::quit(this, SLOT(slotFileQuit()), actionCollection());
    fileQuit->setToolTip(i18n("Quits the application"));
    fileQuit->setWhatsThis(i18n("Quits the application"));

// The "Edit" menu
    editCut = KStandardAction::cut(phraseList, SLOT(cut()), actionCollection());
    editCut->setToolTip(i18n("Cuts the selected section and puts it to the clipboard"));
    editCut->setWhatsThis(i18n("Cuts the selected section and puts it to the clipboard. If there is some text selected in the edit field it is placed it on the clipboard. Otherwise the selected sentences in the history (if any) are placed on the clipboard."));

    editCopy = KStandardAction::copy(phraseList, SLOT(copy()), actionCollection());
    editCopy->setToolTip(i18n("Copies the selected section to the clipboard"));
    editCopy->setWhatsThis(i18n("Copies the selected section to the clipboard. If there is some text selected in the edit field it is copied to the clipboard. Otherwise the selected sentences in the history (if any) are copied to the clipboard."));

    editPaste = KStandardAction::paste(phraseList, SLOT(paste()), actionCollection());
    editPaste->setToolTip(i18n("Pastes the clipboard contents to current position"));
    editPaste->setWhatsThis(i18n("Pastes the clipboard contents at the current cursor position into the edit field."));

    editSpeak = actionCollection()->addAction(QLatin1String("edit_speak"));
    editSpeak->setIcon(KIcon(QLatin1String("text-speak")));
    editSpeak->setText(i18nc("Start speaking", "&Speak"));
    connect(editSpeak, SIGNAL(triggered(bool)), phraseList, SLOT(speak()));
    editSpeak->setToolTip(i18n("Speaks the currently active sentence(s)"));
    editSpeak->setWhatsThis(i18n("Speaks the currently active sentence(s). If there is some text in the edit field it is spoken. Otherwise the selected sentences in the history (if any) are spoken."));

// The "Phrase book" menu
    phrasebookEdit = actionCollection()->addAction(QLatin1String("phrasebook_edit"));
    phrasebookEdit->setText(i18n("&Edit..."));
    connect(phrasebookEdit, SIGNAL(triggered(bool)), this, SLOT(slotEditPhrasebook()));

// The "Options" menu
    viewMenuBar = KStandardAction::showMenubar(this, SLOT(slotViewMenuBar()), actionCollection());
    // FIXME: Disable so it will compile.
    // viewToolBar = KStandardAction::showToolbar(this, SLOT(slotViewToolBar()), actionCollection());
    // viewToolBar->setToolTip(i18n("Enables/disables the toolbar"));
    // viewToolBar->setWhatsThis (i18n("Enables/disables the toolbar"));

    viewPhrasebookBar = actionCollection()->add<KToggleAction>(QLatin1String("showPhrasebookBar"));
    viewPhrasebookBar->setText(i18n("Show P&hrasebook Bar"));
    connect(viewPhrasebookBar, SIGNAL(triggered(bool)), this, SLOT(slotViewPhrasebookBar()));
    viewPhrasebookBar->setToolTip(i18n("Enables/disables the phrasebook bar"));
    viewPhrasebookBar->setWhatsThis(i18n("Enables/disables the phrasebook bar"));

    viewStatusBar = KStandardAction::showStatusbar(this, SLOT(slotViewStatusBar()), actionCollection());
    viewStatusBar->setToolTip(i18n("Enables/disables the statusbar"));
    viewStatusBar->setWhatsThis(i18n("Enables/disables the statusbar"));

    configureTTS = actionCollection()->addAction(QLatin1String("configureTTS"));
    configureTTS->setIcon(KIcon(QLatin1String("configure")));
    configureTTS->setText(i18n("&Configure KMouth..."));
    connect(configureTTS, SIGNAL(triggered(bool)), this, SLOT(slotConfigureTTS()));
    configureTTS->setToolTip(i18n("Opens the configuration dialog"));
    configureTTS->setWhatsThis(i18n("Opens the configuration dialog"));

// The "Help" menu
    // The "Help" menu will automatically get created.

// The popup menu of the list of spoken sentences
    phraseListSpeak = actionCollection()->addAction(QLatin1String("phraselist_speak"));
    phraseListSpeak->setIcon(KIcon(QLatin1String("text-speak")));
    phraseListSpeak->setText(i18n("&Speak"));
    phraseListSpeak->setToolTip(i18n("Speaks the currently selected phrases in the history"));
    connect(phraseListSpeak, SIGNAL(triggered(bool)), phraseList, SLOT(speakListSelection()));
    phraseListSpeak->setWhatsThis(i18n("Speaks the currently selected phrases in the history"));

    phraseListRemove = actionCollection()->addAction(QLatin1String("phraselist_remove"));
    phraseListRemove->setIcon(KIcon(QLatin1String("edit-delete")));
    phraseListRemove->setText(i18n("&Delete"));
    connect(phraseListRemove, SIGNAL(triggered(bool)), phraseList, SLOT(removeListSelection()));
    phraseListRemove->setToolTip(i18n("Deletes the currently selected phrases from the history"));
    phraseListRemove->setWhatsThis(i18n("Deletes the currently selected phrases from the history"));

    phraseListCut = actionCollection()->addAction(QLatin1String("phraselist_cut"));
    phraseListCut->setIcon(KIcon(QLatin1String("edit-cut")));
    phraseListCut->setText(i18n("Cu&t"));
    connect(phraseListCut, SIGNAL(triggered(bool)), phraseList, SLOT(cutListSelection()));
    phraseListCut->setToolTip(i18n("Cuts the currently selected phrases from the history and puts them to the clipboard"));
    phraseListCut->setWhatsThis(i18n("Cuts the currently selected phrases from the history and puts them to the clipboard"));

    phraseListCopy = actionCollection()->addAction(QLatin1String("phraselist_copy"));
    phraseListCopy->setIcon(KIcon(QLatin1String("edit-copy")));
    phraseListCopy->setText(i18n("&Copy"));
    connect(phraseListCopy, SIGNAL(triggered(bool)), phraseList, SLOT(copyListSelection()));
    phraseListCut->setToolTip(i18n("Copies the currently selected phrases from the history to the clipboard"));
    phraseListCut->setWhatsThis(i18n("Copies the currently selected phrases from the history to the clipboard"));

    phraselistSelectAll = actionCollection()->addAction(QLatin1String("phraselist_select_all"));
    phraselistSelectAll->setText(i18n("Select &All Entries"));
    connect(phraselistSelectAll, SIGNAL(triggered(bool)), phraseList, SLOT(selectAllEntries()));
    phraselistSelectAll->setToolTip(i18n("Selects all phrases in the history"));
    phraselistSelectAll->setWhatsThis(i18n("Selects all phrases in the history"));

    phraselistDeselectAll = actionCollection()->addAction(QLatin1String("phraselist_deselect_all"));
    phraselistDeselectAll->setText(i18n("D&eselect All Entries"));
    connect(phraselistDeselectAll, SIGNAL(triggered(bool)), phraseList, SLOT(deselectAllEntries()));
    phraselistDeselectAll->setToolTip(i18n("Deselects all phrases in the history"));
    phraselistDeselectAll->setWhatsThis(i18n("Deselects all phrases in the history"));

// The popup menu of the edit field
    // The popup menu of the edit field will automatically get created.

    // use the absolute path to your kmouthui.rc file for testing purpose in createGUI();
    createGUI();
}
示例#4
0
void Portal::initActions()
{
  fileQuit = actionCollection()->addAction( KStandardAction::Quit, this, SLOT(slotFileQuit() ) );
  editCut = actionCollection()->addAction( KStandardAction::Cut, this, SLOT(slotEditCut() ) );
  editCopy = actionCollection()->addAction( KStandardAction::Copy, this, SLOT(slotEditCopy() ) );
  editPaste = actionCollection()->addAction( KStandardAction::Paste, this, SLOT(slotEditPaste() ) );
  viewStatusBar = KStandardAction::showStatusbar(this, SLOT(slotViewStatusBar()), actionCollection());

  actionCollection()->addAction( KStandardAction::Preferences, this, SLOT( preferences() ) );

  actNewDocument = actionCollection()->addAction( "document_new", this, SLOT( slotNewDocument()) );
  actNewDocument->setText( i18n("Create Document") );
  actNewDocument->setShortcut( KStandardShortcut::shortcut(KStandardShortcut::New) );
  actNewDocument->setIcon( KIcon("document-new"));

  actCopyDocument = actionCollection()->addAction( "document_copy", this, SLOT( slotCopyDocument()) );
  actCopyDocument->setText( i18n("Copy Document"));
  actCopyDocument->setShortcut( KStandardShortcut::shortcut(KStandardShortcut::Copy) );
  actCopyDocument->setIcon( KIcon( "document-edit"));

  actFollowDocument = actionCollection()->addAction( "document_follow", this, SLOT( slotFollowUpDocument() ) );
  actFollowDocument->setText( i18n("Follow Document" ));
  actFollowDocument->setShortcut( KShortcut( Qt::CTRL + Qt::Key_F ));
  actFollowDocument->setIcon( KIcon( "document-edit"));

  actPrintDocument = actionCollection()->addAction( "document_print", this, SLOT( slotPrintDocument()) );
  actPrintDocument->setText( i18n("Print Document"));
  actPrintDocument->setShortcut( KStandardShortcut::shortcut(KStandardShortcut::Print) );
  actPrintDocument->setIcon( KIcon("document-print"));

  actOpenArchivedDocument = actionCollection()->addAction( "archived_open", this, SLOT( slotArchivedDocExecuted()) );
  actOpenArchivedDocument->setText( i18n("Open Archived Document"));
  actOpenArchivedDocument->setShortcut( KShortcut(Qt::CTRL + Qt::Key_A) );

  actViewDocument  = actionCollection()->addAction( "document_view", this, SLOT( slotViewDocument()));
  actViewDocument->setText(i18n("Show Document"));
  actViewDocument->setShortcut( KStandardShortcut::shortcut(KStandardShortcut::Reload) );
  actViewDocument->setIcon( KIcon("document-preview" ));

  actOpenDocument = actionCollection()->addAction( "document_open", this, SLOT( slotOpenDocument()) );
  actOpenDocument->setText( i18n("Edit Document"));
  actOpenDocument->setShortcut( KStandardShortcut::shortcut(KStandardShortcut::Open) );
  actOpenDocument->setIcon( KIcon("document-open" ));

  actMailDocument = actionCollection()->addAction( "document_mail", this, SLOT( slotMailDocument()) );
  actMailDocument->setText(i18n("&Mail Document"));
  actMailDocument->setShortcut( KShortcut(Qt::CTRL + Qt::Key_M ));
  actMailDocument->setIcon( KIcon("mail-forward"));

  actEditTemplates = actionCollection()->addAction( "edit_tag_templates", this, SLOT( slotEditTagTemplates() ) );
  actEditTemplates->setText("Edit Tag Templates");
  actEditTemplates->setShortcut( KShortcut( Qt::CTRL + Qt::Key_E ));

  KAction *reconfDb = actionCollection()->addAction( "reconfigure_db", this, SLOT( slotReconfigureDatabase() ) );
  reconfDb->setText("Redo Initial Setup...");
  reconfDb->setShortcut( KShortcut( Qt::CTRL + Qt::Key_R ));

  fileQuit->setStatusTip(i18n("Quits the application"));
  editCut->setStatusTip(i18n("Cuts the selected section and puts it to the clipboard"));
  editCopy->setStatusTip(i18n("Copies the selected section to the clipboard"));
  editPaste->setStatusTip(i18n("Pastes the clipboard contents to current position"));
  viewStatusBar->setStatusTip(i18n("Enables/disables the statusbar"));

  actNewDocument->setStatusTip( i18n( "Creates a new Document" ) );
  actPrintDocument->setStatusTip( i18n( "Print and archive this Document" ) );
  actCopyDocument->setStatusTip( i18n( "Creates a new document which is a copy of the selected document" ) );
  actFollowDocument->setStatusTip( i18n( "Create a followup document for the current document" ) );
  actOpenDocument->setStatusTip( i18n( "Opens the document for editing" ) );
  actViewDocument->setStatusTip( i18n( "Opens a read only view on the document." ) );
  actMailDocument->setStatusTip( i18n( "Send document per mail" ) );
  actEditTemplates->setStatusTip( i18n("Edit the available tag templates which can be assigned to document items.") );
  reconfDb->setStatusTip( i18n( "Configure the Database Kraft is working on." ) );

  actOpenArchivedDocument->setStatusTip( i18n( "Open a viewer on an archived document" ) );
  setStandardToolBarMenuEnabled( true );
  actOpenDocument->setEnabled( false );
  actViewDocument->setEnabled( false );
  actPrintDocument->setEnabled( false );
  actCopyDocument->setEnabled( false );
  actFollowDocument->setEnabled( false );
  actMailDocument->setEnabled( false );

  actOpenArchivedDocument->setEnabled( false );
  // use the absolute path to your kraftui.rc file for testing purpose in createGUI();
  QString prjPath = QString::fromUtf8(qgetenv("KRAFT_HOME"));
  if( !prjPath.isEmpty() ) {
      createGUI(QString("%1/src/kraftui.rc").arg(prjPath));
  } else {
      createGUI( "kraftui.rc");
  }

}
示例#5
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();
}
示例#6
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);
}