2017-10-02 16:18:40 +00:00
|
|
|
#include "Sidebar.h"
|
|
|
|
#include "ui_Sidebar.h"
|
2017-03-29 10:18:37 +00:00
|
|
|
|
2017-10-01 19:09:42 +00:00
|
|
|
#include "MainWindow.h"
|
2017-04-13 15:14:02 +00:00
|
|
|
|
2017-03-29 10:18:37 +00:00
|
|
|
#include <QSettings>
|
|
|
|
|
|
|
|
|
2017-04-01 02:09:03 +00:00
|
|
|
SideBar::SideBar(MainWindow *main) :
|
|
|
|
QWidget(main),
|
|
|
|
ui(new Ui::SideBar),
|
|
|
|
// Radare core found in:
|
|
|
|
main(main)
|
2017-03-29 10:18:37 +00:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
2017-04-03 00:18:09 +00:00
|
|
|
QSettings settings;
|
2017-04-09 19:55:06 +00:00
|
|
|
if (settings.value("responsive").toBool())
|
|
|
|
{
|
2017-03-29 10:18:37 +00:00
|
|
|
ui->respButton->setChecked(true);
|
2017-04-09 19:55:06 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-03-29 10:18:37 +00:00
|
|
|
ui->respButton->setChecked(false);
|
|
|
|
}
|
2017-04-09 19:55:06 +00:00
|
|
|
if (settings.value("dark").toBool())
|
|
|
|
{
|
2017-04-05 14:29:01 +00:00
|
|
|
ui->themesButton->setChecked(true);
|
2017-04-09 19:55:06 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-04-05 14:29:01 +00:00
|
|
|
ui->themesButton->setChecked(false);
|
|
|
|
}
|
2017-03-29 10:18:37 +00:00
|
|
|
}
|
|
|
|
|
2017-10-02 09:41:28 +00:00
|
|
|
SideBar::~SideBar() {}
|
2017-03-29 10:18:37 +00:00
|
|
|
|
|
|
|
void SideBar::on_tabsButton_clicked()
|
|
|
|
{
|
|
|
|
this->main->on_actionTabs_triggered();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SideBar::on_lockButton_clicked()
|
|
|
|
{
|
2017-04-09 19:55:06 +00:00
|
|
|
if (ui->lockButton->isChecked())
|
|
|
|
{
|
2017-06-15 09:53:10 +00:00
|
|
|
ui->lockButton->setIcon(QIcon(":/img/icons/unlock_white.svg"));
|
2017-03-29 10:18:37 +00:00
|
|
|
this->main->lockUnlock_Docks(1);
|
2017-04-09 19:55:06 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-06-15 09:53:10 +00:00
|
|
|
ui->lockButton->setIcon(QIcon(":/img/icons/lock_white.svg"));
|
2017-03-29 10:18:37 +00:00
|
|
|
this->main->lockUnlock_Docks(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-09 19:55:06 +00:00
|
|
|
void SideBar::themesButtonToggle()
|
|
|
|
{
|
2017-03-29 10:18:37 +00:00
|
|
|
ui->themesButton->click();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SideBar::on_themesButton_clicked()
|
|
|
|
{
|
2017-04-09 19:55:06 +00:00
|
|
|
if (ui->themesButton->isChecked())
|
|
|
|
{
|
2017-03-29 10:18:37 +00:00
|
|
|
// Dark theme
|
2017-11-20 11:23:37 +00:00
|
|
|
this->main->setDarkTheme();
|
2017-04-09 19:55:06 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-03-29 10:18:37 +00:00
|
|
|
// Clear theme
|
2017-11-20 11:23:37 +00:00
|
|
|
this->main->setDefaultTheme();
|
2017-03-29 10:18:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SideBar::on_calcInput_textChanged(const QString &arg1)
|
|
|
|
{
|
2017-10-09 18:08:35 +00:00
|
|
|
ui->calcOutput->setText(QString::number(CutterCore::getInstance()->math(arg1)));
|
2017-03-29 10:18:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SideBar::on_asm2hex_clicked()
|
|
|
|
{
|
2017-10-09 18:08:35 +00:00
|
|
|
ui->hexInput->setPlainText(CutterCore::getInstance()->assemble(ui->asmInput->toPlainText()));
|
2017-03-29 10:18:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SideBar::on_hex2asm_clicked()
|
|
|
|
{
|
2017-10-09 18:08:35 +00:00
|
|
|
ui->asmInput->setPlainText(CutterCore::getInstance()->disassemble(ui->hexInput->toPlainText()));
|
2017-03-29 10:18:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SideBar::on_respButton_toggled(bool checked)
|
|
|
|
{
|
|
|
|
this->main->toggleResponsive(checked);
|
|
|
|
}
|
2017-05-26 08:52:17 +00:00
|
|
|
|
|
|
|
void SideBar::on_refreshButton_clicked()
|
|
|
|
{
|
2017-11-19 12:56:10 +00:00
|
|
|
this->main->refreshAll();
|
2017-05-26 08:52:17 +00:00
|
|
|
}
|