|
|
|
@ -36,12 +36,16 @@ Window::Window(QWidget *parent) :
@@ -36,12 +36,16 @@ Window::Window(QWidget *parent) :
|
|
|
|
|
|
|
|
|
|
QObject::connect(mTabWidget, &QTabWidget::currentChanged, |
|
|
|
|
this, &Window::switchActiveTab); |
|
|
|
|
mTabWidget->setCurrentIndex(0); |
|
|
|
|
switchActiveTab(0); |
|
|
|
|
|
|
|
|
|
this->setLayout(body); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Window::switchActivePane(hex::Pane* newPane) { |
|
|
|
|
//TODO: Replace this garbage. It's broken.
|
|
|
|
|
|
|
|
|
|
mPathBar->setText(newPane->getPath()); |
|
|
|
|
QObject::connect(mButton, &QPushButton::clicked, |
|
|
|
|
newPane, &hex::Pane::moveUp); |
|
|
|
@ -49,9 +53,15 @@ void Window::switchActivePane(hex::Pane* newPane) {
@@ -49,9 +53,15 @@ void Window::switchActivePane(hex::Pane* newPane) {
|
|
|
|
|
// newPane, &hex::Pane::setPath);
|
|
|
|
|
QObject::connect(newPane, &hex::Pane::pathChanged, |
|
|
|
|
mPathBar, &QLineEdit::setText); |
|
|
|
|
QObject::connect(newPane, &hex::Pane::folderChanged, |
|
|
|
|
this, &Window::changeFolder); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Window::switchActiveTab(int newTab) { |
|
|
|
|
std::cout << newTab; |
|
|
|
|
switchActivePane(dynamic_cast<hex::Pane*>(mTabWidget->widget(newTab))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Window::changeFolder(const QString& newFolder) { |
|
|
|
|
mTabWidget->setTabText(mTabWidget->currentIndex(), newFolder); |
|
|
|
|
} |
|
|
|
|