void Hdd::configAccepted() { KConfigGroup cg = config(); KConfigGroup cgGlobal = globalConfig(); QStandardItem *parentItem = m_hddModel.invisibleRootItem(); clear(); for (int i = 0; i < parentItem->rowCount(); ++i) { QStandardItem *item = parentItem->child(i, 0); if (item) { QStandardItem *child = parentItem->child(i, 1); if (child->text() != child->data().toString()) { cgGlobal.writeEntry(item->data().toString(), child->text()); } if (item->checkState() == Qt::Checked) { appendSource(item->data().toString()); } } } cg.writeEntry("uuids", sources()); uint interval = ui.intervalSpinBox->value(); cg.writeEntry("interval", interval); emit configNeedsSaving(); }
void readKeysConfiguration() { Fl_Config globalConfig(fl_find_config_file("wmanager.conf", 0), true, false); globalConfig.set_section("Hotkeys"); for (int i=0; i<NR_HOTKEYS; i++) { Fl_String tmp; globalConfig.read(hotkeys[i].systemname, tmp, ""); keycodes[i] = name_to_svalue(tmp); } globalConfig.set_section("Applications"); for (int i=0; i<NR_HOTKEYS; i++) { Fl_String tmp; if ((strncmp(hotkeys[i].systemname,"App",3) == 0) && (keycodes[i] != 0)) { globalConfig.read(hotkeys[i].systemname, tmp, ""); if (tmp != "") strncpy(hotkeys[i].command, tmp, 50); if (keycodes[i]>0 && tmp != "") strncpy(hotkeys[i].uiname, hotkeys[i].systemname, 20); } } globalConfig.set_section("ApplicationNames"); for (int i=0; i<NR_HOTKEYS; i++) { Fl_String tmp; if ((strncmp(hotkeys[i].systemname,"App",3) == 0) && (keycodes[i] != 0)) { globalConfig.read(hotkeys[i].systemname, tmp, ""); if (tmp != "") strncpy(hotkeys[i].uiname, tmp, 50); } } }
void PreviewsSettingsPage::loadSettings() { KConfigGroup globalConfig(KGlobal::config(), "PreviewSettings"); m_enabledPreviewPlugins = globalConfig.readEntry("Plugins", QStringList() << QLatin1String("directorythumbnail") << QLatin1String("imagethumbnail") << QLatin1String("jpegthumbnail")); // If the user is upgrading from KDE <= 4.6, we must check if he had the 'jpegrotatedthumbnail' plugin enabled. // This plugin does not exist any more in KDE >= 4.7, so we have to replace it with the 'jpegthumbnail' plugin. // // Note that the upgrade to the correct plugin is done already in KFilePreviewGenerator. However, if Konqueror is // opened in web browsing mode and the Settings dialog is opened, we might end up here before KFilePreviewGenerator's // constructor is ever called -> the plugin replacement should be done here as well. if (m_enabledPreviewPlugins.contains(QLatin1String("jpegrotatedthumbnail"))) { m_enabledPreviewPlugins.removeAll(QLatin1String("jpegrotatedthumbnail")); m_enabledPreviewPlugins.append(QLatin1String("jpegthumbnail")); globalConfig.writeEntry("Plugins", m_enabledPreviewPlugins); globalConfig.sync(); } const qulonglong defaultRemotePreview = static_cast<qulonglong>(MaxRemotePreviewSize) * 1024 * 1024; const qulonglong maxRemoteByteSize = globalConfig.readEntry("MaximumRemoteSize", defaultRemotePreview); const int maxRemoteMByteSize = maxRemoteByteSize / (1024 * 1024); m_remoteFileSizeBox->setValue(maxRemoteMByteSize); }
void Desktop::update_bg() { Fl_Renderer::system_init(); if (wpaper) { delete wpaper; wpaper=0; } Fl_Config globalConfig(fl_find_config_file("ede.conf", 0), true, false); globalConfig.set_section("Desktop"); globalConfig.read("Color", bg_color, (Fl_Color)fl_darker(FL_BLUE)); globalConfig.read("Opacity", bg_opacity, 255); globalConfig.read("Mode", bg_mode, 0); globalConfig.read("Use", bg_use, 1); Fl_Image *im=0; if(!globalConfig.read("Wallpaper", bg_filename, 0)) { if(bg_use) { im = Fl_Image::read(bg_filename, 0); if (im) im->system_convert(); } } else { bg_filename.clear(); } if(im) { wpaper = make_image(bg_color, im, Fl::w(), Fl::h(), bg_mode, bg_opacity); delete im; } redraw(); }
void PreviewsSettingsPage::applySettings() { const QAbstractItemModel* model = m_listView->model(); const int rowCount = model->rowCount(); if (rowCount > 0) { m_enabledPreviewPlugins.clear(); for (int i = 0; i < rowCount; ++i) { const QModelIndex index = model->index(i, 0); const bool checked = model->data(index, Qt::CheckStateRole).toBool(); if (checked) { const QString enabledPlugin = model->data(index, Qt::UserRole).toString(); m_enabledPreviewPlugins.append(enabledPlugin); } } } KConfigGroup globalConfig(KGlobal::config(), QLatin1String("PreviewSettings")); globalConfig.writeEntry("Plugins", m_enabledPreviewPlugins); const qulonglong maximumRemoteSize = static_cast<qulonglong>(m_remoteFileSizeBox->value()) * 1024 * 1024; globalConfig.writeEntry("MaximumRemoteSize", maximumRemoteSize, KConfigBase::Normal | KConfigBase::Global); globalConfig.sync(); }
void Paste::init() { cfg = globalConfig(); m_list = new ListForm; connect(&cfg, SIGNAL(changed(ConfigData)), m_list, SLOT(setData(ConfigData))); connect(m_list, SIGNAL(textCopied()), this, SLOT(showOk())); m_list->setData(cfg); }
QString Hdd::hddTitle(const QString& uuid, const Plasma::DataEngine::Data &data) { KConfigGroup cg = globalConfig(); QString label = cg.readEntry(uuid, ""); if (label.isEmpty()) { label = guessHddTitle(data); } return label; }
void readIconsConfiguration() { Fl_Config globalConfig(fl_find_config_file("ede.conf", 0), true, false); globalConfig.set_section("IconManager"); globalConfig.read("Label Background", label_background, 46848); globalConfig.read("Label Transparent", label_trans, false); globalConfig.read("Label Foreground", label_foreground, FL_WHITE); globalConfig.read("Label Fontsize", label_fontsize, 12); globalConfig.read("Label Maxwidth", label_maxwidth, 75); globalConfig.read("Gridspacing", label_gridspacing, 16); globalConfig.read("OneClickExec", one_click_exec, 0); globalConfig.read("AutoArrange", auto_arr, false); }
void bg_apply(Fl_Button *w, void *d) { if(changed) { Fl_Config globalConfig(fl_find_config_file("ede.conf", 1), true, true); globalConfig.set_section("Desktop"); globalConfig.write("Color", color); globalConfig.write("Opacity", int(opacity)); globalConfig.write("Wallpaper", filename); globalConfig.write("Mode", mode); globalConfig.write("Use", use); globalConfig.flush(); desktop->update_bg(); } changed=false; }
GitEntry::GitProperties GitEntry::ReadGitProperties(const wxString& localRepoPath) { GitEntry::GitProperties props; // Read the global name/email // ~/.gitconfig | %USERPROFILE%\.gitconfig { wxFileName globalConfig(::wxGetHomeDir(), ".gitconfig"); if(globalConfig.Exists()) { wxFFile fp(globalConfig.GetFullPath(), "rb"); if(fp.IsOpened()) { wxString content; fp.ReadAll(&content, wxConvUTF8); wxStringInputStream sis(content); wxFileConfig conf(sis); conf.Read("user/email", &props.global_email); conf.Read("user/name", &props.global_username); fp.Close(); } } } // Read the repo config file if(!localRepoPath.IsEmpty()) { wxFileName localConfig(localRepoPath, "config"); localConfig.AppendDir(".git"); wxFFile fp(localConfig.GetFullPath(), "rb"); if(fp.IsOpened()) { wxString content; fp.ReadAll(&content, wxConvUTF8); wxStringInputStream sis(content); wxFileConfig conf(sis); conf.Read("user/email", &props.local_email); conf.Read("user/name", &props.local_username); fp.Close(); } } return props; }
void writeKeysConfiguration() { Fl_Config globalConfig(fl_find_config_file("wmanager.conf", 1)); globalConfig.set_section("Hotkeys"); for (int i=0; i<NR_HOTKEYS; i++) globalConfig.write(hotkeys[i].systemname, Fl::key_name(keycodes[i])); globalConfig.set_section("Applications"); for (int i=0; i<NR_HOTKEYS; i++) if ((strncmp(hotkeys[i].systemname,"App",3) == 0) && (strcmp(hotkeys[i].uiname,"") != 0) && (strcmp(hotkeys[i].command,"") != 0)) globalConfig.write(hotkeys[i].systemname, hotkeys[i].command); globalConfig.set_section("ApplicationNames"); for (int i=0; i<NR_HOTKEYS; i++) if ((strncmp(hotkeys[i].systemname,"App",3) == 0) && (strcmp(hotkeys[i].uiname,"") != 0) && (strcmp(hotkeys[i].command,"") != 0)) globalConfig.write(hotkeys[i].systemname, hotkeys[i].uiname); }
unsigned long Options::updateSettings() { KConfig *config = KGlobal::config(); unsigned long changed = 0; changed |= d->updateKWinSettings(config); // read decoration settings config->setGroup("Windows"); moveMode = stringToMoveResizeMode(config->readEntry("MoveMode", "Opaque")); resizeMode = stringToMoveResizeMode(config->readEntry("ResizeMode", "Opaque")); show_geometry_tip = config->readBoolEntry("GeometryTip", false); tabboxOutline = config->readBoolEntry("TabboxOutline", true); QString val; val = config->readEntry("FocusPolicy", "ClickToFocus"); focusPolicy = ClickToFocus; // what a default :-) if(val == "FocusFollowsMouse") focusPolicy = FocusFollowsMouse; else if(val == "FocusUnderMouse") focusPolicy = FocusUnderMouse; else if(val == "FocusStrictlyUnderMouse") focusPolicy = FocusStrictlyUnderMouse; val = config->readEntry("AltTabStyle", "KDE"); altTabStyle = KDE; // what a default :-) if(val == "CDE") altTabStyle = CDE; rollOverDesktops = config->readBoolEntry("RollOverDesktops", TRUE); // focusStealingPreventionLevel = config->readNumEntry( "FocusStealingPreventionLevel", 2 ); // TODO use low level for now focusStealingPreventionLevel = config->readNumEntry("FocusStealingPreventionLevel", 1); focusStealingPreventionLevel = KMAX(0, KMIN(4, focusStealingPreventionLevel)); if(!focusPolicyIsReasonable()) // #48786, comments #7 and later focusStealingPreventionLevel = 0; KConfig *gc = new KConfig("kdeglobals", false, false); gc->setGroup("Windows"); xineramaEnabled = gc->readBoolEntry("XineramaEnabled", true); xineramaPlacementEnabled = gc->readBoolEntry("XineramaPlacementEnabled", true); xineramaMovementEnabled = gc->readBoolEntry("XineramaMovementEnabled", true); xineramaMaximizeEnabled = gc->readBoolEntry("XineramaMaximizeEnabled", true); xineramaFullscreenEnabled = gc->readBoolEntry("XineramaFullscreenEnabled", true); delete gc; placement = Placement::policyFromString(config->readEntry("Placement"), true); animateShade = config->readBoolEntry("AnimateShade", TRUE); animateMinimize = config->readBoolEntry("AnimateMinimize", TRUE); animateMinimizeSpeed = config->readNumEntry("AnimateMinimizeSpeed", 5); if(focusPolicy == ClickToFocus) { autoRaise = false; autoRaiseInterval = 0; delayFocus = false; delayFocusInterval = 0; } else { autoRaise = config->readBoolEntry("AutoRaise", FALSE); autoRaiseInterval = config->readNumEntry("AutoRaiseInterval", 0); delayFocus = config->readBoolEntry("DelayFocus", FALSE); delayFocusInterval = config->readNumEntry("DelayFocusInterval", 0); } shadeHover = config->readBoolEntry("ShadeHover", FALSE); shadeHoverInterval = config->readNumEntry("ShadeHoverInterval", 250); // important: autoRaise implies ClickRaise clickRaise = autoRaise || config->readBoolEntry("ClickRaise", TRUE); borderSnapZone = config->readNumEntry("BorderSnapZone", 10); windowSnapZone = config->readNumEntry("WindowSnapZone", 10); snapOnlyWhenOverlapping = config->readBoolEntry("SnapOnlyWhenOverlapping", FALSE); electric_borders = config->readNumEntry("ElectricBorders", 0); electric_border_delay = config->readNumEntry("ElectricBorderDelay", 150); OpTitlebarDblClick = windowOperation(config->readEntry("TitlebarDoubleClickCommand", "Shade"), true); d->OpMaxButtonLeftClick = windowOperation(config->readEntry("MaximizeButtonLeftClickCommand", "Maximize"), true); d->OpMaxButtonMiddleClick = windowOperation(config->readEntry("MaximizeButtonMiddleClickCommand", "Maximize (vertical only)"), true); d->OpMaxButtonRightClick = windowOperation(config->readEntry("MaximizeButtonRightClickCommand", "Maximize (horizontal only)"), true); ignorePositionClasses = config->readListEntry("IgnorePositionClasses"); ignoreFocusStealingClasses = config->readListEntry("IgnoreFocusStealingClasses"); // Qt3.2 and older had resource class all lowercase, but Qt3.3 has it capitalized // therefore Client::resourceClass() forces lowercase, force here lowercase as well for(QStringList::Iterator it = ignorePositionClasses.begin(); it != ignorePositionClasses.end(); ++it) (*it) = (*it).lower(); for(QStringList::Iterator it = ignoreFocusStealingClasses.begin(); it != ignoreFocusStealingClasses.end(); ++it) (*it) = (*it).lower(); killPingTimeout = config->readNumEntry("KillPingTimeout", 5000); hideUtilityWindowsForInactive = config->readBoolEntry("HideUtilityWindowsForInactive", true); showDesktopIsMinimizeAll = config->readBoolEntry("ShowDesktopIsMinimizeAll", false); // Mouse bindings config->setGroup("MouseBindings"); CmdActiveTitlebar1 = mouseCommand(config->readEntry("CommandActiveTitlebar1", "Raise"), true); CmdActiveTitlebar2 = mouseCommand(config->readEntry("CommandActiveTitlebar2", "Lower"), true); CmdActiveTitlebar3 = mouseCommand(config->readEntry("CommandActiveTitlebar3", "Operations menu"), true); CmdInactiveTitlebar1 = mouseCommand(config->readEntry("CommandInactiveTitlebar1", "Activate and raise"), true); CmdInactiveTitlebar2 = mouseCommand(config->readEntry("CommandInactiveTitlebar2", "Activate and lower"), true); CmdInactiveTitlebar3 = mouseCommand(config->readEntry("CommandInactiveTitlebar3", "Operations menu"), true); CmdTitlebarWheel = mouseWheelCommand(config->readEntry("CommandTitlebarWheel", "Nothing")); CmdWindow1 = mouseCommand(config->readEntry("CommandWindow1", "Activate, raise and pass click"), false); CmdWindow2 = mouseCommand(config->readEntry("CommandWindow2", "Activate and pass click"), false); CmdWindow3 = mouseCommand(config->readEntry("CommandWindow3", "Activate and pass click"), false); CmdAllModKey = (config->readEntry("CommandAllKey", "Alt") == "Meta") ? Qt::Key_Meta : Qt::Key_Alt; CmdAll1 = mouseCommand(config->readEntry("CommandAll1", "Move"), false); CmdAll2 = mouseCommand(config->readEntry("CommandAll2", "Toggle raise and lower"), false); CmdAll3 = mouseCommand(config->readEntry("CommandAll3", "Resize"), false); CmdAllWheel = mouseWheelCommand(config->readEntry("CommandAllWheel", "Nothing")); // translucency settings config->setGroup("Notification Messages"); useTranslucency = config->readBoolEntry("UseTranslucency", false); config->setGroup("Translucency"); translucentActiveWindows = config->readBoolEntry("TranslucentActiveWindows", false); activeWindowOpacity = uint((config->readNumEntry("ActiveWindowOpacity", 100) / 100.0) * 0xFFFFFFFF); translucentInactiveWindows = config->readBoolEntry("TranslucentInactiveWindows", false); inactiveWindowOpacity = uint((config->readNumEntry("InactiveWindowOpacity", 75) / 100.0) * 0xFFFFFFFF); translucentMovingWindows = config->readBoolEntry("TranslucentMovingWindows", false); movingWindowOpacity = uint((config->readNumEntry("MovingWindowOpacity", 50) / 100.0) * 0xFFFFFFFF); translucentDocks = config->readBoolEntry("TranslucentDocks", false); dockOpacity = uint((config->readNumEntry("DockOpacity", 80) / 100.0) * 0xFFFFFFFF); keepAboveAsActive = config->readBoolEntry("TreatKeepAboveAsActive", true); // TODO: remove this variable useTitleMenuSlider = true; activeWindowShadowSize = config->readNumEntry("ActiveWindowShadowSize", 200); inactiveWindowShadowSize = config->readNumEntry("InactiveWindowShadowSize", 100); dockShadowSize = config->readNumEntry("DockShadowSize", 80); removeShadowsOnMove = config->readBoolEntry("RemoveShadowsOnMove", true); removeShadowsOnResize = config->readBoolEntry("RemoveShadowsOnResize", true); onlyDecoTranslucent = config->readBoolEntry("OnlyDecoTranslucent", false); resetKompmgr = config->readBoolEntry("ResetKompmgr", false); if(resetKompmgr) config->writeEntry("ResetKompmgr", FALSE); // Read button tooltip animation effect from kdeglobals // Since we want to allow users to enable window decoration tooltips // and not kstyle tooltips and vise-versa, we don't read the // "EffectNoTooltip" setting from kdeglobals. KConfig globalConfig("kdeglobals"); globalConfig.setGroup("KDE"); topmenus = globalConfig.readBoolEntry("macStyle", false); KConfig kdesktopcfg("kdesktoprc", true); kdesktopcfg.setGroup("Menubar"); desktop_topmenu = kdesktopcfg.readBoolEntry("ShowMenubar", false); if(desktop_topmenu) topmenus = true; QToolTip::setGloballyEnabled(d->show_tooltips); return changed; }
void GitEntry::WriteGitProperties(const wxString& localRepoPath, const GitEntry::GitProperties& props) { // Read the global name/email // ~/.gitconfig | %USERPROFILE%\.gitconfig { wxFileName globalConfig(::wxGetHomeDir(), ".gitconfig"); if(globalConfig.Exists()) { wxFFile fp(globalConfig.GetFullPath(), "rb"); if(fp.IsOpened()) { wxString content; fp.ReadAll(&content, wxConvUTF8); fp.Close(); wxStringInputStream sis(content); wxFileConfig conf(sis); conf.Write("user/email", props.global_email); conf.Write("user/name", props.global_username); // Write the content content.Clear(); wxStringOutputStream sos(&content); if(conf.Save(sos, wxConvUTF8)) { wxFFile fpo(globalConfig.GetFullPath(), "w+b"); if(fpo.IsOpened()) { fpo.Write(content, wxConvUTF8); fpo.Close(); } } else { ::wxMessageBox("Could not save GIT global configuration. Configuration is unmodified", "git", wxICON_WARNING | wxOK | wxCENTER); } } } } // Read the repo config file if(!localRepoPath.IsEmpty()) { wxFileName localConfig(localRepoPath, "config"); localConfig.AppendDir(".git"); wxFFile fp(localConfig.GetFullPath(), "rb"); if(fp.IsOpened()) { wxString content; fp.ReadAll(&content, wxConvUTF8); fp.Close(); wxStringInputStream sis(content); wxFileConfig conf(sis); conf.Write("user/email", props.local_email); conf.Write("user/name", props.local_username); content.Clear(); wxStringOutputStream sos(&content); if(conf.Save(sos, wxConvUTF8)) { wxFFile fpo(localConfig.GetFullPath(), "w+b"); if(fpo.IsOpened()) { fpo.Write(content, wxConvUTF8); fpo.Close(); } } else { ::wxMessageBox("Could not save GIT local configuration. Configuration is unmodified", "git", wxICON_WARNING | wxOK | wxCENTER); } } } }
int main (int argc, char **argv) { fl_init_locale_support("evolume", PREFIX"/share/locale"); Fl_Config globalConfig("EDE Team", "evolume"); globalConfig.get("Sound mixer", "Device", device, "/dev/mixer", sizeof(device)); main_window = new Fl_Window(720, 205, _("Volume control")); Fl_Menu_Bar *vc_menubar = new Fl_Menu_Bar(0, 0, 724, 25); vc_menubar->begin(); Fl_Item_Group file(_("&File")); Fl_Item* pref_item = new Fl_Item(_("Preferences")); pref_item->shortcut(FL_CTRL+'p'); pref_item->callback(PreferencesDialog); Fl_Item* quit_item = new Fl_Item(_("Quit")); quit_item->shortcut(FL_CTRL+'q'); quit_item->callback(quit_cb); file.end(); Fl_Item_Group help(_("&Help")); Fl_Item* about_item = new Fl_Item(_("About")); about_item->shortcut(FL_CTRL+'a'); about_item->callback((Fl_Callback*)cb_About); help.end(); vc_menubar->end(); new Fl_Divider(0, 24, 724, 3); volume_slider = new Fl_Slider(20, 50, 20, 80, "VOL"); default_look(volume_slider); volume_balance = new Fl_Slider(10, 135, 40, 15, "Balance"); default_look_b(volume_balance); volume_mute = new Fl_Check_Button(5, 165, 20, 20, "Mute"); volume_mute->align(FL_ALIGN_BOTTOM); volume_rec = new Fl_Check_Button(35, 165, 20, 20, "Rec"); volume_rec->align(FL_ALIGN_BOTTOM); cd_slider = new Fl_Slider(80, 50, 20, 80, "CD"); default_look(cd_slider); cd_balance = new Fl_Slider(70, 135, 40, 15, "Balance"); default_look_b(cd_balance); cd_mute = new Fl_Check_Button(65, 165, 20, 20, "Mute"); cd_mute->align(FL_ALIGN_BOTTOM); cd_rec = new Fl_Check_Button(95, 165, 20, 20, "Rec"); cd_rec->align(FL_ALIGN_BOTTOM); pcm_slider = new Fl_Slider(140, 50, 20, 80, "PCM"); default_look(pcm_slider); pcm_balance = new Fl_Slider(130, 135, 40, 15, "Balance"); default_look_b(pcm_balance); pcm_mute = new Fl_Check_Button(125, 165, 20, 20, "Mute"); pcm_mute->align(FL_ALIGN_BOTTOM); pcm_rec = new Fl_Check_Button(155, 165, 20, 20, "Rec"); pcm_rec->align(FL_ALIGN_BOTTOM); synth_slider = new Fl_Slider(200, 50, 20, 80, "SYNTH"); default_look(synth_slider); synth_balance = new Fl_Slider(190, 135, 40, 15, "Balance"); default_look_b(synth_balance); synth_mute = new Fl_Check_Button(185, 165, 20, 20, "Mute"); synth_mute->align(FL_ALIGN_BOTTOM); synth_rec = new Fl_Check_Button(215, 165, 20, 20, "Rec"); synth_rec->align(FL_ALIGN_BOTTOM); line_slider = new Fl_Slider(260, 50, 20, 80, "LINE"); default_look(line_slider); line_balance = new Fl_Slider(250, 135, 40, 15, "Balance"); default_look_b(line_balance); line_mute = new Fl_Check_Button(245, 165, 20, 20, "Mute"); line_mute->align(FL_ALIGN_BOTTOM); line_rec = new Fl_Check_Button(275, 165, 20, 20, "Rec"); line_rec->align(FL_ALIGN_BOTTOM); bass_slider = new Fl_Slider(320, 50, 20, 80, "BASS"); default_look(bass_slider); bass_balance = new Fl_Slider(310, 135, 40, 15, "Balance"); default_look_b(bass_balance); bass_mute = new Fl_Check_Button(305, 165, 20, 20, "Mute"); bass_mute->align(FL_ALIGN_BOTTOM); bass_rec = new Fl_Check_Button(335, 165, 20, 20, "Rec"); bass_rec->align(FL_ALIGN_BOTTOM); treble_slider = new Fl_Slider(380, 50, 20, 80, "TREBLE"); default_look(treble_slider); treble_balance = new Fl_Slider(370, 135, 40, 15, "Balance"); default_look_b(treble_balance); treble_mute = new Fl_Check_Button(365, 165, 20, 20, "Mute"); treble_mute->align(FL_ALIGN_BOTTOM); treble_rec = new Fl_Check_Button(395, 165, 20, 20, "Rec"); treble_rec->align(FL_ALIGN_BOTTOM); mic_slider = new Fl_Slider(440, 50, 20, 80, "MIC"); default_look(mic_slider); mic_balance = new Fl_Slider(430, 135, 40, 15, "Balance"); default_look_b(mic_balance); mic_mute = new Fl_Check_Button(425, 165, 20, 20, "Mute"); mic_mute->align(FL_ALIGN_BOTTOM); mic_rec = new Fl_Check_Button(455, 165, 20, 20, "Rec"); mic_rec->align(FL_ALIGN_BOTTOM); speaker_slider = new Fl_Slider(500, 50, 20, 80, "SPK"); default_look(speaker_slider); speaker_balance = new Fl_Slider(490, 135, 40, 15, "Balance"); default_look_b(speaker_balance); speaker_mute = new Fl_Check_Button(485, 165, 20, 20, "Mute"); speaker_mute->align(FL_ALIGN_BOTTOM); speaker_rec = new Fl_Check_Button(515, 165, 20, 20, "Rec"); speaker_rec->align(FL_ALIGN_BOTTOM); imix_slider = new Fl_Slider(560, 50, 20, 80, "IMIX"); default_look(imix_slider); imix_balance = new Fl_Slider(550, 135, 40, 15, "Balance"); default_look_b(imix_balance); imix_mute = new Fl_Check_Button(545, 165, 20, 20, "Mute"); imix_mute->align(FL_ALIGN_BOTTOM); imix_rec = new Fl_Check_Button(575, 165, 20, 20, "Rec"); imix_rec->align(FL_ALIGN_BOTTOM); igain_slider = new Fl_Slider(620, 50, 20, 80, "IGAIN"); default_look(igain_slider); igain_balance = new Fl_Slider(610, 135, 40, 15, "Balance"); default_look_b(igain_balance); igain_mute = new Fl_Check_Button(605, 165, 20, 20, "Mute"); igain_mute->align(FL_ALIGN_BOTTOM); igain_rec = new Fl_Check_Button(635, 165, 20, 20, "Rec"); igain_rec->align(FL_ALIGN_BOTTOM); ogain_slider = new Fl_Slider(680, 50, 20, 80, "OGAIN"); default_look(ogain_slider); ogain_balance = new Fl_Slider(670, 135, 40, 15, "Balance"); default_look_b(ogain_balance); ogain_mute = new Fl_Check_Button(665, 165, 20, 20, "Mute"); ogain_mute->align(FL_ALIGN_BOTTOM); ogain_rec = new Fl_Check_Button(695, 165, 20, 20, "Rec"); ogain_rec->align(FL_ALIGN_BOTTOM); mixer_device = open(device, O_RDWR); if (mixer_device == -1) { fl_alert(_("Opening mixer device %s failed. Setup correct device in configuration dialog."), device); volume_slider->deactivate(); cd_slider->deactivate(); pcm_slider->deactivate(); synth_slider->deactivate(); line_slider->deactivate(); bass_slider->deactivate(); treble_slider->deactivate(); mic_slider->deactivate(); speaker_slider->deactivate(); imix_slider->deactivate(); igain_slider->deactivate(); ogain_slider->deactivate(); } update_info(); volume_slider->callback( cb_volume, 1 ); volume_balance->callback( cb_volume, 2 ); volume_mute->callback( cb_volume, 3 ); volume_rec->callback( cb_volume, 4 ); get_device_info(mixer_device, volume_slider, volume_balance, volume_rec, SOUND_MIXER_VOLUME); cd_slider->callback( cb_cd, 1 ); cd_balance->callback( cb_cd, 2 ); cd_mute->callback( cb_cd, 3 ); cd_rec->callback( cb_cd, 4 ); get_device_info(mixer_device, cd_slider, cd_balance, cd_rec, SOUND_MIXER_CD); pcm_slider->callback( cb_pcm, 1 ); pcm_balance->callback( cb_pcm, 2 ); pcm_mute->callback( cb_pcm, 3 ); pcm_rec->callback( cb_pcm, 4 ); get_device_info(mixer_device, pcm_slider, pcm_balance, pcm_rec, SOUND_MIXER_PCM); synth_slider->callback( cb_synth, 1 ); synth_balance->callback( cb_synth, 2 ); synth_mute->callback( cb_synth, 3 ); synth_rec->callback( cb_synth, 4 ); get_device_info(mixer_device, synth_slider, synth_balance, synth_rec, SOUND_MIXER_SYNTH); line_slider->callback( cb_line, 1 ); line_balance->callback( cb_line, 2 ); line_mute->callback( cb_line, 3 ); line_rec->callback( cb_line, 4 ); get_device_info(mixer_device, line_slider, line_balance, line_rec, SOUND_MIXER_LINE); bass_slider->callback( cb_bass, 1 ); bass_balance->callback( cb_bass, 2 ); bass_mute->callback( cb_bass, 3 ); bass_rec->callback( cb_bass, 4 ); get_device_info(mixer_device, bass_slider, bass_balance, bass_rec, SOUND_MIXER_BASS); treble_slider->callback( cb_treble, 1 ); treble_balance->callback( cb_treble, 2 ); treble_mute->callback( cb_treble, 3 ); treble_rec->callback( cb_treble, 4 ); get_device_info(mixer_device, treble_slider, treble_balance, treble_rec, SOUND_MIXER_TREBLE); mic_slider->callback( cb_mic, 1 ); mic_balance->callback( cb_mic, 2 ); mic_mute->callback( cb_mic, 3 ); mic_rec->callback( cb_mic, 4 ); get_device_info(mixer_device, mic_slider, mic_balance, mic_rec, SOUND_MIXER_MIC); speaker_slider->callback( cb_speaker, 1 ); speaker_balance->callback( cb_speaker, 2 ); speaker_mute->callback( cb_speaker, 3 ); speaker_rec->callback( cb_speaker, 4 ); get_device_info(mixer_device, speaker_slider, speaker_balance, speaker_rec, SOUND_MIXER_SPEAKER); imix_slider->callback( cb_imix, 1 ); imix_balance->callback( cb_imix, 2 ); imix_mute->callback( cb_imix, 3 ); imix_rec->callback( cb_imix, 4 ); get_device_info(mixer_device, imix_slider, imix_balance, imix_rec, SOUND_MIXER_IMIX); igain_slider->callback( cb_igain, 1 ); igain_balance->callback( cb_igain, 2 ); igain_mute->callback( cb_igain, 3 ); igain_rec->callback( cb_igain, 4 ); get_device_info(mixer_device, igain_slider, igain_balance, igain_rec, SOUND_MIXER_IGAIN); ogain_slider->callback( cb_ogain, 1 ); ogain_balance->callback( cb_ogain, 2 ); ogain_mute->callback( cb_ogain, 3 ); ogain_rec->callback( cb_ogain, 4 ); get_device_info(mixer_device, ogain_slider, ogain_balance, ogain_rec, SOUND_MIXER_OGAIN); main_window->end(); main_window->show(argc, argv); return Fl::run(); }
unsigned long Options::updateSettings() { KSharedConfig::Ptr _config = KGlobal::config(); unsigned long changed = 0; changed |= KDecorationOptions::updateSettings( _config.data() ); // read decoration settings KConfigGroup config( _config, "Windows" ); moveMode = stringToMoveResizeMode( config.readEntry("MoveMode", "Opaque" )); resizeMode = stringToMoveResizeMode( config.readEntry("ResizeMode", "Opaque" )); show_geometry_tip = config.readEntry("GeometryTip", false); QString val; val = config.readEntry ("FocusPolicy", "ClickToFocus"); focusPolicy = ClickToFocus; // what a default :-) if ( val == "FocusFollowsMouse" ) focusPolicy = FocusFollowsMouse; else if ( val == "FocusUnderMouse" ) focusPolicy = FocusUnderMouse; else if ( val == "FocusStrictlyUnderMouse" ) focusPolicy = FocusStrictlyUnderMouse; val = config.readEntry ("AltTabStyle", "KDE"); altTabStyle = KDE; // what a default :-) if ( val == "CDE" ) altTabStyle = CDE; separateScreenFocus = config.readEntry( "SeparateScreenFocus", false ); activeMouseScreen = config.readEntry( "ActiveMouseScreen", focusPolicy != ClickToFocus ); rollOverDesktops = config.readEntry("RollOverDesktops", true); // focusStealingPreventionLevel = config.readEntry( "FocusStealingPreventionLevel", 2 ); // TODO use low level for now focusStealingPreventionLevel = config.readEntry( "FocusStealingPreventionLevel", 1 ); focusStealingPreventionLevel = qMax( 0, qMin( 4, focusStealingPreventionLevel )); if( !focusPolicyIsReasonable()) // #48786, comments #7 and later focusStealingPreventionLevel = 0; xineramaEnabled = config.readEntry ("XineramaEnabled", true); xineramaPlacementEnabled = config.readEntry ("XineramaPlacementEnabled", true); xineramaMovementEnabled = config.readEntry ("XineramaMovementEnabled", true); xineramaMaximizeEnabled = config.readEntry ("XineramaMaximizeEnabled", true); xineramaFullscreenEnabled = config.readEntry ("XineramaFullscreenEnabled", true); placement = Placement::policyFromString( config.readEntry("Placement"), true ); xineramaPlacementScreen = qBound( -1, config.readEntry( "XineramaPlacementScreen", -1 ), Kephal::ScreenUtils::numScreens() - 1 ); if( focusPolicy == ClickToFocus ) { autoRaise = false; autoRaiseInterval = 0; delayFocus = false; delayFocusInterval = 0; } else { autoRaise = config.readEntry("AutoRaise", false); autoRaiseInterval = config.readEntry("AutoRaiseInterval", 0 ); delayFocus = config.readEntry("DelayFocus", false); delayFocusInterval = config.readEntry("DelayFocusInterval", 0 ); } shadeHover = config.readEntry("ShadeHover", false); shadeHoverInterval = config.readEntry("ShadeHoverInterval", 250 ); // important: autoRaise implies ClickRaise clickRaise = autoRaise || config.readEntry("ClickRaise", true); borderSnapZone = config.readEntry("BorderSnapZone", 10); windowSnapZone = config.readEntry("WindowSnapZone", 10); centerSnapZone = config.readEntry("CenterSnapZone", 0); snapOnlyWhenOverlapping = config.readEntry("SnapOnlyWhenOverlapping", false); // Electric borders KConfigGroup borderConfig( _config, "ElectricBorders" ); electric_border_top = electricBorderAction( borderConfig.readEntry( "Top", "None" )); electric_border_top_right = electricBorderAction( borderConfig.readEntry( "TopRight", "None" )); electric_border_right = electricBorderAction( borderConfig.readEntry( "Right", "None" )); electric_border_bottom_right = electricBorderAction( borderConfig.readEntry( "BottomRight", "None" )); electric_border_bottom = electricBorderAction( borderConfig.readEntry( "Bottom", "None" )); electric_border_bottom_left = electricBorderAction( borderConfig.readEntry( "BottomLeft", "None" )); electric_border_left = electricBorderAction( borderConfig.readEntry( "Left", "None" )); electric_border_top_left = electricBorderAction( borderConfig.readEntry( "TopLeft", "None" )); electric_borders = config.readEntry("ElectricBorders", 0); electric_border_delay = config.readEntry("ElectricBorderDelay", 150); electric_border_cooldown = config.readEntry("ElectricBorderCooldown", 350); OpTitlebarDblClick = windowOperation( config.readEntry("TitlebarDoubleClickCommand", "Maximize"), true ); setOpMaxButtonLeftClick( windowOperation( config.readEntry("MaximizeButtonLeftClickCommand", "Maximize"), true )); setOpMaxButtonMiddleClick( windowOperation( config.readEntry("MaximizeButtonMiddleClickCommand", "Maximize (vertical only)"), true )); setOpMaxButtonRightClick( windowOperation( config.readEntry("MaximizeButtonRightClickCommand", "Maximize (horizontal only)"), true )); ignorePositionClasses = config.readEntry("IgnorePositionClasses",QStringList()); ignoreFocusStealingClasses = config.readEntry("IgnoreFocusStealingClasses",QStringList()); // Qt3.2 and older had resource class all lowercase, but Qt3.3 has it capitalized // therefore Client::resourceClass() forces lowercase, force here lowercase as well for( QStringList::Iterator it = ignorePositionClasses.begin(); it != ignorePositionClasses.end(); ++it ) (*it) = (*it).toLower(); for( QStringList::Iterator it = ignoreFocusStealingClasses.begin(); it != ignoreFocusStealingClasses.end(); ++it ) (*it) = (*it).toLower(); killPingTimeout = config.readEntry( "KillPingTimeout", 5000 ); hideUtilityWindowsForInactive = config.readEntry( "HideUtilityWindowsForInactive", true); showDesktopIsMinimizeAll = config.readEntry( "ShowDesktopIsMinimizeAll", false ); // Mouse bindings config = KConfigGroup( _config, "MouseBindings" ); CmdActiveTitlebar1 = mouseCommand(config.readEntry("CommandActiveTitlebar1","Raise"), true ); CmdActiveTitlebar2 = mouseCommand(config.readEntry("CommandActiveTitlebar2","Lower"), true ); CmdActiveTitlebar3 = mouseCommand(config.readEntry("CommandActiveTitlebar3","Operations menu"), true ); CmdInactiveTitlebar1 = mouseCommand(config.readEntry("CommandInactiveTitlebar1","Activate and raise"), true ); CmdInactiveTitlebar2 = mouseCommand(config.readEntry("CommandInactiveTitlebar2","Activate and lower"), true ); CmdInactiveTitlebar3 = mouseCommand(config.readEntry("CommandInactiveTitlebar3","Operations menu"), true ); CmdTitlebarWheel = mouseWheelCommand(config.readEntry("CommandTitlebarWheel","Nothing")); CmdWindow1 = mouseCommand(config.readEntry("CommandWindow1","Activate, raise and pass click"), false ); CmdWindow2 = mouseCommand(config.readEntry("CommandWindow2","Activate and pass click"), false ); CmdWindow3 = mouseCommand(config.readEntry("CommandWindow3","Activate and pass click"), false ); CmdAllModKey = (config.readEntry("CommandAllKey","Alt") == "Meta") ? Qt::Key_Meta : Qt::Key_Alt; CmdAll1 = mouseCommand(config.readEntry("CommandAll1","Move"), false ); CmdAll2 = mouseCommand(config.readEntry("CommandAll2","Toggle raise and lower"), false ); CmdAll3 = mouseCommand(config.readEntry("CommandAll3","Resize"), false ); CmdAllWheel = mouseWheelCommand(config.readEntry("CommandAllWheel","Nothing")); config=KConfigGroup(_config,"Compositing"); refreshRate = config.readEntry( "RefreshRate", 0 ); // Read button tooltip animation effect from kdeglobals // Since we want to allow users to enable window decoration tooltips // and not kstyle tooltips and vise-versa, we don't read the // "EffectNoTooltip" setting from kdeglobals. #if 0 FIXME: we have no mac style menu implementation in kwin anymore, so this just breaks things for people! KConfig _globalConfig("kdeglobals"); KConfigGroup globalConfig(&_globalConfig, "KDE"); topmenus = globalConfig.readEntry("macStyle", false); #else topmenus = false; #endif // QToolTip::setGloballyEnabled( d->show_tooltips ); // KDE4 this probably needs to be done manually in clients // Driver-specific config detection CompositingPrefs prefs; prefs.detect(); reloadCompositingSettings( prefs ); return changed; }