summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-22 13:15:04 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-22 13:15:04 (GMT)
commit9c2d2d709404058ccaa3ea82b6714f720320c684 (patch)
treed404e84a723357a2fd5a27126f7a21bbb7990326
parent1fa1ba07a38c157841c53aa5ca2f71322037a9f5 (diff)
we include a tabbar soon per default, if people want the other variants, they might port them from master, no need to waste our time
-rw-r--r--addons/kate/CMakeLists.txt22
-rw-r--r--addons/kate/tabbarextension/CMakeLists.txt26
-rw-r--r--addons/kate/tabbarextension/Messages.sh3
-rw-r--r--addons/kate/tabbarextension/katetabbarextension.desktop105
-rw-r--r--addons/kate/tabbarextension/ktinytabbar.cpp1243
-rw-r--r--addons/kate/tabbarextension/ktinytabbar.h250
-rw-r--r--addons/kate/tabbarextension/ktinytabbarconfigdialog.cpp84
-rw-r--r--addons/kate/tabbarextension/ktinytabbarconfigdialog.h61
-rw-r--r--addons/kate/tabbarextension/ktinytabbarconfigpage.cpp424
-rw-r--r--addons/kate/tabbarextension/ktinytabbarconfigpage.h139
-rw-r--r--addons/kate/tabbarextension/ktinytabbutton.cpp397
-rw-r--r--addons/kate/tabbarextension/ktinytabbutton.h242
-rw-r--r--addons/kate/tabbarextension/plugin_katetabbarextension.cpp292
-rw-r--r--addons/kate/tabbarextension/plugin_katetabbarextension.h99
-rw-r--r--addons/kate/tabbarextension/tabbarconfigwidget.ui496
-rw-r--r--addons/kate/tabbarextension/ui.rc7
-rw-r--r--addons/kate/tabify/CMakeLists.txt13
-rw-r--r--addons/kate/tabify/Messages.sh3
-rw-r--r--addons/kate/tabify/katetabifyplugin.desktop112
-rw-r--r--addons/kate/tabify/tabify.cpp265
-rw-r--r--addons/kate/tabify/tabify.h87
-rw-r--r--addons/kate/tabify/ui.rc7
22 files changed, 6 insertions, 4371 deletions
diff --git a/addons/kate/CMakeLists.txt b/addons/kate/CMakeLists.txt
index 8e7c88c..885392e 100644
--- a/addons/kate/CMakeLists.txt
+++ b/addons/kate/CMakeLists.txt
@@ -28,14 +28,14 @@ ecm_optional_add_subdirectory (filebrowser)
# xml completion
ecm_optional_add_subdirectory (xmltools)
-ecm_optional_add_subdirectory( openheader )
+# open header matching to current file
+ecm_optional_add_subdirectory (openheader)
-ecm_optional_add_subdirectory( close-except-like )
+# close document except this one (or similar)
+ecm_optional_add_subdirectory (close-except-like)
-
-if(NOT WIN32)
- ecm_optional_add_subdirectory (gdbplugin) # should be tested on windows...
-endif(NOT WIN32)
+# debugger plugin, needs windows love
+ecm_optional_add_subdirectory (gdbplugin)
# build plugin
ecm_optional_add_subdirectory (katebuild-plugin)
@@ -44,22 +44,12 @@ ecm_optional_add_subdirectory (katebuild-plugin)
#add_subdirectory( mailfiles )
-#add_subdirectory( tabbarextension )
-
#add_subdirectory( symbolviewer )
#add_subdirectory( filetemplates )
#add_subdirectory( kttsd )
-
#add_subdirectory( xmlcheck )
-
-#add_subdirectory( tabify )
-
-
-
#macro_optional_add_subdirectory(pate)
-
-#
diff --git a/addons/kate/tabbarextension/CMakeLists.txt b/addons/kate/tabbarextension/CMakeLists.txt
deleted file mode 100644
index e91ef85..0000000
--- a/addons/kate/tabbarextension/CMakeLists.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-########### next target ###############
-
-set(katetabbarextensionplugin_PART_SRCS
- plugin_katetabbarextension.cpp
- ktinytabbutton.cpp
- ktinytabbar.cpp
- ktinytabbarconfigdialog.cpp
- ktinytabbarconfigpage.cpp )
-
-set(katetabbarextensionplugin_PART_UI
- tabbarconfigwidget.ui
-)
-
-kde4_add_ui_files(katetabbarextensionplugin_PART_SRCS ${katetabbarextensionplugin_PART_UI} )
-
-kde4_add_plugin(katetabbarextensionplugin ${katetabbarextensionplugin_PART_SRCS})
-
-target_link_libraries(katetabbarextensionplugin ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS} kateinterfaces )
-
-install(TARGETS katetabbarextensionplugin DESTINATION ${PLUGIN_INSTALL_DIR} )
-
-
-########### install files ###############
-
-install( FILES ui.rc DESTINATION ${DATA_INSTALL_DIR}/kate/plugins/katetabbarextension )
-install( FILES katetabbarextension.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
diff --git a/addons/kate/tabbarextension/Messages.sh b/addons/kate/tabbarextension/Messages.sh
deleted file mode 100644
index 2dde84f..0000000
--- a/addons/kate/tabbarextension/Messages.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-$EXTRACTRC *.rc *.ui >> rc.cpp
-$XGETTEXT *.cpp *.h -o $podir/katetabbarextension.pot
diff --git a/addons/kate/tabbarextension/katetabbarextension.desktop b/addons/kate/tabbarextension/katetabbarextension.desktop
deleted file mode 100644
index d5db982..0000000
--- a/addons/kate/tabbarextension/katetabbarextension.desktop
+++ /dev/null
@@ -1,105 +0,0 @@
-[Desktop Entry]
-Type=Service
-ServiceTypes=Kate/Plugin
-X-KDE-Library=katetabbarextensionplugin
-X-Kate-Version=2.8
-Name=Multiline Tab Bar
-Name[bg]=Лента с подпрозорци на няколко реда
-Name[bs]=Višelinijska traka kartica
-Name[ca]=Barra de pestanyes multilínia
-Name[ca@valencia]=Barra de pestanyes multilínia
-Name[cs]=Víceřádkový pruh s kartami
-Name[da]=Fanebladslinje med flere linjer
-Name[de]=Mehrzeilige Unterfensterleiste
-Name[el]=Καρτέλες πολλαπλών γραμμών
-Name[es]=Barra de pestañas multilínea
-Name[et]=Mitmerealine kaardiriba
-Name[eu]=Lerro anitzeko fitxa-barra
-Name[fi]=Monirivinen välilehtipalkki
-Name[fr]=Barre d'onglets multi-ligne
-Name[ga]=Barra Cluaisíní Il-Líne
-Name[gl]=Barra de lapelas multiliña
-Name[hu]=Többsoros lapozósáv
-Name[ia]=Barra de scheda multi-rango
-Name[it]=Barra di schede multilinea
-Name[kk]=Көпжолды қойынды
-Name[km]=របារ​ផ្ទាំង​​​ពហុ​បន្ទាត់
-Name[ko]=여러 줄 탭 표시줄
-Name[lt]=Kelių eilučių kortelių juosta
-Name[lv]=Vairāku rindu ciļņu josla
-Name[mr]=बहुलरेषा टॅब पट्टी
-Name[nb]=Fanelinje med flere rader
-Name[nds]=Mehrregen-Paneelbalken
-Name[nl]=Meerregelige tabbladbalk
-Name[pa]=ਬਹੁ-ਲਾਈਨ ਟੈਬ ਪੱਟੀ
-Name[pl]=Wieloliniowy pasek kart
-Name[pt]=Barra de Páginas Multi-Linha
-Name[pt_BR]=Barra de abas multilinha
-Name[ro]=Bară de file multilinie
-Name[ru]=Многострочная панель вкладок
-Name[si]=බහුපේලි තීරුව
-Name[sk]=Viacriadkový panel kariet
-Name[sl]=Vrstica z zavihki v več vrsticah
-Name[sr]=Вишередна трака језичака
-Name[sr@ijekavian]=Вишередна трака језичака
-Name[sr@ijekavianlatin]=Višeredna traka jezičaka
-Name[sr@latin]=Višeredna traka jezičaka
-Name[sv]=Flerraders flikrad
-Name[tg]=Панели бисёрсатра
-Name[tr]=Çoksatırlı Sekme Çubuğu
-Name[ug]=كۆپ قۇرلۇق بەتكۈچ بالداق
-Name[uk]=Багаторядкова панель вкладок
-Name[x-test]=xxMultiline Tab Barxx
-Name[zh_CN]=多行标签栏
-Name[zh_TW]=多行分頁列
-Comment=Adds a tab bar with multiple rows to Kate's main window
-Comment[bg]=Добавяне на лента с подпрозорци на няколко реда към основния прозорец на Kate
-Comment[bs]=Dodaje traku sa karticama u glavni prozor Kate
-Comment[ca]=Afegeix una barra de pestanyes amb diverses files a la finestra principal del Kate
-Comment[ca@valencia]=Afig una barra de pestanyes amb diverses files a la finestra principal del Kate
-Comment[cs]=Přidá do hlavního okna Kate pruh karet s více řádky
-Comment[da]=Føjer en fanebladslinje med flere rækker til Kates hovedvindue
-Comment[de]=Fügt dem Hauptfenster von Kate eine mehrzeilige Unterfensterleiste hinzu
-Comment[el]=Προσθέτει καρτέλες πολλαπλών γραμμών στο κύριο παράθυρο του Kate
-Comment[es]=Añade una barra de pestañas con varias filas a la ventana principal de Kate
-Comment[et]=Lisab Kate peaaknasse mitmerealise kaardiriba
-Comment[eu]=Hainbat errenkada dituen fitxa-barra gehitzen dio Kate-ren leiho nagusiari
-Comment[fi]=Lisää monirivisen välilehtipalkin Katen pääikkunaan
-Comment[fr]=Ajoute une barre d'onglets comportant plusieurs lignes à la fenêtre principale de Kate
-Comment[ga]=Cuir barra cluaisíní ina bhfuil níos mó ná ró amháin le príomhfhuinneog Kate
-Comment[gl]=Engade unha barra de lapelas en varias liñas á xanela principal de Kate
-Comment[hu]=Többsoros lapozósáv hozzáadása a Kate főablakához
-Comment[ia]=Adde un barra con multiple rangos a fenestra principal de Kate
-Comment[it]=Aggiunge una barra di schede su più righe alla finestra principale di Kate
-Comment[kk]=Kate-тің негізгі терезесіне көп бағанды қойындысын қосу
-Comment[km]=បន្ថែម​របារ​​ផ្ទាំង​ដែល​មាន​​ពហុ​បន្ទាត់​​​ទៅ​បង្អួច​មេ​របស់ Kate​
-Comment[ko]=Kate의 주 창에 여러 줄로 된 탭 표시줄 추가
-Comment[lt]=Įdeda kelių juostų kortelių juostą į Kate langą
-Comment[lv]=Pievieno ciļņu joslu ar vairākām rindām Kate galvenajam logam
-Comment[mr]=केटच्या मुख्य चौकटीत बहुलरेषेची टॅब पट्टी जोडतो
-Comment[nb]=Legger til en fanelinje med flere rader i Kates hovedvindu
-Comment[nds]=Föögt Kate sien Hööftfinster en Paneelbalken mit mehr Regen to
-Comment[nl]=Voegt een tabbladbalk met meerder regels toe aan Kate's hoofdvenster
-Comment[nn]=Legg ei fanelinje med fleire rader til hovudvindauget i Kate
-Comment[pa]=ਕੇਟ ਦੀ ਮੇਨ ਵਿੰਡੋ ਵਿੱਚ ਕਈ ਕਤਾਰਾਂ ਵਾਲੀ ਇੱਕ ਟੈਬ ਬਾਰ ਸ਼ਾਮਲ ਕਰੋ
-Comment[pl]=Dodaje pasek kart o wielu wierszach do głównego okna Kate
-Comment[pt]=Adiciona uma barra de páginas com várias linhas à janela principal do Kate
-Comment[pt_BR]=Adiciona uma barra de abas com várias linhas à janela principal do Kate
-Comment[ro]=Adaugă o bară de file cu mai multe rînduri la fereastra principală Kate
-Comment[ru]=Добавляет панель вкладок с несколькими строками в окно Kate
-Comment[si]=Kate හි ප්‍රධාන කවුළුවට පේළි කිහිපයක් සහිත ටැබ් තීරුවක් එක් කරයි
-Comment[sk]=Pridá panel kariet s viacerými riadkami na hlavné okno Kate
-Comment[sl]=Doda vrstico z zavihki v več vrsticah v glavno okno urejevalnika Kate
-Comment[sr]=Додаје траку језичака са више редова у главни прозор Кејт
-Comment[sr@ijekavian]=Додаје траку језичака са више редова у главни прозор Кејт
-Comment[sr@ijekavianlatin]=Dodaje traku jezičaka sa više redova u glavni prozor Kate
-Comment[sr@latin]=Dodaje traku jezičaka sa više redova u glavni prozor Kate
-Comment[sv]=Lägger till en flikrad med flera rader i Kates huvudfönster
-Comment[tg]=Панели бисёрқаторро ба тирезаи асосии барномаи Kate илова мекунад
-Comment[tr]=Kate uygulamasının ana penceresine çok satırlı bir sekme çubuğu ekler
-Comment[ug]=كۆپ قۇرلۇق بەتكۈچ بالداقتىن بىرنى Kate نىڭ ئاساسىي كۆزنىكىگە قوشىدۇ
-Comment[uk]=Додає панель вкладок з декількома рядками до головного вікна Kate
-Comment[x-test]=xxAdds a tab bar with multiple rows to Kate's main windowxx
-Comment[zh_CN]=在 Kate 主窗口上添加一个多行标签栏
-Comment[zh_TW]=在 Kate 主視窗中加入多行分頁列
-author=Dominik Haumann, dhdev@gmx.de
diff --git a/addons/kate/tabbarextension/ktinytabbar.cpp b/addons/kate/tabbarextension/ktinytabbar.cpp
deleted file mode 100644
index 0f8b2ca..0000000
--- a/addons/kate/tabbarextension/ktinytabbar.cpp
+++ /dev/null
@@ -1,1243 +0,0 @@
-/***************************************************************************
- ktinytabbar.cpp
- -------------------
- begin : 2005-06-15
- copyright : (C) 2005 by Dominik Haumann
- email : dhdev@gmx.de
-
- Copyright (C) 2007 Flavio Castelli <flavio.castelli@gmail.com>
- ***************************************************************************/
-
-/***************************************************************************
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- ***************************************************************************/
-
-#include "ktinytabbar.h"
-#include "ktinytabbar.moc"
-#include "ktinytabbutton.h"
-#include "ktinytabbarconfigpage.h"
-#include "ktinytabbarconfigdialog.h"
-
-#include <kconfig.h>
-#include <kiconloader.h>
-#include <kstringhandler.h>
-
-#include <QApplication> // QApplication::sendEvent
-#include <QtAlgorithms> // qSort
-
-KTinyTabBar::SortType global_sortType;
-
-// public operator < for two tab buttons
-bool tabLessThan( const KTinyTabButton* a, const KTinyTabButton* b )
-{
- switch( global_sortType )
- {
- case KTinyTabBar::OpeningOrder: {
- return a->buttonID() < b->buttonID();
- }
-
- case KTinyTabBar::Name: {
- // fall back to ID
- if( a->text().toLower() == b->text().toLower() )
- return a->buttonID() < b->buttonID();
-
- return KStringHandler::naturalCompare(a->text(), b->text(), Qt::CaseInsensitive) < 0;
- }
-
- case KTinyTabBar::URL: {
- // fall back, if infos not available
- if( a->url().isEmpty() && b->url().isEmpty() )
- {
- if( a->text().toLower() == b->text().toLower() )
- return a->buttonID() < b->buttonID();
-
- return KStringHandler::naturalCompare(a->text(), b->text(), Qt::CaseInsensitive) < 0;
- }
-
- return KStringHandler::naturalCompare(a->url(), b->url(), Qt::CaseInsensitive) < 0;
- }
-
- case KTinyTabBar::Extension:
- {
- // sort by extension, but check whether the files have an
- // extension first
- const int apos = a->text().lastIndexOf( '.' );
- const int bpos = b->text().lastIndexOf( '.' );
-
- if( apos == -1 && bpos == -1 )
- return a->text().toLower() < b->text().toLower();
- else if( apos == -1 )
- return true;
- else if( bpos == -1 )
- return false;
- else
- {
- const int aright = a->text().size() - apos;
- const int bright = b->text().size() - bpos;
- QString aExt = a->text().right( aright ).toLower();
- QString bExt = b->text().right( bright ).toLower();
- QString aFile = a->text().left( apos ).toLower();
- QString bFile = b->text().left( bpos ).toLower();
-
- if( aExt == bExt )
- return (aFile == bFile) ? a->buttonID() < b->buttonID()
- : aFile < bFile;
- else
- return aExt < bExt;
- }
- }
- }
-
- return true;
-}
-
-//BEGIN public member functions
-/**
- * Creates a new tab bar with the given \a parent and \a name.
- *
- * The default values are in detail:
- * - minimum tab width: 150 pixel
- * - maximum tab width: 200 pixel
- * - fixed tab height : 22 pixel. Note that the icon's size is 16 pixel.
- * - number of rows: 1 row.
- * .
- */
-KTinyTabBar::KTinyTabBar( QWidget *parent )
- : QWidget( parent )
-{
- m_minimumTabWidth = 150;
- m_maximumTabWidth = 200;
-
- m_tabHeight = 22;
-
- m_locationTop = true;
- m_numRows = 1;
- m_currentRow = 0;
- m_followCurrentTab = true;
- m_highlightModifiedTabs = false;
- m_highlightPreviousTab = false;
- m_highlightActiveTab = false;
- m_highlightOpacity = 20;
-
- m_tabButtonStyle = Push;
- m_sortType = OpeningOrder;
- m_nextID = 0;
-
- m_activeButton = 0L;
- m_previousButton = 0L;
-
- // default colors
- m_colorModifiedTab = QColor( Qt::red );
- m_colorActiveTab = QColor( 150, 150, 255 );
- m_colorPreviousTab = QColor( 150, 150, 255 );
-
- // functions called in ::load() will set settings for the nav buttons
- m_upButton = new KTinyTabButton( QString(), QString(), -1, true, this );
- m_downButton = new KTinyTabButton( QString(), QString(), -2, true, this );
- m_configureButton = new KTinyTabButton( QString(), QString(), -3, true, this );
- m_navigateSize = 20;
-
- m_upButton->setIcon( KIconLoader::global()->loadIcon( "arrow-up", KIconLoader::Small, 16 ) );
- m_downButton->setIcon( KIconLoader::global()->loadIcon( "arrow-down", KIconLoader::Small, 16 ) );
- m_configureButton->setIcon( KIconLoader::global()->loadIcon( "configure", KIconLoader::Small, 16 ) );
-
- connect( m_upButton, SIGNAL(activated(KTinyTabButton*)), this, SLOT(upClicked()) );
- connect( m_downButton, SIGNAL(activated(KTinyTabButton*)), this, SLOT(downClicked()) );
- connect( m_configureButton, SIGNAL(activated(KTinyTabButton*)), this, SLOT(configureClicked()) );
-
- setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- updateFixedHeight();
-}
-
-/**
- * Destroys the tab bar.
- */
-KTinyTabBar::~KTinyTabBar()
-{
-}
-
-/**
- * Loads the settings from \a config from section \a group.
- * Remembered properties are:
- * - number of rows
- * - minimum and maximum tab width
- * - fixed tab height
- * - button colors
- * - much more!
- * .
- * The original group is saved and restored at the end of this function.
- *
- * \note Call @p load() immediately after you created the tabbar, otherwise
- * some properties might not be restored correctly (like highlighted
- * buttons).
- */
-void KTinyTabBar::load( KConfigBase* config, const QString& group )
-{
- KConfigGroup cg( config, group );
-
- // tabbar properties
- setLocationTop ( cg.readEntry( "location top", false ) );
- setNumRows ( cg.readEntry( "count of rows", 1 ) );
- setMinimumTabWidth( cg.readEntry( "minimum width", 150 ) );
- setMaximumTabWidth( cg.readEntry( "maximum width", 300 ) );
- setTabHeight ( cg.readEntry( "fixed height", 20 ) );
- setTabSortType ( (SortType) cg.readEntry( "sort type", (int)OpeningOrder ) );
- setTabButtonStyle ( (ButtonStyle) cg.readEntry( "button style", (int)Push ) );
- setFollowCurrentTab(cg.readEntry("follow current tab", true ) );
- setHighlightModifiedTabs( cg.readEntry( "highlight modified", false ) );
- setHighlightPreviousTab( cg.readEntry( "highlight previous", false ) );
- setHighlightActiveTab( cg.readEntry( "highlight active", false ) );
- setHighlightOpacity(cg.readEntry( "highlight opacity", 20 ) );
-
- // color settings
- setModifiedTabsColor( cg.readEntry( "color modified", m_colorModifiedTab ) );
- setActiveTabColor( cg.readEntry( "color active", m_colorActiveTab ) );
- setPreviousTabColor( cg.readEntry( "color previous", m_colorPreviousTab ) );
-
- // highlighted entries
- QStringList documents = cg.readEntry( "highlighted documents", QStringList() );
- QStringList colors = cg.readEntry( "highlighted colors", QStringList() );
-
- // restore highlight map
- m_highlightedTabs.clear();
- for( int i = 0; i < documents.size() && i < colors.size(); ++i )
- m_highlightedTabs[documents[i]] = colors[i];
-
- setHighlightMarks( highlightMarks() );
-}
-
-/**
- * Saves the settings to \a config into section \a group.
- * The original group is saved and restored at the end of this function.
- * See @p load() for more information.
- */
-void KTinyTabBar::save( KConfigBase* config, const QString& group ) const
-{
- KConfigGroup cg( config, group );
-
- // tabbar properties
- cg.writeEntry( "location top", locationTop() );
- cg.writeEntry( "count of rows", numRows() );
- cg.writeEntry( "minimum width", minimumTabWidth() );
- cg.writeEntry( "maximum width", maximumTabWidth() );
- cg.writeEntry( "fixed height", tabHeight() );
- cg.writeEntry( "sort type", (int)tabSortType() );
- cg.writeEntry( "button style", (int) tabButtonStyle() );
- cg.writeEntry( "follow current tab", followCurrentTab() );
- cg.writeEntry( "highlight modified", highlightModifiedTabs() );
- cg.writeEntry( "highlight previous", highlightPreviousTab() );
- cg.writeEntry( "highlight active", highlightActiveTab() );
- cg.writeEntry( "highlight opacity", highlightOpacity() );
-
-
- // color settings
- cg.writeEntry( "color modified", modifiedTabsColor() );
- cg.writeEntry( "color active", activeTabColor() );
- cg.writeEntry( "color previous", previousTabColor() );
-
- // highlighted entries
- cg.writeEntry( "highlighted documents", m_highlightedTabs.keys() );
- cg.writeEntry( "highlighted colors", m_highlightedTabs.values() );
-}
-
-/**
- * Set the location to @p top.
- */
-void KTinyTabBar::setLocationTop( bool top )
-{
- m_locationTop = top;
-}
-
-/**
- * Get whether the location is on top or bottom.
- */
-bool KTinyTabBar::locationTop() const
-{
- return m_locationTop;
-}
-
-
-/**
- * Set the number of \a rows.
- */
-void KTinyTabBar::setNumRows( int rows )
-{
- if( rows < 1 || rows == numRows() )
- return;
-
- m_numRows = rows;
- updateFixedHeight();
-}
-
-/**
- * Get the number of rows.
- */
-int KTinyTabBar::numRows() const
-{
- return m_numRows;
-}
-
-/**
- * Set the minimum width in pixels a tab must have.
- */
-void KTinyTabBar::setMinimumTabWidth( int min_pixel )
-{
- if( m_minimumTabWidth == min_pixel )
- return;
-
- m_minimumTabWidth = min_pixel;
- triggerResizeEvent();
-}
-
-/**
- * Set the maximum width in pixels a tab may have.
- */
-void KTinyTabBar::setMaximumTabWidth( int max_pixel )
-{
- if( m_maximumTabWidth == max_pixel )
- return;
-
- m_maximumTabWidth = max_pixel;
- triggerResizeEvent();
-}
-
-/**
- * Get the minimum width in pixels a tab can have.
- */
-int KTinyTabBar::minimumTabWidth() const
-{
- return m_minimumTabWidth;
-}
-
-/**
- * Get the maximum width in pixels a tab can have.
- */
-int KTinyTabBar::maximumTabWidth() const
-{
- return m_maximumTabWidth;
-}
-
-/**
- * Set the fixed height in pixels all tabs have.
- * \note If you also show icons use a height of iconheight + 2.
- * E.g. for 16x16 pixel icons, a tab height of 18 pixel looks best.
- * For 22x22 pixel icons a height of 24 pixel is best etc.
- */
-void KTinyTabBar::setTabHeight( int height_pixel )
-{
- if( m_tabHeight == height_pixel )
- return;
-
- m_tabHeight = height_pixel;
- updateFixedHeight();
-}
-
-/**
- * Get the fixed tab height in pixels.
- */
-int KTinyTabBar::tabHeight() const
-{
- return m_tabHeight;
-}
-
-/**
- * Adds a new tab with text \a text. Returns the new tab's ID. The document's
- * url @p docurl is used to sort the documents by URL.
- */
-int KTinyTabBar::addTab( const QString& docurl, const QString& text )
-{
- return addTab( docurl, QIcon(), text );
-}
-
-/**
- * This is an overloaded member function, provided for convenience.
- * It behaves essentially like the above function.
- *
- * Adds a new tab with \a icon and \a text. Returns the new tab's index.
- */
-int KTinyTabBar::addTab( const QString& docurl, const QIcon& icon, const QString& text )
-{
- KTinyTabButton* tabButton = new KTinyTabButton( docurl, text, m_nextID, false, this );
- tabButton->setIcon( icon );
- if( m_highlightedTabs.contains( text ) )
- tabButton->setHighlightColor( QColor( m_highlightedTabs[text] ) );
-
- // set all properties! be sure nothing is missing :)
- tabButton->setHighlightOpacity( highlightOpacity() );
- tabButton->setTabButtonStyle( tabButtonStyle() );
- tabButton->setHighlightModifiedTabs( highlightModifiedTabs() );
- tabButton->setHighlightActiveTab( highlightActiveTab() );
- tabButton->setHighlightPreviousTab( highlightPreviousTab() );
- tabButton->setModifiedTabsColor( modifiedTabsColor() );
- tabButton->setActiveTabColor( activeTabColor() );
- tabButton->setPreviousTabColor( previousTabColor() );
-
- m_tabButtons.append( tabButton );
- m_IDToTabButton[m_nextID] = tabButton;
- connect( tabButton, SIGNAL(activated(KTinyTabButton*)),
- this, SLOT(tabButtonActivated(KTinyTabButton*)) );
- connect( tabButton, SIGNAL(highlightChanged(KTinyTabButton*)),
- this, SLOT(tabButtonHighlightChanged(KTinyTabButton*)) );
- connect( tabButton, SIGNAL(closeRequest(KTinyTabButton*)),
- this, SLOT(tabButtonCloseRequest(KTinyTabButton*)) );
- connect( tabButton, SIGNAL(closeOtherTabsRequest(KTinyTabButton*)),
- this, SLOT(tabButtonCloseOtherRequest(KTinyTabButton*)) );
- connect( tabButton, SIGNAL(closeAllTabsRequest()),
- this, SLOT(tabButtonCloseAllRequest()) );
-
- if( !isVisible() )
- show();
-
- updateSort();
-
- return m_nextID++;
-}
-
-/**
- * Get the ID of the tab bar's activated tab. Returns -1 if no tab is activated.
- */
-int KTinyTabBar::currentTab() const
-{
- if( m_activeButton != 0L )
- return m_activeButton->buttonID();
-
- return -1;
-}
-
-/**
- * Activate the tab with ID \a button_id. No signal is emitted.
- */
-void KTinyTabBar::setCurrentTab( int button_id )
-{
- if( !m_IDToTabButton.contains( button_id ) )
- return;
-
- KTinyTabButton* tabButton = m_IDToTabButton[button_id];
- if( m_activeButton == tabButton )
- return;
-
- if( m_previousButton )
- m_previousButton->setPreviousTab( false );
-
- if( m_activeButton )
- {
- m_activeButton->setActivated( false );
- m_previousButton = m_activeButton;
- m_previousButton->setPreviousTab( true );
- }
-
- m_activeButton = tabButton;
- m_activeButton->setActivated( true );
- m_activeButton->setPreviousTab( false );
-
- // make current tab visible
- if( followCurrentTab() && !m_activeButton->isVisible() )
- makeCurrentTabVisible();
-}
-
-/**
- * Removes the tab with ID \a button_id.
- */
-void KTinyTabBar::removeTab( int button_id )
-{
- if( !m_IDToTabButton.contains( button_id ) )
- return;
-
- KTinyTabButton* tabButton = m_IDToTabButton[button_id];
-
- if( tabButton == m_previousButton )
- m_previousButton = 0L;
-
- if( tabButton == m_activeButton )
- m_activeButton = 0L;
-
- m_IDToTabButton.remove( button_id );
- m_tabButtons.removeAll( tabButton );
- // delete the button with deleteLater() because the button itself might
- // have send a close-request. So the app-execution is still in the
- // button, a delete tabButton; would lead to a crash.
- tabButton->hide();
- tabButton->deleteLater();
-
- if( m_tabButtons.count() == 0 )
- hide();
-
- triggerResizeEvent();
-}
-
-/**
- * Returns whether a tab with ID \a button_id exists.
- */
-bool KTinyTabBar::containsTab( int button_id ) const
-{
- return m_IDToTabButton.contains( button_id );
-}
-
-/**
- * Sets the text of the tab with ID \a button_id to \a text.
- * \see tabText()
- */
-void KTinyTabBar::setTabText( int button_id, const QString& text )
-{
- if( !m_IDToTabButton.contains( button_id ) )
- return;
-
- // change highlight key, if entry exists
- if( m_highlightedTabs.contains( m_IDToTabButton[button_id]->text() ) )
- {
- QString value = m_highlightedTabs[m_IDToTabButton[button_id]->text()];
- m_highlightedTabs.remove( m_IDToTabButton[button_id]->text() );
- m_highlightedTabs[text] = value;
-
- // do not emit highlightMarksChanged(), because every tabbar gets this
- // change (usually)
- // emit highlightMarksChanged( this );
- }
-
- m_IDToTabButton[button_id]->setText( text );
-
- if( tabSortType() == Name || tabSortType() == URL || tabSortType() == Extension )
- updateSort();
-}
-
-/**
- * Returns the text of the tab with ID \a button_id. If the button id does not
- * exist \a QString() is returned.
- * \see setTabText()
- */
-QString KTinyTabBar::tabText( int button_id ) const
-{
- if( m_IDToTabButton.contains( button_id ) )
- return m_IDToTabButton[button_id]->text();
-
- return QString();
-}
-
-/**
- * Set the button @p button_id's url to @p docurl.
- */
-void KTinyTabBar::setTabURL( int button_id, const QString& docurl )
-{
- if( !m_IDToTabButton.contains( button_id ) )
- return;
-
- m_IDToTabButton[button_id]->setURL( docurl);
-
- if( tabSortType() == URL )
- updateSort();
-}
-
-/**
- * Get the button @p button_id's url. Result is QStrint() if not available.
- */
-QString KTinyTabBar::tabURL( int button_id ) const
-{
- if( m_IDToTabButton.contains( button_id ) )
- return m_IDToTabButton[button_id]->url();
-
- return QString();
-}
-
-
-/**
- * Sets the icon of the tab with ID \a button_id to \a icon.
- * \see tabIcon()
- */
-void KTinyTabBar::setTabIcon( int button_id, const QIcon& icon )
-{
- if( m_IDToTabButton.contains( button_id ) )
- m_IDToTabButton[button_id]->setIcon( icon );
-}
-
-/**
- * Returns the icon of the tab with ID \a button_id. If the button id does not
- * exist \a QIcon() is returned.
- * \see setTabIcon()
- */
-QIcon KTinyTabBar::tabIcon( int button_id ) const
-{
- if( m_IDToTabButton.contains( button_id ) )
- return m_IDToTabButton[button_id]->icon();
-
- return QIcon();
-}
-
-/**
- * Returns the number of tabs in the tab bar.
- */
-int KTinyTabBar::count() const
-{
- return m_tabButtons.count();
-}
-
-/**
- * Set the tabbutton style. The signal @p tabButtonStyleChanged() is not
- * emitted.
- * @param tabStyle button style
- */
-void KTinyTabBar::setTabButtonStyle( ButtonStyle tabStyle )
-{
- m_tabButtonStyle = tabStyle;
-
- KTinyTabButton* tabButton;
- foreach( tabButton, m_tabButtons )
- tabButton->setTabButtonStyle( tabStyle );
-
- m_upButton->setTabButtonStyle( tabStyle );
- m_downButton->setTabButtonStyle( tabStyle );
- m_configureButton->setTabButtonStyle( tabStyle );
-}
-
-/**
- * Get the tabbutton style.
- * @return button style
- */
-KTinyTabBar::ButtonStyle KTinyTabBar::tabButtonStyle() const
-{
- return m_tabButtonStyle;
-}
-
-/**
- * Set the sort tye to @p sort.
- */
-void KTinyTabBar::setTabSortType( SortType sort )
-{
- if( m_sortType == sort )
- return;
-
- m_sortType = sort;
- updateSort();
-}
-
-/**
- * Get the sort type.
- */
-KTinyTabBar::SortType KTinyTabBar::tabSortType() const
-{
- return m_sortType;
-}
-
-
-/**
- * Set follow current tab to @p follow.
- */
-void KTinyTabBar::setFollowCurrentTab( bool follow )
-{
- m_followCurrentTab = follow;
- if( m_followCurrentTab )
- makeCurrentTabVisible();
-}
-
-/**
- * Check, whether to follow the current tab.
- */
-bool KTinyTabBar::followCurrentTab() const
-{
- return m_followCurrentTab;
-}
-
-/**
- * Set whether to highlight the previous button to @e highlight.
- */
-void KTinyTabBar::setHighlightPreviousTab( bool highlight )
-{
- m_highlightPreviousTab = highlight;
-
- KTinyTabButton* tabButton;
- foreach( tabButton, m_tabButtons )
- tabButton->setHighlightPreviousTab( highlight );
-}
-
-/**
- * Check, whether to highlight the previous button.
- */
-bool KTinyTabBar::highlightPreviousTab() const
-{
- return m_highlightPreviousTab;
-}
-
-/**
- * Set whether to highlight the previous button to @e highlight.
- */
-void KTinyTabBar::setHighlightActiveTab( bool highlight )
-{
- m_highlightActiveTab = highlight;
-
- KTinyTabButton* tabButton;
- foreach( tabButton, m_tabButtons )
- tabButton->setHighlightActiveTab( highlight );
-}
-
-/**
- * Check, whether to highlight the previous button.
- */
-bool KTinyTabBar::highlightActiveTab() const
-{
- return m_highlightActiveTab;
-}
-
-/**
- * Set the highlight opacity to @p value.
- */
-void KTinyTabBar::setHighlightOpacity( int value )
-{
- m_highlightOpacity = value;
-
- KTinyTabButton* tabButton;
- foreach( tabButton, m_tabButtons )
- tabButton->setHighlightOpacity( value );
-}
-
-/**
- * Get the highlight opacity.
- */
-int KTinyTabBar::highlightOpacity() const
-{
- return m_highlightOpacity;
-}
-
-/**
- * Set the color for the previous tab to @p color.
- */
-void KTinyTabBar::setPreviousTabColor( const QColor& color )
-{
- m_colorPreviousTab = color;
- KTinyTabButton* tabButton;
- foreach( tabButton, m_tabButtons )
- tabButton->setPreviousTabColor( color );
-}
-
-/**
- * Get the color for the previous tab.
- */
-QColor KTinyTabBar::previousTabColor() const
-{
- return m_colorPreviousTab;
-}
-
-/**
- * Set the color for the active tab to @p color.
- */
-void KTinyTabBar::setActiveTabColor( const QColor& color )
-{
- m_colorActiveTab = color;
- KTinyTabButton* tabButton;
- foreach( tabButton, m_tabButtons )
- tabButton->setActiveTabColor( color );
-}
-
-/**
- * Get the color for the active tab.
- */
-QColor KTinyTabBar::activeTabColor() const
-{
- return m_colorActiveTab;
-}
-
-void KTinyTabBar::setTabModified( int button_id, bool modified )
-{
- if( m_IDToTabButton.contains( button_id ) )
- m_IDToTabButton[button_id]->setModified( modified);
-}
-
-bool KTinyTabBar::isTabModified( int button_id ) const
-{
- if( m_IDToTabButton.contains( button_id ) )
- return m_IDToTabButton[button_id]->isModified();
-
- return false;
-}
-
-void KTinyTabBar::setHighlightModifiedTabs( bool modified )
-{
- m_highlightModifiedTabs = modified;
- KTinyTabButton* tabButton;
- foreach( tabButton, m_tabButtons )
- tabButton->setHighlightModifiedTabs( modified );
-}
-
-bool KTinyTabBar::highlightModifiedTabs() const
-{
- return m_highlightModifiedTabs;
-}
-
-void KTinyTabBar::setModifiedTabsColor( const QColor& color )
-{
- m_colorModifiedTab = color;
- KTinyTabButton* tabButton;
- foreach( tabButton, m_tabButtons )
- tabButton->setModifiedTabsColor( color );
-}
-
-QColor KTinyTabBar::modifiedTabsColor() const
-{
- return m_colorModifiedTab;
-}
-
-void KTinyTabBar::removeHighlightMarks()
-{
- KTinyTabButton* tabButton;
- foreach( tabButton, m_tabButtons )
- {
- if( tabButton->highlightColor().isValid() )
- tabButton->setHighlightColor( QColor() );
- }
-
- m_highlightedTabs.clear();
- emit highlightMarksChanged( this );
-}
-
-void KTinyTabBar::setHighlightMarks( const QMap<QString, QString>& marks )
-{
- m_highlightedTabs = marks;
-
- KTinyTabButton* tabButton;
- foreach( tabButton, m_tabButtons )
- {
- if( marks.contains( tabButton->text() ) )
- {
- if( tabButton->highlightColor().name() != marks[tabButton->text()] )
- tabButton->setHighlightColor( QColor( marks[tabButton->text()] ) );
- }
- else if( tabButton->highlightColor().isValid() )
- tabButton->setHighlightColor( QColor() );
- }
-}
-
-QMap<QString, QString> KTinyTabBar::highlightMarks() const
-{
- return m_highlightedTabs;
-}
-//END public member functions
-
-
-
-
-
-
-//BEGIN protected / private member functions
-
-/**
- * Active button changed. Emit signal \p currentChanged() with the button's ID.
- */
-void KTinyTabBar::tabButtonActivated( KTinyTabButton* tabButton )
-{
- if( tabButton == m_activeButton )
- return;
-
- if( m_previousButton )
- m_previousButton->setPreviousTab( false );
-
- if( m_activeButton )
- {
- m_activeButton->setActivated( false );
- m_previousButton = m_activeButton;
- m_previousButton->setPreviousTab( true );
- }
-
- m_activeButton = tabButton;
- m_activeButton->setActivated( true );
- m_activeButton->setPreviousTab( false );
-
- emit currentChanged( tabButton->buttonID() );
-}
-
-/**
- * The \e tabButton's highlight color changed, so update the list of documents
- * and colors.
- */
-void KTinyTabBar::tabButtonHighlightChanged( KTinyTabButton* tabButton )
-{
- if( tabButton->highlightColor().isValid() )
- {
- m_highlightedTabs[tabButton->text()] = tabButton->highlightColor().name();
- emit highlightMarksChanged( this );
- }
- else if( m_highlightedTabs.contains( tabButton->text() ) )
- {
- // invalid color, so remove the item
- m_highlightedTabs.remove( tabButton->text() );
- emit highlightMarksChanged( this );
- }
-}
-
-/**
- * If the user wants to close a tab with the context menu, it sends a close
- * request. Throw the close request by emitting the signal @p closeRequest().
- */
-void KTinyTabBar::tabButtonCloseRequest( KTinyTabButton* tabButton )
-{
- emit closeRequest( tabButton->buttonID() );
-}
-
-/**
- * If the user wants to close all tabs except the current one using the context
- * menu, it sends multiple close requests.
- * Throw the close requests by emitting the signal @p closeRequest().
- */
-void KTinyTabBar::tabButtonCloseOtherRequest( KTinyTabButton* tabButton )
-{
- QList <int> tabToCloseID;
- for (int i = 0; i < m_tabButtons.size(); ++i) {
- if ((m_tabButtons.at(i))->buttonID() != tabButton->buttonID())
- tabToCloseID << (m_tabButtons.at(i))->buttonID();
- }
-
- for (int i = 0; i < tabToCloseID.size(); i++) {
- emit closeRequest(tabToCloseID.at(i));
- }
-}
-
-/**
- * If the user wants to close all the tabs using the context menu, it sends
- * multiple close requests.
- * Throw the close requests by emitting the signal @p closeRequest().
- */
-void KTinyTabBar::tabButtonCloseAllRequest( )
-{
- QList <int> tabToCloseID;
- for (int i = 0; i < m_tabButtons.size(); ++i) {
- tabToCloseID << (m_tabButtons.at(i))->buttonID();
- }
-
- for (int i = 0; i < tabToCloseID.size(); i++) {
- emit closeRequest(tabToCloseID.at(i));
- }
-}
-
-/**
- * Recalculate geometry for all children.
- */
-void KTinyTabBar::resizeEvent( QResizeEvent* event )
-{
-// qDebug() << "resizeEvent";
- // if there are no tabs there is nothing to do. Do not delete otherwise
- // division by zero is possible.
- if( m_tabButtons.count() == 0 )
- {
- updateHelperButtons( event->size(), 0 );
- return;
- }
-
- int tabbar_width = event->size().width() - ( 4 - ( numRows()>3?3:numRows() ) ) * m_navigateSize;
- int tabs_per_row = tabbar_width / minimumTabWidth();
- if( tabs_per_row == 0 )
- tabs_per_row = 1;
-
- int tab_width = minimumTabWidth();
-
- int needed_rows = m_tabButtons.count() / tabs_per_row;
- if( needed_rows * tabs_per_row < (int)m_tabButtons.count() )
- ++needed_rows;
-
- // if we do not need more rows than available we can increase the tab
- // buttons' width up to maximumTabWidth.
- if( needed_rows <= numRows() )
- {
- // use available size optimal, but honor maximumTabWidth()
- tab_width = tabbar_width * numRows() / m_tabButtons.count();
-
- if( tab_width > maximumTabWidth() )
- tab_width = maximumTabWidth();
-
- tabs_per_row = tabbar_width / tab_width;
-
- // due to rounding fuzzys we have to increase the tabs_per_row if
- // the number of tabs does not fit.
- if( tabs_per_row * numRows() < (int)m_tabButtons.count() )
- ++tabs_per_row;
- }
-
- // On this point, we really know the value of tabs_per_row. So a final
- // calculation gives us the tab_width. With this the width can even get
- // greater than maximumTabWidth(), but that does not matter as it looks
- // more ugly if there is a lot wasted space on the right.
- tab_width = tabbar_width / tabs_per_row;
-
- updateHelperButtons( event->size(), needed_rows );
-
- KTinyTabButton* tabButton;
-
- foreach( tabButton, m_tabButtons )
- tabButton->hide();
-
- for( int row = 0; row < numRows(); ++row )
- {
- int current_row = row + currentRow();
- for( int i = 0; i < tabs_per_row; ++i )
- {
- // value returns 0L, if index is out of bounds
- tabButton = m_tabButtons.value( current_row * tabs_per_row + i );
-
- if( tabButton )
- {
- tabButton->setGeometry( i * tab_width, row * tabHeight(),
- tab_width, tabHeight() );
- tabButton->show();
- }
- }
- }
-}
-
-void KTinyTabBar::wheelEvent( QWheelEvent* event )
-{
- event->accept();
-
- if (event->delta() < 0) {
- scrollDown();
- } else {
- scrollUp();
- }
-}
-
-/**
- * Make sure the current tab visible. If it is not visible the tabbar scrolls
- * so that it is visible.
- */
-void KTinyTabBar::makeCurrentTabVisible()
-{
- if( !m_activeButton || m_activeButton->isVisible() )
- return;
-
- //BEGIN copy of resizeEvent
- int tabbar_width = width() - ( 4 - ( numRows()>3?3:numRows() ) ) * m_navigateSize;
- int tabs_per_row = tabbar_width / minimumTabWidth();
- if( tabs_per_row == 0 )
- tabs_per_row = 1;
-
- int tab_width = minimumTabWidth();
-
- int needed_rows = m_tabButtons.count() / tabs_per_row;
- if( needed_rows * tabs_per_row < (int)m_tabButtons.count() )
- ++needed_rows;
-
- // if we do not need more rows than available we can increase the tab
- // buttons' width up to maximumTabWidth.
- if( needed_rows <= numRows() )
- {
- // use available size optimal, but honor maximumTabWidth()
- tab_width = tabbar_width * numRows() / m_tabButtons.count();
-
- if( tab_width > maximumTabWidth() )
- tab_width = maximumTabWidth();
-
- tabs_per_row = tabbar_width / tab_width;
-
- // due to rounding fuzzys we have to increase the tabs_per_row if
- // the number of tabs does not fit.
- if( tabs_per_row * numRows() < (int)m_tabButtons.count() )
- ++tabs_per_row;
- }
- //END copy of resizeEvent
-
- int index = m_tabButtons.indexOf( m_activeButton );
- int firstVisible = currentRow() * tabs_per_row;
- int lastVisible = ( currentRow() + numRows() ) * tabs_per_row - 1;
-
- if( firstVisible >= m_tabButtons.count() )
- firstVisible = m_tabButtons.count() - 1;
-
- if( lastVisible >= m_tabButtons.count() )
- lastVisible = m_tabButtons.count() - 1;
-
- if( index < firstVisible )
- {
- setCurrentRow( index / tabs_per_row );
- }
- else if( index > lastVisible )
- {
- const int diff = index / tabs_per_row - ( numRows() - 1 );
- setCurrentRow( diff );
- }
-}
-
-/**
- * Updates the fixed height. Called when the tab height or the number of rows
- * changed.
- */
-void KTinyTabBar::updateFixedHeight()
-{
- setFixedHeight( numRows() * tabHeight() );
- triggerResizeEvent();
-}
-
-/**
- * May modifies current row if more tabs fit into a row.
- * Sets geometry for the buttons 'up', 'down' and 'configure'.
- */
-void KTinyTabBar::updateHelperButtons( QSize new_size, int needed_rows )
-{
- // if the size increased so that more tabs fit into one row it can happen
- // that suddenly a row on the bottom is empty - or that even all rows are
- // empty. That is not desired, so make sure that currentRow has a
- // reasonable value.
- if( currentRow() + numRows() > needed_rows )
- m_currentRow = ( needed_rows - numRows() < 0 ?
- 0 : needed_rows - numRows() );
-
- m_upButton->setEnabled( currentRow() != 0 );
- m_downButton->setEnabled( needed_rows - currentRow() > numRows() );
-
- // set geometry for up, down, configure
- switch( numRows() )
- {
- case 1:
- m_upButton->setGeometry( new_size.width() - 3 * m_navigateSize,
- 0, m_navigateSize, tabHeight() );
- m_downButton->setGeometry( new_size.width() - 2 * m_navigateSize,
- 0, m_navigateSize, tabHeight() );
- m_configureButton->setGeometry( new_size.width() - m_navigateSize,
- 0, m_navigateSize, tabHeight() );
- break;
- case 2:
- m_upButton->setGeometry( new_size.width() - 2 * m_navigateSize,
- 0, m_navigateSize, tabHeight() );
- m_downButton->setGeometry( new_size.width() - 2 * m_navigateSize,
- tabHeight(), m_navigateSize, tabHeight() );
- m_configureButton->setGeometry( new_size.width() - m_navigateSize,
- 0, m_navigateSize, 2 * tabHeight() );
- break;
- default:
- m_upButton->setGeometry( new_size.width() - m_navigateSize,
- 0, m_navigateSize, tabHeight() );
- m_downButton->setGeometry( new_size.width() - m_navigateSize,
- tabHeight(), m_navigateSize, tabHeight() );
- m_configureButton->setGeometry( new_size.width() - m_navigateSize,
- 2 * tabHeight(), m_navigateSize, tabHeight() );
- break;
- }
-}
-
-void KTinyTabBar::updateSort()
-{
- global_sortType = tabSortType();
- qSort( m_tabButtons.begin(), m_tabButtons.end(), tabLessThan );
- triggerResizeEvent();
-}
-
-/**
- * Decrease the current row. Called when the button 'up' was clicked.
- */
-void KTinyTabBar::upClicked()
-{
- scrollUp();
- m_upButton->setActivated( false );
-}
-
-/**
- * Increase the current row. Called when the button 'down' was clicked.
- */
-void KTinyTabBar::downClicked()
-{
- scrollDown();
- m_downButton->setActivated( false );
-}
-
-/**
- * Show configure dialog. If the button style changes the signal
- * @p tabButtonStyleChanged() will be emitted.
- */
-void KTinyTabBar::configureClicked()
-{
- m_configureButton->setActivated( false );
-
- KTinyTabBarConfigDialog dlg( this, (QWidget*)parent() );
- dlg.setObjectName( "tabbar_config_dialog" );
- if( dlg.exec() == KDialog::Accepted )
- {
- KTinyTabBarConfigPage* page = dlg.configPage();
-
- setLocationTop( page->locationTop() );
- setNumRows( page->numberOfRows() );
- setMinimumTabWidth( page->minimumTabWidth() );
- setMaximumTabWidth( page->maximumTabWidth() );
- setTabHeight( page->fixedTabHeight() );
- setTabSortType( page->tabSortType() );
- setTabButtonStyle( page->tabButtonStyle() );
- setFollowCurrentTab( page->followCurrentTab() );
- setHighlightModifiedTabs( page->highlightModifiedTabs() );
- setHighlightActiveTab( page->highlightActiveTab() );
- setHighlightPreviousTab( page->highlightPreviousTab() );
- setModifiedTabsColor( page->modifiedTabsColor() );
- setActiveTabColor( page->activeTabColor() );
- setPreviousTabColor( page->previousTabColor() );
- setHighlightOpacity( page->highlightOpacity() );
-
- emit settingsChanged( this );
- }
-}
-
-/**
- * Set the current row.
- * @param row new current row
- */
-void KTinyTabBar::setCurrentRow( int row )
-{
- if( row == currentRow() )
- return;
-
- m_currentRow = row;
- if( m_currentRow < 0 )
- m_currentRow = 0;
-
- triggerResizeEvent();
-}
-
-/**
- * Returns the current row.
- */
-int KTinyTabBar::currentRow() const
-{
- return m_currentRow;
-}
-
-/**
- * Increase the current row.
- */
-void KTinyTabBar::scrollDown()
-{
- ++m_currentRow;
- triggerResizeEvent();
-}
-
-/**
- * Decrease the current row.
- */
-void KTinyTabBar::scrollUp()
-{
- if( m_currentRow == 0 )
- return;
-
- --m_currentRow;
- triggerResizeEvent();
-}
-
-/**
- * Triggers a resizeEvent. This is used whenever the tab buttons need
- * a rearrange. By using \p QApplication::sendEvent() multiple calls are
- * combined into only one call.
- *
- * \see addTab(), removeTab(), setMinimumWidth(), setMaximumWidth(),
- * setFixedHeight(), scrollDown(), scrollUp()
- */
-void KTinyTabBar::triggerResizeEvent()
-{
- QResizeEvent ev( size(), size() );
- QApplication::sendEvent( this, &ev );
-}
-
-//END protected / private member functions
-
-// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on; eol unix;
diff --git a/addons/kate/tabbarextension/ktinytabbar.h b/addons/kate/tabbarextension/ktinytabbar.h
deleted file mode 100644
index 8d88364..0000000
--- a/addons/kate/tabbarextension/ktinytabbar.h
+++ /dev/null
@@ -1,250 +0,0 @@
-/***************************************************************************
- ktinytabbar.h
- -------------------
- begin : 2005-06-15
- copyright : (C) 2005 by Dominik Haumann
- email : dhdev@gmx.de
-
- Copyright (C) 2007 Flavio Castelli <flavio.castelli@gmail.com>
- ***************************************************************************/
-
-/***************************************************************************
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- ***************************************************************************/
-
-#ifndef KTINYTABBAR_H
-#define KTINYTABBAR_H
-
-#include <QWidget>
-
-#include <QList>
-#include <QMap>
-#include <QIcon>
-#include <QResizeEvent>
-
-class KTinyTabButton;
-class KConfigBase;
-
-/**
- * The \p KTinyTabBar class provides a tab bar, e.g. for tabbed documents and
- * supports multiple rows. The tab bar hides itself if there are no tabs.
- *
- * It implements the API from TrollTech's \p QTabBar with some minor changes
- * and additions.
- *
- * @author Dominik Haumann
- */
-class KTinyTabBar : public QWidget
-{
- Q_OBJECT
-
-public:
- /**
- * Defines the tab button's style.
- */
- enum ButtonStyle
- {
- Push=0, ///< default push button
- Flat ///< flat push button
- };
-
- /**
- * Sort types.
- */
- enum SortType
- {
- OpeningOrder=0, ///< opening order
- Name, ///< alphabetically
- URL, ///< alphabetically URL based
- Extension ///< by file extension (suffix)
- };
- Q_DECLARE_FLAGS( SortTypes, SortType )
-
-public:
- // NOTE: as the API here is very self-explaining the docs are in the cpp
- // file, more clean imho.
-
- KTinyTabBar( QWidget *parent = 0 );
- virtual ~KTinyTabBar();
-
- void load( KConfigBase* config, const QString& group );
- void save( KConfigBase* config, const QString& group ) const;
-
- void setLocationTop( bool top );
- bool locationTop() const;
-
- void setNumRows( int rows );
- int numRows() const;
-
- void setMinimumTabWidth( int min_pixel );
- void setMaximumTabWidth( int max_pixel );
-
- int minimumTabWidth() const;
- int maximumTabWidth() const;
-
- void setTabHeight( int height_pixel );
- int tabHeight() const;
-
- int addTab( const QString& docurl, const QString& text );
- int addTab( const QString& docurl, const QIcon& pixmap, const QString& text );
- void removeTab( int button_id );
-
- int currentTab() const;
- // corresponding SLOT: void setCurrentTab( int button_id );
-
- bool containsTab( int button_id ) const;
-
- void setTabURL( int button_id, const QString& docurl );
- QString tabURL( int button_id ) const;
-
- void setTabText( int button_id, const QString& text );
- QString tabText( int button_id ) const;
-
- void setTabIcon( int button_id, const QIcon& pixmap );
- QIcon tabIcon( int button_id ) const;
-
- void setTabModified( int button_id, bool modified );
- bool isTabModified( int button_id ) const;
-
- void setHighlightModifiedTabs( bool modified );
- bool highlightModifiedTabs() const;
-
- void setModifiedTabsColor( const QColor& color );
- QColor modifiedTabsColor() const;
-
- int count() const;
-
- void setTabButtonStyle( ButtonStyle tabStyle );
- ButtonStyle tabButtonStyle() const;
-
- void setTabSortType( SortType sort );
- SortType tabSortType() const;
-
- void setFollowCurrentTab( bool follow );
- bool followCurrentTab() const;
-
- void setHighlightPreviousTab( bool highlight );
- bool highlightPreviousTab() const;
-
- void setHighlightActiveTab( bool highlight );
- bool highlightActiveTab() const;
-
- void setHighlightOpacity( int value );
- int highlightOpacity() const;
-
- void setPreviousTabColor( const QColor& color );
- QColor previousTabColor() const;
-
- void setActiveTabColor( const QColor& color );
- QColor activeTabColor() const;
-
- void setHighlightMarks( const QMap<QString, QString>& marks );
- QMap<QString, QString> highlightMarks() const;
-
-public Q_SLOTS:
- void setCurrentTab( int button_id ); // does not emit signal
- void removeHighlightMarks();
-
-Q_SIGNALS:
- /**
- * This signal is emitted whenever the current activated tab changes.
- */
- void currentChanged( int button_id );
- /**
- * This signal is emitted whenever a tab should be closed.
- */
- void closeRequest( int button_id );
- /**
- * This signal is emitted whenever a setting entry changes.
- * A special property is the location. As the tabbar is embedded it cannot
- * change its location itself. So if you find a changed location, then go
- * and change it yourself!
- */
- void settingsChanged( KTinyTabBar* tabbar );
-
- /**
- * This signal is emitted whenever a highlight mark changes.
- * Usually this is used to synchronice several tabbars.
- */
- void highlightMarksChanged( KTinyTabBar* tabbar );
-
-protected Q_SLOTS:
- void tabButtonActivated( KTinyTabButton* tabButton );
- void tabButtonHighlightChanged( KTinyTabButton* tabButton );
- void tabButtonCloseAllRequest();
- void tabButtonCloseRequest( KTinyTabButton* tabButton );
- void tabButtonCloseOtherRequest( KTinyTabButton* tabButton );
- void upClicked();
- void downClicked();
- void configureClicked();
- void makeCurrentTabVisible();
-
-protected:
- virtual void resizeEvent( QResizeEvent* event );
- virtual void wheelEvent( QWheelEvent* event );
-
-
-protected:
- void updateFixedHeight();
- void triggerResizeEvent();
- void updateSort();
- int currentRow() const;
- void setCurrentRow( int row );
- void updateHelperButtons( QSize new_size, int needed_rows );
- void scrollDown();
- void scrollUp();
-
-private:
- bool m_locationTop;
- int m_numRows;
- int m_currentRow;
- int m_minimumTabWidth;
- int m_maximumTabWidth;
- int m_tabHeight;
-
- QList< KTinyTabButton* > m_tabButtons;
- QMap< int, KTinyTabButton* > m_IDToTabButton;
-
- KTinyTabButton* m_activeButton;
- KTinyTabButton* m_previousButton;
-
- // buttons on the right to navigate and configure
- KTinyTabButton* m_upButton;
- KTinyTabButton* m_downButton;
- KTinyTabButton* m_configureButton;
- int m_navigateSize;
-
- int m_nextID;
-
- // map of highlighted tabs and colors
- QMap< QString, QString > m_highlightedTabs;
- // tab button style
- ButtonStyle m_tabButtonStyle;
- SortType m_sortType;
- bool m_highlightModifiedTabs;
- bool m_followCurrentTab;
- bool m_highlightPreviousTab;
- bool m_highlightActiveTab;
- int m_highlightOpacity;
-
- // configurable and saved by KTinyTabBar
- QColor m_colorModifiedTab;
- QColor m_colorActiveTab;
- QColor m_colorPreviousTab;
-};
-
-#endif // KTINYTABBAR_H
-
-// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on; eol unix;
diff --git a/addons/kate/tabbarextension/ktinytabbarconfigdialog.cpp b/addons/kate/tabbarextension/ktinytabbarconfigdialog.cpp
deleted file mode 100644
index 30b33c5..0000000
--- a/addons/kate/tabbarextension/ktinytabbarconfigdialog.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/***************************************************************************
- ktinytabbarconfigdialog.cpp
- -------------------
- begin : 2005-06-19
- copyright : (C) 2005 by Dominik Haumann
- email : dhdev@gmx.de
- ***************************************************************************/
-
-/***************************************************************************
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- ***************************************************************************/
-
-#include "ktinytabbarconfigdialog.h"
-#include "ktinytabbarconfigpage.h"
-#include "ktinytabbar.h"
-#include "ktinytabbutton.h"
-
-#include <klocalizedstring.h>
-
-
-KTinyTabBarConfigDialog::KTinyTabBarConfigDialog( const KTinyTabBar* tabbar,
- QWidget *parent )
- : KDialog( parent )
-{
- setCaption( i18n( "Configure Tab Bar" ) );
- setButtons( KDialog::Cancel | KDialog::Ok );
-
- m_configPage = new KTinyTabBarConfigPage( this );
-
- m_configPage->setLocationTop( tabbar->locationTop() );
- m_configPage->setNumberOfRows( tabbar->numRows() );
- m_configPage->setMinimumTabWidth( tabbar->minimumTabWidth() );
- m_configPage->setMaximumTabWidth( tabbar->maximumTabWidth() );
- m_configPage->setFixedTabHeight( tabbar->tabHeight() );
- m_configPage->setFollowCurrentTab( tabbar->followCurrentTab() );
- m_configPage->setTabSortType( tabbar->tabSortType() );
- m_configPage->setTabButtonStyle( tabbar->tabButtonStyle() );
- m_configPage->setHighlightModifiedTabs( tabbar->highlightModifiedTabs() );
- m_configPage->setHighlightActiveTab( tabbar->highlightActiveTab() );
- m_configPage->setHighlightPreviousTab( tabbar->highlightPreviousTab() );
- m_configPage->setModifiedTabsColor( tabbar->modifiedTabsColor() );
- m_configPage->setActiveTabColor( tabbar->activeTabColor() );
- m_configPage->setPreviousTabColor( tabbar->previousTabColor() );
- m_configPage->setHighlightOpacity( tabbar->highlightOpacity() );
-
- setMainWidget( m_configPage );
- resize( 400, 300 );
-
- enableButton( KDialog::Ok, false );
- connect( m_configPage, SIGNAL(changed()), this, SLOT(configChanged()) );
- connect( m_configPage, SIGNAL(removeHighlightMarks()),
- tabbar, SLOT(removeHighlightMarks()) );
-}
-
-KTinyTabBarConfigDialog::~KTinyTabBarConfigDialog()
-{
-}
-
-void KTinyTabBarConfigDialog::configChanged()
-{
- enableButton( KDialog::Ok, true );
-}
-
-KTinyTabBarConfigPage* KTinyTabBarConfigDialog::configPage()
-{
- return m_configPage;
-}
-
-#include "ktinytabbarconfigdialog.moc"
-
-// kate: space-indent on; tab-width 4; replace-tabs off; eol unix;
-
diff --git a/addons/kate/tabbarextension/ktinytabbarconfigdialog.h b/addons/kate/tabbarextension/ktinytabbarconfigdialog.h
deleted file mode 100644
index d8fa0cb..0000000
--- a/addons/kate/tabbarextension/ktinytabbarconfigdialog.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/***************************************************************************
- ktinytabbarconfigdialog.h
- -------------------
- begin : 2005-06-19
- copyright : (C) 2005 by Dominik Haumann
- email : dhdev@gmx.de
- ***************************************************************************/
-
-/***************************************************************************
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- ***************************************************************************/
-
-#ifndef KTINYTABBARCONFIGDIALOG_H
-#define KTINYTABBARCONFIGDIALOG_H
-
-#include <kdialog.h>
-
-
-class KTinyTabBar;
-class KTinyTabBarConfigPage;
-
-/**
- * The class @p KTinyTabBarConfigDialog provides a configuration dialog
- * for the @p KTinyTabBar widget. It is only a wrapper dialog for
- * @p KTinyTabBarConfigPage. It's mainly for private usage. If the return code
- * is @p KDialog::Accepted an option changed for sure.
- *
- * @author Dominik Haumann
- */
-class KTinyTabBarConfigDialog
- : public KDialog
-{
- Q_OBJECT
-public:
- explicit KTinyTabBarConfigDialog( const KTinyTabBar* tabbar, QWidget *parent = 0 );
- ~KTinyTabBarConfigDialog();
-
- KTinyTabBarConfigPage* configPage();
-
-protected Q_SLOTS:
- void configChanged();
-
-private:
- KTinyTabBarConfigPage* m_configPage;
-};
-
-#endif
-
-// kate: space-indent on; tab-width 4; replace-tabs off; eol unix;
diff --git a/addons/kate/tabbarextension/ktinytabbarconfigpage.cpp b/addons/kate/tabbarextension/ktinytabbarconfigpage.cpp
deleted file mode 100644
index d57d2f4..0000000
--- a/addons/kate/tabbarextension/ktinytabbarconfigpage.cpp
+++ /dev/null
@@ -1,424 +0,0 @@
-/***************************************************************************
- ktinytabbarconfigpage.cpp
- -------------------
- begin : 2005-06-19
- copyright : (C) 2005 by Dominik Haumann
- email : dhdev@gmx.de
- ***************************************************************************/
-
-/***************************************************************************
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- ***************************************************************************/
-
-#include "ktinytabbarconfigpage.h"
-#include "ktinytabbutton.h"
-
-#include <QSpinBox>
-#include <QGroupBox>
-#include <QPushButton>
-#include <QCheckBox>
-#include <QLabel>
-#include <QGridLayout>
-#include <QHBoxLayout>
-#include <QVBoxLayout>
-#include <QRadioButton>
-#include <QSlider>
-
-#include <kdialog.h>
-#include <klocalizedstring.h>
-#include <kiconloader.h>
-#include <kcolorbutton.h>
-#include <ktabwidget.h>
-
-
-KTinyTabBarConfigPage::KTinyTabBarConfigPage( QWidget *parent )
- : QWidget( parent )
- , Ui::TabBarConfigWidget()
-{
- setupUi(this);
-
- // preview group box
- QHBoxLayout* hlPreview = new QHBoxLayout( gbPreview );
- m_previewMinimum = new KTinyTabButton( QString(), i18n( "minimum size" ), 0, true, gbPreview );
- m_previewMaximum = new KTinyTabButton( QString(), i18n( "maximum size" ), 1, true, gbPreview );
- hlPreview->addWidget( m_previewMinimum );
- hlPreview->addWidget( m_previewMaximum );
-
- connect(btnClearCache, SIGNAL(clicked()),
- this, SIGNAL(removeHighlightMarks()));
-
- setupConnections();
-}
-
-void KTinyTabBarConfigPage::setupDefaults()
-{
- // location
- cmbLocation->setCurrentIndex(0);
-
- // follow current tab
- chkFollowActive->setChecked(true);
-
- // sort by
- cmbSorting->setCurrentIndex(0);
-
- // tab sizes group box
- sbMinWidth->setValue(150);
- sbMaxWidth->setValue(200);
- sbHeight->setValue(22);
-
- // button style group
- cmbStyle->setCurrentIndex(0);
-
- // tab highlighting
- chkModified->setChecked(false);
- colModified->setEnabled(false);
- colModified->setColor(Qt::red);
- chkActive->setChecked(false);
- colActive->setEnabled(false);
- colActive->setColor(Qt::blue);
- chkPrevious->setChecked(false);
- colPrevious->setEnabled(false);
- colPrevious->setColor(Qt::yellow);
-
- slOpacity->setValue( 20 );
-
-
- // preview
- m_previewMinimum->setActivated( true );
- m_previewMinimum->setFixedSize( minimumTabWidth(), fixedTabHeight() );
- m_previewMaximum->setFixedSize( maximumTabWidth(), fixedTabHeight() );
- m_previewMinimum->setHighlightOpacity( highlightOpacity() );
- m_previewMaximum->setHighlightOpacity( highlightOpacity() );
- m_previewMinimum->setTabButtonStyle( tabButtonStyle() );
- m_previewMaximum->setTabButtonStyle( tabButtonStyle() );
- m_previewMinimum->setHighlightActiveTab( highlightActiveTab() );
- m_previewMinimum->setHighlightPreviousTab( highlightPreviousTab() );
- m_previewMaximum->setHighlightActiveTab( highlightActiveTab() );
- m_previewMaximum->setHighlightPreviousTab( highlightPreviousTab() );
-
- m_previewMinimum->setHighlightModifiedTabs( false );
- m_previewMaximum->setHighlightModifiedTabs( true );
- m_previewMaximum->setModifiedTabsColor( modifiedTabsColor() );
- m_previewMaximum->setModified( true );
-}
-
-void KTinyTabBarConfigPage::setupConnections()
-{
- // location: nothing
- connect(cmbLocation, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed()));
-
- // rows group box
- connect(sbRows, SIGNAL(valueChanged(int)), this, SIGNAL(changed()));
- connect(chkFollowActive, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
-
- // sort by group box
- connect(cmbSorting, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed()));
-
- // tab sizes group box
- connect(sbMinWidth, SIGNAL(valueChanged(int)), this, SLOT(minimumTabWidthChanged(int)));
- connect(sbMaxWidth, SIGNAL(valueChanged(int)), this, SLOT(maximumTabWidthChanged(int)));
- connect(sbHeight, SIGNAL(valueChanged(int)), this, SLOT(fixedTabHeightChanged(int)));
-
- // button style group
- connect(cmbStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(buttonStyleChanged(int)));
-
- // tab highlighting
- connect(chkModified, SIGNAL(toggled(bool)), this, SLOT(highlightModifiedTabsChanged(bool)));
- connect(colModified, SIGNAL(changed(QColor)), this, SLOT(modifiedTabsColorChanged(QColor)));
- connect(chkActive, SIGNAL(toggled(bool)), this, SLOT(highlightActiveTabChanged(bool)));
- connect(chkPrevious, SIGNAL(toggled(bool)), this, SLOT(highlightPreviousTabChanged(bool)));
- connect(colActive, SIGNAL(changed(QColor)), this, SLOT(activeTabColorChanged(QColor)));
- connect(colPrevious, SIGNAL(changed(QColor)), this, SLOT(previousTabColorChanged(QColor)));
- connect(slOpacity, SIGNAL(valueChanged(int)), this, SLOT(highlightOpacityChanged(int)));
-
- // preview
- connect(m_previewMinimum, SIGNAL(activated(KTinyTabButton*)), this, SLOT(buttonActivated(KTinyTabButton*)));
- connect(m_previewMaximum, SIGNAL(activated(KTinyTabButton*)), this, SLOT(buttonActivated(KTinyTabButton*)));
-}
-
-KTinyTabBarConfigPage::~KTinyTabBarConfigPage()
-{
-}
-
-//BEGIN protected slots
-
-void KTinyTabBarConfigPage::minimumTabWidthChanged( int value )
-{
- m_previewMinimum->setFixedWidth( value );
- emit changed();
-}
-
-void KTinyTabBarConfigPage::maximumTabWidthChanged( int value )
-{
- m_previewMaximum->setFixedWidth( value );
- emit changed();
-}
-
-void KTinyTabBarConfigPage::fixedTabHeightChanged( int value )
-{
- m_previewMinimum->setFixedHeight( value );
- m_previewMaximum->setFixedHeight( value );
- emit changed();
-}
-
-void KTinyTabBarConfigPage::buttonStyleChanged(int index)
-{
- KTinyTabBar::ButtonStyle style = static_cast<KTinyTabBar::ButtonStyle>(index);
- m_previewMinimum->setTabButtonStyle(style);
- m_previewMaximum->setTabButtonStyle(style);
- emit changed();
-}
-
-void KTinyTabBarConfigPage::highlightActiveTabChanged( bool highlight )
-{
- m_previewMinimum->setHighlightActiveTab( highlight );
- m_previewMaximum->setHighlightActiveTab( highlight );
- emit changed();
-}
-
-void KTinyTabBarConfigPage::highlightPreviousTabChanged( bool highlight )
-{
- m_previewMinimum->setHighlightPreviousTab( highlight );
- m_previewMaximum->setHighlightPreviousTab( highlight );
- emit changed();
-}
-
-void KTinyTabBarConfigPage::activeTabColorChanged( const QColor& newColor )
-{
- m_previewMinimum->setActiveTabColor( newColor );
- m_previewMaximum->setActiveTabColor( newColor );
- emit changed();
-}
-
-void KTinyTabBarConfigPage::previousTabColorChanged( const QColor& newColor )
-{
- m_previewMinimum->setPreviousTabColor( newColor );
- m_previewMaximum->setPreviousTabColor( newColor );
- emit changed();
-}
-
-void KTinyTabBarConfigPage::highlightOpacityChanged( int value )
-{
- m_previewMinimum->setHighlightOpacity( value );
- m_previewMaximum->setHighlightOpacity( value );
- emit changed();
-}
-
-void KTinyTabBarConfigPage::highlightModifiedTabsChanged( bool highlight )
-{
- m_previewMinimum->setHighlightModifiedTabs( highlight );
- m_previewMaximum->setHighlightModifiedTabs( highlight );
- emit changed();
-}
-
-void KTinyTabBarConfigPage::modifiedTabsColorChanged( const QColor& newColor )
-{
- m_previewMinimum->setModifiedTabsColor( newColor );
- m_previewMaximum->setModifiedTabsColor( newColor );
- emit changed();
-}
-
-
-
-
-void KTinyTabBarConfigPage::buttonActivated( KTinyTabButton* button )
-{
- if( button == m_previewMinimum ) {
- m_previewMinimum->setPreviousTab(false);
- m_previewMaximum->setActivated(false);
- m_previewMaximum->setPreviousTab(true);
- } else {
- m_previewMaximum->setPreviousTab(false);
- m_previewMinimum->setActivated(false);
- m_previewMinimum->setPreviousTab(true);
- }
-}
-//END protected slots
-
-bool KTinyTabBarConfigPage::locationTop() const
-{
- return cmbLocation->currentIndex() == 0;
-}
-
-void KTinyTabBarConfigPage::setLocationTop( bool value )
-{
- cmbLocation->setCurrentIndex( value ? 0 : 1);
-}
-
-int KTinyTabBarConfigPage::minimumTabWidth() const
-{
- return sbMinWidth->value();
-}
-
-void KTinyTabBarConfigPage::setMinimumTabWidth( int value )
-{
- sbMinWidth->setValue( value );
-}
-
-int KTinyTabBarConfigPage::maximumTabWidth() const
-{
- return sbMaxWidth->value();
-}
-
-void KTinyTabBarConfigPage::setMaximumTabWidth( int value )
-{
- sbMaxWidth->setValue( value );
-}
-
-int KTinyTabBarConfigPage::fixedTabHeight() const
-{
- return sbHeight->value();
-}
-
-void KTinyTabBarConfigPage::setFixedTabHeight( int value )
-{
- sbHeight->setValue( value );
-}
-
-
-int KTinyTabBarConfigPage::numberOfRows() const
-{
- return sbRows->value();
-}
-
-void KTinyTabBarConfigPage::setNumberOfRows( int value )
-{
- sbRows->setValue( value );
-}
-
-bool KTinyTabBarConfigPage::followCurrentTab() const
-{
- return chkFollowActive->isChecked();
-}
-
-void KTinyTabBarConfigPage::setFollowCurrentTab( bool value )
-{
- chkFollowActive->setChecked( value );
-}
-
-void KTinyTabBarConfigPage::setTabSortType( KTinyTabBar::SortType type )
-{
- int index = static_cast<int>(type);
- cmbSorting->setCurrentIndex(index);
-}
-
-KTinyTabBar::SortType KTinyTabBarConfigPage::tabSortType() const
-{
- return static_cast<KTinyTabBar::SortType>(cmbSorting->currentIndex());
-}
-
-
-void KTinyTabBarConfigPage::setTabButtonStyle( KTinyTabBar::ButtonStyle style )
-{
- int index = static_cast<int>(style);
- cmbStyle->setCurrentIndex(index);
-}
-
-KTinyTabBar::ButtonStyle KTinyTabBarConfigPage::tabButtonStyle() const
-{
- return static_cast<KTinyTabBar::ButtonStyle>(cmbStyle->currentIndex());
-}
-
-
-void KTinyTabBarConfigPage::setHighlightActiveTab( bool value )
-{
- chkActive->setChecked( value );
- m_previewMinimum->setHighlightActiveTab( value );
- m_previewMaximum->setHighlightActiveTab( value );
-}
-
-bool KTinyTabBarConfigPage::highlightActiveTab() const
-{
- return chkActive->isChecked();
-}
-
-void KTinyTabBarConfigPage::setActiveTabColor( const QColor& color )
-{
- colActive->setColor( color );
- m_previewMinimum->setActiveTabColor( color );
- m_previewMaximum->setActiveTabColor( color );
-}
-
-QColor KTinyTabBarConfigPage::activeTabColor() const
-{
- return colActive->color();
-}
-
-
-void KTinyTabBarConfigPage::setHighlightPreviousTab( bool value )
-{
- chkPrevious->setChecked( value );
- m_previewMinimum->setHighlightPreviousTab( value );
- m_previewMaximum->setHighlightPreviousTab( value );
-}
-
-bool KTinyTabBarConfigPage::highlightPreviousTab() const
-{
- return chkPrevious->isChecked();
-}
-
-void KTinyTabBarConfigPage::setPreviousTabColor( const QColor& color )
-{
- colPrevious->setColor( color );
- m_previewMinimum->setPreviousTabColor( color );
- m_previewMaximum->setPreviousTabColor( color );
-}
-
-QColor KTinyTabBarConfigPage::previousTabColor() const
-{
- return colPrevious->color();
-}
-
-void KTinyTabBarConfigPage::setHighlightOpacity( int value )
-{
- slOpacity->setValue( value );
- m_previewMinimum->setHighlightOpacity( value );
- m_previewMaximum->setHighlightOpacity( value );
-}
-
-int KTinyTabBarConfigPage::highlightOpacity() const
-{
- return slOpacity->value();
-}
-
-void KTinyTabBarConfigPage::setHighlightModifiedTabs( bool modified )
-{
- chkModified->setChecked( modified );
- m_previewMinimum->setHighlightModifiedTabs( modified );
- m_previewMaximum->setHighlightModifiedTabs( modified );
-}
-
-bool KTinyTabBarConfigPage::highlightModifiedTabs() const
-{
- return chkModified->isChecked();
-}
-
-void KTinyTabBarConfigPage::setModifiedTabsColor( const QColor& color )
-{
- colModified->setColor( color );
- m_previewMinimum->setModifiedTabsColor( color );
- m_previewMaximum->setModifiedTabsColor( color );
-}
-
-QColor KTinyTabBarConfigPage::modifiedTabsColor() const
-{
- return colModified->color();
-}
-
-
-
-#include "ktinytabbarconfigpage.moc"
-
-// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs off; eol unix;
diff --git a/addons/kate/tabbarextension/ktinytabbarconfigpage.h b/addons/kate/tabbarextension/ktinytabbarconfigpage.h
deleted file mode 100644
index fb8774d..0000000
--- a/addons/kate/tabbarextension/ktinytabbarconfigpage.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/***************************************************************************
- ktinytabbarconfigpage.h
- -------------------
- begin : 2005-06-19
- copyright : (C) 2005 by Dominik Haumann
- email : dhdev@gmx.de
- ***************************************************************************/
-
-/***************************************************************************
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- ***************************************************************************/
-
-#ifndef KTINYTABBARCONFIGPAGE_H
-#define KTINYTABBARCONFIGPAGE_H
-
-#include <QWidget>
-#include <QColor>
-
-#include "ktinytabbar.h"
-#include "ui_tabbarconfigwidget.h"
-
-class KColorButton;
-class KTinyTabButton;
-class QCheckBox;
-class QLabel;
-class QRadioButton;
-class QSlider;
-class QSpinBox;
-
-/**
- * The class @p KTinyTabBarConfigPage provides a config page for
- * @p KTinyTabBar. It provides an interface to set the number of rows,
- * minimum and maximum tab width, and the tab height.
- *
- * @author Dominik Haumann
- */
-class KTinyTabBarConfigPage
- : public QWidget
- , private Ui::TabBarConfigWidget
-{
- Q_OBJECT
-public:
- KTinyTabBarConfigPage( QWidget *parent = 0 );
-
- ~KTinyTabBarConfigPage();
-
-
- bool locationTop() const;
- void setLocationTop( bool value );
-
-
- int minimumTabWidth() const;
- void setMinimumTabWidth( int value );
-
- int maximumTabWidth() const;
- void setMaximumTabWidth( int value );
-
- int fixedTabHeight() const;
- void setFixedTabHeight( int value );
-
-
- int numberOfRows() const;
- void setNumberOfRows( int value );
-
- bool followCurrentTab() const;
- void setFollowCurrentTab( bool value );
-
- void setTabSortType( KTinyTabBar::SortType type );
- KTinyTabBar::SortType tabSortType() const;
-
- void setTabButtonStyle( KTinyTabBar::ButtonStyle style );
- KTinyTabBar::ButtonStyle tabButtonStyle() const;
-
-
- void setHighlightActiveTab( bool value );
- bool highlightActiveTab() const;
-
- void setActiveTabColor( const QColor& color );
- QColor activeTabColor() const;
-
- void setHighlightPreviousTab( bool value );
- bool highlightPreviousTab() const;
-
- void setPreviousTabColor( const QColor& color );
- QColor previousTabColor() const;
-
- void setHighlightOpacity( int value );
- int highlightOpacity() const;
-
- void setHighlightModifiedTabs( bool modified );
- bool highlightModifiedTabs() const;
-
- void setModifiedTabsColor( const QColor& color );
- QColor modifiedTabsColor() const;
-
-
-Q_SIGNALS:
- void changed();
- void removeHighlightMarks();
-
-protected Q_SLOTS:
- void minimumTabWidthChanged(int value);
- void maximumTabWidthChanged(int value);
- void fixedTabHeightChanged(int value);
- void buttonStyleChanged(int index);
- void highlightActiveTabChanged( bool highlight );
- void highlightPreviousTabChanged( bool highlight );
- void activeTabColorChanged( const QColor& newColor );
- void previousTabColorChanged( const QColor& newColor );
- void highlightOpacityChanged( int value );
- void highlightModifiedTabsChanged( bool highlight );
- void modifiedTabsColorChanged( const QColor& newColor );
-
- void buttonActivated( KTinyTabButton* );
-
-protected:
- void setupDefaults();
- void setupConnections();
-
-private:
- KTinyTabButton* m_previewMinimum;
- KTinyTabButton* m_previewMaximum;
-};
-
-#endif
-
-// kate: space-indent on; indent-width 2; tab-width 4; replace-tabs off; eol unix;
diff --git a/addons/kate/tabbarextension/ktinytabbutton.cpp b/addons/kate/tabbarextension/ktinytabbutton.cpp
deleted file mode 100644
index 5d2d2c5..0000000
--- a/addons/kate/tabbarextension/ktinytabbutton.cpp
+++ /dev/null
@@ -1,397 +0,0 @@
-/***************************************************************************
- ktinytabbutton.cpp
- -------------------
- begin : 2005-06-15
- copyright : (C) 2005 by Dominik Haumann
- email : dhdev@gmx.de
-
- Copyright (C) 2007 Flavio Castelli <flavio.castelli@gmail.com>
- ***************************************************************************/
-
-/***************************************************************************
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- ***************************************************************************/
-
-#include "ktinytabbutton.h"
-#include "ktinytabbutton.moc"
-
-#include <kcolordialog.h>
-#include <kiconloader.h>
-#include <klocalizedstring.h>
-#include <kglobalsettings.h>
-
-#include <QApplication>
-#include <QContextMenuEvent>
-#include <QIcon>
-#include <QMenu>
-#include <QPainter>
-#include <QStyle>
-#include <QStyleOptionButton>
-#include <qdrawutil.h>
-
-QColor KTinyTabButton::s_predefinedColors[] = { Qt::red, Qt::yellow, Qt::green, Qt::cyan, Qt::blue, Qt::magenta };
-const int KTinyTabButton::s_colorCount = 6;
-int KTinyTabButton::s_currentColor = 0;
-
-
-KTinyTabButton::KTinyTabButton( const QString& docurl, const QString& caption,
- int button_id, bool blockContextMenu, QWidget *parent )
- : QPushButton( parent )
-{
- setFont(KGlobalSettings::toolBarFont());
- setCheckable( true );
- setFocusPolicy( Qt::NoFocus );
- setMinimumWidth( 1 );
-
- if( blockContextMenu )
- setContextMenuPolicy( Qt::NoContextMenu );
-
- m_buttonId = button_id;
- m_tabButtonStyle = KTinyTabBar::Push;
- m_highlightModifiedTab = false;
- m_isPreviousTab = false;
- m_highlightColor = QColor(); // set to invalid color
- m_highlightActiveTab = false;
- m_highlightPreviousTab = false;
- m_highlightOpacity = 20;
- m_modified = false;
-
- setIcon( QIcon() );
- setText( caption );
- setURL( docurl );
-
- connect( this, SIGNAL(clicked()), this, SLOT(buttonClicked()) );
-}
-
-KTinyTabButton::~KTinyTabButton()
-{
-}
-
-void KTinyTabButton::setURL( const QString& docurl )
-{
- m_url = docurl;
- if( !m_url.isEmpty() )
- setToolTip( m_url );
- else
- setToolTip( text() );
-}
-
-QString KTinyTabButton::url() const
-{
- return m_url;
-}
-
-
-void KTinyTabButton::buttonClicked()
-{
- // once down, stay down until another tab is activated
- if( isChecked() )
- emit activated( this );
- else
- setChecked( true );
-}
-
-void KTinyTabButton::setActivated( bool active )
-{
- if( isChecked() == active ) return;
- setChecked( active );
- update();
-}
-
-bool KTinyTabButton::isActivated() const
-{
- return isChecked();
-}
-
-void KTinyTabButton::paintEvent( QPaintEvent* ev )
-{
- const int opac = m_highlightOpacity;
- const int comp = 100 - opac;
-
- QColor mix = ( highlightActiveTab() && isActivated() ) ? m_colorActiveTab :
- ( ( highlightPreviousTab() && previousTab() ) ? m_colorPreviousTab :
- m_highlightColor );
- QPalette pal = QApplication::palette();
- if( isModified() && highlightModifiedTabs() )
- pal.setColor( QPalette::ButtonText, modifiedTabsColor() );
-
-
- switch( tabButtonStyle() )
- {
- case KTinyTabBar::Push:
- case KTinyTabBar::Flat:
- {
- if( m_highlightColor.isValid()
- || ( isActivated() && highlightActiveTab() )
- || ( previousTab() && highlightPreviousTab() ) )
- {
- QColor col( pal.button().color() );
- col.setRed( ( col.red()*comp + mix.red()*opac ) / 100 );
- col.setGreen( ( col.green()*comp + mix.green()*opac ) / 100 );
- col.setBlue( ( col.blue()*comp + mix.blue()*opac ) / 100 );
- pal.setColor( QPalette::Button, col );
- if( tabButtonStyle() == KTinyTabBar::Flat )
- pal.setColor( QPalette::Background, col );
- }
- setPalette( pal );
- QPushButton::paintEvent( ev );
-
- break;
- }
- }
-}
-
-void KTinyTabButton::contextMenuEvent( QContextMenuEvent* ev )
-{
- QPixmap colorIcon( 22, 22 );
- QMenu menu( /*text(),*/ this );
- QMenu* colorMenu = menu.addMenu( i18n( "&Highlight Tab" ) );
- QAction* aNone = colorMenu->addAction( i18n( "&None" ) );
- colorMenu->addSeparator();
- colorIcon.fill( Qt::red );
- QAction* aRed = colorMenu->addAction( colorIcon, i18n( "&Red" ) );
- colorIcon.fill( Qt::yellow );
- QAction* aYellow = colorMenu->addAction( colorIcon, i18n( "&Yellow" ) );
- colorIcon.fill( Qt::green );
- QAction* aGreen = colorMenu->addAction( colorIcon, i18n( "&Green" ) );
- colorIcon.fill( Qt::cyan );
- QAction* aCyan = colorMenu->addAction( colorIcon, i18n( "&Cyan" ) );
- colorIcon.fill( Qt::blue );
- QAction* aBlue = colorMenu->addAction( colorIcon, i18n( "&Blue" ) );
- colorIcon.fill( Qt::magenta );
- QAction* aMagenta = colorMenu->addAction( colorIcon, i18n( "&Magenta" ) );
- colorMenu->addSeparator();
- QAction* aCustomColor = colorMenu->addAction(
- QIcon( SmallIcon( "colors" ) ), i18n( "C&ustom Color..." ) );
- menu.addSeparator();
-
- QAction* aCloseTab = menu.addAction( i18n( "&Close Tab" ) );
- QAction* aCloseOtherTabs = menu.addAction( i18n( "Close &Other Tabs" ) );
- QAction* aCloseAllTabs = menu.addAction( i18n( "Close &All Tabs" ) );
-
- QAction* choice = menu.exec( ev->globalPos() );
-
- // process the result
- if( choice == aNone ) {
- if( m_highlightColor.isValid() )
- {
- setHighlightColor( QColor() );
- emit highlightChanged( this );
- }
- } else if( choice == aRed ) {
- setHighlightColor( Qt::red );
- emit highlightChanged( this );
- } else if( choice == aYellow ) {
- setHighlightColor( Qt::yellow );
- emit highlightChanged( this );
- } else if( choice == aGreen ) {
- setHighlightColor( Qt::green );
- emit highlightChanged( this );
- } else if( choice == aCyan ) {
- setHighlightColor( Qt::cyan );
- emit highlightChanged( this );
- } else if( choice == aBlue ) {
- setHighlightColor( Qt::blue );
- emit highlightChanged( this );
- } else if( choice == aMagenta ) {
- setHighlightColor( Qt::magenta );
- emit highlightChanged( this );
- } else if( choice == aCustomColor ) {
- QColor newColor;
- int result = KColorDialog::getColor( newColor, m_highlightColor, this );
- if ( result == KColorDialog::Accepted )
- {
- setHighlightColor( newColor );
- emit highlightChanged( this );
- }
- } else if( choice == aCloseTab ) {
- emit closeRequest( this );
- } else if (choice == aCloseOtherTabs) {
- emit closeOtherTabsRequest (this);
- } else if (choice == aCloseAllTabs) {
- emit closeAllTabsRequest ();
- }
-
-}
-
-void KTinyTabButton::mousePressEvent( QMouseEvent* ev )
-{
- if (ev->button() == Qt::MidButton) {
- if (ev->modifiers() & Qt::ControlModifier) {
- // clear tab highlight
- setHighlightColor(QColor());
- } else {
- setHighlightColor(s_predefinedColors[s_currentColor]);
- if (++s_currentColor >= s_colorCount)
- s_currentColor = 0;
- }
- ev->accept();
- } else {
- QPushButton::mousePressEvent(ev);
- }
-}
-
-void KTinyTabButton::setButtonID( int button_id )
-{
- m_buttonId = button_id;
-}
-
-int KTinyTabButton::buttonID() const
-{
- return m_buttonId;
-}
-
-void KTinyTabButton::setHighlightColor( const QColor& color )
-{
- if( color.isValid() )
- {
- m_highlightColor = color;
- update();
- }
- else if( m_highlightColor.isValid() )
- {
- m_highlightColor = QColor();
- update();
- }
-}
-
-QColor KTinyTabButton::highlightColor() const
-{
- return m_highlightColor;
-}
-
-void KTinyTabButton::setTabButtonStyle( KTinyTabBar::ButtonStyle tabStyle )
-{
- if( m_tabButtonStyle == tabStyle )
- return;
-
- const bool flat = tabStyle == KTinyTabBar::Flat;
- setFlat( flat );
- setAutoFillBackground( flat );
- m_tabButtonStyle = tabStyle;
- update();
-}
-
-KTinyTabBar::ButtonStyle KTinyTabButton::tabButtonStyle() const
-{
- return m_tabButtonStyle;
-}
-
-void KTinyTabButton::setPreviousTab( bool previous )
-{
- m_isPreviousTab = previous;
- update();
-}
-
-bool KTinyTabButton::previousTab() const
-{
- return m_isPreviousTab;
-}
-
-void KTinyTabButton::setHighlightOpacity( int value )
-{
- m_highlightOpacity = value;
- update();
-}
-
-int KTinyTabButton::highlightOpacity() const
-{
- return m_highlightOpacity;
-}
-
-void KTinyTabButton::setHighlightActiveTab( bool value )
-{
- m_highlightActiveTab = value;
- update();
-}
-
-bool KTinyTabButton::highlightActiveTab()
-{
- return m_highlightActiveTab;
-}
-
-void KTinyTabButton::setHighlightPreviousTab( bool value )
-{
- m_highlightPreviousTab = value;
- update();
-}
-
-bool KTinyTabButton::highlightPreviousTab()
-{
- return m_highlightPreviousTab;
-}
-
-
-void KTinyTabButton::setPreviousTabColor( const QColor& color )
-{
- m_colorPreviousTab = color;
- if( highlightPreviousTab() )
- update();
-}
-
-QColor KTinyTabButton::previousTabColor() const
-{
- return m_colorPreviousTab;
-}
-
-void KTinyTabButton::setActiveTabColor( const QColor& color )
-{
- m_colorActiveTab = color;
- if( isActivated() )
- update();
-}
-
-QColor KTinyTabButton::activeTabColor() const
-{
- return m_colorActiveTab;
-}
-
-void KTinyTabButton::setHighlightModifiedTabs( bool highlight )
-{
- m_highlightModifiedTab = highlight;
- if( isModified() )
- update();
-}
-
-bool KTinyTabButton::highlightModifiedTabs() const
-{
- return m_highlightModifiedTab;
-}
-
-void KTinyTabButton::setModifiedTabsColor( const QColor& color )
-{
- m_colorModifiedTab = color;
- if( isModified() )
- update();
-}
-
-QColor KTinyTabButton::modifiedTabsColor() const
-{
- return m_colorModifiedTab;
-}
-
-
-void KTinyTabButton::setModified( bool modified )
-{
- m_modified = modified;
- update();
-}
-
-bool KTinyTabButton::isModified() const
-{
- return m_modified;
-}
-
-// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on; eol unix;
diff --git a/addons/kate/tabbarextension/ktinytabbutton.h b/addons/kate/tabbarextension/ktinytabbutton.h
deleted file mode 100644
index d34ebab..0000000
--- a/addons/kate/tabbarextension/ktinytabbutton.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/***************************************************************************
- ktinytabbutton.h
- -------------------
- begin : 2005-06-15
- copyright : (C) 2005 by Dominik Haumann
- email : dhdev@gmx.de
-
- Copyright (C) 2007 Flavio Castelli <flavio.castelli@gmail.com>
- ***************************************************************************/
-
-/***************************************************************************
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- ***************************************************************************/
-
-#ifndef TINYTABBUTTON_H
-#define TINYTABBUTTON_H
-
-#include <QPushButton>
-#include "ktinytabbar.h"
-
-
-/**
- * A \p KTinyTabButton represents a button on the tab bar. It can either be
- * \e activated or \e deactivated. If the state is \e deactivated it will
- * be @e activated when the mouse is pressed. It then emits the signal
- * @p activated(). The \p KTinyTabButton's caption can be set with \p setText()
- * and an additional pixmap can be shown with \p setPixmap().
- *
- * @author Dominik Haumann
- */
-class KTinyTabButton : public QPushButton
-{
-Q_OBJECT
-
-public:
- /**
- * Constructs a new tab bar button with \a caption and \a parent. If
- * \e blockContextMenu is \e false the context menu will be blocked, i.e.
- * hidden. If the @p docurl is unknown, pass QString().
- */
- KTinyTabButton( const QString& docurl, const QString& caption, int button_id,
- bool blockContextMenu = true, QWidget *parent = 0 );
-
- virtual ~KTinyTabButton();
-
- /**
- * Activate or deactivate the button. If the button is already down
- * and \a active is \e true nothing happens, otherwise the state toggles.
- * \note The signal \p activated is \e not emitted.
- */
- void setActivated( bool active );
-
- /**
- * Check the button status. The return value is \e true, if the button is
- * down.
- */
- bool isActivated() const;
-
- /**
- * Set a unique button id number.
- */
- void setButtonID( int button_id );
-
- /**
- * Get the unique id number.
- */
- int buttonID() const;
-
- /**
- * Set the document's url to @p docurl. If unknown, pass QString().
- */
- void setURL( const QString& docurl );
-
- /**
- * Get the document's url.
- */
- QString url() const;
-
- /**
- * Set the highlighted state. If @p color.isValid() is \e false the
- * button is not highlighted. This does \e not emit the signal
- * @p highlightChanged().
- * @param color the color
- */
- void setHighlightColor( const QColor& color );
-
- /**
- * Get the highlight color. If the button is not highlighted then the color
- * is invalid, i.e. \p QColor::isValid() returns \e flase.
- */
- QColor highlightColor() const;
-
- /**
- * Set the highlight opacity to @p value.
- * @param value opacity between 0..100
- */
- void setHighlightOpacity( int value );
-
- /**
- * Get the highlight opacity
- * @return opacity
- */
- int highlightOpacity() const;
-
- /**
- * Set whether the tab was previously selected.
- * @param previous truth vlaue
- */
- void setPreviousTab( bool previous );
-
- /**
- * Check whether the tab is the previously selected tab.
- * @return true, if tab was active before the current active tab
- */
- bool previousTab() const;
-
- /**
- * Set the tabbutton style.
- * @param tabStyle button style
- */
- void setTabButtonStyle( KTinyTabBar::ButtonStyle tabStyle );
-
- /**
- * Get the tabbutton style
- * @return button style
- */
- KTinyTabBar::ButtonStyle tabButtonStyle() const;
-
- /**
- * Set whether an active tab should be highlighted.
- */
- void setHighlightActiveTab( bool value );
- /**
- * Get whether an active tab should be highlighted.
- */
- bool highlightActiveTab();
-
- /**
- * Set whether a previous tab should be highlighted.
- */
- void setHighlightPreviousTab( bool value );
- /**
- * Get whether a previous tab is highlighted.
- */
- bool highlightPreviousTab();
-
- void setPreviousTabColor( const QColor& color );
- QColor previousTabColor() const;
-
- void setActiveTabColor( const QColor& color );
- QColor activeTabColor() const;
-
- void setHighlightModifiedTabs( bool highlight );
- bool highlightModifiedTabs() const;
-
- void setModifiedTabsColor( const QColor& color );
- QColor modifiedTabsColor() const;
-
- void setModified( bool modified );
- bool isModified() const;
-
-Q_SIGNALS:
- /**
- * Emitted whenever the button changes state from deactivated to activated.
- * @param tabbutton the pressed button (this)
- */
- void activated( KTinyTabButton* tabbutton );
-
- /**
- * Emitted whenever the user changes the highlighted state. This can be
- * done only via the context menu.
- * @param tabbutton the changed button (this)
- */
- void highlightChanged( KTinyTabButton* tabbutton );
-
- /**
- * Emitted whenever the user wants to close the tab button.
- * @param tabbutton the button that emitted this signal
- */
- void closeRequest( KTinyTabButton* tabbutton );
-
- /**
- * Emitted whenever the user wants to close all the tab button except the
- * selected one.
- * @param tabbutton the button that emitted this signal
- */
- void closeOtherTabsRequest( KTinyTabButton* tabbutton );
-
- /**
- * Emitted whenever the user wants to close all the tabs.
- */
- void closeAllTabsRequest();
-
-protected Q_SLOTS:
- void buttonClicked();
-
-protected:
- /** paint eyecandy rectangles around the button */
- virtual void paintEvent( QPaintEvent* ev );
- /** support for context menu */
- virtual void contextMenuEvent( QContextMenuEvent* ev );
- /** middle mouse button changes color */
- virtual void mousePressEvent( QMouseEvent* ev );
-
-
-private:
- QString m_url;
- int m_buttonId;
- bool m_modified;
- bool m_highlightModifiedTab;
- bool m_highlightActiveTab;
- bool m_highlightPreviousTab;
- bool m_isPreviousTab;
-
- QColor m_colorModifiedTab;
- QColor m_colorActiveTab;
- QColor m_colorPreviousTab;
-
- QColor m_highlightColor;
- KTinyTabBar::ButtonStyle m_tabButtonStyle;
- int m_highlightOpacity;
-
- static QColor s_predefinedColors[6];
- static const int s_colorCount;
- static int s_currentColor;
-};
-
-#endif
-
-// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on; eol unix;
diff --git a/addons/kate/tabbarextension/plugin_katetabbarextension.cpp b/addons/kate/tabbarextension/plugin_katetabbarextension.cpp
deleted file mode 100644
index d83e5e5..0000000
--- a/addons/kate/tabbarextension/plugin_katetabbarextension.cpp
+++ /dev/null
@@ -1,292 +0,0 @@
-/***************************************************************************
- plugin_katetabbarextension.cpp
- -------------------
- begin : 2004-04-20
- copyright : (C) 2004-2005 by Dominik Haumann
- email : dhdev@gmx.de
- ***************************************************************************/
-
-/***************************************************************************
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- ***************************************************************************/
-
-
-//BEGIN INCLUDES
-#include "plugin_katetabbarextension.h"
-#include "ktinytabbar.h"
-
-#include <kate/documentmanager.h>
-#include <kate/application.h>
-
-#include <klocalizedstring.h>
-#include <kpluginfactory.h>
-#include <kpluginloader.h>
-#include <kaboutdata.h>
-
-
-#include <QBoxLayout>
-//END
-
-
-K_PLUGIN_FACTORY(KateTabBarExtensionFactory, registerPlugin<KatePluginTabBarExtension>();)
-K_EXPORT_PLUGIN(KateTabBarExtensionFactory(KAboutData("katetabbarextension","katetabbarextension",ki18n("TabBarExtension"), "0.1", ki18n("TabBar extension"), KAboutData::License_LGPL_V2)) )
-
-
-//BEGIN PluginView
-PluginView::PluginView( Kate::MainWindow* mainwindow )
- : Kate::PluginView( mainwindow )
-{
- tabbar = new KTinyTabBar( mainWindow()->centralWidget() );
-
- QBoxLayout* layout = qobject_cast<QBoxLayout*>(mainWindow()->centralWidget()->layout());
- layout->insertWidget( 0, tabbar );
-
- connect( Kate::application()->documentManager(), SIGNAL(documentCreated(KTextEditor::Document*)),
- this, SLOT(slotDocumentCreated(KTextEditor::Document*)) );
- connect( Kate::application()->documentManager(), SIGNAL(documentDeleted(KTextEditor::Document*)),
- this, SLOT(slotDocumentDeleted(KTextEditor::Document*)) );
- connect( mainWindow(), SIGNAL(viewChanged(KTextEditor::View *)),
- this, SLOT(slotViewChanged()) );
-
- connect( tabbar, SIGNAL(currentChanged(int)),
- this, SLOT(currentTabChanged(int)) );
- connect( tabbar, SIGNAL(closeRequest(int)),
- this, SLOT(closeTabRequest(int)) );
-
- // add already existing documents
- foreach( KTextEditor::Document* doc, Kate::application()->documentManager()->documents() )
- slotDocumentCreated( doc );
-}
-
-PluginView::~PluginView()
-{
- delete tabbar;
-}
-
-void PluginView::readSessionConfig (KConfigBase* config, const QString& groupPrefix)
-{
- tabbar->load( config, groupPrefix + ":view" );
- updateLocation();
-}
-
-void PluginView::writeSessionConfig (KConfigBase* config, const QString& groupPrefix)
-{
- tabbar->save( config, groupPrefix + ":view" );
-}
-
-void PluginView::updateLocation()
-{
- QBoxLayout* layout = qobject_cast<QBoxLayout*>(mainWindow()->centralWidget()->layout());
- if( !layout ) return;
-
- layout->removeWidget( tabbar );
- layout->insertWidget( tabbar->locationTop()?0:-1, tabbar );
-}
-
-
-void PluginView::currentTabChanged( int button_id )
-{
- mainWindow()->activateView( id2doc[button_id] );
-}
-
-void PluginView::closeTabRequest( int button_id )
-{
- Kate::application()->documentManager()->closeDocument( id2doc[button_id] );
-}
-
-void PluginView::slotDocumentCreated( KTextEditor::Document* document )
-{
- if( !document )
- return;
-
- connect( document, SIGNAL(modifiedChanged(KTextEditor::Document*)),
- this, SLOT(slotDocumentChanged(KTextEditor::Document*)) );
- connect( document, SIGNAL( modifiedOnDisk( KTextEditor::Document*, bool,
- KTextEditor::ModificationInterface::ModifiedOnDiskReason ) ),
- this, SLOT( slotModifiedOnDisc( KTextEditor::Document*, bool,
- KTextEditor::ModificationInterface::ModifiedOnDiskReason ) ) );
- connect( document, SIGNAL(documentNameChanged(KTextEditor::Document*)),
- this, SLOT(slotNameChanged(KTextEditor::Document*)) );
-
-
- int tabID = tabbar->addTab( document->url().prettyUrl(), document->documentName() );
- id2doc[tabID] = document;
- doc2id[document] = tabID;
-}
-
-void PluginView::slotDocumentDeleted( KTextEditor::Document* document )
-{
- // qDebug() << "slotDocumentDeleted ";
- int tabID = doc2id[document];
-
- tabbar->removeTab( tabID );
- doc2id.remove( document );
- id2doc.remove( tabID );
-}
-
-void PluginView::slotViewChanged()
-{
- KTextEditor::View *view = mainWindow()->activeView();
- if( !view )
- return;
-
- int tabID = doc2id[view->document()];
- tabbar->setCurrentTab( tabID );
-}
-
-void PluginView::slotDocumentChanged( KTextEditor::Document* document )
-{
- if( !document )
- return;
-
- int tabID = doc2id[document];
- if( document->isModified() )
- tabbar->setTabIcon( tabID, KIconLoader::global()
- ->loadIcon( "document-save", KIconLoader::Small, 16 ) );
- else
- tabbar->setTabIcon( tabID, QIcon() );
-
- tabbar->setTabModified( tabID, document->isModified() );
-}
-
-void PluginView::slotNameChanged( KTextEditor::Document* document )
-{
- if( !document )
- return;
-
- int tabID = doc2id[document];
- tabbar->setTabText( tabID, document->documentName() );
- if( document->url().prettyUrl() != tabbar->tabURL( tabID ) )
- tabbar->setTabURL( tabID, document->url().prettyUrl() );
-}
-
-void PluginView::slotModifiedOnDisc( KTextEditor::Document* document, bool modified,
- KTextEditor::ModificationInterface::ModifiedOnDiskReason reason )
-{
- qDebug() << "modified: " << modified << ", id: " << reason;
- int tabID = doc2id[document];
- if( !modified )
- {
- tabbar->setTabIcon( tabID, QIcon() );
- tabbar->setTabModified( tabID, false );
- }
- else
- {
- // NOTE: right now the size 16 pixel is hard coded. If I omit the size
- // parameter it would use KDE defaults. So if a user requests standard
- // sized icons (because he changed his KDE defaults) the solution is to
- // omit the parameter.
- switch( reason )
- {
- case KTextEditor::ModificationInterface::OnDiskModified:
- tabbar->setTabIcon( tabID, KIconLoader::global()
- ->loadIcon( "dialog-warning", KIconLoader::Small, 16 ) );
- break;
- case KTextEditor::ModificationInterface::OnDiskCreated:
- tabbar->setTabIcon( tabID, KIconLoader::global()
- ->loadIcon( "document-save", KIconLoader::Small, 16 ) );
- break;
- case KTextEditor::ModificationInterface::OnDiskDeleted:
- tabbar->setTabIcon( tabID, KIconLoader::global()
- ->loadIcon( "dialog-warning", KIconLoader::Small, 16 ) );
- break;
- default:
- tabbar->setTabIcon( tabID, KIconLoader::global()
- ->loadIcon( "dialog-warning", KIconLoader::Small, 16 ) );
- }
-
- tabbar->setTabModified( tabID, true );
- }
-}
-//END PluginView
-
-
-
-//BEGIN KatePluginTabBarExtension
-KatePluginTabBarExtension::KatePluginTabBarExtension(
- QObject* parent, const QList<QVariant>& )
- : Kate::Plugin ( (Kate::Application*)parent)
-{
-}
-
-KatePluginTabBarExtension::~KatePluginTabBarExtension()
-{
-}
-
-Kate::PluginView *KatePluginTabBarExtension::createView (Kate::MainWindow *mainWindow)
-{
- PluginView *view = new PluginView( mainWindow );
- connect( view->tabbar, SIGNAL(settingsChanged(KTinyTabBar*)),
- this, SLOT(tabbarSettingsChanged(KTinyTabBar*)) );
- connect( view->tabbar, SIGNAL(highlightMarksChanged(KTinyTabBar*)),
- this, SLOT(tabbarHighlightMarksChanged(KTinyTabBar*)) );
- m_views.append( view );
- return view;
-}
-
-
-void KatePluginTabBarExtension::readSessionConfig (KConfigBase* /*config*/, const QString& /*groupPrefix*/)
-{
-}
-
-void KatePluginTabBarExtension::writeSessionConfig (KConfigBase* /*config*/, const QString& /*groupPrefix*/)
-{
-}
-
-void KatePluginTabBarExtension::tabbarHighlightMarksChanged( KTinyTabBar* tabbar )
-{
- // synchronize all tabbars
- foreach( PluginView* view, m_views )
- {
- view->updateLocation();
- if( view->tabbar != tabbar )
- {
- view->tabbar->setHighlightMarks( tabbar->highlightMarks() );
- }
- }
-}
-
-void KatePluginTabBarExtension::tabbarSettingsChanged( KTinyTabBar* tabbar )
-{
- // synchronize all tabbars
- foreach( PluginView* view, m_views )
- {
- view->updateLocation();
- if( view->tabbar != tabbar )
- {
- view->tabbar->setLocationTop( tabbar->locationTop() );
- view->updateLocation();
- view->tabbar->setNumRows( tabbar->numRows() );
- view->tabbar->setMinimumTabWidth( tabbar->minimumTabWidth() );
- view->tabbar->setMaximumTabWidth( tabbar->maximumTabWidth() );
- view->tabbar->setTabHeight( tabbar->tabHeight() );
- view->tabbar->setTabButtonStyle( tabbar->tabButtonStyle() );
- view->tabbar->setFollowCurrentTab( tabbar->followCurrentTab() );
- view->tabbar->setTabSortType( tabbar->tabSortType() );
- view->tabbar->setHighlightModifiedTabs( tabbar->highlightModifiedTabs() );
- view->tabbar->setHighlightActiveTab( tabbar->highlightActiveTab() );
- view->tabbar->setHighlightPreviousTab( tabbar->highlightPreviousTab() );
- view->tabbar->setHighlightOpacity( tabbar->highlightOpacity() );
- view->tabbar->setModifiedTabsColor( tabbar->modifiedTabsColor() );
- view->tabbar->setActiveTabColor( tabbar->activeTabColor() );
- view->tabbar->setPreviousTabColor( tabbar->previousTabColor() );
- }
- }
-}
-//END KatePluginTabBarExtension
-
-#include "plugin_katetabbarextension.moc"
-
-// kate: space-indent on; indent-width 2; tab-width 4; replace-tabs off; eol unix;
diff --git a/addons/kate/tabbarextension/plugin_katetabbarextension.h b/addons/kate/tabbarextension/plugin_katetabbarextension.h
deleted file mode 100644
index ce49494..0000000
--- a/addons/kate/tabbarextension/plugin_katetabbarextension.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/***************************************************************************
- plugin_katetabbarextension.h
- -------------------
- begin : 2004-04-20
- copyright : (C) 2004-2005 by Dominik Haumann
- email : dhdev@gmx.de
- ***************************************************************************/
-
-/***************************************************************************
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- ***************************************************************************/
-
-#ifndef PLUGIN_KATETABBAREXTENSION_H
-#define PLUGIN_KATETABBAREXTENSION_H
-
-#include <kate/application.h>
-#include <kate/documentmanager.h>
-#include <kate/mainwindow.h>
-#include <kate/plugin.h>
-
-#include <ktexteditor/document.h>
-#include <ktexteditor/view.h>
-#include <ktexteditor/modificationinterface.h>
-
-#include <klocalizedstring.h>
-#include <ktoolbar.h>
-
-#include <qpushbutton.h>
-#include <QMap>
-#include <QList>
-
-class KateTabBarExtension;
-class KTinyTabBar;
-
-class PluginView : public Kate::PluginView
-{
- Q_OBJECT
- friend class KatePluginTabBarExtension;
-
-public:
- PluginView( Kate::MainWindow* mainwindow );
- virtual ~PluginView();
-
- void updateLocation();
-
- void readSessionConfig (KConfigBase* config, const QString& groupPrefix);
- void writeSessionConfig (KConfigBase* config, const QString& groupPrefix);
-
-public Q_SLOTS:
- void currentTabChanged( int button_id );
- void closeTabRequest( int button_id );
- void slotDocumentCreated( KTextEditor::Document* document );
- void slotDocumentDeleted( KTextEditor::Document* document );
- void slotViewChanged();
- void slotDocumentChanged( KTextEditor::Document* );
- void slotModifiedOnDisc( KTextEditor::Document* document, bool modified,
- KTextEditor::ModificationInterface::ModifiedOnDiskReason reason );
- void slotNameChanged( KTextEditor::Document* document );
-
-private:
- KTinyTabBar* tabbar;
- QMap<int, KTextEditor::Document*> id2doc;
- QMap<KTextEditor::Document*, int> doc2id;
-};
-
-class KatePluginTabBarExtension : public Kate::Plugin
-{
- Q_OBJECT
-
- public:
- explicit KatePluginTabBarExtension( QObject* parent = 0, const QList<QVariant>& = QList<QVariant>() );
- virtual ~KatePluginTabBarExtension();
-
- Kate::PluginView *createView (Kate::MainWindow *mainWindow);
-
- void readSessionConfig (KConfigBase* config, const QString& groupPrefix);
- void writeSessionConfig (KConfigBase* config, const QString& groupPrefix);
-
- protected Q_SLOTS:
- void tabbarSettingsChanged( KTinyTabBar* tabbar );
- void tabbarHighlightMarksChanged( KTinyTabBar* tabbar );
-
- private:
- QList<PluginView*> m_views;
-};
-
-#endif // PLUGIN_KATETABBAREXTENSION_H
diff --git a/addons/kate/tabbarextension/tabbarconfigwidget.ui b/addons/kate/tabbarextension/tabbarconfigwidget.ui
deleted file mode 100644
index 42791e2..0000000
--- a/addons/kate/tabbarextension/tabbarconfigwidget.ui
+++ /dev/null
@@ -1,496 +0,0 @@
-<ui version="4.0" >
- <class>TabBarConfigWidget</class>
- <widget class="QWidget" name="TabBarConfigWidget" >
- <layout class="QGridLayout" name="gridLayout_4" >
- <item row="0" column="0" >
- <widget class="QGroupBox" name="gbBehaviour" >
- <property name="title" >
- <string>Behavior</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_2" >
- <item row="0" column="0" >
- <widget class="QLabel" name="lblLocation" >
- <property name="text" >
- <string>Location:</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QComboBox" name="cmbLocation" >
- <item>
- <property name="text" >
- <string comment="Tab bar location">Top</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string comment="Tab bar location">Bottom</string>
- </property>
- </item>
- </widget>
- </item>
- <item rowspan="2" row="0" column="2" >
- <spacer name="horizontalSpacer_3" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::MinimumExpanding</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>98</width>
- <height>53</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="0" >
- <widget class="QLabel" name="lblRows" >
- <property name="text" >
- <string>Rows:</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="1" column="1" >
- <widget class="QSpinBox" name="sbRows" >
- <property name="suffix" >
- <string> rows</string>
- </property>
- <property name="minimum" >
- <number>1</number>
- </property>
- <property name="maximum" >
- <number>10</number>
- </property>
- </widget>
- </item>
- <item row="3" column="0" >
- <widget class="QLabel" name="lblSorting" >
- <property name="text" >
- <string>Sorting:</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="2" column="1" colspan="2" >
- <layout class="QHBoxLayout" name="horizontalLayout_2" >
- <item>
- <widget class="QCheckBox" name="chkFollowActive" >
- <property name="text" >
- <string>Keep activated tab visible</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_4" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::MinimumExpanding</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>0</width>
- <height>28</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item row="3" column="1" colspan="2" >
- <layout class="QHBoxLayout" name="horizontalLayout" >
- <item>
- <widget class="QComboBox" name="cmbSorting" >
- <item>
- <property name="text" >
- <string>Opening Order</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Document Name</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Document URL</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>File Extension</string>
- </property>
- </item>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_2" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::MinimumExpanding</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>0</width>
- <height>17</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QGroupBox" name="gbTabs" >
- <property name="title" >
- <string>Tabs</string>
- </property>
- <layout class="QGridLayout" name="gridLayout" >
- <item row="1" column="0" >
- <widget class="QLabel" name="lblMinWidth" >
- <property name="text" >
- <string>Minimum width:</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="1" column="1" >
- <widget class="QSpinBox" name="sbMinWidth" >
- <property name="suffix" >
- <string> pixels</string>
- </property>
- <property name="minimum" >
- <number>20</number>
- </property>
- <property name="maximum" >
- <number>500</number>
- </property>
- </widget>
- </item>
- <item rowspan="3" row="1" column="2" >
- <spacer name="horizontalSpacer" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>11</width>
- <height>96</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="2" column="0" >
- <widget class="QLabel" name="lblMaxWidth" >
- <property name="text" >
- <string>Maximum width:</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="2" column="1" >
- <widget class="QSpinBox" name="sbMaxWidth" >
- <property name="text" stdset="0" >
- <string>20 pixels</string>
- </property>
- <property name="suffix" >
- <string> pixels</string>
- </property>
- <property name="minimum" >
- <number>20</number>
- </property>
- <property name="maximum" >
- <number>500</number>
- </property>
- </widget>
- </item>
- <item row="3" column="0" >
- <widget class="QLabel" name="lblHeight" >
- <property name="text" >
- <string>Height:</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="3" column="1" >
- <widget class="QSpinBox" name="sbHeight" >
- <property name="text" stdset="0" >
- <string>16 pixels</string>
- </property>
- <property name="suffix" >
- <string> pixels</string>
- </property>
- <property name="minimum" >
- <number>16</number>
- </property>
- <property name="maximum" >
- <number>60</number>
- </property>
- </widget>
- </item>
- <item row="0" column="0" >
- <widget class="QLabel" name="lblStyle" >
- <property name="text" >
- <string>Style:</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QComboBox" name="cmbStyle" >
- <item>
- <property name="text" >
- <string>Buttons</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Flat</string>
- </property>
- </item>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="1" column="0" colspan="2" >
- <widget class="QGroupBox" name="gbHighlighting" >
- <property name="title" >
- <string>Highlighting</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout" >
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_3" >
- <item>
- <layout class="QGridLayout" name="gridLayout_3" >
- <item row="0" column="0" >
- <widget class="KColorButton" name="colModified" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QCheckBox" name="chkModified" >
- <property name="text" >
- <string>Highlight modified tabs</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0" >
- <widget class="KColorButton" name="colActive" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1" >
- <widget class="QCheckBox" name="chkActive" >
- <property name="text" >
- <string>Highlight active tab</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0" >
- <widget class="KColorButton" name="colPrevious" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="1" >
- <widget class="QCheckBox" name="chkPrevious" >
- <property name="text" >
- <string>Highlight previous tab</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0" >
- <widget class="QLabel" name="lblOpacity" >
- <property name="text" >
- <string>Opacity:</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="3" column="1" >
- <widget class="QSlider" name="slOpacity" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="maximum" >
- <number>100</number>
- </property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <spacer name="horizontalSpacer_5" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>241</width>
- <height>108</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_4" >
- <item>
- <widget class="QLabel" name="lblNote" >
- <property name="text" >
- <string>Note: Use the context menu to highlight a tab</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_7" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>0</width>
- <height>13</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="btnClearCache" >
- <property name="whatsThis" >
- <string>Remove all highlight marks in the current session.</string>
- </property>
- <property name="text" >
- <string>Clear Highlight Cache</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item row="2" column="0" colspan="2" >
- <widget class="QGroupBox" name="gbPreview" >
- <property name="title" >
- <string>Preview</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <customwidgets>
- <customwidget>
- <class>KColorButton</class>
- <extends>QPushButton</extends>
- <header>kcolorbutton.h</header>
- </customwidget>
- </customwidgets>
- <tabstops>
- <tabstop>cmbLocation</tabstop>
- <tabstop>sbRows</tabstop>
- <tabstop>chkFollowActive</tabstop>
- <tabstop>cmbSorting</tabstop>
- <tabstop>cmbStyle</tabstop>
- <tabstop>sbMinWidth</tabstop>
- <tabstop>sbMaxWidth</tabstop>
- <tabstop>sbHeight</tabstop>
- <tabstop>chkModified</tabstop>
- <tabstop>colModified</tabstop>
- <tabstop>chkActive</tabstop>
- <tabstop>colActive</tabstop>
- <tabstop>chkPrevious</tabstop>
- <tabstop>colPrevious</tabstop>
- <tabstop>slOpacity</tabstop>
- <tabstop>btnClearCache</tabstop>
- </tabstops>
- <resources/>
- <connections>
- <connection>
- <sender>chkModified</sender>
- <signal>toggled(bool)</signal>
- <receiver>colModified</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>111</x>
- <y>237</y>
- </hint>
- <hint type="destinationlabel" >
- <x>50</x>
- <y>238</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>chkActive</sender>
- <signal>toggled(bool)</signal>
- <receiver>colActive</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>96</x>
- <y>273</y>
- </hint>
- <hint type="destinationlabel" >
- <x>55</x>
- <y>268</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>chkPrevious</sender>
- <signal>toggled(bool)</signal>
- <receiver>colPrevious</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>84</x>
- <y>297</y>
- </hint>
- <hint type="destinationlabel" >
- <x>60</x>
- <y>303</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
diff --git a/addons/kate/tabbarextension/ui.rc b/addons/kate/tabbarextension/ui.rc
deleted file mode 100644
index 953a812..0000000
--- a/addons/kate/tabbarextension/ui.rc
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE kpartgui>
-<gui name="tabbarextension" library="katetabbarextensionplugin" version="1">
-<ToolBar name="tabbarExtensionToolBar">
- <text>Tab Bar Extension</text>
- <Action name="tabbar_widget"/>
-</ToolBar>
-</gui>
diff --git a/addons/kate/tabify/CMakeLists.txt b/addons/kate/tabify/CMakeLists.txt
deleted file mode 100644
index 6892be2..0000000
--- a/addons/kate/tabify/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-find_package(KDE4 REQUIRED)
-include (KDE4Defaults)
-include_directories(${KDE4_INCLUDES})
-
-kde4_add_plugin(katetabifyplugin tabify.cpp)
-
-target_link_libraries(katetabifyplugin ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS} kateinterfaces)
-
-install(TARGETS katetabifyplugin DESTINATION ${PLUGIN_INSTALL_DIR})
-
-####################### install files #########################################
-install(FILES ui.rc DESTINATION ${DATA_INSTALL_DIR}/kate/plugins/katetabify)
-install(FILES katetabifyplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR})
diff --git a/addons/kate/tabify/Messages.sh b/addons/kate/tabify/Messages.sh
deleted file mode 100644
index de3a888..0000000
--- a/addons/kate/tabify/Messages.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-$EXTRACTRC *.rc >> rc.cpp
-$XGETTEXT *.cpp -o $podir/katetabifyplugin.pot
diff --git a/addons/kate/tabify/katetabifyplugin.desktop b/addons/kate/tabify/katetabifyplugin.desktop
deleted file mode 100644
index c9baa51..0000000
--- a/addons/kate/tabify/katetabifyplugin.desktop
+++ /dev/null
@@ -1,112 +0,0 @@
-[Desktop Entry]
-X-Kate-Version=2.8
-X-KDE-Library=katetabifyplugin
-ServiceTypes=Kate/Plugin
-Type=Service
-Icon=korganizer
-Name=Tab Bar
-Name[ast]=Barra de llingüetes
-Name[bg]=Лента с подпрозорци
-Name[bs]=Traka kartica
-Name[ca]=Barra de pestanyes
-Name[ca@valencia]=Barra de pestanyes
-Name[cs]=Lišta karet
-Name[da]=Fanebladslinje
-Name[de]=Unterfensterleiste
-Name[el]=Γραμμή καρτελών
-Name[en_GB]=Tab Bar
-Name[es]=Barra de pestañas
-Name[et]=Kaardiriba
-Name[eu]=Fitxa-barra
-Name[fi]=Välilehtipalkki
-Name[fr]=Barre d'onglets
-Name[ga]=Barra Cluaisíní
-Name[gl]=Barra de lapelas
-Name[hu]=Lapozósáv
-Name[ia]=Barra de Scheda
-Name[it]=Barra di schede
-Name[ja]=タブバー
-Name[kk]=Қойынды жиегі
-Name[km]=របារ​ផ្ទាំង​
-Name[ko]=탭 표시줄
-Name[lt]=Kortelių juosta
-Name[lv]=Ciļņu josla
-Name[mai]=टैब पट्टी
-Name[mr]=टॅब पट्टी
-Name[nb]=Fanelinje
-Name[nds]=Paneelbalken
-Name[nl]=Tabbladbalk
-Name[nn]=Fanelinje
-Name[pa]=ਟੈਬ ਬਾਰ
-Name[pl]=Pasek kart
-Name[pt]=Barra de Páginas
-Name[pt_BR]=Barra de abas
-Name[ro]=Bară de file
-Name[ru]=Панель вкладок
-Name[si]=ටැබ් තීරුව
-Name[sk]=Panel kariet
-Name[sl]=Vrstica z zavihki
-Name[sr]=Трака језичака
-Name[sr@ijekavian]=Трака језичака
-Name[sr@ijekavianlatin]=Traka jezičaka
-Name[sr@latin]=Traka jezičaka
-Name[sv]=Flikrad
-Name[tg]=Панели замима
-Name[tr]=Sekme Çubuğu
-Name[ug]=بەتكۈچ بالداق
-Name[uk]=Панель вкладок
-Name[x-test]=xxTab Barxx
-Name[zh_CN]=标签栏
-Name[zh_TW]=分頁列
-Comment=Adds a standard tab bar to Kate's main window
-Comment[bg]=Добавяне на стандартна лента с подпрозорци към основния прозорец на Kate
-Comment[bs]=Dodaje traku sa karticama u glavni prozor Kate
-Comment[ca]=Afegeix una barra de pestanyes estàndard a la finestra principal del Kate
-Comment[ca@valencia]=Afig una barra de pestanyes estàndard a la finestra principal del Kate
-Comment[cs]=Přidá do hlavního okna Kate standardní pruh karet
-Comment[da]=Føjer en standard fanebladslinje til Kates hovedvindue
-Comment[de]=Fügt dem Hauptfenster von Kate eine normale Unterfensterleiste hinzu
-Comment[el]=Προσθέτει μια τυπική γραμμή καρτελών στο κύριο παράθυρο του Kate
-Comment[es]=Añade una barra de pestañas estándar a la ventana principal de Kate
-Comment[et]=Lisab Kate peaaknasse standardse kaardiriba
-Comment[eu]=Fitxa-barra estandarra gehitzen dio Kate-ren leiho nagusiari
-Comment[fi]=Lisää standardin välilehtipalkin Katen pääikkunaan
-Comment[fr]=Ajoute une barre standard d'onglets à la fenêtre principale de Kate
-Comment[ga]=Cuir barra cluaisíní caighdeánach le príomhfhuinneog Kate
-Comment[gl]=Engade unha barra con lapelas á xanela principal de Kate
-Comment[hu]=Lapozósáv hozzáadása a Kate főablakához
-Comment[ia]=Adde un barra de scheda standard a fenestra principal de Kate
-Comment[it]=Aggiunge una barra di schede standard alla finestra principale di Kate
-Comment[ja]=Kate のメインウィンドウに標準のタブバーを追加します
-Comment[kk]=Kate-тің негізгі терезесіне стандартты қойындысын қосу
-Comment[km]=បន្ថែម​របារ​​ផ្ទាំង​ទៅ​​ស្តង់ដារ​ទៅ​បង្អួច​មេ​របស់ Kate
-Comment[ko]=Kate의 주 창에 탭 표시줄 추가
-Comment[lt]=Įdeda standartinę kortelių juostą į Kate langą
-Comment[lv]=Pievieno standarta ciļņu joslu Kate galvenajam logam
-Comment[mr]=केटच्या मुख्य चौकटीत प्रमाणित टॅब पट्टी जोडतो
-Comment[nb]=Legger til en standard fanelinje i Kates hovedvindu
-Comment[nds]=Föögt Kate sien Hööftfinster en Standard-Paneelbalken to
-Comment[nl]=Voegt een standaard tabbladbalk toe aan Kate's hoofdvenster
-Comment[nn]=Legg ei fanelinje til hovudvindauget i Kate
-Comment[pa]=ਕੇਟ ਦੀ ਮੇਨ ਵਿੰਡੋ ਵਿੱਚ ਸਟੈਂਡਰਡ ਟੈਬ ਬਾਰ ਸ਼ਾਮਲ ਕਰੋ
-Comment[pl]=Dodaje standardowy pasek kart do głównego okna Kate
-Comment[pt]=Adiciona uma barra de páginas normal à janela principal do Kate
-Comment[pt_BR]=Adiciona uma barra de abas padrão à janela principal do Kate
-Comment[ro]=Adaugă o bară de file standard la fereastra principală Kate
-Comment[ru]=Добавляет стандартную панель вкладок в окно Kate
-Comment[si]=Kate හි ප්‍රධාන කවුළුවට සම්මත ටැබ් තීරුව එක්කරයි
-Comment[sk]=Pridá štandardný panel kariet na hlavné okno Kate
-Comment[sl]=Doda vrstico z zavihki v glavno okno urejevalnika Kate
-Comment[sr]=Додаје уобичајену траку језичака у главни прозор Кејт
-Comment[sr@ijekavian]=Додаје уобичајену траку језичака у главни прозор Кејт
-Comment[sr@ijekavianlatin]=Dodaje uobičajenu traku jezičaka u glavni prozor Kate
-Comment[sr@latin]=Dodaje uobičajenu traku jezičaka u glavni prozor Kate
-Comment[sv]=Lägger till en vanlig flikrad i Kates huvudfönster
-Comment[tg]=Панели стандартиро ба тирезаи асосии барномаи Kate илова мекунад
-Comment[tr]=Kate uygulamasının ana penceresine standart bir sekme çubuğu ekler
-Comment[ug]=ئۆلچەملىك بەتكۈچ بالداقتىن بىرنى Kate نىڭ ئاساسىي كۆزنىكىگە قوشىدۇ
-Comment[uk]=Додає стандартну смужку вкладок до головного вікна Kate
-Comment[x-test]=xxAdds a standard tab bar to Kate's main windowxx
-Comment[zh_CN]=在 Kate 主窗口上添加一个标准标签栏
-Comment[zh_TW]=在 Kate 主視窗中加入標準分頁列
-author=Abhishek Patil, abhishekworld@gmail.com
diff --git a/addons/kate/tabify/tabify.cpp b/addons/kate/tabify/tabify.cpp
deleted file mode 100644
index ab91476..0000000
--- a/addons/kate/tabify/tabify.cpp
+++ /dev/null
@@ -1,265 +0,0 @@
-/***************************************************************************
-* Copyright (C) 2010 by Abhishek Patil <abhishekworld@gmail.com> *
-* *
-* This program is free software; you can redistribute it and/or modify *
-* it under the terms of the GNU General Public License as published by *
-* the Free Software Foundation; either version 2 of the License, or *
-* (at your option) any later version. *
-* *
-* This program is distributed in the hope that it will be useful, *
-* but WITHOUT ANY WARRANTY; without even the implied warranty of *
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
-* GNU General Public License for more details. *
-* *
-* You should have received a copy of the GNU General Public License *
-* along with this program; if not, write to the *
-* Free Software Foundation, Inc., *
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
-***************************************************************************/
-#include "tabify.h"
-#include <kate/documentmanager.h>
-#include <kate/application.h>
-
-#include <kacceleratormanager.h>
-#include <QAction>
-#include <klocalizedstring.h>
-#include <kstandarddirs.h>
-#include <kglobalsettings.h>
-#include <kpluginfactory.h>
-#include <kpluginloader.h>
-#include <kaboutdata.h>
-
-#include <kiconloader.h>
-#include <ktabbar.h>
-#include <QtGui/QBoxLayout>
-
-K_PLUGIN_FACTORY(TabBarFactory, registerPlugin<TabBarPlugin>();)
-K_EXPORT_PLUGIN(TabBarFactory(KAboutData("tabifyplugin", "katetabifyplugin",
- ki18n("TabifyPlugin"), "0.1", ki18n("Tabify Plugin"), KAboutData::License_LGPL_V2)))
-
-///////////////////////////////////////////////////////////////////////////////
-// TabBarPluginView
-///////////////////////////////////////////////////////////////////////////////
-TabBarPluginView::TabBarPluginView(Kate::MainWindow* mainwindow)
- : Kate::PluginView(mainwindow)
-{
- m_tabBar = new KTabBar(mainWindow()->centralWidget());
- KAcceleratorManager::setNoAccel(m_tabBar);
-
- m_tabIsDeleting = false;
-
- m_tabBar->setTabsClosable(true);
- m_tabBar->setDocumentMode(true);
- m_tabBar->setMovable(true);
-
- QBoxLayout* layout = qobject_cast<QBoxLayout*>(mainWindow()->centralWidget()->layout());
- layout->insertWidget(0, m_tabBar);
-
- connect(Kate::application()->documentManager(), SIGNAL(documentCreated(KTextEditor::Document*)),
- this, SLOT(slotDocumentCreated(KTextEditor::Document*)));
- connect(Kate::application()->documentManager(), SIGNAL(documentDeleted(KTextEditor::Document*)),
- this, SLOT(slotDocumentDeleted(KTextEditor::Document*)));
- connect(mainWindow(), SIGNAL(viewChanged(KTextEditor::View *)),
- this, SLOT(slotViewChanged()));
-
- connect(m_tabBar, SIGNAL(currentChanged(int)), this, SLOT(slotTabChanged(int)));
- connect(m_tabBar, SIGNAL(closeRequest(int)), this, SLOT(slotTabCloseRequest(int)));
- connect(m_tabBar, SIGNAL(mouseMiddleClick(int)), this, SLOT(slotMiddleMouseButtonPressed(int)));
- connect(m_tabBar, SIGNAL(wheelDelta(int)), this, SLOT(slotWheelDelta(int)));
- connect(m_tabBar, SIGNAL(tabMoved(int,int)), this, SLOT(slotTabMoved(int,int)));
-
- foreach(KTextEditor::Document* document, Kate::application()->documentManager()->documents()) {
- slotDocumentCreated(document);
- }
-}
-
-TabBarPluginView::~TabBarPluginView()
-{
- delete m_tabBar;
-}
-
-void TabBarPluginView::slotDocumentCreated(KTextEditor::Document* document)
-{
- if (!document)
- return;
-
- connect(document, SIGNAL(modifiedChanged(KTextEditor::Document*)),
- this, SLOT(slotDocumentChanged(KTextEditor::Document*)));
- connect(document, SIGNAL(modifiedOnDisk(KTextEditor::Document*, bool,
- KTextEditor::ModificationInterface::ModifiedOnDiskReason)),
- this, SLOT(slotModifiedOnDisc(KTextEditor::Document*, bool,
- KTextEditor::ModificationInterface::ModifiedOnDiskReason)));
- connect(document, SIGNAL(documentNameChanged(KTextEditor::Document*)),
- this, SLOT(slotNameChanged(KTextEditor::Document*)));
-
- int index = m_tabBar->addTab(document->documentName());
- m_tabBar->setTabToolTip(index, document->url().pathOrUrl());
- m_tabDocMap[index] = document;
- m_docTabMap[document] = index;
- m_docList.append(document);
- m_modifiedMap[document] = false;
-}
-
-void TabBarPluginView::slotTabChanged(int index)
-{
- if (m_tabIsDeleting) {
- return;
- }
-
- mainWindow()->activateView(m_tabDocMap[index]);
-}
-
-void TabBarPluginView::slotDocumentDeleted(KTextEditor::Document* document)
-{
- const int index = m_docTabMap[document];
- m_docTabMap.remove(document);
- m_tabDocMap.remove(index);
- m_modifiedMap.remove(document);
- m_docList.removeAll(document);
-
- m_tabIsDeleting = true;
- m_tabBar->removeTab(index);
- m_tabIsDeleting = false;
-
- // Rebuild the maps using the new state of the list.
- rebuildMaps();
-}
-
-void TabBarPluginView::slotViewChanged()
-{
- if (m_tabIsDeleting) {
- return;
- }
-
- KTextEditor::View* view = mainWindow()->activeView();
- if (!view) {
- return;
- }
-
- int tabID = m_docTabMap[view->document()];
- m_tabBar->setCurrentIndex(tabID);
-}
-
-void TabBarPluginView::slotMiddleMouseButtonPressed(int tabId)
-{
- // only close by middle mouse button, if the document is not externally
- // modified. Avoids a non-trivial crash: bug #299744
- if (!m_modifiedMap[m_tabDocMap[tabId]]) {
- slotTabCloseRequest(tabId);
- }
-}
-
-void TabBarPluginView::slotTabCloseRequest(int tabId)
-{
- Kate::application()->documentManager()->closeDocument(m_tabDocMap[tabId]);
-}
-
-void TabBarPluginView::slotDocumentChanged(KTextEditor::Document* document)
-{
-
- int tabID = m_docTabMap[document];
- if (document->isModified()) {
- m_tabBar->setTabIcon(tabID, KIconLoader::global()
- ->loadIcon("document-save", KIconLoader::Small, 16));
- } else {
- m_tabBar->setTabIcon(tabID, QIcon());
- }
-}
-
-void TabBarPluginView::slotModifiedOnDisc(KTextEditor::Document* document, bool modified,
- KTextEditor::ModificationInterface::ModifiedOnDiskReason reason)
-{
- int tabID = m_docTabMap[document];
- m_modifiedMap[document] = modified;
-
- if (!modified) {
- m_tabBar->setTabIcon(tabID, QIcon());
- } else {
- switch (reason) {
- case KTextEditor::ModificationInterface::OnDiskModified:
- m_tabBar->setTabIcon(tabID, KIconLoader::global()
- ->loadIcon("dialog-warning", KIconLoader::Small));
- break;
- case KTextEditor::ModificationInterface::OnDiskCreated:
- m_tabBar->setTabIcon(tabID, KIconLoader::global()
- ->loadIcon("document-save", KIconLoader::Small));
- break;
- case KTextEditor::ModificationInterface::OnDiskDeleted:
- m_tabBar->setTabIcon(tabID, KIconLoader::global()
- ->loadIcon("dialog-warning", KIconLoader::Small));
- default:
- m_tabBar->setTabIcon(tabID, KIconLoader::global()
- ->loadIcon("dialog-warning", KIconLoader::Small));
- }
- }
-}
-
-void TabBarPluginView::slotNameChanged(KTextEditor::Document* document)
-{
-
- if (!document) {
- return;
- }
-
- int tabID = m_docTabMap[document];
- m_tabBar->setTabText(tabID, document->documentName());
- m_tabBar->setTabToolTip(tabID, document->url().pathOrUrl());
-}
-
-void TabBarPluginView::slotWheelDelta(int delta)
-{
- if (m_tabBar->count() < 2) {
- return;
- }
-
- int page = m_tabBar->currentIndex();
- if (delta < 0) {
- page = (page + 1) % m_tabBar->count();
- } else {
- page --;
- }
-
- if (page < 0) {
- page = m_tabBar->count() - 1;
- }
-
- m_tabBar->setCurrentIndex(page);
-}
-
-void TabBarPluginView::slotTabMoved(int from, int to)
-{
- KTextEditor::Document* document = m_docList.takeAt(from);
- m_docList.insert(to, document);
- rebuildMaps();
-}
-
-void TabBarPluginView::rebuildMaps() {
- m_tabDocMap.clear();
- m_docTabMap.clear();
-
- for (int i = 0; i < m_docList.count(); i++) {
- KTextEditor::Document* document = m_docList.at(i);
- //m_tabBar->setTabToolTip(i, document->url().pathOrUrl());
- m_tabDocMap[i] = document;
- m_docTabMap[document] = i;
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// TabBarPlugin
-///////////////////////////////////////////////////////////////////////////////
-TabBarPlugin::TabBarPlugin(QObject* parent , const QList<QVariant>&)
- : Kate::Plugin((Kate::Application*)parent)
-{
-}
-
-TabBarPlugin::~TabBarPlugin()
-{
-}
-
-Kate::PluginView *TabBarPlugin::createView(Kate::MainWindow *mainWindow)
-{
- TabBarPluginView *view = new TabBarPluginView(mainWindow);
- return view;
-}
-
diff --git a/addons/kate/tabify/tabify.h b/addons/kate/tabify/tabify.h
deleted file mode 100644
index ab090de..0000000
--- a/addons/kate/tabify/tabify.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2010 by Abhishek Patil <abhishekworld@gmail.com> *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
- ***************************************************************************/
-#ifndef TABIFY_H
-#define TABIFY_H
-
-#include <kate/application.h>
-#include <kate/documentmanager.h>
-#include <kate/mainwindow.h>
-#include <kate/plugin.h>
-#include <ktexteditor/document.h>
-#include <ktexteditor/modificationinterface.h>
-#include <ktexteditor/plugin.h>
-#include <ktexteditor/view.h>
-#include <klocalizedstring.h>
-#include <ktabbar.h>
-
-#include <QtCore/QEvent>
-#include <QtCore/QObject>
-#include <QtCore/QList>
-#include <QtGui/QTabBar>
-
-class TabBarPluginView
- : public Kate::PluginView
-{
- Q_OBJECT
-
-public:
- explicit TabBarPluginView(Kate::MainWindow* mainwindow);
- virtual ~TabBarPluginView();
-
-public Q_SLOTS:
- void slotDocumentCreated(KTextEditor::Document* doc);
- void slotTabChanged(int);
- void slotDocumentDeleted(KTextEditor::Document*);
- void slotViewChanged();
- void slotMiddleMouseButtonPressed(int);
- void slotTabCloseRequest(int);
- void slotDocumentChanged(KTextEditor::Document*);
- void slotModifiedOnDisc(KTextEditor::Document*, bool,
- KTextEditor::ModificationInterface::ModifiedOnDiskReason);
- void slotNameChanged(KTextEditor::Document*);
- void slotWheelDelta(int);
- void slotTabMoved(int, int);
-
-private:
- KTabBar* m_tabBar;
- QMap<int, KTextEditor::Document*> m_tabDocMap;
- QMap<KTextEditor::Document*, int> m_docTabMap;
- QList<KTextEditor::Document*> m_docList;
- QMap<KTextEditor::Document*, bool> m_modifiedMap;
- bool m_tabIsDeleting;
- void rebuildMaps();
-};
-
-class TabBarPlugin
- : public Kate::Plugin
-{
- Q_OBJECT
-
-
-public:
- explicit TabBarPlugin(QObject* parent = 0, const QList<QVariant>& = QList<QVariant>());
- virtual ~TabBarPlugin();
-
- Kate::PluginView *createView(Kate::MainWindow *mainWindow);
-
-private:
- QList<TabBarPluginView*> m_views;
-};
-
-#endif // TABIFY_H
diff --git a/addons/kate/tabify/ui.rc b/addons/kate/tabify/ui.rc
deleted file mode 100644
index 183150e..0000000
--- a/addons/kate/tabify/ui.rc
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE kpartgui>
-<gui name="tabifyplugin" library="katetabifyplugin" version="1">
-<ToolBar>
- <text>Tabify Plugin</text>
- <Action name="tabbar_widget"/>
-</ToolBar>
-</gui>