Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
d2945886
Commit
d2945886
authored
Jan 08, 2021
by
Waqar Ahmed
Browse files
Move quick-open config to the quick-open dialog from Behaviour config
parent
536f0664
Changes
7
Hide whitespace changes
Inline
Side-by-side
kate/kateconfigdialog.cpp
View file @
d2945886
...
...
@@ -96,32 +96,12 @@ void KateConfigDialog::addBehaviorPage()
buttonGroup
->
setLayout
(
vbox
);
// quick search
buttonGroup
=
new
QGroupBox
(
i18n
(
"&Quick Open"
),
generalFrame
);
vbox
=
new
QVBoxLayout
;
buttonGroup
->
setLayout
(
vbox
);
// quick open list mode
auto
hlayout
=
new
QHBoxLayout
;
auto
label
=
new
QLabel
(
i18n
(
"&List Mode:"
),
buttonGroup
);
hlayout
->
addWidget
(
label
);
m_cmbQuickOpenListMode
=
new
QComboBox
(
buttonGroup
);
hlayout
->
addWidget
(
m_cmbQuickOpenListMode
);
label
->
setBuddy
(
m_cmbQuickOpenListMode
);
m_cmbQuickOpenListMode
->
addItem
(
i18n
(
"Current Project Files"
),
QVariant
(
KateQuickOpenModel
::
List
::
CurrentProject
));
m_cmbQuickOpenListMode
->
addItem
(
i18n
(
"All Projects Files"
),
QVariant
(
KateQuickOpenModel
::
List
::
AllProjects
));
m_cmbQuickOpenListMode
->
setCurrentIndex
(
m_cmbQuickOpenListMode
->
findData
(
m_mainWindow
->
quickOpenListMode
()));
m_mainWindow
->
setQuickOpenListMode
(
static_cast
<
KateQuickOpenModel
::
List
>
(
m_cmbQuickOpenListMode
->
currentData
().
toInt
()));
connect
(
m_cmbQuickOpenListMode
,
static_cast
<
void
(
QComboBox
::*
)(
int
)
>
(
&
QComboBox
::
currentIndexChanged
),
this
,
&
KateConfigDialog
::
slotChanged
);
vbox
->
addLayout
(
hlayout
);
layout
->
addWidget
(
buttonGroup
);
// tabbar => we allow to configure some limit on number of tabs to show
buttonGroup
=
new
QGroupBox
(
i18n
(
"&Tabs"
),
generalFrame
);
vbox
=
new
QVBoxLayout
;
buttonGroup
->
setLayout
(
vbox
);
hlayout
=
new
QHBoxLayout
;
label
=
new
QLabel
(
i18n
(
"&Limit number of tabs:"
),
buttonGroup
);
auto
hlayout
=
new
QHBoxLayout
;
auto
label
=
new
QLabel
(
i18n
(
"&Limit number of tabs:"
),
buttonGroup
);
hlayout
->
addWidget
(
label
);
m_tabLimit
=
new
QSpinBox
(
buttonGroup
);
hlayout
->
addWidget
(
m_tabLimit
);
...
...
@@ -348,9 +328,6 @@ void KateConfigDialog::slotApply()
cg
.
writeEntry
(
"Close After Last"
,
sessionConfigUi
.
modCloseAfterLast
->
isChecked
());
m_mainWindow
->
setModCloseAfterLast
(
sessionConfigUi
.
modCloseAfterLast
->
isChecked
());
cg
.
writeEntry
(
"Quick Open List Mode"
,
m_cmbQuickOpenListMode
->
currentData
().
toInt
());
m_mainWindow
->
setQuickOpenListMode
(
static_cast
<
KateQuickOpenModel
::
List
>
(
m_cmbQuickOpenListMode
->
currentData
().
toInt
()));
cg
.
writeEntry
(
"Tabbar Tab Limit"
,
m_tabLimit
->
value
());
cg
.
writeEntry
(
"Show Tabs Close Button"
,
m_showTabCloseButton
->
isChecked
());
...
...
kate/katemainwindow.cpp
View file @
d2945886
...
...
@@ -20,7 +20,6 @@
#include "katemwmodonhddialog.h"
#include "katepluginmanager.h"
#include "katequickopen.h"
#include "katequickopenmodel.h"
#include "katesavemodifieddialog.h"
#include "katesessionmanager.h"
#include "katesessionsaction.h"
...
...
@@ -605,9 +604,6 @@ void KateMainWindow::readOptions()
m_paShowMenuBar
->
setChecked
(
generalGroup
.
readEntry
(
"Show Menu Bar"
,
true
));
m_paShowTabBar
->
setChecked
(
generalGroup
.
readEntry
(
"Show Tab Bar"
,
true
));
int
listMode
=
generalGroup
.
readEntry
(
"Quick Open List Mode"
,
static_cast
<
int
>
(
KateQuickOpenModel
::
List
::
CurrentProject
));
m_quickOpen
->
setListMode
(
static_cast
<
KateQuickOpenModel
::
List
>
(
listMode
));
// emit signal to hide/show statusbars
toggleShowStatusBar
();
toggleShowTabBar
();
...
...
@@ -1244,16 +1240,6 @@ bool KateMainWindow::hideToolView(QWidget *widget)
return
KateMDI
::
MainWindow
::
hideToolView
(
qobject_cast
<
KateMDI
::
ToolView
*>
(
widget
));
}
void
KateMainWindow
::
setQuickOpenListMode
(
KateQuickOpenModel
::
List
mode
)
{
m_quickOpen
->
setListMode
(
mode
);
}
KateQuickOpenModel
::
List
KateMainWindow
::
quickOpenListMode
()
const
{
return
m_quickOpen
->
listMode
();
}
void
KateMainWindow
::
addRecentOpenedFile
(
const
QUrl
&
url
)
{
// skip non-existing urls for untitled documents
...
...
kate/katemainwindow.h
View file @
d2945886
...
...
@@ -296,9 +296,6 @@ public:
m_modCloseAfterLast
=
e
;
}
void
setQuickOpenListMode
(
KateQuickOpenModelList
mode
);
KateQuickOpenModelList
quickOpenListMode
()
const
;
/**
* add given url to list of recently opened files
* @param url url that got opened
...
...
kate/katequickopen.cpp
View file @
d2945886
...
...
@@ -238,6 +238,7 @@ KateQuickOpen::KateQuickOpen(KateMainWindow *mainWindow)
connect
(
m_inputLine
,
&
QuickOpenLineEdit
::
textChanged
,
this
,
[
this
](){
m_listView
->
viewport
()
->
update
();
});
connect
(
m_inputLine
,
&
QuickOpenLineEdit
::
returnPressed
,
this
,
&
KateQuickOpen
::
slotReturnPressed
);
connect
(
m_inputLine
,
&
QuickOpenLineEdit
::
filterModeChanged
,
this
,
&
KateQuickOpen
::
slotfilterModeChanged
);
connect
(
m_inputLine
,
&
QuickOpenLineEdit
::
listModeChanged
,
this
,
&
KateQuickOpen
::
slotListModeChanged
);
connect
(
m_model
,
&
QSortFilterProxyModel
::
rowsInserted
,
this
,
&
KateQuickOpen
::
reselectFirst
);
connect
(
m_model
,
&
QSortFilterProxyModel
::
rowsRemoved
,
this
,
&
KateQuickOpen
::
reselectFirst
);
...
...
@@ -338,16 +339,11 @@ void KateQuickOpen::slotfilterModeChanged(FilterModes mode)
m_model
->
invalidate
();
}
void
KateQuickOpen
::
s
e
tListMode
(
KateQuickOpenModel
::
List
mode
)
void
KateQuickOpen
::
s
lo
tListMode
Changed
(
KateQuickOpenModel
::
List
mode
)
{
m_base_model
->
setListMode
(
mode
);
}
KateQuickOpenModel
::
List
KateQuickOpen
::
listMode
()
const
{
return
m_base_model
->
listMode
();
}
void
KateQuickOpen
::
updateViewGeometry
()
{
const
QSize
centralSize
=
m_mainWindow
->
size
();
...
...
kate/katequickopen.h
View file @
d2945886
...
...
@@ -36,9 +36,6 @@ public:
void
update
();
void
updateViewGeometry
();
KateQuickOpenModelList
listMode
()
const
;
void
setListMode
(
KateQuickOpenModelList
mode
);
protected:
bool
eventFilter
(
QObject
*
obj
,
QEvent
*
event
)
override
;
...
...
@@ -53,6 +50,8 @@ private Q_SLOTS:
void
slotfilterModeChanged
(
FilterModes
mode
);
void
slotListModeChanged
(
KateQuickOpenModelList
mode
);
private:
KateMainWindow
*
m_mainWindow
;
QTreeView
*
m_listView
;
...
...
kate/katequickopenlineedit.cpp
View file @
d2945886
...
...
@@ -52,6 +52,29 @@ QuickOpenLineEdit::QuickOpenLineEdit(QWidget* parent)
});
act
->
setChecked
(
true
);
m_menu
->
addSeparator
();
QActionGroup
*
actGp
=
new
QActionGroup
(
this
);
actGp
->
setExclusionPolicy
(
QActionGroup
::
ExclusionPolicy
::
Exclusive
);
act
=
m_menu
->
addAction
(
QStringLiteral
(
"All Projects"
));
act
->
setCheckable
(
true
);
connect
(
act
,
&
QAction
::
toggled
,
this
,
[
this
](
bool
checked
){
if
(
checked
)
emit
listModeChanged
(
KateQuickOpenModelList
::
AllProjects
);
});
actGp
->
addAction
(
act
);
act
=
m_menu
->
addAction
(
QStringLiteral
(
"Current Project"
));
connect
(
act
,
&
QAction
::
toggled
,
this
,
[
this
](
bool
checked
){
if
(
checked
)
emit
listModeChanged
(
KateQuickOpenModelList
::
CurrentProject
);
});
act
->
setCheckable
(
true
);
actGp
->
addAction
(
act
);
connect
(
m_button
,
&
SwitchModeButton
::
clicked
,
this
,
&
QuickOpenLineEdit
::
openMenu
);
}
...
...
kate/katequickopenlineedit.h
View file @
d2945886
...
...
@@ -11,6 +11,8 @@
#include <QAbstractButton>
#include <QIcon>
#include "katequickopenmodel.h"
class
SwitchModeButton
:
public
QAbstractButton
{
...
...
@@ -63,6 +65,7 @@ private Q_SLOTS:
Q_SIGNALS:
void
filterModeChanged
(
FilterModes
mode
);
void
listModeChanged
(
KateQuickOpenModelList
mode
);
};
#endif // QUICKOPENLINEEDIT_H
Write
Preview
Supports
Markdown
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