Adding some work-in-progress files for shortcut handling which I don't have time...
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 10 Apr 2008 21:36:15 +0000 (21:36 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 10 Apr 2008 21:36:15 +0000 (21:36 +0000)
src/uisupport/action.cpp [new file with mode: 0644]
src/uisupport/action.h [new file with mode: 0644]
src/uisupport/actioncollection.cpp [new file with mode: 0644]
src/uisupport/actioncollection.h [new file with mode: 0644]

diff --git a/src/uisupport/action.cpp b/src/uisupport/action.cpp
new file mode 100644 (file)
index 0000000..c98c321
--- /dev/null
@@ -0,0 +1,19 @@
+/***************************************************************************
+ *   Copyright (C) 2005-08 by the Quassel Project                          *
+ *   devel@quassel-irc.org                                                 *
+ *                                                                         *
+ *   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.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
diff --git a/src/uisupport/action.h b/src/uisupport/action.h
new file mode 100644 (file)
index 0000000..a26d55c
--- /dev/null
@@ -0,0 +1,50 @@
+/***************************************************************************
+ *   Copyright (C) 2005-08 by the Quassel Project                          *
+ *   devel@quassel-irc.org                                                 *
+ *                                                                         *
+ *   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.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef ACTION_H_
+#define ACTION_H_
+
+#include <QWidgetAction>
+
+class Action : public QWidgetAction {
+  Q_OBJECT
+
+  Q_PROPERTY(QShortcut shortcut READ shortcut WRITE setShortcut);
+  Q_PROPERTY(bool shortcutConfigurable READ isShortcutConfigurable WRITE setShortcutConfigurable);
+  Q_FLAGS(ShortcutType);
+
+  public:
+    enum ShortcutType {
+      ActiveShortcut = 0x01,
+      DefaultShortcut = 0x02
+    };
+    Q_DECLARE_FLAGS(ShortcutTypes, ShortcutType);
+
+    explicit Action(QObject *parent);
+    Action(const QString &text, QObject *parent);
+    Action(const QIcon &icon, const QString &text, QObject *parent);
+
+    QShortcut shortcut(ShortcutTypes types = ActiveShortcut) const;
+    void setShortcut(const QShortcut &shortcut, ShortcutTypes type = ActiveShortcut);
+    void setShortcut(const QKeySequence &shortcut, ShortcutTypes type = ActiveShortcut);
+
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(ShortcutTypes);
\ No newline at end of file
diff --git a/src/uisupport/actioncollection.cpp b/src/uisupport/actioncollection.cpp
new file mode 100644 (file)
index 0000000..c98c321
--- /dev/null
@@ -0,0 +1,19 @@
+/***************************************************************************
+ *   Copyright (C) 2005-08 by the Quassel Project                          *
+ *   devel@quassel-irc.org                                                 *
+ *                                                                         *
+ *   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.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
diff --git a/src/uisupport/actioncollection.h b/src/uisupport/actioncollection.h
new file mode 100644 (file)
index 0000000..d73b973
--- /dev/null
@@ -0,0 +1,20 @@
+/***************************************************************************
+ *   Copyright (C) 2005-08 by the Quassel Project                          *
+ *   devel@quassel-irc.org                                                 *
+ *                                                                         *
+ *   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.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+