Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
AlphaWHH opened this issue Feb 20, 2024 · 1 comment · Fixed by #1176
Closed

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

AlphaWHH opened this issue Feb 20, 2024 · 1 comment · Fixed by #1176
Labels

Comments

@AlphaWHH
Copy link

AlphaWHH commented Feb 20, 2024

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);));

@tsujan tsujan added the bug label Oct 30, 2024
@tsujan
Copy link
Member

tsujan commented Oct 30, 2024

Thanks for reporting this! It was hidden among less important reports. We lack enough manpower, and I should attend to other projects first.

tsujan added a commit that referenced this issue Oct 30, 2024
This patch fixes two bugs when the terminal is started with a preset of N > 1 terminals:

 * Previously, the action "New tab from preset" didn't work correctly when the number of preset was less than N.
 * Also, if the terminal context menu was the first menu that was opened, the action "Collapse Subterminal" would be disabled.

I also silenced a compilation warning about `&QCheckBox::stateChanged`.

Fixes #1104
tsujan added a commit that referenced this issue Oct 30, 2024
This patch fixes two bugs when the terminal is started with a preset of N > 1 terminals:

 * Previously, the action "New tab from preset" didn't work correctly when the number of preset was less than N.
 * Also, if the terminal context menu was the first menu that was opened, the action "Collapse Subterminal" would be disabled.

I also silenced a compilation warning about `&QCheckBox::stateChanged`.

Fixes #1104
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants