Logo Search packages:      
Sourcecode: qtiplot version File versions  Download package

void ApplicationWindow::showFolderPopupMenu ( Q3ListViewItem *  it,
const QPoint &  p,
bool  fromFolders 
) [slot]

creates and opens the context menu of a folder list view item

Parameters:
it list view item
p mouse global position
fromFolders,: true means that the user clicked right mouse buttom on an item from QListView "folders" false means that the user clicked right mouse buttom on an item from QListView "lv"

Definition at line 13271 of file ApplicationWindow.cpp.

References addFolder(), appendProject(), deleteFolder(), folderProperties(), hideAllFolderWindows(), setShowWindowsPolicy(), show_windows_policy, showAllFolderWindows(), startRenameFolder(), and window().

Referenced by showFolderPopupMenu().

{
      if (!it || folders->isRenaming())
            return;

      QMenu cm(this);
      QMenu window(this);
      QMenu viewWindowsMenu(this);
      viewWindowsMenu.setCheckable ( true );

      cm.insertItem(tr("&Find..."), this, SLOT(showFindDialogue()));
      cm.insertSeparator();
      cm.insertItem(tr("App&end Project..."), this, SLOT(appendProject()));
      if (((FolderListItem *)it)->folder()->parent())
            cm.insertItem(tr("Save &As Project..."), this, SLOT(saveAsProject()));
      else
            cm.insertItem(tr("Save Project &As..."), this, SLOT(saveProjectAs()));
      cm.insertSeparator();

      if (fromFolders && show_windows_policy != HideAll)
      {
            cm.insertItem(tr("&Show All Windows"), this, SLOT(showAllFolderWindows()));
            cm.insertItem(tr("&Hide All Windows"), this, SLOT(hideAllFolderWindows()));
            cm.insertSeparator();
      }

      if (((FolderListItem *)it)->folder()->parent())
      {
            cm.insertItem(QPixmap(close_xpm), tr("&Delete Folder"), this, SLOT(deleteFolder()), Qt::Key_F8);
            cm.insertItem(tr("&Rename"), this, SLOT(startRenameFolder()), Qt::Key_F2);
            cm.insertSeparator();
      }

      if (fromFolders)
      {
            window.addAction(actionNewTable);
            window.addAction(actionNewMatrix);
            window.addAction(actionNewNote);
            window.addAction(actionNewGraph);
            window.addAction(actionNewFunctionPlot);
            window.addAction(actionNewSurfacePlot);
            cm.insertItem(tr("New &Window"), &window);
      }

      cm.insertItem(QPixmap(newfolder_xpm), tr("New F&older"), this, SLOT(addFolder()), Qt::Key_F7);
      cm.insertSeparator();

      QStringList lst;
      lst << tr("&None") << tr("&Windows in Active Folder") << tr("Windows in &Active Folder && Subfolders");
      for (int i = 0; i < 3; ++i)
      {
            int id = viewWindowsMenu.insertItem(lst[i],this, SLOT( setShowWindowsPolicy( int ) ) );
            viewWindowsMenu.setItemParameter( id, i );
            viewWindowsMenu.setItemChecked( id, show_windows_policy == i );
      }
      cm.insertItem(tr("&View Windows"), &viewWindowsMenu);
      cm.insertSeparator();
      cm.insertItem(tr("&Properties..."), this, SLOT(folderProperties()));
      cm.exec(p);
}


Generated by  Doxygen 1.6.0   Back to index