Skip to content
Snippets Groups Projects
Commit 04b47b4a authored by Fabian Homborg's avatar Fabian Homborg
Browse files

Enable configuration through UI.

This needs a couple of workarounds:

- Qt won't convert a QStringList to an Array, instead giving an utterly
  useless QVariant(QStringList) (without any methods and presumably only
  containing the pointer)

- The config group _needs_ to be empty, else it's not accessible from
  the javascript side
parent 822c46a0
No related branches found
No related tags found
No related merge requests found
* TODO Make rules for tiling
** HACK Ignore yakuake and menus/dialogs for tiling
Waiting for KDE 4.11 which allows configuration for kwin scripts
** DONE HACK Ignore yakuake and menus/dialogs for tiling
** DONE Add useractionsmenu
* DONE Resize tiles
Hacked for Spirallayout, working for Halflayout
......@@ -22,6 +21,8 @@
** This was the result of removing an element from an array and afterwards accessing it by index
* DONE Retile on minimize
* TODO Avoid struts
Never noticed because I set the panel to autohide
* TODO Testing
** Weird apps (mplayer, gimp)
** Weird configurations
......
......@@ -40,3 +40,17 @@ success2 = false;
testSignal.disconnect(testSlot2);
testSignal.emit(1, 2, "test");
print("Signal test 2: " + (success1 && !success2 ? "SUCCESS" : "FAILURE"));
var isConfig = function(name, defaultValue) {
print("Reading", name);
c = readConfig(name, defaultValue);
print("Read", name);
if (c == null) {
print("Configuration option", name, "not defined");
} else {
print("Configuration option", name, ": ", c);
}
}
print("Testing configuration");
isConfig("floaters", "");
......@@ -125,6 +125,7 @@ TileList.prototype.addClient = function(client) {
this.tiles[tileIndex].clients.push(client);
}
} else {
print("Adding client",client.resourceClass.toString(), "to a new tile");
// If not, create a new tile
this._addTile(client);
}
......@@ -252,10 +253,16 @@ TileList.prototype._identifyNewTiles = function() {
* all, e.g. the panel.
*/
TileList._isIgnored = function(client) {
// NOTE: Application workarounds should be put here
// TODO: Hook this up to the rules
var floaters = Array("yakuake", "krunner", "Plasma", "Plasma-desktop", "plasma-desktop", "Plugin-container", "plugin-container");
// Application workarounds should be put here
// Qt gives us a method-less QVariant(QStringList) if we ask for an array
// Ask for a string instead (which can and should still be a StringList for the UI)
var fl = "yakuake,krunner,Plasma,Plasma-desktop,plasma-desktop,Plugin-container,plugin-container,Wine";
// TODO: This could break if an entry contains whitespace or a comma - it needs to be validated on the qt side
var floaters = String(readConfig("floaters", fl)).replace(/ /g,"").split(",");
print("Floaters: ",floaters);
print(client.resourceClass.toString());
if (floaters.indexOf(client.resourceClass.toString()) > -1) {
print("Client floating");
client.syncTabGroupFor("kwin_tiling_floats", true);
return true;
}
......
......@@ -5,8 +5,9 @@
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name=""/>
<group name="">
<entry name="FadeToBlack" type="Bool">
<default>false</default>
<entry name="floaters" type="StringList">
<label>The windows (by class) that should float</label>
<default>yakuake,Plasma,Plasma-desktop,krunner,plugin-container</default>
</entry>
</group>
</kcfg>
......@@ -11,13 +11,6 @@
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="kcfg_FadeToBlack">
<property name="text">
<string>Fade to black (fullscreen splash screens only)</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
......@@ -31,8 +24,22 @@
</property>
</spacer>
</item>
<item>
<widget class="KEditListBox" name="kcfg_floaters">
<property name="buttons">
<set>KEditListBox::Add|KEditListBox::Remove</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KEditListBox</class>
<extends>QGroupBox</extends>
<header>keditlistbox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
......@@ -8,9 +8,9 @@ X-KWin-Exclude-Listing=false
X-KDE-PluginInfo-Author=Fabian Homborg
X-KDE-PluginInfo-Email=FHomborg@gmail.com
X-KDE-PluginInfo-Name=tiling
X-KDE-PluginKeyword=tiling
X-KDE-ParentComponents=tiling
X-KDE-PluginInfo-Name=kwin-script-tiling
X-KDE-PluginKeyword=kwin-script-tiling
X-KDE-ParentComponents=kwin-script-tiling
X-KDE-PluginInfo-Version=0.2
X-KDE-PluginInfo-Depends=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment