[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdenonbeta/kdmthemes
From: Andy Goossens <andygoossens () pandora ! be>
Date: 2004-03-31 21:34:18
Message-ID: 20040331213418.E136699C5 () office ! kde ! org
[Download RAW message or body]
CVS commit by goossens:
* removing unused findPixmapFile method
* look up strings for <stock> items
M +40 -20 kdmthemer.cpp 1.57
M +7 -9 kdmthemer.h 1.21
--- kdenonbeta/kdmthemes/kdmthemer.cpp #1.56:1.57
@@ -66,23 +66,4 @@ bitBlt(px,QPoint(0,0),this,r);
}
-
-QString KdmThemer::findPixmapFile(const QDomNode &node)
-{
- QDomNodeList subnodeList=node.childNodes();
-
- for (uint nod=0;nod<subnodeList.count();nod++)
- {
- QDomElement el=subnodeList.item(nod).toElement();
- if (el.tagName()=="normal")
- {
- QString filename=el.attribute("file","");
- return filename;
- }
- }
- return (QString(""));
-
-}
-
-
int KdmThemer::findSpecifiedLength(const QDomNode &node,bool vertical)
{
@@ -501,5 +482,5 @@ QRect KdmThemer::generateItem(KdmWidget
else if (tagName == "stock")
{
- newItem->setText(el.attribute("type"));
+ newItem->setText(lookupStock(el.attribute("type")));
kdDebug()<<"\tElement has a \"stock\" tag\n";
}
@@ -693,3 +674,42 @@ void KdmThemer::paintEvent(QPaintEvent*
}
+QString KdmThemer::lookupStock (const QString &stock)
+{
+ //FIXME add key accels!
+
+ QString type( stock.lower() );
+
+ if (type == "language")
+ return i18n("Language");
+ else if (type == "session")
+ return i18n("Session");
+ else if (type == "system")
+ return i18n("Actions");
+ else if (type == "disconnect")
+ return i18n("Disconnect");
+ else if (type == "quit")
+ return i18n("Quit");
+ else if (type == "halt")
+ return i18n("Shut down");
+ else if (type == "suspend")
+ return i18n("Suspend");
+ else if (type == "reboot")
+ return i18n("Reboot");
+ else if (type == "chooser")
+ return i18n("XDMCP Chooser");
+ else if (type == "config")
+ return i18n("Configure");
+ else if (type == "caps-lock-warning")
+ return i18n("You've got capslock on!");
+ else if (type == "timed-label")
+ return i18n("User %s will login in %d seconds");
+ else if (type == "welcome-label")
+ return i18n("Welcome"); //TODO read config, local login != remote ("Welcome to foo")
+ else if (type == "username-label")
+ return i18n("Username:");
+
+ kdWarning() << "Invalid <stock> element. Check your theme!" << endl;
+ return QString::null;
+}
+
#include "kdmthemer.moc"
--- kdenonbeta/kdmthemes/kdmthemer.h #1.20:1.21
@@ -102,13 +102,4 @@ class KdmThemer: public QWidget
/*
- * Finds the "<normal" subnode in the given node, and retrieves
- * the filename of the pixmap
- */
-
- QString findPixmapFile(const QDomNode &node);
-
-
-
- /*
* Takes care of adding and positioning the new elements
*/
@@ -178,4 +169,11 @@ class KdmThemer: public QWidget
+ /*
+ * Method to lookup the caption associated with an item
+ */
+
+ QString lookupStock (const QString &stock);
+
+
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic