Skip to content

Commit 524e5e3

Browse files
committed
fakevim option add load default command list action
1 parent ed09e23 commit 524e5e3

File tree

3 files changed

+83
-50
lines changed

3 files changed

+83
-50
lines changed

liteidex/src/plugins/fakevimedit/fakevimeditoption.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ FakeVimEditOption::FakeVimEditOption(LiteApi::IApplication *app,QObject *parent)
4343
ui->setupUi(m_widget);
4444
QStringList cmds = m_liteApp->settings()->value(FAKEVIMEDIT_INITCOMMANDS,initCommandList()).toStringList();
4545
ui->textInitCommands->setPlainText(cmds.join("\n"));
46+
connect(ui->resetCommandsButton,SIGNAL(clicked(bool)),this,SLOT(on_resetCommandsButton_clicked()));
4647
}
4748

4849
FakeVimEditOption::~FakeVimEditOption()
@@ -72,3 +73,8 @@ void FakeVimEditOption::apply()
7273
QStringList cmds = ui->textInitCommands->toPlainText().split("\n",QString::SkipEmptyParts);
7374
m_liteApp->settings()->setValue(FAKEVIMEDIT_INITCOMMANDS,cmds);
7475
}
76+
77+
void FakeVimEditOption::on_resetCommandsButton_clicked()
78+
{
79+
ui->textInitCommands->setPlainText(initCommandList().join("\n"));
80+
}
Lines changed: 53 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,53 @@
1-
/**************************************************************************
2-
** This file is part of LiteIDE
3-
**
4-
** Copyright (c) 2011-2016 LiteIDE Team. All rights reserved.
5-
**
6-
** This library is free software; you can redistribute it and/or
7-
** modify it under the terms of the GNU Lesser General Public
8-
** License as published by the Free Software Foundation; either
9-
** version 2.1 of the License, or (at your option) any later version.
10-
**
11-
** This library is distributed in the hope that it will be useful,
12-
** but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14-
** Lesser General Public License for more details.
15-
**
16-
** In addition, as a special exception, that plugins developed for LiteIDE,
17-
** are allowed to remain closed sourced and can be distributed under any license .
18-
** These rights are included in the file LGPL_EXCEPTION.txt in this package.
19-
**
20-
**************************************************************************/
21-
// Module: fakevimeditoption.h
22-
// Creator: jsuppe <jon.suppe@gmail.com>
23-
24-
#ifndef FAKEVIMEDITOPTION_H
25-
#define FAKEVIMEDITOPTION_H
26-
27-
#include "liteapi/liteapi.h"
28-
29-
namespace Ui {
30-
class FakeVimEditOption;
31-
}
32-
33-
class FakeVimEditOption : public LiteApi::IOption
34-
{
35-
Q_OBJECT
36-
37-
public:
38-
explicit FakeVimEditOption(LiteApi::IApplication *app, QObject *parent = 0);
39-
~FakeVimEditOption();
40-
virtual QWidget *widget();
41-
virtual QString name() const;
42-
virtual QString mimeType() const;
43-
virtual void apply();
44-
private:
45-
LiteApi::IApplication *m_liteApp;
46-
QWidget *m_widget;
47-
Ui::FakeVimEditOption *ui;
48-
};
49-
50-
#endif // FAKEVIMEDITOPTION_H
1+
/**************************************************************************
2+
** This file is part of LiteIDE
3+
**
4+
** Copyright (c) 2011-2016 LiteIDE Team. All rights reserved.
5+
**
6+
** This library is free software; you can redistribute it and/or
7+
** modify it under the terms of the GNU Lesser General Public
8+
** License as published by the Free Software Foundation; either
9+
** version 2.1 of the License, or (at your option) any later version.
10+
**
11+
** This library is distributed in the hope that it will be useful,
12+
** but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
** Lesser General Public License for more details.
15+
**
16+
** In addition, as a special exception, that plugins developed for LiteIDE,
17+
** are allowed to remain closed sourced and can be distributed under any license .
18+
** These rights are included in the file LGPL_EXCEPTION.txt in this package.
19+
**
20+
**************************************************************************/
21+
// Module: fakevimeditoption.h
22+
// Creator: jsuppe <jon.suppe@gmail.com>
23+
24+
#ifndef FAKEVIMEDITOPTION_H
25+
#define FAKEVIMEDITOPTION_H
26+
27+
#include "liteapi/liteapi.h"
28+
29+
namespace Ui {
30+
class FakeVimEditOption;
31+
}
32+
33+
class FakeVimEditOption : public LiteApi::IOption
34+
{
35+
Q_OBJECT
36+
37+
public:
38+
explicit FakeVimEditOption(LiteApi::IApplication *app, QObject *parent = 0);
39+
~FakeVimEditOption();
40+
virtual QWidget *widget();
41+
virtual QString name() const;
42+
virtual QString mimeType() const;
43+
virtual void apply();
44+
private slots:
45+
void on_resetCommandsButton_clicked();
46+
47+
private:
48+
LiteApi::IApplication *m_liteApp;
49+
QWidget *m_widget;
50+
Ui::FakeVimEditOption *ui;
51+
};
52+
53+
#endif // FAKEVIMEDITOPTION_H

liteidex/src/plugins/fakevimedit/fakevimeditoption.ui

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,30 @@
2020
<string>FakeVim initialization command list (# start is comment):</string>
2121
</property>
2222
<layout class="QVBoxLayout" name="verticalLayout">
23+
<item>
24+
<layout class="QHBoxLayout" name="horizontalLayout">
25+
<item>
26+
<widget class="QPushButton" name="resetCommandsButton">
27+
<property name="text">
28+
<string>Load default init command list</string>
29+
</property>
30+
</widget>
31+
</item>
32+
<item>
33+
<spacer name="horizontalSpacer">
34+
<property name="orientation">
35+
<enum>Qt::Horizontal</enum>
36+
</property>
37+
<property name="sizeHint" stdset="0">
38+
<size>
39+
<width>40</width>
40+
<height>20</height>
41+
</size>
42+
</property>
43+
</spacer>
44+
</item>
45+
</layout>
46+
</item>
2347
<item>
2448
<widget class="QPlainTextEdit" name="textInitCommands"/>
2549
</item>

0 commit comments

Comments
 (0)