Exemple #1
0
void MainWindow::saveSettings(){
    if(fullScreen())
        this->showNormal();

    QSettings settingsNative;

    settingsNative.setValue("pos",  pos());
    settingsNative.setValue("size", size());

    settingsNative.setValue("backgroundRed", backgroundColor().red());
    settingsNative.setValue("backgroundGreen", backgroundColor().green());
    settingsNative.setValue("backgroundBlue", backgroundColor().blue());

    settingsNative.setValue("canvasRed", canvasColor().red());
    settingsNative.setValue("canvasGreen", canvasColor().green());
    settingsNative.setValue("canvasBlue", canvasColor().blue());

    settingsNative.setValue("infoRed", infoColor().red());
    settingsNative.setValue("infoGreen", infoColor().green());
    settingsNative.setValue("infoBlue", infoColor().blue());

    QSettings settings(Constants::SETTINGS_FOLDER + "/" + Constants::PLAYER_SETTINGS_FILE, QSettings::IniFormat);

    settings.setValue("orientation", orientation());
    settings.setValue("alwaysOnTop", alwaysOnTop());
    settings.setValue("autoScale",   autoScale());
    settings.setValue("width",       width());
    settings.setValue("height",      height());
    settings.setValue("fps",         fps());
    settings.setValue("scale",       scale());
    settings.setValue("drawInfos",   drawInfos());

    if(fullScreen())
        this->showFullScreen();
}
Cleps_VidPlayer::Cleps_VidPlayer(QWidget *parent)
    : QWidget(parent)

{
    videoWidget = new QVideoWidget(this);
    videoWidget->setContextMenuPolicy(Qt::CustomContextMenu);
    videoWidget->setAspectRatioMode(Qt::IgnoreAspectRatio);
    
    QBoxLayout *mreLayout = new QHBoxLayout;
    mreLayout->setMargin(0);
    mreLayout->setSpacing(0);

    QBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(videoWidget);
    layout->addLayout(mreLayout);

       setLayout(layout);

      QShortcut *fll = new QShortcut(QKeySequence(Qt::Key_F11), videoWidget);
      fll->setContext(Qt::ApplicationShortcut);

      QShortcut *fllve = new QShortcut(QKeySequence(Qt::Key_Escape), videoWidget);
      fllve->setContext(Qt::ApplicationShortcut);


       connect(fll,SIGNAL(activated()),this,SLOT(fullScreen()));
       connect(fllve,SIGNAL(activated()),this,SLOT(exitFullScreen()));
       connect(videoWidget, SIGNAL(customContextMenuRequested(QPoint)),this, SLOT(context(QPoint)));
   
}
Exemple #3
0
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
{
	ui.setupUi(this);
	ui.pbClose->setToolTip(QStringLiteral("关闭软件"));
	sa = NULL;

	//加载界面窗体
	homeSlot();

	//关闭
	connect(ui.pbClose, SIGNAL(clicked()), this, SLOT(close()));
	//视频窗体全屏信号
	connect(this, SIGNAL(fullScreen(QString)), this, SLOT(callSlot(QString)));

	QString hint = "";
	FileCentre *fc = FileCentre::GetInstance();
	fc->ReadSystemValue("windowhint", hint);
	if(hint == "1")
	{
		setWindowState(Qt::WindowFullScreen);
	}
	else
	{
		setWindowState( Qt::WindowMaximized );
	}
}
Exemple #4
0
//화면 사이즈 지정
HWND cMAIN_GAME::createGameWindow(LPCWSTR sz_window_class, LPCWSTR sz_tile, HINSTANCE& inst)
{	
	fullScreen(screen_width_, screen_height_);
	//::AdjustWindowRect(&rt, WS_OVERLAPPEDWINDOW, TRUE);
	return ::CreateWindow(sz_window_class, sz_tile, WS_POPUP,
		CW_USEDEFAULT, 0, client_rt_.right - client_rt_.left, client_rt_.bottom - client_rt_.top, NULL, NULL, inst, NULL);
}
void CounterInterface::keyPressEvent(QKeyEvent *event){
    if (event->key() == Qt::Key_Delete)
        onClick_pbRemoveItem();

    switch (event->modifiers()){

    case Qt::ControlModifier:{
        if (event->key() == Qt::Key_S)
            onClick_pbSaveOrdered();

        if (event->key() == Qt::Key_L)
            onClick_pbClearOrdered();

        if (event->key() == Qt::Key_C)
            onClick_pbCancelOrdered();

        if (event->key() == Qt::Key_M)
            onClick_lPizza();

        break;
    }
    }

    if (event->key() == Qt::Key_F11)
        emit fullScreen();
}
Exemple #6
0
void WidgetGL::mouseDoubleClickEvent(QMouseEvent *event)
{
    if(event->buttons() & Qt::LeftButton)
    {
        m_fullscreen = !m_fullscreen;
        fullScreen(m_fullscreen);
    }
}
Exemple #7
0
void cMAIN_GAME::update()
{
	if (input_->getDownKey_once(VK_F1))
		fullScreen(screen_width_, screen_height_);				
	
	if (input_->getDownKey_once(VK_F2))
		windowMode();

	current_scene_->update(30.0 / 1000.0);
}
Window& Window::displayMode(DisplayMode v){
	if(created()){
		const Cursor cursor_ = cursor();
		const bool cursorHide_ = cursorHide();
		const Dim dim_ = dimensions();
		const bool fullScreen_ = fullScreen();
		const double fps_ = fps();
		const std::string& title_ = title();

		destroy();
		create(dim_, title_, fps_, v);
		cursor(cursor_);
		cursorHide(cursorHide_);
		fullScreen(fullScreen_);
	}
	else{
		mDisplayMode = v;
	}
	return *this;
}
Exemple #9
0
void Window::toggleMode()
{
    switch (m_mode)
    {
        case FullScreenMode:
            windowed();
            return;
        case WindowMode:
            fullScreen();
            return;
    }
}
inline void OmniStereoGraphicsRenderer::start() {
  if (mOmni.activeStereo()) {
    Window::displayMode(Window::displayMode() | Window::STEREO_BUF);
  }

  create();

  if (mOmni.fullScreen()) {
    fullScreen(true);
    cursorHide(true);
  }

  Main::get().start();
}
Exemple #11
0
bool Adapter::toggleFullScreen(uint nWidth, uint nHeight, uint nColorDepth, uint nFrequency)
{
	DEVMODE DevMode;
	DEVMODE RecDevMode;
	uint nIndex = 0;
	RecDevMode.dmDisplayFrequency	= 0;
	bool bHaveOne	= false;

	//win9x下,取到的刷新率是0 - yun
	DWORD dwStandard = (m_OldDevMode.dmDisplayFrequency > 0 ? m_OldDevMode.dmDisplayFrequency : nFrequency);

	//Trace("OriginFreq = %d\n",m_OldDevMode.dmDisplayFrequency);

	while( EnumDisplaySettings(NULL,nIndex,&DevMode)!=0 )
	{
		if(DevMode.dmPelsWidth == (DWORD)nWidth && DevMode.dmPelsHeight == (DWORD)nHeight && DevMode.dmBitsPerPel == (DWORD)nColorDepth)
		{
			//Trace("%d*%d*%d %d\n",DevMode.dmPelsWidth,DevMode.dmPelsHeight,DevMode.dmBitsPerPel,DevMode.dmDisplayFrequency);
			if(DevMode.dmDisplayFrequency <= dwStandard)
			{
				if(testMode(DevMode))
				{
					//Trace("TestMode Ok! %d*%d*%d %d\n",DevMode.dmPelsWidth,DevMode.dmPelsHeight,DevMode.dmBitsPerPel,DevMode.dmDisplayFrequency);
					if(DevMode.dmDisplayFrequency >= RecDevMode.dmDisplayFrequency)
					{
						memcpy(&RecDevMode,&DevMode,sizeof(DEVMODE));
						bHaveOne	= true;
					}
				}
			}
		}
		nIndex++;
	}

	bool bRet = FALSE;
	if(bHaveOne)
	{
		if(RecDevMode.dmDisplayFrequency == 0)
			RecDevMode.dmDisplayFrequency = nFrequency;

		bRet = fullScreen(RecDevMode);

		//Trace("DEVMODE = %d*%d*%d %d",DevMode.dmPelsWidth,DevMode.dmPelsHeight,DevMode.dmBitsPerPel,DevMode.dmDisplayFrequency);
	}

	return bRet;
}
// renders draws a complete frame
//
void Coordinator::render() {

	// adjust framecount and fps
    if (now - lastReset <= unitsPerSec) 
		framecount++;
	else {
        // recalculate the frame rate
        fps        = framecount * unitsPerSec / (now - lastReset);
		framecount = 0;
		lastReset  = now;
        if (timerText) {
            wchar_t str[MAX_DESC + 1];
            sprintf(str, fps, L" fps");
	        timerText->set(str);
        }
	}
    // update the user input devices
    userInput->update();
    Coordinator::update();
    // update the model
    update();
    // update the audio
    audio->setVolume(volume);
    audio->setFrequencyRatio(frequency);
    audio->update(Camera::getView());

    // start rendering
    display->beginDrawFrame(Camera::getView());
    if (background) { 
        Rectf fullScreen(0, 0, 1, 1);
        display->beginDrawHUD(0);
        background->render(fullScreen, true);
        display->endDrawHUD();
    }
    display->setAmbientLight(ambient.r, ambient.g, ambient.b);
    render(OPAQUE_OBJECT);
    display->set(ALPHA_BLEND, true);
    render(TRANSLUCENT_OBJECT);
    display->set(ALPHA_BLEND, false);
    display->beginDrawHUD(HUD_ALPHA);
    render(ALL_HUDS);
	render(CONSOLE);
    display->endDrawHUD();
    display->endDrawFrame();
    render(ALL_SOUNDS);
	
}
void Cleps_VidPlayer::contextMenuEvent(QContextMenuEvent *event)
{
    QMenu menu(this);
    menu.addAction(tr("View Playlist"), this->parent(), SLOT(showPlaylist()));
    menu.addAction(tr("Add Media"), this->parent(), SLOT(open()));
    menu.addSeparator();
    menu.addAction(tr("Toggle Fullscreen"),this, SLOT(fullScreen()));
    menu.addSeparator();
    menu.addAction(tr("Play/Pause"),this->parent(), SLOT(play()));
    menu.addAction(tr("Previous"),this->parent(), SLOT(previousMedia()));
    menu.addAction(tr("Next"),this->parent(), SLOT(nextMedia()));
    menu.addAction(tr("Stop"),this->parent(), SLOT(stop()));
    menu.addSeparator();
    menu.addAction(tr("Quit"),this->parent(), SLOT(quit()));


    menu.exec(event->globalPos());

}
Exemple #14
0
void WidgetGL::keyPressEvent(QKeyEvent *e)
{
    switch( e->key() )
    {
    case Qt::Key_Space:
        {
            resets();
        }
        break;
    case Qt::Key_F:
        m_fullscreen = !m_fullscreen;
        fullScreen(m_fullscreen);
        updateGL();
        break;
    case Qt::Key_L://是否使用色彩混合,高亮
        {
            blend = !blend;
            if(blend)
            {
                glEnable(GL_BLEND);//色彩融合和深度缓存不能同时开启
                glDisable(GL_DEPTH_TEST);
            }
            else
            {
                glDisable(GL_BLEND);
                glEnable(GL_DEPTH_TEST);
            }
            updateGL();
        }
        break;
    case Qt::Key_Z:
        {
            bAnimate = !bAnimate;
            if( bAnimate )
                timer->start(40);
            else
                timer->stop();
        }
        break;
    case Qt::Key_Escape:
        close();
    }
}
Exemple #15
0
inline void OmniApp::start() {
	if (mOmni.activeStereo()) {
		Window::displayMode(Window::displayMode() | Window::STEREO_BUF);
	}
	
	create();
	
	if (mOmni.fullScreen()) {
		fullScreen(true);
		cursorHide(true);
	}
	
	if (!bSlave) { 
		if(oscSend().opened()) sendHandshake();
		mAudioIO.start();
	}
	
	Main::get().start();
}
Exemple #16
0
BOOL CLotteryDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动
	//  执行此操作
	SetIcon(m_hIcon, TRUE);			// 设置大图标
	SetIcon(m_hIcon, FALSE);		// 设置小图标

	fullScreen();

	InitLottery();

	m_bRollTimer = FALSE;

	_playSound(BEGIN, true);
	SetFocus();

	return TRUE;  // 除非将焦点设置到控件,否则返回 TRUE
}
void MainWindow::initActions()
{
    m_sessionNew = new QAction(this);
    m_sessionNew->setShortcut( tr( "Ctrl+N" ) );
    connect ( m_sessionNew , SIGNAL ( triggered() ), this , SLOT ( newSession() ) );

    m_sessionList = new QAction(this);
    m_sessionList->setShortcut( tr( "Ctrl+L" ) );
    connect ( m_sessionList , SIGNAL ( triggered() ), this , SLOT ( sessionList() ) );

    m_closeFullScreenAction = new QAction(this);
    m_closeFullScreenAction -> setIcon( QIcon( ":/shellicons/Restore") );
    connect ( m_closeFullScreenAction , SIGNAL ( triggered() ), this , SLOT ( showNormal() ) );

    //TODO: Fix fullscreen action behaviour
    m_fullScreenAction = new QAction(this);
    m_fullScreenAction -> setIcon( QIcon( ":/icons/FullScreen") );
    m_fullScreenAction->setShortcut( tr( "F11" ) );
    connect ( m_fullScreenAction, SIGNAL ( triggered() ), this , SLOT ( fullScreen() ) );
  
    m_quitAction = new QAction(this);
    m_quitAction->setShortcut(tr("Ctrl+Q"));
    m_quitAction -> setIcon( QIcon( ":/icons/Quit") );

    connect ( m_quitAction, SIGNAL ( triggered() ), this , SLOT ( close() ) );

    m_updateAllMonitorsActions = new QAction(this);
    m_updateAllMonitorsActions->setShortcut( tr("F5") );
    connect ( m_updateAllMonitorsActions, SIGNAL ( triggered() ),this, SLOT ( update() ) );

    m_selectStyleAction = new QAction(this);
    connect ( m_selectStyleAction , SIGNAL (triggered()), this , SLOT ( selectStyle() ) );

    m_preferencesAction = new QAction( this );
    connect ( m_preferencesAction, SIGNAL ( triggered() ),this, SLOT ( showPreferences() ) );

    aboutAction = new QAction(this);
    aboutQtAction = new QAction(this);
    connect ( aboutAction, SIGNAL ( triggered () ), this, SLOT ( aboutDialog() ) );
    connect ( aboutQtAction, SIGNAL ( triggered () ), qApp, SLOT ( aboutQt() ) );
}
void TreatmentInterface::keyPressEvent(QKeyEvent *event)
{
    switch(event->modifiers())
    {

    case Qt::ControlModifier:{
        if (event->key() == Qt::Key_Tab)
            emit goToPanel(5);

        break;
    }

    }

    if (event->key() == Qt::Key_Backtab){
        goToPanel(11);
    }

    if (event->key() == Qt::Key_F11)
        emit fullScreen();
}
Exemple #19
0
void MainWindow::fullScreenSlot(QString text)
{
	emit fullScreen(text);
	/*
	QWidget* camera = CameraFactory::CreateCamera();	

	if(text != QStringLiteral("全屏显示"))
	{
		camera->setParent(this);
		//camera->setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
		camera->setWindowFlags(Qt::Window);
		camera->showFullScreen();
		//camera->move(400,400);
		//camera->showMaximized();
		//camera->setFocus();
	}	
	else
	{
		camera->setParent(ui.scrollArea);
		camera->show();
		camera->setFocus();
	}
	*/
}
Exemple #20
0
static void kTermFullscreen()
{
	fullScreen(1);
}
void CardHostWindow::paintBase(QPainter* painter, bool maximized)
{
    if (maximized) {
        // faster, rectangular blit
        painter->setRenderHint(QPainter::SmoothPixmapTransform, false);
        painter->rotate(m_adjustmentAngle);

        Window::paint(painter, 0, 0);
        painter->rotate(-m_adjustmentAngle);
        painter->setRenderHint(QPainter::SmoothPixmapTransform, true);
    } else {
        // draw with rounded corners
        const QPixmap* pix = acquireScreenPixmap();
        if (pix) {
            QRectF brect = boundingRect();
            QPainterPath paintPath;

                            initializeRoundedCornerStage();

                            painter->setCompositionMode(QPainter::CompositionMode_SourceOver);

            if (m_adjustmentAngle == 90 || m_adjustmentAngle == -90) {
                QRectF rotRect = QRectF(brect.y(), brect.x(), brect.height(), brect.width());
                paintPath.addRoundedRect(rotRect, 25, 25);
            } else {
                paintPath.addRoundedRect(m_boundingRect, 25, 25);
            }

            int originX = brect.x();
            int originY = brect.y();

            if (m_adjustmentAngle == 90 || m_adjustmentAngle == -90) {
                originX = brect.y();
                originY = brect.x();
            }

            if (fullScreen()) {
                if (m_adjustmentAngle == 90 || m_adjustmentAngle == -90) {
                    painter->setBrushOrigin(originX - (pix->width()-brect.height())/2, originY);
                } else {
                    painter->setBrushOrigin(originX, originY - (pix->height() - brect.height()) / 2);
                }
            }
            else
                painter->setBrushOrigin(originX, originY);
                            painter->rotate(m_adjustmentAngle);
#if defined(USE_ROUNDEDCORNER_SHADER)
                            m_roundedCornerShaderStage->setOnPainter(painter);
                            if (m_adjustmentAngle == 90 || m_adjustmentAngle == -90) {
                                painter->drawPixmap(-brect.height()/2, -brect.width()/2, *pix);
                            }
                            else {
                                painter->drawPixmap(-brect.width()/2, -brect.height()/2, *pix);
                            }
                            m_roundedCornerShaderStage->removeFromPainter(painter);
#else
                            painter->fillPath(paintPath, *pix);
#endif
                            painter->rotate(-m_adjustmentAngle);
            painter->setBrushOrigin(0, 0);
        }
    }
}
Exemple #22
0
//------------------------------------------------------------------------------
//!
void
CoreXGL::initWin()
{
   DBG_BLOCK( os_xgl, "CoreXGL::initWin" );

   // Open a connection to the X Server.
   _display = XOpenDisplay( getenv("DISPLAY") );

   if( _display == 0 )
   {
      DBG_MSG( os_xgl, "No display connection." );
      return;
   }

   // Window creation.
   XSetWindowAttributes attr;

   attr.background_pixel = 0;
   attr.border_pixel     = 0;
   attr.colormap         = CopyFromParent;
   attr.event_mask =
      ExposureMask | StructureNotifyMask |
      KeyPressMask | KeyReleaseMask |
      ButtonPressMask | ButtonReleaseMask | PointerMotionMask;

   unsigned long mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;


   if( fullScreen() )
   {
      int defScreen = DefaultScreen( _display );
      _size.x = XDisplayWidth( _display, defScreen );
      _size.y = XDisplayHeight( _display, defScreen );
   }
   else
   {
      _size = size();
   }

   _window = XCreateWindow(
      _display,
      DefaultRootWindow( _display ),
      0, 0,
      _size.x, _size.y,
      0,
      CopyFromParent,
      InputOutput,
      CopyFromParent,
      mask,
      &attr
   );

   // Interaction with the WM.
   _wmDeleteWindow = XInternAtom( _display, "WM_DELETE_WINDOW", True );
   XSetWMProtocols( _display, _window, &_wmDeleteWindow, 1 );

   // Load pointer.
   _pointer[Pointer::DEFAULT]  = XCreateFontCursor( _display, XC_left_ptr );
   _pointer[Pointer::SIZE_ALL] = XCreateFontCursor( _display, XC_center_ptr );

   _pointer[Pointer::SIZE_T]   = XCreateFontCursor( _display, XC_top_side );
   _pointer[Pointer::SIZE_B]   = XCreateFontCursor( _display, XC_bottom_side );
   _pointer[Pointer::SIZE_BL]  = XCreateFontCursor( _display, XC_bottom_left_corner );
   _pointer[Pointer::SIZE_BR]  = XCreateFontCursor( _display, XC_bottom_right_corner );
   _pointer[Pointer::SIZE_TL]  = XCreateFontCursor( _display, XC_top_left_corner );
   _pointer[Pointer::SIZE_TR]  = XCreateFontCursor( _display, XC_top_right_corner );
   _pointer[Pointer::SIZE_L]   = XCreateFontCursor( _display, XC_left_side );
   _pointer[Pointer::SIZE_R]   = XCreateFontCursor( _display, XC_right_side );

   _pointer[Pointer::TEXT]     = XCreateFontCursor( _display, XC_xterm );
   _pointer[Pointer::HAND]     = XCreateFontCursor( _display, XC_hand1 );
   _pointer[Pointer::WAIT]     = XCreateFontCursor( _display, XC_watch );

   _pointer[Pointer::INVALID]  = _pointer[Pointer::DEFAULT];

   XMapRaised( _display, _window );

   // Resize window to cover the screen.
   if( fullScreen() )
   {
      // No border.
      Atom wmhints = XInternAtom( _display, "_MOTIF_WM_HINTS", False );

      struct {
         unsigned long flags;
         unsigned long functions;
         unsigned long decorations;
         long input_mode;
         unsigned long status;
      } MWMHints = { (1L << 1), 0, 0, 0, 0 };

      XChangeProperty(
         _display,
         _window,
         wmhints, wmhints,
         32, PropModeReplace,
         (uchar*)&MWMHints, 5
      );
      // Resizing and moving.
      XMoveResizeWindow( _display, _window, 0, 0, _size.x, _size.y );

      Atom props[6];
      props[0] = XInternAtom( _display, "_NET_WM_STATE_FULLSCREEN", False );
      props[1] = XInternAtom( _display, "_NET_WM_STATE_SKIP_TASKBAR", False );
      props[2] = XInternAtom( _display, "_NET_WM_STATE_SKIP_PAGER", False );
      props[3] = XInternAtom( _display, "_NET_WM_STATE_ABOVE", False );
      props[4] = XInternAtom( _display, "_NET_WM_STATE_STICKY", False );
      props[5] = 0;
      XChangeProperty(
         _display,
         _window,
         XInternAtom( _display, "_NET_WM_STATE", False ),
         XA_ATOM,
         32, PropModeReplace,
         (unsigned char*)props, 4 // Use 5 if you want sticky!!
      );
   }
}
Exemple #23
0
void MainWindow::createMenus()
{
   QAction* action;
   QString  name;
   QMenu*   menu;
   QMenu*   subMenu;

   // ----- File Menu -----
   menu = menuBar()->addMenu("File");

      name = "About";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), this, SLOT(showAbout()));

      name = "New Molecule";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(newMoleculeMenu()));
      action->setShortcut(QKeySequence::New);

      name = "New Viewer";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), this, SLOT(newViewer()));

      name = "Open";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), this, SLOT(openFile()));
      action->setShortcut(QKeySequence::Open);

      name = "Open Recent";
      m_recentFilesMenu = menu->addMenu(name);
      updateRecentFilesMenu();

      menu->addSeparator();

/*
      name = "Parse Test File";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), this, SLOT(parseFile()));

      menu->addSeparator();
*/

      name = "Close Viewer";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), this, SLOT(close()));
      action->setShortcut(QKeySequence::Close);

      name = "Save";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(saveAll()));
      action->setShortcut(QKeySequence::Save);

      name = "Save As";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(saveAs()));
      action->setShortcut(Qt::SHIFT + Qt::CTRL + Qt::Key_S);

      menu->addSeparator();

      name = "Save Picture";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewer, SLOT(saveSnapshot()));
      action->setShortcut(Qt::CTRL + Qt::Key_P);

      name = "Record Animation";
      action = menu->addAction(name);
      action->setCheckable(true);
      action->setChecked(false);
      connect(action, SIGNAL(triggered()), this, SLOT(toggleRecordingActive()));
      action->setShortcut(Qt::SHIFT + Qt::CTRL + Qt::Key_P);
      m_recordAnimationAction = action;

      name = "Show Message Log";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), this, SLOT(showLogMessages()));
      action->setShortcut(Qt::CTRL + Qt::Key_L);

      name = "Quit";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), this, SLOT(quit()));
      action->setShortcut(Qt::CTRL + Qt::Key_Q);


   // ----- Edit Menu -----
   menu = menuBar()->addMenu("Edit");
  
      name = "Undo";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_undoStack, SLOT(undo()));
      action->setShortcut(QKeySequence::Undo);
      connect(&m_undoStack, SIGNAL(canUndoChanged(bool)), action, SLOT(setEnabled(bool)));

      name = "Redo";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_undoStack, SLOT(redo()));
      action->setShortcut(QKeySequence::Redo);
      connect(&m_undoStack, SIGNAL(canRedoChanged(bool)), action, SLOT(setEnabled(bool)));

      menu->addSeparator();

      name = "Cut";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(cutSelection()));
      action->setShortcut(Qt::CTRL + Qt::Key_X);

      name = "Copy";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(copySelectionToClipboard()));
      action->setShortcut(Qt::CTRL + Qt::Key_C);

      name = "Paste";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(pasteSelectionFromClipboard()));
      action->setShortcut(Qt::CTRL + Qt::Key_V);

      menu->addSeparator();

      name = "Select All";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(selectAll()));
      action->setShortcut(Qt::CTRL + Qt::Key_A);

      name = "Select None";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SIGNAL(clearSelection()));
      action->setShortcut(Qt::SHIFT + Qt::CTRL + Qt::Key_A);

      name = "Invert Selection";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(invertSelection()));
      action->setShortcut(Qt::CTRL + Qt::Key_I);

      menu->addSeparator();

      name = "Reindex Atoms";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), this, SLOT(reindexAtoms()));


      menu->addSeparator();

      name = "Preferences";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), this, SLOT(showPreferences()));


   // ----- Display Menu -----
   menu = menuBar()->addMenu("Display");

      name = "Full Screen";
      action = menu->addAction(name);
      action->setCheckable(true);
      action->setChecked(false);
      connect(action, SIGNAL(triggered()), this, SLOT(fullScreen()));
      action->setShortcut(Qt::CTRL + Qt::Key_0);
      m_fullScreenAction = action;

      name = "Reset View";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewer, SLOT(resetView()));
      action->setShortcut(Qt::CTRL + Qt::Key_R);

      name = "Show Axes";
      action = menu->addAction(name);
      action->setCheckable(true);
      action->setChecked(false);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(toggleAxes()));
      connect(&m_viewerModel, SIGNAL(axesOn(bool)), action, SLOT(setChecked(bool)));
      action->setShortcut(Qt::Key_A);


      menu->addSeparator();

      name = "Atom Labels";
      subMenu = menu->addMenu(name);

         name = "Element";
         action = subMenu->addAction(name);
         connect(action, SIGNAL(triggered()), this, SLOT(setLabel()));
         action->setData(Layer::Atom::Element);
         action->setShortcut(Qt::Key_E);
         action->setCheckable(true);
         m_labelActions << action;

         name = "Index";
         action = subMenu->addAction(name);
         connect(action, SIGNAL(triggered()), this, SLOT(setLabel()));
         action->setData(Layer::Atom::Index);
         action->setShortcut(Qt::Key_I);
         action->setCheckable(true);
         m_labelActions << action;
   
         name = "Mass";
         action = subMenu->addAction(name);
         connect(action, SIGNAL(triggered()), this, SLOT(setLabel()));
         action->setData(Layer::Atom::Mass);
         action->setShortcut(Qt::Key_M);
         action->setCheckable(true);
         m_labelActions << action;

/*
         name = "NMR Shifts";
         action = subMenu->addAction(name);
         connect(action, SIGNAL(triggered()), this, SLOT(setLabel()));
         action->setData(Layer::Atom::NmrShifts);
         action->setShortcut(Qt::Key_N);
         action->setCheckable(true);
         m_labelActions << action;
*/

         name = "Partial Charge";
         action = subMenu->addAction(name);
         connect(action, SIGNAL(triggered()), this, SLOT(setLabel()));
         action->setData(Layer::Atom::Charge);
         action->setShortcut(Qt::Key_Q);
         action->setCheckable(true);
         m_labelActions << action;

         name = "Spin Densities";
         action = subMenu->addAction(name);
         connect(action, SIGNAL(triggered()), this, SLOT(setLabel()));
         action->setData(Layer::Atom::Spin);
         action->setShortcut(Qt::Key_S);
         action->setCheckable(true);
         m_labelActions << action;

   menu->addSeparator();

   name = "Configure Appearance";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), this, SLOT(configureAppearance()));


      // These are not working correctly at the moment.
/*
      name = "Partial Charge Type";
      QActionGroup* partialChargeGroup = new QActionGroup(this);
      subMenu = menu->addMenu(name);

         QString pc("Gasteiger");
         action = subMenu->addAction(pc);
         action->setCheckable(true);
         action->setChecked(true);
         action->setData(pc);
         partialChargeGroup->addAction(action);
         connect(action, SIGNAL(triggered()), this, SLOT(setPartialChargeType()));

         pc = "Sanderson";
         action = subMenu->addAction(pc);
         action->setCheckable(true);
         action->setData(pc);
         partialChargeGroup->addAction(action);
         connect(action, SIGNAL(triggered()), this, SLOT(setPartialChargeType()));

         pc = "Mulliken";
         action = subMenu->addAction(pc);
         action->setCheckable(true);
         action->setData(pc);
         partialChargeGroup->addAction(action);
         connect(action, SIGNAL(triggered()), this, SLOT(setPartialChargeType()));
*/



   // ----- Build Menu -----
   menu = menuBar()->addMenu("Build");

      name = "Fill Valencies With Hydrogens";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(addHydrogens()));
      action->setShortcut(Qt::CTRL + Qt::Key_F);

      name = "Reperceive Bonds";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(reperceiveBonds()));

      menu->addSeparator();

      name = "Set Constraint";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(setConstraint()));
      action->setShortcut(Qt::CTRL + Qt::Key_K);

      name = "Minimize Structure";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(minimizeEnergy()));
      action->setShortcut(Qt::CTRL + Qt::Key_M);

      name = "Select Force Field";

      QActionGroup* forceFieldGroup = new QActionGroup(this);
      subMenu = menu->addMenu(name);

         QString ff("MMFF94");
         action = subMenu->addAction(ff);
         action->setCheckable(true);
         action->setData(ff);
         forceFieldGroup->addAction(action);
         connect(action, SIGNAL(triggered()), this, SLOT(setForceField()));
         if (Preferences::DefaultForceField() == ff) action->setChecked(true);

         ff = "MMFF94s";
         action = subMenu->addAction(ff);
         action->setCheckable(true);
         action->setData(ff);
         forceFieldGroup->addAction(action);
         connect(action, SIGNAL(triggered()), this, SLOT(setForceField()));
         if (Preferences::DefaultForceField() == ff) action->setChecked(true);

         ff = "UFF";
         action = subMenu->addAction(ff);
         action->setCheckable(true);
         action->setData(ff);
         forceFieldGroup->addAction(action);
         connect(action, SIGNAL(triggered()), this, SLOT(setForceField()));
         if (Preferences::DefaultForceField() == ff) action->setChecked(true);

         ff = "Ghemical";
         action = subMenu->addAction(ff);
         action->setCheckable(true);
         action->setData(ff);
         forceFieldGroup->addAction(action);
         connect(action, SIGNAL(triggered()), this, SLOT(setForceField()));
         if (Preferences::DefaultForceField() == ff) action->setChecked(true);

         ff = "Gaff";
         action = subMenu->addAction(ff);
         action->setCheckable(true);
         action->setData(ff);
         forceFieldGroup->addAction(action);
         connect(action, SIGNAL(triggered()), this, SLOT(setForceField()));
         if (Preferences::DefaultForceField() == ff) action->setChecked(true);

      menu->addSeparator();

      name = "Translate To Center";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(translateToCenter()));
      action->setShortcut(Qt::CTRL + Qt::Key_T );

      name = "Symmetrize Molecule";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(symmetrize()));
      action->setShortcut(Qt::CTRL + Qt::Key_Y );

      name = "Set Symmetry Tolerance";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(adjustSymmetryTolerance()));

      name = "Auto-detect Symmetry";
      action = menu->addAction(name);
      action->setCheckable(true);
      action->setChecked(false);
      connect(action, SIGNAL(triggered()), &m_viewerModel, SLOT(toggleAutoDetectSymmetry()));



   // ----- Calculation Menu -----
   menu = menuBar()->addMenu("Calculation");

      name = "Q-Chem Setup";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), this, SLOT(openQChemUI()));
      action->setShortcut(Qt::CTRL + Qt::Key_U );
      m_qchemSetupAction = action;

      name = "Job Monitor";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), this, SLOT(showProcessMonitor()));
      action->setShortcut(Qt::CTRL + Qt::Key_J );

      menu->addSeparator();

      name = "Edit Servers";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), this, SLOT(editServers()));

      name = "Remove All Processes";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), 
         &(ProcessMonitor::instance()), SLOT(clearProcessList()));

      name = "Reset Password Vault Key";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), this, SLOT(setVaultPassword()));



   // ----- Help Menu -----
   menu = menuBar()->addMenu("Help");

      name = "Show Help";
      action = menu->addAction(name);
      connect(action, SIGNAL(triggered()), this, SLOT(showHelp()));
}
Exemple #24
0
void MainWindow::createConnections()
{
   connect(&m_toolBar, SIGNAL(newMolecule()), 
      &m_viewerModel, SLOT(newMoleculeMenu()));

   connect(&m_toolBar, SIGNAL(open()), 
      this, SLOT(openFile()));

   connect(&m_toolBar, SIGNAL(save()), 
      &m_viewerModel, SLOT(saveAll()));

   connect(&m_toolBar, SIGNAL(addHydrogens()), 
      &m_viewerModel, SLOT(addHydrogens()));

   connect(&m_toolBar, SIGNAL(minimizeEnergy()), 
      &m_viewerModel, SLOT(minimizeEnergy()));

   connect(&m_toolBar, SIGNAL(deleteSelection()), 
      &m_viewerModel, SLOT(deleteSelection()));

   connect(&m_toolBar, SIGNAL(takeSnapshot()), 
      &m_viewer, SLOT(saveSnapshot()));

   connect(&m_toolBar, SIGNAL(record(bool)), 
      this, SLOT(setRecordingActive(bool)));
         
   connect(this, SIGNAL(recordingActive(bool)), 
      &m_toolBar, SLOT(setRecordAnimationButtonChecked(bool)));
         
   connect(this, SIGNAL(recordingActive(bool)), 
      &m_viewer, SLOT(setRecordingActive(bool)));

   connect(&m_viewer, SIGNAL(recordingCancelled()), 
      this, SLOT(recordingCancelled()));
         
   connect(&m_toolBar, SIGNAL(fullScreen()), 
      this, SLOT(fullScreen()));

   connect(&m_toolBar, SIGNAL(showHelp()), 
      this, SLOT(showHelp()));
         
   connect(&m_toolBar, SIGNAL(viewerModeChanged(Viewer::Mode const)), 
      &m_viewer, SLOT(setActiveViewerMode(Viewer::Mode const)));

   connect(&m_toolBar, SIGNAL(buildElementSelected(unsigned int)), 
      &m_viewer, SLOT(setDefaultBuildElement(unsigned int)));

   connect(&m_toolBar, 
      SIGNAL(buildFragmentSelected(QString const&, Viewer::Mode const)), 
      &m_viewer,
      SLOT(setDefaultBuildFragment(QString const&, Viewer::Mode const)));

   // ViewerModel 
   connect(&m_viewerModel, SIGNAL(updated()), 
      &m_viewer, SLOT(updateGL()));

   connect(&m_viewerView, SIGNAL(doubleClicked(QModelIndex const&)),
      &m_viewerModel, SLOT(itemDoubleClicked(QModelIndex const&))); 

   connect(&m_viewerView, SIGNAL(expanded(QModelIndex const&)),
      &m_viewerModel, SLOT(itemExpanded(QModelIndex const&))); 

   connect(&m_viewerModel, SIGNAL(sceneRadiusChanged(double const)), 
      &m_viewer, SLOT(setSceneRadius(double const)));

   connect(&m_viewerModel, SIGNAL(changeActiveViewerMode(Viewer::Mode const)), 
      &m_viewer, SLOT(setActiveViewerMode(Viewer::Mode const)));

   connect(&m_viewerModel, SIGNAL(displayMessage(QString const&)),
       &m_viewer, SLOT(displayMessage(QString const&)));

   connect(&m_viewerModel, SIGNAL(postCommand(QUndoCommand*)),
       this, SLOT(addCommand(QUndoCommand*)));

   connect(&m_viewerModel, SIGNAL(foregroundColorChanged(QColor const&)),
       &m_viewer, SLOT(setForegroundColor(QColor const&)));

   connect(&(ProcessMonitor::instance()), SIGNAL(resultsAvailable(JobInfo*)),
       &m_viewerModel, SLOT(openCalculationResults(JobInfo*)));

   // Viewer
   connect(&m_viewer, SIGNAL(enableUpdate(bool const)), 
      &m_viewerModel, SLOT(enableUpdate(bool const)));

   connect(&m_viewerModel, SIGNAL(pushAnimators(AnimatorList const&)),
      &m_viewer, SLOT(pushAnimators(AnimatorList const&)));

   connect(&m_viewerModel, SIGNAL(popAnimators(AnimatorList const&)),
      &m_viewer, SLOT(popAnimators(AnimatorList const&)));

   connect(&m_viewer, SIGNAL(postCommand(QUndoCommand*)),
      this, SLOT(addCommand(QUndoCommand*)));

   connect(&m_viewer, SIGNAL(openFileFromDrop(QString const&)),
      this, SLOT(openFile(QString const&)));

   connect(&m_viewer, SIGNAL(activeViewerModeChanged(Viewer::Mode const)),
      &m_toolBar, SLOT(setToolBarMode(Viewer::Mode const)));

   connect(&m_viewer, SIGNAL(escapeFullScreen()), 
      this, SLOT(fullScreen()));

   connect(&m_viewer, SIGNAL(animationStep()), 
      &m_viewerModel, SLOT(reperceiveBondsForAnimation()));

   // Selection
   connect(&m_viewerSelectionModel, 
      SIGNAL(selectionChanged(QItemSelection const&, QItemSelection const&)),
      &m_viewerModel, SLOT(selectionChanged(QItemSelection const&, QItemSelection const&)) );

   connect(&m_viewerModel, 
      SIGNAL(selectionChanged(QItemSelection const&, QItemSelectionModel::SelectionFlags)),
      &m_viewerSelectionModel, 
      SLOT(select(QItemSelection const&, QItemSelectionModel::SelectionFlags)) );

   connect(&m_viewerModel, SIGNAL(clearSelection()),
      &m_viewerSelectionModel, SLOT(clearSelection()));

   connect(&m_viewer, SIGNAL(clearSelection()),
      &m_viewerSelectionModel, SLOT(clearSelection()));

   connect(&m_viewer, 
      SIGNAL(select(QModelIndex const&, QItemSelectionModel::SelectionFlags)),
      &m_viewerSelectionModel, 
      SLOT(select(QModelIndex const&, QItemSelectionModel::SelectionFlags)));

   connect(&m_viewerModel, 
      SIGNAL(select(QModelIndex const&, QItemSelectionModel::SelectionFlags)),
      &m_viewerSelectionModel, 
      SLOT(select(QModelIndex const&, QItemSelectionModel::SelectionFlags)));
}
Exemple #25
0
Player::Player(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Player)
{
    std::cout << "Initialize player..." << std::endl;
    ui->setupUi(this);

    //Add MPlayer frame
    mplayer = new MPlayer;
    ui->playerLayout->setMargin(0);
    ui->playerLayout->addWidget(mplayer, 1);
    //enable autohiding toolbar
    mplayer->installEventFilter(this);
    mplayer->setMouseTracking(true);
    mplayer->getLayer()->installEventFilter(this);
    mplayer->getLayer()->setMouseTracking(true);
    ui->toolBar->installEventFilter(this);

    //move window
    ui->titleBar->installEventFilter(this);

    //Add Playlist
    playlist = new Playlist;
    ui->playerLayout->addWidget(playlist);
    playlist->installEventFilter(this);

    //Add Border
    topLeftBorder = new Border(this, Border::LEFT);
    topLeftBorder->setObjectName("topLeftBorder");
    topRightBorder = new Border(this, Border::RIGHT);
    topRightBorder->setObjectName("topRightBorder");
    ui->titleBarLayout->insertWidget(0, topLeftBorder);
    ui->titleBarLayout->addWidget(topRightBorder);

    leftBorder = new Border(this, Border::LEFT);
    leftBorder->setObjectName("leftBorder");
    rightBorder = new Border(this, Border::RIGHT);
    rightBorder->setObjectName("rightBorder");
    bottomBorder = new Border(this, Border::BOTTOM);
    bottomBorder->setObjectName("bottomBorder");
    ui->playerLayout->insertWidget(0, leftBorder);
    ui->playerLayout->addWidget(rightBorder);
    ui->mainLayout->addWidget(bottomBorder);

    ui->pauseButton->hide();
    ui->progressBar->hide();
    playlist->hide();

    //Add Cutterbar
    cutterbar = new CutterBar;
    int insertPos = ui->mainLayout->indexOf(ui->toolBar);
    ui->mainLayout->insertWidget(insertPos, cutterbar);
    cutterbar->hide();
    mplayer->menu->addAction(tr("Cut video"), this, SLOT(showCutterbar()), QKeySequence("C"));

    //Add WebVideo
    webvideo = new WebVideo;
    reslibrary = new ResLibrary;
    webvideo->addTab(reslibrary, tr("Resources"));
    webvideo->setCurrentIndex(0);

    //add downloader
    downloader = new Downloader;
    webvideo->addTab(downloader, tr("Downloader"));

    //add transformer
    transformer = new Transformer;

    //Settings Dialog
    settingsDialog = new SettingsDialog(this);

    //Add menu
    menubar = new QMenuBar;
    menu = menubar->addMenu(tr("Player"));
    menu->addAction(tr("Online video"), webvideo, SLOT(show()));
    menu->addAction(tr("Transform video"), transformer, SLOT(show()));
    menu->addAction(tr("Settings"), this, SLOT(onSetButton()));
    menu->addSeparator();
    menu->addAction(tr("Homepage"), this, SLOT(openHomepage()));
    menu->addAction(tr("About"), this, SLOT(onAboutClicked()));
    ui->mainLayout->insertWidget(0, menubar);

    //Add time show
    timeShow = new QLabel(mplayer);
    timeShow->move(0, 0);
    timeShow->hide();

    //Connect
    connect(ui->playButton, SIGNAL(clicked()), mplayer, SLOT(changeState()));
    connect(ui->pauseButton, SIGNAL(clicked()), mplayer, SLOT(changeState()));
    connect(ui->stopButton, SIGNAL(clicked()), this, SLOT(onStopButton()));
    connect(ui->progressBar, SIGNAL(valueChanged(int)), this, SLOT(onPBarChanged(int)));
    connect(ui->progressBar, SIGNAL(sliderPressed()), this, SLOT(onPBarPressed()));
    connect(ui->progressBar, SIGNAL(sliderReleased()), this, SLOT(onPBarReleased()));
    connect(ui->volumeSlider, SIGNAL(valueChanged(int)), mplayer, SLOT(setVolume(int)));
    connect(ui->volumeSlider, SIGNAL(valueChanged(int)), this, SLOT(onSaveVolume(int)));
    connect(ui->netButton, SIGNAL(clicked()), webvideo, SLOT(show()));
    connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(close()));
    connect(ui->minButton, SIGNAL(clicked()), this, SLOT(showMinimized()));
    connect(ui->maxButton, SIGNAL(clicked()), this, SLOT(setMaxNormal()));
    connect(ui->menuButton, SIGNAL(clicked()), this, SLOT(showMenu()));

    connect(mplayer, SIGNAL(played()), this, SLOT(setIconToPause()));
    connect(mplayer, SIGNAL(paused()), this, SLOT(setIconToPlay()));
    connect(mplayer, SIGNAL(stopped()), this, SLOT(onStopped()));
    connect(mplayer, SIGNAL(timeChanged(int)), this, SLOT(onProgressChanged(int)));
    connect(mplayer, SIGNAL(lengthChanged(int)), this, SLOT(onLengthChanged(int)));
    connect(mplayer, SIGNAL(fullScreen()), this, SLOT(setFullScreen()));
    connect(mplayer, SIGNAL(sizeChanged(QSize&)), this, SLOT(onSizeChanged(QSize&)));

    connect(playlist, SIGNAL(fileSelected(const QString&)), mplayer, SLOT(openFile(const QString&)));
    connect(playlist, SIGNAL(needPause(bool)), this, SLOT(onNeedPause(bool)));

    connect(downloader, SIGNAL(newPlay(const QString&,const QString&)), playlist, SLOT(addFileAndPlay(const QString&,const QString&)));
    connect(downloader, SIGNAL(newFile(const QString&,const QString&)), playlist, SLOT(addFile(const QString&,const QString&)));

    connect(cutterbar, SIGNAL(newFrame(int)), mplayer, SLOT(jumpTo(int)));
    connect(cutterbar, SIGNAL(finished()), cutterbar, SLOT(hide()));
    connect(cutterbar, SIGNAL(finished()), ui->toolBar, SLOT(show()));

    //Set skin
    setSkin(Settings::skinList[Settings::currentSkin]);

    //Set default volume
    ui->volumeSlider->setValue(Settings::volume);

    no_play_next = false;
    is_fullscreen = false;
}
Exemple #26
0
bool Window_Win32::fullScreen( const std::string &titlestring )
{
	return fullScreen(m_windowWidth, m_windowHeight, titlestring);
}
Exemple #27
0
void SystemActions::generateActions(const std::vector<int> & actions)
{
    category()->setText(QCoreApplication::tr("System"));
    actions_.clear();

    std::vector<int> all = actions;
    if (all.size() <= 0)
    {
        all.push_back(ROTATE_SCREEN);
        all.push_back(SCREEN_UPDATE_TYPE);
        all.push_back(MUSIC);
        all.push_back(RETURN_TO_LIBRARY);
    }

    for(int i = 0; i < static_cast<int>(all.size()); ++i)
    {
        switch (all[i])
        {
        case ROTATE_SCREEN:
            {
                shared_ptr<QAction> rotate(new QAction(exclusiveGroup()));
                rotate->setCheckable(true);
                rotate->setText(QCoreApplication::tr("Rotate Screen"));
                rotate->setIcon(QIcon(QPixmap(":/images/screen_rotation.png")));
                rotate->setData(ROTATE_SCREEN);
                actions_.push_back(rotate);
                break;
            }
        case SCREEN_UPDATE_TYPE:
            {
                // Screen update type.
                shared_ptr<QAction> screen(new QAction(exclusiveGroup()));
                screen->setCheckable(true);
                if (onyx::screen::instance().defaultWaveform() == onyx::screen::ScreenProxy::GC)
                {
                    screen->setText(QCoreApplication::tr("Full Refresh Off"));
                    screen->setIcon(QIcon(QPixmap(":/images/fast_update.png")));
                }
                else
                {
                    screen->setText(QCoreApplication::tr("Full Refresh On"));
                    screen->setIcon(QIcon(QPixmap(":/images/full_update.png")));
                }
                screen->setData(SCREEN_UPDATE_TYPE);
                actions_.push_back(screen);
                break;
            }
        case FULL_SCREEN:
            {
                shared_ptr<QAction> fullScreen(new QAction(exclusiveGroup()));
                fullScreen->setCheckable(true);
                fullScreen->setText(QCoreApplication::tr("Full Screen"));
                fullScreen->setIcon(QIcon(QPixmap(":/images/full_screen.png")));
                fullScreen->setData(FULL_SCREEN);
                actions_.push_back(fullScreen);
                break;
            }
        case EXIT_FULL_SCREEN:
            {
                shared_ptr<QAction> exitFullScreen(new QAction(exclusiveGroup()));
                exitFullScreen->setCheckable(true);
                exitFullScreen->setText(QCoreApplication::tr("Exit Full Screen"));
                exitFullScreen->setIcon(QIcon(QPixmap(
                        ":/images/exit_full_screen.png")));
                exitFullScreen->setData(EXIT_FULL_SCREEN);
                actions_.push_back(exitFullScreen);
                break;
            }
        case MUSIC:
            {
                if (sys::SystemConfig::isMusicPlayerAvailable())
                {
                    // Music.
                    shared_ptr<QAction> music(new QAction(exclusiveGroup()));
                    music->setCheckable(true);
                    music->setText(QCoreApplication::tr("Music"));
                    music->setIcon(QIcon(QPixmap(":/images/music.png")));
                    music->setData(MUSIC);
                    actions_.push_back(music);
                }
                break;
            }
        case RETURN_TO_LIBRARY:
            {
                // Close document.
                shared_ptr<QAction> close(new QAction(exclusiveGroup()));
                close->setCheckable(true);
                close->setText(QCoreApplication::tr("Close"));
                close->setIcon(QIcon(QPixmap(":/images/return_to_library.png")));
                close->setData(RETURN_TO_LIBRARY);
                actions_.push_back(close);
                break;
            }
        }
    }
}
Exemple #28
0
void MainWindow::fullScreenWindow(bool _fullScreen){
    setAutoScale(_fullScreen);
    setFullScreen(_fullScreen);
    actionFull_Screen(fullScreen());
    updateAutoScale();
}
Exemple #29
0
void MainWindow::updateFullScreen(){
    if(fullScreen())
        this->showFullScreen();
    else
        this->showNormal();
}
Exemple #30
0
static void kTermTitleScreen()
{
	fullScreen(0);
}