review of toolbar and menu bar
This commit is contained in:
+75
-8
@@ -24,7 +24,13 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
indexPath++;
|
||||
currentPath = new Path();
|
||||
Path* p = new Path();
|
||||
currentPath = p;
|
||||
path.append(p);
|
||||
loadPath(p);
|
||||
int pathCount = path.length();
|
||||
ui->pathNumber->setMaximum(pathCount);
|
||||
ui->pathNumber->setSuffix("/" + QString::number(pathCount));
|
||||
|
||||
|
||||
connect(ui->titleEdit, &QLineEdit::editingFinished, this, [this]() {
|
||||
@@ -505,8 +511,7 @@ void MainWindow::on_actionopenFile_triggered()
|
||||
this->loadNewPath();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionEditCopy_triggered()
|
||||
{
|
||||
void MainWindow::copyText(){
|
||||
QWidget *focused = QApplication::focusWidget();
|
||||
QLineEdit* lineEdit = qobject_cast<QLineEdit*>(focused);
|
||||
|
||||
@@ -515,9 +520,12 @@ void MainWindow::on_actionEditCopy_triggered()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionEditPaste_triggered()
|
||||
void MainWindow::on_actionEditCopy_triggered()
|
||||
{
|
||||
this->copyText();
|
||||
}
|
||||
|
||||
void MainWindow::pastText(){
|
||||
QWidget *focused = QApplication::focusWidget();
|
||||
QLineEdit* lineEdit = qobject_cast<QLineEdit*>(focused);
|
||||
|
||||
@@ -528,10 +536,13 @@ void MainWindow::on_actionEditPaste_triggered()
|
||||
lineEdit->setText(text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionEditCut_triggered()
|
||||
void MainWindow::on_actionEditPaste_triggered()
|
||||
{
|
||||
this->pastText();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::cutText(){
|
||||
QWidget *focused = QApplication::focusWidget();
|
||||
QLineEdit* lineEdit = qobject_cast<QLineEdit*>(focused);
|
||||
|
||||
@@ -544,6 +555,10 @@ void MainWindow::on_actionEditCut_triggered()
|
||||
lineEdit->setText(text);
|
||||
}
|
||||
}
|
||||
void MainWindow::on_actionEditCut_triggered()
|
||||
{
|
||||
this->cutText();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_pathNumber_valueChanged(int arg1)
|
||||
@@ -648,3 +663,55 @@ void MainWindow::on_exportHTMLBtn_clicked()
|
||||
w.siteHtml();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionSaveFile_triggered()
|
||||
{
|
||||
this->saveFile();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionSaveAsFile_triggered()
|
||||
{
|
||||
this->saveAsFile();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionCopy_triggered()
|
||||
{
|
||||
this->copyText();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionPast_triggered()
|
||||
{
|
||||
this->pastText();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionCut_triggered()
|
||||
{
|
||||
this->cutText();
|
||||
}
|
||||
|
||||
void MainWindow::newPath(){
|
||||
Path* p = new Path();
|
||||
currentPath = p;
|
||||
path.append(p);
|
||||
loadPath(p);
|
||||
|
||||
int pathCount = path.length();
|
||||
ui->pathNumber->setMaximum(pathCount);
|
||||
ui->pathNumber->setSuffix("/" + QString::number(pathCount));
|
||||
ui->pathNumber->setValue(path.indexOf(currentPath)+1);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionNew_triggered()
|
||||
{
|
||||
this->newPath();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionNewFile_triggered()
|
||||
{
|
||||
this->newPath();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user