OBSBasicStatusBar::OBSBasicStatusBar(QWidget *parent)
	: QStatusBar    (parent),
	  droppedFrames (new QLabel),
	  sessionTime   (new QLabel),
	  cpuUsage      (new QLabel),
	  kbps          (new QLabel)
{
	sessionTime->setText(QString("00:00:00"));
	cpuUsage->setText(QString("CPU: 0.0%"));

	droppedFrames->setAlignment(Qt::AlignRight);
	sessionTime->setAlignment(Qt::AlignRight);
	cpuUsage->setAlignment(Qt::AlignRight);
	kbps->setAlignment(Qt::AlignRight);

	droppedFrames->setIndent(20);
	sessionTime->setIndent(20);
	cpuUsage->setIndent(20);
	kbps->setIndent(10);

	addPermanentWidget(droppedFrames);
	addPermanentWidget(sessionTime);
	addPermanentWidget(cpuUsage);
	addPermanentWidget(kbps);
}
Пример #2
0
	StatusBar::StatusBar(QWidget* parent) 
		: KStatusBar(parent),
		speed(0),up_speed(0),down_speed(0),
		transfer(0),up_transfer(0),down_transfer(0),
		dht_status(0),dht_peers(0),dht_tasks(0),dht_on(false)
	{
		QString s = i18n("Speed down: %1 / up: %2",BytesPerSecToString((double)down_speed),BytesPerSecToString((double)up_speed));
		QString t = i18n("Transferred down: %1 / up: %2",BytesToString(down_transfer),BytesToString(up_transfer));
		
		dht_status = new QLabel(i18n("DHT: off"),this);
		dht_status->setFrameShape(QFrame::Box);
		dht_status->setFrameShadow(QFrame::Sunken);
		addPermanentWidget(dht_status);

		speed = new QLabel(s,this);
		speed->setFrameShape(QFrame::Box);
		speed->setFrameShadow(QFrame::Sunken);
		addPermanentWidget(speed);

		transfer = new QLabel(t,this);
		transfer->setFrameShape(QFrame::Box);
		transfer->setFrameShadow(QFrame::Sunken);
		addPermanentWidget(transfer);
		
		addPermanentWidget(new KStatusBarOfflineIndicator(this));
	}
Пример #3
0
StatusBar::StatusBar()
{
    mDownloadButton = new QToolButton( this );
    mDownloadButton->setGeometry( 0, 0, 20, 20 );
    mDownloadButton->setIcon( QIcon(":/icons/menus/download.png"));
    
    mDownloadManager = new DownloadManager( window() );

    connect( mDownloadButton, SIGNAL( clicked(bool) ), 
             this, SLOT( toggleDownloadManager()) );
    
    connect( mDownloadManager, SIGNAL( downloadFinished() ),
             this, SLOT( popupDownloadManager() ) );
    
    setFixedHeight( 21 );
        
    mLabel = new QLabel( this );
    QFont font;
    font.setPixelSize( 12 );
    
    mLabel->setFont( font );
    mLabel->setMaximumHeight( 20 );
    
    addPermanentWidget( mDownloadButton );
    addPermanentWidget( mLabel );
    mLabel->setText( "" );
}
Пример #4
0
void StatusBarWidget::setup()
{
	m_zoomSlider = new ZoomWidget(this);

	addPermanentWidget(new ActionWidget(ZoomOutAction, NULL, this));
	addPermanentWidget(m_zoomSlider);
	addPermanentWidget(new ActionWidget(ZoomInAction, NULL, this));

	connect(m_zoomSlider, SIGNAL(requestedZoomChange(int)), this, SIGNAL(requestedZoomChange(int)));
}
Пример #5
0
StatusBar::StatusBar( QWidget* parent )
    : QStatusBar( parent )
{
    // create labels
    QLabel* label;
    
    label = ( mLabels[ltCursorPosition] = new QLabel( this ) );
    label->setToolTip( tr( "Cursor position" ) );
    
    label = ( mLabels[ltSaveState] = new QLabel( this ) );
    label->setToolTip( tr( "Modification state of file" ) );
    
    label = ( mLabels[ltEOLMode] = new QLabel( this ) );
    label->setToolTip( tr( "EOL mode" ) );
    
    label = ( mLabels[ltIndentMode] = new QLabel( this ) );
    label->setToolTip( tr( "Indentation mode" ) );
    
    // add labels
    for ( int i = ltCursorPosition; i < ltIndentMode +1; i++ )
    {
        label = mLabels[ i ];
        addPermanentWidget( label );
        label->setMargin( 2 );
        label->setFrameStyle( QFrame::NoFrame );
        label->setAttribute( Qt::WA_MacSmallSize );
    }
    
    // force remove statusbar label frame
    setStyleSheet( "QStatusBar::item { border: 0px; }" );
    
    // connections
    connect( this, SIGNAL( messageChanged( const QString& ) ), this, SLOT( setMessage( const QString& ) ) );
}
Пример #6
0
WalletStatusBar::WalletStatusBar(QWidget* _parent) : QStatusBar(_parent), m_cryptoNoteAdapter(nullptr), m_nodeStateModel(nullptr), m_syncStatusLabel(new QLabel(this)),
  m_syncStatusIconLabel(new QLabel(this)), m_encryptionStatusIconLabel(new QLabel(this)),
  m_peerCountLabel(new QLabel(this)), m_syncMovie(new QMovie(this)), m_walletIsSynchronized(false), m_checkSyncStateTimerId(-1) {
  m_syncStatusLabel->setObjectName("m_syncStatusLabel");
  m_syncStatusIconLabel->setObjectName("m_syncStatusIconLabel");
  m_encryptionStatusIconLabel->setObjectName("m_encryptionStatusIconLabel");
  m_peerCountLabel->setObjectName("m_peerCountLabel");
  m_syncMovie->setFileName(Settings::instance().getCurrentStyle().getWalletSyncGifFile());
  m_syncMovie->setScaledSize(QSize(16, 16));
  addWidget(m_syncStatusLabel);
  addPermanentWidget(m_peerCountLabel);
  addPermanentWidget(m_encryptionStatusIconLabel);
  addPermanentWidget(m_syncStatusIconLabel);

  setStyleSheet(Settings::instance().getCurrentStyle().makeStyleSheet(STATUS_BAR_STYLE_SHEET_TEMPLATE));
}
Пример #7
0
/*** PUBLIC ***/
br::Progress::Progress(QWidget *parent)
    : QStatusBar(parent)
{
    pbProgress.setVisible(false);
    pbProgress.setMaximum(100);
    pbProgress.setMinimum(0);
    pbProgress.setValue(0);
    pbProgress.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
    pbProgress.setTextVisible(false);

    addWidget(&wSpacer, 1);
    addPermanentWidget(&pbProgress);
    addPermanentWidget(&lTimeRemaining);
    connect(&timer, SIGNAL(timeout()), this, SLOT(checkProgress()));
    timer.start(1000);
}
Пример #8
0
	QProgressBar* StatusBar::createProgressBar()
	{
		QProgressBar* pb = new QProgressBar(this);
		pb->setMaximumHeight(height());
		addPermanentWidget(pb);
		return pb;
	}
Пример #9
0
CStatusBar::CStatusBar(QWidget *parent) :
    QStatusBar(parent)
{
    contract = new QLabel(this);
    contract->setFixedWidth(30);
    declarer = new QLabel(this);
    declarer->setFixedWidth(30);
    vulnerable = new QLabel(this);
    vulnerable->setFixedWidth(30);
    mode = new QLabel(this);
    mode->setFixedWidth(30);

    addPermanentWidget(mode);
    addPermanentWidget(vulnerable);
    addPermanentWidget(declarer);
    addPermanentWidget(contract);
}
Пример #10
0
void KileWidget::StatusBar::reset()
{
	addLabel(HintText, i18n("Normal Mode"), 10);
	addPermanentWidget(m_errorHandler->compilationResultLabel());
	addLabel(ParserStatus, QString(), 0);
	addLabel(LineColumn, QString(), 0);
	addLabel(ViewMode, QString(), 0);
	addLabel(SelectionMode, QString(), 0);
}
Пример #11
0
void StatusBarWidget::setup()
{
	m_zoomSlider = new QSlider(this);
	m_zoomSlider->setRange(10, 250);
	m_zoomSlider->setTracking(true);;
	m_zoomSlider->setOrientation(Qt::Horizontal);
	m_zoomSlider->setMaximumWidth(100);

	QToolButton *zoomOutButton = new QToolButton(this);
	zoomOutButton->setDefaultAction(ActionsManager::getAction(QLatin1String("ZoomOut")));
	zoomOutButton->setAutoRaise(true);

	QToolButton *zoomInButton = new QToolButton(this);
	zoomInButton->setDefaultAction(ActionsManager::getAction(QLatin1String("ZoomIn")));
	zoomInButton->setAutoRaise(true);

	addPermanentWidget(zoomOutButton);
	addPermanentWidget(m_zoomSlider);
	addPermanentWidget(zoomInButton);
	setZoom(100);

	connect(m_zoomSlider, SIGNAL(valueChanged(int)), this, SIGNAL(requestedZoomChange(int)));
}
Пример #12
0
void KStatusBar::insertItem( const QString& text, int id, int stretch)
{
    if ( d->items[id] ) {
        kDebug() << "KStatusBar::insertItem: item id " << id << " already exists.";
    }

    KSqueezedTextLabel *l = new KSqueezedTextLabel( text, this );
    l->installEventFilter( this );
    l->setFixedHeight( fontMetrics().height() + 2 );
    l->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter );
    d->items.insert( id, l );
    addPermanentWidget( l, stretch );
    l->show();
}
	subObservationStatusBar::subObservationStatusBar(std::string text)
		:text(text)
	{
		frame = new QFrame;
		addPermanentWidget(frame, 1);

		this->positionLabel = new QLabel;
		positionLabel->setText("");
		this->reducedLabel = new QLabel;
		reducedLabel->setText("");
		QLabel* textLabel = new QLabel;
		textLabel->setText(QString::fromStdString(text));

		layout = new QHBoxLayout;
		layout->addWidget(positionLabel, 1, Qt::AlignLeft);
		layout->addWidget(textLabel, 1, Qt::AlignCenter);
		layout->addWidget(reducedLabel, 0, Qt::AlignRight);
		layout->setContentsMargins(0,0,0,0);
		frame->setLayout(layout);
	}
Пример #14
0
void DkStatusBar::createLayout() {

	mLabels.resize(status_end);
	setObjectName("DkStatusBar");

	for (int idx = 0; idx < mLabels.size(); idx++) {
		mLabels[idx] = new QLabel(this);
		mLabels[idx]->setObjectName("statusBarLabel");
		mLabels[idx]->hide();

		if (idx == 0) {
			mLabels[idx]->setToolTip(tr("CTRL activates the crosshair cursor"));
			addWidget(mLabels[idx]);
		}
		else
			addPermanentWidget(mLabels[idx]);
	}

	hide();
}
Пример #15
0
TupStatusBar::TupStatusBar(QWidget *parent)
 : QStatusBar(parent)
{
    setObjectName("TupStatusBar_");

    //m_progressBar = new QProgressBar(this);
    //m_progressBar->setMaximumSize(100, m_progressBar->height()/2);
    //m_progressBar->setMinimumWidth(100);

    //m_progressBar->setMaximum(10);

    m_status = new QLabel(this);
    m_status->setIndent(10);

    addPermanentWidget(m_status, 1);
    //addPermanentWidget(m_progressBar, 0);

    // m_timer = new QTimer(this);
    // connect(m_timer, SIGNAL(timeout()), this, SLOT(clear()));
}
Пример #16
0
void DkStatusBar::createLayout() {

	mLabels.resize(status_end);

	setObjectName("DkStatusBar");
	if (DkSettingsManager::param().display().toolbarGradient)
		setObjectName("statusBarWithGradient");	

	for (int idx = 0; idx < mLabels.size(); idx++) {
		mLabels[idx] = new QLabel(this);
		mLabels[idx]->setObjectName("statusBarLabel");
		mLabels[idx]->hide();

		if (idx == 0) {
			mLabels[idx]->setToolTip(tr("CTRL activates the crosshair cursor"));
			addWidget(mLabels[idx]);
		}
		else
			addPermanentWidget(mLabels[idx]);
	}

	hide();
}
Пример #17
0
StatusBar::StatusBar(QWidget *parent)
  : QStatusBar(parent)
{
  m_self = this;

  m_spinner = new Spinner(this);
  m_icon = new QLabel(this);
  m_login = new LoginIcon(this);
  m_secure = new QLabel(this);
  m_label = new QLabel(this);

# if !defined(SCHAT_NO_SSL)
  m_secure->setPixmap(QPixmap(LS(":/images/secure.png")));
# endif

  m_url = new NetworkWidget(this, NetworkWidget::BasicLayout);
  m_url->setMinimumWidth(m_url->width() * 2 + 50);
  m_urlAction = new QWidgetAction(this);
  m_urlAction->setDefaultWidget(m_url);

  m_bg = new BgOperationWidget(this);
  m_status = new StatusWidget(this);

  addWidget(m_spinner);
  addWidget(m_icon);
  addWidget(m_login);
  addWidget(m_secure);
  addWidget(m_label, 1);
  addWidget(m_bg);
  addPermanentWidget(m_status);

  connect(ChatClient::io(), SIGNAL(clientStateChanged(int,int)), SLOT(clientStateChanged(int)));
  connect(ChatNotify::i(), SIGNAL(notify(Notify)), SLOT(notify(Notify)));

  updateStyleSheet();
  clientStateChanged(SimpleClient::ClientOffline);
}
Пример #18
0
void KileWidget::StatusBar::addLabel(StatusMode id, const QString& text, int stretch)
{
	QLabel *l = new QLabel(this);
	l->setText(text);
	switch (id) {
		case HintText:
		  m_hintTextLabel = l;
		  break;
		case ParserStatus:
		  m_parserStatusLabel = l;
		  break;
		case LineColumn:
		  m_lineColumnLabel = l;
		  break;
		case ViewMode:
		  m_viewModeLabel = l;
		  break;
		case SelectionMode:
		  m_selectionModeLabel = l;
		  break;
	}
	addPermanentWidget(l, stretch);
	l->show();
}
Пример #19
0
void StatusBar::loadChangeableActions(const QStringList &action_names) {
  clear();

  QList<QAction*> available_actions = availableActions();

  // Iterate action names and add respectable actions into the toolbar.
  foreach (const QString &action_name, action_names) {
    QAction *matching_action = findMatchingAction(action_name, available_actions);
    QAction *action_to_add;
    QWidget *widget_to_add;

    if (matching_action == m_barProgressDownloadAction) {
      widget_to_add = m_barProgressDownload;
      action_to_add = m_barProgressDownloadAction;

      widget_to_add->setVisible(false);
    }
    else if (matching_action == m_barProgressFeedsAction) {
      widget_to_add = m_barProgressFeeds;
      action_to_add = m_barProgressFeedsAction;

      widget_to_add->setVisible(false);
    }
    else if (matching_action == m_lblProgressDownloadAction) {
      widget_to_add = m_lblProgressDownload;
      action_to_add = m_lblProgressDownloadAction;

      widget_to_add->setVisible(false);
    }
    else if (matching_action == m_lblProgressFeedsAction) {
      widget_to_add = m_lblProgressFeeds;
      action_to_add = m_lblProgressFeedsAction;

      widget_to_add->setVisible(false);
    }
    else {
      if (action_name == SEPARATOR_ACTION_NAME) {
        QLabel *lbl = new QLabel(QString::fromUtf8("•"));
        widget_to_add = lbl;

        action_to_add = new QAction(this);
        action_to_add->setSeparator(true);
        action_to_add->setProperty("should_remove_action", true);
      }
      else if (action_name == SPACER_ACTION_NAME) {
        QLabel *lbl = new QLabel(QSL("\t\t"));
        widget_to_add = lbl;

        action_to_add = new QAction(this);
        action_to_add->setProperty("should_remove_action", true);
        action_to_add->setIcon(qApp->icons()->fromTheme(QSL("system-search")));
        action_to_add->setProperty("type", SPACER_ACTION_NAME);
        action_to_add->setProperty("name", tr("Toolbar spacer"));
      }
      else if (matching_action != nullptr) {
        // Add originally toolbar action.
        PlainToolButton *tool_button = new PlainToolButton(this);
        tool_button->reactOnActionChange(matching_action);

        widget_to_add = tool_button;
        action_to_add = matching_action;

        connect(tool_button, SIGNAL(clicked(bool)), matching_action, SLOT(trigger()));
        connect(matching_action, SIGNAL(changed()), tool_button, SLOT(reactOnActionChange()));
      }
      else {
        action_to_add = nullptr;
        widget_to_add = nullptr;
      }

      if (action_to_add != nullptr) {
        action_to_add->setProperty("should_remove_widget", true);
      }
    }

    if (action_to_add != nullptr && widget_to_add != nullptr) {
      action_to_add->setProperty("widget", QVariant::fromValue((void*) widget_to_add));
      addPermanentWidget(widget_to_add);
      addAction(action_to_add);
    }
  }
void QmitkExtWorkbenchWindowAdvisor::PostWindowCreate()
{
  // very bad hack...
  berry::IWorkbenchWindow::Pointer window =
    this->GetWindowConfigurer()->GetWindow();
  QMainWindow* mainWindow =
    qobject_cast<QMainWindow*> (window->GetShell()->GetControl());

  if (!windowIcon.isEmpty())
  {
    mainWindow->setWindowIcon(QIcon(windowIcon));
  }
  mainWindow->setContextMenuPolicy(Qt::PreventContextMenu);

  /*mainWindow->setStyleSheet("color: white;"
  "background-color: #808080;"
  "selection-color: #659EC7;"
  "selection-background-color: #808080;"
  " QMenuBar {"
  "background-color: #808080; }");*/

  // Load selected icon theme

  QStringList searchPaths = QIcon::themeSearchPaths();
  searchPaths.push_front( QString(":/org_mitk_icons/icons/") );
  QIcon::setThemeSearchPaths( searchPaths );

  berry::IPreferencesService* prefService = berry::Platform::GetPreferencesService();
  berry::IPreferences::Pointer stylePref = prefService->GetSystemPreferences()->Node(berry::QtPreferences::QT_STYLES_NODE);
  QString iconTheme = stylePref->Get(berry::QtPreferences::QT_ICON_THEME, "<<default>>");
  if( iconTheme == QString( "<<default>>" ) )
  {
    iconTheme = QString( "tango" );
  }
  QIcon::setThemeName( iconTheme );

  // ==== Application menu ============================

  QMenuBar* menuBar = mainWindow->menuBar();
  menuBar->setContextMenuPolicy(Qt::PreventContextMenu);

#ifdef __APPLE__
  menuBar->setNativeMenuBar(true);
#else
  menuBar->setNativeMenuBar(false);
#endif

  QAction* fileOpenAction = new QmitkFileOpenAction(QIcon::fromTheme("document-open",QIcon(":/org_mitk_icons/icons/tango/scalable/actions/document-open.svg")), window);
  fileOpenAction->setShortcut(QKeySequence::Open);
  QAction* fileSaveAction = new QmitkFileSaveAction(QIcon(":/org.mitk.gui.qt.ext/Save_48.png"), window);
  fileSaveAction->setShortcut(QKeySequence::Save);
  fileSaveProjectAction = new QmitkExtFileSaveProjectAction(window);
  fileSaveProjectAction->setIcon(QIcon::fromTheme("document-save",QIcon(":/org_mitk_icons/icons/tango/scalable/actions/document-save.svg")));
  closeProjectAction = new QmitkCloseProjectAction(window);
  closeProjectAction->setIcon(QIcon::fromTheme("edit-delete",QIcon(":/org_mitk_icons/icons/tango/scalable/actions/edit-delete.svg")));

  auto   perspGroup = new QActionGroup(menuBar);
  std::map<QString, berry::IViewDescriptor::Pointer> VDMap;

  // sort elements (converting vector to map...)
  QList<berry::IViewDescriptor::Pointer>::const_iterator iter;

  berry::IViewRegistry* viewRegistry =
    berry::PlatformUI::GetWorkbench()->GetViewRegistry();
  const QList<berry::IViewDescriptor::Pointer> viewDescriptors = viewRegistry->GetViews();

  bool skip = false;
  for (iter = viewDescriptors.begin(); iter != viewDescriptors.end(); ++iter)
  {
    // if viewExcludeList is set, it contains the id-strings of view, which
    // should not appear as an menu-entry in the menu
    if (viewExcludeList.size() > 0)
    {
      for (int i=0; i<viewExcludeList.size(); i++)
      {
        if (viewExcludeList.at(i) == (*iter)->GetId())
        {
          skip = true;
          break;
        }
      }
      if (skip)
      {
        skip = false;
        continue;
      }
    }

    if ((*iter)->GetId() == "org.blueberry.ui.internal.introview")
      continue;
    if ((*iter)->GetId() == "org.mitk.views.imagenavigator")
      continue;
    if ((*iter)->GetId() == "org.mitk.views.viewnavigatorview")
      continue;

    std::pair<QString, berry::IViewDescriptor::Pointer> p(
      (*iter)->GetLabel(), (*iter));
    VDMap.insert(p);
  }

  std::map<QString, berry::IViewDescriptor::Pointer>::const_iterator
    MapIter;
  for (MapIter = VDMap.begin(); MapIter != VDMap.end(); ++MapIter)
  {
    berry::QtShowViewAction* viewAction = new berry::QtShowViewAction(window,
      (*MapIter).second);
    viewActions.push_back(viewAction);
  }

  if (!USE_EXPERIMENTAL_COMMAND_CONTRIBUTIONS)
  {
    QMenu* fileMenu = menuBar->addMenu("&File");
    fileMenu->setObjectName("FileMenu");
    fileMenu->addAction(fileOpenAction);
    fileMenu->addAction(fileSaveAction);
    fileMenu->addAction(fileSaveProjectAction);
    fileMenu->addAction(closeProjectAction);
    fileMenu->addSeparator();

    QAction* fileExitAction = new QmitkFileExitAction(window);
    fileExitAction->setIcon(QIcon::fromTheme("system-log-out",QIcon(":/org_mitk_icons/icons/tango/scalable/actions/system-log-out.svg")));
    fileExitAction->setShortcut(QKeySequence::Quit);
    fileExitAction->setObjectName("QmitkFileExitAction");
    fileMenu->addAction(fileExitAction);

    // another bad hack to get an edit/undo menu...
    QMenu* editMenu = menuBar->addMenu("&Edit");
    undoAction = editMenu->addAction(QIcon::fromTheme("edit-undo",QIcon(":/org_mitk_icons/icons/tango/scalable/actions/edit-undo.svg")),
      "&Undo",
      QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onUndo()),
      QKeySequence("CTRL+Z"));
    undoAction->setToolTip("Undo the last action (not supported by all modules)");
    redoAction = editMenu->addAction(QIcon::fromTheme("edit-redo",QIcon(":/org_mitk_icons/icons/tango/scalable/actions/edit-redo.svg"))
      , "&Redo",
      QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onRedo()),
      QKeySequence("CTRL+Y"));
    redoAction->setToolTip("execute the last action that was undone again (not supported by all modules)");

    // ==== Window Menu ==========================
    QMenu* windowMenu = menuBar->addMenu("Window");
    if (showNewWindowMenuItem)
    {
      windowMenu->addAction("&New Window", QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onNewWindow()));
      windowMenu->addSeparator();
    }

    QMenu* perspMenu = windowMenu->addMenu("&Open Perspective");

    QMenu* viewMenu;
    if (showViewMenuItem)
    {
      viewMenu = windowMenu->addMenu("Show &View");
      viewMenu->setObjectName("Show View");
    }
    windowMenu->addSeparator();
    resetPerspAction = windowMenu->addAction("&Reset Perspective",
      QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onResetPerspective()));

    if(showClosePerspectiveMenuItem)
      closePerspAction = windowMenu->addAction("&Close Perspective", QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onClosePerspective()));

    windowMenu->addSeparator();
    windowMenu->addAction("&Preferences...",
      QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onEditPreferences()),
      QKeySequence("CTRL+P"));

    // fill perspective menu
    berry::IPerspectiveRegistry* perspRegistry =
      window->GetWorkbench()->GetPerspectiveRegistry();

    QList<berry::IPerspectiveDescriptor::Pointer> perspectives(
      perspRegistry->GetPerspectives());

    skip = false;
    for (QList<berry::IPerspectiveDescriptor::Pointer>::iterator perspIt =
      perspectives.begin(); perspIt != perspectives.end(); ++perspIt)
    {
      // if perspectiveExcludeList is set, it contains the id-strings of perspectives, which
      // should not appear as an menu-entry in the perspective menu
      if (perspectiveExcludeList.size() > 0)
      {
        for (int i=0; i<perspectiveExcludeList.size(); i++)
        {
          if (perspectiveExcludeList.at(i) == (*perspIt)->GetId())
          {
            skip = true;
            break;
          }
        }
        if (skip)
        {
          skip = false;
          continue;
        }
      }

      QAction* perspAction = new berry::QtOpenPerspectiveAction(window,
        *perspIt, perspGroup);
      mapPerspIdToAction.insert((*perspIt)->GetId(), perspAction);
    }
    perspMenu->addActions(perspGroup->actions());

    if (showViewMenuItem)
    {
      for (auto viewAction : viewActions)
      {
        viewMenu->addAction(viewAction);
      }
    }

    // ===== Help menu ====================================
    QMenu* helpMenu = menuBar->addMenu("&Help");
    helpMenu->addAction("&Welcome",this, SLOT(onIntro()));
    helpMenu->addAction("&Open Help Perspective", this, SLOT(onHelpOpenHelpPerspective()));
    helpMenu->addAction("&Context Help",this, SLOT(onHelp()),  QKeySequence("F1"));
    helpMenu->addAction("&About",this, SLOT(onAbout()));
    // =====================================================
  }
  else
  {
    //undoAction = new QAction(QIcon::fromTheme("edit-undo",QIcon(":/org_mitk_icons/icons/tango/scalable/actions/edit-undo.svg")),
    //  "&Undo", nullptr);
    undoAction = new QmitkUndoAction(QIcon::fromTheme("edit-undo",QIcon(":/org_mitk_icons/icons/tango/scalable/actions/edit-undo.svg")), nullptr);
    undoAction->setShortcut(QKeySequence::Undo);
    redoAction = new QmitkRedoAction(QIcon::fromTheme("edit-redo",QIcon(":/org_mitk_icons/icons/tango/scalable/actions/edit-redo.svg")), nullptr);
    redoAction->setShortcut(QKeySequence::Redo);
  }

  // toolbar for showing file open, undo, redo and other main actions
  auto   mainActionsToolBar = new QToolBar;
  mainActionsToolBar->setObjectName("mainActionsToolBar");
  mainActionsToolBar->setContextMenuPolicy(Qt::PreventContextMenu);
#ifdef __APPLE__
  mainActionsToolBar->setToolButtonStyle ( Qt::ToolButtonTextUnderIcon );
#else
  mainActionsToolBar->setToolButtonStyle ( Qt::ToolButtonTextBesideIcon );
#endif

  imageNavigatorAction = new QAction(QIcon(":/org.mitk.gui.qt.ext/Slider.png"), "&Image Navigator", nullptr);
  bool imageNavigatorViewFound = window->GetWorkbench()->GetViewRegistry()->Find("org.mitk.views.imagenavigator");

  if(this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicomeditor"))
  {
    openDicomEditorAction = new QmitkOpenDicomEditorAction(QIcon(":/org.mitk.gui.qt.ext/dcm-icon.png"),window);
  }

  if (imageNavigatorViewFound)
  {
    QObject::connect(imageNavigatorAction, SIGNAL(triggered(bool)), QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onImageNavigator()));
    imageNavigatorAction->setCheckable(true);

    // add part listener for image navigator
    imageNavigatorPartListener.reset(new PartListenerForImageNavigator(imageNavigatorAction));
    window->GetPartService()->AddPartListener(imageNavigatorPartListener.data());
    berry::IViewPart::Pointer imageNavigatorView =
      window->GetActivePage()->FindView("org.mitk.views.imagenavigator");
    imageNavigatorAction->setChecked(false);
    if (imageNavigatorView)
    {
      bool isImageNavigatorVisible = window->GetActivePage()->IsPartVisible(imageNavigatorView);
      if (isImageNavigatorVisible)
        imageNavigatorAction->setChecked(true);
    }
    imageNavigatorAction->setToolTip("Toggle image navigator for navigating through image");
  }

  viewNavigatorAction = new QAction(QIcon(":/org.mitk.gui.qt.ext/view-manager_48.png"),"&View Navigator", nullptr);
  viewNavigatorFound = window->GetWorkbench()->GetViewRegistry()->Find("org.mitk.views.viewnavigatorview");
  if (viewNavigatorFound)
  {
    QObject::connect(viewNavigatorAction, SIGNAL(triggered(bool)), QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onViewNavigator()));
    viewNavigatorAction->setCheckable(true);

    // add part listener for view navigator
    viewNavigatorPartListener.reset(new PartListenerForViewNavigator(viewNavigatorAction));
    window->GetPartService()->AddPartListener(viewNavigatorPartListener.data());
    berry::IViewPart::Pointer viewnavigatorview =
      window->GetActivePage()->FindView("org.mitk.views.viewnavigatorview");
    viewNavigatorAction->setChecked(false);
    if (viewnavigatorview)
    {
      bool isViewNavigatorVisible = window->GetActivePage()->IsPartVisible(viewnavigatorview);
      if (isViewNavigatorVisible)
        viewNavigatorAction->setChecked(true);
    }
    viewNavigatorAction->setToolTip("Toggle View Navigator");
  }

  mainActionsToolBar->addAction(fileOpenAction);
  mainActionsToolBar->addAction(fileSaveProjectAction);
  mainActionsToolBar->addAction(closeProjectAction);
  mainActionsToolBar->addAction(undoAction);
  mainActionsToolBar->addAction(redoAction);
  if(this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicomeditor"))
  {
    mainActionsToolBar->addAction(openDicomEditorAction);
  }
  if (imageNavigatorViewFound)
  {
    mainActionsToolBar->addAction(imageNavigatorAction);
  }
  if (viewNavigatorFound)
  {
    mainActionsToolBar->addAction(viewNavigatorAction);
  }
  mainWindow->addToolBar(mainActionsToolBar);

  // ==== Perspective Toolbar ==================================
  auto   qPerspectiveToolbar = new QToolBar;
  qPerspectiveToolbar->setObjectName("perspectiveToolBar");

  if (showPerspectiveToolbar)
  {
    qPerspectiveToolbar->addActions(perspGroup->actions());
    mainWindow->addToolBar(qPerspectiveToolbar);
  }
  else
    delete qPerspectiveToolbar;

  // ==== View Toolbar ==================================
  auto   qToolbar = new QToolBar;
  qToolbar->setObjectName("viewToolBar");

  if (showViewToolbar)
  {
    mainWindow->addToolBar(qToolbar);

    for (auto viewAction : viewActions)
    {
      qToolbar->addAction(viewAction);
    }
  }
  else
    delete qToolbar;

  QSettings settings(GetQSettingsFile(), QSettings::IniFormat);
  mainWindow->restoreState(settings.value("ToolbarPosition").toByteArray());

  auto   qStatusBar = new QStatusBar();

  //creating a QmitkStatusBar for Output on the QStatusBar and connecting it with the MainStatusBar
  auto  statusBar = new QmitkStatusBar(qStatusBar);
  //disabling the SizeGrip in the lower right corner
  statusBar->SetSizeGripEnabled(false);

  auto  progBar = new QmitkProgressBar();

  qStatusBar->addPermanentWidget(progBar, 0);
  progBar->hide();
  // progBar->AddStepsToDo(2);
  // progBar->Progress(1);

  mainWindow->setStatusBar(qStatusBar);

  if (showMemoryIndicator)
  {
    auto   memoryIndicator = new QmitkMemoryUsageIndicatorView();
    qStatusBar->addPermanentWidget(memoryIndicator, 0);
  }
}