1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Added Restore All Closed Tabs option to ClosedTabsManager

This commit is contained in:
nowrep 2011-05-16 21:36:39 +02:00
parent bac1f5d78d
commit 8ab4dc75df
8 changed files with 88 additions and 52 deletions

Binary file not shown.

View File

@ -701,8 +701,11 @@ void QupZilla::aboutToShowHistoryMenu()
menuClosedTabs->addAction(_iconForUrl(tab.url), title, m_tabWidget, SLOT(restoreClosedTab()))->setData(i);
i++;
}
menuClosedTabs->addSeparator();
if (i == 0)
menuClosedTabs->addAction(tr("Empty"))->setEnabled(false);
else
menuClosedTabs->addAction(tr("Restore All Closed Tabs"), m_tabWidget, SLOT(restoreAllClosedTabs()));
m_menuHistory->addMenu(menuClosedTabs);
}

View File

@ -47,3 +47,8 @@ bool ClosedTabsManager::isClosedTabAvailable()
{
return (m_closedTabs.count() != 0);
}
void ClosedTabsManager::clearList()
{
m_closedTabs.clear();
}

View File

@ -26,6 +26,7 @@ public:
ClosedTabsManager::Tab getTabAt(int index);
bool isClosedTabAvailable();
void clearList();
QList<ClosedTabsManager::Tab> allClosedTabs() { return m_closedTabs; }

View File

@ -350,6 +350,22 @@ void TabWidget::restoreClosedTab()
weView(index)->load(tab.url);
}
void TabWidget::restoreAllClosedTabs()
{
if (!m_closedTabsManager->isClosedTabAvailable())
return;
QList<ClosedTabsManager::Tab> closedTabs = m_closedTabsManager->allClosedTabs();
foreach (ClosedTabsManager::Tab tab, closedTabs) {
int index = addView(QUrl(), tab.title);
QDataStream historyStream(tab.history);
historyStream >> *weView(index)->history();
weView(index)->load(tab.url);
}
m_closedTabsManager->clearList();
}
bool TabWidget::canRestoreTab()
{
return m_closedTabsManager->isClosedTabAvailable();

View File

@ -67,6 +67,7 @@ public slots:
void duplicateTab(int index);
void closeAllButCurrent(int index);
void restoreClosedTab();
void restoreAllClosedTabs();
private slots:
void aboutToShowTabsMenu();

View File

@ -2285,17 +2285,17 @@ nebyl nalezen!</translation>
<translation>Poslat odkaz...</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="759"/>
<location filename="../src/app/qupzilla.cpp" line="762"/>
<source>Other</source>
<translation>Ostatní</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="768"/>
<location filename="../src/app/qupzilla.cpp" line="771"/>
<source>Default</source>
<translation>Defaultní</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1122"/>
<location filename="../src/app/qupzilla.cpp" line="1125"/>
<source>Start Private Browsing</source>
<translation>Spustit anonymní prohlížení</translation>
</message>
@ -2333,7 +2333,7 @@ nebyl nalezen!</translation>
<message>
<location filename="../src/app/qupzilla.cpp" line="620"/>
<location filename="../src/app/qupzilla.cpp" line="640"/>
<location filename="../src/app/qupzilla.cpp" line="705"/>
<location filename="../src/app/qupzilla.cpp" line="706"/>
<source>Empty</source>
<translation>Prázdný</translation>
</message>
@ -2383,108 +2383,113 @@ nebyl nalezen!</translation>
<translation>Zavřené panely</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="713"/>
<location filename="../src/app/qupzilla.cpp" line="708"/>
<source>Restore All Closed Tabs</source>
<translation>Obnovit všechny zavřené panely</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="716"/>
<source>Report &amp;Bug</source>
<translation>Nahlásit &amp;bug</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="716"/>
<location filename="../src/app/qupzilla.cpp" line="719"/>
<source>About &amp;Qt</source>
<translation>O &amp;Qt</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="717"/>
<location filename="../src/app/qupzilla.cpp" line="720"/>
<source>&amp;About QupZilla</source>
<translation>&amp;O QupZille</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="723"/>
<location filename="../src/app/qupzilla.cpp" line="726"/>
<source>&amp;Web Search</source>
<translation>Hledání na &amp;webu</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="724"/>
<location filename="../src/app/qupzilla.cpp" line="727"/>
<source>Page &amp;Info</source>
<translation>Informace o &amp;stránce</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="726"/>
<location filename="../src/app/qupzilla.cpp" line="729"/>
<source>&amp;Download Manager</source>
<translation>Správce s&amp;tahování</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="727"/>
<location filename="../src/app/qupzilla.cpp" line="730"/>
<source>&amp;Cookies Manager</source>
<translation>Správce coo&amp;kies</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="728"/>
<location filename="../src/app/qupzilla.cpp" line="731"/>
<source>&amp;AdBlock</source>
<translation>&amp;AdBlock</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="729"/>
<location filename="../src/app/qupzilla.cpp" line="732"/>
<source>RSS &amp;Reader</source>
<translation>&amp;RSS čtečka</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="730"/>
<location filename="../src/app/qupzilla.cpp" line="733"/>
<source>Clear Recent &amp;History</source>
<translation>Vymazat nedá&amp;vnou historii</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="731"/>
<location filename="../src/app/qupzilla.cpp" line="734"/>
<source>&amp;Private Browsing</source>
<translation>Soukromé prohlíž&amp;ení</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="738"/>
<location filename="../src/app/qupzilla.cpp" line="741"/>
<source>Pr&amp;eferences</source>
<translation>Předvo&amp;lby</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1003"/>
<location filename="../src/app/qupzilla.cpp" line="1004"/>
<location filename="../src/app/qupzilla.cpp" line="1006"/>
<location filename="../src/app/qupzilla.cpp" line="1007"/>
<source>Web Inspector</source>
<translation>Web Inspektor</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1046"/>
<location filename="../src/app/qupzilla.cpp" line="1049"/>
<source>Open file...</source>
<translation>Otevřít soubor...</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1109"/>
<location filename="../src/app/qupzilla.cpp" line="1112"/>
<source>Are you sure you want to turn on private browsing?</source>
<translation>Jste si jistý že chcete zapnout soukromé prohlížení?</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1110"/>
<location filename="../src/app/qupzilla.cpp" line="1113"/>
<source>When private browsing is turned on, some actions concerning your privacy will be disabled:</source>
<translation>Se zapnutým soukromým prohlížením jsou některé akce týkající se soukromí vypnuty:</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1113"/>
<location filename="../src/app/qupzilla.cpp" line="1116"/>
<source>Webpages are not added to the history.</source>
<translation>Stránky nejsou přidávány do historie.</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1114"/>
<location filename="../src/app/qupzilla.cpp" line="1117"/>
<source>New cookies are not stored, but current cookies can be accessed.</source>
<translation>Nové cookies nejsou přijímány, ale současné cookies jsou zasílány.</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1115"/>
<location filename="../src/app/qupzilla.cpp" line="1118"/>
<source>Your session won&apos;t be stored.</source>
<translation>Vaše relace nebude uložena.</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1117"/>
<location filename="../src/app/qupzilla.cpp" line="1120"/>
<source>Until you close the window, you can still click the Back and Forward buttons to return to the webpages you have opened.</source>
<translation>Než zavřete prohlížeč, stále můžete použít tlačítka Zpět a Vpřed k vrácení se na stránky které jste otevřeli.</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1161"/>
<location filename="../src/app/qupzilla.cpp" line="1164"/>
<source>There are still %1 open tabs and your session won&apos;t be stored. Are you sure to quit?</source>
<translation>Ještě je otevřeno %1 panelů a Vaše relace nebude uložena. Opravdu chcete skončit?</translation>
</message>

View File

@ -2287,17 +2287,17 @@ p, li { white-space: pre-wrap; }
<translation>Poslať odkaz...</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="759"/>
<location filename="../src/app/qupzilla.cpp" line="762"/>
<source>Other</source>
<translation>Ostatné</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="768"/>
<location filename="../src/app/qupzilla.cpp" line="771"/>
<source>Default</source>
<translation>Základné</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1122"/>
<location filename="../src/app/qupzilla.cpp" line="1125"/>
<source>Start Private Browsing</source>
<translation>Spustiť anonymné prehliadanie</translation>
</message>
@ -2334,7 +2334,7 @@ p, li { white-space: pre-wrap; }
<message>
<location filename="../src/app/qupzilla.cpp" line="620"/>
<location filename="../src/app/qupzilla.cpp" line="640"/>
<location filename="../src/app/qupzilla.cpp" line="705"/>
<location filename="../src/app/qupzilla.cpp" line="706"/>
<source>Empty</source>
<translation>Prázdny</translation>
</message>
@ -2384,108 +2384,113 @@ p, li { white-space: pre-wrap; }
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="713"/>
<location filename="../src/app/qupzilla.cpp" line="708"/>
<source>Restore All Closed Tabs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="716"/>
<source>Report &amp;Bug</source>
<translation>Nahlásiť &amp;chybu</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="716"/>
<location filename="../src/app/qupzilla.cpp" line="719"/>
<source>About &amp;Qt</source>
<translation>O &amp;Qt</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="717"/>
<location filename="../src/app/qupzilla.cpp" line="720"/>
<source>&amp;About QupZilla</source>
<translation>&amp;O QupZille</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="723"/>
<location filename="../src/app/qupzilla.cpp" line="726"/>
<source>&amp;Web Search</source>
<translation>Hladať na &amp;webu</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="724"/>
<location filename="../src/app/qupzilla.cpp" line="727"/>
<source>Page &amp;Info</source>
<translation>&amp;Informácie o stránke</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="726"/>
<location filename="../src/app/qupzilla.cpp" line="729"/>
<source>&amp;Download Manager</source>
<translation>Správca &amp;sťahovania</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="727"/>
<location filename="../src/app/qupzilla.cpp" line="730"/>
<source>&amp;Cookies Manager</source>
<translation>Správca &amp;cookies</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="728"/>
<location filename="../src/app/qupzilla.cpp" line="731"/>
<source>&amp;AdBlock</source>
<translation>&amp;AdBlock</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="729"/>
<location filename="../src/app/qupzilla.cpp" line="732"/>
<source>RSS &amp;Reader</source>
<translation>&amp;RSS čítač</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="730"/>
<location filename="../src/app/qupzilla.cpp" line="733"/>
<source>Clear Recent &amp;History</source>
<translation>Vymazať nedávnu &amp;históriu</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="731"/>
<location filename="../src/app/qupzilla.cpp" line="734"/>
<source>&amp;Private Browsing</source>
<translation>Súkromné prehlia&amp;danie</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="738"/>
<location filename="../src/app/qupzilla.cpp" line="741"/>
<source>Pr&amp;eferences</source>
<translation>Pr&amp;edvoľby</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1003"/>
<location filename="../src/app/qupzilla.cpp" line="1004"/>
<location filename="../src/app/qupzilla.cpp" line="1006"/>
<location filename="../src/app/qupzilla.cpp" line="1007"/>
<source>Web Inspector</source>
<translation>Web inšpektor</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1046"/>
<location filename="../src/app/qupzilla.cpp" line="1049"/>
<source>Open file...</source>
<translation>Otvoriť súbor...</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1109"/>
<location filename="../src/app/qupzilla.cpp" line="1112"/>
<source>Are you sure you want to turn on private browsing?</source>
<translation>Ste si istý, že chcete zapnúť súkromné prehliadanie?</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1110"/>
<location filename="../src/app/qupzilla.cpp" line="1113"/>
<source>When private browsing is turned on, some actions concerning your privacy will be disabled:</source>
<translation>So zapnutým súkromným prehliadaním niektoré akcie týkajúce sa súkromia vypnuté:</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1113"/>
<location filename="../src/app/qupzilla.cpp" line="1116"/>
<source>Webpages are not added to the history.</source>
<translation>Stránky nie pridávané do histórie.</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1114"/>
<location filename="../src/app/qupzilla.cpp" line="1117"/>
<source>New cookies are not stored, but current cookies can be accessed.</source>
<translation>Nové cookies nie prijímané, ale súčasné cookies zasielané.</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1115"/>
<location filename="../src/app/qupzilla.cpp" line="1118"/>
<source>Your session won&apos;t be stored.</source>
<translation>Vaša relácia nebude uložená.</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1117"/>
<location filename="../src/app/qupzilla.cpp" line="1120"/>
<source>Until you close the window, you can still click the Back and Forward buttons to return to the webpages you have opened.</source>
<translation>Dokiaľ nezavriete prehliadač, tak stále môžete používať tlačidla Späť a Dopredu k vráteniu sa na stránky, ktoré ste mali otvorené.</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="1161"/>
<location filename="../src/app/qupzilla.cpp" line="1164"/>
<source>There are still %1 open tabs and your session won&apos;t be stored. Are you sure to quit?</source>
<translation>Stále otvorené %1 panely a Vaša relácia nebude uložená. Skutočne chcete skončiť?</translation>
</message>