[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/games/kamala/src
From: Stanislas Marquis <roundphi () gmail ! com>
Date: 2009-04-20 19:14:03
Message-ID: 1240254843.863078.22149.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 956850 by smarquis:
Exposed settings to scripting interface.
M +20 -20 core/collections/settingscollection.h
M +4 -1 core/krossmod.h
M +8 -8 core/objects/settings.h
M +1 -1 core/preferences.h
M +3 -4 gui/systray.cpp
--- trunk/playground/games/kamala/src/core/collections/settingscollection.h #956849:956850
@@ -46,51 +46,51 @@
virtual ~SettingsCollection() {}
+ void clone(const SettingsCollection &other);
+
SettingsCollection &operator=(const SettingsCollection &other)
{ clone(other); return *this; }
QList<Settings*> settingsList() const;
+ int indexOf(Settings *set) const;
+
Settings *settings(int idx) const;
+ bool addSettings(Settings *set);
+
Settings *takeSettings(int idx);
- public Q_SLOTS:
+ bool removeSettings(int idx);
+ bool deleteSettings(int idx);
+
+ bool deleteSettings(Settings *set);
+
+ void clear();
+
+ void mrProper();
+
+ static SettingsCollection *dbCollection();
+
+ public Q_SLOTS: /* scripting interface */
+
int count() const;
- void clone(const SettingsCollection &other);
-
QStringList settingsNames() const;
- int indexOf(Settings *set) const;
-
Settings *settings(const QString &name) const;
Settings *takeSettings(const QString &name);
Settings *newSettings() const;
- bool addSettings(Settings *set);
-
bool removeSettings(const QString &name);
- bool removeSettings(int idx);
+ bool removeSettings(Settings *set); // hidden
- bool removeSettings(Settings *set);
-
bool deleteSettings(const QString &name);
- bool deleteSettings(int idx);
-
- bool deleteSettings(Settings *set);
-
- void clear();
-
- void mrProper();
-
- static SettingsCollection *dbCollection();
-
Q_SIGNALS:
void settingsAboutToBeAdded(SettingsCollection *coll, int row);
--- trunk/playground/games/kamala/src/core/krossmod.h #956849:956850
@@ -27,6 +27,7 @@
#include <QObject>
class QString;
#include "preferences.h"
+#include "collections/settingscollection.h"
#include "../kamala_export.h"
namespace Kamala
@@ -66,8 +67,10 @@
public Q_SLOTS: // there goes scripting interface
- Preferences *preferences() { return Preferences::self(); }
+ Preferences *preferences() const { return Preferences::self(); }
+ SettingsCollection *settingsCollection() const { return SettingsCollection::dbCollection(); }
+
};
} // namespace Kamala
--- trunk/playground/games/kamala/src/core/objects/settings.h #956849:956850
@@ -233,6 +233,8 @@
virtual ~Settings() {}
+ void clone(const Settings &other);
+
Settings &operator=(const Settings &other) { clone(other); return *this; }
int idx() const { return d->idx; }
@@ -327,24 +329,22 @@
void setComments(const QString &comm);
- public Q_SLOTS:
+ int select(int idx);
- void clone(const Settings &other);
+ /** @brief Return the swissepg flags corresponding to the settings
+ */
+ int swissephFlags() const;
+ public Q_SLOTS: /* scripting interface */
+
void setDefault();
int select(const QString &name);
- int select(int idx);
-
int save();
int erase();
- /** @brief Return the swissepg flags corresponding to the settings
- */
- int swissephFlags() const;
-
Q_SIGNALS:
void changed(Settings *set, Settings::Properties p);
--- trunk/playground/games/kamala/src/core/preferences.h #956849:956850
@@ -183,7 +183,7 @@
Preferences &operator=(const Preferences &other)
{ clone(other); return *this; }
- public Q_SLOTS:
+ public Q_SLOTS: /* scripting interface */
/** @brief Load user's preferences from database
** @return 1 if ok, -1 on error
--- trunk/playground/games/kamala/src/gui/systray.cpp #956849:956850
@@ -22,10 +22,10 @@
*/
#include "mainwindow.h"
-#include <QIcon>
#include <QMenu>
#include <KSystemTrayIcon>
-#include <KStandardDirs>
+#include <KIcon>
+//#include <KStandardDirs>
#include <KActionCollection>
#include <KStandardAction>
#include <KLocalizedString>
@@ -38,8 +38,7 @@
KActionCollection *actionCollection = this->actionCollection();
m_trayIcon = new KSystemTrayIcon(this);
- m_trayIcon->setIcon(
- QIcon(KStandardDirs::locate("data", "kamala/pics/kamala.png")));
+ m_trayIcon->setIcon(KIcon("kamala"));
m_trayIcon->setToolTip(i18nc("Tray icon tooltip", "Kamala"));
QMenu *menu = m_trayIcon->contextMenu();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic