AppearanceConfigTab::AppearanceConfigTab(QWidget *parent, TabMode mode) : QWidget(parent), ui(new Ui::ChatWindowConfig) { m_groupChat = mode == GroupChat; ui->setupUi(this); m_demoChatHeader.setChatName(i18n("A demo chat")); m_demoChatHeader.setSourceName(i18n("Jabber")); m_demoChatHeader.setTimeOpened(QDateTime::currentDateTime()); m_demoChatHeader.setDestinationName(i18nc("Example email", "*****@*****.**")); m_demoChatHeader.setDestinationDisplayName(i18nc("Example name", "Ted")); m_demoChatHeader.setGroupChat(m_groupChat); ChatWindowStyleManager *manager = ChatWindowStyleManager::self(); connect(manager, SIGNAL(loadStylesFinished()), SLOT(onStylesLoaded())); //loading theme settings. loadTab(); connect(ui->chatView, SIGNAL(loadFinished(bool)), SLOT(sendDemoMessages())); connect(ui->styleComboBox, SIGNAL(activated(int)), SLOT(onStyleSelected(int))); connect(ui->variantComboBox, SIGNAL(activated(QString)), SLOT(onVariantSelected(QString))); connect(ui->showHeader, SIGNAL(clicked(bool)), SLOT(onShowHeaderChanged(bool))); connect(ui->customFontBox, SIGNAL(clicked(bool)), SLOT(onFontGroupChanged(bool))); connect(ui->fontFamily, SIGNAL(currentFontChanged(QFont)), SLOT(onFontFamilyChanged(QFont))); connect(ui->fontSize, SIGNAL(valueChanged(int)), SLOT(onFontSizeChanged(int))); connect(ui->showPresenceCheckBox, SIGNAL(stateChanged(int)), SLOT(onShowPresenceChangesChanged(int))); sendDemoMessages(); }
/** * @brief DeclarativeWebContainer::reload * Reloads the active tab. If not tabs exist this does nothing. If the page was * virtualized it will be resurrected. */ void DeclarativeWebContainer::reload(bool force) { if (m_tabId > 0) { if (force && m_webPage && m_webPage->viewReady() && m_webPage->tabId() == m_tabId) { // Reload live active tab directly. m_webPage->reload(); } else { loadTab(m_tabId, m_url, m_title, force); } } }
void ReadKkit::readData( const string& line ) { vector< string > argv; chopLine( line, argv ); if ( argv[0] == "simundump" ) undump( argv ); else if ( argv[0] == "addmsg" ) addmsg( argv ); else if ( argv[0] == "call" ) call( argv ); else if ( argv[0] == "simobjdump" ) objdump( argv ); else if ( argv[0] == "xtextload" ) textload( argv ); else if ( argv[0] == "loadtab" ) loadTab( argv ); }
bool ScriptableProxyHelper::loadTab(const QString &arg1) { INVOKE(loadTab(arg1)); return m_wnd->loadTab(arg1); }
/** * Loads a given power tree and sets up the menu accordingly */ void MenuPowers::loadPowerTree(const std::string &filename) { // only load the power tree once per instance if (tree_loaded) return; // First, parse the power tree file FileParser infile; // @CLASS MenuPowers: Power tree layout|Description of powers/trees/ if (infile.open(filename)) { while (infile.next()) { if (infile.new_section) { // for sections that are stored in collections, add a new object here if (infile.section == "power") { slots.push_back(NULL); upgradeButtons.push_back(NULL); power_cell.push_back(Power_Menu_Cell()); } else if (infile.section == "upgrade") power_cell_upgrade.push_back(Power_Menu_Cell()); else if (infile.section == "tab") tabs.push_back(Power_Menu_Tab()); } if (infile.section == "") { // @ATTR background|string|Filename of the default background image if (infile.key == "background") default_background = infile.val; } else if (infile.section == "tab") loadTab(infile); else if (infile.section == "power") loadPower(infile); else if (infile.section == "upgrade") loadUpgrade(infile); } infile.close(); } // save a copy of the base level powers, as they get overwritten during upgrades power_cell_base = power_cell; // store the appropriate level for all upgrades for (unsigned i=0; i<power_cell_upgrade.size(); ++i) { for (unsigned j=0; j<power_cell_base.size(); j++) { std::vector<short>::iterator it = std::find(power_cell_base[j].upgrades.begin(), power_cell_base[j].upgrades.end(), power_cell_upgrade[i].id); if (it != power_cell_base[j].upgrades.end()) { power_cell_upgrade[i].upgrade_level = static_cast<short>(std::distance(power_cell_base[j].upgrades.begin(), it) + 2); break; } } } // combine base and upgrade powers into a single list for (unsigned i=0; i<power_cell_base.size(); ++i) { power_cell_all.push_back(power_cell_base[i]); } for (unsigned i=0; i<power_cell_upgrade.size(); ++i) { power_cell_all.push_back(power_cell_upgrade[i]); } // load any specified graphics into the tree_surf vector Image *graphics; if (tabs.empty() && default_background != "") { graphics = render_device->loadImage(default_background); if (graphics) { tree_surf.push_back(graphics->createSprite()); graphics->unref(); } } else { for (unsigned int i = 0; i < tabs.size(); ++i) { if (tabs[i].background == "") tabs[i].background = default_background; if (tabs[i].background == "") { tree_surf.push_back(NULL); continue; } graphics = render_device->loadImage(tabs[i].background); if (graphics) { tree_surf.push_back(graphics->createSprite()); graphics->unref(); } else { tree_surf.push_back(NULL); } } } // If we have more than one tab, create tab_control if (!tabs.empty()) { tab_control = new WidgetTabControl(); if (tab_control) { // Initialize the tab control. tab_control->setMainArea(window_area.x+tab_area.x, window_area.y+tab_area.y, tab_area.w, tab_area.h); // Define the header. for (unsigned i=0; i<tabs.size(); i++) tab_control->setTabTitle(i, msg->get(tabs[i].title)); tab_control->updateHeader(); } } // create power slots for (unsigned int i=0; i<slots.size(); i++) { if (static_cast<unsigned>(power_cell[i].id) < powers->powers.size()) { slots[i] = new WidgetSlot(powers->powers[power_cell[i].id].icon); slots[i]->setBasePos(power_cell[i].pos.x, power_cell[i].pos.y); tablist.add(slots[i]); if (upgradeButtons[i] != NULL) { upgradeButtons[i]->setBasePos(power_cell[i].pos.x + ICON_SIZE, power_cell[i].pos.y); } } } applyPowerUpgrades(); tree_loaded = true; align(); }