void ArgsProcess::process(int argc, const char* argv[])
{
    //only has support for executable path
    //only works for Globals
    //more to come later
    
    sel::State state{true};
    
    std::map<std::string, std::unique_ptr<MultiPointer> > t_map;
    
    //add to map
    t_map["exec_path"] = std::make_unique<MultiPointer>(&Globals::exec_path);
    t_map["IS_DEBUG"] = std::make_unique<MultiPointer>(&Globals::IS_DEBUG);
    t_map["FPS_CAP"] = std::make_unique<MultiPointer>(&Globals::FPS_CAP);
    
    //ignore first one
    //os made
    std::string temp_path = argv[0];
    Globals::exec_path = temp_path.substr(0, temp_path.find_last_of("/") );
    
    //iterates over array
    //ignores first one
    for(int i = 1; i < argc; i++)
    {
        std::string arg = argv[i];
        arg = arg.substr(arg.find_first_of("-") + 1, std::string::npos);
        
        std::string name = arg.substr(0, arg.find_first_of("=") );
        
        std::cout << "ARG: " << arg << std::endl;
        addToLua(arg, state);
        
        addToC(t_map, name, state);
    }
}
Esempio n. 2
0
Prefs_TableOfContents::Prefs_TableOfContents(QWidget* parent, ScribusDoc* doc)
	: Prefs_Pane(parent),
	m_Doc(doc)
{
	setupUi(this);
	languageChange();
	itemDestFrameComboBox->setMaximumWidth(fontMetrics().width( "This is a very long Name" ));
	itemAttrComboBox->setMaximumWidth(fontMetrics().width( "This is a very long Name" ));
	itemNumberPlacementComboBox->setMaximumWidth(fontMetrics().width( "This is a very long Name" ));
	itemParagraphStyleComboBox->setMaximumWidth(fontMetrics().width( "This is a very long Name" ));

	// signals and slots connections
	//do not connect( tocListBox, SIGNAL( currentRowChanged(int) ), this, SLOT( selectToC(int) ) );
	connect( tocAddButton, SIGNAL( clicked() ), this, SLOT( addToC() ) );
	connect( tocDeleteButton, SIGNAL( clicked() ), this, SLOT( deleteToC() ) );
	connect( itemAttrComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemAttributeSelected(const QString&) ) );
	connect( itemDestFrameComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemFrameSelected(const QString&) ) );
	connect( itemParagraphStyleComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemParagraphStyleSelected(const QString&) ) );
	connect( itemNumberPlacementComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemPageNumberPlacedSelected(const QString&) ) );
	connect( tocNameLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( setToCName(const QString&) ) );
	connect( itemListNonPrintingCheckBox, SIGNAL( toggled(bool) ), this, SLOT( nonPrintingFramesSelected(bool) ) );
	setCurrentComboItem(itemNumberPlacementComboBox, trStrPNEnd);
	numSelected=999;
}