void BrowserProcessImpl::EndSession()
{
    // Mark all the profiles as clean.
    ProfileManager* pm = profile_manager();
    std::vector<Profile*> profiles(pm->GetLoadedProfiles());
    for(size_t i=0; i<profiles.size(); ++i)
    {
        profiles[i]->MarkAsCleanShutdown();
    }

    // Tell the metrics service it was cleanly shutdown.
    //MetricsService* metrics = g_browser_process->metrics_service();
    //if(metrics && local_state())
    //{
    //    metrics->RecordStartOfSessionEnd();

    //    // MetricsService lazily writes to prefs, force it to write now.
    //    local_state()->SavePersistentPrefs();
    //}

    // We must write that the profile and metrics service shutdown cleanly,
    // otherwise on startup we'll think we crashed. So we block until done and
    // then proceed with normal shutdown.
    //BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
    //    NewRunnableFunction(PostQuit, MessageLoop::current()));
    MessageLoop::current()->Run();
}
Esempio n. 2
0
bool HMDDevice::Initialize(DeviceBase* parent)
{
    pParent = parent;

    // Initialize user profile to default for device.
    ProfileManager* profileManager = GetManager()->GetProfileManager();    
    ProfileName = profileManager->GetDefaultProfileName(getDesc()->GetProfileType());

    return true;
}
Esempio n. 3
0
void QX::launch_clicked()
{
    int sel = GetClickedId();
    if (sel<0) return;

    DesktopEntry entry = scanner->entries[sel];
    QString appname = entry.file;

    ProfileManager *mngr = new ProfileManager();
    AppProfile prof = mngr->GetAppProfile(appname);
    delete mngr;

#ifdef QTOPIA
    if (prof.antiDim)
    {
        powerConstraint = QtopiaApplication::Disable;
    }
    else if (prof.antiSuspend)
    {
        powerConstraint = QtopiaApplication::DisableSuspend;
    }

    if (prof.gps)
        gpsPower("1");
#endif

    if (prof.init != "")
        system(prof.init.toUtf8().data());

    //if (prof.qvga) { }

    QString cmd = entry.exec;

    if ((prof.wm) || (prof.kbd))
    {
        QString script = "/tmp/.QX_app_launcher.sh";
        QFile f(script);
        if (f.open(QIODevice::WriteOnly))
        {
            f.write("matchbox-window-manager &\n");
            f.write("sleep 5\n");
            if (prof.kbd)
                f.write("matchbox-keyboard &\n");
            f.write(entry.exec.toUtf8());
            f.close();
        }
        cmd = "sh " + script;
    }

    QString applabel = "<b>"+entry.name+"</b><br/>"+entry.exec;
    runApp(cmd, applabel, prof.rotate);
}
Esempio n. 4
0
Profile* HMDDeviceCreateDesc::GetProfileAddRef() const
{
    // Create device may override profile name, so get it from there is possible.
    ProfileManager* profileManager = GetManagerImpl()->GetProfileManager();
    ProfileType     profileType    = GetProfileType();
    const char *    profileName    = pDevice ?
                        ((HMDDevice*)pDevice)->GetProfileName() :
                        profileManager->GetDefaultProfileName(profileType);
    
    return profileName ? 
        profileManager->LoadProfile(profileType, profileName) :
        profileManager->GetDeviceDefaultProfile(profileType);
}
Esempio n. 5
0
        virtual void callback()
        {
            core::stringw info_text("");
            if (isSuccess())
            {
                PlayerManager::getCurrentOnlineProfile()->removeFriend(m_id);
                ProfileManager *pm = ProfileManager::get();
                pm->moveToCache(m_id);
                pm->getProfileByID(m_id)->deleteRelationalInfo();
                OnlineProfileFriends::getInstance()->refreshFriendsList();
                info_text = _("Friend removed!");
            }
            else
                info_text = getInfo();

            UserInfoDialog *info = new UserInfoDialog(m_id, info_text, 
                                                      !isSuccess(), true);
            GUIEngine::DialogQueue::get()->pushDialog(info, true);

        }   // callback
Esempio n. 6
0
        /** Callback for the request to cancel a friend invitation. Shows a
        *  confirmation message and takes care of updating all the cached
        *  information.
        */
        virtual void callback()
        {
            uint32_t id(0);
            getXMLData()->get("friendid", &id);
            core::stringw info_text("");
            if (isSuccess())
            {
                PlayerManager::getCurrentOnlineProfile()->removeFriend(id);
                ProfileManager *pm = ProfileManager::get();
                pm->moveToCache(id);
                pm->getProfileByID(id)->deleteRelationalInfo();
                OnlineProfileFriends::getInstance()->refreshFriendsList();
                info_text = _("Friend request cancelled!");
            }
            else
                info_text = getInfo();

            UserInfoDialog *dia = new UserInfoDialog(id, info_text,
                                                     !isSuccess(), true);
            GUIEngine::DialogQueue::get()->pushDialog(dia, true);
        }   // callback
Esempio n. 7
0
/**
 * 初始化 profile 部分
 *
 * @param path     数据存放路径
 *
 * @return  0: success ;   -1: 程序处理失败
 */
int initProfile(const char * path, bool sync = true, bool buildHF = false)
{
    ProfileManager * mgr = ProfileManager::getInstance();

    if ( NULL == mgr )
    {
        TERR("ProfileManager instance is null");
        return -1;
    }

    if ( (NULL == path) || strlen( path ) <= 0 )
    {
        TERR("profile node's path attribute is null");
        return -1;
    }

    if ( mgr->getProfileDocNum() > 0 )
    {
        TLOG("profile has been loaded!");
        return 0;
    }

    mgr->setProfilePath( path );
    mgr->setDataSync( sync );

    TLOG("begin to load profile! path:%s", path);

    if ( 0 != mgr->load(!buildHF) )
    {
        TERR("load profile failed! path:%s", path);
        return -1;
    }

    TLOG("load profile success!");

    return 0;
}
Esempio n. 8
0
int main(int argc, char* argv[])
{
    int      ret        = 0;

    char     *path      = NULL;
    uint32_t doc_id     = 0;
    uint32_t doc_count  = 0;

    // parse args
    if (argc < 4) {
        show_usage(basename(argv[0]));
        return -1;
    }

    for(int ch; -1 != (ch = getopt(argc, argv, "p:d:"));)
    {
        switch(ch)
        {
            case 'p':
                path = optarg;
                break;
            
            case 'd':
                doc_id = strtoul(optarg, NULL, 10);
                break;

            case '?':
            default:
                show_usage(basename(argv[0]));
                return -1;
        }
    }

    ProfileManager *pManager = ProfileManager::getInstance();
    pManager->setProfilePath(path);
    const ProfileField * pField = NULL;

    do {
        // load profile
        if ((ret = pManager->load(false)) != 0) {
            printf("Load profile failed!\n");
            break;
        }

        doc_count = pManager->getProfileDocNum();
        if (doc_id >= doc_count) {
            printf("target docid not exist!\n");
            break;
        }

        ProfileDocAccessor *pDocAccessor = ProfileManager::getDocAccessor();
        pField = pDocAccessor->getProfileField("ends");
        if (pField == NULL) {
            printf("ends field not exist!\n");
            break;
        }

        if (pDocAccessor->getFieldFlag(pField) != F_TIME) {
            printf("field not ends flag!\n");
            break;
        }

        if (pField->type != DT_UINT64) {
            printf("ends field wrong type!\n");
            break;
        }

        EndsTimeProcessor process(pField);
        uint32_t curTime = time(NULL);
        uint32_t ends = process.getValidEndTime(doc_id, curTime);
        printf("doc_id [%u] cur_time [%u]:\t ends [%u]\n", doc_id, curTime, ends);
    }
    while(0);

    ProfileManager::freeInstance();
    EndsTimeManager::freeInstance();
    return ret;
}
int main(int argc, char* argv[])
{
    char *path       = NULL;
    char field_name[100];

    uint32_t doc_num  = 0;
    uint32_t doc_count  = 0;
    int8_t   value_int8 = 0;
    int16_t  value_int16 = 0;
    int32_t  value_int32 = 0;
    int64_t  value_int64 = 0;
    uint8_t  value_uint8 = 0;
    uint16_t value_uint16 = 0;
    uint32_t value_uint32 = 0;
    uint64_t value_uint64 = 0;
    float    value_float = 0;
    double   value_double = 0;
    const char* value_str = NULL;
    int      ret      = 0;

    struct timeval tv_begin;
    struct timeval tv_end;
    struct timeval tv_total;
    srand(time(NULL));
    // parse args

    if (argc < 6) {
        show_usage(basename(argv[0]));
        return -1;
    }

    for(int ch; -1 != (ch = getopt(argc, argv, "p:d:f:"));)
    {
        switch(ch)
        {
            case 'p':
                path = optarg;
                break;
            
            case 'd':
                doc_num = strtoul(optarg, NULL, 10);
                break;

            case 'f':
                snprintf(field_name, 100, "%s", optarg);
                break;

            case '?':
            default:
                show_usage(basename(argv[0]));
                return -1;
        }
    }

    uint32_t *targetDocs = NULL;
    targetDocs = (uint32_t*)malloc(sizeof(uint32_t) * doc_num);

    ProfileManager *pManager = ProfileManager::getInstance();
    pManager->setProfilePath(path);
    const ProfileField * pField = NULL;

    do {
        // load profile
        if ((ret = pManager->load(false)) != 0) {
            printf("Load profile failed!\n");
            break;
        }

        doc_count = pManager->getProfileDocNum();
        for (uint32_t pos=0; pos< doc_num; ++pos) {
            targetDocs[pos] = rand()%doc_count;
        }   

        ProfileDocAccessor *pDocAccessor = ProfileManager::getDocAccessor();
        pField = pDocAccessor->getProfileField(field_name);
        if (pField == NULL) {
            printf("%s field not exist!\n", field_name);
            break;
        }

        printf("begin!****************************\n");
        gettimeofday(&tv_begin, NULL);

        switch(pField->type) {
            case DT_INT8:
                for(uint32_t pos = 0; pos < doc_num; ++pos) {
                    value_int8 = pDocAccessor->getInt8(targetDocs[pos], pField);
                    //printf("%d\n", value_int8);
                }
                break;

            case DT_INT16:
                for(uint32_t pos = 0; pos < doc_num; ++pos) {
                    value_int16 = pDocAccessor->getInt16(targetDocs[pos], pField);
                    //printf("%d\n", value_int16);
                }
                break;

            case DT_INT32:
                for(uint32_t pos = 0; pos < doc_num; ++pos) {
                    value_int32 = pDocAccessor->getInt32(targetDocs[pos], pField);
                    //printf("%d\n", value_int32);
                }
                break;

            case DT_INT64:
                for(uint32_t pos = 0; pos < doc_num; ++pos) {
                    value_int64 = pDocAccessor->getInt64(targetDocs[pos], pField);
                    //printf("%ld\n", value_int64);
                }
                break;

            case DT_UINT8:
                for(uint32_t pos = 0; pos < doc_num; ++pos) {
                    value_uint8 = pDocAccessor->getUInt8(targetDocs[pos], pField);
                    //printf("%u\n", value_uint8);
                }
                break;

            case DT_UINT16:
                for(uint32_t pos = 0; pos < doc_num; ++pos) {
                    value_uint16 = pDocAccessor->getUInt16(targetDocs[pos], pField);
                    //printf("%u\n", value_uint16);
                }
                break;

            case DT_UINT32:
                for(uint32_t pos = 0; pos < doc_num; ++pos) {
                    value_uint32 = pDocAccessor->getUInt32(targetDocs[pos], pField);
                    //printf("%u\n", value_uint32);
                }
                break;

            case DT_UINT64:
                for(uint32_t pos = 0; pos < doc_num; ++pos) {
                    value_uint64 = pDocAccessor->getUInt64(targetDocs[pos], pField);
                    //printf("%lu\n", value_uint64);
                }
                break;

            case DT_FLOAT:
                for(uint32_t pos = 0; pos < doc_num; ++pos) {
                    value_float = pDocAccessor->getFloat(targetDocs[pos], pField);
                    //printf("%f\n", value_float);
                }
                break;

            case DT_DOUBLE:
                for(uint32_t pos = 0; pos < doc_num; ++pos) {
                    value_double = pDocAccessor->getDouble(targetDocs[pos], pField);
                    //printf("%lf\n", value_double);
                }
                break;

            case DT_STRING:
                for(uint32_t pos = 0; pos < doc_num; ++pos) {
                    value_str = pDocAccessor->getString(targetDocs[pos], pField);
                    //printf("%s\n", value_str);
                }
                break;

            default:
                printf("invalid type!\n");
        }

        gettimeofday(&tv_end, NULL);
        timersub(&tv_end, &tv_begin, &tv_total);
        fprintf(stderr, "time consumed: %ld.%06ld s\n", tv_total.tv_sec, tv_total.tv_usec);
    }
    while(0);

    printf("int8:%d\n", value_int8);
    printf("int16:%d\n", value_int16);
    printf("int32:%d\n", value_int32);
    printf("int64:%ld\n", value_int64);
    printf("uint8:%u\n", value_uint8);
    printf("uint16:%u\n", value_uint16);
    printf("uint32:%u\n", value_uint32);
    printf("uint64:%lu\n", value_uint64);
    printf("float:%f\n", value_float);
    printf("double:%lf\n", value_double);
    printf("string:%s\n", value_str);

    ProfileManager::freeInstance();
    free(targetDocs);
    return ret;
}
Esempio n. 10
0
void NetworkDialog::on_actionExportKey_activated()
{
	ProfileManager prof ;
	prof.exec() ;
}
Esempio n. 11
0
Preferences::Preferences(BrowserWindow* window, QWidget* parent)
    : QDialog(parent)
    , ui(new Ui::Preferences)
    , m_window(window)
    , m_autoFillManager(0)
    , m_pluginsList(0)
    , m_autoFillEnabled(false)
{
    setAttribute(Qt::WA_DeleteOnClose);
    ui->setupUi(this);
    ui->languages->setLayoutDirection(Qt::LeftToRight);

    m_themesManager = new ThemeManager(ui->themesWidget, this);
    m_pluginsList = new PluginsManager(this);
    ui->pluginsFrame->addWidget(m_pluginsList);

#ifdef DISABLE_CHECK_UPDATES
    ui->checkUpdates->setVisible(false);
#endif

    if (QIcon::themeName().toLower() == QLatin1String("oxygen")) {
        ui->listWidget->item(0)->setIcon(QIcon::fromTheme("preferences-desktop", QIcon(":/icons/preferences/preferences-desktop.png")));
        ui->listWidget->item(1)->setIcon(QIcon::fromTheme("format-stroke-color", QIcon(":/icons/preferences/application-x-theme.png")));
        ui->listWidget->item(2)->setIcon(QIcon::fromTheme("tab-new-background", QIcon(":/icons/preferences/applications-internet.png")));
        ui->listWidget->item(3)->setIcon(QIcon::fromTheme("preferences-system-network", QIcon(":/icons/preferences/applications-webbrowsers.png")));
        ui->listWidget->item(4)->setIcon(QIcon::fromTheme("preferences-desktop-font", QIcon(":/icons/preferences/applications-fonts.png")));
        ui->listWidget->item(5)->setIcon(QIcon::fromTheme("configure-shortcuts", QIcon(":/icons/preferences/preferences-desktop-keyboard-shortcuts.png")));
        ui->listWidget->item(6)->setIcon(QIcon::fromTheme("download", QIcon(":/icons/preferences/mail-inbox.png")));
        ui->listWidget->item(7)->setIcon(QIcon::fromTheme("user-identity", QIcon(":/icons/preferences/dialog-password.png")));
        ui->listWidget->item(8)->setIcon(QIcon::fromTheme("preferences-system-firewall", QIcon(":/icons/preferences/preferences-system-firewall.png")));
        ui->listWidget->item(9)->setIcon(QIcon::fromTheme("preferences-desktop-notification", QIcon(":/icons/preferences/dialog-question.png")));
        ui->listWidget->item(10)->setIcon(QIcon::fromTheme("preferences-plugin", QIcon(":/icons/preferences/extension.png")));
        ui->listWidget->item(11)->setIcon(QIcon::fromTheme("applications-system", QIcon(":/icons/preferences/applications-system.png")));
    }
    else {
        ui->listWidget->item(0)->setIcon(QIcon::fromTheme("preferences-desktop", QIcon(":/icons/preferences/preferences-desktop.png")));
        ui->listWidget->item(1)->setIcon(QIcon::fromTheme("application-x-theme", QIcon(":/icons/preferences/application-x-theme.png")));
        ui->listWidget->item(2)->setIcon(QIcon::fromTheme("applications-internet", QIcon(":/icons/preferences/applications-internet.png")));
        ui->listWidget->item(3)->setIcon(QIcon::fromTheme("applications-webbrowsers", QIcon(":/icons/preferences/applications-webbrowsers.png")));
        ui->listWidget->item(4)->setIcon(QIcon::fromTheme("applications-fonts", QIcon(":/icons/preferences/applications-fonts.png")));
        ui->listWidget->item(5)->setIcon(QIcon::fromTheme("preferences-desktop-keyboard-shortcuts", QIcon(":/icons/preferences/preferences-desktop-keyboard-shortcuts.png")));
        ui->listWidget->item(6)->setIcon(QIcon::fromTheme("mail-inbox", QIcon(":/icons/preferences/mail-inbox.png")));
        ui->listWidget->item(7)->setIcon(QIcon::fromTheme("dialog-password", QIcon(":/icons/preferences/dialog-password.png")));
        ui->listWidget->item(8)->setIcon(QIcon::fromTheme("preferences-system-firewall", QIcon(":/icons/preferences/preferences-system-firewall.png")));
        ui->listWidget->item(9)->setIcon(QIcon::fromTheme("dialog-question", QIcon(":/icons/preferences/dialog-question.png")));
        ui->listWidget->item(10)->setIcon(QIcon::fromTheme("extension", QIcon(":/icons/preferences/extension.png")));
        ui->listWidget->item(11)->setIcon(QIcon::fromTheme("applications-system", QIcon(":/icons/preferences/applications-system.png")));
    }

    Settings settings;
    //GENERAL URLs
    settings.beginGroup("Web-URL-Settings");
    m_homepage = settings.value("homepage", "qupzilla:start").toString();
    m_newTabUrl = settings.value("newTabUrl", "qupzilla:speeddial").toString();
    ui->homepage->setText(m_homepage);
    ui->newTabUrl->setText(m_newTabUrl);
    int afterLaunch = settings.value("afterLaunch", 3).toInt();
    settings.endGroup();
    ui->afterLaunch->setCurrentIndex(afterLaunch);
    ui->checkUpdates->setChecked(settings.value("Web-Browser-Settings/CheckUpdates", DEFAULT_CHECK_UPDATES).toBool());
    ui->dontLoadTabsUntilSelected->setChecked(settings.value("Web-Browser-Settings/LoadTabsOnActivation", true).toBool());

#if defined(Q_OS_WIN) && !defined(Q_OS_OS2)
    ui->checkDefaultBrowser->setChecked(settings.value("Web-Browser-Settings/CheckDefaultBrowser", DEFAULT_CHECK_DEFAULTBROWSER).toBool());
    if (mApp->associationManager()->isDefaultForAllCapabilities()) {
        ui->checkNowDefaultBrowser->setText(tr("Default"));
        ui->checkNowDefaultBrowser->setEnabled(false);
    }
    else {
        ui->checkNowDefaultBrowser->setText(tr("Set as default"));
        ui->checkNowDefaultBrowser->setEnabled(true);
        connect(ui->checkNowDefaultBrowser, SIGNAL(clicked()), this, SLOT(makeQupZillaDefault()));
    }
#else // No Default Browser settings on non-Windows platform
    ui->hSpacerDefaultBrowser->changeSize(0, 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
    ui->hLayoutDefaultBrowser->invalidate();
    delete ui->hLayoutDefaultBrowser;
    delete ui->checkDefaultBrowser;
    delete ui->checkNowDefaultBrowser;
#endif

    ui->newTabFrame->setVisible(false);
    if (m_newTabUrl.isEmpty()) {
        ui->newTab->setCurrentIndex(0);
    }
    else if (m_newTabUrl == m_homepage) {
        ui->newTab->setCurrentIndex(1);
    }
    else if (m_newTabUrl == QLatin1String("qupzilla:speeddial")) {
        ui->newTab->setCurrentIndex(2);
    }
    else {
        ui->newTab->setCurrentIndex(3);
        ui->newTabFrame->setVisible(true);
    }

    afterLaunchChanged(ui->afterLaunch->currentIndex());
    connect(ui->afterLaunch, SIGNAL(currentIndexChanged(int)), this, SLOT(afterLaunchChanged(int)));
    connect(ui->newTab, SIGNAL(currentIndexChanged(int)), this, SLOT(newTabChanged(int)));
    if (m_window) {
        connect(ui->useCurrentBut, SIGNAL(clicked()), this, SLOT(useActualHomepage()));
        connect(ui->newTabUseCurrent, SIGNAL(clicked()), this, SLOT(useActualNewTab()));
    }
    else {
        ui->useCurrentBut->setEnabled(false);
        ui->newTabUseCurrent->setEnabled(false);
    }

    // PROFILES
    ProfileManager profileManager;
    QString startingProfile = profileManager.startingProfile();
    ui->activeProfile->setText("<b>" + profileManager.currentProfile() + "</b>");
    ui->startProfile->addItem(startingProfile);

    foreach (const QString &name, profileManager.availableProfiles()) {
        if (startingProfile != name) {
            ui->startProfile->addItem(name);
        }
    }

    connect(ui->createProfile, SIGNAL(clicked()), this, SLOT(createProfile()));
    connect(ui->deleteProfile, SIGNAL(clicked()), this, SLOT(deleteProfile()));
    connect(ui->startProfile, SIGNAL(currentIndexChanged(int)), this, SLOT(startProfileIndexChanged(int)));
    startProfileIndexChanged(ui->startProfile->currentIndex());

    //APPEREANCE
    settings.beginGroup("Bookmarks-Settings");
    ui->hideEmptyFoldersInMenu->setChecked(settings.value("hideEmptyFoldersInMenu", false).toBool());
    settings.endGroup();

    settings.beginGroup("Browser-View-Settings");
    ui->showStatusbar->setChecked(settings.value("showStatusBar", true).toBool());
    ui->showBookmarksToolbar->setChecked(settings.value("showBookmarksToolbar", true).toBool());
    ui->showNavigationToolbar->setChecked(settings.value("showNavigationToolbar", true).toBool());
    ui->showHome->setChecked(settings.value("showHomeButton", true).toBool());
    ui->showBackForward->setChecked(settings.value("showBackForwardButtons", true).toBool());
    ui->showAddTabButton->setChecked(settings.value("showAddTabButton", false).toBool());
    ui->showReloadStopButtons->setChecked(settings.value("showReloadButton", true).toBool());
    ui->showWebSearchBar->setChecked(settings.value("showWebSearchBar", true).toBool());
    ui->useTransparentBg->setChecked(settings.value("useTransparentBackground", false).toBool());
    int currentSettingsPage = settings.value("settingsDialogPage", 0).toInt(0);
    settings.endGroup();
#ifdef Q_OS_WIN
    ui->useTransparentBg->setEnabled(QtWin::isCompositionEnabled());
#endif

    //TABS
    settings.beginGroup("Browser-Tabs-Settings");
    ui->hideTabsOnTab->setChecked(settings.value("hideTabsWithOneTab", false).toBool());
    ui->activateLastTab->setChecked(settings.value("ActivateLastTabWhenClosingActual", false).toBool());
    ui->openNewTabAfterActive->setChecked(settings.value("newTabAfterActive", true).toBool());
    ui->openNewEmptyTabAfterActive->setChecked(settings.value("newEmptyTabAfterActive", false).toBool());
    ui->alwaysSwitchTabsWithWheel->setChecked(settings.value("AlwaysSwitchTabsWithWheel", false).toBool());
    ui->switchToNewTabs->setChecked(settings.value("OpenNewTabsSelected", false).toBool());
    ui->dontCloseOnLastTab->setChecked(settings.value("dontCloseWithOneTab", false).toBool());
    ui->askWhenClosingMultipleTabs->setChecked(settings.value("AskOnClosing", false).toBool());
    ui->showClosedTabsButton->setChecked(settings.value("showClosedTabsButton", false).toBool());
    ui->showTabPreviews->setChecked(settings.value("showTabPreviews", false).toBool());
    ui->animatedTabPreviews->setChecked(settings.value("tabPreviewAnimationsEnabled", true).toBool());
    ui->showCloseOnInactive->setCurrentIndex(settings.value("showCloseOnInactiveTabs", 0).toInt());
    settings.endGroup();

    connect(ui->showTabPreviews, SIGNAL(toggled(bool)), this, SLOT(showTabPreviewsChanged(bool)));
    showTabPreviewsChanged(ui->showTabPreviews->isChecked());

    //AddressBar
    settings.beginGroup("AddressBar");
    ui->addressbarCompletion->setCurrentIndex(settings.value("showSuggestions", 0).toInt());
    ui->useInlineCompletion->setChecked(settings.value("useInlineCompletion", true).toBool());
    ui->completionShowSwitchTab->setChecked(settings.value("showSwitchTab", true).toBool());
    ui->alwaysShowGoIcon->setChecked(settings.value("alwaysShowGoIcon", false).toBool());
    ui->selectAllOnFocus->setChecked(settings.value("SelectAllTextOnDoubleClick", true).toBool());
    ui->selectAllOnClick->setChecked(settings.value("SelectAllTextOnClick", false).toBool());
    ui->addCountryWithAlt->setChecked(settings.value("AddCountryDomainWithAltKey", true).toBool());
    bool showPBinAB = settings.value("ShowLoadingProgress", false).toBool();
    ui->showLoadingInAddressBar->setChecked(showPBinAB);
    ui->adressProgressSettings->setEnabled(showPBinAB);
    ui->progressStyleSelector->setCurrentIndex(settings.value("ProgressStyle", 0).toInt());
    bool pbInABuseCC = settings.value("UseCustomProgressColor", false).toBool();
    ui->checkBoxCustomProgressColor->setChecked(pbInABuseCC);
    ui->progressBarColorSelector->setEnabled(pbInABuseCC);
    QColor pbColor = settings.value("CustomProgressColor", m_window->palette().color(QPalette::Highlight)).value<QColor>();
    setProgressBarColorIcon(pbColor);
    connect(ui->customColorToolButton, SIGNAL(clicked(bool)), SLOT(selectCustomProgressBarColor()));
    connect(ui->resetProgressBarcolor, SIGNAL(clicked()), SLOT(setProgressBarColorIcon()));
    settings.endGroup();

    settings.beginGroup("SearchEngines");
    ui->searchWithDefaultEngine->setChecked(settings.value("SearchWithDefaultEngine", false).toBool());
    settings.endGroup();

    // BROWSING
    settings.beginGroup("Web-Browser-Settings");
    ui->allowPlugins->setChecked(settings.value("allowFlash", true).toBool());
    ui->allowJavaScript->setChecked(settings.value("allowJavaScript", true).toBool());
    ui->allowJava->setChecked(settings.value("allowJava", true).toBool());
    ui->allowDNSPrefetch->setChecked(settings.value("DNS-Prefetch", false).toBool());
    ui->linksInFocusChain->setChecked(settings.value("IncludeLinkInFocusChain", false).toBool());
    ui->zoomTextOnly->setChecked(settings.value("zoomTextOnly", false).toBool());
    ui->spatialNavigation->setChecked(settings.value("SpatialNavigation", false).toBool());
    ui->caretBrowsing->setChecked(settings.value("CaretBrowsing", false).toBool());
    ui->animateScrolling->setChecked(settings.value("AnimateScrolling", true).toBool());
    ui->printEBackground->setChecked(settings.value("PrintElementBackground", true).toBool());
    ui->wheelScroll->setValue(settings.value("wheelScrollLines", qApp->wheelScrollLines()).toInt());
    ui->xssAuditing->setChecked(settings.value("XSSAuditing", false).toBool());
    ui->formsUndoRedo->setChecked(settings.value("enableFormsUndoRedo", false).toBool());

    foreach (int level, WebView::zoomLevels()) {
        ui->defaultZoomLevel->addItem(QString("%1%").arg(level));
    }
Esempio n. 12
0
void ProfileWidget::profilemanager()
{
    ProfileManager profilemanager;
    profilemanager.exec();
}