Esempio n. 1
0
LaunchSimulationBox::LaunchSimulationBox(
        const Glib::RefPtr < Gtk::Builder >& xml, const vpz::Vpz& vpz,
        vle::utils::Package& curr_pack)
    : mVpz(vpz), mDialog(0), mMono(0), mMulti(0), mNbProcess(0), mDistant(0),
    mPlay(0), mStop(0), mProgressBar(0), mCurrentTimeLabel(0),mState(Wait),
    mThread(0), mThreadRun(false), mCurrPackage(curr_pack)
{
    xml->get_widget("DialogSimulation", mDialog);
    xml->get_widget("RadioSimuMono", mMono);
    xml->get_widget("RadioSimuMulti", mMulti);
    xml->get_widget("SpinSimuProcess", mNbProcess);
    xml->get_widget("RadioSimuDistant", mDistant);
    xml->get_widget("simuPlay", mPlay);
    xml->get_widget("simuStop", mStop);
    xml->get_widget("simuProgressBar", mProgressBar);
    xml->get_widget("simuCurrentTime", mCurrentTimeLabel);

    mConnectionPlayButton = mPlay->signal_clicked().connect(
        sigc::mem_fun(*this, &LaunchSimulationBox::onPlayButtonClicked));

    mConnectionStopButton = mStop->signal_clicked().connect(
        sigc::mem_fun(*this, &LaunchSimulationBox::onStopButtonClicked));

    mMono->set_active(true);
    mMulti->set_sensitive(false);
    mDistant->set_sensitive(false);

    updateWidget();
}
Esempio n. 2
0
ModuleWindow::ModuleWindow(Module* module, MainWindow* parent, 
                               Manager* manager)
{
    m_pModule = module;
    m_pParent = parent;
    m_pManager = manager;

    /* Create a new scrolled window, with scrollbars only if needed */
    set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
    add(m_TreeView);

    /* create tree store */
    m_refTreeModel = Gtk::TreeStore::create(m_Columns);
    m_TreeView.set_model(m_refTreeModel);

    //Add the Model’s column to the View’s columns: 
    Gtk::CellRendererText* cellText = Gtk::manage(new Gtk::CellRendererText());
    Gtk::CellRendererPixbuf* cellPix = Gtk::manage(new Gtk::CellRendererPixbuf()); 
    Gtk::TreeViewColumn* col = Gtk::manage(new Gtk::TreeViewColumn("Item"));
    col->pack_start(*cellPix, false);
    col->pack_start(*cellText, true);
    col->add_attribute(*cellText, "text", 1);
    col->add_attribute(*cellPix, "pixbuf", 0);
    m_TreeView.append_column(*col);
    m_TreeView.get_column(0)->set_resizable(true);

    m_TreeView.append_column("Value", m_Columns.m_col_value);
    m_TreeView.get_column(1)->set_resizable(true);
    
    updateWidget();
    show_all_children();
}
 void PianorollTrackView::onMouseReleaseSlot(QMouseEvent *event) {
     mouseStatus.endPosition = mapToScene(event->pos());
     if (mouseStatus.mode == MouseStatus::LEFTBUTTON_MOVE_ITEM) {
         if (mouseStatus.isMouseMoved) {
             ItemSelectionManager *manager = controllerAdapter->getItemSelectionManager();
             EditEventCommand command = manager->getEditEventCommand(trackIndex);
             controllerAdapter->execute(&command);
         } else {
             ItemSelectionManager *manager = controllerAdapter->getItemSelectionManager();
             const VSQ_NS::Event *noteEventOnMouse = findNoteEventAt(event->pos());
             if (noteEventOnMouse) {
                 if ((event->modifiers() & Qt::ControlModifier) != Qt::ControlModifier) {
                     manager->clear();
                 }
                 if (mouseStatus.itemSelectionStatusAtFirst.isContains(noteEventOnMouse)) {
                     manager->remove(noteEventOnMouse);
                 } else {
                     manager->add(noteEventOnMouse);
                 }
             }
         }
     } else if (mouseStatus.mode == MouseStatus::LEFTBUTTON_ADD_ITEM) {
         if (0 < mouseStatus.addingNoteItem.getLength()) {
             std::vector<VSQ_NS::Event> eventList;
             eventList.push_back(mouseStatus.addingNoteItem);
             AddEventCommand command(trackIndex, eventList);
             controllerAdapter->execute(&command);
         }
     }
     mouseStatus.mode = MouseStatus::NONE;
     updateWidget();
 }
Esempio n. 4
0
void ResourceWindow::onRefresh()
{
    ErrorLogger* logger  = ErrorLogger::Instance();

    if(m_pManager->updateResource(m_pComputer->getName()))
    {
        YarpBroker broker;
        broker.init();
    
        string strServer = m_pComputer->getName();
        if(strServer[0] != '/')
            strServer = string("/") + strServer;
        // Processes list
        ProcessContainer processes;
        if(broker.getAllProcesses(strServer.c_str(), processes))
        {
            m_pComputer->getProcesses().clear();
            for(unsigned int i=0; i<processes.size(); i++)
                m_pComputer->getProcesses().push_back(processes[i]);
        }
        else
            logger->addError(broker.error());        

        updateWidget();
    }
    m_pParent->reportErrors();
}
Esempio n. 5
0
static void updateAll(EditorWidget *my_widget, QWidget *widget){
  configure_note_colors(my_widget);

  updateWidget(my_widget, widget);

#if 0
  if(widget->objectName () == "view"){
    widget->setStyleSheet(QString::fromUtf8("background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0.38, y2:1, stop:0 rgba(111, 131, 111, 22), stop:1 rgba(255, 255, 255, 43));"));
  }
#endif

#if 0
  widget->setStyleSheet(QString::fromUtf8("color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0.38, y2:1, stop:0 rgba(0, 3, 0, 155), stop:1 rgba(5, 5, 5, 175));"));
#endif

  const QList<QObject*> list = widget->children();
  if(list.empty()==true)
    return;

  for (int i = 0; i < list.size(); ++i) {
    QWidget *widget = dynamic_cast<QWidget*>(list.at(i));
    if(widget!=NULL)
      updateAll(my_widget,widget);
  }
}
Esempio n. 6
0
static void updateAll(EditorWidget *my_widget){
  foreach (QWidget *widget, QApplication::allWidgets())
    updateWidget(my_widget, widget);

  //updateAll(my_widget,application->mainWidget());
  updateApplication(my_widget,application);
}
Esempio n. 7
0
void ColormapEditWidget::selectionChanged( int id )
{
    m_colormap = ColormapFunctions::get( id );
    m_nameEdit->setText( m_colormap.getName() );
    m_selected = id;

    updateWidget();
}
    void PianorollTrackView::onMouseMoveSlot(QMouseEvent *event) {
        if (mouseStatus.mode == MouseStatus::LEFTBUTTON_SELECT_ITEM) {
            mouseStatus.endPosition = mapToScene(event->pos());
            updateSelectedItem();
            updateWidget();
        } else if (mouseStatus.mode == MouseStatus::MIDDLEBUTTON_SCROLL) {
            QPoint globalMousePos = ui->mainContent->mapToGlobal(event->pos());
            int deltaX = globalMousePos.x() - mouseStatus.globalStartPosition.x();
            int deltaY = globalMousePos.y() - mouseStatus.globalStartPosition.y();

            ui->mainContent->horizontalScrollBar()
                          ->setValue(mouseStatus.horizontalScrollStartValue - deltaX);
            ui->mainContent->verticalScrollBar()
                          ->setValue(mouseStatus.verticalScrollStartValue - deltaY);
            updateWidget();
        } else if (mouseStatus.mode == MouseStatus::LEFTBUTTON_MOVE_ITEM) {
            QPoint currentMousePos = mapToScene(event->pos());

            // マウスの移動量から、クロック・ノートの移動量を算出
            VSQ_NS::tick_t deltaClocks = controllerAdapter->getTickFromX(currentMousePos.x())
                    - controllerAdapter->getTickFromX(mouseStatus.startPosition.x());
            if (mouseStatus.noteOnMouse) {
                VSQ_NS::tick_t editedNoteClock
                        = quantize(mouseStatus.noteOnMouse->clock + deltaClocks);
                deltaClocks = editedNoteClock - mouseStatus.noteOnMouse->clock;
            }
            int deltaNoteNumbers = getNoteNumberFromY(currentMousePos.y(), trackHeight)
                    - getNoteNumberFromY(mouseStatus.startPosition.y(), trackHeight);

            // 選択されたアイテムすべてについて、移動を適用する
            ItemSelectionManager *manager = controllerAdapter->getItemSelectionManager();
            manager->moveItems(deltaClocks, deltaNoteNumbers);
            updateWidget();
        } else if (mouseStatus.mode == MouseStatus::LEFTBUTTON_ADD_ITEM) {
            QPoint currentMousePos = mapToScene(event->pos());
            VSQ_NS::tick_t endClock = controllerAdapter->getTickFromX(currentMousePos.x());
            VSQ_NS::tick_t length = 0;
            if (mouseStatus.addingNoteItem.clock < endClock) {
                length = endClock - mouseStatus.addingNoteItem.clock;
                length = quantize(length);
            }
            mouseStatus.addingNoteItem.setLength(length);
            updateWidget();
        }
        mouseStatus.isMouseMoved = true;
    }
 void PianorollTrackView::handleMouseLeftButtonPressByEraser(QMouseEvent *event) {
     const VSQ_NS::Event *noteEventOnMouse = findNoteEventAt(event->pos());
     controllerAdapter->removeEvent(trackIndex, noteEventOnMouse);
     if (!noteEventOnMouse) {
         initMouseStatus(MouseStatus::LEFTBUTTON_SELECT_ITEM, event, noteEventOnMouse);
     }
     updateWidget();
 }
Esempio n. 10
0
void LoginWidget::slotChangePWView(){
  if(pwVisible){
    pwVisible = FALSE;
  }else{
    pwVisible = TRUE;
  }
  updateWidget();
}
Esempio n. 11
0
void LoginWidget::slotUserUnselected(){
  userSelected = FALSE;
  pwVisible = FALSE;
  linePassword->clear(); //make sure the password is cleared if the user is changed
  updateWidget();
  listUserBig->setFocus();
  emit UserSelected("");
}
Esempio n. 12
0
void LoginWidget::slotChangePWView(){
  if(pwVisible){
    pwVisible = false;
  }else{
    pwVisible = true;
  }
  updateWidget();
}
Esempio n. 13
0
/// Ensure all pending events have been processed and update screen
/// for the given widget.
/// \widget The widget needs to update.
/// \w The waveform used to update screen.
/// \whole Update whole screen or not.
/// \wait The synchronous way between ScreenProxy and server.
void ScreenProxy::flush(const QWidget *widget,
                        Waveform w,
                        bool whole,
                        ScreenCommand::WaitMode wait)
{
    flush();
    updateWidget(widget, w, whole, wait);
}
Esempio n. 14
0
QMenu *QMenuFilesRecentlyOpened::createWidget(QWidget *parent, const std::string &name)
{
    menuRecentlyOpenedFiles = new QMenu(QString(name.c_str()), parent);
    menuRecentlyOpenedFiles->setTearOffEnabled(true);

    updateWidget();
    return menuRecentlyOpenedFiles;
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
QWidget* QSRPropGuiBindingBool::createWidget()
{
    CVF_ASSERT(m_widget == NULL);
    m_widget = new QCheckBox;
    updateWidget(CONFIG_AND_VALUE);
    connect(m_widget, SIGNAL(stateChanged(int)), SLOT(slotStateChanged()));

    return m_widget;
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
QWidget* QSRPropGuiBindingEnum::createWidget()
{
    CVF_ASSERT(m_widget == NULL);
    m_widget = new QComboBox;
    updateWidget(CONFIG_AND_VALUE);
    connect(m_widget, SIGNAL(currentIndexChanged(int)), SLOT(slotCurrentIndexChanged()));

    return m_widget;
}
Esempio n. 17
0
/*!
  \brief Update the entries for an item

  \param itemInfo Info for an item
  \param data List of legend entry attributes for the item
 */
void QwtLegend::updateLegend( const QVariant &itemInfo, 
    const QList<QwtLegendData> &data )
{
    QList<QWidget *> widgetList = legendWidgets( itemInfo );

    if ( widgetList.size() != data.size() )
    {
        QLayout *contentsLayout = d_data->view->contentsWidget->layout();

        while ( widgetList.size() > data.size() )
        {
            QWidget *w = widgetList.takeLast();

            contentsLayout->removeWidget( w );

            // updates might be triggered by signals from the legend widget
            // itself. So we better don't delete it here.

            w->hide();
            w->deleteLater();
        }

        for ( int i = widgetList.size(); i < data.size(); i++ )
        {
            QWidget *widget = createWidget( data[i] );

            if ( contentsLayout )
                contentsLayout->addWidget( widget );

            if ( isVisible() )
            {
                // QLayout does a delayed show, with the effect, that
                // the size hint will be wrong, when applications
                // call replot() right after changing the list
                // of plot items. So we better do the show now.

                widget->setVisible( true );
            }

            widgetList += widget;
        }

        if ( widgetList.isEmpty() )
        {
            d_data->itemMap.remove( itemInfo );
        }
        else
        {
            d_data->itemMap.insert( itemInfo, widgetList );
        }

        updateTabOrder();
    }
    
    for ( int i = 0; i < data.size(); i++ )
        updateWidget( widgetList[i], data[i] );
}
Esempio n. 18
0
void LoginWidget::setCurrentDE(QString de){
  for(int i=0; i<listDE->count(); i++){
    if( listDE->itemText(i) == de ){
      listDE->setCurrentIndex(i);
      break;
    }
  }
  updateWidget();
}
Esempio n. 19
0
FlyEmDataQueryDialog::FlyEmDataQueryDialog(QWidget *parent) :
  QDialog(parent),
  ui(new Ui::FlyEmDataQueryDialog)
{
  ui->setupUi(this);
  connect(ui->sourceComboBox, SIGNAL(currentIndexChanged(const QString&)),
          this, SLOT(updateWidget(const QString&)));
  updateWidget(ui->sourceComboBox->currentText());
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
QWidget* QSRPropGuiBindingInt::createWidget()
{
    CVF_ASSERT(m_widget == NULL);
    m_widget = new QSpinBox;
    m_widget->setKeyboardTracking(false);
    updateWidget(CONFIG_AND_VALUE);
    connect(m_widget, SIGNAL(valueChanged(int)), SLOT(slotValueChanged()));

    return m_widget;
}
Esempio n. 21
0
void FilesystemWidget::pathChanged() {
    // Enable/disable go up button
    if (dir.absolutePath() == QDir::rootPath()) {
        goUpAction->setDisabled(true);
        // If we are on a Mac, we should allow hidden files - GH-40
        // fsWidgetModel->setFilter(QDir::AllDirs|QDir::Files|QDir::NoDotAndDotDot|QDir::Hidden);
    }
    else { goUpAction->setEnabled(true); }
    updateWidget();
}
void ArchiveAccountOptionsWidget::apply()
{
	if (FSaveRequests.isEmpty())
	{
		IArchiveStreamPrefs prefs = FArchiver->archivePrefs(FStreamJid);
		prefs.methodLocal = ui.cmbMethodLocal->itemData(ui.cmbMethodLocal->currentIndex()).toString();
		prefs.methodAuto = ui.cmbMethodAuto->itemData(ui.cmbMethodAuto->currentIndex()).toString();
		prefs.methodManual = ui.cmbMethodManual->itemData(ui.cmbMethodManual->currentIndex()).toString();
		prefs.defaultPrefs.otr = ui.cmbModeOTR->itemData(ui.cmbModeOTR->currentIndex()).toString();
		prefs.defaultPrefs.save = ui.cmbModeSave->itemData(ui.cmbModeSave->currentIndex()).toString();
		prefs.defaultPrefs.expire = ui.cmbExpireTime->itemData(ui.cmbExpireTime->currentIndex()).toInt();

		foreach(const Jid &itemJid, FTableItems.keys())
		{
			QTableWidgetItem *jidItem = FTableItems.value(itemJid);
			prefs.itemPrefs[itemJid].save = ui.tbwItemPrefs->item(jidItem->row(),COL_SAVE)->data(Qt::UserRole).toString();
			prefs.itemPrefs[itemJid].otr = ui.tbwItemPrefs->item(jidItem->row(),COL_OTR)->data(Qt::UserRole).toString();
			prefs.itemPrefs[itemJid].expire = ui.tbwItemPrefs->item(jidItem->row(),COL_EXPIRE)->data(Qt::UserRole).toInt();
			prefs.itemPrefs[itemJid].exactmatch = ui.tbwItemPrefs->item(jidItem->row(),COL_EXACT)->data(Qt::UserRole).toBool();
		}

		foreach(const Jid &itemJid, prefs.itemPrefs.keys())
		{
			if (!FTableItems.contains(itemJid))
			{
				if (FArchiver->isSupported(FStreamJid,NS_ARCHIVE_PREF))
				{
					QString requestId = FArchiver->removeArchiveItemPrefs(FStreamJid,itemJid);
					if (!requestId.isEmpty())
						FSaveRequests.append(requestId);
					prefs.itemPrefs.remove(itemJid);
				}
				else
				{
					prefs.itemPrefs[itemJid].otr = QString::null;
					prefs.itemPrefs[itemJid].save = QString::null;
				}
			}
		}

		QString requestId = FArchiver->setArchivePrefs(FStreamJid,prefs);
		if (!requestId.isEmpty())
			FSaveRequests.append(requestId);

		if (prefs.autoSave != ui.chbAutoSave->isChecked())
		{
			requestId = FArchiver->setArchiveAutoSave(FStreamJid,ui.chbAutoSave->isChecked());
			if (!requestId.isEmpty())
				FSaveRequests.append(requestId);
		}

		FLastError = XmppError::null;
		updateWidget();
	}
void HTMLPlugInImageElement::updateWidgetIfNecessary()
{
    document()->updateStyleIfNeeded();

    if (!needsWidgetUpdate() || useFallbackContent() || isImageType())
        return;

    if (!renderEmbeddedObject() || renderEmbeddedObject()->pluginCrashedOrWasMissing())
        return;

    updateWidget(CreateOnlyNonNetscapePlugins);
}
Esempio n. 24
0
void HTMLPlugInImageElement::updateWidgetIfNecessary()
{
    document()->updateStyleIfNeeded();

    if (!needsWidgetUpdate() || useFallbackContent() || isImageType())
        return;

    if (!renderEmbeddedObject() || renderEmbeddedObject()->showsUnavailablePluginIndicator())
        return;

    updateWidget(CreateOnlyNonNetscapePlugins);
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void QSRPropGuiBindingDouble::slotValueChanged()
{
    CVF_ASSERT(m_widget);
    if (m_property->setValue(m_widget->value()))
    {
        emit signalPropertyValueChangedInGui(m_property.p());
    }
    else
    {
        updateWidget(VALUE_ONLY);
    }
}
Esempio n. 26
0
void FileDialog::setFilter(const QString& filter) {
	StringList strs = StringUtil::tokenize(q2u(filter).c_str(), L'|');

	m_filters.clear();
	for (StringList::iterator it=strs.begin(); it!=strs.end(); ++it) {
		m_filters.push_back(u2q(*it));
	}
	if (!m_filters.contains("*.*")) {
		m_filters.push_back("*.*");
	}

	updateWidget();
}
Esempio n. 27
0
void LoginWidget::setCurrentUser(QString id){
  if(idL.isEmpty()){ return; }
  
  int index = idL.indexOf(id);
  if(index == -1){
    qDebug() << "LoginWidget: Item does not exist -" << id;
  }else{
    listUsers->setCurrentIndex(index);
    listUserBig->setCurrentRow(index);
    updateWidget();
    emit UserChanged(id);
  }
}
Esempio n. 28
0
void LoginWidget::slotUserSelected(){
  if(userSelected){ //make sure the big user widget is updated as well
    listUserBig->setCurrentRow( listUsers->currentIndex() );
  }else{ //make sure the small user widget is updated as well
    listUsers->setCurrentIndex( listUserBig->currentRow() );
  }
  userSelected = TRUE;
  pwVisible = FALSE;
  linePassword->clear(); //make sure the password is cleared if the user is changed
  updateWidget();
  linePassword->setFocus();
  emit UserSelected(listUsers->currentText());
}
Esempio n. 29
0
void DataMediaWidget::onUrlLoaded(const QUrl &AUrl, const QByteArray &AData)
{
    if (FUriIndex<FMedia.uris.count() && FMedia.uris.at(FUriIndex).url == AUrl)
    {
        const IDataMediaURI &uri = FMedia.uris.at(FUriIndex);
        if (!updateWidget(uri, AData))
        {
            FUriIndex++;
            FLastError = XmppError(IERR_DATAFORMS_MEDIA_INVALID_FORMAT);
            loadUri();
        }
    }
}
Esempio n. 30
0
/*! \brief Constructor
 *
 * set up the widget, start timer.
 */
CallWidget::CallWidget(UserInfo *ui, const QString &channelme,
                       const QString &status, uint ts,
                       const QString &channelpeer, const QString & callerid,
                       const QString &calleridname, QWidget *parent,
                       const PhoneInfo *_pi)
    : QWidget(parent), m_square(16,16), m_parkedCall(false)
{
    // qDebug() << Q_FUNC_INFO << channelme;
    m_ui = ui;
    pi = _pi;
    QGridLayout * gridlayout = new QGridLayout(this);

    m_channelme = channelme;
    m_channelpeer = channelpeer;

    gridlayout->setColumnStretch(3, 1);
    m_lbl_status = new QLabel(this);
    gridlayout->addWidget(m_lbl_status, 0, 0);

    m_lbl_time = new QLabel(this);
    m_lbl_time->setFont(QFont("", 8, QFont::Bold));
    m_startTime = QDateTime::fromTime_t(ts);
    startTimer(1000);
    gridlayout->addWidget(m_lbl_time, 1, 0, 1, 3);

    m_lbl_direction = new QLabel(this);
    gridlayout->addWidget(m_lbl_direction, 0, 1);

    m_lbl_exten = new QLabel(this);
    m_lbl_exten->setFont(QFont("courier", 10, QFont::Light));
    gridlayout->addWidget(m_lbl_exten, 0, 2);

    //updateWidget(status, ts, "cpeer", callerid, calleridname);
    updateWidget(status, ts, channelpeer, callerid, calleridname, pi);

    m_hangUpAction = new QAction(tr("&Hangup"), this);
    m_hangUpAction->setStatusTip(tr("Hang up/Close the channel"));
    connect(m_hangUpAction, SIGNAL(triggered()),
             this, SLOT(hangUp()));

    m_transferToNumberAction = new QAction(tr("&Transfer to number"), this);
    m_transferToNumberAction->setStatusTip(tr("Transfer the channel to the dialed number") );
    connect(m_transferToNumberAction, SIGNAL(triggered()),
             this, SLOT(transferToNumber()));

    m_parkCall = new QAction(tr("&Park the call"), this);
    m_parkCall->setStatusTip(tr("Park this call") );
    connect(m_parkCall, SIGNAL(triggered()),
             this, SLOT(parkCall()));
}