1 #include "mainwindow.h"
2 #include "ui_mainwindow.h"
4 MainWindow::MainWindow(QWidget *parent) :
9 connect(ui->actionExit, SIGNAL(triggered()), this, SLOT(close()));
10 connect(ui->upButton, SIGNAL(clicked()), ui->fileListWidget, SLOT(changePathUp()));
11 connect(ui->locationLine, SIGNAL(returnPressed()), this, SLOT(locationLineEnterKeyHandler()));
12 connect(ui->fileListWidget, SIGNAL(pathChanged(QString)), ui->locationLine, SLOT(setText(QString)));
13 connect(ui->actionDelete, SIGNAL(triggered()), ui->fileListWidget, SLOT(actionDelete()));
14 connect(ui->actionMode, SIGNAL(toggled(bool)), ui->fileListWidget, SLOT(actionSwitchMode(bool)));
15 connect(ui->actionCopy, SIGNAL(triggered()), ui->fileListWidget, SLOT(actionCopy()));
16 connect(ui->actionCut, SIGNAL(triggered()), ui->fileListWidget, SLOT(actionCut()));
17 connect(ui->actionPaste, SIGNAL(triggered()), ui->fileListWidget, SLOT(actionPaste()));
18 connect(ui->actionShow_hidden, SIGNAL(toggled(bool)), ui->fileListWidget, SLOT(actionShowHidden(bool)));
19 connect(ui->actionRename, SIGNAL(triggered()), ui->fileListWidget, SLOT(actionRename()));
20 connect(ui->actionSend, SIGNAL(triggered()), ui->fileListWidget, SLOT(actionSendFiles()));
21 ui->locationLine->setText(ui->fileListWidget->getPath());
24 ui->fileListWidget->addAction(ui->actionCopy);
25 ui->fileListWidget->addAction(ui->actionCut);
26 ui->fileListWidget->addAction(ui->actionPaste);
27 ui->fileListWidget->addAction(ui->actionDelete);
28 ui->fileListWidget->addAction(ui->actionRename);
29 ui->fileListWidget->addAction(ui->actionSend);
32 MainWindow::~MainWindow()
37 void MainWindow::locationLineEnterKeyHandler()
39 ui->fileListWidget->changePath(ui->locationLine->text());
41 void MainWindow::keyPressEvent(QKeyEvent *e)
43 if(e->key() == Qt::Key_Control || e->key() == Qt::Key_Shift)
44 ui->fileListWidget->setSelectMode(true);
46 QMainWindow::keyPressEvent(e);
48 void MainWindow::keyReleaseEvent(QKeyEvent *e)
50 if(e->key() == Qt::Key_Control || e->key() == Qt::Key_Shift)
51 ui->fileListWidget->setSelectMode(false);
53 QMainWindow::keyPressEvent(e);
56 void MainWindow::changeEvent(QEvent *e)
58 QMainWindow::changeEvent(e);
60 case QEvent::LanguageChange:
61 ui->retranslateUi(this);