diff --git a/kcmkwin/kwinrules/CMakeLists.txt b/kcmkwin/kwinrules/CMakeLists.txt index 982a98762..ce5b5f080 100644 --- a/kcmkwin/kwinrules/CMakeLists.txt +++ b/kcmkwin/kwinrules/CMakeLists.txt @@ -1,86 +1,85 @@ # KI18N Translation Domain for this library add_definitions(-DTRANSLATION_DOMAIN=\"kcmkwinrules\") add_definitions(-DKCMRULES) ########### next target ############### include_directories(../../) set(kwinrules_MOC_HDRS ../../cursor.h ../../plugins/platforms/x11/standalone/x11cursor.h) qt5_wrap_cpp(kwinrules_MOC_SRCS ${kwinrules_MOC_HDRS}) set(kwinrules_SRCS ../../rulebooksettings.cpp optionsmodel.cpp ruleitem.cpp rulesmodel.cpp rulesdialog.cpp main.cpp kwinsrc.cpp ${kwinrules_MOC_SRCS} ) kconfig_add_kcfg_files(kwinrules_SRCS ../../rulesettings.kcfgc) kconfig_add_kcfg_files(kwinrules_SRCS ../../rulebooksettingsbase.kcfgc) add_executable(kwin_rules_dialog ${kwinrules_SRCS}) set(kwin_kcm_rules_XCB_LIBS XCB::CURSOR XCB::XCB XCB::XFIXES ) set(kcm_libs Qt5::Concurrent Qt5::X11Extras Qt5::QuickWidgets KF5::Completion KF5::ConfigWidgets KF5::I18n KF5::Service KF5::WindowSystem KF5::XmlGui ) if (KWIN_BUILD_ACTIVITIES) set(kcm_libs ${kcm_libs} KF5::Activities) endif() target_link_libraries(kwin_rules_dialog ${kcm_libs} ${kwin_kcm_rules_XCB_LIBS}) install(TARGETS kwin_rules_dialog DESTINATION ${LIBEXEC_INSTALL_DIR}) ########### next target ############### -set(kcmkwinrules_qml_SRCS +set(kcmkwinrules_SRCS kcmrules.cpp ${kwinrules_SRCS} ) -add_library(kcm_kwinrules_qml MODULE ${kcmkwinrules_qml_SRCS}) +add_library(kcm_kwinrules MODULE ${kcmkwinrules_SRCS}) -target_link_libraries(kcm_kwinrules_qml +target_link_libraries(kcm_kwinrules Qt5::Quick KF5::I18n KF5::ConfigWidgets KF5::CoreAddons KF5::QuickAddons KF5::WindowSystem ${kcm_libs} ${kwin_kcm_rules_XCB_LIBS} ) -kcoreaddons_desktop_to_json(kcm_kwinrules_qml "kcm_kwinrules_qml.desktop" SERVICE_TYPES kcmodule.desktop) +kcoreaddons_desktop_to_json(kcm_kwinrules "kcm_kwinrules.desktop" SERVICE_TYPES kcmodule.desktop) -# This desktop file is installed only for retrocompatibility with sycoca -install(TARGETS kcm_kwinrules_qml DESTINATION ${KDE_INSTALL_PLUGINDIR}/kcms) -install(FILES kcm_kwinrules_qml.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) +########### install files ############### -kpackage_install_package(package kcm_kwinrules_qml kcms) +# This desktop file is installed only for retrocompatibility with sycoca +install(TARGETS kcm_kwinrules DESTINATION ${KDE_INSTALL_PLUGINDIR}/kcms) +install(FILES kcm_kwinrules.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) -########### install files ############### +kpackage_install_package(package kcm_kwinrules kcms) -install(FILES kwinrules.desktop DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/kcmkwin/kwinrules/kcm_kwinrules_qml.desktop b/kcmkwin/kwinrules/kcm_kwinrules.desktop similarity index 99% rename from kcmkwin/kwinrules/kcm_kwinrules_qml.desktop rename to kcmkwin/kwinrules/kcm_kwinrules.desktop index ffc16d663..bb5ff1185 100644 --- a/kcmkwin/kwinrules/kcm_kwinrules_qml.desktop +++ b/kcmkwin/kwinrules/kcm_kwinrules.desktop @@ -1,164 +1,164 @@ [Desktop Entry] -Exec=kcmshell5 kwinrules_qml +Exec=kcmshell5 kwinrules Icon=preferences-system-windows-actions Categories=Qt;KDE;X-KDE-settings-looknfeel; Type=Service X-KDE-ServiceTypes=KCModule -X-KDE-Library=kcm_kwinrules_qml +X-KDE-Library=kcm_kwinrules X-KDE-ParentApp=kcontrol X-KDE-System-Settings-Parent-Category=windowmanagement X-KDE-Weight=120 X-KDE-FormFactors=desktop,tablet Name=Window Rules Name[ar]=قواعد النوافذ Name[bg]=Правила за прозорци Name[bs]=Pravila prozora Name[ca]=Regles de les finestres Name[ca@valencia]=Regles de les finestres Name[cs]=Pravidla oken Name[da]=Vinduesregler Name[de]=Fensterregeln Name[el]=Κανόνες παραθύρου Name[en_GB]=Window Rules Name[es]=Reglas de las ventanas Name[et]=Akna reeglid Name[eu]=Leihoaren arauak Name[fi]=Ikkunasäännöt Name[fr]=Règles de la fenêtre Name[ga]=Rialacha Fuinneog Name[gl]=Regras da xanela Name[gu]=વિન્ડો નિયમો Name[he]=כללי חלון Name[hi]=विंडो निय Name[hr]=Pravila prozora Name[hu]=Ablakszabályok Name[ia]=Regulas de fenestra Name[id]=Peraturan Window Name[is]=Gluggahegðunarreglur Name[it]=Regole delle finestre Name[ja]=ウィンドウルール Name[kk]=Терезе тәртібі Name[km]=ក្បួន​បង្អួច Name[kn]=ವಿಂಡೋ ನಿಯಮಗಳು Name[ko]=창 규칙 Name[lt]=Langų taisyklės Name[lv]=Loga noteikumi Name[mr]=चौकट नियम Name[nb]=Vindusregler Name[nds]=Finsterbedregen Name[nl]=Vensterregels Name[nn]=Vindaugsreglar Name[pa]=ਵਿੰਡੋ ਨਿਯਮ Name[pl]=Zasady okien Name[pt]=Regras das Janelas Name[pt_BR]=Regras das janelas Name[ro]=Reguli fereastră Name[ru]=Особые параметры окон Name[si]=කවුළු නීති Name[sk]=Pravidlá okien Name[sl]=Pravila za okna Name[sr]=Правила прозора Name[sr@ijekavian]=Правила прозора Name[sr@ijekavianlatin]=Pravila prozora Name[sr@latin]=Pravila prozora Name[sv]=Fönsterregler Name[th]=กฎต่าง ๆ ของหน้าต่าง Name[tr]=Pencere Kuralları Name[ug]=كۆزنەك بەلگىلىمىسى Name[uk]=Правила вікон Name[wa]=Rîles des finiesses Name[x-test]=xxWindow Rulesxx Name[zh_CN]=窗口规则 Name[zh_TW]=視窗規則 Comment=Individual Window Behavior Comment[bs]=Ponašanje pojedinog prozora Comment[ca]=Comportament individual de les finestres Comment[ca@valencia]=Comportament individual de les finestres Comment[cs]=Chování individuálních oken Comment[da]=Opførsel af enkeltvinduer Comment[de]=Individuelles Fensterverhalten Comment[el]=Συμπεριφορά ανεξάρτητου παραθύρου Comment[en_GB]=Individual Window Behaviour Comment[es]=Comportamiento de las ventanas individuales Comment[et]=Konkreetse akna käitumine Comment[eu]=Leihoen banakako portaera Comment[fi]=Yksittäisten ikkunoiden toiminta Comment[fr]=Comportement individuel des fenêtres Comment[gl]=Comportamento individual das xanelas Comment[he]=התנהגות חלונות ספציפים Comment[hu]=Egyéni ablakműveletek Comment[ia]=Comportamento de fenestra individual Comment[id]=Perilaku Window Individu Comment[it]=Comportamento della singola finestra Comment[ja]=個別のウィンドウの挙動 Comment[ko]=개별 창 동작 Comment[lt]=Individuali langų elgsena Comment[nb]=Oppførsel for individuelle vinduer Comment[nds]=Bedregen vun enkelte Finstern Comment[nl]=Individueel venstergedrag Comment[nn]=Åtferd for einskildvindauge Comment[pa]=ਵੱਖ-ਵੱਖ ਵਿੰਡੋ ਰਵੱਈਆ Comment[pl]=Wyjątkowe okna Comment[pt]=Comportamento das Janelas Individuais Comment[pt_BR]=Comportamento das janelas individuais Comment[ru]=Особые параметры конкретных окон Comment[sk]=Individuálne správanie okien Comment[sl]=Obnašanje posameznih oken Comment[sr]=Понашање појединачних прозора Comment[sr@ijekavian]=Понашање појединачних прозора Comment[sr@ijekavianlatin]=Ponašanje pojedinačnih prozora Comment[sr@latin]=Ponašanje pojedinačnih prozora Comment[sv]=Individuellt fönsterbeteende Comment[tr]=Bireysel Pencere Davranışı Comment[uk]=Поведінка окремих вікон Comment[x-test]=xxIndividual Window Behaviorxx Comment[zh_CN]=个别窗口行为 Comment[zh_TW]=個別視窗行為 X-KDE-Keywords=size,position,state,window behavior,windows,specific,workarounds,remember,rules X-KDE-Keywords[bs]=veličina,pozicija,grad,reagiranje prozora,prozori,specifičan,workarounds,sjećati se,pravila X-KDE-Keywords[ca]=mida,posició,estat,comportament de la finestra,finestres,específic,solucions alternatives,recorda,regles X-KDE-Keywords[ca@valencia]=mida,posició,estat,comportament de la finestra,finestres,específic,solucions alternatives,recorda,regles X-KDE-Keywords[da]=størrelse,position,tilstand,vinduesopførsel,vinduer,specifikt,workarounds,husk,regler X-KDE-Keywords[de]=Größe,Position,Status,Fensterverhalten,Fenster,Regeln X-KDE-Keywords[el]=μέγεθος,θέση,κατάσταση,συμπεριφορά παραθύρου,παράθυρα,ειδική,εναλλακτικές,απομνημόνευση,κανόνες X-KDE-Keywords[en_GB]=size,position,state,window behaviour,windows,specific,workarounds,remember,rules X-KDE-Keywords[es]=tamaño,posición,estado,comportamiento de las ventanas,ventanas,específicos,soluciones,recordatorio,reglas X-KDE-Keywords[et]=suurus,asukoht,olek,akende käitumine,aknad,meeldejätmine,reeglid X-KDE-Keywords[eu]=tamaina,posizio,egoera,leihoaren portaera,leihoak,zehatz,konponbide,gogorarazpen,arau X-KDE-Keywords[fi]=koko,sijainti,tila,ikkunoiden toiminta,ikkunat,erikoisasetukset,ikkunakohtaiset,korjaukset,muista,muistaminen,säännöt X-KDE-Keywords[fr]=taille, position, état, comportement de la fenêtre, fenêtres, spécifique, contournements, rappel, règles X-KDE-Keywords[ga]=méid,ionad,staid,oibriú na bhfuinneog,fuinneoga,sainiúil,réitigh seiftithe,meabhraigh,rialacha X-KDE-Keywords[gl]=tamaño,posición,estado,comportamento da xanela,xanelas,específico,regra X-KDE-Keywords[hu]=méret,elhelyezkedés,állapot,ablakműködés,ablakok,specifikus,kerülő megoldások,megjegyzés,szabályok X-KDE-Keywords[ia]=grandor,position,stato,comportamento de fenestra,fenestras,specific,workarounds,memora,regulas X-KDE-Keywords[id]=ukuran,posisi,kondisi,perilaku window,window,spesifik,sekeliling,ingat,peraturan X-KDE-Keywords[it]=dimensione,posizione,stato,comportamento della finestra,finestre,specifico,espedienti,ricorda,regole X-KDE-Keywords[kk]=size,position,state,window behavior,windows,specific,workarounds,remember,rules X-KDE-Keywords[km]=size,position,state,window behavior,windows,specific,workarounds,remember,rules X-KDE-Keywords[ko]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,크기,위치,창 행동,창,창 지정,규칙 X-KDE-Keywords[lt]=dydis,pozicija,vieta,būsena,busena,lango elgsena,langų elgsena,langu elgsena,langas,langai,apėjimas,apejimas,apėjimai,apejimai,specifiniai,tam tikri,tam tikros,tam tikrų,tam tikru,įsiminti,isiminti,atsiminti,prisiminti,taisyklės,taisykles X-KDE-Keywords[nb]=størrelse,plassering,vindusoppførsel,vindu,bestemt,løsninger,husk,regler X-KDE-Keywords[nds]=Grött,Positschoon,Tostand,Finsterbedregen,Finstern,besünner,Ümto,wohren,Regeln X-KDE-Keywords[nl]=grootte,positie,status,venstergedrag,vensters,specifiek,er omheen gewerkt,herinneren,regels X-KDE-Keywords[nn]=storleik,plassering,tilstand,vindaugsåtferd,vindauge,einskild,løysingar,unntak,hugs,reglar X-KDE-Keywords[pl]=rozmiar,pozycja,stan,zachowanie okna,okna,specyficzne,obejścia,zapamiętaj,reguły X-KDE-Keywords[pt]=tamanho,posição,estado,comportamento da janela,janelas,específico,alternativas,recordar,regras X-KDE-Keywords[pt_BR]=tamanho,posição,estado,comportamento da janela,janelas,específico,alternativas,lembrar,regras X-KDE-Keywords[ru]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,размер,позиция,состояние,поведение окон,окна,специальный,специальные возможности,запомнить,правила X-KDE-Keywords[sk]=veľkosť,poloha,stav,správanie okien,okná,špecifický,workaroundy,pamätať,pravidlá X-KDE-Keywords[sl]=velikost,položaj,stanje,obnašanje oken,okna,določeno,popravki,pomnjenje,pravila X-KDE-Keywords[sr]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,величина,положај,стање,понашање прозора,прозор,заобилазак,запамти,правила X-KDE-Keywords[sr@ijekavian]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,величина,положај,стање,понашање прозора,прозор,заобилазак,запамти,правила X-KDE-Keywords[sr@ijekavianlatin]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,veličina,položaj,stanje,ponašanje prozora,prozor,zaobilazak,zapamti,pravila X-KDE-Keywords[sr@latin]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,veličina,položaj,stanje,ponašanje prozora,prozor,zaobilazak,zapamti,pravila X-KDE-Keywords[sv]=storlek,position,tillstånd,fönsterbeteende,fönster,specifik,kom ihåg,regler X-KDE-Keywords[tr]=boyut,konum,durum,pencere davranışı,pencere,özel,etrafından dolanmalar,anımsa,kurallar X-KDE-Keywords[uk]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,розмір,розташування,місце,стан,поведінка,вікно,вікна,поведінка вікон,окрема,специфічна,окремо,запам’ятати,пам’ять,правило,правила X-KDE-Keywords[x-test]=xxsizexx,xxpositionxx,xxstatexx,xxwindow behaviorxx,xxwindowsxx,xxspecificxx,xxworkaroundsxx,xxrememberxx,xxrulesxx X-KDE-Keywords[zh_CN]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,大小,位置,窗口行为,特定,记住,规则 X-KDE-Keywords[zh_TW]=size,position,state,window behavior,windows,specific,workarounds,remember,rules diff --git a/kcmkwin/kwinrules/kcmrules.cpp b/kcmkwin/kwinrules/kcmrules.cpp index 737075c4e..b191461f5 100644 --- a/kcmkwin/kwinrules/kcmrules.cpp +++ b/kcmkwin/kwinrules/kcmrules.cpp @@ -1,287 +1,287 @@ /* * Copyright (c) 2004 Lubos Lunak * Copyright (c) 2020 Ismael Asensio * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "kcmrules.h" #include #include #include #include #include #include namespace KWin { KCMKWinRules::KCMKWinRules(QObject *parent, const QVariantList &arguments) : KQuickAddons::ConfigModule(parent, arguments) , m_ruleBook(new RuleBookSettings(this)) , m_rulesModel(new RulesModel(this)) { - auto about = new KAboutData(QStringLiteral("kcm_kwinrules_qml"), + auto about = new KAboutData(QStringLiteral("kcm_kwinrules"), i18n("Window Rules"), QStringLiteral("1.0"), QString(), KAboutLicense::GPL); about->addAuthor(i18n("Ismael Asensio"), i18n("Author"), QStringLiteral("isma.af@gmail.com")); setAboutData(about); setQuickHelp(i18n("

Window-specific Settings

Here you can customize window settings specifically only" " for some windows.

" "

Please note that this configuration will not take effect if you do not use" " KWin as your window manager. If you do use a different window manager, please refer to its documentation" " for how to customize window behavior.

")); connect(m_rulesModel, &RulesModel::descriptionChanged, this, [this]{ if (m_editingIndex >=0 && m_editingIndex < m_ruleBook->count()) { m_rules.at(m_editingIndex)->description = m_rulesModel->description(); emit ruleBookModelChanged(); } } ); connect(m_rulesModel, &RulesModel::dataChanged, this, &KCMKWinRules::updateNeedsSave); } KCMKWinRules::~KCMKWinRules() { qDeleteAll(m_rules); } QStringList KCMKWinRules::ruleBookModel() const { QStringList ruleDescriptionList; for (const Rules *rule : qAsConst(m_rules)) { ruleDescriptionList.append(rule->description); } return ruleDescriptionList; } void KCMKWinRules::load() { m_ruleBook->load(); m_rules = m_ruleBook->rules(); setNeedsSave(false); emit ruleBookModelChanged(); // Check if current index is no longer valid if (m_editingIndex >= m_rules.count()) { m_editingIndex = -1; pop(); emit editingIndexChanged(); } // Reset current index for rule editor if (m_editingIndex > 0) { m_rulesModel->importFromRules(m_rules.at(m_editingIndex)); } } void KCMKWinRules::save() { saveCurrentRule(); m_ruleBook->setRules(m_rules); m_ruleBook->save(); // Notify kwin to reload configuration QDBusMessage message = QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); QDBusConnection::sessionBus().send(message); } void KCMKWinRules::updateState() { m_ruleBook->setCount(m_rules.count()); emit editingIndexChanged(); emit ruleBookModelChanged(); updateNeedsSave(); } void KCMKWinRules::updateNeedsSave() { setNeedsSave(true); emit needsSaveChanged(); } void KCMKWinRules::saveCurrentRule() { if (m_editingIndex < 0) { return; } if (needsSave()) { delete(m_rules[m_editingIndex]); m_rules[m_editingIndex] = m_rulesModel->exportToRules(); } } int KCMKWinRules::editingIndex() const { return m_editingIndex; } void KCMKWinRules::editRule(int index) { if (index < 0 || index >= m_rules.count()) { return; } saveCurrentRule(); m_editingIndex = index; m_rulesModel->importFromRules(m_rules.at(m_editingIndex)); emit editingIndexChanged(); // Show and move to Rules Editor page if (depth() < 2) { push(QStringLiteral("RulesEditor.qml")); } setCurrentIndex(1); } void KCMKWinRules::createRule() { m_rules.append(new Rules()); updateState(); const int newIndex = m_rules.count() - 1; editRule(newIndex); saveCurrentRule(); } void KCMKWinRules::removeRule(int index) { if (index < 0 || index >= m_rules.count()) { return; } if (m_editingIndex == index) { m_editingIndex = -1; pop(); } delete(m_rules.at(index)); m_rules.removeAt(index); updateState(); } void KCMKWinRules::moveRule(int sourceIndex, int destIndex) { const int lastIndex = m_rules.count() - 1; if (sourceIndex == destIndex || (sourceIndex < 0 || sourceIndex > lastIndex) || (destIndex < 0 || destIndex > lastIndex)) { return; } m_rules.move(sourceIndex, destIndex); if (m_editingIndex == sourceIndex) { m_editingIndex = destIndex; emit editingIndexChanged(); } else if (m_editingIndex > sourceIndex && m_editingIndex <= destIndex) { m_editingIndex -= 1; emit editingIndexChanged(); } else if (m_editingIndex < sourceIndex && m_editingIndex >= destIndex) { m_editingIndex += 1; emit editingIndexChanged(); } emit ruleBookModelChanged(); updateNeedsSave(); } void KCMKWinRules::exportToFile(const QUrl &path, int index) { Q_ASSERT(index >= 0 && index < m_rules.count()); saveCurrentRule(); const auto config = KSharedConfig::openConfig(path.toLocalFile(), KConfig::SimpleConfig); RuleSettings settings(config, m_rules.at(index)->description); settings.setDefaults(); m_rules.at(index)->write(&settings); settings.save(); } void KCMKWinRules::importFromFile(const QUrl &path) { const auto config = KSharedConfig::openConfig(path.toLocalFile(), KConfig::SimpleConfig); const QStringList groups = config->groupList(); if (groups.isEmpty()) { return; } for (const QString &groupName : groups) { RuleSettings settings(config, groupName); const bool remove = settings.deleteRule(); const QString importDescription = settings.description(); if (importDescription.isEmpty()) { continue; } // Try to find a rule with the same description to replace int newIndex = -2; for (int index = 0; index < m_rules.count(); index++) { if (m_rules.at(index)->description == importDescription) { newIndex = index; break; } } if (remove) { removeRule(newIndex); continue; } Rules *newRule = new Rules(&settings); if (newIndex < 0) { m_rules.append(newRule); } else { delete m_rules[newIndex]; m_rules[newIndex] = newRule; } // Reset rule editor if the current rule changed when importing if (m_editingIndex == newIndex) { m_rulesModel->importFromRules(m_rules.at(m_editingIndex)); } } updateState(); } -K_PLUGIN_CLASS_WITH_JSON(KCMKWinRules, "kcm_kwinrules_qml.json"); +K_PLUGIN_CLASS_WITH_JSON(KCMKWinRules, "kcm_kwinrules.json"); } // namespace #include "kcmrules.moc" diff --git a/kcmkwin/kwinrules/kwinrules.desktop b/kcmkwin/kwinrules/kwinrules.desktop deleted file mode 100644 index bb7eaf378..000000000 --- a/kcmkwin/kwinrules/kwinrules.desktop +++ /dev/null @@ -1,163 +0,0 @@ -[Desktop Entry] -Exec=kcmshell5 kwinrules -Icon=preferences-system-windows-actions -Type=Service -X-KDE-ServiceTypes=KCModule -X-DocPath=kcontrol/windowspecific/index.html - -X-KDE-Library=kcm_kwinrules -X-KDE-ParentApp=kcontrol - -X-KDE-System-Settings-Parent-Category=windowmanagement -X-KDE-Weight=120 - -Name=Window Rules -Name[ar]=قواعد النوافذ -Name[bg]=Правила за прозорци -Name[bs]=Pravila prozora -Name[ca]=Regles de les finestres -Name[ca@valencia]=Regles de les finestres -Name[cs]=Pravidla oken -Name[da]=Vinduesregler -Name[de]=Fensterregeln -Name[el]=Κανόνες παραθύρου -Name[en_GB]=Window Rules -Name[es]=Reglas de las ventanas -Name[et]=Akna reeglid -Name[eu]=Leihoaren arauak -Name[fi]=Ikkunasäännöt -Name[fr]=Règles de la fenêtre -Name[ga]=Rialacha Fuinneog -Name[gl]=Regras da xanela -Name[gu]=વિન્ડો નિયમો -Name[he]=כללי חלון -Name[hi]=विंडो निय -Name[hr]=Pravila prozora -Name[hu]=Ablakszabályok -Name[ia]=Regulas de fenestra -Name[id]=Peraturan Window -Name[is]=Gluggahegðunarreglur -Name[it]=Regole delle finestre -Name[ja]=ウィンドウルール -Name[kk]=Терезе тәртібі -Name[km]=ក្បួន​បង្អួច -Name[kn]=ವಿಂಡೋ ನಿಯಮಗಳು -Name[ko]=창 규칙 -Name[lt]=Langų taisyklės -Name[lv]=Loga noteikumi -Name[mr]=चौकट नियम -Name[nb]=Vindusregler -Name[nds]=Finsterbedregen -Name[nl]=Vensterregels -Name[nn]=Vindaugsreglar -Name[pa]=ਵਿੰਡੋ ਨਿਯਮ -Name[pl]=Zasady okien -Name[pt]=Regras das Janelas -Name[pt_BR]=Regras das janelas -Name[ro]=Reguli fereastră -Name[ru]=Особые параметры окон -Name[si]=කවුළු නීති -Name[sk]=Pravidlá okien -Name[sl]=Pravila za okna -Name[sr]=Правила прозора -Name[sr@ijekavian]=Правила прозора -Name[sr@ijekavianlatin]=Pravila prozora -Name[sr@latin]=Pravila prozora -Name[sv]=Fönsterregler -Name[th]=กฎต่าง ๆ ของหน้าต่าง -Name[tr]=Pencere Kuralları -Name[ug]=كۆزنەك بەلگىلىمىسى -Name[uk]=Правила вікон -Name[wa]=Rîles des finiesses -Name[x-test]=xxWindow Rulesxx -Name[zh_CN]=窗口规则 -Name[zh_TW]=視窗規則 - -Comment=Individual Window Behavior -Comment[bs]=Ponašanje pojedinog prozora -Comment[ca]=Comportament individual de les finestres -Comment[ca@valencia]=Comportament individual de les finestres -Comment[cs]=Chování individuálních oken -Comment[da]=Opførsel af enkeltvinduer -Comment[de]=Individuelles Fensterverhalten -Comment[el]=Συμπεριφορά ανεξάρτητου παραθύρου -Comment[en_GB]=Individual Window Behaviour -Comment[es]=Comportamiento de las ventanas individuales -Comment[et]=Konkreetse akna käitumine -Comment[eu]=Leihoen banakako portaera -Comment[fi]=Yksittäisten ikkunoiden toiminta -Comment[fr]=Comportement individuel des fenêtres -Comment[gl]=Comportamento individual das xanelas -Comment[he]=התנהגות חלונות ספציפים -Comment[hu]=Egyéni ablakműveletek -Comment[ia]=Comportamento de fenestra individual -Comment[id]=Perilaku Window Individu -Comment[it]=Comportamento della singola finestra -Comment[ja]=個別のウィンドウの挙動 -Comment[ko]=개별 창 동작 -Comment[lt]=Individuali langų elgsena -Comment[nb]=Oppførsel for individuelle vinduer -Comment[nds]=Bedregen vun enkelte Finstern -Comment[nl]=Individueel venstergedrag -Comment[nn]=Åtferd for einskildvindauge -Comment[pa]=ਵੱਖ-ਵੱਖ ਵਿੰਡੋ ਰਵੱਈਆ -Comment[pl]=Wyjątkowe okna -Comment[pt]=Comportamento das Janelas Individuais -Comment[pt_BR]=Comportamento das janelas individuais -Comment[ru]=Особые параметры конкретных окон -Comment[sk]=Individuálne správanie okien -Comment[sl]=Obnašanje posameznih oken -Comment[sr]=Понашање појединачних прозора -Comment[sr@ijekavian]=Понашање појединачних прозора -Comment[sr@ijekavianlatin]=Ponašanje pojedinačnih prozora -Comment[sr@latin]=Ponašanje pojedinačnih prozora -Comment[sv]=Individuellt fönsterbeteende -Comment[tr]=Bireysel Pencere Davranışı -Comment[uk]=Поведінка окремих вікон -Comment[x-test]=xxIndividual Window Behaviorxx -Comment[zh_CN]=个别窗口行为 -Comment[zh_TW]=個別視窗行為 - -X-KDE-Keywords=size,position,state,window behavior,windows,specific,workarounds,remember,rules -X-KDE-Keywords[bs]=veličina,pozicija,grad,reagiranje prozora,prozori,specifičan,workarounds,sjećati se,pravila -X-KDE-Keywords[ca]=mida,posició,estat,comportament de la finestra,finestres,específic,solucions alternatives,recorda,regles -X-KDE-Keywords[ca@valencia]=mida,posició,estat,comportament de la finestra,finestres,específic,solucions alternatives,recorda,regles -X-KDE-Keywords[da]=størrelse,position,tilstand,vinduesopførsel,vinduer,specifikt,workarounds,husk,regler -X-KDE-Keywords[de]=Größe,Position,Status,Fensterverhalten,Fenster,Regeln -X-KDE-Keywords[el]=μέγεθος,θέση,κατάσταση,συμπεριφορά παραθύρου,παράθυρα,ειδική,εναλλακτικές,απομνημόνευση,κανόνες -X-KDE-Keywords[en_GB]=size,position,state,window behaviour,windows,specific,workarounds,remember,rules -X-KDE-Keywords[es]=tamaño,posición,estado,comportamiento de las ventanas,ventanas,específicos,soluciones,recordatorio,reglas -X-KDE-Keywords[et]=suurus,asukoht,olek,akende käitumine,aknad,meeldejätmine,reeglid -X-KDE-Keywords[eu]=tamaina,posizio,egoera,leihoaren portaera,leihoak,zehatz,konponbide,gogorarazpen,arau -X-KDE-Keywords[fi]=koko,sijainti,tila,ikkunoiden toiminta,ikkunat,erikoisasetukset,ikkunakohtaiset,korjaukset,muista,muistaminen,säännöt -X-KDE-Keywords[fr]=taille, position, état, comportement de la fenêtre, fenêtres, spécifique, contournements, rappel, règles -X-KDE-Keywords[ga]=méid,ionad,staid,oibriú na bhfuinneog,fuinneoga,sainiúil,réitigh seiftithe,meabhraigh,rialacha -X-KDE-Keywords[gl]=tamaño,posición,estado,comportamento da xanela,xanelas,específico,regra -X-KDE-Keywords[hu]=méret,elhelyezkedés,állapot,ablakműködés,ablakok,specifikus,kerülő megoldások,megjegyzés,szabályok -X-KDE-Keywords[ia]=grandor,position,stato,comportamento de fenestra,fenestras,specific,workarounds,memora,regulas -X-KDE-Keywords[id]=ukuran,posisi,kondisi,perilaku window,window,spesifik,sekeliling,ingat,peraturan -X-KDE-Keywords[it]=dimensione,posizione,stato,comportamento della finestra,finestre,specifico,espedienti,ricorda,regole -X-KDE-Keywords[kk]=size,position,state,window behavior,windows,specific,workarounds,remember,rules -X-KDE-Keywords[km]=size,position,state,window behavior,windows,specific,workarounds,remember,rules -X-KDE-Keywords[ko]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,크기,위치,창 행동,창,창 지정,규칙 -X-KDE-Keywords[lt]=dydis,pozicija,vieta,būsena,busena,lango elgsena,langų elgsena,langu elgsena,langas,langai,apėjimas,apejimas,apėjimai,apejimai,specifiniai,tam tikri,tam tikros,tam tikrų,tam tikru,įsiminti,isiminti,atsiminti,prisiminti,taisyklės,taisykles -X-KDE-Keywords[nb]=størrelse,plassering,vindusoppførsel,vindu,bestemt,løsninger,husk,regler -X-KDE-Keywords[nds]=Grött,Positschoon,Tostand,Finsterbedregen,Finstern,besünner,Ümto,wohren,Regeln -X-KDE-Keywords[nl]=grootte,positie,status,venstergedrag,vensters,specifiek,er omheen gewerkt,herinneren,regels -X-KDE-Keywords[nn]=storleik,plassering,tilstand,vindaugsåtferd,vindauge,einskild,løysingar,unntak,hugs,reglar -X-KDE-Keywords[pl]=rozmiar,pozycja,stan,zachowanie okna,okna,specyficzne,obejścia,zapamiętaj,reguły -X-KDE-Keywords[pt]=tamanho,posição,estado,comportamento da janela,janelas,específico,alternativas,recordar,regras -X-KDE-Keywords[pt_BR]=tamanho,posição,estado,comportamento da janela,janelas,específico,alternativas,lembrar,regras -X-KDE-Keywords[ru]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,размер,позиция,состояние,поведение окон,окна,специальный,специальные возможности,запомнить,правила -X-KDE-Keywords[sk]=veľkosť,poloha,stav,správanie okien,okná,špecifický,workaroundy,pamätať,pravidlá -X-KDE-Keywords[sl]=velikost,položaj,stanje,obnašanje oken,okna,določeno,popravki,pomnjenje,pravila -X-KDE-Keywords[sr]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,величина,положај,стање,понашање прозора,прозор,заобилазак,запамти,правила -X-KDE-Keywords[sr@ijekavian]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,величина,положај,стање,понашање прозора,прозор,заобилазак,запамти,правила -X-KDE-Keywords[sr@ijekavianlatin]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,veličina,položaj,stanje,ponašanje prozora,prozor,zaobilazak,zapamti,pravila -X-KDE-Keywords[sr@latin]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,veličina,položaj,stanje,ponašanje prozora,prozor,zaobilazak,zapamti,pravila -X-KDE-Keywords[sv]=storlek,position,tillstånd,fönsterbeteende,fönster,specifik,kom ihåg,regler -X-KDE-Keywords[tr]=boyut,konum,durum,pencere davranışı,pencere,özel,etrafından dolanmalar,anımsa,kurallar -X-KDE-Keywords[uk]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,розмір,розташування,місце,стан,поведінка,вікно,вікна,поведінка вікон,окрема,специфічна,окремо,запам’ятати,пам’ять,правило,правила -X-KDE-Keywords[x-test]=xxsizexx,xxpositionxx,xxstatexx,xxwindow behaviorxx,xxwindowsxx,xxspecificxx,xxworkaroundsxx,xxrememberxx,xxrulesxx -X-KDE-Keywords[zh_CN]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,大小,位置,窗口行为,特定,记住,规则 -X-KDE-Keywords[zh_TW]=size,position,state,window behavior,windows,specific,workarounds,remember,rules diff --git a/kcmkwin/kwinrules/package/metadata.desktop b/kcmkwin/kwinrules/package/metadata.desktop index b5f3e0278..fb46eb605 100644 --- a/kcmkwin/kwinrules/package/metadata.desktop +++ b/kcmkwin/kwinrules/package/metadata.desktop @@ -1,19 +1,19 @@ [Desktop Entry] Icon=preferences-system-windows-actions Type=Service Keywords= X-KDE-ParentApp= X-KDE-System-Settings-Parent-Category=applicationstyle X-KDE-PluginInfo-Author=Ismael Asensio X-KDE-PluginInfo-Email=isma.af@gmail.com X-KDE-PluginInfo-License=GPL-2.0+ -X-KDE-PluginInfo-Name=kcm_kwinrules_qml +X-KDE-PluginInfo-Name=kcm_kwinrules X-KDE-PluginInfo-Version= X-KDE-PluginInfo-Website=https://www.kde.org/plasma-desktop X-KDE-ServiceTypes=Plasma/Generic X-Plasma-API=declarativeappletscript X-Plasma-MainScript=ui/RulesList.qml X-KDE-FormFactors=desktop,tablet -Name=Window Rules (QML) +Name=Window Rules Comment=Individual Window Behavior diff --git a/kcmkwin/kwinrules/rulesdialog.cpp b/kcmkwin/kwinrules/rulesdialog.cpp index 7c9a98b58..01f4a2623 100644 --- a/kcmkwin/kwinrules/rulesdialog.cpp +++ b/kcmkwin/kwinrules/rulesdialog.cpp @@ -1,86 +1,86 @@ /* * Copyright (c) 2004 Lubos Lunak * Copyright (c) 2020 Ismael Asensio * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "rulesdialog.h" #include #include #include #include #include #include namespace KWin { RulesDialog::RulesDialog(QWidget* parent, const char* name) : QDialog(parent) , m_rulesModel(new RulesModel(this)) { setObjectName(name); setModal(true); setWindowTitle(i18n("Edit Window-Specific Settings")); setWindowIcon(QIcon::fromTheme("preferences-system-windows-actions")); setLayout(new QVBoxLayout); // Init RuleEditor QML QuickView QQuickView *quickView = new QQuickView(); quickView->setSource(QUrl::fromLocalFile(QStandardPaths::locate( QStandardPaths::GenericDataLocation, - QStringLiteral("kpackage/kcms/kcm_kwinrules_qml/contents/ui/RulesEditor.qml")))); + QStringLiteral("kpackage/kcms/kcm_kwinrules/contents/ui/RulesEditor.qml")))); quickView->setResizeMode(QQuickView::SizeRootObjectToView); quickView->rootObject()->setProperty("rulesModel", QVariant::fromValue(m_rulesModel)); m_quickWidget = QWidget::createWindowContainer(quickView, this); m_quickWidget->setMinimumSize(QSize(680, 700)); layout()->addWidget(m_quickWidget); QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); connect(buttons, SIGNAL(accepted()), SLOT(accept())); connect(buttons, SIGNAL(rejected()), SLOT(reject())); layout()->addWidget(buttons); } // window is set only for Alt+F3/Window-specific settings, because the dialog // is then related to one specific window Rules* RulesDialog::edit(Rules* r, const QVariantMap& info, bool show_hints) { Q_UNUSED(show_hints); m_rules = r; m_rulesModel->importFromRules(m_rules); if (!info.isEmpty()) { m_rulesModel->prefillProperties(info); } exec(); return m_rules; } void RulesDialog::accept() { m_rules = m_rulesModel->exportToRules(); QDialog::accept(); } }