Ejemplo n.º 1
0
 MyInputPanel::MyInputPanel()
     : QWidget(0, Qt::Tool | Qt::WindowStaysOnTopHint)
 {
     bUpper = false;
     form.setupUi(this);

     signalMapper.setMapping(form.key_0, form.key_0);
     signalMapper.setMapping(form.key_1, form.key_1);
     signalMapper.setMapping(form.key_2, form.key_2);
     signalMapper.setMapping(form.key_3, form.key_3);
     signalMapper.setMapping(form.key_4, form.key_4);
     signalMapper.setMapping(form.key_5, form.key_5);
     signalMapper.setMapping(form.key_6, form.key_6);
     signalMapper.setMapping(form.key_7, form.key_7);
     signalMapper.setMapping(form.key_8, form.key_8);
     signalMapper.setMapping(form.key_9, form.key_9);
     signalMapper.setMapping(form.key_Q, form.key_Q);
     signalMapper.setMapping(form.key_W, form.key_W);
     signalMapper.setMapping(form.key_E, form.key_E);
     signalMapper.setMapping(form.key_R, form.key_R);
     signalMapper.setMapping(form.key_T, form.key_T);
     signalMapper.setMapping(form.key_Y, form.key_Y);
     signalMapper.setMapping(form.key_U, form.key_U);
     signalMapper.setMapping(form.key_I, form.key_I);
     signalMapper.setMapping(form.key_O, form.key_O);
     signalMapper.setMapping(form.key_P, form.key_P);
     signalMapper.setMapping(form.key_A, form.key_A);
     signalMapper.setMapping(form.key_S, form.key_S);
     signalMapper.setMapping(form.key_D, form.key_D);
     signalMapper.setMapping(form.key_F, form.key_F);
     signalMapper.setMapping(form.key_G, form.key_G);
     signalMapper.setMapping(form.key_H, form.key_H);
     signalMapper.setMapping(form.key_J, form.key_J);
     signalMapper.setMapping(form.key_K, form.key_K);
     signalMapper.setMapping(form.key_L, form.key_L);
     signalMapper.setMapping(form.key_Z, form.key_Z);
     signalMapper.setMapping(form.key_X, form.key_X);
     signalMapper.setMapping(form.key_C, form.key_C);
     signalMapper.setMapping(form.key_V, form.key_V);
     signalMapper.setMapping(form.key_B, form.key_B);
     signalMapper.setMapping(form.key_N, form.key_N);
     signalMapper.setMapping(form.key_M, form.key_M);
//     signalMapper.setMapping(form.key_star, form.key_star);
//     signalMapper.setMapping(form.key_hash, form.key_hash);
     signalMapper.setMapping(form.key_dot, form.key_dot);
     signalMapper.setMapping(form.key_sub, form.key_sub);
     signalMapper.setMapping(form.key_clear, form.key_clear);
     signalMapper.setMapping(form.key_blank, form.key_blank);
     signalMapper.setMapping(form.key_Escape, form.key_Escape);
     signalMapper.setMapping(form.key_backspace, form.key_backspace);

     signalMapper.setMapping(form.key_Enter, form.key_Enter);
     signalMapper.setMapping(form.key_Enter_2, form.key_Enter_2);
     signalMapper.setMapping(form.key_clear_2, form.key_clear_2);


     connect(form.key_0, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_1, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_2, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_3, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_4, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_5, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_6, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_7, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_8, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_9, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_Q, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_W, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_E, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_R, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_T, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_Y, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_U, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_I, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_O, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_P, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_A, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_S, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_D, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_F, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_G, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_H, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_J, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_K, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_L, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_Z, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_X, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_C, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_V, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_B, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_N, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_M, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
//     connect(form.key_star, SIGNAL(clicked()),
//             &signalMapper, SLOT(map()));
//     connect(form.key_hash, SIGNAL(clicked()),
//             &signalMapper, SLOT(map()));
     connect(form.key_clear, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_blank, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_sub, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_dot, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_Escape, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_backspace, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));

     connect(form.key_Enter, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_Enter_2, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));
     connect(form.key_clear_2, SIGNAL(clicked()),
             &signalMapper, SLOT(map()));

     connect(&signalMapper, SIGNAL(mapped(QWidget*)),
             this, SLOT(buttonClicked(QWidget*)));
     SwithToNum();
     this->setWindowModality(Qt::ApplicationModal);
 }
Ejemplo n.º 2
0
QgsComposerItemWidget::QgsComposerItemWidget( QWidget* parent, QgsComposerItem* item ): QgsComposerItemBaseWidget( parent, item ), mItem( item )
{

  setupUi( this );

  //make button exclusive
  QButtonGroup* buttonGroup = new QButtonGroup( this );
  buttonGroup->addButton( mUpperLeftCheckBox );
  buttonGroup->addButton( mUpperMiddleCheckBox );
  buttonGroup->addButton( mUpperRightCheckBox );
  buttonGroup->addButton( mMiddleLeftCheckBox );
  buttonGroup->addButton( mMiddleCheckBox );
  buttonGroup->addButton( mMiddleRightCheckBox );
  buttonGroup->addButton( mLowerLeftCheckBox );
  buttonGroup->addButton( mLowerMiddleCheckBox );
  buttonGroup->addButton( mLowerRightCheckBox );
  buttonGroup->setExclusive( true );

  setValuesForGuiElements();
  connect( mItem->composition(), SIGNAL( paperSizeChanged() ), this, SLOT( setValuesForGuiPositionElements() ) );
  connect( mItem, SIGNAL( sizeChanged() ), this, SLOT( setValuesForGuiPositionElements() ) );
  connect( mItem, SIGNAL( itemChanged() ), this, SLOT( setValuesForGuiNonPositionElements() ) );

  connect( mTransparencySlider, SIGNAL( valueChanged( int ) ), mTransparencySpnBx, SLOT( setValue( int ) ) );
  connect( mTransparencySpnBx, SIGNAL( valueChanged( int ) ), mTransparencySlider, SLOT( setValue( int ) ) );

  //connect atlas signals to data defined buttons
  QgsAtlasComposition* atlas = atlasComposition();
  if ( atlas )
  {
    //repopulate data defined buttons if atlas layer changes
    connect( atlas, SIGNAL( coverageLayerChanged( QgsVectorLayer* ) ),
             this, SLOT( populateDataDefinedButtons() ) );
    connect( atlas, SIGNAL( toggled( bool ) ), this, SLOT( populateDataDefinedButtons() ) );
  }

  //connect data defined buttons
  connect( mXPositionDDBtn, SIGNAL( dataDefinedChanged( const QString& ) ), this, SLOT( updateDataDefinedProperty( ) ) );
  connect( mXPositionDDBtn, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( updateDataDefinedProperty( ) ) );

  connect( mYPositionDDBtn, SIGNAL( dataDefinedChanged( const QString& ) ), this, SLOT( updateDataDefinedProperty( ) ) );
  connect( mYPositionDDBtn, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( updateDataDefinedProperty( ) ) );

  connect( mWidthDDBtn, SIGNAL( dataDefinedChanged( const QString& ) ), this, SLOT( updateDataDefinedProperty( ) ) );
  connect( mWidthDDBtn, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( updateDataDefinedProperty( ) ) );

  connect( mHeightDDBtn, SIGNAL( dataDefinedChanged( const QString& ) ), this, SLOT( updateDataDefinedProperty( ) ) );
  connect( mHeightDDBtn, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( updateDataDefinedProperty( ) ) );

  connect( mItemRotationDDBtn, SIGNAL( dataDefinedChanged( const QString& ) ), this, SLOT( updateDataDefinedProperty( ) ) );
  connect( mItemRotationDDBtn, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( updateDataDefinedProperty( ) ) );

  connect( mTransparencyDDBtn, SIGNAL( dataDefinedChanged( const QString& ) ), this, SLOT( updateDataDefinedProperty( ) ) );
  connect( mTransparencyDDBtn, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( updateDataDefinedProperty( ) ) );

  connect( mBlendModeDDBtn, SIGNAL( dataDefinedChanged( const QString& ) ), this, SLOT( updateDataDefinedProperty( ) ) );
  connect( mBlendModeDDBtn, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( updateDataDefinedProperty( ) ) );

  connect( mExcludePrintsDDBtn, SIGNAL( dataDefinedChanged( const QString& ) ), this, SLOT( updateDataDefinedProperty( ) ) );
  connect( mExcludePrintsDDBtn, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( updateDataDefinedProperty( ) ) );
}
Ejemplo n.º 3
0
#ifdef Q_OS_MAC
    setWindowFlags((windowFlags() & ~Qt::WindowType_Mask) | Qt::Sheet);
    setStyleSheet(styleSheet() + " #MovieSearch { border: 1px solid rgba(0, 0, 0, 100); border-top: none; }");
#else
    setWindowFlags((windowFlags() & ~Qt::WindowType_Mask) | Qt::Dialog);
#endif

    foreach (ScraperInterface *scraper, Manager::instance()->scrapers()) {
        ui->comboScraper->addItem(scraper->name(), scraper->identifier());
        connect(scraper, SIGNAL(searchDone(QList<ScraperSearchResult>)), this, SLOT(showResults(QList<ScraperSearchResult>)));
    }
    ui->comboScraper->setCurrentIndex(Settings::instance()->currentMovieScraper());

    connect(ui->comboScraper, SIGNAL(currentIndexChanged(int)), this, SLOT(search()));
    connect(ui->searchString, SIGNAL(returnPressed()), this, SLOT(search()));
    connect(ui->results, SIGNAL(itemClicked(QTableWidgetItem*)), this, SLOT(resultClicked(QTableWidgetItem*)));
    connect(ui->buttonClose, SIGNAL(clicked()), this, SLOT(reject()));

    ui->chkActors->setMyData(MovieScraperInfos::Actors);
    ui->chkBackdrop->setMyData(MovieScraperInfos::Backdrop);
    ui->chkCertification->setMyData(MovieScraperInfos::Certification);
    ui->chkCountries->setMyData(MovieScraperInfos::Countries);
    ui->chkDirector->setMyData(MovieScraperInfos::Director);
    ui->chkGenres->setMyData(MovieScraperInfos::Genres);
    ui->chkOverview->setMyData(MovieScraperInfos::Overview);
    ui->chkPoster->setMyData(MovieScraperInfos::Poster);
    ui->chkRating->setMyData(MovieScraperInfos::Rating);
    ui->chkReleased->setMyData(MovieScraperInfos::Released);
    ui->chkRuntime->setMyData(MovieScraperInfos::Runtime);
    ui->chkSet->setMyData(MovieScraperInfos::Set);
Ejemplo n.º 4
0
optionsDialog::optionsDialog(QWidget *parent, std::string name)
    : QDialog(parent)
{
    zoomLabel = new QLabel(tr("Zoom factor"));
    delayLabel = new QLabel(tr("Delay factor"));
    generationLabel = new QLabel(tr("Generation:"));
    numberLabel = new QLabel(tr("0"));

    zoomSB = new QSpinBox;
    zoomSB->setRange(1,30);
    delaySB = new QSpinBox;
    delaySB->setRange(1,10000);

    zoomSlid = new QSlider(Qt::Horizontal);
    zoomSlid->setRange(1,30);
    QObject::connect(zoomSB, SIGNAL(valueChanged(int)),
                     zoomSlid, SLOT(setValue(int)));
    QObject::connect(zoomSlid, SIGNAL(valueChanged(int)),
                     zoomSB, SLOT(setValue(int)));
    QObject::connect(zoomSB, SIGNAL(valueChanged(int)),
                     parent, SLOT(zoomChanged(int)));
    zoomSB->setValue(10);
    

    delaySlid = new QSlider(Qt::Horizontal);
    delaySlid->setRange(1,10000);
    QObject::connect(delaySB, SIGNAL(valueChanged(int)),
                     delaySlid, SLOT(setValue(int)));
    QObject::connect(delaySlid, SIGNAL(valueChanged(int)),
                     delaySB, SLOT(setValue(int)));
    QObject::connect(delaySB, SIGNAL(valueChanged(int)),
                     parent, SLOT(delayChanged(int)));
    delaySB->setValue(100);

    quitButton = new QPushButton(tr("&Quit"));
    playButton = new QPushButton(tr("&Play"));
    stepButton = new QPushButton(tr("&Step"));
    QObject::connect(quitButton, SIGNAL(clicked()),
            parent, SLOT(quitClicked()));
    QObject::connect(stepButton, SIGNAL(clicked()),
            parent, SLOT(stepClicked()));
    QObject::connect(playButton, SIGNAL(clicked()),
            parent, SLOT(playClicked()));


    QHBoxLayout *zoomLayout = new QHBoxLayout;
    zoomLayout->addWidget(zoomLabel);
    zoomLayout->addWidget(zoomSB);
    zoomLayout->addWidget(zoomSlid);

    QHBoxLayout *delayLayout = new QHBoxLayout;
    delayLayout->addWidget(delayLabel);
    delayLayout->addWidget(delaySB);
    delayLayout->addWidget(delaySlid);

    QHBoxLayout *generationLayout = new QHBoxLayout;
    generationLayout->addWidget(generationLabel);
    generationLayout->addStretch();
    generationLayout->addWidget(numberLabel);
    QHBoxLayout *buttonLayout = new QHBoxLayout;
    buttonLayout->addWidget(quitButton);
    buttonLayout->addWidget(playButton);
    buttonLayout->addWidget(stepButton);
    
    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addLayout(zoomLayout);
    mainLayout->addLayout(delayLayout);
    mainLayout->addLayout(generationLayout);
    mainLayout->addLayout(buttonLayout);
    setLayout(mainLayout);

    QString *title = new QString((name + " Controls").c_str());
    setWindowTitle(*title);
    setFixedHeight(sizeHint().height());
}
Ejemplo n.º 5
0
TransactionView::TransactionView(QWidget *parent) :
    QWidget(parent), model(0), transactionProxyModel(0),
    transactionView(0)
{
    // Build filter row
    setContentsMargins(0,0,0,0);

    QHBoxLayout *hlayout = new QHBoxLayout();
    hlayout->setContentsMargins(0,0,0,0);
#ifdef Q_OS_MAC
    hlayout->setSpacing(5);
    hlayout->addSpacing(26);
#else
    hlayout->setSpacing(0);
    hlayout->addSpacing(23);
#endif

    dateWidget = new QComboBox(this);
#ifdef Q_OS_MAC
    dateWidget->setFixedWidth(121);
#else
    dateWidget->setFixedWidth(120);
#endif
    dateWidget->addItem(tr("All"), All);
    dateWidget->addItem(tr("Today"), Today);
    dateWidget->addItem(tr("This week"), ThisWeek);
    dateWidget->addItem(tr("This month"), ThisMonth);
    dateWidget->addItem(tr("Last month"), LastMonth);
    dateWidget->addItem(tr("This year"), ThisYear);
    dateWidget->addItem(tr("Range..."), Range);
    hlayout->addWidget(dateWidget);

    typeWidget = new QComboBox(this);
#ifdef Q_OS_MAC
    typeWidget->setFixedWidth(121);
#else
    typeWidget->setFixedWidth(120);
#endif

    typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES);
    typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) |
                                        TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther));
    typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) |
                                  TransactionFilterProxy::TYPE(TransactionRecord::SendToOther));
    typeWidget->addItem(tr("To yourself"), TransactionFilterProxy::TYPE(TransactionRecord::SendToSelf));
    typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated));
    typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other));

    hlayout->addWidget(typeWidget);

    addressWidget = new QLineEdit(this);
#if QT_VERSION >= 0x040700
    /* Do not move this to the XML file, Qt before 4.7 will choke on it */
    addressWidget->setPlaceholderText(tr("Enter address or label to search"));
#endif
    hlayout->addWidget(addressWidget);

    amountWidget = new QLineEdit(this);
#if QT_VERSION >= 0x040700
    /* Do not move this to the XML file, Qt before 4.7 will choke on it */
    amountWidget->setPlaceholderText(tr("Min amount"));
#endif
#ifdef Q_OS_MAC
    amountWidget->setFixedWidth(97);
#else
    amountWidget->setFixedWidth(100);
#endif
    amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this));
    hlayout->addWidget(amountWidget);

    QVBoxLayout *vlayout = new QVBoxLayout(this);
    vlayout->setContentsMargins(0,0,0,0);
    vlayout->setSpacing(0);

    QTableView *view = new QTableView(this);
    vlayout->addLayout(hlayout);
    vlayout->addWidget(createDateRangeWidget());
    vlayout->addWidget(view);
    vlayout->setSpacing(0);
    int width = view->verticalScrollBar()->sizeHint().width();
    // Cover scroll bar width with spacing
#ifdef Q_OS_MAC
    hlayout->addSpacing(width+2);
#else
    hlayout->addSpacing(width);
#endif
    // Always show scroll bar
    view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    view->setTabKeyNavigation(false);
    view->setContextMenuPolicy(Qt::CustomContextMenu);

    transactionView = view;

    // Actions
    QAction *copyAddressAction = new QAction(tr("Copy address"), this);
    QAction *copyLabelAction = new QAction(tr("Copy label"), this);
    QAction *copyAmountAction = new QAction(tr("Copy amount"), this);
    QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this);
    QAction *editLabelAction = new QAction(tr("Edit label"), this);
    QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);

    contextMenu = new QMenu();
    contextMenu->addAction(copyAddressAction);
    contextMenu->addAction(copyLabelAction);
    contextMenu->addAction(copyAmountAction);
    contextMenu->addAction(copyTxIDAction);
    contextMenu->addAction(editLabelAction);
    contextMenu->addAction(showDetailsAction);

    // Connect actions
    connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int)));
    connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int)));
    connect(addressWidget, SIGNAL(textChanged(QString)), this, SLOT(changedPrefix(QString)));
    connect(amountWidget, SIGNAL(textChanged(QString)), this, SLOT(changedAmount(QString)));

    connect(view, SIGNAL(doubleClicked(QModelIndex)), this, SIGNAL(doubleClicked(QModelIndex)));
    connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));

    connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress()));
    connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel()));
    connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount()));
    connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID()));
    connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel()));
    connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails()));
}
Ejemplo n.º 6
0
#endif
  }else{
    available = true;
  }
  QObject::connect(&wine, SIGNAL(finished(int, QProcess::ExitStatus)),
    this, SLOT(finished(int, QProcess::ExitStatus)));
  QObject::connect(&wine, SIGNAL(error(QProcess::ProcessError)),
    this, SLOT(error(QProcess::ProcessError)));
}

WineLauncher::~WineLauncher()
{
  QObject::disconnect(&wine, SIGNAL(finished(int, QProcess::ExitStatus)),
    this, SLOT(finished(int, QProcess::ExitStatus)));
  QObject::disconnect(&wine, SIGNAL(error(QProcess::ProcessError)),
    this, SLOT(error(QProcess::ProcessError)));
  if(wine.state() != QProcess::NotRunning){
    wine.waitForFinished(10000);
  }
  if(wine.state() != QProcess::NotRunning){
    wine.kill();
  }
}

void WineLauncher::setEnv(const QString &var, const QString &val)
{
  env.insert(var, val);
}

void WineLauncher::run(const QString &tgt)
{
Ejemplo n.º 7
0
//----------------------------------------------------------------------
// MapIcons
MapIcons::MapIcons(Player* player, const QString& preferenceName,
		   QObject* parent, const char* name)
  : QObject(parent, name),
    m_player(player),
    m_preferenceName(preferenceName),
    m_flash(false)
{
  // Setup the map icons with default icon type characteristics
  Qt::PenCapStyle cap = Qt::SquareCap;
  Qt::PenJoinStyle join = Qt::BevelJoin;

  m_mapIcons[tIconTypeUnknown]
    .setImage(QBrush(), QPen(Qt::gray, 1, Qt::SolidLine, cap, join),
	      tIconStyleCircle, tIconSizeSmall,
	      true, false, true, false);
  m_mapIcons[tIconTypeDrop]
    .setImage(QBrush(), QPen(Qt::yellow, 1, Qt::SolidLine, cap, join),
	      tIconStyleX, tIconSizeRegular,
	      true, false, false, false);
  m_mapIcons[tIconTypeDoor]
    .setImage(QBrush(Qt::NoBrush), QPen(QColor(110, 60, 0)),
	      tIconStyleSquare, tIconSizeTiny,
	      true, false, false, false);
  m_mapIcons[tIconTypeZoneDoor]
    .setImage(QBrush(QColor(110,26,104)), QPen(QColor(110, 26, 104)),
	      tIconStyleDiamond, tIconSizeSmall,
	      true, false, false, false);
  m_mapIcons[tIconTypeSpawnNPC]
    .setImage(QBrush(SolidPattern), QPen(Qt::black, 0, Qt::SolidLine, cap, join), 
	      tIconStyleCircle, tIconSizeRegular,
	      true, false, true, false);
  m_mapIcons[tIconTypeSpawnNPCCorpse]
    .setImage(QBrush(SolidPattern), QPen(Qt::cyan, 1, Qt::SolidLine, cap, join),
	      tIconStylePlus, tIconSizeRegular,
	      true, false, false, false);
  m_mapIcons[tIconTypeSpawnPlayer]
    .setImage(QBrush(SolidPattern), QPen(Qt::magenta, 1, Qt::SolidLine, cap, join),
	      tIconStyleSquare, tIconSizeRegular,
	      true, false, true, false);
  m_mapIcons[tIconTypeSpawnPlayerCorpse]
    .setImage(QBrush(), QPen(Qt::yellow, 2, Qt::SolidLine, cap, join), 
	      tIconStyleSquare, tIconSizeRegular,
	      true, false, false, false);
  m_mapIcons[tIconTypeSpawnUnknown]
    .setImage(QBrush(Qt::gray), QPen(Qt::NoBrush, 1, Qt::SolidLine, cap, join), 
	      tIconStyleCircle, tIconSizeRegular,
	      true, false, false, false);
  m_mapIcons[tIconTypeSpawnConsidered]
    .setHighlight(QBrush(Qt::NoBrush), QPen(Qt::red, 1, Qt::SolidLine, cap, join),
		  tIconStyleSquare, tIconSizeLarge,
		  true, false, false, false);
  m_mapIcons[tIconTypeSpawnPlayerPvPEnabled]
    .setHighlight(QBrush(Qt::NoBrush), QPen(Qt::red, 1, Qt::SolidLine, cap, join),
		  tIconStyleCircle, tIconSizeXLarge,
		  true, false, false, true);
  m_mapIcons[tIconTypeSpawnPlayerPvPEnabled]
    .setImage(QBrush(SolidPattern), QPen(Qt::magenta, 1, Qt::SolidLine, cap, join), 
	      tIconStyleUpTriangle, tIconSizeRegular,
	      true, false, true, false);
  m_mapIcons[tIconTypeSpawnPetPvPEnabled]
    .setHighlight(QBrush(Qt::NoBrush), QPen(Qt::red, 1, Qt::SolidLine, cap, join),
		  tIconStyleCircle, tIconSizeXLarge,
		  true, false, false, true);
  m_mapIcons[tIconTypeSpawnPlayerTeam1]
    .setImage(QBrush(SolidPattern), QPen(Qt::magenta, 1, Qt::SolidLine, cap, join), 
	      tIconStyleUpTriangle, tIconSizeRegular,
	      true, false, true, false);
  m_mapIcons[tIconTypeSpawnPlayerTeam2]
    .setImage(QBrush(SolidPattern), QPen(Qt::magenta, 1, Qt::SolidLine, cap, join), 
	      tIconStyleRightTriangle, tIconSizeRegular,
	      true, false, true, false);
  m_mapIcons[tIconTypeSpawnPlayerTeam3]
    .setImage(QBrush(SolidPattern), QPen(Qt::magenta, 1, Qt::SolidLine, cap, join), 
	      tIconStyleDownTriangle, tIconSizeRegular,
	      true, false, true, false);
  m_mapIcons[tIconTypeSpawnPlayerTeam4]
    .setImage(QBrush(SolidPattern), QPen(Qt::magenta, 1, Qt::SolidLine, cap, join), 
	      tIconStyleLeftTriangle, tIconSizeRegular,
	      true, false, true, false);
  m_mapIcons[tIconTypeSpawnPlayerTeam5]
    .setImage(QBrush(SolidPattern), QPen(Qt::magenta, 1, Qt::SolidLine, cap, join), 
	      tIconStyleSquare, tIconSizeRegular,
	      true, false, true, false);
  m_mapIcons[tIconTypeSpawnPlayerTeamOtherRace]
    .setHighlight(QBrush(Qt::NoBrush), QPen(Qt::gray, 1, Qt::SolidLine, cap, join),
		  tIconStyleSquare, tIconSizeXLarge,
		  true, false, false, true);
  m_mapIcons[tIconTypeSpawnPlayerTeamOtherDeity]
    .setHighlight(QBrush(Qt::NoBrush), QPen(Qt::SolidPattern, 1, Qt::SolidLine, cap, join),
		  tIconStyleCircle, tIconSizeXLarge,
		  true, false, false, true);
  m_mapIcons[tIconTypeSpawnPlayerTeamOtherRacePet]
    .setHighlight(QBrush(Qt::NoBrush), QPen(Qt::SolidLine, 1, Qt::SolidLine, cap, join),
		  tIconStyleCircle, tIconSizeXLarge,
		  true, true, false, true);
  m_mapIcons[tIconTypeSpawnPlayerTeamOtherDeityPet]
    .setImage(QBrush(Qt::NoBrush), QPen(Qt::SolidLine, 1, Qt::SolidLine, cap, join),
	      tIconStyleCircle, tIconSizeXLarge,
	      true, true, false, true);
  m_mapIcons[tIconTypeSpawnPlayerOld]
    .setImage(QBrush(), QPen(Qt::magenta, 1, Qt::SolidLine, cap, join), 
	      tIconStylePlus, tIconSizeRegular,
	      true, false, false, false);
  m_mapIcons[tIconTypeItemSelected]
    .setHighlight(QBrush(Qt::NoBrush), QPen(Qt::magenta, 1, Qt::SolidLine, cap, join),
		  tIconStyleCircle, tIconSizeXXLarge,
		  true, false, false, false);
  m_mapIcons[tIconTypeItemSelected].setLine0(true, QPen(Qt::magenta));
  m_mapIcons[tIconTypeItemSelected].setShowWalkPath(true);
  m_mapIcons[tIconTypeFilterFlagHunt]
    .setHighlight(QBrush(Qt::NoBrush), QPen(Qt::gray, 1, Qt::SolidLine, cap, join),
		  tIconStyleCircle, tIconSizeLarge,
		  true, false, false, true);
  m_mapIcons[tIconTypeFilterFlagCaution]
    .setHighlight(QBrush(Qt::NoBrush), QPen(Qt::yellow, 1, Qt::SolidLine, cap, join),
		  tIconStyleCircle, tIconSizeLarge,
		  true, false, false, true);
  m_mapIcons[tIconTypeFilterFlagCaution]
    .setLine1(500, QPen(Qt::yellow, 1, Qt::SolidLine, cap, join));
  m_mapIcons[tIconTypeFilterFlagDanger]
    .setHighlight(QBrush(Qt::NoBrush), QPen(Qt::red, 1, Qt::SolidLine, cap, join),
		  tIconStyleCircle, tIconSizeLarge,
		  true, false, false, true);
  m_mapIcons[tIconTypeFilterFlagDanger]
    .setLine1(500, QPen(Qt::red, 1, Qt::SolidLine, cap, join));
  m_mapIcons[tIconTypeFilterFlagDanger]
    .setLine2(1000, QPen(Qt::yellow, 1, Qt::SolidLine, cap, join));
  m_mapIcons[tIconTypeFilterFlagLocate]
    .setHighlight(QBrush(Qt::NoBrush), QPen(Qt::white, 1, Qt::SolidLine, cap, join),
		  tIconStyleCircle, tIconSizeLarge,
		  true, false, false, true);
  m_mapIcons[tIconTypeFilterFlagLocate]
    .setLine0(true, QPen(Qt::white, 1, Qt::SolidLine, cap, join));
  m_mapIcons[tIconTypeFilterFlagAlert]
    .setHighlight(QBrush(Qt::NoBrush), QPen(),
		  tIconStyleCircle, tIconSizeLarge,
		  true, false, false, true);
  m_mapIcons[tIconTypeFilterFlagFiltered]
    .setImage(QBrush(Qt::Dense2Pattern), QPen(Qt::gray, 0, Qt::SolidLine, cap, join), 
	      tIconStyleCircle, tIconSizeSmall,
	      true, false, true, false);
  m_mapIcons[tIconTypeFilterFlagTracer]
    .setHighlight(QBrush(Qt::NoBrush), QPen(Qt::yellow, 1, Qt::SolidLine, cap, join),
		  tIconStyleCircle, tIconSizeLarge,
		  true, false, false, false);
  m_mapIcons[tIconTypeRuntimeFiltered]
    .setHighlight(QBrush(Qt::NoBrush), QPen(Qt::white, 1, Qt::SolidLine, cap, join),
		  tIconStyleCircle, tIconSizeLarge,
		  true, false, false, true);
  m_mapIcons[tIconTypeSpawnPoint]
    .setImage(QBrush(SolidPattern), QPen(Qt::darkGray, 1, Qt::SolidLine, cap, join),
	      tIconStylePlus, tIconSizeRegular,
	      true, true, false, false);
  m_mapIcons[tIconTypeSpawnPointSelected]
    .setHighlight(QBrush(Qt::NoBrush), QPen(Qt::blue, 1, Qt::SolidLine, cap, join),
		  tIconStyleCircle, tIconSizeTiny,
		  true, false, false, false);
  m_mapIcons[tIconTypeSpawnPointSelected]
    .setLine0(true, QPen(Qt::blue));
  m_mapIcons[tIconTypeZoneSafePoint]
    .setImage(QBrush(), QPen(Qt::green, 1, Qt::SolidLine, cap, join),
	      tIconStyleX, tIconSizeSmall,
	      true, false, false, false);
  m_mapIcons[tIconTypeZoneSafePoint].setShowName(true);

  // setup icon size maps
  m_mapIconSizes[tIconSizeNone] = &m_markerNSize; // none should never be drawn
  m_mapIconSizesWH[tIconSizeNone] = &m_markerNSizeWH; // but just in case...
  m_mapIconSizes[tIconSizeTiny] = &m_markerNSize;
  m_mapIconSizesWH[tIconSizeTiny] = &m_markerNSizeWH;
  m_mapIconSizes[tIconSizeSmall] = &m_marker0Size;
  m_mapIconSizesWH[tIconSizeSmall] = &m_marker0SizeWH;
  m_mapIconSizes[tIconSizeRegular] = &m_drawSize;
  m_mapIconSizesWH[tIconSizeRegular] = &m_drawSizeWH;
  m_mapIconSizes[tIconSizeLarge] = &m_marker1Size;
  m_mapIconSizesWH[tIconSizeLarge] = &m_marker1SizeWH;
  m_mapIconSizes[tIconSizeXLarge] = &m_marker2Size;
  m_mapIconSizesWH[tIconSizeXLarge] = &m_marker2SizeWH;
  m_mapIconSizes[tIconSizeXXLarge] = &m_marker2Size;
  m_mapIconSizesWH[tIconSizeXXLarge] = &m_marker2SizeWH;

  // setup the flash timer
  m_flashTimer = new QTimer(this);
  connect(m_flashTimer, SIGNAL(timeout()), this, SLOT(flashTick()));
  m_flashTimer->start(200, false);
}
Ejemplo n.º 8
0
void *SpellHighlighter::processEvent(Event *e)
{
    if (e->type() == EventCheckState){
        CommandDef *cmd = (CommandDef*)(e->param());
        if (cmd->id == m_plugin->CmdSpell){
            MsgEdit *m_edit = (MsgEdit*)(cmd->param);
            if (m_edit->m_edit != textEdit())
                return NULL;
            m_index = textEdit()->charAt(static_cast<TextEdit*>(textEdit())->m_popupPos, &m_parag);
            m_pos = 0;
            m_bError   = false;
            m_bInError = false;
            m_curStart = 0;
            m_word     = "";
            m_curWord  = "";
            while (!m_fonts.empty())
                m_fonts.pop();
            m_bCheck = true;
            parse(textEdit()->text(m_paragraph));
            flushText();
            m_curText = "";
            m_bCheck = false;
            if (!m_bInError)
                return NULL;
            m_sug = m_plugin->suggestions(m_word);
            CommandDef *cmds = new CommandDef[m_sug.count() + 3];
            memset(cmds, 0, sizeof(CommandDef) * (m_sug.count() + 3));
            unsigned i = 0;
            for (QStringList::Iterator it = m_sug.begin(); it != m_sug.end(); ++it, i++){
                cmds[i].id   = m_plugin->CmdSpell + i + 2;
                cmds[i].text = "_";
                cmds[i].text_wrk = strdup((*it).toUtf8());
                if (i >= 10){
                    i++;
                    break;
                }
            }
            cmds[i].id   = m_plugin->CmdSpell;
            cmds[i].text = "_";
            cmds[i].text_wrk = strdup(i18n("Add '%1'") .arg(m_word) .toUtf8());
            i++;
            cmds[i].id   = m_plugin->CmdSpell + 1;
            cmds[i].text = "_";
            cmds[i].text_wrk = strdup(i18n("Ignore '%1'") .arg(m_word) .toUtf8());

            cmd->param  = cmds;
            cmd->flags |= COMMAND_RECURSIVE;
            return cmd;
        }
    }
    if (e->type() == EventCommandExec){
        CommandDef *cmd = (CommandDef*)(e->param());
        if (cmd->id == CmdSend){
            if (((MsgEdit*)(cmd->param))->m_edit == textEdit()){
                m_bDisable = true;
                rehighlight();
                QTimer::singleShot(50, this, SLOT(restore()));
            }
        }
        if ((cmd->id >= m_plugin->CmdSpell) && (cmd->id < m_plugin->CmdSpell + m_sug.count() + 1)){
            MsgEdit *m_edit = (MsgEdit*)(cmd->param);
            if (m_edit->m_edit != textEdit())
                return NULL;
            if (cmd->id == m_plugin->CmdSpell){
                m_plugin->add(m_word);
                MAP_BOOL::iterator it = m_words.find(my_string(m_word.toUtf8()));
                if (it == m_words.end()){
                    m_words.insert(MAP_BOOL::value_type(my_string(m_word.toUtf8()), true));
                }else{
                    if ((*it).second)
                        return NULL;
                    (*it).second = true;
                }
                m_bDirty = true;
                QTimer::singleShot(300, this, SLOT(reformat()));
            }else  if (cmd->id == m_plugin->CmdSpell + 1){
                MAP_BOOL::iterator it = m_plugin->m_ignore.find(my_string(m_word.toUtf8()));
                if (it == m_plugin->m_ignore.end())
                    m_plugin->m_ignore.insert(MAP_BOOL::value_type(my_string(m_word.toUtf8()), true));
                it = m_words.find(my_string(m_word.toUtf8()));
                if (it == m_words.end()){
                    m_words.insert(MAP_BOOL::value_type(my_string(m_word.toUtf8()), true));
                }else{
                    if ((*it).second)
                        return NULL;
                    (*it).second = true;
                }
                m_bDirty = true;
                QTimer::singleShot(300, this, SLOT(reformat()));
            }else{
                unsigned n = cmd->id - m_plugin->CmdSpell - 2;
                QString word = m_sug[n];
                textEdit()->setSelection(m_parag, m_start_word, m_parag, m_start_word + m_word.length(), 0);
                textEdit()->insert(word, true, true, true);
            }
        }
    }
    return NULL;
}
Ejemplo n.º 9
0
AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AddressBookPage),
    model(0),
    mode(mode),
    tab(tab)
{
    ui->setupUi(this);

#ifdef Q_WS_MAC // Icons on push buttons are very uncommon on Mac
    ui->newAddressButton->setIcon(QIcon());
    ui->copyToClipboard->setIcon(QIcon());
    ui->deleteButton->setIcon(QIcon());
#endif

#ifndef USE_QRCODE
    ui->showQRCode->setVisible(false);
#endif

    switch(mode)
    {
    case ForSending:
        connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(accept()));
        ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
        ui->tableView->setFocus();
        break;
    case ForEditing:
        ui->buttonBox->setVisible(false);
        break;
    }
    switch(tab)
    {
    case SendingTab:
        ui->labelExplanation->setVisible(false);
        ui->deleteButton->setVisible(true);
        ui->signMessage->setVisible(false);
        break;
    case ReceivingTab:
        ui->deleteButton->setVisible(false);
        ui->signMessage->setVisible(true);
        break;
    }
    ui->tableView->setTabKeyNavigation(false);
    ui->tableView->setContextMenuPolicy(Qt::CustomContextMenu);

    // Context menu actions
    QAction *copyAddressAction = new QAction(tr("Copy address"), this);
    QAction *copyLabelAction = new QAction(tr("Copy label"), this);
    QAction *editAction = new QAction(tr("Edit"), this);
    deleteAction = new QAction(tr("Delete"), this);

    contextMenu = new QMenu();
    contextMenu->addAction(copyAddressAction);
    contextMenu->addAction(copyLabelAction);
    contextMenu->addAction(editAction);
    contextMenu->addAction(deleteAction);

    connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(on_copyToClipboard_clicked()));
    connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(onCopyLabelAction()));
    connect(editAction, SIGNAL(triggered()), this, SLOT(onEditAction()));
    connect(deleteAction, SIGNAL(triggered()), this, SLOT(on_deleteButton_clicked()));

    connect(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));

    // Pass through accept action from button box
    connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
}
Ejemplo n.º 10
0
vendor::vendor(QWidget* parent, const char* name, Qt::WFlags fl)
    : QMainWindow(parent, name, fl)
{
  setupUi(this);

  connect(_save, SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_printAddresses, SIGNAL(clicked()), this, SLOT(sPrintAddresses()));
  connect(_newAddress, SIGNAL(clicked()), this, SLOT(sNewAddress()));
  connect(_editAddress, SIGNAL(clicked()), this, SLOT(sEditAddress()));
  connect(_viewAddress, SIGNAL(clicked()), this, SLOT(sViewAddress()));
  connect(_deleteAddress, SIGNAL(clicked()), this, SLOT(sDeleteAddress()));
  connect(_deleteTaxreg, SIGNAL(clicked()), this, SLOT(sDeleteTaxreg()));
  connect(_editTaxreg,   SIGNAL(clicked()), this, SLOT(sEditTaxreg()));
  connect(_newTaxreg,    SIGNAL(clicked()), this, SLOT(sNewTaxreg()));
  connect(_viewTaxreg,   SIGNAL(clicked()), this, SLOT(sViewTaxreg()));
  connect(_next, SIGNAL(clicked()), this, SLOT(sNext()));
  connect(_previous, SIGNAL(clicked()), this, SLOT(sPrevious()));

  _defaultCurr->setLabel(_defaultCurrLit);

  _vendaddr->addColumn(tr("Number"),           70,  Qt::AlignLeft );
  _vendaddr->addColumn(tr("Name"),             150, Qt::AlignLeft );
  _vendaddr->addColumn(tr("City, State, Zip"), -1,  Qt::AlignLeft );

  _taxreg->addColumn(tr("Tax Authority"), 100, Qt::AlignLeft );
  _taxreg->addColumn(tr("Registration #"), -1, Qt::AlignLeft );

  _crmacctid = -1;
  _ignoreClose = false;
  
  if (!_metrics->boolean("EnableBatchManager"))
    _tabs->removePage(_tabs->page(_tabs->count()-1));
}
Ejemplo n.º 11
0
ServerChoice::ServerChoice(TeamHolder* team) :
    ui(new Ui::ServerChoice), wasConnected(false), team(team)
{
    ui->setupUi(this);
    ui->announcement->hide();

    ServerChoiceModel *model = new ServerChoiceModel();
    model->setParent(ui->serverList);
    filter = new QSortFilterProxyModel(ui->serverList);
    filter->setSourceModel(model);
    filter->setSortRole(ServerChoiceModel::SortRole);
    ui->serverList->setModel(filter);

    connect(ui->description, SIGNAL(anchorClicked(QUrl)), SLOT(anchorClicked(QUrl)));

    QSettings settings;

    registry_connection = new Analyzer(true);
    connect(registry_connection, SIGNAL(connected()), SLOT(connected()));

    registry_connection->connectTo(
        settings.value("ServerChoice/RegistryServer", "pokemon-online-registry.dynalias.net").toString(),
        settings.value("ServerChoice/RegistryPort", 5090).toUInt()
    );
    registry_connection->setParent(this);

    ui->switchPort->setIcon(QApplication::style()->standardIcon(QStyle::SP_BrowserReload));

    connect(registry_connection, SIGNAL(connectionError(int,QString)), SLOT(connectionError(int , QString)));
    connect(registry_connection, SIGNAL(regAnnouncementReceived(QString)), ui->announcement, SLOT(setText(QString)));
    connect(registry_connection, SIGNAL(regAnnouncementReceived(QString)), ui->announcement, SLOT(show()));

    connect(registry_connection, SIGNAL(serverReceived(ServerInfo)), model, SLOT(addServer(ServerInfo)));
    connect(this, SIGNAL(clearList()), model, SLOT(clear()));
    connect(registry_connection, SIGNAL(serverReceived(ServerInfo)), SLOT(serverAdded()));

    //TO-DO: Make  the item 0 un-resizable and unselectable - Latios

    ui->serverList->setColumnWidth(0, settings.value("ServerChoice/PasswordProtectedWidth", 26).toInt());
    ui->serverList->setColumnWidth(1, settings.value("ServerChoice/ServerNameWidth", 152).toInt());
    if (settings.contains("ServerChoice/PlayersInfoWidth")) {
        ui->serverList->setColumnWidth(2, settings.value("ServerChoice/PlayersInfoWidth").toInt());
    }
    ui->serverList->horizontalHeader()->setStretchLastSection(true);

    connect(ui->serverList, SIGNAL(activated(QModelIndex)), SLOT(regServerChosen(QModelIndex)));
    connect(ui->serverList, SIGNAL(currentCellChanged(QModelIndex)), SLOT(showDetails(QModelIndex)));

    ui->nameEdit->setText(team->name());
    ui->advServerEdit->addItem(settings.value("ServerChoice/DefaultServer").toString());
    connect(ui->nameEdit, SIGNAL(returnPressed()), SLOT(advServerChosen()));
    connect(ui->advServerEdit->lineEdit(), SIGNAL(returnPressed()), SLOT(advServerChosen()));

    QCompleter *completer = new QCompleter(ui->advServerEdit);
    completer->setCaseSensitivity(Qt::CaseInsensitive);
    QStringList res = settings.value("ServerChoice/SavedServers").toStringList();

    foreach (QString r, res) {
        if (r.contains("-")) {
            savedServers.push_back(QStringList() << r.section("-", -1).trimmed() << r.section("-", 0, -2).trimmed());
        } else {
            savedServers.push_back(QStringList() << r << "");
        }
    }

    QStringListModel *m = new QStringListModel(res, completer);

    completer->setModel(m);
    ui->advServerEdit->setCompleter(completer);
    ui->advServerEdit->setModel(m);

    connect(ui->goBack, SIGNAL(clicked()), SIGNAL(rejected()));
    connect(ui->advancedConnection, SIGNAL(clicked()), SLOT(advServerChosen()));

    QTimer *t = new QTimer(this);
    t->singleShot(5000, this, SLOT(timeout()));

#if QT_VERSION >= QT_VERSION_CHECK(4,8,0)
    ui->serverList->sortByColumn(ServerChoiceModel::Players, Qt::SortOrder(filter->headerData(ServerChoiceModel::Players, Qt::Horizontal, Qt::InitialSortOrderRole).toInt()));
#else
    ui->serverList->sortByColumn(ServerChoiceModel::Players, Qt::DescendingOrder);
#endif
}
Ejemplo n.º 12
0
void vendor::set(const ParameterList &pParams)
{
  QVariant param;
  bool     valid;

  param = pParams.value("crmacct_number", &valid);
  if (valid)
    _number->setText(param.toString());

  param = pParams.value("crmacct_name", &valid);
  if (valid)
    _name->setText(param.toString());

  param = pParams.value("crmacct_id", &valid);
  if (valid)
    _crmacctid = param.toInt();

  param = pParams.value("vend_id", &valid);
  if (valid)
  {
    _vendid = param.toInt();
    populate();
  }

  param = pParams.value("mode", &valid);
  if (valid)
  {
    if (param.toString() == "new")
    {
      _mode = cNew;

      q.exec("SELECT NEXTVAL('vend_vend_id_seq') AS vend_id;");
      if (q.first())
        _vendid = q.value("vend_id").toInt();
      else
        systemError(this, tr("A System Error occurred at %1::%2.")
                          .arg(__FILE__)
                          .arg(__LINE__) );

      _comments->setId(_vendid);
      _defaultShipVia->setText(_metrics->value("DefaultPOShipVia"));
  
      connect(_number, SIGNAL(lostFocus()), this, SLOT(sCheck()));

      if (_privleges->check("MaintainVendorAddresses"))
      {
        connect(_vendaddr, SIGNAL(valid(bool)), _editAddress, SLOT(setEnabled(bool)));
        connect(_vendaddr, SIGNAL(valid(bool)), _deleteAddress, SLOT(setEnabled(bool)));
        connect(_vendaddr, SIGNAL(itemSelected(int)), _editAddress, SLOT(animateClick()));
      }
      else
      {
        _newAddress->setEnabled(FALSE);
        connect(_vendaddr, SIGNAL(itemSelected(int)), _viewAddress, SLOT(animateClick()));
      }

      _number->setFocus();
    }
    else if (param.toString() == "edit")
    {
      _mode = cEdit;

      if (_privleges->check("MaintainVendorAddresses"))
      {
        connect(_vendaddr, SIGNAL(valid(bool)), _editAddress, SLOT(setEnabled(bool)));
        connect(_vendaddr, SIGNAL(valid(bool)), _deleteAddress, SLOT(setEnabled(bool)));
        connect(_vendaddr, SIGNAL(itemSelected(int)), _editAddress, SLOT(animateClick()));
      }
      else
      {
        _newAddress->setEnabled(FALSE);
        connect(_vendaddr, SIGNAL(itemSelected(int)), _viewAddress, SLOT(animateClick()));
      }

      _save->setFocus();
    }
    else if (param.toString() == "view")
    {
      _mode = cView;

      _number->setEnabled(FALSE);
      _vendtype->setEnabled(FALSE);
      _active->setEnabled(FALSE);
      _name->setEnabled(FALSE);
      _accountNumber->setEnabled(FALSE);
      _defaultTerms->setEnabled(FALSE);
      _defaultShipVia->setEnabled(FALSE);
      _defaultCurr->setEnabled(FALSE);
      _contact1->setEnabled(FALSE);
      _contact2->setEnabled(FALSE);
      _address->setEnabled(FALSE);
      _notes->setReadOnly(FALSE);
      _poComments->setReadOnly(TRUE);
      _poItems->setEnabled(FALSE);
      _restrictToItemSource->setEnabled(FALSE);
      _receives1099->setEnabled(FALSE);
      _qualified->setEnabled(FALSE);
      _emailPODelivery->setEnabled(FALSE);
      _emailPOGroup->setEnabled(FALSE);
      _newAddress->setEnabled(FALSE);
      _defaultFOBGroup->setEnabled(false);
      _taxauth->setEnabled(false);
      _match->setEnabled(false);
      _newTaxreg->setEnabled(false);
      _comments->setReadOnly(TRUE);
      _save->hide();
      _close->setText(tr("&Close"));

      disconnect(_taxreg, SIGNAL(valid(bool)), _deleteTaxreg, SLOT(setEnabled(bool)));
      disconnect(_taxreg, SIGNAL(valid(bool)), _editTaxreg, SLOT(setEnabled(bool)));
      disconnect(_taxreg, SIGNAL(itemSelected(int)), _editTaxreg, SLOT(animateClick()));
      connect(_taxreg, SIGNAL(itemSelected(int)), _viewTaxreg, SLOT(animateClick()));

      _close->setFocus();
    }
  }

  if(cNew == _mode || !pParams.inList("showNextPrev"))
  {
    _next->hide();
    _previous->hide();
  }
}
void VESPERSBeamlineSetStringAction::start()
{
	setStarted(true);
	connect(pv_, SIGNAL(valueChanged()), this, SLOT(onValueChanged()));
	VESPERS::stringToPV(pv_, string_);
}
Ejemplo n.º 14
0
//connects gui buttons with Slots in this class
void MainWindow::connectSignalSlots() {
    //connect signals/slots
    //load/save/open export folder
    connect(ui->pushButton_load, SIGNAL(clicked()), this, SLOT(loadUserFilePath()));
    connect(ui->pushButton_save, SIGNAL(clicked()), this, SLOT(saveUserFilePath()));
    connect(ui->pushButton_openExportFolder, SIGNAL(clicked()), this, SLOT(openExportFolder()));
    //zoom
    connect(ui->pushButton_zoomIn, SIGNAL(clicked()), this, SLOT(zoomIn()));
    connect(ui->pushButton_zoomOut, SIGNAL(clicked()), this, SLOT(zoomOut()));
    connect(ui->pushButton_resetZoom, SIGNAL(clicked()), this, SLOT(resetZoom()));
    connect(ui->pushButton_fitInView, SIGNAL(clicked()), this, SLOT(fitInView()));
    //calculate
    connect(ui->pushButton_calcNormal, SIGNAL(clicked()), this, SLOT(calcNormalAndPreview()));
    connect(ui->pushButton_calcSpec, SIGNAL(clicked()), this, SLOT(calcSpecAndPreview()));
    connect(ui->pushButton_calcDisplace, SIGNAL(clicked()), this, SLOT(calcDisplaceAndPreview()));
    connect(ui->pushButton_calcSsao, SIGNAL(clicked()), this, SLOT(calcSsaoAndPreview()));
    //switch between tabs
    connect(ui->tabWidget, SIGNAL(tabBarClicked(int)), this, SLOT(preview(int)));
    //display channel intensity
    connect(ui->checkBox_displayChannelIntensity, SIGNAL(clicked(bool)), this, SLOT(preview()));
    connect(ui->checkBox_displayChannelIntensity, SIGNAL(clicked(bool)), ui->radioButton_displayRed, SLOT(setEnabled(bool)));
    connect(ui->checkBox_displayChannelIntensity, SIGNAL(clicked(bool)), ui->radioButton_displayGreen, SLOT(setEnabled(bool)));
    connect(ui->checkBox_displayChannelIntensity, SIGNAL(clicked(bool)), ui->radioButton_displayBlue, SLOT(setEnabled(bool)));
    connect(ui->checkBox_displayChannelIntensity, SIGNAL(clicked(bool)), ui->radioButton_displayAlpha, SLOT(setEnabled(bool)));

    connect(ui->radioButton_displayRed, SIGNAL(clicked()), this, SLOT(displayChannelIntensity()));
    connect(ui->radioButton_displayGreen, SIGNAL(clicked()), this, SLOT(displayChannelIntensity()));
    connect(ui->radioButton_displayBlue, SIGNAL(clicked()), this, SLOT(displayChannelIntensity()));
    connect(ui->radioButton_displayAlpha, SIGNAL(clicked()), this, SLOT(displayChannelIntensity()));
    connect(ui->checkBox_displayChannelIntensity, SIGNAL(clicked()), this, SLOT(displayChannelIntensity()));
    //autoupdate after changed values
    // spec autoupdate
    connect(ui->doubleSpinBox_spec_redMul, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate()));
    connect(ui->doubleSpinBox_spec_greenMul, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate()));
    connect(ui->doubleSpinBox_spec_blueMul, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate()));
    connect(ui->doubleSpinBox_spec_alphaMul, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate()));
    connect(ui->doubleSpinBox_spec_scale, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate()));
    connect(ui->comboBox_mode_spec, SIGNAL(currentIndexChanged(int)), this, SLOT(autoUpdate()));
    connect(ui->doubleSpinBox_spec_contrast, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate()));
    // normal autoupdate
    connect(ui->checkBox_useRed_normal, SIGNAL(clicked()), this, SLOT(autoUpdate()));
    connect(ui->checkBox_useGreen_normal, SIGNAL(clicked()), this, SLOT(autoUpdate()));
    connect(ui->checkBox_useBlue_normal, SIGNAL(clicked()), this, SLOT(autoUpdate()));
    connect(ui->checkBox_useAlpha_normal, SIGNAL(clicked()), this, SLOT(autoUpdate()));
    connect(ui->comboBox_mode_normal, SIGNAL(currentIndexChanged(int)), this, SLOT(autoUpdate()));
    connect(ui->comboBox_method, SIGNAL(currentIndexChanged(int)), this, SLOT(autoUpdate()));
    connect(ui->doubleSpinBox_strength, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate()));
    connect(ui->checkBox_tileable, SIGNAL(clicked()), this, SLOT(autoUpdate()));
    connect(ui->checkBox_invertHeight, SIGNAL(clicked()), this, SLOT(autoUpdate()));
    connect(ui->spinBox_normalmapSize, SIGNAL(valueChanged(int)), this, SLOT(autoUpdate()));
    connect(ui->checkBox_keepLargeDetail, SIGNAL(clicked()), this, SLOT(autoUpdate()));
    connect(ui->spinBox_largeDetailScale, SIGNAL(valueChanged(int)), this, SLOT(autoUpdate()));
    connect(ui->doubleSpinBox_largeDetailHeight, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate()));
    // displcacement autoupdate
    connect(ui->doubleSpinBox_displace_redMul, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate()));
    connect(ui->doubleSpinBox_displace_greenMul, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate()));
    connect(ui->doubleSpinBox_displace_blueMul, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate()));
    connect(ui->doubleSpinBox_displace_scale, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate()));
    connect(ui->comboBox_mode_displace, SIGNAL(currentIndexChanged(int)), this, SLOT(autoUpdate()));
    connect(ui->doubleSpinBox_displace_contrast, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate()));
    // ssao autoupdate
    connect(ui->doubleSpinBox_ssao_size, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate()));
    //graphicsview drag and drop
    connect(ui->graphicsView, SIGNAL(singleImageDropped(QUrl)), this, SLOT(loadSingleDropped(QUrl)));
    connect(ui->graphicsView, SIGNAL(multipleImagesDropped(QList<QUrl>)), this, SLOT(loadMultipleDropped(QList<QUrl>)));
    //graphicsview rightclick/middleclick/zoom
    connect(ui->graphicsView, SIGNAL(rightClick()), this, SLOT(resetZoom()));
    connect(ui->graphicsView, SIGNAL(middleClick()), this, SLOT(fitInView()));
    connect(ui->graphicsView, SIGNAL(zoomIn()), this, SLOT(zoomIn()));
    connect(ui->graphicsView, SIGNAL(zoomOut()), this, SLOT(zoomOut()));
    //queue (item widget)
    connect(ui->pushButton_removeImagesFromQueue, SIGNAL(clicked()), this, SLOT(removeImagesFromQueue()));
    connect(ui->pushButton_processQueue, SIGNAL(clicked()), this, SLOT(processQueue()));
    connect(ui->pushButton_stopProcessingQueue, SIGNAL(clicked()), this, SLOT(stopProcessingQueue()));
    connect(ui->pushButton_changeOutputPath_Queue, SIGNAL(clicked()), this, SLOT(changeOutputPathQueueDialog()));
    connect(ui->lineEdit_outputPath, SIGNAL(editingFinished()), this, SLOT(editOutputPathQueue()));
    connect(ui->listWidget_queue, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(queueItemDoubleClicked(QListWidgetItem*)));
    //queue drag and drop
    connect(ui->listWidget_queue, SIGNAL(singleImageDropped(QUrl)), this, SLOT(loadSingleDropped(QUrl)));
    connect(ui->listWidget_queue, SIGNAL(multipleImagesDropped(QList<QUrl>)), this, SLOT(loadMultipleDropped(QList<QUrl>)));
    //normalmap size preview text
    connect(ui->spinBox_normalmapSize, SIGNAL(valueChanged(int)), this, SLOT(normalmapSizeChanged()));
    //"About" button
    connect(ui->pushButton_about, SIGNAL(clicked()), this, SLOT(showAboutDialog()));
}
Ejemplo n.º 15
0
bool QAudioInputPrivate::open()
{
#ifdef DEBUG_AUDIO
    QTime now(QTime::currentTime());
    qDebug()<<now.second()<<"s "<<now.msec()<<"ms :open()";
#endif
    clockStamp.restart();
    timeStamp.restart();
    elapsedTimeOffset = 0;

    int dir;
    int err=-1;
    int count=0;
    unsigned int freakuency=settings.frequency();

    QString dev = QString(QLatin1String(m_device.constData()));
    QList<QByteArray> devices = QAudioDeviceInfoInternal::availableDevices(QAudio::AudioInput);
    if(dev.compare(QLatin1String("default")) == 0) {
#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
        dev = QLatin1String(devices.first());
#else
        dev = QLatin1String("hw:0,0");
#endif
    } else {
#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
        dev = QLatin1String(m_device);
#else
        int idx = 0;
        char *name;

        QString shortName = QLatin1String(m_device.mid(m_device.indexOf('=',0)+1).constData());

        while(snd_card_get_name(idx,&name) == 0) {
            if(qstrncmp(shortName.toLocal8Bit().constData(),name,shortName.length()) == 0)
                break;
            idx++;
        }
        dev = QString(QLatin1String("hw:%1,0")).arg(idx);
#endif
    }

    // Step 1: try and open the device
    while((count < 5) && (err < 0)) {
        err=snd_pcm_open(&handle,dev.toLocal8Bit().constData(),SND_PCM_STREAM_CAPTURE,0);
        if(err < 0)
            count++;
    }
    if (( err < 0)||(handle == 0)) {
        errorState = QAudio::OpenError;
        deviceState = QAudio::StoppedState;
        emit stateChanged(deviceState);
        return false;
    }
    snd_pcm_nonblock( handle, 0 );

    // Step 2: Set the desired HW parameters.
    snd_pcm_hw_params_alloca( &hwparams );

    bool fatal = false;
    QString errMessage;
    unsigned int chunks = 8;

    err = snd_pcm_hw_params_any( handle, hwparams );
    if ( err < 0 ) {
        fatal = true;
        errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_any: err = %1").arg(err);
    }
    if ( !fatal ) {
        err = snd_pcm_hw_params_set_rate_resample( handle, hwparams, 1 );
        if ( err < 0 ) {
            fatal = true;
            errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_rate_resample: err = %1").arg(err);
        }
    }
    if ( !fatal ) {
        err = snd_pcm_hw_params_set_access( handle, hwparams, access );
        if ( err < 0 ) {
            fatal = true;
            errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_access: err = %1").arg(err);
        }
    }
    if ( !fatal ) {
        err = setFormat();
        if ( err < 0 ) {
            fatal = true;
            errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_format: err = %1").arg(err);
        }
    }
    if ( !fatal ) {
        err = snd_pcm_hw_params_set_channels( handle, hwparams, (unsigned int)settings.channels() );
        if ( err < 0 ) {
            fatal = true;
            errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_channels: err = %1").arg(err);
        }
    }
    if ( !fatal ) {
        err = snd_pcm_hw_params_set_rate_near( handle, hwparams, &freakuency, 0 );
        if ( err < 0 ) {
            fatal = true;
            errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_rate_near: err = %1").arg(err);
        }
    }
    if ( !fatal ) {
        err = snd_pcm_hw_params_set_buffer_time_near(handle, hwparams, &buffer_time, &dir);
        if ( err < 0 ) {
            fatal = true;
            errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_buffer_time_near: err = %1").arg(err);
        }
    }
    if ( !fatal ) {
        err = snd_pcm_hw_params_set_period_time_near(handle, hwparams, &period_time, &dir);
        if ( err < 0 ) {
            fatal = true;
            errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_period_time_near: err = %1").arg(err);
        }
    }
    if ( !fatal ) {
        err = snd_pcm_hw_params_set_periods_near(handle, hwparams, &chunks, &dir);
        if ( err < 0 ) {
            fatal = true;
            errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_periods_near: err = %1").arg(err);
        }
    }
    if ( !fatal ) {
        err = snd_pcm_hw_params(handle, hwparams);
        if ( err < 0 ) {
            fatal = true;
            errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params: err = %1").arg(err);
        }
    }
    if( err < 0) {
        qWarning()<<errMessage;
        errorState = QAudio::OpenError;
        deviceState = QAudio::StoppedState;
        emit stateChanged(deviceState);
        return false;
    }
    snd_pcm_hw_params_get_buffer_size(hwparams,&buffer_frames);
    buffer_size = snd_pcm_frames_to_bytes(handle,buffer_frames);
    snd_pcm_hw_params_get_period_size(hwparams,&period_frames, &dir);
    period_size = snd_pcm_frames_to_bytes(handle,period_frames);
    snd_pcm_hw_params_get_buffer_time(hwparams,&buffer_time, &dir);
    snd_pcm_hw_params_get_period_time(hwparams,&period_time, &dir);

    // Step 3: Set the desired SW parameters.
    snd_pcm_sw_params_t *swparams;
    snd_pcm_sw_params_alloca(&swparams);
    snd_pcm_sw_params_current(handle, swparams);
    snd_pcm_sw_params_set_start_threshold(handle,swparams,period_frames);
    snd_pcm_sw_params_set_stop_threshold(handle,swparams,buffer_frames);
    snd_pcm_sw_params_set_avail_min(handle, swparams,period_frames);
    snd_pcm_sw_params(handle, swparams);

    // Step 4: Prepare audio
    if(audioBuffer == 0)
        audioBuffer = new char[buffer_size];
    snd_pcm_prepare( handle );
    snd_pcm_start(handle);

    // Step 5: Setup timer
    bytesAvailable = bytesReady();

    if(pullMode)
        connect(audioSource,SIGNAL(readyRead()),this,SLOT(userFeed()));

    // Step 6: Start audio processing
    chunks = buffer_size/period_size;
    timer->start(period_time*chunks/2000);

    errorState  = QAudio::NoError;
    deviceState = QAudio::ActiveState;

    totalTimeValue = 0;

    return true;
}
Ejemplo n.º 16
0
void ProxyAction::changeContexts(QList<int> contexts)
{
    LOG_TRACE("Context update request on proxy action", text());

    if (m_contextActions.isEmpty())
    {
        LOG_TRACE("No backend actions stored here.");
        return;
    }

    m_contexts = contexts;

    QAction *oldAction = m_activeAction;
    m_activeAction = 0;

    for (int n = 0; n < m_contexts.size(); n++)
    {
        QAction *a = m_contextActions.value(m_contexts.at(n), 0);
        if (a)
        {
            m_activeAction = a;
            m_activeAction->setObjectName(a->text());

            LOG_TRACE(QString("Backend action found: %1, shortcut: %2, proxy shortcut: %3")
                      .arg(m_activeAction->text())
                      .arg(m_activeAction->shortcut().toString())
                      .arg(m_action->shortcut().toString()));
            break;
        }
    }

    if (m_activeAction == oldAction && m_initialized)
    {
        updateFrontend();

        LOG_TRACE("New backend action is the same as the active action; nothing to be done.");
        return;
    }

    if (oldAction)
    {
        LOG_TRACE(QString("Disconnecting multi-context action from previous backend action in parent: %1")
                  .arg(oldAction->parent() ? oldAction->parent()->objectName() : "Unspecified parent"));

        disconnect(oldAction, SIGNAL(changed()), this, SLOT(updateFrontend()));
        disconnect(m_action, SIGNAL(triggered(bool)), oldAction, SIGNAL(triggered(bool)));
        disconnect(m_action, SIGNAL(toggled(bool)), oldAction, SLOT(setChecked(bool)));
    }

    if (m_activeAction)
    {
        LOG_TRACE(QString("Connecting base action: %1, shortcut: %2, parent: %3")
                  .arg(m_activeAction->text())
                  .arg(m_action->shortcut().toString())
                  .arg(m_activeAction->parent() ? m_activeAction->parent()->objectName() : "Unspecified parent"));

        connect(m_activeAction, SIGNAL(changed()), SLOT(updateFrontend()));
        connect(m_action, SIGNAL(triggered(bool)), m_activeAction, SIGNAL(triggered(bool)));
        connect(m_action, SIGNAL(toggled(bool)), m_activeAction, SLOT(setChecked(bool)));

        updateFrontend();

        m_initialized = true;

        return;
    }
    else
    {
        LOG_TRACE("New backend action could not be found; action will be disabled in this context.");
    }

    m_action->setEnabled(false);
}
Ejemplo n.º 17
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    m_contactsModel(new CContactsModel(this)),
    m_messagingModel(new CMessagingModel(this)),
    m_chatContactsModel(new CContactsModel(this)),
    m_chatMessagingModel(new CMessagingModel(this)),
    m_chatInfoModel(new CChatInfoModel(this)),
    m_activeChatId(0),
    m_chatCreationMode(false),
    m_core(new CTelegramCore(this)),
    m_registered(false),
    m_appState(AppStateNone)
{
    ui->setupUi(this);
    ui->contactListTable->setModel(m_contactsModel);
    ui->messagingView->setModel(m_messagingModel);
    ui->groupChatContacts->setModel(m_chatContactsModel);
    ui->groupChatChatsList->setModel(m_chatInfoModel);
    ui->groupChatMessagingView->setModel(m_chatMessagingModel);

    QCompleter *comp = new QCompleter(m_contactsModel, this);
    ui->messagingContactPhone->setCompleter(comp);
    ui->groupChatContactPhone->setCompleter(comp);

    connect(ui->secretOpenFile, SIGNAL(clicked()), SLOT(loadSecretFromBrowsedFile()));

    // Telepathy Morse app info
    CAppInformation appInfo;
    appInfo.setAppId(14617);
    appInfo.setAppHash(QLatin1String("e17ac360fd072f83d5d08db45ce9a121"));
    appInfo.setAppVersion(QLatin1String("0.1"));
    appInfo.setDeviceInfo(QLatin1String("pc"));
    appInfo.setOsInfo(QLatin1String("GNU/Linux"));
    appInfo.setLanguageCode(QLatin1String("en"));

    m_core->setAppInformation(&appInfo);
    m_core->setAutoReconnection(true);

    connect(m_core, SIGNAL(connectionStateChanged(TelegramNamespace::ConnectionState)),
            SLOT(whenConnectionStateChanged(TelegramNamespace::ConnectionState)));
    connect(m_core, SIGNAL(phoneStatusReceived(QString,bool,bool)),
            SLOT(whenPhoneStatusReceived(QString,bool,bool)));
    connect(m_core, SIGNAL(phoneCodeRequired()),
            SLOT(whenPhoneCodeRequested()));
    connect(m_core, SIGNAL(authSignErrorReceived(TelegramNamespace::AuthSignError,QString)),
            SLOT(whenAuthSignErrorReceived(TelegramNamespace::AuthSignError,QString)));
    connect(m_core, SIGNAL(contactListChanged()),
            SLOT(whenContactListChanged()));
    connect(m_core, SIGNAL(contactProfileChanged(QString)),
            SLOT(whenContactProfileChanged(QString)));
    connect(m_core, SIGNAL(avatarReceived(QString,QByteArray,QString,QString)),
            SLOT(whenAvatarReceived(QString,QByteArray,QString)));
    connect(m_core, SIGNAL(messageMediaDataReceived(QString,quint32,QByteArray,QString,TelegramNamespace::MessageType,quint32,quint32)),
            SLOT(whenMessageMediaDataReceived(QString,quint32,QByteArray,QString,TelegramNamespace::MessageType,quint32,quint32)));
    connect(m_core, SIGNAL(messageReceived(TelegramNamespace::Message)),
            SLOT(whenMessageReceived(TelegramNamespace::Message)));
    connect(m_core, SIGNAL(contactChatTypingStatusChanged(quint32,QString,bool)),
            SLOT(whenContactChatTypingStatusChanged(quint32,QString,bool)));
    connect(m_core, SIGNAL(contactTypingStatusChanged(QString,bool)),
            SLOT(whenContactTypingStatusChanged(QString,bool)));
    connect(m_core, SIGNAL(contactStatusChanged(QString,TelegramNamespace::ContactStatus)),
            SLOT(whenContactStatusChanged(QString)));
    connect(m_core, SIGNAL(sentMessageStatusChanged(QString,quint64,TelegramNamespace::MessageDeliveryStatus)),
            m_messagingModel, SLOT(setMessageDeliveryStatus(QString,quint64,TelegramNamespace::MessageDeliveryStatus)));
    connect(m_core, SIGNAL(uploadingStatusUpdated(quint32,quint32,quint32)),
            SLOT(whenUploadingStatusUpdated(quint32,quint32,quint32)));

    connect(m_core, SIGNAL(chatAdded(quint32)), SLOT(whenChatAdded(quint32)));
    connect(m_core, SIGNAL(chatChanged(quint32)), SLOT(whenChatChanged(quint32)));

    ui->groupChatContacts->hideColumn(CContactsModel::Blocked);

    ui->mainSplitter->setSizes(QList<int>() << 0 << 100);
    ui->groupChatSplitter->setSizes(QList<int>() << 550 << 450 << 300);

    ui->groupChatChatsList->setColumnWidth(CChatInfoModel::Id, 30);

    ui->blockContact->hide();
    ui->unblockContact->hide();

    ui->groupChatLeaveChat->hide();

    QFile helpFile(QLatin1String(":/USAGE"));
    helpFile.open(QIODevice::ReadOnly);
    ui->helpView->setPlainText(helpFile.readAll());

    setAppState(AppStateNone);
    updateGroupChatAddContactButtonText();

    connect(ui->groupChatContactPhone, SIGNAL(textChanged(QString)), SLOT(updateGroupChatAddContactButtonText()));

#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
    connect(ui->messagingView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(whenCustomMenuRequested(QPoint)));
#endif

    ui->groupChatAddContactForwardMessages->hide();

    ui->messagingAttachButton->hide();
}
Ejemplo n.º 18
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    ArrayInit();

    QFile file;//загрузка jquery и добавление ноу конфликт
    file.setFileName(":/jquery-1.11.3.min.js");
    file.open(QIODevice::ReadOnly);
    jQuery = file.readAll();
    jQuery.append("\nvar qt = { 'jQuery': jQuery.noConflict(true) };");
    file.close();

    ServIP="127.0.0.1";


    QFile htmlF;//подгрузка html
    htmlF.setFileName(":/page.html");
    htmlF.open(QFile::ReadOnly);
    Html = htmlF.readAll();
    htmlF.close();

    QFile styleF;//подгрузка стилей
    styleF.setFileName("://style.qss");
    styleF.open(QFile::ReadOnly);
    QString qssStr = styleF.readAll();
    qApp->setStyleSheet(qssStr);
    styleF.close();

     QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
     QWebSettings::globalSettings()->setAttribute(QWebSettings::AutoLoadImages, true);
     QWebSettings::globalSettings()->setAttribute(QWebSettings::JavascriptEnabled, true);
     connect(ui->webView,SIGNAL(loadFinished(bool)),this,SLOT(UIloadFinished(bool)));
     ui->webView->load(QUrl("http://free-filmy.ru/"));

    connect(this,SIGNAL (phase2(QString)),this ,SLOT(Phase2Do(QString)));
    wb1=new QWebView();
    connect(wb1,SIGNAL(loadFinished(bool)),this,SLOT(loadFinished(bool)));
    connect(wb1,SIGNAL(loadProgress(int)),this, SLOT(changeProgress(int)));
    wb2=new QWebView();
    connect(wb2,SIGNAL(loadFinished(bool)),this,SLOT(loadFinished2(bool)));

    dial=new QDialog;
    wb3=new QWebView();
    pb=new QPushButton();
    pb->setText("OK");
    VBox=new QVBoxLayout;
    VBox->addWidget(wb3);
    VBox->addWidget(pb);
    HBox=new QHBoxLayout;
    HBox->addLayout(VBox);
    dial->setLayout(HBox);

    dial2=new QDialog;
    wb4=new QWebView();
    VBox2=new QVBoxLayout;
    VBox2->addWidget(wb4);
    HBox2=new QHBoxLayout;
    HBox2->addLayout(VBox2);
    dial2->setLayout(HBox2);


  connect(pb,SIGNAL(clicked(bool)),this,SLOT(pb_click(bool)));
  connect(wb3->page()->mainFrame(),SIGNAL(titleChanged(QString)),this,SLOT(img_put(QString)));

  done2=true;

}
Ejemplo n.º 19
0
AddressBook::AddressBook(QWidget *parent)
    : QWidget(parent)
{
    QLabel *nameLabel = new QLabel(tr("Name:"));
    nameLine = new QLineEdit;
    nameLine->setReadOnly(true);

    QLabel *addressLabel = new QLabel(tr("Address:"));
    addressText = new QTextEdit;
    addressText->setReadOnly(true);

    addButton = new QPushButton(tr("&Add"));
//! [edit and remove buttons] 
    editButton = new QPushButton(tr("&Edit"));
    editButton->setEnabled(false);
    removeButton = new QPushButton(tr("&Remove"));
    removeButton->setEnabled(false);
//! [edit and remove buttons] 
    submitButton = new QPushButton(tr("&Submit"));
    submitButton->hide();
    cancelButton = new QPushButton(tr("&Cancel"));
    cancelButton->hide();
    
    nextButton = new QPushButton(tr("&Next"));
    nextButton->setEnabled(false);
    previousButton = new QPushButton(tr("&Previous"));
    previousButton->setEnabled(false);

    connect(addButton, SIGNAL(clicked()), this, SLOT(addContact()));
    connect(submitButton, SIGNAL(clicked()), this, SLOT(submitContact()));
//! [connecting edit and remove] 
    connect(editButton, SIGNAL(clicked()), this, SLOT(editContact()));
    connect(removeButton, SIGNAL(clicked()), this, SLOT(removeContact()));
//! [connecting edit and remove] 
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancel()));
    connect(nextButton, SIGNAL(clicked()), this, SLOT(next()));
    connect(previousButton, SIGNAL(clicked()), this, SLOT(previous()));

    QVBoxLayout *buttonLayout1 = new QVBoxLayout;
    buttonLayout1->addWidget(addButton);
//! [adding edit and remove to the layout]     
    buttonLayout1->addWidget(editButton);
    buttonLayout1->addWidget(removeButton);
//! [adding edit and remove to the layout]         
    buttonLayout1->addWidget(submitButton);
    buttonLayout1->addWidget(cancelButton);
    buttonLayout1->addStretch();

    QHBoxLayout *buttonLayout2 = new QHBoxLayout;
    buttonLayout2->addWidget(previousButton);
    buttonLayout2->addWidget(nextButton);

    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(nameLabel, 0, 0);
    mainLayout->addWidget(nameLine, 0, 1);
    mainLayout->addWidget(addressLabel, 1, 0, Qt::AlignTop);
    mainLayout->addWidget(addressText, 1, 1);
    mainLayout->addLayout(buttonLayout1, 1, 2);
    mainLayout->addLayout(buttonLayout2, 2, 1);

    setLayout(mainLayout);
    setWindowTitle(tr("Simple Address Book"));
}
Ejemplo n.º 20
0
void FriendsWidget::drawFriendsWidget()
{
    //Friends
    FriendItem *fitem = new FriendItem(this);
    fitem->setPos(18, 50);
    fitem->setName("Siraj");
    //fitem->setIcon

    connect(fitem, SIGNAL(clicked()), this, SLOT(spin()));

    mItems[fitem->name()] = fitem;

    fitem = new FriendItem(this);
    fitem->setPos(18, 100);
    fitem->setName("Lahiru");
    //fitem->setIcon

    connect(fitem, SIGNAL(clicked()), this, SLOT(spin()));

    mItems[fitem->name()] = fitem;

    fitem = new FriendItem(this);
    fitem->setPos(18, 150);
    fitem->setName("Bud");
    //fitem->setIcon

    connect(fitem, SIGNAL(clicked()), this, SLOT(spin()));

    mItems[fitem->name()] = fitem;

    fitem = new FriendItem(this);
    fitem->setPos(18, 200);
    fitem->setName("Mani");
    //fitem->setIcon

    connect(fitem, SIGNAL(clicked()), this, SLOT(spin()));

    mItems[fitem->name()] = fitem;

    //Actions
    FriendItem *action = new FriendItem(this);
    action->setPos(18, 50);
    action->setName("Chat");
    action->setIcon(QPixmap(mPrefix + "chat.png"));
    action->hide();

    connect(action, SIGNAL(clicked()), this, SLOT(spin()));

    mActions[action->name()] = action;

    action = new FriendItem(this);
    action->setPos(18, 100);
    action->setName("Webcam");
    action->setIcon(QPixmap(mPrefix + "webcam.png"));
    action->hide();

    connect(action, SIGNAL(clicked()), this, SLOT(spin()));

    mActions[action->name()] = action;

    action = new FriendItem(this);
    action->setPos(18, 150);
    action->setName("Blog");
    action->setIcon(QPixmap(mPrefix + "blog.png"));
    action->hide();

    connect(action, SIGNAL(clicked()), this, SLOT(spin()));

    mActions[action->name()] = action;

    action = new FriendItem(this);
    action->setPos(18, 200);
    action->setName("Twitter");
    action->setIcon(QPixmap(mPrefix + "twitter.png"));
    action->hide();

    connect(action, SIGNAL(clicked()), this, SLOT(spin()));

    mActions[action->name()] = action;

    m_main_bg = QImage(mPrefix + "default.png");
}
Ejemplo n.º 21
0
VirtualConsole::VirtualConsole(QWidget* parent, Doc* doc)
    : QWidget(parent)
    , m_doc(doc)

    , m_editAction(EditNone)
    , m_toolbar(NULL)

    , m_addActionGroup(NULL)
    , m_editActionGroup(NULL)
    , m_bgActionGroup(NULL)
    , m_fgActionGroup(NULL)
    , m_fontActionGroup(NULL)
    , m_frameActionGroup(NULL)
    , m_stackingActionGroup(NULL)

    , m_addButtonAction(NULL)
    , m_addButtonMatrixAction(NULL)
    , m_addSliderAction(NULL)
    , m_addSliderMatrixAction(NULL)
    , m_addSpeedDialAction(NULL)
    , m_addXYPadAction(NULL)
    , m_addCueListAction(NULL)
    , m_addFrameAction(NULL)
    , m_addSoloFrameAction(NULL)
    , m_addLabelAction(NULL)

    , m_toolsSettingsAction(NULL)

    , m_editCutAction(NULL)
    , m_editCopyAction(NULL)
    , m_editPasteAction(NULL)
    , m_editDeleteAction(NULL)
    , m_editPropertiesAction(NULL)
    , m_editRenameAction(NULL)

    , m_bgColorAction(NULL)
    , m_bgImageAction(NULL)
    , m_bgDefaultAction(NULL)

    , m_fgColorAction(NULL)
    , m_fgDefaultAction(NULL)

    , m_fontAction(NULL)
    , m_resetFontAction(NULL)

    , m_frameSunkenAction(NULL)
    , m_frameRaisedAction(NULL)
    , m_frameNoneAction(NULL)

    , m_stackingRaiseAction(NULL)
    , m_stackingLowerAction(NULL)

    , m_customMenu(NULL)
    , m_editMenu(NULL)
    , m_addMenu(NULL)

    , m_dockArea(NULL)
    , m_contentsLayout(NULL)
    , m_scrollArea(NULL)
    , m_contents(NULL)

    , m_tapModifierDown(false)
{
    Q_ASSERT(s_instance == NULL);
    s_instance = this;

    Q_ASSERT(doc != NULL);

    /* Main layout */
    new QHBoxLayout(this);
    layout()->setMargin(1);
    layout()->setSpacing(1);

    initActions();
    initDockArea();
    m_contentsLayout = new QVBoxLayout;
    layout()->addItem(m_contentsLayout);
    initMenuBar();
    initContents();

    // Propagate mode changes to all widgets
    connect(m_doc, SIGNAL(modeChanged(Doc::Mode)),
            this, SLOT(slotModeChanged(Doc::Mode)));

    // Use the initial mode
    slotModeChanged(m_doc->mode());

    // Nothing is selected
    updateActions();
}
Ejemplo n.º 22
0
ScriptEdit::ScriptEdit(ScriptingEnv *env, QWidget *parent, const char *name)
  : QTextEdit(parent, name), scripted(env), d_error(false), d_completer(0),
  d_file_name(QString::null), d_search_string(QString::null), d_output_widget(NULL)
{
	myScript = scriptEnv->newScript("", this, name);
	connect(myScript, SIGNAL(error(const QString&, const QString&, int)), this, SLOT(insertErrorMsg(const QString&)));
	connect(myScript, SIGNAL(print(const QString&)), this, SLOT(scriptPrint(const QString&)));
	connect(myScript, SIGNAL(error(const QString&, const QString&, int)),
			this, SIGNAL(error(const QString&, const QString&, int)));

	setLineWrapMode(NoWrap);
	setUndoRedoEnabled(true);
	setTextFormat(Qt::PlainText);
	setAcceptRichText (false);

#ifdef SCRIPTING_PYTHON
	if (scriptEnv->name() == QString("Python"))
		d_highlighter = new PythonSyntaxHighlighter(this);
	else
		d_highlighter = NULL;
#endif

	d_fmt_default.setBackground(palette().brush(QPalette::Base));

	printCursor = textCursor();
	scriptsDirPath = qApp->applicationDirPath();

	actionExecute = new QAction(tr("E&xecute"), this);
	actionExecute->setShortcut( tr("Ctrl+J") );
	connect(actionExecute, SIGNAL(activated()), this, SLOT(execute()));

	actionExecuteAll = new QAction(tr("Execute &All"), this);
	actionExecuteAll->setShortcut( tr("Ctrl+Shift+J") );
	connect(actionExecuteAll, SIGNAL(activated()), this, SLOT(executeAll()));

	actionEval = new QAction(tr("&Evaluate Expression"), this);
	actionEval->setShortcut( tr("Ctrl+Return") );
	connect(actionEval, SIGNAL(activated()), this, SLOT(evaluate()));

	actionPrint = new QAction(QPixmap(fileprint_xpm), tr("&Print"), this);
	connect(actionPrint, SIGNAL(activated()), this, SLOT(print()));

	actionImport = new QAction(tr("&Import..."), this);
	actionImport->setShortcut(QKeySequence(Qt::CTRL+Qt::ALT+Qt::Key_O));
	connect(actionImport, SIGNAL(activated()), this, SLOT(importASCII()));

	QShortcut *accelImport = new QShortcut(actionImport->shortcut(), this);
	connect(accelImport, SIGNAL(activated()), this, SLOT(importASCII()));

	actionSave = new QAction(QPixmap(filesave_xpm), tr("&Save"), this);
	actionSave->setShortcut(QKeySequence(Qt::CTRL+Qt::ALT+Qt::Key_S));
	connect(actionSave, SIGNAL(activated()), this, SLOT(save()));

	QShortcut *accelSave = new QShortcut(actionSave->shortcut(), this);
	connect(accelSave, SIGNAL(activated()), this, SLOT(save()));

	actionExport = new QAction(QIcon(QPixmap(filesaveas_xpm)), tr("Sa&ve as..."), this);
	connect(actionExport, SIGNAL(activated()), this, SLOT(exportASCII()));

	actionFind = new QAction(QPixmap(find_xpm), tr("&Find..."), this);
	actionFind->setShortcut(QKeySequence(Qt::CTRL+Qt::ALT+Qt::Key_F));
	connect(actionFind, SIGNAL(activated()), this, SLOT(showFindDialog()));

	QShortcut *accelFind = new QShortcut(actionFind->shortcut(), this);
	connect(accelFind, SIGNAL(activated()), this, SLOT(showFindDialog()));

	actionReplace = new QAction(tr("&Replace..."), this);
	actionReplace->setShortcut(QKeySequence(Qt::CTRL+Qt::ALT+Qt::Key_R));
	connect(actionReplace, SIGNAL(activated()), this, SLOT(replace()));

	QShortcut *accelReplace = new QShortcut(actionReplace->shortcut(), this);
	connect(accelReplace, SIGNAL(activated()), this, SLOT(replace()));

	actionFindNext = new QAction(tr("&Find next"), this);
	actionFindNext->setShortcut(QKeySequence(Qt::Key_F3));
	connect(actionFindNext, SIGNAL(activated()), this, SLOT(findNext()));

	QShortcut *accelFindNext = new QShortcut(actionFindNext->shortcut(), this);
	connect(accelFindNext, SIGNAL(activated()), this, SLOT(findNext()));

	actionFindPrevious = new QAction(tr("&Find previous"), this);
	actionFindPrevious->setShortcut(QKeySequence(Qt::Key_F4));
	connect(actionFindPrevious, SIGNAL(activated()), this, SLOT(findPrevious()));

	QShortcut *accelFindPrevious = new QShortcut(actionFindPrevious->shortcut(), this);
	connect(accelFindPrevious, SIGNAL(activated()), this, SLOT(findPrevious()));

	functionsMenu = new QMenu(this);
	Q_CHECK_PTR(functionsMenu);
	connect(functionsMenu, SIGNAL(triggered(QAction *)), this, SLOT(insertFunction(QAction *)));
}
Ejemplo n.º 23
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    copyFlag = false;
    ui->setupUi(this);
    setWindowIcon(QIcon(":/hd_32.ico"));

    QAction *newAction = new QAction(QIcon(":/new_32.ico"), tr("Новый проект"), this);
    QAction *saveAction = new QAction(QIcon(":/save_32.ico"), tr("Сохранить проект"), this);
    QAction *openAction = new QAction(QIcon(":/open_32.ico"), tr("Загрузить проект"), this);
    QAction *configAction = new QAction(QIcon(":/opts_32.ico"), tr("Общие настройки"), this);
    //QAction *printAction = new QAction(QIcon(":/edit_32.ico"), tr("Строки и переменные в текстовый файл"), this);
    QAction *plcToAction = new QAction(QIcon(":/impt_32.ico"), tr("Загрузить в пульт"), this);
    QAction *plcFromAction = new QAction(QIcon(":/exp_32.ico"), tr("Прочитать из пульта"), this);
    QAction *varAct = new QAction(QIcon(":/apps_32.ico"), tr("Настройка переменных проекта"), this);
    QAction *aboutAction = new QAction(QIcon(":/about_32.ico"), tr("О программе"), this);
    connect(varAct, SIGNAL(triggered()), this, SLOT(varEdit()));
    connect(saveAction,SIGNAL(triggered()),this,SLOT(saveProject()));
    connect(newAction,SIGNAL(triggered()),this,SLOT(newProject()));
    connect(openAction,SIGNAL(triggered()),this,SLOT(openProject()));
    connect(configAction,SIGNAL(triggered()),this,SLOT(commonConfig()));
    connect(aboutAction,SIGNAL(triggered()),this,SLOT(aboutWindow()));
    connect(plcToAction, SIGNAL(triggered()), this, SLOT(dataToPLC()));

    ui->mainToolBar->addAction(newAction);
    ui->mainToolBar->addAction(saveAction);
    ui->mainToolBar->addAction(openAction);
    ui->mainToolBar->addSeparator();
    ui->mainToolBar->addAction(configAction);
    ui->mainToolBar->addAction(varAct);
    ui->mainToolBar->addSeparator();
    ui->mainToolBar->addAction(plcToAction);
    ui->mainToolBar->addAction(plcFromAction);
    ui->mainToolBar->addSeparator();
    ui->mainToolBar->addAction(aboutAction);
    //ui->mainToolBar->addSeparator();
    //ui->mainToolBar->addAction(printAction);

    Settings conf;
    vars = conf.readVars();
    font = conf.readFont();
    DisplayData* lcdData = conf.readDisplay();
    lcd = new Display(lcdData);


    QVBoxLayout *layout = new QVBoxLayout;

    display = new LcdWidget(lcd);
    display->setFont(font);
    display->setVars(vars);

    connect(display,SIGNAL(updateMessage(QString)),this,SLOT(updateVarMessage(QString)));
    connect(display,SIGNAL(copyStr(unsigned char,uint)),this,SLOT(displayCopy(unsigned char,uint)));
    connect(display,SIGNAL(pasteStr(unsigned char,uint)),this,SLOT(displayReplace(unsigned char,uint)));

    layout->addWidget(display);

    listOfRows1 = new QListWidget();listOfRows1->setMinimumHeight(display->height()*1.5);
    listOfRows2 = new QListWidget();
    listOfRows3 = new QListWidget();
    listOfRows4 = new QListWidget();

    fillLists(lcdData);

    QHBoxLayout *listLayout = new QHBoxLayout;

    listLayout->addWidget(listOfRows1);
    listLayout->addWidget(listOfRows2);
    listLayout->addWidget(listOfRows3);
    listLayout->addWidget(listOfRows4);

    layout->addLayout(listLayout);

    layout->addStretch();

    setCentralWidget(new QWidget);
    centralWidget()->setLayout(layout);

    connect(display,SIGNAL(updateString(DisplayData*)),this,SLOT(fillLists(DisplayData*)));
    connect(listOfRows1,SIGNAL(clicked(QModelIndex)),this,SLOT(str1Changed(QModelIndex)));
    connect(listOfRows2,SIGNAL(clicked(QModelIndex)),this,SLOT(str2Changed(QModelIndex)));
    connect(listOfRows3,SIGNAL(clicked(QModelIndex)),this,SLOT(str3Changed(QModelIndex)));
    connect(listOfRows4,SIGNAL(clicked(QModelIndex)),this,SLOT(str4Changed(QModelIndex)));

    QMenu* contextMenu1 = new QMenu(listOfRows1);
    listOfRows1->setContextMenuPolicy(Qt::ActionsContextMenu);
    QAction* addBefore1 = new QAction(QIcon(":/up_32.ico"),"Добавить строку перед",contextMenu1);
    QAction* addAfter1 = new QAction(QIcon(":/down_32.ico"),"Добавить строку после",contextMenu1);
    QAction* copy1 = new QAction(QIcon(":/copy_32.ico"),"Копировать строку в буфер",contextMenu1);
    QAction* replace1 = new QAction(QIcon(":/paste_32.ico"),"Заменить на строку из буфера",contextMenu1);
    QAction* delete1 = new QAction(QIcon(":/trash_32.ico"),"Удалить строку",contextMenu1);
    listOfRows1->addAction(addBefore1);
    listOfRows1->addAction(addAfter1);
    listOfRows1->addAction(copy1);
    listOfRows1->addAction(replace1);
    listOfRows1->addAction(delete1);
    connect(addBefore1,SIGNAL(triggered()),this,SLOT(str1AddBefore()));
    connect(addAfter1,SIGNAL(triggered()),this,SLOT(str1AddAfter()));
    connect(copy1,SIGNAL(triggered()),this,SLOT(str1Copy()));
    connect(replace1,SIGNAL(triggered()),this,SLOT(str1Replace()));
    connect(delete1,SIGNAL(triggered()),this,SLOT(str1Delete()));

    QMenu* contextMenu2 = new QMenu(listOfRows2);
    listOfRows2->setContextMenuPolicy(Qt::ActionsContextMenu);
    QAction* addBefore2 = new QAction(QIcon(":/up_32.ico"),"Добавить строку перед",contextMenu2);
    QAction* addAfter2 = new QAction(QIcon(":/down_32.ico"),"Добавить строку после",contextMenu2);
    QAction* copy2 = new QAction(QIcon(":/copy_32.ico"),"Копировать строку в буфер",contextMenu2);
    QAction* replace2 = new QAction(QIcon(":/paste_32.ico"),"Заменить на строку из буфера",contextMenu2);
    QAction* delete2 = new QAction(QIcon(":/trash_32.ico"),"Удалить строку",contextMenu2);
    listOfRows2->addAction(addBefore2);
    listOfRows2->addAction(addAfter2);
    listOfRows2->addAction(copy2);
    listOfRows2->addAction(replace2);
    listOfRows2->addAction(delete2);
    connect(addBefore2,SIGNAL(triggered()),this,SLOT(str2AddBefore()));
    connect(addAfter2,SIGNAL(triggered()),this,SLOT(str2AddAfter()));
    connect(copy2,SIGNAL(triggered()),this,SLOT(str2Copy()));
    connect(replace2,SIGNAL(triggered()),this,SLOT(str2Replace()));
    connect(delete2,SIGNAL(triggered()),this,SLOT(str2Delete()));

    QMenu* contextMenu3 = new QMenu(listOfRows3);
    listOfRows3->setContextMenuPolicy(Qt::ActionsContextMenu);
    QAction* addBefore3 = new QAction(QIcon(":/up_32.ico"),"Добавить строку перед",contextMenu3);
    QAction* addAfter3 = new QAction(QIcon(":/down_32.ico"),"Добавить строку после",contextMenu3);
    QAction* copy3 = new QAction(QIcon(":/copy_32.ico"),"Копировать строку в буфер",contextMenu3);
    QAction* replace3 = new QAction(QIcon(":/paste_32.ico"),"Заменить на строку из буфера",contextMenu3);
    QAction* delete3 = new QAction(QIcon(":/trash_32.ico"),"Удалить строку",contextMenu3);
    listOfRows3->addAction(addBefore3);
    listOfRows3->addAction(addAfter3);
    listOfRows3->addAction(copy3);
    listOfRows3->addAction(replace3);
    listOfRows3->addAction(delete3);
    connect(addBefore3,SIGNAL(triggered()),this,SLOT(str3AddBefore()));
    connect(addAfter3,SIGNAL(triggered()),this,SLOT(str3AddAfter()));
    connect(copy3,SIGNAL(triggered()),this,SLOT(str3Copy()));
    connect(replace3,SIGNAL(triggered()),this,SLOT(str3Replace()));
    connect(delete3,SIGNAL(triggered()),this,SLOT(str3Delete()));

    QMenu* contextMenu4 = new QMenu(listOfRows4);
    listOfRows4->setContextMenuPolicy(Qt::ActionsContextMenu);
    QAction* addBefore4 = new QAction(QIcon(":/up_32.ico"),"Добавить строку перед",contextMenu4);
    QAction* addAfter4 = new QAction(QIcon(":/down_32.ico"),"Добавить строку после",contextMenu4);
    QAction* copy4 = new QAction(QIcon(":/copy_32.ico"),"Копировать строку в буфер",contextMenu4);
    QAction* replace4 = new QAction(QIcon(":/paste_32.ico"),"Заменить на строку из буфера",contextMenu4);
    QAction* delete4 = new QAction(QIcon(":/trash_32.ico"),"Удалить строку",contextMenu4);
    listOfRows4->addAction(addBefore4);
    listOfRows4->addAction(addAfter4);
    listOfRows4->addAction(copy4);
    listOfRows4->addAction(replace4);
    listOfRows4->addAction(delete4);
    connect(addBefore4,SIGNAL(triggered()),this,SLOT(str4AddBefore()));
    connect(addAfter4,SIGNAL(triggered()),this,SLOT(str4AddAfter()));
    connect(copy4,SIGNAL(triggered()),this,SLOT(str4Copy()));
    connect(replace4,SIGNAL(triggered()),this,SLOT(str4Replace()));
    connect(delete4,SIGNAL(triggered()),this,SLOT(str4Delete()));

    display->setFocus();

}
Ejemplo n.º 24
0
MousePluginWidget::MousePluginWidget(const QString &pluginName, const QString &trigger, QGridLayout *layoutHack, QWidget *parent)
    : QObject(parent),
      m_configDlg(0),
      m_containment(0),
      m_lastConfigLocation(trigger),
      m_tempConfigParent(QString(), KConfig::SimpleConfig)
{
    KPluginInfo::List plugins = Plasma::ContainmentActions::listContainmentActionsInfo();
    if (plugins.isEmpty()) {
        //panic!!
        QLabel *fail = new QLabel(i18n("No plugins found, check your installation."), parent);
        layoutHack->addWidget(fail, 0, 0);
        return;
    }

    //make us some widgets
    m_pluginList = new QComboBox(parent);
    m_aboutButton = new QToolButton(parent);
    m_clearButton = new QToolButton(parent);
    m_triggerButton = new MouseInputButton(parent);
    m_configButton = new QToolButton(parent);
    //m_ui.description->setText(plugin.comment());

    //plugin list
    //FIXME is there some way to share this across all the entries?
    foreach (const KPluginInfo& plugin, plugins) {
        if (plugin.property("NoDisplay").toBool()) {
            continue;
        }

        m_pluginList->addItem(KIcon(plugin.icon()), plugin.name(), QVariant::fromValue(plugin));
        if (plugin.pluginName() == pluginName) {
            m_pluginList->setCurrentIndex(m_pluginList->count() - 1);
            m_plugin = plugin;
        }
    }

    if (! m_plugin.isValid()) {
        //probably an empty string; pick the first one
        m_pluginList->setCurrentIndex(0);
        m_plugin = plugins.first();
    }

    //I can haz config?
    m_tempConfig = KConfigGroup(&m_tempConfigParent, "test");
    if (!m_plugin.property("X-Plasma-HasConfigurationInterface").toBool()) {
        m_configButton->setVisible(false);
    }

    setTrigger(trigger);

    //pretty icons for the buttons
    m_aboutButton->setIcon(KIcon("dialog-information"));
    m_aboutButton->setToolTip(i18nc("About mouse action", "About"));
    m_triggerButton->setIcon(KIcon("input-mouse"));
    m_configButton->setIcon(KIcon("configure"));
    m_configButton->setToolTip(i18nc("Configure mouse action", "Configure"));
    m_clearButton->setIcon(KIcon("list-remove"));
    m_clearButton->setToolTip(i18nc("Remove mouse action", "Remove"));

    //HACK
    //FIXME what's the Right Way to do this?
    int row = layoutHack->rowCount();
    layoutHack->addWidget(m_triggerButton, row, 0);
    layoutHack->addWidget(m_pluginList, row, 1);
    layoutHack->addWidget(m_configButton, row, 2);
    layoutHack->addWidget(m_aboutButton, row, 3);
    layoutHack->addWidget(m_clearButton, row, 4);

    //connect
    connect(m_pluginList, SIGNAL(currentIndexChanged(int)), this, SLOT(setPlugin(int)));
    connect(m_triggerButton, SIGNAL(triggerChanged(QString,QString)), this, SLOT(changeTrigger(QString,QString)));
    connect(m_configButton, SIGNAL(clicked()), this, SLOT(configure()));
    connect(m_clearButton, SIGNAL(clicked()), this, SLOT(clearTrigger()));
    connect(m_aboutButton, SIGNAL(clicked()), this, SLOT(showAbout()));
}
AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AddressBookPage),
    model(0),
    optionsModel(0),
    mode(mode),
    tab(tab)
{
    ui->setupUi(this);

#ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac
    ui->newAddress->setIcon(QIcon());
    ui->copyAddress->setIcon(QIcon());
    ui->deleteAddress->setIcon(QIcon());
    ui->verifyMessage->setIcon(QIcon());
    ui->signMessage->setIcon(QIcon());
    ui->exportButton->setIcon(QIcon());
#endif

#ifndef USE_QRCODE
    ui->showQRCode->setVisible(false);
#endif

    switch(mode)
    {
    case ForSending:
        connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(accept()));
        ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
        ui->tableView->setFocus();
        ui->exportButton->hide();
        break;
    case ForEditing:
        ui->buttonBox->setVisible(false);
        break;
    }
    switch(tab)
    {
    case SendingTab:
        ui->labelExplanation->setText(tr("These are your ChickenBaconRanch addresses for sending payments. Always check the amount and the receiving address before sending coins."));
        ui->deleteAddress->setVisible(true);
        ui->signMessage->setVisible(false);
        break;
    case ReceivingTab:
        ui->labelExplanation->setText(tr("These are your ChickenBaconRanch addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you."));
        ui->deleteAddress->setVisible(false);
        ui->signMessage->setVisible(true);
        break;
    }

    // Context menu actions
    QAction *copyAddressAction = new QAction(ui->copyAddress->text(), this);
    QAction *copyLabelAction = new QAction(tr("Copy &Label"), this);
    QAction *editAction = new QAction(tr("&Edit"), this);
    QAction *sendCoinsAction = new QAction(tr("Send &Coins"), this);
    QAction *showQRCodeAction = new QAction(ui->showQRCode->text(), this);
    QAction *signMessageAction = new QAction(ui->signMessage->text(), this);
    QAction *verifyMessageAction = new QAction(ui->verifyMessage->text(), this);
    deleteAction = new QAction(ui->deleteAddress->text(), this);

    // Build context menu
    contextMenu = new QMenu();
    contextMenu->addAction(copyAddressAction);
    contextMenu->addAction(copyLabelAction);
    contextMenu->addAction(editAction);
    if(tab == SendingTab)
        contextMenu->addAction(deleteAction);
    contextMenu->addSeparator();
    if(tab == SendingTab)
        contextMenu->addAction(sendCoinsAction);
#ifdef USE_QRCODE
    contextMenu->addAction(showQRCodeAction);
#endif
    if(tab == ReceivingTab)
        contextMenu->addAction(signMessageAction);
    else if(tab == SendingTab)
        contextMenu->addAction(verifyMessageAction);

    // Connect signals for context menu actions
    connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(on_copyAddress_clicked()));
    connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(onCopyLabelAction()));
    connect(editAction, SIGNAL(triggered()), this, SLOT(onEditAction()));
    connect(deleteAction, SIGNAL(triggered()), this, SLOT(on_deleteAddress_clicked()));
    connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(onSendCoinsAction()));
    connect(showQRCodeAction, SIGNAL(triggered()), this, SLOT(on_showQRCode_clicked()));
    connect(signMessageAction, SIGNAL(triggered()), this, SLOT(on_signMessage_clicked()));
    connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(on_verifyMessage_clicked()));

    connect(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));

    // Pass through accept action from button box
    connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
}
QalfModeratorWidget::QalfModeratorWidget(QWidget * parent) : QWidget(parent) {
	vlayout = new QVBoxLayout(this) ;

	noKeySetLabel = new QLabel() ;
	noKeySetLabel->setWordWrap(true) ;
	vlayout->addWidget(noKeySetLabel) ;

	// file path
	fileLabel = new QLabel(tr("File :")) ;
	fileValue = new QLineEdit(QString("/home/alf/tentative_de.ogg")) ;
	openFileButton = new QPushButton(QIcon(":/icons/folder_open.png"),QString()) ;
	connect(openFileButton,SIGNAL(clicked()),this,SLOT(openFile())) ;
	fileLayout = new QHBoxLayout() ;
	fileLayout->addWidget(fileLabel) ;
	fileLayout->addWidget(fileValue) ;
	fileLayout->addWidget(openFileButton) ;

	vlayout->addLayout(fileLayout) ;

	// general informations
	infoBox = new QGroupBox(tr("Informations about file")) ;
	QGridLayout *  infoLayout = new QGridLayout() ;
	titleLabel = new QLabel(tr("title :")) ;
	titleValue = new QLineEdit("Tentative de") ;
	authorsLabel = new QLabel(tr("authors :")) ;
	authorsValue = new QLineEdit("VoX") ;
	licenseLabel = new QLabel(tr("license :")) ;
	licenseValue = new QComboBox() ;
	keywordsLabel = new QLabel(tr("keywords :")) ;
	keywordsValue = new QLineEdit("VoX") ;
	infoLayout->addWidget(titleLabel,0,0) ;
	infoLayout->addWidget(titleValue,0,1) ;
	infoLayout->addWidget(authorsLabel,1,0) ;
	infoLayout->addWidget(authorsValue,1,1) ;
	infoLayout->addWidget(licenseLabel,0,3) ;
	infoLayout->addWidget(licenseValue,0,4) ;
	infoLayout->addWidget(keywordsLabel,1,3) ;
	infoLayout->addWidget(keywordsValue,1,4) ;
	infoLayout->setColumnMinimumWidth(2,25) ;
	infoLayout->setRowStretch(2,1) ;
	infoLayout->setColumnStretch(0,0) ;
	infoLayout->setColumnStretch(1,2) ;
	infoLayout->setColumnStretch(2,0) ;
	infoLayout->setColumnStretch(3,0) ;
	infoLayout->setColumnStretch(4,1) ;
	infoBox->setLayout(infoLayout);
	vlayout->addWidget(infoBox) ;

	// medium specific
	mediumBox = new QGroupBox(tr("Informations specific to medium")) ;
	QVBoxLayout * mediumLayout = new QVBoxLayout() ;
	
	mediumInfo = new QStackedWidget() ;
	mediumInfo->addWidget(new QalfImageInfoWidget()) ;
	mediumLayout->addWidget(mediumInfo) ;

	mediumBox->setLayout(mediumLayout) ;
	
	vlayout->addWidget(mediumBox) ;

	vlayout->addStretch(1) ;

	QSize iconSize(22,22) ;
	sendButton = new QPushButton(tr("Send torrent")) ;
	sendButton->setIcon(QIcon(":/icons/vcs_add.png")) ;
	sendButton->setIconSize(iconSize) ;
	connect(sendButton,SIGNAL(clicked()),this,SLOT(sendTorrent())) ;
	buttonLayout = new QHBoxLayout() ;
	buttonLayout->addStretch() ;
	buttonLayout->addWidget(sendButton) ;
	vlayout->addLayout(buttonLayout) ;
	setLayout(vlayout) ;
	switchToNokey() ;
	checkKey() ;
}
Ejemplo n.º 27
0
	tickerOnly=tickOnly;
	if(!tickerOnly)
	{
	connect(mainClass,SIGNAL(reloadOrders()),this,SLOT(reloadOrders()));
	connect(mainClass,SIGNAL(apiBuy(double, double)),this,SLOT(buy(double, double)));
	connect(mainClass,SIGNAL(apiSell(double, double)),this,SLOT(sell(double, double)));
	connect(mainClass,SIGNAL(cancelOrderByOid(QByteArray)),this,SLOT(cancelOrder(QByteArray)));
	connect(this,SIGNAL(ordersChanged(QString)),mainClass,SLOT(ordersChanged(QString)));
	connect(mainClass,SIGNAL(cancelOrderByOid(QByteArray)),this,SLOT(cancelOrder(QByteArray)));
	connect(mainClass,SIGNAL(getHistory(bool)),this,SLOT(getHistory(bool)));
	connect(this,SIGNAL(ordersLogChanged(QString)),mainClass,SLOT(ordersLogChanged(QString)));
	connect(this,SIGNAL(orderCanceled(QByteArray)),mainClass,SLOT(orderCanceled(QByteArray)));
	connect(this,SIGNAL(ordersIsEmpty()),mainClass,SLOT(ordersIsEmpty()));
	}

	connect(this,SIGNAL(identificationRequired(QString)),mainClass,SLOT(identificationRequired(QString)));
	connect(this,SIGNAL(apiDownChanged(bool)),mainClass,SLOT(setApiDown(bool)));
	connect(this,SIGNAL(accLastSellChanged(QByteArray,double)),mainClass,SLOT(accLastSellChanged(QByteArray,double)));
	connect(this,SIGNAL(accLastBuyChanged(QByteArray,double)),mainClass,SLOT(accLastBuyChanged(QByteArray,double)));

	connect(mainClass,SIGNAL(clearValues()),this,SLOT(clearValues()));
	connect(this,SIGNAL(firstTicker()),mainClass,SLOT(firstTicker()));
	connect(this,SIGNAL(firstAccInfo()),mainClass,SLOT(firstAccInfo()));
	connect(this,SIGNAL(apiLagChanged(double)),mainClass->ui.lagValue,SLOT(setValue(double)));
	connect(this,SIGNAL(softLagChanged(int)),mainClass,SLOT(setSoftLagValue(int)));
	connect(this,SIGNAL(accVolumeChanged(double)),mainClass->ui.accountVolume,SLOT(setValue(double)));
	connect(this,SIGNAL(accFeeChanged(double)),mainClass->ui.accountFee,SLOT(setValue(double)));
	connect(this,SIGNAL(accBtcBalanceChanged(double)),mainClass->ui.accountBTC,SLOT(setValue(double)));
	connect(this,SIGNAL(accUsdBalanceChanged(double)),mainClass->ui.accountUSD,SLOT(setValue(double)));
	connect(this,SIGNAL(loginChanged(QString)),mainClass,SLOT(loginChanged(QString)));
Ejemplo n.º 28
0
SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::SendCoinsDialog),
    model(0)
{
    ui->setupUi(this);

#ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac
    ui->addButton->setIcon(QIcon());
    ui->clearButton->setIcon(QIcon());
    ui->sendButton->setIcon(QIcon());
#endif

#if QT_VERSION >= 0x040700
    /* Do not move this to the XML file, Qt before 4.7 will choke on it */
    ui->lineEditCoinControlChange->setPlaceholderText(tr("Enter a Loancoin address (e.g. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)"));
#endif

    addEntry();

    connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addEntry()));
    connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear()));

    // Coin Control
    ui->lineEditCoinControlChange->setFont(GUIUtil::bitcoinAddressFont());
    connect(ui->pushButtonCoinControl, SIGNAL(clicked()), this, SLOT(coinControlButtonClicked()));
    connect(ui->checkBoxCoinControlChange, SIGNAL(stateChanged(int)), this, SLOT(coinControlChangeChecked(int)));
    connect(ui->lineEditCoinControlChange, SIGNAL(textEdited(const QString &)), this, SLOT(coinControlChangeEdited(const QString &)));

    // Coin Control: clipboard actions
    QAction *clipboardQuantityAction = new QAction(tr("Copy quantity"), this);
    QAction *clipboardAmountAction = new QAction(tr("Copy amount"), this);
    QAction *clipboardFeeAction = new QAction(tr("Copy fee"), this);
    QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this);
    QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this);
    QAction *clipboardPriorityAction = new QAction(tr("Copy priority"), this);
    QAction *clipboardLowOutputAction = new QAction(tr("Copy low output"), this);
    QAction *clipboardChangeAction = new QAction(tr("Copy change"), this);
    connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardQuantity()));
    connect(clipboardAmountAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardAmount()));
    connect(clipboardFeeAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardFee()));
    connect(clipboardAfterFeeAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardAfterFee()));
    connect(clipboardBytesAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardBytes()));
    connect(clipboardPriorityAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardPriority()));
    connect(clipboardLowOutputAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardLowOutput()));
    connect(clipboardChangeAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardChange()));
    ui->labelCoinControlQuantity->addAction(clipboardQuantityAction);
    ui->labelCoinControlAmount->addAction(clipboardAmountAction);
    ui->labelCoinControlFee->addAction(clipboardFeeAction);
    ui->labelCoinControlAfterFee->addAction(clipboardAfterFeeAction);
    ui->labelCoinControlBytes->addAction(clipboardBytesAction);
    ui->labelCoinControlPriority->addAction(clipboardPriorityAction);
    ui->labelCoinControlLowOutput->addAction(clipboardLowOutputAction);
    ui->labelCoinControlChange->addAction(clipboardChangeAction);

    fNewRecipientAllowed = true;
}
Ejemplo n.º 29
0
FormEditorWidget::FormEditorWidget(FormEditorView *view)
    : QWidget(),
    m_formEditorView(view)
{
    setStyleSheet(QLatin1String(Utils::FileReader::fetchQrc(":/qmldesigner/formeditorstylesheet.css")));

    QVBoxLayout *fillLayout = new QVBoxLayout(this);
    fillLayout->setMargin(0);
    fillLayout->setSpacing(0);
    setLayout(fillLayout);

    QList<QAction*> upperActions;

    m_toolActionGroup = new QActionGroup(this);

    m_transformToolAction = m_toolActionGroup->addAction("Transform Tool (Press Key Q)");
    m_transformToolAction->setShortcut(Qt::Key_Q);
    m_transformToolAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
    m_transformToolAction->setCheckable(true);
    m_transformToolAction->setChecked(true);
    m_transformToolAction->setIcon(QPixmap(":/icon/tool/transform.png"));
    connect(m_transformToolAction.data(), SIGNAL(triggered(bool)), SLOT(changeTransformTool(bool)));

    m_anchorToolAction = m_toolActionGroup->addAction("Anchor Tool (Press Key W)");
    m_anchorToolAction->setShortcut(Qt::Key_W);
    m_anchorToolAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
    m_anchorToolAction->setCheckable(true);
    m_anchorToolAction->setIcon(QPixmap(":/icon/tool/anchor.png"));
    connect(m_anchorToolAction.data(), SIGNAL(triggered(bool)), SLOT(changeAnchorTool(bool)));

//    addActions(m_toolActionGroup->actions());
//    upperActions.append(m_toolActionGroup->actions());

    QActionGroup *layoutActionGroup = new QActionGroup(this);
    layoutActionGroup->setExclusive(false);
    m_snappingAction = layoutActionGroup->addAction(tr("Snap to guides (E)"));
    m_snappingAction->setShortcut(Qt::Key_E);
    m_snappingAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
    m_snappingAction->setCheckable(true);
    m_snappingAction->setChecked(true);
    m_snappingAction->setIcon(QPixmap(":/icon/layout/snapping.png"));

    m_snappingAndAnchoringAction = layoutActionGroup->addAction("Toogle Snapping And Anchoring (Press Key R)");
    m_snappingAndAnchoringAction->setShortcut(Qt::Key_R);
    m_snappingAndAnchoringAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
    m_snappingAndAnchoringAction->setCheckable(true);
    m_snappingAndAnchoringAction->setChecked(false);
    m_snappingAndAnchoringAction->setEnabled(false);
    m_snappingAndAnchoringAction->setVisible(false);
    m_snappingAndAnchoringAction->setIcon(QPixmap(":/icon/layout/snapping_and_anchoring.png"));

    addActions(layoutActionGroup->actions());
    upperActions.append(layoutActionGroup->actions());

    QAction *separatorAction = new QAction(this);
    separatorAction->setSeparator(true);
    addAction(separatorAction);
    upperActions.append(separatorAction);

    m_showBoundingRectAction = new QAction(tr("Show bounding rectangles and stripes for empty items (Press Key A)"), this);
    m_showBoundingRectAction->setShortcut(Qt::Key_A);
    m_showBoundingRectAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
    m_showBoundingRectAction->setCheckable(true);
    m_showBoundingRectAction->setChecked(true);
    m_showBoundingRectAction->setIcon(QPixmap(":/icon/layout/boundingrect.png"));

    addAction(m_showBoundingRectAction.data());
    upperActions.append(m_showBoundingRectAction.data());

    m_selectOnlyContentItemsAction = new QAction(tr("Only select items with content (S)"), this);
    m_selectOnlyContentItemsAction->setShortcut(Qt::Key_S);
    m_selectOnlyContentItemsAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
    m_selectOnlyContentItemsAction->setCheckable(true);
    m_selectOnlyContentItemsAction->setChecked(false);
    m_selectOnlyContentItemsAction->setIcon(QPixmap(":/icon/selection/selectonlycontentitems.png"));

    addAction(m_selectOnlyContentItemsAction.data());
    upperActions.append(m_selectOnlyContentItemsAction.data());

    m_rootWidthAction = new LineEditAction(tr("width"), this);
    connect(m_rootWidthAction.data(), SIGNAL(textChanged(QString)), this, SLOT(changeRootItemWidth(QString)));
    addAction(m_rootWidthAction.data());
    upperActions.append(m_rootWidthAction.data());

    m_rootHeightAction =  new LineEditAction(tr("height"), this);
    connect(m_rootHeightAction.data(), SIGNAL(textChanged(QString)), this, SLOT(changeRootItemHeight(QString)));
    addAction(m_rootHeightAction.data());
    upperActions.append(m_rootHeightAction.data());

    m_snappingAndAnchoringAction = layoutActionGroup->addAction("Toogle Snapping And Anchoring (Press Key R)");

    m_toolBox = new ToolBox(this);
    fillLayout->addWidget(m_toolBox.data());
    m_toolBox->setLeftSideActions(upperActions);

    m_graphicsView = new FormEditorGraphicsView(this);
    fillLayout->addWidget(m_graphicsView.data());

    m_graphicsView.data()->setStyleSheet(
            QLatin1String(Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css")));

    QList<QAction*> lowerActions;

    m_zoomAction = new ZoomAction(m_toolActionGroup.data());
    connect(m_zoomAction.data(), SIGNAL(zoomLevelChanged(double)), SLOT(setZoomLevel(double)));
    addAction(m_zoomAction.data());
    upperActions.append(m_zoomAction.data());
    m_toolBox->addRightSideAction(m_zoomAction.data());

    m_resetAction = new QAction(tr("Reset view (R)"), this);
    m_resetAction->setShortcut(Qt::Key_R);
    m_resetAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
    m_resetAction->setIcon(QPixmap(":/icon/reset.png"));
    connect(m_resetAction.data(), SIGNAL(triggered(bool)), this, SLOT(resetNodeInstanceView()));
    addAction(m_resetAction.data());
    upperActions.append(m_resetAction.data());
    m_toolBox->addRightSideAction(m_resetAction.data());
}
Ejemplo n.º 30
0
     
     if (canedit && format == DIV_ABSOLUTE ) {
     slider = new Rotater(Rotate,event->widget());
     widgetslider = new QWidgetAction(event->widget());
     widgetslider->setDefaultWidget(slider);
     RootMenu->addAction(widgetslider); 
     connect(slider, SIGNAL(rotater(int)),this, SLOT(RotateLayer(int)));
         
     
     }
     
     actionSwapLock = new QAction(tr("Lock Unlock Layer"),this);
     actionSwapLock->setIcon( W_modus() == Lock ? QIcon(":/img/encrypted.png") : QIcon(":/img/unlock.png"));
     actionSwapLock->setCheckable(true);
     actionSwapLock->setChecked ( W_modus() == Lock ? true : false );
     connect(actionSwapLock, SIGNAL(triggered()),this,SLOT(SwapLockmodus()));
     RootMenu->addAction(actionSwapLock);
     
 
 
 
 
 a = RootMenu->addAction(tr("Register commit layer now"), this, SLOT(CommitLayer()));
 a->setIcon(QIcon(":/img/html_div.png"));
 if (canedit) {
 QMenu *DocRevision = new QMenu(tr("Revision History"),event->widget());
 DocRevision->setIcon(QIcon(":/img/html_div.png"));
     int longs = 0;
              QMapIterator<uint,QString> i(history);
              while (i.hasNext()) {
                  i.next();