ProfileOpenDlg::ProfileOpenDlg(const QString &def, const VarList &_langs, const QString &curLang, QWidget *parent) :QDialog(parent) { setupUi(this); setModal(true); setWindowTitle(CAP(caption())); langs = _langs; // insert the logo QPixmap logo = (QPixmap)IconsetFactory::icon("psi/psiLogo").pixmap(); lb_logo->setPixmap(logo); lb_logo->setFixedSize(logo.width(), logo.height()); lb_logo->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); //setFixedWidth(logo->width()); QImage logoImg = logo.convertToImage(); QPixmap tmp; tmp.convertFromImage( logoImg.copy(0, 0, 1, logoImg.height()) ); StretchLogoLabel *stretch = new StretchLogoLabel(tmp, lb_left); tmp.convertFromImage( logoImg.copy(logoImg.width()-1, 0, 1, logoImg.height()) ); stretch = new StretchLogoLabel(tmp, lb_right); // setup signals connect(pb_open, SIGNAL(clicked()), SLOT(accept())); connect(pb_close, SIGNAL(clicked()), SLOT(reject())); connect(pb_profiles, SIGNAL(clicked()), SLOT(manageProfiles())); connect(cb_lang, SIGNAL(activated(int)), SLOT(langChange(int))); int x = 0; langSel = x; for(VarList::ConstIterator it = langs.begin(); it != langs.end(); ++it) { cb_lang->insertItem((*it).data()); if((curLang.isEmpty() && x == 0) || (curLang == (*it).key())) { cb_lang->setCurrentItem(x); langSel = x; } ++x; } // QWhatsThis helpers cb_profile->setWhatsThis( tr("Select a profile to open from this list.")); cb_lang->setWhatsThis( tr("Select a language you would like Synapse-IM to use from this " "list. You can download extra language packs from the Synapse-IM homepage.")); ck_auto->setWhatsThis( tr("Automatically open this profile when Synapse-IM is started. Useful if " "you only have one profile.")); reload(def); }
ViewProfilesManageController::ViewProfilesManageController( KXMLGUIClient* guiClient, ByteArrayViewProfileManager* viewProfileManager, QWidget* parentWidget ) : mParentWidget( parentWidget ), mViewProfileManager( viewProfileManager ) { KActionCollection* actionCollection = guiClient->actionCollection(); mManageAction = actionCollection->addAction( QLatin1String("settings_profiles_manage"), this, SLOT(manageProfiles()) ); mManageAction->setText( i18nc("@action:inmenu", "Manage View Profiles...") ); }