コード例 #1
0
ファイル: codespinbox.cpp プロジェクト: sakazuki/actiona
	void CodeSpinBox::codeChanged(bool code)
	{
		if(!code)
		{
			if(mPrefix.isEmpty())
				mPrefix = prefix();
			if(mSuffix.isEmpty())
				mSuffix = suffix();

			setPrefix(mPrefix);
			setSuffix(mSuffix);
			
			setButtonSymbols(QAbstractSpinBox::UpDownArrows);
			setValue(text().toInt());
			codeLineEdit()->textChanged(codeLineEdit()->text());
		}
		else
		{
			setButtonSymbols(QAbstractSpinBox::NoButtons);
			
			mPrefix = prefix();
			mSuffix = suffix();
			
			int previousWidth = width();

			setPrefix(QString());
			setSuffix(QString());
			
			setMinimumWidth(previousWidth);//This is a hack to fix widget size under KDE, but a better fix has to be found
		}
	}
コード例 #2
0
// Reactivates all following Plugins
void ParameterFileModel::reactivate(){
    QString tmpPrefix = _prefix;
    QStringList outputsOfOneSlot;
    int parameterIndex = 0;
    for (int p = 0; p < _keys.size(); p++){
        if (_keys[p].contains("active")){
            parameterIndex = p;
            break;
        }
    }
    if (getValue(_keys[parameterIndex]) == "false"){
        setValue(_keys[parameterIndex], "true");
        for (int i = 0; i < tmpPrefix.size(); i++){
            if (tmpPrefix.at(i) == '.'){
                tmpPrefix.truncate(i);
            }
        }
        for (int i = 0; i < getOutputs(tmpPrefix).size(); i++){
            if (getValue(tmpPrefix + "."+ getOutputs(tmpPrefix).at(i)).contains(";")){
                outputsOfOneSlot = getValue(tmpPrefix + "."+ getOutputs(tmpPrefix).at(i)).split(";");
                for (int o = 0; o < outputsOfOneSlot.size(); o++){
                    setPrefix(outputsOfOneSlot.at(o));
                    reactivate();
                }
            }
            else if (getValue(tmpPrefix + "."+ getOutputs(tmpPrefix).at(i)) != ""){
                setPrefix(getValue(tmpPrefix + "."+ getOutputs(tmpPrefix).at(i)));
                reactivate();
            }
        }

    }
}
コード例 #3
0
ファイル: Attribute.cpp プロジェクト: mydw/mydw
int Attribute::setURI(const AxisChar* uri)
{
	#ifdef ENABLE_AXISTRACE
		if (axiscpp::AxisTrace::isTraceOn())
			axiscpp::AxisTrace::traceEntry("Attribute", "setURI", this, 1,
					TRACETYPE_STRING, 0, ((void*)&uri));	  /* AUTOINSERTED TRACE */
	#endif

	if(NULL==uri)
	{
        uri="";
	}
    
	/**
	 * sets the prefix according to the URI
	 */
	
	if(m_prefix != "")
	{
		
		bool bPrefixFound = false;
		list<Namespace*>::iterator	itCurrNamespaceDecl = m_namespaceDecls.begin();
		while( itCurrNamespaceDecl != m_namespaceDecls.end() && !bPrefixFound)
		{
			if( !(bPrefixFound = !strcmp( (*itCurrNamespaceDecl)->getURI(), uri)))
			{
				itCurrNamespaceDecl++;
			}
		}    
		
		if( bPrefixFound)
		{
			setPrefix((*itCurrNamespaceDecl)->getPrefix());
		}
		else
		{
			setPrefix(NULL);
		}
	}
		
	m_uri= uri;
    	{
		#ifdef ENABLE_AXISTRACE
			int traceRet = (AXIS_SUCCESS);
			if (axiscpp::AxisTrace::isTraceOn())
				axiscpp::AxisTrace::traceExit("Attribute", "setURI", this, 0,
					TRACETYPE_INT, 0, ((void*)&traceRet));	  /* AUTOINSERTED TRACE */
			return traceRet;
		#else
			return AXIS_SUCCESS;
		#endif
	}

}
コード例 #4
0
ファイル: codespinbox.cpp プロジェクト: sakazuki/actiona
	QString CodeSpinBox::text()
	{
		QString currentPrefix = prefix();
		QString currentSuffix = suffix();

		setPrefix(QString());
		setSuffix(QString());

		QString value = codeLineEdit()->text();

		setPrefix(currentPrefix);
		setSuffix(currentSuffix);

		return value;
	}
コード例 #5
0
ファイル: extscript.cpp プロジェクト: wlemuel/awesome-widgets
void ExtScript::readConfiguration()
{
    AbstractExtItem::readConfiguration();

    for (int i = directories().count() - 1; i >= 0; i--) {
        if (!QDir(directories().at(i))
                 .entryList(QDir::Files)
                 .contains(fileName()))
            continue;
        QSettings settings(
            QString("%1/%2").arg(directories().at(i)).arg(fileName()),
            QSettings::IniFormat);

        settings.beginGroup(QString("Desktop Entry"));
        setExecutable(settings.value(QString("Exec"), m_executable).toString());
        setPrefix(settings.value(QString("X-AW-Prefix"), m_prefix).toString());
        setStrRedirect(
            settings.value(QString("X-AW-Redirect"), strRedirect()).toString());
        // api == 3
        setFilters(settings.value(QString("X-AW-Filters"), m_filters)
                       .toString()
                       .split(QChar(','), QString::SkipEmptyParts));
        settings.endGroup();
    }

    // update for current API
    if ((apiVersion() > 0) && (apiVersion() < AWESAPI)) {
        qCWarning(LOG_LIB) << "Bump API version from" << apiVersion() << "to"
                           << AWESAPI;
        setApiVersion(AWESAPI);
        writeConfiguration();
    }
}
コード例 #6
0
ファイル: ptree.c プロジェクト: onceking/liblognorm
/**
 * Split the provided tree (node) into two at the provided index into its
 * common prefix. This function exists to support splitting nodes when
 * a mismatch in the common prefix requires that. This function more or less
 * keeps the tree as it is, just changes the structure. No new node is added.
 * Usually, it is desired to add a new node. This must be made afterwards.
 * Note that we need to create a new tree *in front of* the current one, as 
 * the current one contains field etc. subtree pointers.
 * @param[in] tree tree to split
 * @param[in] offs offset into common prefix (must be less than prefix length!)
 */
static inline struct ln_ptree*
splitTree(struct ln_ptree *tree, unsigned short offs)
{
	unsigned char *c;
	struct ln_ptree *r;
	unsigned short newlen;
	ln_ptree **newparentptr;	 /**< pointer in parent that needs to be updated */

	assert(offs < tree->lenPrefix);
	if((r = ln_newPTree(tree->ctx, tree->parentptr)) == NULL)
		goto done;

	ln_dbgprintf(tree->ctx, "splitTree %p at offs %u", tree, offs);
	/* note: the overall prefix is reduced by one char, which is now taken
	 * care of inside the "branch table".
	 */
	c = prefixBase(tree);
//ln_dbgprintf(tree->ctx, "splitTree new bb, *(c+offs): '%s'", c);
	if(setPrefix(r, c, offs, 0) != 0) {
		ln_deletePTree(r);
		r = NULL;
		goto done; /* fail! */
	}

ln_dbgprintf(tree->ctx, "splitTree new tree %p lenPrefix=%u, char '%c'", r, r->lenPrefix, r->prefix.data[0]);
	/* add the proper branch table entry for the new node. must be done
	 * here, because the next step will destroy the required index char!
	 */
	newparentptr = &(r->subtree[c[offs]]);
	r->subtree[c[offs]] = tree;

	/* finally fix existing common prefix */
	newlen = tree->lenPrefix - offs - 1;
	if(tree->lenPrefix > sizeof(tree->prefix) && (newlen <= sizeof(tree->prefix))) {
		/* note: c is a different pointer; the original
		 * pointer is overwritten by memcpy! */
ln_dbgprintf(tree->ctx, "splitTree new case one bb, offs %u, lenPrefix %u, newlen %u", offs, tree->lenPrefix, newlen);
//ln_dbgprintf(tree->ctx, "splitTree new case one bb, *(c+offs): '%s'", c);
		memcpy(tree->prefix.data, c+offs+1, newlen);
		free(c);
	} else {
ln_dbgprintf(tree->ctx, "splitTree new case two bb, offs=%u, newlen %u", offs, newlen);
		memmove(c, c+offs+1, newlen);
	}
	tree->lenPrefix = tree->lenPrefix - offs - 1;

	if(tree->parentptr == 0)
		tree->ctx->ptree = r;	/* root does not have a parent! */
	else
		*(tree->parentptr) = r;
	tree->parentptr = newparentptr;

done:	return r;
}
コード例 #7
0
			void setPrefixAndRegisterAsTemp(std::string const & prefix, uint64_t const numbwt, uint64_t const numgt)
			{
				setPrefix(prefix, numbwt, numgt);
				for ( uint64_t i = 0; i < getGT().size(); ++i )
					::libmaus2::util::TempFileRemovalContainer::addTempFile(getGT()[i]);
				for ( uint64_t i = 0; i < getBWT().size(); ++i )
					::libmaus2::util::TempFileRemovalContainer::addTempFile(getBWT()[i]);
				::libmaus2::util::TempFileRemovalContainer::addTempFile(getHWT());
				::libmaus2::util::TempFileRemovalContainer::addTempFile(getHist());
				::libmaus2::util::TempFileRemovalContainer::addTempFile(getSampledISA());			
			}
コード例 #8
0
ファイル: ptree.c プロジェクト: onceking/liblognorm
struct ln_ptree *
ln_addPTree(struct ln_ptree *tree, es_str_t *str, size_t offs)
{
	struct ln_ptree *r;
	struct ln_ptree **parentptr;	 /**< pointer in parent that needs to be updated */

ln_dbgprintf(tree->ctx, "addPTree: offs %zu", offs);
	parentptr = &(tree->subtree[es_getBufAddr(str)[offs]]);
	/* First check if tree node is totaly empty. If so, we can simply add
	 * the prefix to this node. This case is important, because it happens
	 * every time with a new field.
	 */
	if(isTrueLeaf(tree)) {
		if(setPrefix(tree, es_getBufAddr(str), es_strlen(str), offs) != 0) {
			r = NULL;
		} else {
			r = tree;
		}
		goto done;
	}

	if(tree->ctx->debug) {
		char *cstr = es_str2cstr(str, NULL);
		ln_dbgprintf(tree->ctx, "addPTree: add '%s', offs %zu, tree %p",
			     cstr + offs, offs, tree);
		free(cstr);
	}

	if((r = ln_newPTree(tree->ctx, parentptr)) == NULL)
		goto done;

	if(setPrefix(r, es_getBufAddr(str) + offs + 1, es_strlen(str) - offs - 1, 0) != 0) {
		free(r);
		r = NULL;
		goto done;
	}

	*parentptr = r;

done:	return r;
}
コード例 #9
0
ファイル: Namespace.cpp プロジェクト: Jeffxz/nodeas
	// See E4X 13.2.2, pg 64
    Namespace::Namespace(Atom prefix, Stringp uri, NamespaceType flags)
#ifdef DEBUGGER
		: AvmPlusScriptableObject(sotNamespace())
#endif // DEBUGGER
	{
		// verify our parameters are interned strings
		AvmAssert (uri->isInterned());
		// prefix can be an interned string, undefined, or null
		AvmAssert (AvmCore::isName(prefix) || AvmCore::isNullOrUndefined(prefix));
		setPrefix(prefix);
		setUri(uri, flags);
	}
コード例 #10
0
int QDoubleSpinBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QAbstractSpinBox::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 3)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 3;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QString*>(_v) = prefix(); break;
        case 1: *reinterpret_cast< QString*>(_v) = suffix(); break;
        case 2: *reinterpret_cast< QString*>(_v) = cleanText(); break;
        case 3: *reinterpret_cast< int*>(_v) = decimals(); break;
        case 4: *reinterpret_cast< double*>(_v) = minimum(); break;
        case 5: *reinterpret_cast< double*>(_v) = maximum(); break;
        case 6: *reinterpret_cast< double*>(_v) = singleStep(); break;
        case 7: *reinterpret_cast< double*>(_v) = value(); break;
        }
        _id -= 8;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setPrefix(*reinterpret_cast< QString*>(_v)); break;
        case 1: setSuffix(*reinterpret_cast< QString*>(_v)); break;
        case 3: setDecimals(*reinterpret_cast< int*>(_v)); break;
        case 4: setMinimum(*reinterpret_cast< double*>(_v)); break;
        case 5: setMaximum(*reinterpret_cast< double*>(_v)); break;
        case 6: setSingleStep(*reinterpret_cast< double*>(_v)); break;
        case 7: setValue(*reinterpret_cast< double*>(_v)); break;
        }
        _id -= 8;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 8;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
コード例 #11
0
void ParameterFileModel::clear() {
	if (_parameterFile->getKeyList().size() > 0) {
		bool lock = _resetMutex->tryLock();
		if (lock) {
			beginResetModel();
		}
		_parameterFile->clear();
		_keys.clear();
		setPrefix("");
		if (lock) {
			endResetModel();
			_resetMutex->unlock();
		}
	}
}
コード例 #12
0
ファイル: OSCHandler.cpp プロジェクト: grimtraveller/mlrVST
// Constructor
OSCHandler::OSCHandler(const String &prefix, mlrVSTAudioProcessor * const owner) :
    Thread("OscListener Thread"),
    // incoming ///////////////////////////////////////
    parent(owner), incomingPort(8000),
    s(IpEndpointName("localhost", incomingPort), this),
    // incoming ///////////////////////////////////////
    buffer(), p(buffer, 1536),
    transmitSocket(IpEndpointName("localhost", 8080)),
    // strings ////////////////////////////
    OSCPrefix(prefix), ledStr(OSCPrefix + "led"), ledRowStr(OSCPrefix + "led_row"),
    ledClearStr(OSCPrefix + "clear"), buttonPressMask(OSCPrefix + "press")
{
    // setup the mask
    setPrefix(prefix);
}
コード例 #13
0
ファイル: ImfKeyCode.cpp プロジェクト: cyberCBM/DetectO
KeyCode::KeyCode (int filmMfcCode,
          int filmType,
          int prefix,
          int count,
          int perfOffset,
          int perfsPerFrame,
          int perfsPerCount)
{
    setFilmMfcCode (filmMfcCode);
    setFilmType (filmType);
    setPrefix (prefix);
    setCount (count);
    setPerfOffset (perfOffset);
    setPerfsPerFrame (perfsPerFrame);
    setPerfsPerCount (perfsPerCount);
}
コード例 #14
0
void Inform::setup(const char *prefix)
{
  // Initialize the prefix string
  setPrefix(prefix);

#if POOMA_NO_STRINGSTREAM
  // create an ostrstream, using a fixed-size character buffer for storage
  buffer_m = new char[Inform::bufSize];
  *buffer_m = '\0';
  message_m = new std::ostrstream(buffer_m, Inform::bufSize, std::ios::out);
#else
  // create an ostringstream, which uses its own string for storage
  buffer_m = 0;
  message_m = new std::ostringstream(std::ios::out);
#endif
}
コード例 #15
0
ファイル: tagrenameroptions.cpp プロジェクト: kryptBlue/juk
TagRenamerOptions::TagRenamerOptions(const CategoryID &category)
    : m_category(category.category)
{
    // Set some defaults

    bool disabled;
    unsigned categoryNum = category.categoryNumber;

    switch(category.category) {
    case Title:
    case Artist:
    case Genre:
    case Year:
    case Album:
    case Track:
        disabled = false;
        break;
    default:
        disabled = true;
    }

    // Make sure we don't use translated strings for the config file keys.

    QString typeKey = tagTypeText(category.category, false);
    KConfigGroup config(KGlobal::config(), "FileRenamer");

    if(categoryNum > 0)
        typeKey.append(QString::number(categoryNum));

    setSuffix(config.readEntry(QString("%1Suffix").arg(typeKey), QString()));
    setPrefix(config.readEntry(QString("%1Prefix").arg(typeKey), QString()));

    // Default the emptyAction to ignoring the empty tag.

    const QString emptyAction = config.readEntry(QString("%1EmptyAction").arg(typeKey), QString()).toLower();
    setEmptyAction(IgnoreEmptyTag);

    if(emptyAction == "forceemptyinclude")
        setEmptyAction(ForceEmptyInclude);
    else if(emptyAction == "usereplacementvalue")
        setEmptyAction(UseReplacementValue);

    setEmptyText(config.readEntry(QString("%1EmptyText").arg(typeKey), QString()));
    setTrackWidth(config.readEntry(QString("%1TrackWidth").arg(typeKey), 0));
    setDisabled(config.readEntry(QString("%1Disabled").arg(typeKey), disabled));
}
コード例 #16
0
ファイル: extscript.cpp プロジェクト: wlemuel/awesome-widgets
int ExtScript::showConfiguration(const QVariant args)
{
    Q_UNUSED(args)

    ui->lineEdit_name->setText(name());
    ui->lineEdit_comment->setText(comment());
    ui->label_numberValue->setText(QString("%1").arg(number()));
    ui->lineEdit_command->setText(m_executable);
    ui->lineEdit_prefix->setText(m_prefix);
    ui->checkBox_active->setCheckState(isActive() ? Qt::Checked
                                                  : Qt::Unchecked);
    ui->comboBox_redirect->setCurrentIndex(static_cast<int>(m_redirect));
    ui->spinBox_interval->setValue(interval());
    // filters
    ui->checkBox_colorFilter->setCheckState(
        m_filters.contains(QString("color")) ? Qt::Checked : Qt::Unchecked);
    ui->checkBox_linesFilter->setCheckState(
        m_filters.contains(QString("newline")) ? Qt::Checked : Qt::Unchecked);
    ui->checkBox_spaceFilter->setCheckState(
        m_filters.contains(QString("space")) ? Qt::Checked : Qt::Unchecked);

    int ret = exec();
    if (ret != 1)
        return ret;
    setName(ui->lineEdit_name->text());
    setComment(ui->lineEdit_comment->text());
    setNumber(ui->label_numberValue->text().toInt());
    setApiVersion(AWESAPI);
    setExecutable(ui->lineEdit_command->text());
    setPrefix(ui->lineEdit_prefix->text());
    setActive(ui->checkBox_active->checkState() == Qt::Checked);
    setStrRedirect(ui->comboBox_redirect->currentText());
    setInterval(ui->spinBox_interval->value());
    // filters
    updateFilter(QString("color"),
                 ui->checkBox_colorFilter->checkState() == Qt::Checked);
    updateFilter(QString("newline"),
                 ui->checkBox_linesFilter->checkState() == Qt::Checked);
    updateFilter(QString("space"),
                 ui->checkBox_spaceFilter->checkState() == Qt::Checked);

    writeConfiguration();
    return ret;
}
コード例 #17
0
ファイル: console.cpp プロジェクト: wdobbie/Nexpo
Console::Console(QWidget *parent)
    : QPlainTextEdit(parent)
    , m_commandLineReady(false)
    , m_historyPos(-1)
    , m_completer(0)
{
    QFont f;
#ifdef Q_OS_LINUX
    f.setFamily("Monospace");
    f.setPointSize(12);
#elif defined(Q_OS_MAC)
    f.setFamily("Menlo");
    f.setPointSize(12);
#else
    f.setFamily("Consolas");
    f.setPointSize(12);
#endif
    setFont(f);

    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    setUndoRedoEnabled(false);
    //setLineWrapMode(QPlainTextEdit::NoWrap);
    //setWordWrapMode(QTextOption::NoWrap);
    setBackgroundVisible(false);
    setFrameStyle(QFrame::NoFrame);
    setTabStopWidth(40);
    setAcceptDrops(false);
    setPrefix("Nexpo> ");
    setPrefixColor(QColor(30, 128, 50));
    f.setBold(true);
    setPrefixFont(f);

    m_errorColor = QColor(200, 0, 0);

    // Restore saved history from last session
    QSettings settings;
    m_history = settings.value("consoleCommandHistory").toStringList();

    prepareCommandLine();
}
コード例 #18
0
ファイル: fs.cpp プロジェクト: RobLoach/scummvm
FSDirectory::FSDirectory(const String &prefix, const String &name, int depth, bool flat)
    : _node(name), _cached(false), _depth(depth), _flat(flat) {

    setPrefix(prefix);
}
コード例 #19
0
ファイル: ircsender.cpp プロジェクト: EldFitheach/Mudlet
/*!
    Constructs a new IrcSender, optionally initializing to \a prefix.
 */
IrcSender::IrcSender(const QString& prefix)
{
    setPrefix(prefix);
}
コード例 #20
0
ファイル: HumdrumLine.cpp プロジェクト: humdrum-tools/humlib
HumdrumLine::HumdrumLine(void) : string() {
	owner = NULL;
	duration = -1;
	durationFromStart = -1;
	setPrefix("!!");
}
コード例 #21
0
ファイル: HumdrumLine.cpp プロジェクト: humdrum-tools/humlib
HumdrumLine::HumdrumLine(const char* aString) : string(aString) {
	owner = NULL;
	duration = -1;
	durationFromStart = -1;
	setPrefix("!!");
}
コード例 #22
0
ファイル: VariablePool.cpp プロジェクト: smtrat/carl
VariablePool::VariablePool() noexcept {
	CARL_LOG_INFO("carl.varpool", "Constructor called");
	clear();
	setPrefix();
}
コード例 #23
0
ファイル: mainwindow.cpp プロジェクト: Vdragon/q4wine
MainWindow::MainWindow(int startState, QString run_binary, QWidget * parent, Qt::WindowFlags f) : QMainWindow(parent, f){
     // Loading libq4wine-core.so
#ifdef RELEASE
    libq4wine.setFileName(_CORELIB_PATH_);
#else
    libq4wine.setFileName("../q4wine-lib/libq4wine-core");
#endif
    if (!libq4wine.load()){
        libq4wine.load();
    }

    // Getting corelib class pointer
    CoreLibClassPointer = (CoreLibPrototype *) libq4wine.resolve("createCoreLib");
    CoreLib.reset((corelib *)CoreLibClassPointer(true));

    clearTmp();

    db_prefix.fixPrefixPath();

    if (CoreLib->getSetting("DesktopImport", "importAtStartup", false, 0)==1){
        Progress progress(0, "");
        progress.exec();
    }

    //  importIcons(QString("%1/.local/share/applications/wine/").arg(QDir::homePath()));

    //exportProcess.close();
    // Base GUI setup
    setupUi(this);

    if (!this->createSocket()){
        this->close();
        return;
     }

    if (startState == 1)
        this->showMinimized();

    setWindowTitle(tr("%1 :. Qt GUI for Wine v%2").arg(APP_NAME) .arg(APP_VERS));

    std::auto_ptr<QVBoxLayout> vlayout (new QVBoxLayout);

    std::auto_ptr<PrefixConfigWidget> configWidget (new PrefixConfigWidget(tabPrefixSeup));
    connect(configWidget.get(), SIGNAL(updateDatabaseConnections()), this, SLOT(updateDtabaseConnectedItems()));
    connect(configWidget.get(), SIGNAL(setTabIndex (int)), tbwGeneral, SLOT(setCurrentIndex (int)));
    connect(this, SIGNAL(updateDatabaseConnections()), configWidget.get(), SLOT(getPrefixes()));

    std::auto_ptr<LoggingWidget> logWidget (new LoggingWidget(tabLogging));
    connect (this, SIGNAL(reloadLogData()), logWidget.get(), SLOT(getLogRecords()));

    logWidget->getLogRecords();

    logLayout->addWidget(logWidget.release());

    std::auto_ptr<IconListWidget> lstIcons (new IconListWidget(tabPrograms));
    connect(this, SIGNAL(runProgramRequest(QString)), lstIcons.get(), SLOT(runProgramRequest(QString)));
    connect(lstIcons.get(), SIGNAL(iconItemClick(QString, QString, QString, QString, QString)), this, SLOT(updateIconDesc(QString, QString, QString, QString, QString)));
    connect(lstIcons.get(), SIGNAL(changeStatusText(QString)), this, SLOT(changeStatusText(QString)));
    connect(lstIcons.get(), SIGNAL(appRunned(bool)), this, SLOT(setMeVisible(bool)));

    std::auto_ptr<PrefixTreeWidget> twPrograms (new PrefixTreeWidget(tabPrograms));
    connect(twPrograms.get(), SIGNAL(updateDatabaseConnections()), this, SLOT(updateDtabaseConnectedItems()));
    connect(this, SIGNAL(updateDatabaseConnections()), twPrograms.get(), SLOT(getPrefixes()));
    connect(twPrograms.get(), SIGNAL(showFolderContents(QString, QString)), lstIcons.get(), SLOT(showFolderContents(QString, QString)));
    connect(twPrograms.get(), SIGNAL(setSearchFocus()), this, SLOT(setSearchFocus()));
    connect(twPrograms.get(), SIGNAL(changeStatusText(QString)), this, SLOT(changeStatusText(QString)));
    connect(this, SIGNAL(setDefaultFocus(QString, QString)), twPrograms.get(), SLOT(setDefaultFocus(QString, QString)));
    connect(configWidget.get(), SIGNAL(prefixIndexChanged(QString)), twPrograms.get(), SLOT(setDefaultFocus(QString)));
    connect(twPrograms.get(), SIGNAL(prefixIndexChanged(QString)), configWidget.get(), SLOT(setPrefix(QString)));
    connect(twPrograms.get(), SIGNAL(setTabIndex (int)), tbwGeneral, SLOT(setCurrentIndex (int)));

    connect(twPrograms.get(), SIGNAL(pasteAction()), lstIcons.get(), SLOT(iconPaste_Click()));


    std::auto_ptr<WineProcessWidget> procWidget (new WineProcessWidget(tabProcess));
    connect(this, SIGNAL(stopProcTimer()), procWidget.get(), SLOT(stopTimer()));
    connect(this, SIGNAL(startProcTimer()), procWidget.get(), SLOT(startTimer()));
    connect(procWidget.get(), SIGNAL(changeStatusText(QString)), this, SLOT(changeStatusText(QString)));
    tabProcessLayout->addWidget(procWidget.release());

    std::auto_ptr<PrefixControlWidget> prefixWidget (new PrefixControlWidget(tabPrefix));
    connect(prefixWidget.get(), SIGNAL(updateDatabaseConnections()), twPrograms.get(), SLOT(getPrefixes()));
    connect(prefixWidget.get(), SIGNAL(updateDatabaseConnections()), this, SLOT(updateDtabaseConnectedItems()));
    connect(configWidget.get(), SIGNAL(prefixIndexChanged(QString)), prefixWidget.get(), SLOT(setDefaultFocus(QString)));
    connect(prefixWidget.get(), SIGNAL(prefixIndexChanged(QString)), configWidget.get(), SLOT(setPrefix(QString)));
    connect(prefixWidget.get(), SIGNAL(setTabIndex (int)), tbwGeneral, SLOT(setCurrentIndex (int)));
    connect(twPrograms.get(), SIGNAL(updateDatabaseConnections()), prefixWidget.get(), SLOT(updateDtabaseItems()));

    std::auto_ptr<IconListToolbar> iconToolBar (new IconListToolbar(tabPrograms));
    connect(iconToolBar.get(), SIGNAL(searchFilterChange(QString)), lstIcons.get(), SLOT(setFilterString(QString)));
    connect(iconToolBar.get(), SIGNAL(changeView(int)), lstIcons.get(), SLOT(changeView(int)));

    std::auto_ptr<PrefixTreeToolbar> prefixToolBar (new PrefixTreeToolbar(tabPrograms));
    connect(prefixToolBar.get(), SIGNAL(expandTree()), twPrograms.get(), SLOT(expandTree()));
    connect(prefixToolBar.get(), SIGNAL(collapseTree()), twPrograms.get(), SLOT(collapseTree()));
    connect(prefixToolBar.get(), SIGNAL(updatePrefixTree()), this, SLOT(updateDtabaseConnectedItems()));
    connect(prefixToolBar.get(), SIGNAL(updatePrefixTree()), prefixWidget.get(), SLOT(updateDtabaseItems()));

    vlayout.reset(new QVBoxLayout);
    vlayout->addWidget(prefixToolBar.release());
    vlayout->addWidget(twPrograms.release());
    vlayout->setMargin(0);
    vlayout->setSpacing(0);
    std::auto_ptr<QWidget> wid (new QWidget(tabPrograms));
    wid->setLayout(vlayout.release());

    splitter.reset(new QSplitter(tabPrograms));
    splitter->addWidget(wid.release());

    vlayout.reset(new QVBoxLayout);
    vlayout->addWidget(iconToolBar.release());
    vlayout->addWidget(lstIcons.release());
    vlayout->setMargin(0);
    vlayout->setSpacing(0);
    //vlayout->setContentsMargins(0,0,0,0);
    wid.reset(new QWidget(tabPrograms));
    wid->setLayout(vlayout.release());

    splitter->addWidget(wid.release());

    vlayout.reset(new QVBoxLayout);
    vlayout->addWidget(splitter.get());
    vlayout->addWidget(gbInfo);

    vlayout->setContentsMargins(3,0,3,3);
    tabPrograms->setLayout(vlayout.release());
    tabPrefixLayout->addWidget(prefixWidget.release());
    setupLayout->addWidget(configWidget.release());

    // Updating database connected items
    updateDtabaseConnectedItems();

    // Getting settings from config file
    this->createTrayIcon();
    this->getSettings();

    connect(tbwGeneral, SIGNAL(currentChanged(int)), this, SLOT(tbwGeneral_CurrentTabChange(int)));
    //connect(cmdCreateFake, SIGNAL(clicked()), this, SLOT(cmdCreateFake_Click()));
    //connect(cmdUpdateFake, SIGNAL(clicked()), this, SLOT(cmdUpdateFake_Click()));

    //Main menu actions connection to slots
    connect(mainRun, SIGNAL(triggered()), this, SLOT(mainRun_Click()));
    connect(mainPrograms, SIGNAL(triggered()), this, SLOT(mainPrograms_Click()));
    connect(mainLogging, SIGNAL(triggered()), this, SLOT(mainLogging_Click()));
    connect(mainProcess, SIGNAL(triggered()), this, SLOT(mainProcess_Click()));
    connect(mainSetup, SIGNAL(triggered()), this, SLOT(mainSetup_Click()));
    connect(mainPrefix, SIGNAL(triggered()), this, SLOT(mainPrefix_Click()));
    connect(mainImageManage, SIGNAL(triggered()), this, SLOT(mainImageManager_Click()));
    connect(mainAbout, SIGNAL(triggered()), this, SLOT(mainAbout_Click()));
    connect(mainAboutQt, SIGNAL(triggered()), this, SLOT(mainAboutQt_Click()));
    connect(mainExportIcons, SIGNAL(triggered()), this, SLOT(mainExportIcons_Click()));
    connect(mainOptions, SIGNAL(triggered()), this, SLOT(mainOptions_Click()));
    connect(mainInstall, SIGNAL(triggered()), this, SLOT(mainInstall_Click()));
    connect(mainExit, SIGNAL(triggered()), this, SLOT(mainExit_Click()));
    connect(mainImportWineIcons, SIGNAL(triggered()), this, SLOT(mainImportWineIcons_Click()));
    connect(mainVersionManager, SIGNAL(triggered()), this, SLOT(mainVersionManager_Click()));

    CoreLib->runAutostart();

#ifndef WITH_ICOUTILS
    mainExportIcons->setEnabled(false);
#endif

    if (!run_binary.isEmpty())
        messageReceived(run_binary);

    if (!trayIcon->isVisible())
        show();

    return;
}
コード例 #24
0
ファイル: edsbprecio.cpp プロジェクト: tranfuga25s/gestotux
EDSBPrecio::EDSBPrecio(QWidget *parent)
 : QDoubleSpinBox( parent )
{
 setPrefix( "$ " );
 setDecimals( 2 );
}
コード例 #25
0
int AbstractMeter::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = WidgetWithBackground::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: valueChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 1: valueChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 2: setValue((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 3: setValue((*reinterpret_cast< double(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 4;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< double*>(_v) = minimum(); break;
        case 1: *reinterpret_cast< double*>(_v) = maximum(); break;
        case 2: *reinterpret_cast< double*>(_v) = value(); break;
        case 3: *reinterpret_cast< double*>(_v) = nominal(); break;
        case 4: *reinterpret_cast< double*>(_v) = critical(); break;
        case 5: *reinterpret_cast< QString*>(_v) = prefix(); break;
        case 6: *reinterpret_cast< QString*>(_v) = suffix(); break;
        case 7: *reinterpret_cast< QFont*>(_v) = valueFont(); break;
        case 8: *reinterpret_cast< double*>(_v) = valueOffset(); break;
        case 9: *reinterpret_cast< QFont*>(_v) = digitFont(); break;
        case 10: *reinterpret_cast< double*>(_v) = digitOffset(); break;
        }
        _id -= 11;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setMinimum(*reinterpret_cast< double*>(_v)); break;
        case 1: setMaximum(*reinterpret_cast< double*>(_v)); break;
        case 2: setValue(*reinterpret_cast< double*>(_v)); break;
        case 3: setNominal(*reinterpret_cast< double*>(_v)); break;
        case 4: setCritical(*reinterpret_cast< double*>(_v)); break;
        case 5: setPrefix(*reinterpret_cast< QString*>(_v)); break;
        case 6: setSuffix(*reinterpret_cast< QString*>(_v)); break;
        case 7: setValueFont(*reinterpret_cast< QFont*>(_v)); break;
        case 8: setValueOffset(*reinterpret_cast< double*>(_v)); break;
        case 9: setDigitFont(*reinterpret_cast< QFont*>(_v)); break;
        case 10: setDigitOffset(*reinterpret_cast< double*>(_v)); break;
        }
        _id -= 11;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 11;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}