Exemplo n.º 1
0
void ATMainWindow_c::createTrayIcon()
{
	QAction *aboutAction = new QAction(tr("&About..."), this);
	ATVERIFY( connect(aboutAction, SIGNAL(triggered()), this, SLOT(slotShowAbout())) );

	QAction *restoreAction = new QAction(tr("&Restore"), this);
	ATVERIFY( connect(restoreAction, SIGNAL(triggered()), this, SLOT(showNormal())) );

	QAction *quitAction = new QAction(tr("&Quit"), this);
	ATVERIFY( connect(quitAction, SIGNAL(triggered()), this, SLOT(slotTentativeQuit())) );

	m_trayIconMenu = new QMenu( this );
	m_trayIconMenu->addAction(aboutAction);
	m_trayIconMenu->addAction(restoreAction);
	m_trayIconMenu->addAction(quitAction);

	m_trayIcon = new QSystemTrayIcon( this );
	m_trayIcon->setContextMenu( m_trayIconMenu );
	m_trayIcon->setIcon( m_iconDisconnected );
	m_trayIcon->show();

	ATVERIFY( connect( m_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
		this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason))) );

	ATVERIFY( connect(m_pMainWindow, SIGNAL(signalSetTrayIcon(int)), this, SLOT(slotSetTrayIcon(int))) );
}
Exemplo n.º 2
0
bool ATMainWindow_c::InitMenusAndActions()
{
	QAction *pAction;

	QMenu *pFileMenu	= new QMenu(this);
	pAction				= new QAction(QObject::tr("&Quit"), this);
	pAction->setShortcut(QObject::tr("CTRL+Q"));
	bool bRet			= QObject::connect(pAction, SIGNAL(triggered()), this, SLOT(slotTentativeQuit()));
	ATASSERT( bRet );

	pFileMenu->addAction( pAction );

	QMenu *pStyleMenu		= new QMenu(this);
	QStringList styleList	= QStyleFactory::keys();

	for( int i=0; i<styleList.count(); i++ )
	{
		ATNamedAction *pNamedAction = new ATNamedAction( styleList.at(i), this );
		ATASSERT( connect( pNamedAction, SIGNAL( signalTriggerNamed(QString) ), this, SLOT(slotChangeStyle(QString))) );
		pStyleMenu->addAction(pNamedAction);
	}

	QMenu *pHelpMenu	= new QMenu(this);
	pAction				= new QAction(QObject::tr("&About..."), this);
//	pAction->setShortcut(QObject::tr("F1"));
	ATASSERT( QObject::connect(pAction, SIGNAL(triggered()), this, SLOT(slotShowAbout())) );
	pHelpMenu->addAction(pAction);

	menuBar()->addMenu(pFileMenu)->setText(QObject::tr("File"));
	menuBar()->addMenu(pStyleMenu)->setText(QObject::tr("Style"));
	menuBar()->addMenu(pHelpMenu)->setText(QObject::tr("Help"));

	return true;
}
Exemplo n.º 3
0
void memwindow::CreateLayout(QtclConsole* qconsole) {

	this->parameters = new QPushButton("Parameters", this);
	this->status = new QPushButton("Status", this);
	this->help = new QPushButton("Help", this);
	this->about = new QPushButton("About", this);

	option_line->addWidget(parameters);
	option_line->addWidget(status);
	option_line->addWidget(help);
	option_line->addWidget(about);

	connect(this->parameters, SIGNAL( clicked() ), this,
			SLOT( slotShowParameters() ));

	connect(this->about, SIGNAL( clicked() ), this,
				SLOT( slotShowAbout() ));

	console_line->addWidget((QWidget*) qconsole);

	//      vbox->addWidget((QWidget*)option_line);
	//      vbox->addWidget((QWidget*)console_line);

	vbox->addLayout(option_line);
	vbox->addLayout(console_line);
	this->setLayout(vbox);
	//    settings->setSizePolicy(QSizePolicy::Expanding,
	//        QSizePolicy::Expanding);

}
Exemplo n.º 4
0
WindowMain::WindowMain(QWidget *parParent) :
  QMainWindow(parParent),
  pmManager_(0),
  ui_(new Ui::WindowMain())
{
  ui_->setupUi(this);
  currentWidget_ = NULL;
  questionBox_ = NULL;
  updateMessage_ = NULL;
  regenerationWidget_ = NULL;
  tabWidget_ = NULL;
  aboutWidget_ = NULL;

  windowName_ = QApplication::applicationName()+" "+QApplication::applicationVersion();

  setWindowTitle(windowName_);
  connect(ui_->actionQuit,
          SIGNAL(triggered()),
          this,
          SLOT(close()));
  connect(ui_->actionAbout,
          SIGNAL(triggered()),
          this,
          SLOT(slotShowAbout()));
  connect(ui_->actionManual_force_VM_Mask_rebuild,
          SIGNAL(triggered()),
          this,
          SLOT(slotCleanAllVmMasks()));
}
Exemplo n.º 5
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    connect(ui->actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
    connect(ui->action_About, SIGNAL(triggered()), ui->centralWidget, SLOT(slotShowAbout()));
    connect(ui->actionGame_Mode_A, SIGNAL(triggered()), ui->centralWidget, SLOT(slotStartNewGameModeA()));
    connect(ui->actionGame_Mode_B, SIGNAL(triggered()), ui->centralWidget, SLOT(slotStartNewGameModeB()));
    connect(ui->action_Reset, SIGNAL(triggered()), ui->centralWidget, SLOT(slotReset()));
    connect(ui->action_Sound, SIGNAL(triggered(bool)), ui->centralWidget, SLOT(slotEnableSound(bool)));
    connect(ui->centralWidget, SIGNAL(disableSound()), this, SLOT(slotDisableSoundMenu()));
    connect(this, SIGNAL(setPixmapSize(int,int)), ui->centralWidget, SLOT(slotSetPixmapSize(int,int)));
    connect(ui->action_Original_screen_size, SIGNAL(triggered()), this, SLOT(slotSetOriginalScreenSize()));

    //resize(640, 399 + ui->menuBar->height());
}