diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 18:42:24 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 18:42:24 +0000 |
commit | f508189682b6fba62e08feeb1596f682bad5fff9 (patch) | |
tree | 28aeb0e6c19386c385c1ce5edf8a92c1bca15281 /src/libgui/toplevel.h | |
download | piklab-f508189682b6fba62e08feeb1596f682bad5fff9.tar.gz piklab-f508189682b6fba62e08feeb1596f682bad5fff9.zip |
Added KDE3 version of PikLab
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1095639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/libgui/toplevel.h')
-rw-r--r-- | src/libgui/toplevel.h | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/src/libgui/toplevel.h b/src/libgui/toplevel.h new file mode 100644 index 0000000..11a4316 --- /dev/null +++ b/src/libgui/toplevel.h @@ -0,0 +1,132 @@ +/*************************************************************************** + * Copyright (C) 2005-2007 Nicolas Hadacek <hadacek@kde.org> * + * Copyright (C) 2003-2004 Alain Gibaud <alain.gibaud@free.fr> * + * * + * 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. * + ***************************************************************************/ +#ifndef TOPLEVEL_H +#define TOPLEVEL_H + +#include <qlabel.h> +#include <qprogressbar.h> +#include <kdockwidget.h> + +#include "config_center.h" +#include "tools/list/compile_process.h" +#include "toplevel_ui.h" +namespace Programmer { class Group; } +namespace Tool { class Group; } +class ConfigGenerator; +class HexEditor; +namespace Process { class Base; } + +class MainWindow : public KDockMainWindow +{ +Q_OBJECT +public: + MainWindow(); + virtual ~MainWindow(); + void setDevice(const QString &device); + +public slots: + void newSourceFile(); + void newProject(); + void openProject(); + void buildProject(); + void cleanBuild(); + void configure(ConfigCenter::Type showType = ConfigCenter::General); + void configureProject(); + void showDeviceInfo(); + void runPikloops(); + void runKfind(); + void configGenerator(); + void templateGenerator(); + void updateGUI(); + +private slots: + void newHexFile(); + bool openFile(); + void openRecentFile(const KURL &url); + + void compileFile(); + void compileSuccess(); + void compileFailure(); + void updateFile(const Compile::FileData &data); + void stopBuild(); + + void erase(); + void blankCheck(); + void program(); + void verify(); + void read(); + void showProgress(bool show); + void setTotalProgress(uint nbSteps); + void setProgress(uint nbSteps); + + void applyToolbarSettings(); + void configureToolbar(); + void configureToolchains(); + void configureProgrammer() { configure(ConfigCenter::ProgSelect); } + void showProgrammerSettings() { configure(ConfigCenter::ProgOptions); } + void showDebuggerSettings() { configure(ConfigCenter::DebugOptions); } + void selectProgrammer(const Programmer::Group &group); + void selectTool(const Tool::Group &group); + + void updateToolViewsActions(); + void resetDockLayout(); + void toggleToolView(QWidget *widget); + + void pikloopsDone(); + void kfindDone(); + + void openRecentProject(const KURL &url); + void closeProject(); + + void initialLoading(); + +signals: + void stateChanged(); + +private: + Log::Widget *_programLog; + QLabel *_actionStatus, *_debugStatus, *_editorStatus; + ProgrammerStatusWidget *_programmerStatus; + ToolStatusWidget *_toolStatus; + QProgressBar *_actionProgress; + ConfigGenerator *_configGenerator; + ::Process::Base *_pikloopsProcess, *_kfindProcess; + bool _forceProgramAfterBuild; + + class DockPosition { + public: + DockPosition() {} + DockPosition(const QString &pparent) : parent(pparent), pos(KDockWidget::DockCenter), space(0) {} + DockPosition(KDockWidget::DockPosition ppos, uint pspace) : parent("main_dock_widget"), pos(ppos), space(pspace) {} + QString parent; + KDockWidget::DockPosition pos; + uint space; + }; + class DockData { + public: + ViewMenuAction *action; + KDockWidget *dock; + QString title; + DockPosition position; + }; + QValueList<DockData> _docks; + KDockWidget *_mainDock; + + HexEditor *getHexEditor(); + virtual bool queryClose(); + bool stopOperations(); + void cleanBuild(bool singleFile); + virtual void keyPressEvent(QKeyEvent *e); + void readDockConfig(); + KDockWidget *createDock(const QString &name, const QPixmap &icon, const QString &title, const DockPosition &position); + void initDockPosition(const DockData &ddata); +}; + +#endif |