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
Unmaintained
Rekonq
Commits
b96d7a83
Commit
b96d7a83
authored
Jan 02, 2013
by
Andrea Diamantini
Browse files
Restore rekonq 1.x shortcuts
ALT + #number to change tabs CTRL + #number to load favorites BUG: 312341
parent
2d812b51
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/kspellplugin.cpp
View file @
b96d7a83
...
...
@@ -27,6 +27,7 @@
// Self Includes
#include "kspellplugin.h"
#include "kspellplugin.moc"
// KDE Includes
#include <KDebug>
...
...
src/tabwindow/tabwindow.cpp
View file @
b96d7a83
...
...
@@ -171,6 +171,31 @@ void TabWindow::init()
_addTabButton
->
setToolButtonStyle
(
Qt
::
ToolButtonIconOnly
);
connect
(
this
,
SIGNAL
(
currentChanged
(
int
)),
this
,
SLOT
(
currentChanged
(
int
)));
// ----------------------------------------------------------------------------------------------
// shortcuts for quickly switching to a tab
QSignalMapper
*
tabSignalMapper
=
new
QSignalMapper
(
this
);
for
(
int
i
=
0
;
i
<
9
;
i
++
)
{
a
=
new
KAction
(
i18n
(
"Switch to Tab %1"
,
i
+
1
),
this
);
a
->
setShortcut
(
KShortcut
(
QString
(
"Alt+%1"
).
arg
(
i
+
1
)));
actionCollection
()
->
addAction
(
QL1S
(
QString
(
"switch_tab_"
+
QString
::
number
(
i
+
1
)).
toAscii
()),
a
);
connect
(
a
,
SIGNAL
(
triggered
(
bool
)),
tabSignalMapper
,
SLOT
(
map
()));
tabSignalMapper
->
setMapping
(
a
,
i
);
}
connect
(
tabSignalMapper
,
SIGNAL
(
mapped
(
int
)),
this
,
SLOT
(
setCurrentIndex
(
int
)));
// shortcuts for loading favorite pages
QSignalMapper
*
favoritesSignalMapper
=
new
QSignalMapper
(
this
);
for
(
int
i
=
1
;
i
<=
9
;
++
i
)
{
a
=
new
KAction
(
i18n
(
"Switch to Favorite Page %1"
,
i
),
this
);
a
->
setShortcut
(
KShortcut
(
QString
(
"Ctrl+%1"
).
arg
(
i
)));
actionCollection
()
->
addAction
(
QL1S
(
QString
(
"switch_favorite_"
+
QString
::
number
(
i
)).
toAscii
()),
a
);
connect
(
a
,
SIGNAL
(
triggered
(
bool
)),
favoritesSignalMapper
,
SLOT
(
map
()));
favoritesSignalMapper
->
setMapping
(
a
,
i
);
}
connect
(
favoritesSignalMapper
,
SIGNAL
(
mapped
(
int
)),
this
,
SLOT
(
loadFavorite
(
int
)));
}
...
...
@@ -672,3 +697,15 @@ bool TabWindow::isPrivateBrowsingWindowMode()
{
return
_isPrivateBrowsing
;
}
void
TabWindow
::
loadFavorite
(
const
int
index
)
{
QStringList
urls
=
ReKonfig
::
previewUrls
();
if
(
index
<
0
||
index
>
urls
.
length
())
return
;
KUrl
url
=
KUrl
(
urls
.
at
(
index
-
1
));
loadUrl
(
url
);
currentWebWindow
()
->
setFocus
();
}
src/tabwindow/tabwindow.h
View file @
b96d7a83
...
...
@@ -114,6 +114,8 @@ private Q_SLOTS:
void
setFullScreen
(
bool
);
void
loadFavorite
(
const
int
);
private:
// the new tab button
QToolButton
*
_addTabButton
;
...
...
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