Esempio n. 1
0
void RefImage::insertImage(QPixmap pixmap, QString name)
{
    m_imageItem = new ManipulableItem(pixmap, name, this);
    setImageCached(true);

    connect(imageItem(),SIGNAL(destroyed()),this,SLOT(removeFromCache()));
    connect(imageItem(),SIGNAL(infoChanged()),this,SIGNAL(infoChanged()));

    emit newImage(imageItem());
}
void AMDataSourcesEditor::onSetViewIndexChanged(const QModelIndex &selected, const QModelIndex &deselected) {

	removeDetailEditor();

	// Nothing selected?
	////////////////////////
	if(!selected.isValid()) {
		nameEdit_->clear();
		descriptionEdit_->clear();
		descriptionEdit_->setReadOnly(true);
		addDataSourceButton_->setDisabled(true);
		return;
	}

	addDataSourceButton_->setEnabled(true);

	// Scan selected? (No selected data source)
	/////////////////////////
	if(!selected.parent().isValid()) {
		nameEdit_->clear();
		descriptionEdit_->clear();
		descriptionEdit_->setReadOnly(true);
		return;
	}


	// Data source selected.
	/////////////////

	// Remove old connection to the data source description.
	int oldSi = deselected.parent().row();
	int oldDi = deselected.row();
	AMDataSource *oldDataSource = model_->dataSourceAt(oldSi, oldDi);
	if (oldDataSource)
		disconnect(oldDataSource->signalSource(), SIGNAL(infoChanged()), this, SLOT(onDataSourceDescriptionChanged()));

	// Setup new data source.
	int si = selected.parent().row();
	int di = selected.row();
	AMDataSource* dataSource = model_->dataSourceAt(si, di);
	if(!dataSource)
		return;

	connect(dataSource->signalSource(), SIGNAL(infoChanged()), this, SLOT(onDataSourceDescriptionChanged()));

	nameEdit_->setText(dataSource->name());
	descriptionEdit_->setText(dataSource->description());
	descriptionEdit_->setReadOnly(false);

	installDetailEditor(dataSource->createEditorWidget());

	// Set the new selected data source as the exclusive view preference.
	model_->setExclusiveDataSourceByName(dataSource->name());
}
Esempio n. 3
0
Activity::Activity(const QString &id, QObject *parent)
    : QObject(parent),
      m_id(id),
      m_plugin("default"),
      m_info(new KActivities::Info(id, this)),
      m_activityConsumer(new KActivities::Consumer(this)),
      m_current(false)
{
    m_name = m_info->name();
    m_icon = m_info->icon();

    connect(m_info, SIGNAL(infoChanged()), this, SLOT(activityChanged()));
    connect(m_info, SIGNAL(stateChanged(KActivities::Info::State)), this, SLOT(activityStateChanged(KActivities::Info::State)));
    connect(m_info, SIGNAL(started()), this, SLOT(opened()));
    connect(m_info, SIGNAL(stopped()), this, SLOT(closed()));
    connect(m_info, SIGNAL(removed()), this, SLOT(removed()));

    connect(m_activityConsumer, SIGNAL(currentActivityChanged(QString)), this, SLOT(checkIfCurrent()));
    checkIfCurrent();

    //find your containments
    foreach (Plasma::Containment *cont, PlasmaApp::self()->corona()->containments()) {
        if ((cont->containmentType() == Plasma::Containment::DesktopContainment ||
             cont->containmentType() == Plasma::Containment::CustomContainment) &&
            !PlasmaApp::self()->corona()->offscreenWidgets().contains(cont) && cont->context()->currentActivityId() == id) {
            insertContainment(cont);
        }
    }

    //kDebug() << m_containments.size();
}
Esempio n. 4
0
void
ServiceBase::setInfoParser(InfoParserBase * infoParser)
{
    m_infoParser = infoParser;

    connect ( m_infoParser, SIGNAL( info( QString) ), this, SLOT( infoChanged( QString ) ) );
}
Esempio n. 5
0
void	GLWidget::updateSnap(char * snapName){
	if(object != 0){
		glDeleteLists(object, 1);
		object	=	0;
	}
	
	xRot	=	0;
	yRot	=	0;
	zRot	=	0;
	
	lookAt.x	=	0.0;
	lookAt.y	=	0.0;
	lookAt.z	=	NEAR;
	
	isFocusChanged	=	false;
	isCtrl			=	false;
	isCenChanged	=	false;

	lastFocus.x	=	curFocus.x	=	0.0;
	lastFocus.y	=	curFocus.y	=	0.0;
	lastFocus.z	=	curFocus.z	=	-10.0;

	lastCen.x	=	curCen.x	=	BOXSIZE/2.0;
	lastCen.y	=	curCen.y	=	BOXSIZE/2.0;
	lastCen.z	=	curCen.z	=	BOXSIZE/2.0;

	snap	=	new Snap;
	snap->readSnap(snapName);

	object	=	makeObject();	
	updateGL();

	emit infoChanged();
	delete snap;
}
Esempio n. 6
0
App::App() : KUniqueApplication()
    ,m_networkAccessManager(new NetworkAccessManager(this))
    ,m_oauth(new QOAuth::Interface(this))
    ,m_parser(new QJson::Parser)
    ,m_mainWindow(0)
    ,m_controller(0)
    ,m_tray(0)
{
    qmlRegisterType<QDeclarativePropertyMap>();

    m_controller = new Controller;
    m_mainWindow = new MainWindow;
    m_tray = new KStatusNotifierItem(m_mainWindow);
    m_tray->setIconByName("kmoefm");
    m_tray->setTitle(i18n("Moe FM"));
    m_tray->setToolTipIconByName("kmoefm");
    m_tray->setToolTipTitle(i18n("KMoeFM"));
    m_tray->setToolTipSubTitle(i18n("Moe FM"));
    KAction* action;
    action = m_tray->actionCollection()->addAction(QLatin1String("relogin"), this, SLOT(relogin()));
    action->setText(i18n("Relogin"));
    m_tray->contextMenu()->addAction(action);
    m_tray->setAssociatedWidget(m_mainWindow);

    connect(m_controller, SIGNAL(infoChanged()), this, SLOT(updateInfo()));

    m_oauth->setConsumerKey(CONSUMER_KEY);
    m_oauth->setConsumerSecret(CONSUMER_SECRET);

    readSettings();

    connect(this, SIGNAL(checkCredentialFinished(bool)), SLOT(firstRunCheck(bool)));
    QTimer::singleShot(0, this, SLOT(checkCredential()));
}
void HtmlInfo::parseHtmlFile(const QString &fileName)
{
    QFile file(fileName);

    // Reset the error flag
    m_error.clear();
    emit errorChanged();

    // Try to open the XHTML document and report an error if it fails
    if (!file.open(QIODevice::ReadOnly)) {
        m_error = tr("Couldn't open the file.");
        emit errorChanged();
        return;
    }

//! [0]
    // Create a XML stream reader on the file
    QXmlStreamReader reader(&file);
//! [0]

//! [1]
    int paragraphCount = 0;
    QStringList links;
    QString title;
    /**
     * Read the XHTML document token by token until the end is reached.
     * For every token check whether it's one we are interested in and extract
     * the needed information.
     */
    while (!reader.atEnd()) {
        reader.readNext();
        if (reader.isStartElement()) {
            if (reader.name() == "title")
                title = reader.readElementText();
            else if (reader.name() == "a")
                links.append(reader.attributes().value("href").toString());
            else if (reader.name() == "p")
                ++paragraphCount;
        }
    }
//! [1]

//! [2]
    // If the XML stream reader signaled an error, report it to the UI
    if (reader.hasError()) {
        m_error = tr("The HTML file isn't well-formed: %1").arg(reader.errorString());
        emit errorChanged();
        return;
    }
//! [2]

    // Update the properties with the extracted information
    m_title = title.simplified();
    m_paragraphs = paragraphCount;
    m_links = links.size();
    m_linksContent = links.join("\n");

    // Notify the UI that the properties have changed
    emit infoChanged();
}
Esempio n. 8
0
void VramCanvas::mousePressEvent(QMouseEvent* event) {
  if (event->button() == Qt::LeftButton) {
	  unsigned column = event->x() / 8;
	  unsigned row = event->y() / 8;
	  unsigned tile_num = (row * 64) + column;
	  emit infoChanged(tile_num);
  }
}
Esempio n. 9
0
void ChatWidget::resetStatusBar()
{
	ui->statusLabel->clear();
	ui->typingpixmapLabel->clear();

	typing = false;

	emit infoChanged(this);
}
Esempio n. 10
0
/* delete Input if it ever existed.
   Delete the callbacls on input
   p_input is released once here */
void InputManager::delInput()
{
    if( !p_input ) return;
    msg_Dbg( p_intf, "IM: Deleting the input" );

    /* Save time / position */
    float f_pos = var_GetFloat( p_input , "position" );
    int64_t i_time = var_GetTime( p_input, "time");
    int i_length = var_GetTime( p_input , "length" ) / CLOCK_FREQ;
    if( f_pos < 0.05 || f_pos > 0.95 || i_length < 60) {
        i_time = -1;
    }
    RecentsMRL::getInstance( p_intf )->setTime( p_item->psz_uri, i_time );

    delCallbacks();
    i_old_playing_status = END_S;
    p_item               = NULL;
    oldName              = "";
    artUrl               = "";
    b_video              = false;
    timeA                = 0;
    timeB                = 0;
    f_rate               = 0. ;

    if( p_input_vbi )
    {
        vlc_object_release( p_input_vbi );
        p_input_vbi = NULL;
    }

    vlc_object_release( p_input );
    p_input = NULL;

    emit positionUpdated( -1.0, 0 ,0 );
    emit rateChanged( var_InheritFloat( p_intf, "rate" ) );
    emit nameChanged( "" );
    emit chapterChanged( 0 );
    emit titleChanged( 0 );
    emit playingStatusChanged( END_S );

    emit teletextPossible( false );
    emit AtoBchanged( false, false );
    emit voutChanged( false );
    emit voutListChanged( NULL, 0 );

    /* Reset all InfoPanels but stats */
    emit artChanged( NULL );
    emit artChanged( "" );
    emit infoChanged( NULL );
    emit currentMetaChanged( (input_item_t *)NULL );

    emit encryptionChanged( false );
    emit recordingStateChanged( false );

    emit cachingChanged( 1 );
}
Esempio n. 11
0
QStyleItem::QStyleItem(QQuickPaintedItem *parent)
    : QQuickPaintedItem(parent),
    m_styleoption(0),
    m_itemType(Undefined),
    m_sunken(false),
    m_raised(false),
    m_active(true),
    m_selected(false),
    m_focus(false),
    m_hover(false),
    m_on(false),
    m_horizontal(true),
    m_sharedWidget(false),
    m_minimum(0),
    m_maximum(100),
    m_value(0),
    m_step(0),
    m_paintMargins(0),
    m_contentWidth(0),
    m_contentHeight(0)

{
    if (!qApp->style()) {
        qWarning("\nError: No widget style available. \n\nQt Desktop Components "
               "currently depend on the widget module to function. \n"
               "Use QApplication when creating standalone executables.\n\n");
        exit(-1);
    }
    m_font = qApp->font();
    setFlag(QQuickItem::ItemHasContents, true);
    setSmooth(false);

    connect(this, SIGNAL(enabledChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(infoChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(onChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(selectedChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(textChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(raisedChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(sunkenChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(hoverChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(maximumChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(minimumChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(valueChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(horizontalChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeControlChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(hasFocusChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeControlChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(elementTypeChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(textChanged()), this, SLOT(updateSizeHint()));
    connect(this, SIGNAL(contentWidthChanged(int)), this, SLOT(updateSizeHint()));
    connect(this, SIGNAL(contentHeightChanged(int)), this, SLOT(updateSizeHint()));
}
Esempio n. 12
0
static void updateSaveButtons(int mask, BOOL ok)
{
	if (ok) {
		invalid_fields &= ~mask;
		ok = invalid_fields == 0;
	}
	else
		invalid_fields |= mask;
	if (can_save)
		EnableWindow(GetDlgItem(infoDialog, IDC_SAVE), ok && infoChanged());
	EnableWindow(GetDlgItem(infoDialog, IDC_SAVEAS), ok);
}
Esempio n. 13
0
void ChatWidget::showEvent(QShowEvent */*event*/)
{
	newMessages = false;
	emit infoChanged(this);
	focusDialog();

	if (firstShow) {
		// Workaround: now the scroll position is correct calculated
		firstShow = false;
		QScrollBar *scrollbar = ui->textBrowser->verticalScrollBar();
		scrollbar->setValue(scrollbar->maximum());
	}
}
Esempio n. 14
0
AMAction3* AMActionRunner3::removeActionFromQueue(int index)
{
	if(index<0 || index>=queuedActions_.count())
		return 0;

	emit queuedActionAboutToBeRemoved(index);
	AMAction3* actionToBeRemoved= queuedActions_.takeAt(index);
	emit queuedActionRemoved(index);

	disconnect(actionToBeRemoved->info(), SIGNAL(infoChanged()), this, SIGNAL(queuedActionInfoChanged()));

	return actionToBeRemoved;
}
Esempio n. 15
0
void ChatWidget::updateStatusString(const QString &statusMask, const QString &statusString)
{
	ui->statusLabel->setText(QString(statusMask).arg(tr(statusString.toAscii()))); // displays info for 5 secs.
	ui->typingpixmapLabel->setPixmap(QPixmap(":images/typing.png") );

	if (statusString == "is typing...") {
		typing = true;

		emit infoChanged(this);
	}

	QTimer::singleShot(5000, this, SLOT(resetStatusBar())) ;
}
void AMActionRunnerBottomBarCurrentView3::onCurrentActionChanged(AMAction3 *action)
{
	AMActionRunnerCurrentViewBase::onCurrentActionChanged(action);

	if (action && !action->parentAction() && qobject_cast<AMLoopAction3 *>(action)){

		rootLoopAction_ = qobject_cast<AMLoopAction3 *>(action);
		increaseIterations_->setEnabled(true);
		increaseIterations_->setVisible(true);
		decreaseIterations_->setEnabled(true);
		decreaseIterations_->setVisible(true);
		connect(rootLoopAction_, SIGNAL(currentIterationChanged(int)), this, SLOT(onLoopIterationUpdate(int)));
		connect(rootLoopAction_, SIGNAL(currentSubActionChanged(int)), this, SLOT(onRootLoopSubActionChanged(int)));
		connect(rootLoopAction_, SIGNAL(statusTextChanged(QString)), this, SLOT(onStatusTextChanged(QString)));
		connect(rootLoopAction_->info(), SIGNAL(infoChanged()), this, SLOT(onRootLoopActionLoopCountChanged()));
	}
/* delete Input if it ever existed.
   Delete the callbacls on input
   p_input is released once here */
void InputManager::delInput()
{
    if( !p_input ) return;
    msg_Dbg( p_intf, "IM: Deleting the input" );

    delCallbacks();
    i_old_playing_status = END_S;
    p_item               = NULL;
    oldName              = "";
    artUrl               = "";
    b_video              = false;
    timeA                = 0;
    timeB                = 0;
    f_rate               = 0. ;

    if( p_input_vbi )
    {
        vlc_object_release( p_input_vbi );
        p_input_vbi = NULL;
    }

    vlc_object_release( p_input );
    p_input = NULL;

    emit positionUpdated( -1.0, 0 ,0 );
    emit rateChanged( var_InheritFloat( p_intf, "rate" ) );
    emit nameChanged( "" );
    emit chapterChanged( 0 );
    emit titleChanged( 0 );
    emit playingStatusChanged( END_S );

    emit teletextPossible( false );
    emit AtoBchanged( false, false );
    emit voutChanged( false );
    emit voutListChanged( NULL, 0 );

    /* Reset all InfoPanels but stats */
    emit artChanged( NULL );
    emit artChanged( "" );
    emit infoChanged( NULL );
    emit currentMetaChanged( (input_item_t *)NULL );

    emit encryptionChanged( false );
    emit recordingStateChanged( false );

    emit cachingChanged( 1 );
}
Esempio n. 18
0
WizardBootstrapPage::WizardBootstrapPage(
    SimpleWizard*   wizard,
    const QString&  info ) :
    QWidget( wizard )
{
    uiProgress.setupUi( this );
    uiProgress.progressBar->setRange( 0, 100 );

    uiProgress.topLabel->setText( info );

    // Hook up our signals to the widgets
    connect( this,                   SIGNAL( infoChanged( QString ) ),
             uiProgress.topLabel,    SLOT( setText( const QString& ) ) );

    wizard->enableNext( false );
    wizard->enableBack( false );
}
Esempio n. 19
0
void Viewer::startTask2(QVector<QString> tlist){
    if (tlist.size()==0)    return;

    QMessageBox msgBox;
    msgBox.setText("Task 2 is about to begin\n You will find information about this task on the bottom left area of the screen");
    msgBox.exec();

    task_files = tlist;
    task_id = TASK2;
    task_status = 1;
    task_pos = 0;
    addTerrain(task_files.front());
    emit updateTasklabel(QString::number(task_pos+1)+"/"+QString::number(task_files.size()));
    emit updateIDlabel("TASK "+QString::number(task_id));
    emit taskIsNot1(true);
    emit taskIsNot0(true);
    emit infoChanged(task2_info);
}
Esempio n. 20
0
void updateInfoDialog(LPCTSTR filename, int song)
{
	int songs;
	int i;
	if (infoDialog == NULL)
		return;
	if (edited_info == NULL) {
		edited_info = ASAPInfo_New();
		if (astil == NULL)
			astil = ASTIL_New();
		if (edited_info == NULL || astil == NULL) {
			closeInfoDialog();
			return;
		}
	}
	else if (infoChanged())
		return;
	if (!loadModule(filename, saved_module, &saved_module_len)
	 || !ASAPInfo_Load(edited_info, filename, saved_module, saved_module_len)) {
		closeInfoDialog();
		return;
	}
	setSaved();
	can_save = isExt(filename, _T(".sap"));
	invalid_fields = 0;
	SendDlgItemMessage(infoDialog, IDC_FILENAME, WM_SETTEXT, 0, (LPARAM) filename);
	SendDlgItemMessage(infoDialog, IDC_AUTHOR, WM_SETTEXT, 0, (LPARAM) saved_author);
	SendDlgItemMessage(infoDialog, IDC_NAME, WM_SETTEXT, 0, (LPARAM) saved_title);
	SendDlgItemMessage(infoDialog, IDC_DATE, WM_SETTEXT, 0, (LPARAM) saved_date);
	SendDlgItemMessage(infoDialog, IDC_SONGNO, CB_RESETCONTENT, 0, 0);
	songs = ASAPInfo_GetSongs(edited_info);
	EnableWindow(GetDlgItem(infoDialog, IDC_SONGNO), songs > 1);
	for (i = 1; i <= songs; i++) {
		_TCHAR str[16];
		_stprintf(str, _T("%d"), i);
		SendDlgItemMessage(infoDialog, IDC_SONGNO, CB_ADDSTRING, 0, (LPARAM) str);
	}
	if (song < 0)
		song = ASAPInfo_GetDefaultSong(edited_info);
	SendDlgItemMessage(infoDialog, IDC_SONGNO, CB_SETCURSEL, song, 0);
	setEditedSong(song);
	EnableWindow(GetDlgItem(infoDialog, IDC_SAVE), FALSE);
	updateTech();
}
Esempio n. 21
0
void Viewer::startTask1(QVector<QString> tlist){
    DeleteAll();
    if (tlist.size()==0)    return;
    task_files = tlist;
    task_id = TASK1;
    task_status = 1;
    task_pos = 0;

     QMessageBox msgBox;
     msgBox.setText("Task 1 is about to begin\n You will find information about this task on the bottom left area of the screen");
     msgBox.exec();

    rankings.push_back(0);  rankings.push_back(1);  rankings.push_back(2);
    emit updateIDlabel("TASK "+QString::number(task_id));
    startsubTask1();
    emit taskIsNot1(false);
    emit taskIsNot0(true);
    emit infoChanged(task1_info);
}
Esempio n. 22
0
void InfoHandler::Ontimeout()
{
	if (list.length() < 1 || index >= list.length()) return;

	QString info;

	info = list.at(index).toMap().value("info").toString();
	emit infoChanged(info);

	if (index < list.length() - 1)
	{
		index ++;
	}
	else
	{
		index = 0;
	}
	
}
Esempio n. 23
0
WizardProgressPage::WizardProgressPage(
    SimpleWizard*   wizard,
    const QString&  info,
    const QString&  detailedInfo ) :
        QWidget( wizard )
{
    uiProgress.setupUi( this );

    uiProgress.topLabel->setText( info );
    uiProgress.bottomLabel->setText( detailedInfo );

    // Hook up our signals to the widgets
    connect( this,                   SIGNAL( infoChanged( QString ) ),
             uiProgress.topLabel,    SLOT( setText( const QString& ) ) );

    connect( this,                   SIGNAL( detailedInfoChanged( QString ) ),
             uiProgress.bottomLabel, SLOT( setText( const QString& ) ) );

    wizard->enableNext( false );
    wizard->enableBack( false );
}
Esempio n. 24
0
QStyleItem::QStyleItem(QDeclarativeItem *parent)
    : QDeclarativeItem(parent),
    m_dummywidget(0),
    m_styleoption(0),
    m_type(Undefined),
    m_sunken(false),
    m_raised(false),
    m_active(true),
    m_selected(false),
    m_focus(false),
    m_on(false),
    m_horizontal(true),
    m_sharedWidget(false),
    m_minimum(0),
    m_maximum(100),
    m_value(0),
    m_paintMargins(0)
{
    setFlag(QGraphicsItem::ItemHasNoContents, false);
    setCacheMode(QGraphicsItem::DeviceCoordinateCache);
    setSmooth(true);

    connect(this, SIGNAL(infoChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(onChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(selectedChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(textChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(raisedChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(sunkenChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(hoverChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(maximumChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(minimumChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(valueChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(horizontalChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeControlChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(focusChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeControlChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(elementTypeChanged()), this, SLOT(updateItem()));
}
Esempio n. 25
0
bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
{
	if (obj == ui->chatTextEdit) {
		if (event->type() == QEvent::KeyPress) {
			updateStatusTyping();

			QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
			if (keyEvent && (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return)) {
				// Enter pressed
				if (Settings->getChatSendMessageWithCtrlReturn()) {
					if (keyEvent->modifiers() & Qt::ControlModifier) {
						// send message with Ctrl+Enter
						sendChat();
						return true; // eat event
					}
				} else {
					if (keyEvent->modifiers() & Qt::ControlModifier) {
						// insert return
						ui->chatTextEdit->textCursor().insertText("\n");
					} else {
						// send message with Enter
						sendChat();
					}
					return true; // eat event
				}
			}
		}
	} else {
		if (event->type() == QEvent::WindowActivate) {
			if (isVisible() && (window() == NULL || window()->isActiveWindow())) {
				newMessages = false;
				emit infoChanged(this);
				focusDialog();
			}
		}
	}
	// pass the event on to the parent class
	return QWidget::eventFilter(obj, event);
}
Esempio n. 26
0
AMScanActionEditor::AMScanActionEditor(AMScanActionInfo *info, QWidget *parent)
	: QFrame(parent)
{
	info_ = info;
	setFrameStyle(QFrame::StyledPanel);

	configView_ = 0;

	scanName_ = new QLabel(QString("%1 : %2").arg(info_->configuration()->detailedDescription()).arg(info_->configuration()->name()));
	connect(info_, SIGNAL(infoChanged()), this, SLOT(onScanInfoChanged()));

	QPushButton *configViewButton = new QPushButton(QIcon(":/32x32/hammer-wrench.png"), "Show Configuration");
	connect(configViewButton, SIGNAL(clicked()), this, SLOT(onScanConfigurationViewRequested()));

	QHBoxLayout *layout = new QHBoxLayout;
	layout->addWidget(scanName_);
	layout->addStretch();
	layout->addWidget(configViewButton);
	layout->setContentsMargins(0,0,0,0);

	setLayout(layout);
}
Esempio n. 27
0
Target *
Participant::addTarget()
{
    Target *target = new Target(tr("Hydrogen"), this);
    connect(target, SIGNAL(authorChanged(QString)),
            context, SLOT(setSessionModified()));
    connect(target, SIGNAL(infoChanged(QString)),
            context, SLOT(setSessionModified()));
    connect(target, SIGNAL(kitNameChanged(QString)),
            context, SLOT(setSessionModified()));
    connect(target, SIGNAL(layerAlgorithmChanged(LayerAlgorithm)),
            context, SLOT(setSessionModified()));
    connect(target, SIGNAL(licenseChanged(QString)),
            context, SLOT(setSessionModified()));
    connect(target, SIGNAL(nameChanged(QString)),
            context, SLOT(setSessionModified()));
    connect(target, SIGNAL(pathChanged(QString)),
            context, SLOT(setSessionModified()));
    connect(target, SIGNAL(sampleFormatChanged(SampleFormat)),
            context, SLOT(setSessionModified()));

    synthclone::MenuAction *action =
        new synthclone::MenuAction(tr("Configure"), target);
    connect(action, SIGNAL(triggered()), SLOT(handleTargetConfiguration()));

    const synthclone::Registration &targetRegistration =
        context->addTarget(target);
    connect(&targetRegistration, SIGNAL(unregistered(QObject *)),
            SLOT(handleUnregistration(QObject *)));

    const synthclone::Registration &actionRegistration =
        context->addMenuAction(action, target);
    connect(&actionRegistration, SIGNAL(unregistered(QObject *)),
            SLOT(handleUnregistration(QObject *)));

    return target;
}
Esempio n. 28
0
inline void InputManager::UpdateInfo()
{
    assert( p_input );
    emit infoChanged( input_GetItem( p_input ) );
}
Esempio n. 29
0
void
WizardBootstrapPage::setInfo( QString info )
{
    emit infoChanged( info );
}
Esempio n. 30
0
void
WizardProgressPage::setInfo(
    QString info )
{
    emit infoChanged( info );
}