Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Utilities
Konsole
Commits
b9c664bf
Commit
b9c664bf
authored
Oct 17, 2014
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert to QDialog
parent
4d536dcb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
21 deletions
+63
-21
src/ColorSchemeEditor.cpp
src/ColorSchemeEditor.cpp
+21
-7
src/ColorSchemeEditor.h
src/ColorSchemeEditor.h
+2
-2
src/HistorySizeDialog.cpp
src/HistorySizeDialog.cpp
+18
-4
src/HistorySizeDialog.h
src/HistorySizeDialog.h
+2
-2
src/RenameTabDialog.cpp
src/RenameTabDialog.cpp
+18
-4
src/RenameTabDialog.h
src/RenameTabDialog.h
+2
-2
No files found.
src/ColorSchemeEditor.cpp
View file @
b9c664bf
...
...
@@ -34,6 +34,10 @@
#include <KFileDialog>
#include <KUrlCompletion>
#include <KLocalizedString>
#include <KConfigGroup>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
// Konsole
#include "ui_ColorSchemeEditor.h"
...
...
@@ -51,18 +55,28 @@ const int COLOR_COLUMN = 1; // column 1 : actual colors
const
int
INTENSE_COLOR_COLUMN
=
2
;
// column 2 : intense colors
ColorSchemeEditor
::
ColorSchemeEditor
(
QWidget
*
aParent
)
:
K
Dialog
(
aParent
)
:
Q
Dialog
(
aParent
)
,
_isNewScheme
(
false
)
,
_colors
(
0
)
{
// Kdialog buttons
setButtons
(
KDialog
::
Ok
|
KDialog
::
Cancel
|
KDialog
::
Apply
);
connect
(
this
,
&
Konsole
::
ColorSchemeEditor
::
applyClicked
,
this
,
&
Konsole
::
ColorSchemeEditor
::
saveColorScheme
);
connect
(
this
,
&
Konsole
::
ColorSchemeEditor
::
okClicked
,
this
,
&
Konsole
::
ColorSchemeEditor
::
saveColorScheme
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
|
QDialogButtonBox
::
Apply
);
QWidget
*
mainWidget
=
new
QWidget
(
this
);
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
;
setLayout
(
mainLayout
);
mainLayout
->
addWidget
(
mainWidget
);
QPushButton
*
okButton
=
buttonBox
->
button
(
QDialogButtonBox
::
Ok
);
okButton
->
setDefault
(
true
);
okButton
->
setShortcut
(
Qt
::
CTRL
|
Qt
::
Key_Return
);
connect
(
buttonBox
,
SIGNAL
(
accepted
()),
this
,
SLOT
(
accept
()));
connect
(
buttonBox
,
SIGNAL
(
rejected
()),
this
,
SLOT
(
reject
()));
mainLayout
->
addWidget
(
buttonBox
);
connect
(
buttonBox
->
button
(
QDialogButtonBox
::
Apply
),
&
QPushButton
::
clicked
,
this
,
&
Konsole
::
ColorSchemeEditor
::
saveColorScheme
);
connect
(
okButton
,
&
QPushButton
::
clicked
,
this
,
&
Konsole
::
ColorSchemeEditor
::
saveColorScheme
);
// ui
_ui
=
new
Ui
::
ColorSchemeEditor
();
_ui
->
setupUi
(
mainWidget
()
);
_ui
->
setupUi
(
mainWidget
);
// description edit
_ui
->
descriptionEdit
->
setClearButtonEnabled
(
true
);
...
...
@@ -211,10 +225,10 @@ void ColorSchemeEditor::setup(const ColorScheme* scheme, bool isNewScheme)
_colors
=
new
ColorScheme
(
*
scheme
);
if
(
_isNewScheme
)
{
set
Caption
(
i18n
(
"New Color Scheme"
));
set
WindowTitle
(
i18n
(
"New Color Scheme"
));
setDescription
(
i18n
(
"New Color Scheme"
));
}
else
{
set
Caption
(
i18n
(
"Edit Color Scheme"
));
set
WindowTitle
(
i18n
(
"Edit Color Scheme"
));
}
// setup description edit
...
...
src/ColorSchemeEditor.h
View file @
b9c664bf
...
...
@@ -24,7 +24,7 @@
#include <QWidget>
// KDE
#include <
K
Dialog>
#include <
Q
Dialog>
// Konsole
#include "Profile.h"
...
...
@@ -52,7 +52,7 @@ class ColorScheme;
*
* When changes are made the colorsChanged() signal is emitted.
*/
class
KONSOLEPRIVATE_EXPORT
ColorSchemeEditor
:
public
K
Dialog
class
KONSOLEPRIVATE_EXPORT
ColorSchemeEditor
:
public
Q
Dialog
{
Q_OBJECT
...
...
src/HistorySizeDialog.cpp
View file @
b9c664bf
...
...
@@ -25,19 +25,33 @@
#include "ui_HistorySizeDialog.h"
#include <KLocalizedString>
#include <KConfigGroup>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
using
namespace
Konsole
;
HistorySizeDialog
::
HistorySizeDialog
(
QWidget
*
parent
)
:
K
Dialog
(
parent
)
:
Q
Dialog
(
parent
)
{
setCaption
(
i18nc
(
"@title:window"
,
"Adjust Scrollback"
));
setButtons
(
KDialog
::
Ok
|
KDialog
::
Cancel
);
setWindowTitle
(
i18nc
(
"@title:window"
,
"Adjust Scrollback"
));
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
);
QWidget
*
mainWidget
=
new
QWidget
(
this
);
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
;
setLayout
(
mainLayout
);
mainLayout
->
addWidget
(
mainWidget
);
QPushButton
*
okButton
=
buttonBox
->
button
(
QDialogButtonBox
::
Ok
);
okButton
->
setDefault
(
true
);
okButton
->
setShortcut
(
Qt
::
CTRL
|
Qt
::
Key_Return
);
connect
(
buttonBox
,
SIGNAL
(
accepted
()),
this
,
SLOT
(
accept
()));
connect
(
buttonBox
,
SIGNAL
(
rejected
()),
this
,
SLOT
(
reject
()));
mainLayout
->
addWidget
(
buttonBox
);
setWindowModality
(
Qt
::
WindowModal
);
_ui
=
new
Ui
::
HistorySizeDialog
();
_ui
->
setupUi
(
mainWidget
()
);
_ui
->
setupUi
(
mainWidget
);
_ui
->
tempWarningWidget
->
setVisible
(
true
);
_ui
->
tempWarningWidget
->
setWordWrap
(
true
);
...
...
src/HistorySizeDialog.h
View file @
b9c664bf
...
...
@@ -22,7 +22,7 @@
#define HISTORYSIZEDIALOG_H
// KDE
#include <
K
Dialog>
#include <
Q
Dialog>
// Konsole
#include "Enumeration.h"
...
...
@@ -34,7 +34,7 @@ class HistorySizeDialog;
namespace
Konsole
{
class
HistorySizeDialog
:
public
K
Dialog
class
HistorySizeDialog
:
public
Q
Dialog
{
Q_OBJECT
...
...
src/RenameTabDialog.cpp
View file @
b9c664bf
...
...
@@ -24,19 +24,33 @@
#include "ui_RenameTabDialog.h"
#include <KLocalizedString>
#include <KConfigGroup>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
using
Konsole
::
RenameTabDialog
;
RenameTabDialog
::
RenameTabDialog
(
QWidget
*
parent
)
:
K
Dialog
(
parent
)
:
Q
Dialog
(
parent
)
{
setCaption
(
i18n
(
"Rename Tab"
));
setButtons
(
KDialog
::
Ok
|
KDialog
::
Cancel
);
setWindowTitle
(
i18n
(
"Rename Tab"
));
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
);
QWidget
*
mainWidget
=
new
QWidget
(
this
);
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
;
setLayout
(
mainLayout
);
mainLayout
->
addWidget
(
mainWidget
);
QPushButton
*
okButton
=
buttonBox
->
button
(
QDialogButtonBox
::
Ok
);
okButton
->
setDefault
(
true
);
okButton
->
setShortcut
(
Qt
::
CTRL
|
Qt
::
Key_Return
);
connect
(
buttonBox
,
SIGNAL
(
accepted
()),
this
,
SLOT
(
accept
()));
connect
(
buttonBox
,
SIGNAL
(
rejected
()),
this
,
SLOT
(
reject
()));
mainLayout
->
addWidget
(
buttonBox
);
setWindowModality
(
Qt
::
WindowModal
);
_ui
=
new
Ui
::
RenameTabDialog
();
_ui
->
setupUi
(
mainWidget
()
);
_ui
->
setupUi
(
mainWidget
);
}
RenameTabDialog
::~
RenameTabDialog
()
...
...
src/RenameTabDialog.h
View file @
b9c664bf
...
...
@@ -21,7 +21,7 @@
#define RENAMETABDIALOG_H
// KDE
#include <
K
Dialog>
#include <
Q
Dialog>
namespace
Ui
{
...
...
@@ -30,7 +30,7 @@ class RenameTabDialog;
namespace
Konsole
{
class
RenameTabDialog
:
public
K
Dialog
class
RenameTabDialog
:
public
Q
Dialog
{
Q_OBJECT
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment