Esempio n. 1
0
tUsbPortManager::tUsbPortManager( size_t cpuCount, tHALIOInterface& rHal, tUsbPortSettings& rSettings, QObject* pParent )
    : QObject( pParent )
    , m_PortCount( rHal.GetUsbPortMux().size() ) // this allows to determine the number of port we can actually changed
    , m_CpuCount( cpuCount )
    , m_rHal( rHal )
    , m_rSettings( rSettings )
{
    Connect( &m_rSettings, SIGNAL( Updated() ), this, SLOT( OnSettingsChanged() ) );
    Connect( &m_rHal, SIGNAL( UsbPortMuxChanged(std::vector<Hal::tCpuNumber> ) ), this, SLOT( OnPortMuxChanged() ) );
    OnSettingsChanged(); // load current config
}
Esempio n. 2
0
void OptionsDialog::OnResetButton()
{
    _settings->InitSettings();
    InitOptionsDialog();
    _settings->NotifyAll();

    OnSettingsChanged();
}
Esempio n. 3
0
void OptionsDialog::OnPathSelect()
{
    QString path;

    if (ui->_btnPathsPlayer == sender()) {
        path = QFileDialog::getOpenFileName(this,
                                           tr("Path to QSP player"),
                                           ui->_txtPathsPlayer->text(),
                                           tr("QSP Player (*)"));
        if (!path.isEmpty())
        {
            ui->_txtPathsPlayer->setText(QDir::toNativeSeparators(path));
        }
    }

    OnSettingsChanged();
}
Esempio n. 4
0
void OptionsDialog::OnFontSelect()
{
    bool ok;
    QFont font;

    if (ui->_btnFontsBase == sender())
    {
        font = QFontDialog::getFont(&ok, ui->_txtFontBase->font(), this);
        if (ok)
        {
            ui->_txtFontBase->setFont(font);
            ui->_txtFontBase->setText(font.family());
        }
    } else if (ui->_btnFontsStatements == sender())
    {
        font = QFontDialog::getFont(&ok, ui->_txtFontStatements->font(), this);
        if (ok)
        {
            ui->_txtFontStatements->setFont(font);
            ui->_txtFontStatements->setText(font.family());
        }
    } else if (ui->_btnFontsFunctions == sender())
    {
        font = QFontDialog::getFont(&ok, ui->_txtFontFunctions->font(), this);
        if (ok)
        {
            ui->_txtFontFunctions->setFont(font);
            ui->_txtFontFunctions->setText(font.family());
        }
    } else if (ui->_btnFontsSysVariables == sender())
    {
        font = QFontDialog::getFont(&ok, ui->_txtFontSysVariables->font(), this);
        if (ok)
        {
            ui->_txtFontSysVariables->setFont(font);
            ui->_txtFontSysVariables->setText(font.family());
        }
    } else if (ui->_btnFontsStrings == sender())
    {
        font = QFontDialog::getFont(&ok, ui->_txtFontStrings->font(), this);
        if (ok)
        {
            ui->_txtFontStrings->setFont(font);
            ui->_txtFontStrings->setText(font.family());
        }
    } else if (ui->_btnFontsNumbers == sender())
    {
        font = QFontDialog::getFont(&ok, ui->_txtFontNumbers->font(), this);
        if (ok)
        {
            ui->_txtFontNumbers->setFont(font);
            ui->_txtFontNumbers->setText(font.family());
        }
    } else if (ui->_btnFontsOptsBrts == sender())
    {
        font = QFontDialog::getFont(&ok, ui->_txtFontOptsBrts->font(), this);
        if (ok)
        {
            ui->_txtFontOptsBrts->setFont(font);
            ui->_txtFontOptsBrts->setText(font.family());
        }
    } else if (ui->_btnFontsMarks == sender())
    {
        font = QFontDialog::getFont(&ok, ui->_txtFontMarks->font(), this);
        if (ok)
        {
            ui->_txtFontMarks->setFont(font);
            ui->_txtFontMarks->setText(font.family());
        }
    } else if (ui->_btnFontsComments == sender())
    {
        font = QFontDialog::getFont(&ok, ui->_txtFontComments->font(), this);
        if (ok)
        {
            ui->_txtFontComments->setFont(font);
            ui->_txtFontComments->setText(font.family());
        }
    }

    OnSettingsChanged();
}
Esempio n. 5
0
void OptionsDialog::OnColorSelect()
{
    QColor color;

    if (ui->_btnClrsBaseBack == sender())
    {
        color = QColorDialog::getColor(ui->_colorBaseBack->GetBackColor(), this);
        if (color.isValid())
        {
            ui->_colorBaseBack->SetBackColor(color);
        }
    } else if (ui->_btnClrsTextBack == sender())
    {
        color = QColorDialog::getColor(ui->_colorTextBack->GetBackColor(), this);
        if (color.isValid())
        {
            ui->_colorTextBack->SetBackColor(color);
            ui->_txtFontBase->SetBackColor(color);
            ui->_txtFontStatements->SetBackColor(color);
            ui->_txtFontFunctions->SetBackColor(color);
            ui->_txtFontSysVariables->SetBackColor(color);
            ui->_txtFontStrings->SetBackColor(color);
            ui->_txtFontNumbers->SetBackColor(color);
            ui->_txtFontOptsBrts->SetBackColor(color);
            ui->_txtFontMarks->SetBackColor(color);
            ui->_txtFontComments->SetBackColor(color);
        }
    } else if (ui->_btnClrsBaseFont == sender())
    {
        color = QColorDialog::getColor(ui->_colorBaseFont->GetBackColor(), this);
        if (color.isValid())
        {
            ui->_colorBaseFont->SetBackColor(color);
            ui->_txtFontBase->SetFontColor(color);
        }
    } else if (ui->_btnClrsStatements == sender())
    {
        color = QColorDialog::getColor(ui->_colorStatements->GetBackColor(), this);
        if (color.isValid())
        {
            ui->_colorStatements->SetBackColor(color);
            ui->_txtFontStatements->SetFontColor(color);
        }
    } else if (ui->_btnClrsFunctions == sender())
    {
        color = QColorDialog::getColor(ui->_colorFunctions->GetBackColor(), this);
        if (color.isValid())
        {
            ui->_colorFunctions->SetBackColor(color);
            ui->_txtFontFunctions->SetFontColor(color);
        }
    } else if (ui->_btnClrsSysVariables == sender())
    {
        color = QColorDialog::getColor(ui->_colorSysVariables->GetBackColor(), this);
        if (color.isValid())
        {
            ui->_colorSysVariables->SetBackColor(color);
            ui->_txtFontSysVariables->SetFontColor(color);
        }
    } else if (ui->_btnClrsStrings == sender())
    {
        color = QColorDialog::getColor(ui->_colorStrings->GetBackColor(), this);
        if (color.isValid())
        {
            ui->_colorStrings->SetBackColor(color);
            ui->_txtFontStrings->SetFontColor(color);
        }
    } else if (ui->_btnClrsNumbers == sender())
    {
        color = QColorDialog::getColor(ui->_colorNumbers->GetBackColor(), this);
        if (color.isValid())
        {
            ui->_colorNumbers->SetBackColor(color);
            ui->_txtFontNumbers->SetFontColor(color);
        }
    } else if (ui->_btnClrsOptsBrts == sender())
    {
        color = QColorDialog::getColor(ui->_colorOptsBrts->GetBackColor(), this);
        if (color.isValid())
        {
            ui->_colorOptsBrts->SetBackColor(color);
            ui->_txtFontOptsBrts->SetFontColor(color);
        }
    } else if (ui->_btnClrsMarks == sender())
    {
        color = QColorDialog::getColor(ui->_colorMarks->GetBackColor(), this);
        if (color.isValid())
        {
            ui->_colorMarks->SetBackColor(color);
            ui->_txtFontMarks->SetFontColor(color);
        }
    } else if (ui->_btnClrsComments == sender())
    {
        color = QColorDialog::getColor(ui->_colorComments->GetBackColor(), this);
        if (color.isValid())
        {
            ui->_colorComments->SetBackColor(color);
            ui->_txtFontComments->SetFontColor(color);            
        }
    }

    OnSettingsChanged();
}
void QmitkUSNavigationProcessWidget::SetSettingsWidget(QmitkUSNavigationAbstractSettingsWidget* settingsWidget)
{
  // disconnect slots to settings widget if there was a widget before
  if ( m_SettingsWidget )
  {
    disconnect( ui->settingsSaveButton, SIGNAL(clicked()), m_SettingsWidget, SLOT(OnSave()) );
    disconnect( ui->settingsCancelButton, SIGNAL(clicked()), m_SettingsWidget, SLOT(OnCancel()) );

    disconnect (m_SettingsWidget, SIGNAL(Saved()), this, SLOT(OnSettingsWidgetReturned()) );
    disconnect (m_SettingsWidget, SIGNAL(Canceled()), this, SLOT(OnSettingsWidgetReturned()) );
    disconnect (m_SettingsWidget, SIGNAL(SettingsChanged(itk::SmartPointer<mitk::DataNode>)), this, SLOT(OnSettingsChanged(itk::SmartPointer<mitk::DataNode>)) );

    ui->settingsWidget->removeWidget(m_SettingsWidget);
  }

  m_SettingsWidget = settingsWidget;
  if ( m_SettingsWidget )
  {
    m_SettingsWidget->LoadSettings();

    connect( ui->settingsSaveButton, SIGNAL(clicked()), m_SettingsWidget, SLOT(OnSave()) );
    connect( ui->settingsCancelButton, SIGNAL(clicked()), m_SettingsWidget, SLOT(OnCancel()) );

    connect (m_SettingsWidget, SIGNAL(Saved()), this, SLOT(OnSettingsWidgetReturned()) );
    connect (m_SettingsWidget, SIGNAL(Canceled()), this, SLOT(OnSettingsWidgetReturned()) );
    connect (m_SettingsWidget, SIGNAL(SettingsChanged(itk::SmartPointer<mitk::DataNode>)), this, SLOT(OnSettingsChanged(itk::SmartPointer<mitk::DataNode>)) );

    if ( m_SettingsNode.IsNotNull() ) { m_SettingsWidget->SetSettingsNode(m_SettingsNode, true); }

    ui->settingsWidget->addWidget(m_SettingsWidget);
  }
  ui->settingsButton->setEnabled(m_SettingsWidget != 0);
}
Esempio n. 7
0
//This is the procedure that is run when Opera is used via the EmBrowser API
LRESULT BLD_CALLBACK DLLWndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
{
	switch(message)
	{
	case WM_SETTINGCHANGE:
		extern void OnSettingsChanged();
		OnSettingsChanged();
		return 0;
		
    case WM_DRAWITEM:
        return ucWMDrawItem(hWnd,message,wParam,lParam);
		
    case WM_MEASUREITEM:
        return ucMeasureItem(hWnd,message,wParam,lParam);
		
    case WM_MENUCHAR:
        return g_windows_menu_manager->OnMenuChar(LOWORD(wParam), (HMENU) lParam);
    case WM_COMMAND:
		return g_windows_menu_manager && g_windows_menu_manager->OnMenuCommand(LOWORD(wParam));
    case WM_TIMER:
		{
			return ucTimer(hWnd,message,wParam,lParam);
		}
		
	case WM_KEYDOWN:
		{
			g_input_manager->InvokeKeyPressed(static_cast<OpKey::Code>(wParam), 0);
		}
		
		break;
		
		
	default:
		{ 
			if (hWnd == g_main_hwnd && g_main_message_handler && (message >= WM_USER)) // The (message >= WM_USER) test checks if this is a message posted by opera.
			{
				switch (message)
				{
					case WM_WINSOCK_ACCEPT_CONNECTION:
					{
						OpMessage opr_msg = WINSOCK_ACCEPT_CONNECTION;
						g_main_message_handler->PostDelayedMessage(opr_msg, wParam, lParam, 0);
						break;
					}
					case WM_WINSOCK_CONNECT_READY:
					{
						OpMessage opr_msg = WINSOCK_CONNECT_READY;
						g_main_message_handler->PostDelayedMessage(opr_msg, wParam, lParam, 0);
						break;
					}
					case WM_WINSOCK_DATA_READY:
					{
						OpMessage opr_msg = WINSOCK_DATA_READY;
						g_main_message_handler->PostDelayedMessage(opr_msg, wParam, lParam, 0);
						break;
					}
					case WM_WINSOCK_HOSTINFO_READY:
					{
						OpMessage opr_msg = WINSOCK_HOSTINFO_READY;
						g_main_message_handler->PostDelayedMessage(opr_msg, wParam, lParam, 0);
						break;
					}
					default:
					{
						OP_ASSERT(0);
						// Note by mariusab 20051222:
						// If this hits, a message in user space has been posted that is not properly handled when it returns.
						// The PostDelayedMessage callback requires OpMessage-messages, and these don't have set values. 
						// Mapping between windows user space messages and OpMessages must be done explicitly.
						break;
					}
				}
				return FALSE;
			}
			else
			{
				return DefWindowProc(hWnd, message,wParam,lParam);
			}
		}
	}
	return FALSE;
}