summaryrefslogtreecommitdiffstats
path: root/src/app/historyAction.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-03 01:26:04 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-03 01:26:04 +0000
commit3c7b870f367df150ea60eb9d6bb2fd41646545d7 (patch)
treeac8705b4703cebb5031f9443eafd3e429a17ac1a /src/app/historyAction.h
downloadfilelight-3c7b870f367df150ea60eb9d6bb2fd41646545d7.tar.gz
filelight-3c7b870f367df150ea60eb9d6bb2fd41646545d7.zip
Added abandoned Filelight application
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/filelight@1084392 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/app/historyAction.h')
-rw-r--r--src/app/historyAction.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/app/historyAction.h b/src/app/historyAction.h
new file mode 100644
index 0000000..773093c
--- /dev/null
+++ b/src/app/historyAction.h
@@ -0,0 +1,64 @@
+//Author: Max Howell <max.howell@methylblue.com>, (C) 2003-4
+//Copyright: See COPYING file that comes with this distribution
+
+#ifndef HISTORYACTION_H
+#define HISTORYACTION_H
+
+#include <kaction.h>
+#include <kurl.h>
+#include <qstringlist.h>
+
+class KConfig;
+
+
+/// defined in mainWindow.cpp
+void setActionMenuTextOnly( KAction *a, QString const &suffix );
+
+
+class HistoryAction : KAction
+{
+ HistoryAction( const QString &text, const char *icon, const KShortcut &cut, KActionCollection *ac, const char *name );
+
+ friend class HistoryCollection;
+
+public:
+ virtual void setEnabled( bool b = true ) { KAction::setEnabled( b ? !m_list.isEmpty() : false ); }
+
+ void clear() { m_list.clear(); KAction::setText( m_text ); }
+
+private:
+ void setText();
+
+ void push( const QString &path );
+ QString pop();
+
+ const QString m_text;
+ QStringList m_list;
+};
+
+
+class HistoryCollection : public QObject
+{
+Q_OBJECT
+
+public:
+ HistoryCollection( KActionCollection *ac, QObject *parent, const char *name );
+
+ void save( KConfig *config );
+ void restore( KConfig *config );
+
+public slots:
+ void push( const KURL& );
+ void stop() { m_receiver = 0; }
+
+signals:
+ void activated( const KURL& );
+
+private slots:
+ void pop();
+
+private:
+ HistoryAction *m_b, *m_f, *m_receiver;
+};
+
+#endif