lxqt / qterminal

A lightweight Qt-based terminal emulator
https://lxqt.github.io
GNU General Public License v2.0
586 stars 150 forks source link

New tab from Preset Option 1 Terminal opens "Start with preset" #1104

Open AlphaWHH opened 4 months ago

AlphaWHH commented 4 months ago
Expected Behavior

Start with preset is set to any option in the config, the 'New Tab From Preset':1Terminal should open a single terminal.

Current Behavior

In any configuration the 'New Tab From Preset':1Terminal will open the selected option in the config under start with preset.

Steps to Reproduce (for bugs)
  1. Set 4 terminals preset in menu
  2. new tab from preset and select 1 Terminal
  3. The preset option is used instead of the 1 terminal
Possible Solution

Current code Mainwindow.cpp line 363-364 presetsMenu->addAction(QIcon(), tr("1 &Terminal"), this, SLOT(addNewTab()));

PROBLEM AREA: Line 879 void MainWindow::addNewTab(TerminalConfig cfg) { if (Properties::Instance()->terminalsPreset == 3) consoleTabulator->preset4Terminals(); else if (Properties::Instance()->terminalsPreset == 2) consoleTabulator->preset2Vertical(); else if (Properties::Instance()->terminalsPreset == 1) consoleTabulator->preset2Horizontal(); else consoleTabulator->addNewTab(cfg); // disabled actions are updated by TabWidget::onCurrentChanged() } PROPOSED SOLUTION: Mainwindow.cpp line 363-364 presetsMenu->addAction(QIcon(), tr("1 &Terminal"), this, SLOT(consoleTabulator->addNewTab(cfg);));