From dc874cdc2f9fe027f40d2cd17f240fe28ad3d865 Mon Sep 17 00:00:00 2001 From: Malte Starostik Date: Sun, 13 May 2001 05:19:20 +0000 Subject: [PATCH] Use the standard kwin button order configuration instead of an own one svn path=/trunk/kdebase/kwin/; revision=96753 --- clients/web/Web.cpp | 64 ++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 38 deletions(-) diff --git a/clients/web/Web.cpp b/clients/web/Web.cpp index dcbbf3435f..8bcb5092bb 100644 --- a/clients/web/Web.cpp +++ b/clients/web/Web.cpp @@ -368,51 +368,39 @@ Web::_createButtons() leftButtonList_ .clear(); rightButtonList_ .clear(); - QValueList buttonSetupLeft, buttonSetupRight; - - KConfig c("kwinwebrc"); - - QStringList buttonList; - - if (c.hasGroup("Buttons")) + QString buttons = options->titleButtonsLeft() + "|" + options->titleButtonsRight(); + QList *buttonList = &leftButtonList_; + for (unsigned int i = 0; i < buttons.length(); ++i) { - c.setGroup("Buttons"); + WebButton * tb = 0; + switch (buttons[i].latin1()) + { + case 'S': // Sticky + tb = _createButton("Sticky", this); + break; - buttonList = c.readListEntry("Layout"); - } - else - { - buttonList << "Iconify" << "Sticky"; + case 'H': // Help + tb = _createButton("Help", this); + break; - if (providesContextHelp()) - buttonList << "Help"; + case 'I': // Minimize + tb = _createButton("Iconify", this); + break; - buttonList << "Title"; + case 'A': // Maximize + tb = _createButton("Maximize", this); + break; - buttonList << "Maximize" << "Close"; - } - - QStringList::ConstIterator it(buttonList.begin()); - - for (; it != buttonList.end(); ++it) - { - QString s(*it); - - if ("Title" == s) - break; // Move to right-side buttons. - - WebButton * tb = _createButton(*it, this); + case 'X': // Close + tb = _createButton("Close", this); + break; + case '|': + buttonList = &rightButtonList_; + break; + } if (0 != tb) - leftButtonList_.append(tb); - } - - for (; it != buttonList.end(); ++it) - { - WebButton * tb = _createButton(*it, this); - - if (0 != tb) - rightButtonList_.append(tb); + buttonList->append(tb); } if (!leftButtonList_.isEmpty())