Exemplo n.º 1
0
void MainWindow::_createActions()
{
// connect to an application
    _linkAct = new QAction( QIcon(":/link.png"), tr("&Connect..."), this );  Q_ASSERT( _linkAct );
    _linkAct->setShortcut(tr("Ctrl+C"));
    connect( _linkAct, SIGNAL( triggered( )), this, SLOT( _connect( )));

// open a file
    _openAct = new QAction( QIcon(":/open.png"), tr("&Open..."), this );  Q_ASSERT( _openAct );
    _openAct->setShortcut(tr("Ctrl+O"));
    connect( _openAct, SIGNAL( triggered( )), this, SLOT( _open( )));

// transfer function editor
    _tfAct = new QAction( QIcon(":/tune.png"), tr("Edit &TF"), this );  Q_ASSERT( _tfAct );
    _tfAct->setShortcut(tr("Ctrl+T"));
    _tfAct->setEnabled( true );
    connect( _tfAct, SIGNAL( triggered( )), this, SLOT( _adjustTF()));

// quit app
    _quitAct = new QAction( tr("&Quit"), this );   Q_ASSERT( _quitAct );
    _quitAct->setShortcuts( QKeySequence::Quit );
    _quitAct->setStatusTip( tr("Quit the application") );
    connect(_quitAct, SIGNAL(triggered()), this, SLOT( close()));

// about
    _aboutAct = new QAction( tr("&About"), this );   Q_ASSERT( _aboutAct );
    _aboutAct->setStatusTip( tr("Show the application's About box") );
    connect(_aboutAct, SIGNAL(triggered()), this, SLOT( _about()));


// recent directories actions
    RecentFiles::_createActions();
}
Exemplo n.º 2
0
bool CMenu::_Home(void)
{
	SetupInput();
	_showHome();

	string prevTheme = m_cfg.getString("GENERAL", "theme", "default");
	while(!m_exit)
	{
		/* battery gets refreshed in here... */
		_mainLoopCommon();
		/* and it always changes so... */
		m_btnMgr.setText(m_homeLblBattery, wfmt(PLAYER_BATTERY_LABEL, min((float)wd[0]->battery_level, 100.f), 
			min((float)wd[1]->battery_level, 100.f), min((float)wd[2]->battery_level, 100.f), min((float)wd[3]->battery_level, 100.f)));
		if(BTN_A_PRESSED)
		{
			if(m_btnMgr.selected(m_homeBtnSettings))
			{
				_hideHome();
				_config(1);
				if(prevTheme != m_cfg.getString("GENERAL", "theme") || m_reload == true)
				{
					m_exit = true;
					m_reload = true;
					break;
				}
				_showHome();
			}
			else if(m_btnMgr.selected(m_homeBtnReloadCache))
			{
				//m_gameList.SetLanguage(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str());
				UpdateCache(m_current_view);
				LoadView();
				break;
			}
			else if(m_btnMgr.selected(m_homeBtnUpdate) && !m_locked)
			{
				CoverFlow.stopCoverLoader(true);
				_hideHome();
				_system();
				remove(m_ver.c_str());
				if(m_exit)
					_launchHomebrew(m_dol.c_str(), m_homebrewArgs);
				else
				{
					_showHome();
					CoverFlow.startCoverLoader();
				}
			}
			else if(m_btnMgr.selected(m_homeBtnInstall))
			{
				_hideHome();
				_wbfsOp(WO_ADD_GAME);
				_showHome();
			}
			else if(m_btnMgr.selected(m_homeBtnAbout))
			{
				_hideHome();
				_about();
				_showHome();
			}
			else if(m_btnMgr.selected(m_homeBtnExitTo))
			{
				_hideHome();
				if(m_locked)
					exitHandler(WIIFLOW_DEF);
				else 
					_ExitTo();
				_showHome();
			}
			else if(m_btnMgr.selected(m_homeBtnExplorer))
			{
				_hideHome();
				_Explorer();
				_showHome();
			}
			else if(m_btnMgr.selected(m_homeBtnFTP))
			{
				_hideHome();
				_FTP();
				_showHome();
			}
		}
		else if(BTN_HOME_PRESSED)
		{
			exitHandler(WIIFLOW_DEF);
			break;
		}
		else if(BTN_B_PRESSED)
			break;
	}

	_hideHome();
	return m_exit;
}