Beispiel #1
0
  QStringList ConfigBase::readProfiles() {

    profiles.clear();

    profiles = xmlPreferences( settingFile() ).getStringList( "Name", "Profile" );

    if ( profiles.isEmpty() || profiles.size() <= 0 ) {

      profiles = searchProfiles();
    }

    return profiles;
  }
Beispiel #2
0
QString Widget::askProfiles()
{   // TODO: allow user to create new Tox ID, even if a profile already exists
    QList<QString> profiles = searchProfiles();
    if (profiles.empty()) return "";
    bool ok;
    QString profile = QInputDialog::getItem(this, 
                                            tr("Choose a profile"),
                                            tr("Please choose which identity to use"),
                                            profiles,
                                            0, // which slot to start on
                                            false, // if the user can enter their own input
                                            &ok);
    if (!ok) // user cancelled
    {
        qApp->quit();
        return "";
    }
    else
        return profile;
}