#define MAINWINDOW_H\r
\r
#include <QFileInfo>\r
+#include <QModelIndex>\r
#include <QMainWindow>\r
-class FolderPanel;\r
-class FileTableView;\r
+class QNetworkReply;\r
+class OverWriteDialog;\r
+class QLabel;\r
+class FolderView;\r
+class SearchBox;\r
+class AnyView;\r
\r
namespace Ui {\r
class MainWindow;\r
}\r
\r
+///////////////////////////////////////////////////////////////////////////////\r
+/// \brief The MainWindow class\r
+///\r
class MainWindow : public QMainWindow\r
{\r
Q_OBJECT\r
explicit MainWindow(QWidget *parent = 0);\r
~MainWindow();\r
\r
- void setStatusText(const QString &str);\r
- FileTableView* otherSideView(const FileTableView *view) const;\r
+signals:\r
+ void showHiddenFiles(bool show);\r
+ void showSystemFiles(bool show);\r
\r
public slots:\r
- void onActionSetting();\r
- void onViewFromOther();\r
- void onViewToOther();\r
- void onViewSwap();\r
- void onCmdMove();\r
- void onCmdCopy();\r
- void onHelpAbout();\r
-\r
-private slots:\r
- void onAskOverWrite(bool *bOk, int *prevCopyMethod, int *copyMethod,\r
- QString *alias, const QString srcPath, const QString tgtPath);\r
+ void askOverWrite(QString *copyMethod, QString *alias,\r
+ const QString &srcPath, const QString &tgtPath);\r
+\r
+ void currentChange(const QFileInfo &info);\r
+ void dropAccept(const QFileInfoList &list, QDropEvent *event);\r
+ void focusChange(QWidget * old, QWidget * now);\r
+ void leftKeyPress();\r
+ void rightKeyPress();\r
+ void showFileInfo(const QString &str);\r
+\r
+ void about();\r
+ void checkUpdate(bool silent = false);\r
+ void checkUpdateFinished(QNetworkReply *reply, bool silent = false);\r
+ void checkUpdateFinishedSilent(QNetworkReply *reply);\r
+ void chooseFolder();\r
+ void copyFilenameToClipboard();\r
+ void copyFullpathTpClipboard();\r
+ void copyItems();\r
+ void createFile();\r
+ void createFolder();\r
+ void cursorDown();\r
+ void cursorUp();\r
+ void cursorDownOther();\r
+ void cursorUpOther();\r
+ void deleteItems();\r
+ void editBookmark();\r
+ void executeCommand();\r
+ void expandLeft();\r
+ void expandRight();\r
+ void historyBack();\r
+ void historyForward();\r
+ void markAll();\r
+ void markAllFiles();\r
+ void markAllOff();\r
+ void markInvert();\r
+ void markToggle();\r
+ void moveItems();\r
+ void open(const QModelIndex &index = QModelIndex());\r
+ void openEditor(const QString &path = QString());\r
+ void openTerminal();\r
+ void openArchiver();\r
+ void openBookmark();\r
+ void refresh();\r
+ void renameItems();\r
+ void searchNext();\r
+ void searchPrev();\r
+ void setCursorToBegin();\r
+ void setCursorToEnd();\r
+ void setCursorToBeginOther();\r
+ void setCursorToEndOther();\r
+ void setFontSizeDown();\r
+ void setFontSizeUp();\r
+ void setPathFromOther();\r
+ void setPathToHome();\r
+ void setPathToOther();\r
+ void setPathToParent();\r
+ void setPathToRoot();\r
+ void shellExecute();\r
+ void showBookmarkDialog();\r
+ void showFilterDialog();\r
+ void showHistoryDialog();\r
+ void showPreferenceDialog();\r
+ void showSortDialog();\r
+ void splitCenter();\r
+ void swapView();\r
+ void switchHalfMode(bool checked);\r
+ void toggleSearchBox(bool checked);\r
+ void toggleShowHiddenFiles(bool checked);\r
+ void toggleShowSystemFiles(bool checked);\r
+\r
+ void showContextMenu(QContextMenuEvent *event);\r
+\r
+ void viewFinish();\r
\r
private:\r
+ enum Mode {\r
+ ModeBasic = 0x01,\r
+ ModeSearch = 0x02,\r
+ ModeFullView = 0x04,\r
+ ModeHalfView = 0x08,\r
+ };\r
+ typedef QFlags<Mode> ModeFlags;\r
+\r
Ui::MainWindow *ui;\r
+ FolderView *m_activeView;\r
+ OverWriteDialog *m_overwriteDialog;\r
+ ModeFlags m_viewMode;\r
\r
- FolderPanel* activePanel();\r
- FolderPanel* inactivePanel();\r
-};\r
+ // action\r
+ void initActionConnections();\r
+ static void replaceVars(QString &str, const QFileInfo info);\r
+ bool startProcess(const QString &cmd, const QString &workDir, const QString &errMsg);\r
+ void updateActions();\r
+ void setEnabledAllActions(bool enable);\r
+ void showNameFilters(FolderView *view);\r
+ void copyItems(const QFileInfoList &list, const QString &tgtDir);\r
+ void moveItems(const QFileInfoList &list, const QString &tgtDir);\r
+ void changeFontSize(int diff);\r
+ void initBookmark();\r
+ void sendEventOther(QEvent *event);\r
+\r
+ // getter\r
+ FolderView* otherSideFolderView(const FolderView *view) const;\r
\r
+ // setter\r
+ void setViewMode(ModeFlags flags);\r
+\r
+ // QWidget interface\r
+protected:\r
+ void closeEvent(QCloseEvent *event);\r
+ void keyPressEvent(QKeyEvent *event);\r
+};\r
\r
#endif // MAINWINDOW_H\r