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 MainWindow::~MainWindow()
29 void MainWindow::locationLineEnterKeyHandler()
31 ui->fileListWidget->changePath(ui->locationLine->text());
33 void MainWindow::keyPressEvent(QKeyEvent *e)
35 if(e->key() == Qt::Key_Control || e->key() == Qt::Key_Shift)
36 ui->fileListWidget->setSelectMode(true);
38 QMainWindow::keyPressEvent(e);
40 void MainWindow::keyReleaseEvent(QKeyEvent *e)
42 if(e->key() == Qt::Key_Control || e->key() == Qt::Key_Shift)
43 ui->fileListWidget->setSelectMode(false);
45 QMainWindow::keyPressEvent(e);
48 void MainWindow::changeEvent(QEvent *e)
50 QMainWindow::changeEvent(e);
52 case QEvent::LanguageChange:
53 ui->retranslateUi(this);