Ejemplo n.º 1
0
static int lua_FlowLayout_addRef(lua_State* state)
{
    // Get the number of parameters.
    int paramCount = lua_gettop(state);

    // Attempt to match the parameters to a valid binding.
    switch (paramCount)
    {
        case 1:
        {
            if ((lua_type(state, 1) == LUA_TUSERDATA))
            {
                FlowLayout* instance = getInstance(state);
                instance->addRef();
                
                return 0;
            }

            lua_pushstring(state, "lua_FlowLayout_addRef - Failed to match the given parameters to a valid function signature.");
            lua_error(state);
            break;
        }
        default:
        {
            lua_pushstring(state, "Invalid number of parameters (expected 1).");
            lua_error(state);
            break;
        }
    }
    return 0;
}
Ejemplo n.º 2
0
AddressRowWidget::AddressRowWidget(QWidget *parent, const QString &headerName,
                                   const QList<Imap::Message::MailAddress> &addresses, MessageView *messageView):
    QWidget(parent)
{
    FlowLayout *lay = new FlowLayout(this, 0, 0, -1);
    setLayout(lay);

    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);

#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
    const QString &headerNameEscaped = Qt::escape(headerName);
#else
    const QString &headerNameEscaped = headerName.toHtmlEscaped();
#endif

    QLabel *title = new QLabel(QString::fromUtf8("<b>%1:</b>").arg(headerNameEscaped), this);
    title->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    title->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
    lay->addWidget(title);
    for (int i = 0; i < addresses.size(); ++i) {
        QWidget *w = new OneEnvelopeAddress(this, addresses[i], messageView,
                                            i == addresses.size() - 1 ?
                                                OneEnvelopeAddress::Position::Last :
                                                OneEnvelopeAddress::Position::Middle);
        lay->addWidget(w);
    }
}
Ejemplo n.º 3
0
static int lua_FlowLayout_getHorizontalSpacing(lua_State* state)
{
    // Get the number of parameters.
    int paramCount = lua_gettop(state);

    // Attempt to match the parameters to a valid binding.
    switch (paramCount)
    {
        case 1:
        {
            if ((lua_type(state, 1) == LUA_TUSERDATA))
            {
                FlowLayout* instance = getInstance(state);
                int result = instance->getHorizontalSpacing();

                // Push the return value onto the stack.
                lua_pushinteger(state, result);

                return 1;
            }

            lua_pushstring(state, "lua_FlowLayout_getHorizontalSpacing - Failed to match the given parameters to a valid function signature.");
            lua_error(state);
            break;
        }
        default:
        {
            lua_pushstring(state, "Invalid number of parameters (expected 1).");
            lua_error(state);
            break;
        }
    }
    return 0;
}
Ejemplo n.º 4
0
CaptureDialog::CaptureDialog(CaptureContext *ctx, OnCaptureMethod captureCallback,
                             OnInjectMethod injectCallback, QWidget *parent)
    : QFrame(parent), ui(new Ui::CaptureDialog), m_Ctx(ctx)
{
  ui->setupUi(this);

  // setup FlowLayout for options group
  {
    QLayout *oldLayout = ui->optionsGroup->layout();

    QObjectList options = ui->optionsGroup->children();
    options.removeOne((QObject *)oldLayout);

    delete oldLayout;

    FlowLayout *optionsFlow = new FlowLayout(ui->optionsGroup, -1, 3, 3);

    optionsFlow->setFixedGrid(true);

    for(QObject *o : options)
      optionsFlow->addWidget(qobject_cast<QWidget *>(o));

    ui->optionsGroup->setLayout(optionsFlow);
  }

  ui->envVar->setEnabled(false);

  m_ProcessModel = new QStandardItemModel(0, 3, this);

  m_ProcessModel->setHeaderData(0, Qt::Horizontal, tr("Name"));
  m_ProcessModel->setHeaderData(1, Qt::Horizontal, tr("PID"));
  m_ProcessModel->setHeaderData(2, Qt::Horizontal, tr("Window Title"));

  QSortFilterProxyModel *proxy = new QSortFilterProxyModel(this);

  proxy->setSourceModel(m_ProcessModel);
  // filter on all columns
  proxy->setFilterKeyColumn(-1);
  // allow updating the underlying model
  proxy->setDynamicSortFilter(true);

  ui->processList->setModel(proxy);
  ui->processList->setAlternatingRowColors(true);

  // sort by PID by default
  ui->processList->sortByColumn(1, Qt::AscendingOrder);

  // TODO Vulkan Layer
  ui->vulkanLayerWarn->setVisible(false);

  m_CaptureCallback = captureCallback;
  m_InjectCallback = injectCallback;

  setSettings(CaptureSettings());

  updateGlobalHook();
}
void FlowLayoutBase::execSyncV(      FieldContainer    &oFrom,
                                        ConstFieldMaskArg  whichField,
                                        AspectOffsetStore &oOffsets,
                                        ConstFieldMaskArg  syncMode,
                                  const UInt32             uiSyncInfo)
{
    FlowLayout *pThis = static_cast<FlowLayout *>(this);

    pThis->execSync(static_cast<FlowLayout *>(&oFrom),
                    whichField,
                    oOffsets,
                    syncMode,
                    uiSyncInfo);
}
Ejemplo n.º 6
0
int FlowLayout::widthForHeight( int h ) const
{
	if ( _cachedH != h )
	{
		//Not all C++ compilers support "mutable" yet:
		FlowLayout * mthis = (FlowLayout*)this;
		int w = mthis->doLayout( QRect(0,0,0,h), true );
		mthis->_cachedH = h;
		mthis->_cachedW = w;
		return w;
	}

	return _cachedW;
}
Ejemplo n.º 7
0
int FlowLayout::heightForWidth( int w ) const
{
	if ( _cachedW != w )
	{
		//Not all C++ compilers support "mutable" yet:
		FlowLayout * mthis = (FlowLayout*)this;
		int h = mthis->doLayout( QRect(0,0,w,0), true );
		mthis->_cachedH = h;
		mthis->_cachedW = w;
		return h;
	}

	return _cachedH;
}
Ejemplo n.º 8
0
void StartDlg::init(QStringList partsName)
{

    FlowLayout *layout = new FlowLayout(ui->groupBox);

    for(int i=0;i<partsName.count();i++)
    {
        QCheckBox *check = new QCheckBox(partsName.at(i),ui->groupBox);
        check->setChecked(true);
        check->setMinimumSize(QSize(100, check->height()));
        layout->addWidget(check);
        checkList.append(check);
    }
    adjustSize();

    ui->groupBox->setLayout(layout);
}
Ejemplo n.º 9
0
QWidget *TilesetItemBox::makeCategory(const QString &categoryItem)
{
    QTabWidget *TileSetsCategories = ui->TileSetsCategories;
    QWidget *catWid;
    QWidget *scrollWid;
    QGridLayout *catLayout;
    QLabel *grpLabel;
    QComboBox *tilesetGroup;
    QSpacerItem *spItem;
    QScrollArea *TileSets;
    FlowLayout *theLayOut;


    catWid = new QWidget();
    scrollWid = new QWidget();
    catLayout = new QGridLayout(catWid);
    catLayout->setSpacing(0);
    catLayout->setContentsMargins(0, 0, 0, 0);
    grpLabel = new QLabel(catWid);
    grpLabel->setText(tr("Group:"));
    catLayout->addWidget(grpLabel, 0, 0, 1, 1);

    tilesetGroup = new QComboBox(catWid);

    catLayout->addWidget(tilesetGroup, 0, 1, 1, 1);
    tilesetGroup->setInsertPolicy(QComboBox::InsertAlphabetically);
    spItem = new QSpacerItem(1283, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
    catLayout->addItem(spItem, 0, 2, 1, 1);
    TileSets = new QScrollArea(catWid);
    TileSets->setWidget(scrollWid);
    TileSets->setWidgetResizable(true);
    TileSets->setFrameShape(QFrame::StyledPanel);
    TileSets->setFrameShadow(QFrame::Raised);
    TileSets->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    TileSets->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);

    theLayOut = new FlowLayout(scrollWid);
    theLayOut->setSizeConstraint(QLayout::SetNoConstraint);

    catLayout->addWidget(TileSets, 1, 0, 1, 3);

    TileSetsCategories->addTab(catWid, QString());
    TileSetsCategories->setTabText(TileSetsCategories->indexOf(catWid), categoryItem);

    return catWid;
}
Ejemplo n.º 10
0
Window::Window()
: QGraphicsWidget(0, Qt::Window)
{
    FlowLayout *lay = new FlowLayout;
    QLatin1String wiseWords("I am not bothered by the fact that I am unknown."
    " I am bothered when I do not know others. (Confucius)");
    QString sentence(wiseWords);
    QStringList words = sentence.split(QLatin1Char(' '), QString::SkipEmptyParts);
    for (int i = 0; i < words.count(); ++i) {
        QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget(this);
        QLabel *label = new QLabel(words.at(i));
        label->setFrameStyle(QFrame::Box | QFrame::Plain);
        proxy->setWidget(label);
        lay->addItem(proxy);
    }
    setLayout(lay);
}
Ejemplo n.º 11
0
RemoteManager::RemoteManager(ICaptureContext &ctx, MainWindow *main)
    : QDialog(NULL), ui(new Ui::RemoteManager), m_Ctx(ctx), m_Main(main)
{
  ui->setupUi(this);

  m_ExternalRef.release(1);

  ui->hosts->setFont(Formatter::PreferredFont());
  ui->hostname->setFont(Formatter::PreferredFont());
  ui->runCommand->setFont(Formatter::PreferredFont());

  ui->hosts->setColumns({tr("Hostname"), tr("Running")});

  ui->hosts->header()->setSectionResizeMode(0, QHeaderView::Stretch);
  ui->hosts->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);

  setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

  lookupsProgressFlow = new QWidget(this);

  FlowLayout *flow = new FlowLayout(lookupsProgressFlow, 0, 3, 3);

  lookupsProgressFlow->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);

  flow->addWidget(ui->progressIcon);
  flow->addWidget(ui->progressText);
  flow->addWidget(ui->progressCount);

  QVBoxLayout *vertical = new QVBoxLayout(this);

  vertical->addWidget(ui->hosts);
  vertical->addWidget(lookupsProgressFlow);
  vertical->addWidget(ui->bottomLayout->parentWidget());

  m_Ctx.Config().AddAndroidHosts();

  for(RemoteHost *h : m_Ctx.Config().RemoteHosts)
    addHost(h);

  on_hosts_itemSelectionChanged();
}
Ejemplo n.º 12
0
KGVisualItemGroup::KGVisualItemGroup(QGraphicsWidget *parent) :
    QGraphicsWidget(parent, Qt::Widget), m_isFiltered(0)
{
    FlowLayout *layout = new FlowLayout;
    layout->setSpacing(Qt::Horizontal, 40);
    layout->setSpacing(Qt::Vertical, 40);
    layout->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
    layout->setContentsMargins(40,40,20,10);
    setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
    setLayout(layout);

    KGVisualAppendItem *appendItem = new KGVisualAppendItem(KGVisualAppendItem::APPEND, this);
    appendItem->setPreferredSize(225, 155);
    layout->addItem(appendItem);

    p_visualInsertItem = new KGVisualAppendItem(KGVisualAppendItem::INSERT, this);
    p_visualInsertItem->setPreferredSize(40, 155);
    p_visualInsertItem->setVisible(false);

    setAcceptHoverEvents(true);
    setAcceptDrops(false);

    QGraphicsProxyWidget *w = createButton();

    w->setPos(0, 40);
    w->setParentItem(this);

    //setFlags(QGraphicsItem::ItemHasNoContents);

}
Ejemplo n.º 13
0
static int lua_FlowLayout_setSpacing(lua_State* state)
{
    // Get the number of parameters.
    int paramCount = lua_gettop(state);

    // Attempt to match the parameters to a valid binding.
    switch (paramCount)
    {
        case 3:
        {
            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
                lua_type(state, 2) == LUA_TNUMBER &&
                lua_type(state, 3) == LUA_TNUMBER)
            {
                // Get parameter 1 off the stack.
                int param1 = (int)luaL_checkint(state, 2);

                // Get parameter 2 off the stack.
                int param2 = (int)luaL_checkint(state, 3);

                FlowLayout* instance = getInstance(state);
                instance->setSpacing(param1, param2);
                
                return 0;
            }

            lua_pushstring(state, "lua_FlowLayout_setSpacing - Failed to match the given parameters to a valid function signature.");
            lua_error(state);
            break;
        }
        default:
        {
            lua_pushstring(state, "Invalid number of parameters (expected 3).");
            lua_error(state);
            break;
        }
    }
    return 0;
}
Ejemplo n.º 14
0
Window::Window(QWidget *parent) : QWidget(parent) {
  FlowLayout *flowLayout = new FlowLayout;
  flowLayout->addWidget(new QPushButton(tr("Short")));
  flowLayout->addWidget(new QPushButton(tr("Longer")));
  flowLayout->addWidget(new QPushButton(tr("Different text")));
  flowLayout->addWidget(new QPushButton(tr("More text")));
  flowLayout->addWidget(new QPushButton(tr("Even longer button text")));
  setLayout(flowLayout);

  setWindowTitle(tr("balabal"));
}
Ejemplo n.º 15
0
void ToolBoxWidget::initUI()
{
#ifdef __APPLE__
    // Only Mac needs this. ToolButton is naturally borderless on Win/Linux.
    QString sStyle =
        "QToolButton { border: 0px; }"
        "QToolButton:pressed { border: 1px solid #ADADAD; border-radius: 2px; background-color: #D5D5D5; }"
        "QToolButton:checked { border: 1px solid #ADADAD; border-radius: 2px; background-color: #D5D5D5; }";
    ui->pencilButton->setStyleSheet(sStyle);
    ui->selectButton->setStyleSheet(sStyle);
    ui->moveButton->setStyleSheet(sStyle);
    ui->handButton->setStyleSheet(sStyle);
    ui->penButton->setStyleSheet(sStyle);
    ui->eraserButton->setStyleSheet(sStyle);
    ui->polylineButton->setStyleSheet(sStyle);
    ui->bucketButton->setStyleSheet(sStyle);
    ui->brushButton->setStyleSheet(sStyle);
    ui->eyedropperButton->setStyleSheet(sStyle);
    ui->clearButton->setStyleSheet(sStyle);
    ui->smudgeButton->setStyleSheet(sStyle);
#endif

    ui->pencilButton->setToolTip( tr( "Pencil Tool (%1): Sketch with pencil" )
        .arg( GetToolTips( CMD_TOOL_PENCIL ) ) );
    ui->selectButton->setToolTip( tr( "Select Tool (%1): Select an object" )
        .arg( GetToolTips( CMD_TOOL_SELECT ) ) );
    ui->moveButton->setToolTip( tr( "Move Tool (%1): Move an object" )
        .arg( GetToolTips( CMD_TOOL_MOVE ) ) );
    ui->handButton->setToolTip( tr( "Hand Tool (%1): Move the canvas" )
        .arg( GetToolTips( CMD_TOOL_HAND ) ) );
    ui->penButton->setToolTip( tr( "Pen Tool (%1): Sketch with pen" )
        .arg( GetToolTips( CMD_TOOL_PEN ) ) );
    ui->eraserButton->setToolTip( tr( "Eraser Tool (%1): Erase" )
        .arg( GetToolTips( CMD_TOOL_ERASER ) ) );
    ui->polylineButton->setToolTip( tr( "Polyline Tool (%1): Create line/curves" )
        .arg( GetToolTips( CMD_TOOL_POLYLINE ) ) );
    ui->bucketButton->setToolTip( tr( "Paint Bucket Tool (%1): Fill selected area with a color" )
        .arg( GetToolTips( CMD_TOOL_BUCKET ) ) );
    ui->brushButton->setToolTip( tr( "Brush Tool (%1): Paint smooth stroke with a brush" )
        .arg( GetToolTips( CMD_TOOL_BRUSH ) ) );
    ui->eyedropperButton->setToolTip( tr( "Eyedropper Tool (%1): "
            "Set color from the stage<br>[ALT] for instant access" )
        .arg( GetToolTips( CMD_TOOL_EYEDROPPER ) ) );
    ui->clearButton->setToolTip( tr( "Clear Frame (%1): Erases content of selected frame" )
        .arg( GetToolTips( CMD_CLEAR_FRAME ) ) );
    ui->smudgeButton->setToolTip( tr( "Smudge Tool (%1):<br>Edit polyline/curves<br>"
            "Liquify bitmap pixels<br> (%1)+[Alt]: Smooth" )
        .arg( GetToolTips( CMD_TOOL_SMUDGE ) ) );

    ui->pencilButton->setWhatsThis( tr( "Pencil Tool (%1)" )
        .arg( GetToolTips( CMD_TOOL_PENCIL ) ) );
    ui->selectButton->setWhatsThis( tr( "Select Tool (%1)" )
        .arg( GetToolTips( CMD_TOOL_SELECT ) ) );
    ui->moveButton->setWhatsThis( tr( "Move Tool (%1)" )
        .arg( GetToolTips( CMD_TOOL_MOVE ) ) );
    ui->handButton->setWhatsThis( tr( "Hand Tool (%1)" )
        .arg( GetToolTips( CMD_TOOL_HAND ) ) );
    ui->penButton->setWhatsThis( tr( "Pen Tool (%1)" )
        .arg( GetToolTips( CMD_TOOL_PEN ) ) );
    ui->eraserButton->setWhatsThis( tr( "Eraser Tool (%1)" )
        .arg( GetToolTips( CMD_TOOL_ERASER ) ) );
    ui->polylineButton->setWhatsThis( tr( "Polyline Tool (%1)" )
        .arg( GetToolTips( CMD_TOOL_POLYLINE ) ) );
    ui->bucketButton->setWhatsThis( tr( "Paint Bucket Tool (%1)" )
        .arg( GetToolTips( CMD_TOOL_BUCKET ) ) );
    ui->brushButton->setWhatsThis( tr( "Brush Tool (%1)" )
        .arg( GetToolTips( CMD_TOOL_BRUSH ) ) );
    ui->eyedropperButton->setWhatsThis( tr( "Eyedropper Tool (%1)" )
        .arg( GetToolTips( CMD_TOOL_EYEDROPPER ) ) );
    ui->clearButton->setWhatsThis( tr( "Clear Tool (%1)" )
        .arg( GetToolTips( CMD_CLEAR_FRAME ) ) );
    ui->smudgeButton->setWhatsThis( tr( "Smudge Tool (%1)" )
        .arg( GetToolTips( CMD_TOOL_SMUDGE ) ) );

    connect(ui->clearButton, &QToolButton::clicked, this, &ToolBoxWidget::clearButtonClicked);
    connect(ui->pencilButton, &QToolButton::clicked, this, &ToolBoxWidget::pencilOn);
    connect(ui->eraserButton, &QToolButton::clicked, this, &ToolBoxWidget::eraserOn);
    connect(ui->selectButton, &QToolButton::clicked, this, &ToolBoxWidget::selectOn);
    connect(ui->moveButton, &QToolButton::clicked, this, &ToolBoxWidget::moveOn);
    connect(ui->penButton, &QToolButton::clicked, this, &ToolBoxWidget::penOn);
    connect(ui->handButton, &QToolButton::clicked, this, &ToolBoxWidget::handOn);
    connect(ui->polylineButton, &QToolButton::clicked, this, &ToolBoxWidget::polylineOn);
    connect(ui->bucketButton, &QToolButton::clicked, this, &ToolBoxWidget::bucketOn);
    connect(ui->eyedropperButton, &QToolButton::clicked, this, &ToolBoxWidget::eyedropperOn);
    connect(ui->brushButton, &QToolButton::clicked, this, &ToolBoxWidget::brushOn);
    connect(ui->smudgeButton, &QToolButton::clicked, this, &ToolBoxWidget::smudgeOn);

    delete ui->toolGroup->layout();
    FlowLayout* flowlayout = new FlowLayout;

    flowlayout->addWidget(ui->clearButton);
    flowlayout->addWidget(ui->pencilButton);
    flowlayout->addWidget(ui->eraserButton);
    flowlayout->addWidget(ui->selectButton);
    flowlayout->addWidget(ui->moveButton);
    flowlayout->addWidget(ui->penButton);
    flowlayout->addWidget(ui->handButton);
    flowlayout->addWidget(ui->polylineButton);
    flowlayout->addWidget(ui->bucketButton);
    flowlayout->addWidget(ui->eyedropperButton);
    flowlayout->addWidget(ui->brushButton);
    flowlayout->addWidget(ui->smudgeButton);
    ui->toolGroup->setLayout(flowlayout);

    QSettings settings(PENCIL2D, PENCIL2D);
    restoreGeometry(settings.value("ToolBoxGeom").toByteArray());
}
Ejemplo n.º 16
0
 /*public*/ EnginesTableFrame::EnginesTableFrame(QWidget* parent) :
 OperationsFrame(tr("Engines Table"), parent)
 {
        //super(tr("Engines Table"));
        // general GUI config
 setObjectName("EnginesTableFrame");
 log = new Logger("EnginesTableFrame");
  engineManager = EngineManager::instance();
  // labels
  numEngines = new QLabel();
  textEngines = new QLabel();
  textSep1 = new QLabel("          ");
  f = NULL;
  setStatusBar(new QStatusBar());
  statusBar()->setSizeGripEnabled(true);

  // radio buttons
  sortByNumber = new QRadioButton(tr("Number"));
  sortByRoad = new QRadioButton(tr("Road"));
  sortByModel = new QRadioButton(tr("Model"));
  sortByConsist = new QRadioButton(tr("Consist"));
  sortByLocation = new QRadioButton(tr("Location"));
  sortByDestination = new QRadioButton(tr("Destination"));
  sortByTrain = new QRadioButton(tr("Train"));
  sortByMoves = new QRadioButton(tr("Moves"));
  sortByBuilt = new QRadioButton(tr("Built"));
  sortByOwner = new QRadioButton(tr("Owner"));
  sortByValue = new QRadioButton(Setup::getValueLabel());
  sortByRfid = new QRadioButton(Setup::getRfidLabel());
  sortByLast = new QRadioButton(tr("Last"));
  QButtonGroup* group = new QButtonGroup();

  // major buttons
  addButton = new QPushButton(tr("Add"));
  findButton = new QPushButton(tr("Find"));
  saveButton = new QPushButton(tr("Save"));

  findEngineTextBox = new JTextField(6);
  QVBoxLayout* thisLayout;
  log->debug(tr("getContentPane returned %1").arg(getContentPane()->objectName()));
  getContentPane()->setLayout(thisLayout = new QVBoxLayout); //(getContentPane(), BoxLayout.Y_AXIS));

  // Set up the jtable in a Scroll Pane..
  enginesModel = new EnginesTableModel();
  //sorter = new TableSorter(enginesModel);
  sorter = new QSortFilterProxyModel();
  sorter->setSourceModel(enginesModel);
  enginesTable = new JTable(sorter);
  //sorter.setTableHeader(enginesTable.getTableHeader());
//        enginesPane = new JScrollPane(enginesTable);
//        enginesPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
  enginesModel->initTable(enginesTable, this);

  // load the number of engines and listen for changes
  numEngines->setText(QString::number(engineManager->getNumEntries()));
  //engineManager.addPropertyChangeListener(this);
  connect(engineManager->pcs, SIGNAL(propertyChange(PropertyChangeEvent*)), this, SLOT(propertyChange(PropertyChangeEvent*)));
  textEngines->setText(tr("engines"));

  // Set up the control panel
  // row 1
  QGroupBox* cp1 = new QGroupBox();
  //cp1.setBorder(BorderFactory.createTitledBorder(tr("SortBy")));
  QString     gbStyleSheet = "QGroupBox { border: 2px solid gray; border-radius: 3px;} QGroupBox::title { /*background-color: transparent;*/  subcontrol-position: top left; /* position at the top left*/  padding:0 0px;} ";
  cp1->setStyleSheet(gbStyleSheet);
  FlowLayout * cp1Layout = new FlowLayout(cp1);
  cp1->setTitle(tr("Sort By"));
  cp1Layout->addWidget(sortByNumber);
  cp1Layout->addWidget(sortByRoad);
  cp1Layout->addWidget(sortByModel);
  cp1Layout->addWidget(sortByConsist);
  cp1Layout->addWidget(sortByLocation);
  cp1Layout->addWidget(sortByDestination);
  cp1Layout->addWidget(sortByTrain);
  QFrame* movep = new QFrame();
  //movep.setBorder(BorderFactory.createTitledBorder(""));
  FlowLayout * movepLayout = new FlowLayout(movep);
  movepLayout->addWidget(sortByMoves);
  movepLayout->addWidget(sortByBuilt);
  movepLayout->addWidget(sortByOwner);
  if (Setup::isValueEnabled()) {
      movepLayout->addWidget(sortByValue);
  }
  if (Setup::isRfidEnabled()) {
      movepLayout->addWidget(sortByRfid);
  }
  movepLayout->addWidget(sortByLast);
  cp1Layout->addWidget(movep);

  // row 2
  QWidget* cp2 = new QWidget();
  //cp2.setLayout(new BoxLayout(cp2, BoxLayout.X_AXIS));
  QHBoxLayout* cp2Layout = new QHBoxLayout(cp2);

  QFrame* cp2Add = new QFrame();
  //cp2Add.setBorder(BorderFactory.createTitledBorder(""));
  cp2Add->setFrameShape(QFrame::StyledPanel);
  cp2Add->setFrameShadow(QFrame::Raised);
  QHBoxLayout* cp2AddLayout = new QHBoxLayout(cp2Add);

  cp2AddLayout->addWidget(numEngines);
  cp2AddLayout->addWidget(textEngines);
  cp2AddLayout->addWidget(textSep1);
  cp2AddLayout->addWidget(addButton);
  cp2Layout->addWidget(cp2Add);

  QGroupBox* cp2Find = new QGroupBox();
  //cp2Find.setBorder(BorderFactory.createTitledBorder(""));
  cp2Find->setStyleSheet(gbStyleSheet);
  cp2Find->setTitle("");
  FlowLayout* cp2FindLayout = new FlowLayout(cp2Find);
  findButton->setToolTip(tr("Find locomotive by road number. Asterisk \"*\" = wild card."));
  findEngineTextBox->setToolTip(tr("Find locomotive by road number. Asterisk \"*\" = wild card."));
  cp2FindLayout->addWidget(findButton);
  cp2FindLayout->addWidget(findEngineTextBox);
  cp2Layout->addWidget(cp2Find);

  QWidget* cp2Save = new QWidget();
  //cp2Save.setBorder(BorderFactory.createTitledBorder(""));
  FlowLayout* cp2SaveLayout = new FlowLayout(cp2Save);
  cp2SaveLayout->addWidget(saveButton);
  cp2Layout->addWidget(cp2Save);

  // place controls in scroll pane
  QWidget* controlPanel = new QWidget();
  //controlPanel.setLayout(new BoxLayout(controlPanel, BoxLayout.Y_AXIS));
  QVBoxLayout* controlPanelLayout = new QVBoxLayout(controlPanel);
  controlPanelLayout->addWidget(cp1);
  controlPanelLayout->addWidget(cp2);

  // some tool tips
  sortByLast->setToolTip(tr("Last Moved"));

  QScrollArea* controlPane = new QScrollArea();
  controlPane->setWidget(controlPanel);
  controlPane->setWidgetResizable(true);

  thisLayout->addWidget(/*enginesPane*/enginesTable);
  thisLayout->addWidget(controlPane);

  // setup buttons
  addButtonAction(addButton);
  addButtonAction(findButton);
  addButtonAction(saveButton);

  sortByNumber->setChecked(true);

  addRadioButtonAction(sortByNumber);
  addRadioButtonAction(sortByRoad);
  addRadioButtonAction(sortByModel);
  addRadioButtonAction(sortByConsist);
  addRadioButtonAction(sortByLocation);
  addRadioButtonAction(sortByDestination);
  addRadioButtonAction(sortByTrain);
  addRadioButtonAction(sortByMoves);
  addRadioButtonAction(sortByBuilt);
  addRadioButtonAction(sortByOwner);
  addRadioButtonAction(sortByValue);
  addRadioButtonAction(sortByRfid);
  addRadioButtonAction(sortByLast);

  group->addButton(sortByNumber);
  group->addButton(sortByRoad);
  group->addButton(sortByModel);
  group->addButton(sortByConsist);
  group->addButton(sortByLocation);
  group->addButton(sortByDestination);
  group->addButton(sortByTrain);
  group->addButton(sortByMoves);
  group->addButton(sortByBuilt);
  group->addButton(sortByOwner);
  group->addButton(sortByValue);
  group->addButton(sortByRfid);
  group->addButton(sortByLast);

  // build menu
  QMenuBar* menuBar = new QMenuBar();
  QMenu* toolMenu = new QMenu(tr("Tools"));
  toolMenu->addMenu(new EngineRosterMenu(tr("Engine Roster"), EngineRosterMenu::MAINMENU, this));
//        toolMenu.add(new NceConsistEngineAction(tr("MenuItemNceSync"), this));
  menuBar->addMenu(toolMenu);
  menuBar->addMenu(new OperationsMenu());
  setMenuBar(menuBar);
  addHelpMenu("package.jmri.jmrit.operations.Operations_Locomotives", true); // NOI18N

  initMinimumSize();

  //addHorizontalScrollBarKludgeFix(controlPane, controlPanel);

  // create ShutDownTasks
  createShutDownTask();

 }
Ejemplo n.º 17
0
CConfCore::CConfCore( const char *sDev, const char *sName, const char *sAon, int nMixPlata, int nMaxActivePorts, int nPartys,  QWidget *parent ) : QGroupBox(parent)
{
    m_pOwner = qobject_cast<CConfSMPClient*>(parent);
    if(!m_pOwner)
        QCoreApplication::exit(EXIT_FAILURE);

    QTextCodec *codec = QTextCodec::codecForName("Windows-1251");
    QString name = codec->toUnicode(sName);
    if(name.isEmpty())
        name = QString::number(m_pOwner->pOwner()->m_nVirtLink);

    QString title;
    title = name;
    title += '@';

    QString connected = m_pOwner->pOwner()->m_sHost;
    if(m_pOwner->pOwner()->m_nPort != 10011)
    {
        connected += ':';
        connected += QString::number(m_pOwner->pOwner()->m_nPort);
    }
    title += connected;
    title += " (";
    title += sDev;
    title += ')';

    setAlignment(Qt::AlignHCenter);
    setTitle(title);

    QString tooltip;
    tooltip += tr("Название");
    tooltip += ": ";
    tooltip += name;
    tooltip += '\n';

    tooltip += tr("Номер");
    tooltip += ": ";
    tooltip += sAon;
    tooltip += '\n';

    tooltip += tr("Подключен");
    tooltip += ": ";
    tooltip += connected;
    tooltip += '\n';

    tooltip += tr("Слот");
    tooltip += ": ";
    tooltip += QString::number(m_pOwner->pOwner()->m_nVirtLink - 768);
    tooltip += '\n';

    tooltip += tr("Плата");
    tooltip += ": ";
    tooltip += QString::number(nMixPlata);
    tooltip += '\n';

    tooltip += tr("Максимум активных");
    tooltip += ": ";
    tooltip += QString::number(nMaxActivePorts);

    setToolTip(tooltip);

    m_nMaxActivePorts = nMaxActivePorts;
#ifdef ANDROID
    FlowLayout* pLayout = new FlowLayout(6, 10, 7);
#else
    FlowLayout* pLayout = new FlowLayout(8, 8, 6);
#endif
    for(int i = 0; i < nPartys; i++)
    {
        CConfParty* party = new CConfParty(this);
        m_pPartys.push_back(party);
        pLayout->addWidget(party);
    }

    QVBoxLayout* pTopLayout = new QVBoxLayout;

    QScrollArea* scrl = new QScrollArea();
#ifdef ANDROID
    QScroller::grabGesture(scrl, QScroller::LeftMouseButtonGesture);
    QScroller* s = QScroller::scroller(scrl);
    QScrollerProperties p = s->scrollerProperties();
    p.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QScrollerProperties::OvershootAlwaysOff);
    p.setScrollMetric(QScrollerProperties::VerticalOvershootPolicy, QScrollerProperties::OvershootAlwaysOff);
    p.setScrollMetric(QScrollerProperties::OvershootDragDistanceFactor, 0);
    p.setScrollMetric(QScrollerProperties::OvershootScrollDistanceFactor, 0);

    //p.setScrollMetric(QScrollerProperties::OvershootDragResistanceFactor,  0.9);
    //p.setScrollMetric(QScrollerProperties::DragStartDistance,   0.001 );
    //p.setScrollMetric(QScrollerProperties::ScrollingCurve, QEasingCurve::Linear );
    //p.setScrollMetric(QScrollerProperties::AxisLockThreshold, 0.9);

    //Does this help?
    //p.setScrollMetric(QScrollerProperties::SnapTime, 1);
    //p.setScrollMetric(QScrollerProperties::SnapPositionRatio, 1);

    //p.setScrollMetric(QScrollerProperties::AcceleratingFlickSpeedupFactor, 2.5);
    //p.setScrollMetric(QScrollerProperties::AcceleratingFlickMaximumTime, 1.25);
    s->setScrollerProperties(p);
#endif
    QWidget* wgt = new QWidget();
    scrl->setWidget(wgt);
    scrl->setWidgetResizable(true);
    wgt->setLayout(pLayout);
    pTopLayout->addWidget(scrl);

    m_pBtnGather = new QPushButton(tr("Собрать всех"));
    m_pBtnGather->setIcon(m_pOwner->pOwner()->pix_gather);
    connect(m_pBtnGather, SIGNAL(clicked()), SLOT(slotGatherClicked()));
    m_pBtnGather->setToolTip(tr("Вызвать всех участников конференции"));

    m_pBtnDestroy = new QPushButton(tr("Отбить всех"));
    m_pBtnDestroy->setIcon(m_pOwner->pOwner()->pix_call_down);
    connect(m_pBtnDestroy, SIGNAL(clicked()), SLOT(slotDestroyClicked()));
    m_pBtnDestroy->setToolTip(tr("Отбить всех участников конференции"));

    m_pBtnReconnect = new QPushButton(tr("Обновить соединение"));
    m_pBtnReconnect->setIcon(m_pOwner->pOwner()->pix_connection);
    connect(m_pBtnReconnect, SIGNAL(clicked()), SLOT(slotReconnectClicked()));
    m_pBtnReconnect->setToolTip(tr("Обновить соединение с АТС"));

    QHBoxLayout* pLayoutH = new QHBoxLayout;
    pLayoutH->addWidget(m_pBtnGather);
    pLayoutH->addWidget(m_pBtnDestroy);
    pLayoutH->addWidget(m_pBtnReconnect);
    pTopLayout->addLayout(pLayoutH);
    pTopLayout->setMargin(4);
    setLayout(pTopLayout);
}
Ejemplo n.º 18
0
SettingsTabOther::SettingsTabOther(QWidget *parent, QMap<QString, QVariant> set, bool v) : QWidget(parent) {

	// The global settings
	globSet = set;

	verbose = v;

	this->setObjectName("tabother");
	this->setStyleSheet("#tabother { background: transparent; color: white; }");

	tabs = new TabWidget;
	tabs->expand(false);
	tabs->setBorderTop("rgba(150,150,150,100)",2);
	tabs->setBorderBot("rgba(150,150,150,100)",2);

	QVBoxLayout *mainLay = new QVBoxLayout;
	mainLay->addWidget(tabs);
	this->setLayout(mainLay);

	// the main scroll widget for all LOOK content
	scrollbarOther = new CustomScrollbar;
	QScrollArea *scrollOther = new QScrollArea;
	QVBoxLayout *layOther = new QVBoxLayout(scrollOther);
	QWidget *scrollWidgOther = new QWidget(scrollOther);
	scrollWidgOther->setLayout(layOther);
	scrollOther->setWidget(scrollWidgOther);
	scrollOther->setWidgetResizable(true);
	scrollOther->setVerticalScrollBar(scrollbarOther);

	// the main scroll widget for all FEEL content
	scrollbarFile = new CustomScrollbar;
	QScrollArea *scrollFile = new QScrollArea;
	QVBoxLayout *layFile = new QVBoxLayout(scrollFile);
	QWidget *scrollWidgFile = new QWidget(scrollFile);
	scrollWidgFile->setLayout(layFile);
	scrollFile->setWidget(scrollWidgFile);
	scrollFile->setWidgetResizable(true);
	scrollFile->setVerticalScrollBar(scrollbarFile);

	tabOther = new QWidget;
	tabFile = new QWidget;

	QVBoxLayout *scrollLayOther = new QVBoxLayout;
	scrollLayOther->addWidget(scrollOther);
	tabOther->setLayout(scrollLayOther);

	QVBoxLayout *scrollLayFile = new QVBoxLayout;
	scrollLayFile->addWidget(scrollFile);
	tabFile->setLayout(scrollLayFile);

	tabs->addTab(tabOther,tr("Other"));
	tabs->addTab(tabFile,tr("File Types"));



	// The titles
	CustomLabel *titleOther = new CustomLabel("<center><h1>" + tr("Other Settings") + "</h1></center>");
	layOther->addWidget(titleOther);
	layOther->addSpacing(20);
	CustomLabel *titleFile = new CustomLabel("<center><h1>" + tr("Known File Types") + "</h1></center>");
	layFile->addWidget(titleFile);
	layFile->addSpacing(20);



	// CHOOSE A LANGUAGE
	CustomLabel *langLabel = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("Choose Language") + "</span></b><br><br>" + tr("There are a good few different languages available. Thanks to everybody who took the time to translate PhotoQt!"));
	langLabel->setWordWrap(true);
	layOther->addWidget(langLabel);
	layOther->addSpacing(15);


	// All the languages available. They are sorted according to their language code (except English)
	// A GOOD FEW OF THE TRANSLATIONS HAVEN'T BEEN UPDATED IN A LONG TIME AND ARE STANDING AT 0-5%
	// These translations are NOT included!

	langDesc << "English";
	langShort << "en";

	// Arabic
//	langDesc << QString::fromUtf8("العربية (Amar T.)");
//	langShort << "ar";

	// Czech
	langDesc << QString::fromUtf8("Čeština (Robin H. & Petr Š.)");
	langShort << "cs";

	// German
	langDesc << "Deutsch";
	langShort << "de";

	// Greek
	langDesc << QString::fromUtf8("Ελληνικά (Dimitrios G.)");
	langShort << "el";

	// Spanish
	langDesc << QString::fromUtf8("Español (Hector C. & Victoria P.)");
	langShort << "es_ES";

	// Finnish
	langDesc << QString::fromUtf8("Suomen kieli (Jiri G.)");
	langShort << "fi";

	// French
	langDesc << QString::fromUtf8("Français (Olivier D. & Tubuntu)");
	langShort << "fr";

	// Hungarian
//	langDesc << QString::fromUtf8("Magyar (Zoltan H.)");
//	langShort << "hu";

	// Hebrew
	langDesc << QString::fromUtf8("עברית (GenghisKhan)");
	langShort << "he";

	// Italian
	langDesc << "Italiano (Vincenzo C. & Fabio M.)";
	langShort << "it";

	// Japanese
	langDesc << QString::fromUtf8("日本語 (Obytetest)");
	langShort << "ja";

	// Norwegian Bokmal
//	langDesc << QString::fromUtf8("Bokmål (Ola Haugen H.)");
//	langShort << "nb_NO";

	// Norwegian Nynorsk
//	langDesc << "Nynorsk (Ola Haugen H.)";
//	langShort << "nn_NO";

	// Polish
//	langDesc << "Polski (Daniel K.)";
//	langShort << "pl";

	// Portugal (Brazil)
	langDesc << QString::fromUtf8("Português (Brasil) (Rafael N. & Everton)");
	langShort << "pt_BR";

	// Portugal (Portugal)
	langDesc << QString::fromUtf8("Português (Portugal) (Sérgio M. & Manuela S. & Willow)");
	langShort << "pt_PT";

	// Russian
	langDesc << QString::fromUtf8("Pусский (Yuriy T.)");
	langShort << "ru_RU";

	//Slovak
	langDesc << QString::fromUtf8("Slovenčina (Lukáš D.)");
	langShort << "sk";

	// Serbian
//	langDesc << QString::fromUtf8("српски екавски (Mladen Pejaković)");
//	langShort << "sr_RS";

	// Turkish
//	langDesc << QString::fromUtf8("Türkçe (Onuralp SEZER)");
//	langShort << "tr";

	// Ukrainian
	langDesc << QString::fromUtf8("Українська (neeesdfsdf & zubr139)");
	langShort << "uk_UA";

	// Viatnemese
//	langDesc << QString::fromUtf8("Tiếng Việt (Nguyễn Hữu Tài)");
//	langShort << "vi";

	// Chinese (China)
	langDesc << "Chinese (Min Zhang)";
	langShort << "zh_CN";

	langDesc << "Chinese (traditional) (Min Zhang)";
	langShort << "zh_TW";

	FlowLayout *langLay = new FlowLayout;
	QButtonGroup *langButGrp = new QButtonGroup;

	for(int i = 0; i < langDesc.length(); ++i) {

		SettingsTabOtherLanguageTiles *tile = new SettingsTabOtherLanguageTiles(langDesc.at(i), langShort.at(i));
		allLangTiles << tile;
		langButGrp->addButton(tile->button);
		langLay->addWidget(tile);

	}

	QHBoxLayout *langWidgLay = new QHBoxLayout;
	langWidgLay->addSpacing(50);
	langWidgLay->addLayout(langLay);
	langWidgLay->addSpacing(50);

	layOther->addLayout(langWidgLay);
	layOther->addSpacing(30);


	// Adjust quick settings trigering
	CustomLabel *quickSetLabel = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("Quick Settings") + "</span></b><br><br>" + tr("The 'Quick Settings' is a widget hidden on the right side of the screen. When you move the cursor there, it shows up, and you can adjust a few simple settings on the spot without having to go through this settings dialog. Of course, only a small subset of settings is available (the ones needed most often). Here you can disable the dialog so that it doesn't show on mouse movement anymore."));
	quickSet = new CustomCheckBox(tr("Show 'Quick Settings' on mouse hovering"));
	QHBoxLayout *quickSetLay = new QHBoxLayout;
	quickSetLay->addStretch();
	quickSetLay->addWidget(quickSet);
	quickSetLay->addStretch();

	layOther->addWidget(quickSetLabel);
	layOther->addSpacing(20);
	layOther->addLayout(quickSetLay);
	layOther->addSpacing(30);



	// Adjust context menu
	CustomLabel *contextMenuLabel = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("Adjust Context Menu") + "</span></b><br><br>" + tr("Here you can adjust the context menu. You can simply drag and drop the entries, edit them, add a new one and remove an existing one."));
	context = new Context;
	QHBoxLayout *contextLay = new QHBoxLayout;
	contextLay->addStretch();
	contextLay->addWidget(context);
	contextLay->addStretch();
	CustomPushButton *addNew = new CustomPushButton("+ " + tr("Add new Entry"),this);
	QHBoxLayout *addNewLay = new QHBoxLayout;
	connect(addNew, SIGNAL(clicked()), context, SLOT(addNewEntry()));
	addNewLay->addStretch();
	addNewLay->addWidget(addNew);
	addNewLay->addStretch();
	layOther->addWidget(contextMenuLabel);
	layOther->addSpacing(10);
	layOther->addLayout(contextLay);
	layOther->addLayout(addNewLay);
	layOther->addSpacing(20);



	allCheckQt.clear();
	allCheckGm.clear();
	allCheckGmUnstable.clear();


	// Adjust known file formats
	CustomLabel *titleQt = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("File Types - Qt") + "</span></b><br><br>" + tr("These are the standard file types supported by Qt. Depending on your system, this list can vary a little.") + "<br>" + tr("If you want to add a file type not in the list, you can add them in the text box below. You have to enter the formats like '*.ending', all seperated by commas.") + "</b>");
	titleQt->setWordWrap(true);

	FlowLayout *layQt = new FlowLayout;
	QStringList formatsQt;
	formatsQt << ".bmp" << ".gif" << ".tif" << ".tiff" << ".jpeg2000" << ".jpeg" << ".jpg" << ".png" << ".pbm" << ".pgm" << ".ppm" << ".xbm" << ".xpm";
	formatsQt.sort();
	for(int i = 0; i < formatsQt.length(); ++i) {

		SettingsTabOtherFileTypesTiles *check = new SettingsTabOtherFileTypesTiles(formatsQt.at(i));
		check->setToolTip(formatsQt.at(i));
		allCheckQt.insert(formatsQt.at(i),check);
		layQt->addWidget(check);

	}

	QHBoxLayout *layQtBut = new QHBoxLayout;
	CustomLabel *extraQt = new CustomLabel(tr("Extra File Types:"));
	extraQt->setWordWrap(false);
	extraQtEdit = new CustomLineEdit;
	CustomPushButton *qtMarkAll = new CustomPushButton(tr("Mark All"));
	CustomPushButton *qtMarkNone = new CustomPushButton(tr("Mark None"));
	layQtBut->addWidget(extraQt);
	layQtBut->addWidget(extraQtEdit);
	layQtBut->addStretch();
	layQtBut->addWidget(qtMarkAll);
	layQtBut->addWidget(qtMarkNone);

	layFile->addWidget(titleQt);
	layFile->addSpacing(10);
	layFile->addLayout(layQt);
	layFile->addSpacing(5);
	layFile->addLayout(layQtBut);
	layFile->addSpacing(35);

	QSignalMapper *mapQtMark = new QSignalMapper;
	mapQtMark->setMapping(qtMarkAll,"qtMark");
	connect(qtMarkAll, SIGNAL(clicked()), mapQtMark, SLOT(map()));
	connect(mapQtMark, SIGNAL(mapped(QString)), this, SLOT(markAllNone(QString)));

	QSignalMapper *mapQtNone = new QSignalMapper;
	mapQtNone->setMapping(qtMarkNone,"qtNone");
	connect(qtMarkNone, SIGNAL(clicked()), mapQtNone, SLOT(map()));
	connect(mapQtNone, SIGNAL(mapped(QString)), this, SLOT(markAllNone(QString)));

#ifndef GM
	CustomLabel *gmDisabled = new CustomLabel("<b><i>" + tr("Use of GraphicsMagick has been disabled as PhotoQt was compiled/installed!") + "</i></b>");
	gmDisabled->setWordWrap(true);
#endif

	CustomLabel *titleGmWorking = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("File Types - GraphicsMagick") + "</span></b><br><br>" + tr("PhotoQt makes use of GraphicsMagick for support of many different file types. Not all of the formats supported by GraphicsMagick make sense in an image viewer. There are some that aren't quite working at the moment, you can find them in the 'Unstable' category below.") + "<br>" + tr("If you want to add a file type not in the list, you can add them in the text box below. You have to enter the formats like '*.ending', all seperated by commas.") + "</b>");
	titleGmWorking->setWordWrap(true);

	FlowLayout *layGm = new FlowLayout;
	QStringList formatsGm;
	formatsGm << ".art" << ".avs" << ".x" << ".cals" << ".cgm" << ".cur" << ".cut" << ".acr" << ".dcm" << ".dicom" << ".dic" << ".dcx" << ".dib" << ".dpx" << ".emf" << ".epdf" << ".epi" << ".eps" << ".eps2" << ".eps3" << ".epsf" << ".epsi" << ".ept" << ".fax" << ".fig" << ".fits" << ".fts" << ".fit" << ".fpx" << ".gplt" << ".ico" << ".jbg" << ".jbig" << ".jng" << ".jp2" << ".j2k" << ".jpf" << ".jpx" << ".jpm" << ".mj2" << ".jpc" << ".mat" << ".miff" << ".mng" << ".mpc" << ".mtv" << ".otb" << ".p7" << ".palm" << ".pam" << ".pcd" << ".pcds" << ".pcx" << ".pdb" << ".pdf" << ".picon" << ".pict" << ".pct" << ".pic" << ".pix" << ".pnm" << ".ps" << ".ps2" << ".ps3" << ".psd" << ".ptif" << ".ras" << ".rast" << ".rad" << ".sgi" << ".sun" << ".svg" << ".tga" << ".vicar" << ".viff" << ".wbmp" << ".wbm" << ".xcf" << ".xwd";
	formatsGm.sort();
	for(int i = 0; i < formatsGm.length(); ++i) {

		SettingsTabOtherFileTypesTiles *check = new SettingsTabOtherFileTypesTiles(formatsGm.at(i));
		allCheckGm.insert(formatsGm.at(i),check);
		check->setToolTip(formatsGm.at(i));
		layGm->addWidget(check);
#ifndef GM
		check->setEnabled(false);
#endif

	}

	QHBoxLayout *layGmBut = new QHBoxLayout;
	CustomLabel *extraGm = new CustomLabel(tr("Extra File Types:"));
	extraGm->setWordWrap(false);
	extraGmEdit = new CustomLineEdit;
	CustomPushButton *gmMarkAll = new CustomPushButton(tr("Mark All"));
	CustomPushButton *gmMarkNone = new CustomPushButton(tr("Mark None"));
	layGmBut->addWidget(extraGm);
	layGmBut->addWidget(extraGmEdit);
	layGmBut->addStretch();
	layGmBut->addWidget(gmMarkAll);
	layGmBut->addWidget(gmMarkNone);

#ifndef GM
	titleGmWorking->setEnabled(false);
	gmMarkAll->setEnabled(false);
	gmMarkNone->setEnabled(false);
	extraGm->setEnabled(false);
	extraGmEdit->setEnabled(false);

	layFile->addWidget(gmDisabled);
	layFile->addSpacing(10);
#endif
	layFile->addWidget(titleGmWorking);
	layFile->addSpacing(10);
	layFile->addLayout(layGm);
	layFile->addSpacing(5);
	layFile->addLayout(layGmBut);
	layFile->addSpacing(35);


	QSignalMapper *mapGmMark = new QSignalMapper;
	mapGmMark->setMapping(gmMarkAll,"gmMark");
	connect(gmMarkAll, SIGNAL(clicked()), mapGmMark, SLOT(map()));
	connect(mapGmMark, SIGNAL(mapped(QString)), this, SLOT(markAllNone(QString)));

	QSignalMapper *mapGmNone = new QSignalMapper;
	mapGmNone->setMapping(gmMarkNone,"gmNone");
	connect(gmMarkNone, SIGNAL(clicked()), mapGmNone, SLOT(map()));
	connect(mapGmNone, SIGNAL(mapped(QString)), this, SLOT(markAllNone(QString)));





	CustomLabel *titleGmUnstable = new CustomLabel("<b><span style=\"font-size:12pt\">" + tr("File Types - GraphicsMagick (Unstable)") + "</span></b><br><br>" + tr("The following file types are supported by GraphicsMagick, but aren't quite working in PhotoQt just yet. If you want to experiment around a little, feel free to enable some of them. They shouldn't cause PhotoQt to crash, but you might see an error image instead of the actual image.") + "</b>");
	titleGmUnstable->setWordWrap(true);

	FlowLayout *layGmUnstable = new FlowLayout;
	QStringList formatsGmUnstable;
	formatsGmUnstable << ".gray" << ".hpgl" << ".mono" << ".msl" << ".mvg" << ".pcl" << ".pfa" << ".pfb" << ".pwp" << ".rgb" << ".rgba" << ".rla" << ".rle" << ".sct" << ".sfw" << ".tim" << ".uil" << ".uyvy" << ".wmf" << ".wpg" << ".yuv";
	formatsGmUnstable.sort();
	for(int i = 0; i < formatsGmUnstable.length(); ++i) {

		SettingsTabOtherFileTypesTiles *check = new SettingsTabOtherFileTypesTiles(formatsGmUnstable.at(i));
		check->setToolTip(formatsGmUnstable.at(i));
		allCheckGmUnstable.insert(formatsGmUnstable.at(i),check);
		layGmUnstable->addWidget(check);
#ifndef GM
		check->setEnabled(false);
#endif

	}

	QHBoxLayout *layGmButUnstable = new QHBoxLayout;
	CustomPushButton *gmMarkAllUnstable = new CustomPushButton(tr("Mark All"));
	CustomPushButton *gmMarkNoneUnstable = new CustomPushButton(tr("Mark None"));
	layGmButUnstable->addStretch();
	layGmButUnstable->addWidget(gmMarkAllUnstable);
	layGmButUnstable->addWidget(gmMarkNoneUnstable);

	layFile->addWidget(titleGmUnstable);
	layFile->addSpacing(10);
	layFile->addLayout(layGmUnstable);
	layFile->addSpacing(5);
	layFile->addLayout(layGmButUnstable);
	layFile->addSpacing(35);

#ifndef GM
	titleGmUnstable->setEnabled(false);
	gmMarkAllUnstable->setEnabled(false);
	gmMarkNoneUnstable->setEnabled(false);
#endif

	QSignalMapper *mapGmMarkUnst = new QSignalMapper;
	mapGmMarkUnst->setMapping(gmMarkAllUnstable,"gmunstMark");
	connect(gmMarkAllUnstable, SIGNAL(clicked()), mapGmMarkUnst, SLOT(map()));
	connect(mapGmMarkUnst, SIGNAL(mapped(QString)), this, SLOT(markAllNone(QString)));

	QSignalMapper *mapGmNoneUnst = new QSignalMapper;
	mapGmNoneUnst->setMapping(gmMarkNoneUnstable,"gmunstNone");
	connect(gmMarkNoneUnstable, SIGNAL(clicked()), mapGmNoneUnst, SLOT(map()));
	connect(mapGmNoneUnst, SIGNAL(mapped(QString)), this, SLOT(markAllNone(QString)));



	layOther->addStretch();
	layFile->addStretch();

}
Ejemplo n.º 19
0
CaptureDialog::CaptureDialog(ICaptureContext &ctx, OnCaptureMethod captureCallback,
                             OnInjectMethod injectCallback, MainWindow *main, QWidget *parent)
    : QFrame(parent), ui(new Ui::CaptureDialog), m_Ctx(ctx), m_Main(main)
{
  ui->setupUi(this);

  ui->exePath->setFont(Formatter::PreferredFont());
  ui->workDirPath->setFont(Formatter::PreferredFont());
  ui->cmdline->setFont(Formatter::PreferredFont());
  ui->processList->setFont(Formatter::PreferredFont());

  // setup FlowLayout for options group
  {
    QLayout *oldLayout = ui->optionsGroup->layout();

    QObjectList options = ui->optionsGroup->children();
    options.removeOne((QObject *)oldLayout);

    delete oldLayout;

    FlowLayout *optionsFlow = new FlowLayout(ui->optionsGroup, -1, 3, 3);

    optionsFlow->setFixedGrid(true);

    for(QObject *o : options)
      optionsFlow->addWidget(qobject_cast<QWidget *>(o));

    ui->optionsGroup->setLayout(optionsFlow);
  }

  ui->envVar->setEnabled(false);

  m_ProcessModel = new QStandardItemModel(0, 3, this);

  m_ProcessModel->setHeaderData(0, Qt::Horizontal, tr("Name"));
  m_ProcessModel->setHeaderData(1, Qt::Horizontal, tr("PID"));
  m_ProcessModel->setHeaderData(2, Qt::Horizontal, tr("Window Title"));

  QSortFilterProxyModel *proxy = new QSortFilterProxyModel(this);

  proxy->setSourceModel(m_ProcessModel);
  // filter on all columns
  proxy->setFilterKeyColumn(-1);
  // allow updating the underlying model
  proxy->setDynamicSortFilter(true);
  // use case-insensitive filtering
  proxy->setFilterCaseSensitivity(Qt::CaseInsensitive);

  ui->processList->setModel(proxy);
  ui->processList->setAlternatingRowColors(true);

  // sort by PID by default
  ui->processList->sortByColumn(1, Qt::AscendingOrder);

  // Set up warning for host layer config
  initWarning(ui->vulkanLayerWarn);
  ui->vulkanLayerWarn->setVisible(RENDERDOC_NeedVulkanLayerRegistration(NULL, NULL, NULL));
  QObject::connect(ui->vulkanLayerWarn, &RDLabel::clicked, this,
                   &CaptureDialog::vulkanLayerWarn_mouseClick);

  // Set up scanning for Android apps
  initWarning(ui->androidScan);

  // Set up warning for Android apps
  initWarning(ui->androidWarn);
  QObject::connect(ui->androidWarn, &RDLabel::clicked, this, &CaptureDialog::androidWarn_mouseClick);

  m_AndroidFlags = AndroidFlags::NoFlags;

  m_CaptureCallback = captureCallback;
  m_InjectCallback = injectCallback;

  SetSettings(CaptureSettings());

  UpdateGlobalHook();
}
Ejemplo n.º 20
0
void RecipeWidget::init(HeadcookerWindow *win)
{
    ui->setupUi(this);
    this->win = win;

    ui->bodyWidget->setObjectName("body");

    ui->instructions->setObjectName("instructions");
    ui->instructions->verticalScrollBar()->setObjectName("scrollbar");
    ui->backButton->setObjectName("backButton");
    ui->tagWidget->setObjectName("tagBox");
    ui->ingredientBox->setObjectName("ingredientBox");
    ui->instructionBox->setObjectName("instructionBox");
    ui->recipeName->setObjectName("headline");
    ui->subtitle->setObjectName("subtitle");
    ui->servingsText->setObjectName("metaInfo");
    ui->servingsEdit->setObjectName("inputArea");

    connect(ui->backButton, SIGNAL(clicked()), this, SLOT(back()));

    ui->recipeName->setText(recipe->getTitle());
    ui->subtitle->setText(recipe->getSubtitle());
    ui->instructions->setText(recipe->getInstructions());

    updateIngredients();

    //Metainformations
    ui->servingsEdit->setText(QString::number(recipe->getServings()));

    if (ui->metaInfoWidget->layout() != NULL)
        delete ui->metaInfoWidget->layout();
    FlowLayout *metaInfoLayout = new FlowLayout;
    ui->metaInfoWidget->setLayout(metaInfoLayout);
    for (QPair<QString, QString> metaInfo : recipe->getMetaInfo()) {
        QLabel *name = new QLabel(metaInfo.first);
        name->setObjectName("metaInfo");
        QFont font = name->font();
        font.setBold(true);
        name->setFont(font);

        QLabel *value = new QLabel(metaInfo.second);
        value->setObjectName("text");
        metaInfoLayout->addWidget(name);
        metaInfoLayout->addWidget(value);
    }

    //Tags
    if (ui->tagWidget->layout()) {
        delete ui->tagWidget->layout();
    }

    tagLayout = new FlowLayout;
    ui->tagWidget->setLayout(tagLayout);
    for (QString tag : recipe->getTags()) {
       addTag(tag);
    }

    ui->servingsEdit->setValidator(new QDoubleValidator);

    addAddTagButton();

    connect(&leftClickMapper, SIGNAL(mapped(QString)), this, SLOT(leftClick(QString)));
    connect(&rightClickMapper, SIGNAL(mapped(QString)), this, SLOT(rightClick(QString)));

    connect(Options::ptr(), SIGNAL(updated()), this, SLOT(updateStylesheet()));

    connect(ui->servingsEdit, SIGNAL(textChanged(QString)), this, SLOT(updateIngredients(QString)));

    updateStylesheet();
}