diff --git a/kate/addons/kate/CMakeLists.txt b/kate/addons/kate/CMakeLists.txt index bda13a36..0cd20566 100644 --- a/kate/addons/kate/CMakeLists.txt +++ b/kate/addons/kate/CMakeLists.txt @@ -10,18 +10,12 @@ add_subdirectory(konsole) add_subdirectory(filebrowser) add_subdirectory(mailfiles) -add_subdirectory(tabbarextension) - add_subdirectory(filetemplates) add_subdirectory(kate-ctags) add_subdirectory(katebuild-plugin) add_subdirectory(search) -add_subdirectory(openheader) - add_subdirectory(tabify) -add_subdirectory(close-except-like) - add_subdirectory(project) diff --git a/kate/addons/kate/close-except-like/.kateconfig b/kate/addons/kate/close-except-like/.kateconfig deleted file mode 100644 index 6049b6ed..00000000 --- a/kate/addons/kate/close-except-like/.kateconfig +++ /dev/null @@ -1 +0,0 @@ -kate: space-indent on; tab-width 4; indent-width 4; replace-tabs on; hl C++/Qt4; diff --git a/kate/addons/kate/close-except-like/CMakeLists.txt b/kate/addons/kate/close-except-like/CMakeLists.txt deleted file mode 100644 index a23c7c3c..00000000 --- a/kate/addons/kate/close-except-like/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -set(VERSION_MAJOR 0) -set(VERSION_MINOR 3) -set(VERSION_PATCH 5) -set(VERSION_STRING ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) - -set(KATE_CLOSE_EXCEPT_PLUGIN_SOURCES - close_confirm_dialog.cpp - close_except_plugin.cpp -) - -kde4_add_plugin(katecloseexceptplugin ${KATE_CLOSE_EXCEPT_PLUGIN_SOURCES}) - -target_link_libraries(katecloseexceptplugin - KDE4::kdeui - KDE4::kfile - KDE4::ktexteditor - kateinterfaces -) - -configure_file(config.h.in config.h) - -install( - TARGETS katecloseexceptplugin - DESTINATION ${KDE4_PLUGIN_INSTALL_DIR} -) -install( - FILES ui.rc - DESTINATION ${KDE4_DATA_INSTALL_DIR}/kate/plugins/katecloseexceptplugin -) -install( - FILES katecloseexceptplugin.desktop - DESTINATION ${KDE4_SERVICES_INSTALL_DIR} -) diff --git a/kate/addons/kate/close-except-like/Messages.sh b/kate/addons/kate/close-except-like/Messages.sh deleted file mode 100644 index df117f92..00000000 --- a/kate/addons/kate/close-except-like/Messages.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/sh -$XGETTEXT *.cpp -o $podir/katecloseexceptplugin.pot diff --git a/kate/addons/kate/close-except-like/close_confirm_dialog.cpp b/kate/addons/kate/close-except-like/close_confirm_dialog.cpp deleted file mode 100644 index cf27d3f4..00000000 --- a/kate/addons/kate/close-except-like/close_confirm_dialog.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/** - * \file - * - * \brief Class \c kate::CloseConfirmDialog (implementation) - * - * Copyright (C) 2012 Alex Turbov - * - * \date Sun Jun 24 16:29:13 MSK 2012 -- Initial design - */ -/* - * KateCloseExceptPlugin 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 3 of the License, or - * (at your option) any later version. - * - * KateCloseExceptPlugin 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, see . - */ - -// Project specific includes -#include "close_confirm_dialog.h" - -// Standard includes -#include -#include /// \todo Where is \c i18n() defiend? -#include -#include -#include -#include - -namespace kate { namespace { - -class KateDocItem : public QTreeWidgetItem -{ - public: - KateDocItem(KTextEditor::Document* doc, QTreeWidget* tw) - : QTreeWidgetItem(tw) - , document(doc) - { - setText(0, doc->documentName()); - setText(1, doc->url().prettyUrl()); - setCheckState(0, Qt::Checked); - } - KTextEditor::Document* document; -}; -} // anonymous namespace - -CloseConfirmDialog::CloseConfirmDialog( - QList& docs - , KToggleAction* show_confirmation_action - , QWidget* const parent - ) - : KDialog(parent) - , m_docs(docs) -{ - assert("Documents container expected to be non empty" && !docs.isEmpty()); - - setCaption(i18nc("@title:window", "Close files confirmation")); - setButtons(Ok | Cancel); - setModal(true); - setDefaultButton(KDialog::Ok); - - KVBox* w = new KVBox(this); - setMainWidget(w); - w->setSpacing(KDialog::spacingHint()); - - KHBox* lo1 = new KHBox(w); - - // dialog text - QLabel* icon = new QLabel(lo1); - icon->setPixmap(DesktopIcon("dialog-warning")); - - QLabel* t = new QLabel( - i18nc("@label:listbox", "You are about to close the following documents:") - , lo1 - ); - lo1->setStretchFactor(t, 1000); - - // document list - m_docs_tree = new QTreeWidget(w); - QStringList headers; - headers << i18nc("@title:column", "Document") << i18nc("@title:column", "Location"); - m_docs_tree->setHeaderLabels(headers); - m_docs_tree->setSelectionMode(QAbstractItemView::SingleSelection); - m_docs_tree->setRootIsDecorated(false); - - for (int i = 0; i < m_docs.size(); i++) - { - new KateDocItem(m_docs[i], m_docs_tree); - } - m_docs_tree->header()->setStretchLastSection(false); - m_docs_tree->header()->setResizeMode(0, QHeaderView::ResizeToContents); - m_docs_tree->header()->setResizeMode(1, QHeaderView::ResizeToContents); - - m_dont_ask_again = new QCheckBox(i18nc("option:check", "Do not ask again"), w); - // NOTE If we are here, it means that 'Show Confirmation' action is enabled, - // so not needed to read config... - assert("Sanity check" && show_confirmation_action->isChecked()); - m_dont_ask_again->setCheckState(Qt::Unchecked); - connect(m_dont_ask_again, SIGNAL(toggled(bool)), show_confirmation_action, SLOT(toggle())); - - // Update documents list according checkboxes - connect(this, SIGNAL(accepted()), this, SLOT(updateDocsList())); - - KConfigGroup gcg(KGlobal::config(), "CloseConfirmationDialog"); - restoreDialogSize(gcg); // restore dialog geometry from config -} - -CloseConfirmDialog::~CloseConfirmDialog() -{ - KConfigGroup gcg(KGlobal::config(), "CloseConfirmationDialog"); - saveDialogSize(gcg); // write dialog geometry to config - gcg.sync(); -} - -/** - * Going to remove unchecked files from the given documents list - */ -void CloseConfirmDialog::updateDocsList() -{ - for ( - QTreeWidgetItemIterator it(m_docs_tree, QTreeWidgetItemIterator::NotChecked) - ; *it - ; ++it - ) - { - KateDocItem* item = static_cast(*it); - m_docs.removeAll(item->document); - kDebug() << "do not close the file " << item->document->url().prettyUrl(); - } -} - -} // namespace kate diff --git a/kate/addons/kate/close-except-like/close_confirm_dialog.h b/kate/addons/kate/close-except-like/close_confirm_dialog.h deleted file mode 100644 index 9f40836b..00000000 --- a/kate/addons/kate/close-except-like/close_confirm_dialog.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * \file - * - * \brief Class \c kate::CloseConfirmDialog (interface) - * - * Copyright (C) 2012 Alex Turbov - * - * \date Sun Jun 24 16:29:13 MSK 2012 -- Initial design - */ -/* - * KateCloseExceptPlugin 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 3 of the License, or - * (at your option) any later version. - * - * KateCloseExceptPlugin 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, see . - */ - -#ifndef __SRC__CLOSE_CONFIRM_DIALOG_H__ -# define __SRC__CLOSE_CONFIRM_DIALOG_H__ - -// Project specific includes - -// Standard includes -# include -# include -# include -# include -# include -# include - -namespace kate { - -/** - * \brief [Type brief class description here] - * - * [More detailed description here] - * - */ -class CloseConfirmDialog : public KDialog -{ - Q_OBJECT -public: - /// Default constructor - explicit CloseConfirmDialog(QList&, KToggleAction*, QWidget* const = 0); - ~CloseConfirmDialog(); - -private Q_SLOTS: - void updateDocsList(); - -private: - QList& m_docs; - QTreeWidget* m_docs_tree; - QCheckBox* m_dont_ask_again; -}; - -} // namespace kate -#endif // __SRC__CLOSE_CONFIRM_DIALOG_H__ diff --git a/kate/addons/kate/close-except-like/close_except_plugin.cpp b/kate/addons/kate/close-except-like/close_except_plugin.cpp deleted file mode 100644 index 788b90b5..00000000 --- a/kate/addons/kate/close-except-like/close_except_plugin.cpp +++ /dev/null @@ -1,350 +0,0 @@ -/** - * \file - * - * \brief Kate Close Except/Like plugin implementation - * - * Copyright (C) 2012 Alex Turbov - * - * \date Thu Mar 8 08:13:43 MSK 2012 -- Initial design - */ -/* - * KateCloseExceptPlugin 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 3 of the License, or - * (at your option) any later version. - * - * KateCloseExceptPlugin 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, see . - */ - -// Project specific includes -#include "config.h" -#include "close_except_plugin.h" -#include "close_confirm_dialog.h" - -// Standard includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -K_PLUGIN_FACTORY(CloseExceptPluginFactory, registerPlugin();) -K_EXPORT_PLUGIN( - CloseExceptPluginFactory( - KAboutData( - "katecloseexceptplugin" - , "katecloseexceptplugin" - , ki18n("Close Except/Like Plugin") - , PLUGIN_VERSION - , ki18n("Close all documents started from specified path") - , KAboutData::License_LGPL_V3 - ) - ) - ) - -namespace kate { -//BEGIN CloseExceptPlugin -CloseExceptPlugin::CloseExceptPlugin( - QObject* application - , const QList& - ) - : Kate::Plugin(static_cast(application), "katecloseexceptplugin") -{ -} - -Kate::PluginView* CloseExceptPlugin::createView(Kate::MainWindow* parent) -{ - return new CloseExceptPluginView(parent, CloseExceptPluginFactory::componentData(), this); -} - -void CloseExceptPlugin::readSessionConfig(KConfigBase* config, const QString& groupPrefix) -{ - KConfigGroup scg(config, groupPrefix + "menu"); - m_show_confirmation_needed = scg.readEntry("ShowConfirmation", true); -} - -void CloseExceptPlugin::writeSessionConfig(KConfigBase* config, const QString& groupPrefix) -{ - KConfigGroup scg(config, groupPrefix + "menu"); - scg.writeEntry("ShowConfirmation", m_show_confirmation_needed); - scg.sync(); -} -//END CloseExceptPlugin - -//BEGIN CloseExceptPluginView -CloseExceptPluginView::CloseExceptPluginView( - Kate::MainWindow* mw - , const KComponentData& data - , CloseExceptPlugin* plugin - ) - : Kate::PluginView(mw) - , Kate::XMLGUIClient(data) - , m_plugin(plugin) - , m_show_confirmation_action(new KToggleAction(i18nc("@action:inmenu", "Show Confirmation"), this)) - , m_except_menu(new KActionMenu( - i18nc("@action:inmenu close docs except the following...", "Close Except") - , this - )) - , m_like_menu(new KActionMenu( - i18nc("@action:inmenu close docs like the following...", "Close Like") - , this - )) -{ - actionCollection()->addAction("file_close_except", m_except_menu); - actionCollection()->addAction("file_close_like", m_like_menu); - - // Subscribe self to document creation - connect( - m_plugin->application()->editor() - , SIGNAL(documentCreated(KTextEditor::Editor*, KTextEditor::Document*)) - , this - , SLOT(documentCreated(KTextEditor::Editor*, KTextEditor::Document*)) - ); - // Configure toggle action and connect it to update state - m_show_confirmation_action->setChecked(m_plugin->showConfirmationNeeded()); - connect( - m_show_confirmation_action - , SIGNAL(toggled(bool)) - , m_plugin - , SLOT(toggleShowConfirmation(bool)) - ); - // - connect( - mainWindow() - , SIGNAL(viewCreated(KTextEditor::View*)) - , this - , SLOT(viewCreated(KTextEditor::View*)) - ); - // Fill menu w/ currently opened document masks/groups - updateMenu(); - - mainWindow()->guiFactory()->addClient(this); -} - -CloseExceptPluginView::~CloseExceptPluginView() -{ - mainWindow()->guiFactory()->removeClient(this); -} - -void CloseExceptPluginView::viewCreated(KTextEditor::View* view) -{ - connectToDocument(view->document()); - updateMenu(); -} - -void CloseExceptPluginView::documentCreated(KTextEditor::Editor*, KTextEditor::Document* document) -{ - connectToDocument(document); - updateMenu(); -} - -void CloseExceptPluginView::connectToDocument(KTextEditor::Document* document) -{ - // Subscribe self to document close and name changes - connect( - document - , SIGNAL(aboutToClose(KTextEditor::Document*)) - , this - , SLOT(updateMenuSlotStub(KTextEditor::Document*)) - ); - connect( - document - , SIGNAL(documentNameChanged(KTextEditor::Document*)) - , this - , SLOT(updateMenuSlotStub(KTextEditor::Document*)) - ); - connect( - document - , SIGNAL(documentUrlChanged(KTextEditor::Document*)) - , this - , SLOT(updateMenuSlotStub(KTextEditor::Document*)) - ); -} - -void CloseExceptPluginView::updateMenuSlotStub(KTextEditor::Document*) -{ - updateMenu(); -} - -void CloseExceptPluginView::appendActionsFrom( - const QSet& paths - , actions_map_type& actions - , KActionMenu* menu - , QSignalMapper* mapper - ) -{ - Q_FOREACH(const QString& path, paths) - { - QString action = path.startsWith('*') ? path : path + '*'; - QPointer kaction(new KAction(action, menu)); - actions[action] = kaction; - menu->addAction(kaction); - connect(kaction, SIGNAL(triggered()), mapper, SLOT(map())); - mapper->setMapping(kaction, action); - } -} - -QPointer CloseExceptPluginView::updateMenu( - const QSet& paths - , const QSet& masks - , actions_map_type& actions - , KActionMenu* menu - ) -{ - // turn menu ON or OFF depending on collected results - menu->setEnabled(!paths.empty()); - - // Clear previous menus - foreach (const QPointer it, actions) - { - menu->removeAction(it); - } - actions.clear(); - - // Form a new one - QPointer mapper = QPointer(new QSignalMapper(this)); - appendActionsFrom(paths, actions, menu, mapper); - if (!masks.empty()) - { - if (!paths.empty()) - menu->addSeparator(); // Add separator between paths and file's ext filters - appendActionsFrom(masks, actions, menu, mapper); - } - // Append 'Show Confirmation' toggle menu item - menu->addSeparator(); // Add separator between paths and show confirmation - menu->addAction(m_show_confirmation_action); - return mapper; -} - -void CloseExceptPluginView::updateMenu() -{ - const QList& docs = m_plugin->application()->documentManager()->documents(); - if (docs.size() < 2) - { - kDebug() << "No docs r (or the only) opened right now --> disable menu"; - m_except_menu->setEnabled(false); - m_except_menu->addSeparator(); - m_like_menu->setEnabled(false); - m_like_menu->addSeparator(); - /// \note It seems there is always a document present... it named \em 'Untitled' - } - else - { - // Iterate over documents and form a set of candidates - typedef QSet paths_set_type; - paths_set_type doc_paths; - paths_set_type masks; - Q_FOREACH(KTextEditor::Document* document, docs) - { - const QString& ext = QFileInfo(document->url().path()).completeSuffix(); - if (!ext.isEmpty()) - masks.insert("*." + ext); - doc_paths.insert(document->url().upUrl().path()); - } - paths_set_type paths = doc_paths; - kDebug() << "stage #1: Collected" << paths.size() << "paths and" << masks.size() << "masks"; - // Add common paths to the collection - for (paths_set_type::iterator it = doc_paths.begin(), last = doc_paths.end(); it != last; ++it) - { - for ( - KUrl url = *it - ; url.hasPath() && url.path() != "/" - ; url = url.upUrl() - ) - { - paths_set_type::iterator not_it = it; - for (++not_it; not_it != last; ++not_it) - if (!not_it->startsWith(url.path())) - break; - if (not_it == last) - { - paths.insert(url.path()); - break; - } - } - } - kDebug() << "stage #2: Collected" << paths.size() << "paths and" << masks.size() << "masks"; - // - m_except_mapper = updateMenu(paths, masks, m_except_actions, m_except_menu); - m_like_mapper = updateMenu(paths, masks, m_like_actions, m_like_menu); - connect(m_except_mapper, SIGNAL(mapped(const QString&)), this, SLOT(closeExcept(const QString&))); - connect(m_like_mapper, SIGNAL(mapped(const QString&)), this, SLOT(closeLike(const QString&))); - } -} - -void CloseExceptPluginView::close(const QString& item, const bool close_if_match) -{ - assert( - "Parameter seems invalid! Is smth has changed in the code?" - && !item.isEmpty() && (item[0] == '*' || item[item.size() - 1] == '*') - ); - - const bool is_path = item[0] != '*'; - const QString mask = is_path ? item.left(item.size() - 1) : item; - kDebug() << "Going to close items [" << close_if_match << "/" << is_path << "]: " << mask; - - QList docs2close; - const QList& docs = m_plugin->application()->documentManager()->documents(); - Q_FOREACH(KTextEditor::Document* document, docs) - { - const QString& path = document->url().upUrl().path(); - /// \note Take a dot in account, so \c *.c would not match for \c blah.kcfgc - const QString& ext = '.' + QFileInfo(document->url().fileName()).completeSuffix(); - const bool match = (!is_path && mask.endsWith(ext)) - || (is_path && path.startsWith(mask)) - ; - if (match == close_if_match) - { - kDebug() << "*** Will close: " << document->url(); - docs2close.push_back(document); - } - } - if (docs2close.isEmpty()) - { - KPassivePopup::message( - i18nc("@title:window", "Error") - , i18nc("@info:tooltip", "No files to close ...") - , qobject_cast(this) - ); - return; - } - // Show confirmation dialog if needed - const bool removeNeeded = !m_plugin->showConfirmationNeeded() - || CloseConfirmDialog(docs2close, m_show_confirmation_action, qobject_cast(this)).exec(); - if (removeNeeded) - { - if (docs2close.isEmpty()) - { - KPassivePopup::message( - i18nc("@title:window", "Error") - , i18nc("@info:tooltip", "No files to close ...") - , qobject_cast(this) - ); - } - else - { - // Close 'em all! - m_plugin->application()->documentManager()->closeDocumentList(docs2close); - updateMenu(); - KPassivePopup::message( - i18nc("@title:window", "Done") - , i18np("%1 file closed", "%1 files closed", docs2close.size()) - , qobject_cast(this) - ); - } - } -} -//END CloseExceptPluginView -} // namespace kate diff --git a/kate/addons/kate/close-except-like/close_except_plugin.h b/kate/addons/kate/close-except-like/close_except_plugin.h deleted file mode 100644 index ef762f56..00000000 --- a/kate/addons/kate/close-except-like/close_except_plugin.h +++ /dev/null @@ -1,135 +0,0 @@ -/** - * \file - * - * \brief Declate Kate's Close Except/Like plugin classes - * - * Copyright (C) 2012 Alex Turbov - * - * \date Thu Mar 8 08:13:43 MSK 2012 -- Initial design - */ -/* - * KateCloseExceptPlugin 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 3 of the License, or - * (at your option) any later version. - * - * KateCloseExceptPlugin 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, see . - */ - -#ifndef __SRC__CLOSE_EXCEPT_PLUGIN_H__ -# define __SRC__CLOSE_EXCEPT_PLUGIN_H__ - -// Project specific includes - -// Standard includes -# include -# include -# include -# include -# include -# include -# include -# include -# include - -namespace kate { -class CloseExceptPlugin; // forward declaration - -/** - * \brief Plugin to close docs grouped by extension or location - */ -class CloseExceptPluginView - : public Kate::PluginView - , public Kate::XMLGUIClient -{ - Q_OBJECT - typedef QMap > actions_map_type; - -public: - /// Default constructor - CloseExceptPluginView(Kate::MainWindow*, const KComponentData&, CloseExceptPlugin*); - /// Destructor - ~CloseExceptPluginView(); - -private Q_SLOTS: - void viewCreated(KTextEditor::View*); - void documentCreated(KTextEditor::Editor*, KTextEditor::Document*); - void updateMenuSlotStub(KTextEditor::Document*); - void close(const QString&, const bool); - void closeExcept(const QString& item) - { - close(item, false); - } - void closeLike(const QString& item) - { - close(item, true); - } - -private: - void connectToDocument(KTextEditor::Document*); - void updateMenu(); - QPointer updateMenu( - const QSet& - , const QSet& - , actions_map_type& - , KActionMenu* - ); - void appendActionsFrom( - const QSet& - , actions_map_type& - , KActionMenu* - , QSignalMapper* - ); - - CloseExceptPlugin* m_plugin; - QPointer m_show_confirmation_action; - QPointer m_except_menu; - QPointer m_like_menu; - QPointer m_except_mapper; - QPointer m_like_mapper; - actions_map_type m_except_actions; - actions_map_type m_like_actions; -}; - -/** - * \brief Plugin view class - */ -class CloseExceptPlugin : public Kate::Plugin -{ - Q_OBJECT - -public: - /// Default constructor - CloseExceptPlugin(QObject* = 0, const QList& = QList()); - /// Destructor - virtual ~CloseExceptPlugin() {} - /// Create a new view of this plugin for the given main window - Kate::PluginView* createView(Kate::MainWindow*); - /// \name Plugin interface implementation - //@{ - void readSessionConfig(KConfigBase*, const QString&); - void writeSessionConfig(KConfigBase*, const QString&); - //@} - bool showConfirmationNeeded() const - { - return m_show_confirmation_needed; - } - -public Q_SLOTS: - void toggleShowConfirmation(bool flag) - { - m_show_confirmation_needed = flag; - } - -private: - bool m_show_confirmation_needed; -}; - -} // namespace kate -#endif // __SRC__CLOSE_EXCEPT_PLUGIN_H__ diff --git a/kate/addons/kate/close-except-like/config.h.in b/kate/addons/kate/close-except-like/config.h.in deleted file mode 100644 index 37da1548..00000000 --- a/kate/addons/kate/close-except-like/config.h.in +++ /dev/null @@ -1,31 +0,0 @@ -/** - * \file - * - * \brief Class \c kate::config (interface) - * - * Copyright (C) 2012 Alex Turbov - * - * \date Thu Mar 8 08:19:57 MSK 2012 -- Initial design - * - * \attention DO NOT EDIT THIS FILE! IT WAS GENERATED BY CMAKE. - */ -/* - * KateCloseExceptPlugin 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 3 of the License, or - * (at your option) any later version. - * - * KateCloseExceptPlugin 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, see . - */ - -#ifndef __SRC__CONFIG_H__ -# define __SRC__CONFIG_H__ -# define PLUGIN_VERSION "@VERSION_STRING@" -#endif // __SRC__CONFIG_H__ -// kate: hl c++; diff --git a/kate/addons/kate/close-except-like/katecloseexceptplugin.desktop b/kate/addons/kate/close-except-like/katecloseexceptplugin.desktop deleted file mode 100644 index 71c56aa6..00000000 --- a/kate/addons/kate/close-except-like/katecloseexceptplugin.desktop +++ /dev/null @@ -1,92 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Type=Service -ServiceTypes=Kate/Plugin -X-KDE-Library=katecloseexceptplugin -X-KDE-Version=4.0 -X-Kate-Version=2.9 -X-Kate-Load=True -Name=Close Except/Like -Name[ar]=أغلق ما عدى/المشابه لِـ -Name[bs]=Zatvori Osim/Kao -Name[ca]=Tancament excepte/com -Name[ca@valencia]=Tancament excepte/com -Name[cs]=Zavřít kromě/jako -Name[da]=Luk undtagen/lignende -Name[de]=Bedingtes Schließen -Name[el]=Κλείσιμο Except/Like -Name[en_GB]=Close Except/Like -Name[es]=Cerrar excepto/como -Name[et]=Selliste/teistsuguste sulgemine -Name[fi]=Sulje samanlaiset kuin / muut kuin -Name[fr]=Fermer les exclusions / inclusions -Name[gl]=Pechar agás/como -Name[he]=סגור דומה/למעט -Name[hu]=Kivétel/Like bezárása -Name[ia]=Claude Excepte/Simile -Name[it]=Chiudi escludendo/includendo -Name[kk]=Шарт бойынша жабу -Name[ko]=다음을 제외한/다음과 같은 것 닫기 -Name[lt]=Uždaryti Išskyrus/Kaip -Name[nb]=Lukk unntatt/lik -Name[nds]=Liek/Anner Dateien tomaken -Name[nl]=Behalve/Like sluiten -Name[pl]=Zamknij oprócz/podobne -Name[pt]=Fechar Excluindo/Incluindo -Name[pt_BR]=Fechamento com exclusão/inclusão -Name[ro]=Închide excepția/precum -Name[ru]=Закрыть кроме/только... -Name[sk]=Zatvoriť okrem/ako -Name[sl]=Zapri razen/kot -Name[sr]=Затварање осим/према -Name[sr@ijekavian]=Затварање осим/према -Name[sr@ijekavianlatin]=Zatvaranje osim/prema -Name[sr@latin]=Zatvaranje osim/prema -Name[sv]=Stäng förutom/som -Name[tr]=Hariç/Benzerlerini Kapat -Name[uk]=Додаток закриття за критерієм -Name[x-test]=xxClose Except/Likexx -Name[zh_CN]=关闭除/类似 -Name[zh_TW]=關閉「例外/喜歡」 -Comment=Close group of documents based on a common path or file extension -Comment[ar]=أغلق مجموعة من المستندات بناءً على مسار شائع أو امتداد الملف -Comment[bs]=Zatvori grupu dokumenara na bazi zajedniočke staye ili ekstenzije datoteke -Comment[ca]=Tanca un grup de documents basats en un camí comú o en l'extensió del fitxer -Comment[ca@valencia]=Tanca un grup de documents basats en un camí comú o en l'extensió del fitxer -Comment[cs]=Zavřít skupinu dokumentů podle společné cesty nebo přípony -Comment[da]=Luk gruppe af dokumenter baseret på en fælles sti eller filendelse -Comment[de]=Eine Gruppe von Dokumenten auf der Basis eines gemeinsamen Pfades oder einer Dateierweiterung schließen -Comment[el]=Κλείσιμο ομάδας εγγράφων με βάση κοινή διαδρομή ή κατάληξη ονόματος αρχείου -Comment[en_GB]=Close group of documents based on a common path or file extension -Comment[es]=Cerrar un grupo de documentos según una ruta común o una extensión de archivo -Comment[et]=Rühma ühise asukoha või faililaiendiga dokumentide sulgemine -Comment[fi]=Sulje joukko tiedostoja niille yhteisen polun tai tiedostopäätteen perusteella -Comment[fr]=Fermer un groupe de documents reposant sur un emplacement ou une extension de fichier communs -Comment[gl]=Pecha un grupo de documentos baseado nunha ruta ou extensión de ficheiro común -Comment[he]=סגור קבוצה של מסמכים בהתאם לנתיב משותף או סיומת -Comment[hu]=Közös útvonalon vagy fájlkiterjesztésen alapuló dokumentumok csoportjának bezárása -Comment[ia]=Claude gruppo de documentos basate su un commun percurso o extension de file -Comment[it]=Chiudi gruppo di documenti con percorso o estensione comune -Comment[kk]=Ортақ жолы не жұрнағы негізінде құжаттар тобын жабу -Comment[ko]=공통 경로나 확장자를 기준으로 문서 그룹 닫기 -Comment[lt]=Uždaryti dokumentų grupę remianti bendruoju keliu ar failo plėtiniu -Comment[nb]=Lukk en gruppe dokumenter basert på en felles sti eller etternavn -Comment[nds]=Mehr Dateien op eenmaal tomaken, wenn se en gemeen Padd oder de sülve Ennen hebbt -Comment[nl]=Groep documenten sluiten gebaseerd op een gemeenschappelijk pad of bestandsextensie -Comment[pl]=Zamknij grupę dokumentów w oparciu o wspólną ścieżkę lub rozszerzenie pliku -Comment[pt]=Fecha um grupo de documentos com base numa localização ou extensão de ficheiros comum -Comment[pt_BR]=Fecha um grupo de documentos com base em localização comum ou extensão do arquivo -Comment[ro]=Închide grupul de documente avînd la bază o cale sau extensie de fișier comune -Comment[ru]=Закрывает группу документов, в зависимости от пути или расширения -Comment[sk]=Zatvoriť skupinu dokumentov založenú na spoločnej ceste alebo koncovke súboru -Comment[sl]=Zapre skupino dokumentov, ki temeljijo na skupni poti ali priponi datoteke -Comment[sr]=Затворите групу докумената на основу заједничке путање или проширења фајла -Comment[sr@ijekavian]=Затворите групу докумената на основу заједничке путање или проширења фајла -Comment[sr@ijekavianlatin]=Zatvorite grupu dokumenata na osnovu zajedničke putanje ili proširenja fajla -Comment[sr@latin]=Zatvorite grupu dokumenata na osnovu zajedničke putanje ili proširenja fajla -Comment[sv]=Stäng grupp av dokument baserat på en gemensam sökväg eller filändelse -Comment[tr]=Ortak yol veya dosya uzantısına bağlı belge gruplarını kapat -Comment[uk]=Закриває групу документів, які зберігаються у одному каталозі або мають однаковий суфікс назви. -Comment[x-test]=xxClose group of documents based on a common path or file extensionxx -Comment[zh_CN]=根据路径或文件扩展名关闭一组文档 -Comment[zh_TW]=關閉相同路徑或相同副檔名的文件 diff --git a/kate/addons/kate/close-except-like/ui.rc b/kate/addons/kate/close-except-like/ui.rc deleted file mode 100644 index 024dc940..00000000 --- a/kate/addons/kate/close-except-like/ui.rc +++ /dev/null @@ -1,9 +0,0 @@ - - - - &File - - - - - diff --git a/kate/addons/kate/helloworld/CMakeLists.txt b/kate/addons/kate/helloworld/CMakeLists.txt deleted file mode 100644 index 01bb9cb0..00000000 --- a/kate/addons/kate/helloworld/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -kde4_add_plugin(katehelloworldplugin plugin_katehelloworld.cpp) - -target_link_libraries(katehelloworldplugin - KDE4::kdeui - kateinterfaces -) - -########### install files ############### -install( - TARGETS katehelloworldplugin - DESTINATION ${KDE4_PLUGIN_INSTALL_DIR} -) -install( - FILES ui.rc - DESTINATION ${KDE4_DATA_INSTALL_DIR}/kate/plugins/katehelloworld -) -install( - FILES katehelloworld.desktop - DESTINATION ${KDE4_SERVICES_INSTALL_DIR} -) diff --git a/kate/addons/kate/helloworld/Messages.sh b/kate/addons/kate/helloworld/Messages.sh deleted file mode 100644 index 24dc5829..00000000 --- a/kate/addons/kate/helloworld/Messages.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh -$EXTRACTRC *.rc >> rc.cpp -$XGETTEXT *.cpp -o $podir/katehelloworld.pot diff --git a/kate/addons/kate/helloworld/katehelloworld.desktop b/kate/addons/kate/helloworld/katehelloworld.desktop deleted file mode 100644 index fe1a9d82..00000000 --- a/kate/addons/kate/helloworld/katehelloworld.desktop +++ /dev/null @@ -1,116 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=Kate/Plugin -X-KDE-Library=katehelloworldplugin -X-Kate-Version=2.9 -Name=Hello World Plugin -Name[ar]=ملحقة أهلًا يا عالم -Name[ast]=Complementu Hola mundu -Name[bg]=Приставка "Здравей свят!" -Name[bs]=Zdravo‑svijete priključak -Name[ca]=Connector Hola món -Name[ca@valencia]=Connector Hola món -Name[cs]=Modul Hello World -Name[da]="Hello World"-plugin -Name[de]=Hello-World-Modul -Name[el]=Πρόσθετο Hello World -Name[en_GB]=Hello World Plugin -Name[es]=Complemento Hola mundo -Name[et]='Tere, maailm' plugin -Name[eu]=Kaixo mundua plugina -Name[fi]=Hei maailma -liitännäinen -Name[fr]=Module externe « Bonjour tout le monde » -Name[ga]=Breiseán 'Dia Dhuit a Dhomhain' -Name[gl]=Complemento de «Olá, mundo» -Name[he]=תוסך שלום עולם -Name[hu]=„Helló Világ” bővítmény -Name[ia]=Plug-in de Salute Mondo -Name[it]=Estensione Ciao Mondo -Name[ja]=Hello World プラグイン -Name[kk]=Сынақ плагині -Name[km]=សួស្ដី​កម្មវិធី​ជំនួយ​ពាក្យ​​​​​​​​​​​​​​​ -Name[ko]=Hello World 플러그인 -Name[lt]=Sveikas pasauli! priedas -Name[lv]=“Sveika, pasaule!” spraudnis -Name[mr]=हेल्लो वर्ल्ड प्लगइन -Name[nb]=Programtillegg-eksempel -Name[nds]="Moin-Welt"-Moduul -Name[nl]=Plug-in voor Hello World -Name[nn]=Eksempel-tillegg -Name[pa]=ਹੈਲੋ ਵਰਲਡ ਪਲੱਗਇਨ -Name[pl]=Wtyczka "Witaj świecie" -Name[pt]='Plugin' de Olá Mundo -Name[pt_BR]=Plugin de teste -Name[ro]=Modul Hello World -Name[ru]=Тестовый модуль -Name[si]=ලෝකයට ආයුබෝවන් ප්ලගිනය -Name[sk]=Hello World Plugin -Name[sl]=Vstavek »Pozdravljen svet« -Name[sr]=Здраво‑свете прикључак -Name[sr@ijekavian]=Здраво‑свијете прикључак -Name[sr@ijekavianlatin]=Zdravo‑svijete priključak -Name[sr@latin]=Zdravo‑svete priključak -Name[sv]=Hello world-insticksprogram -Name[tg]=Плагини Салом ҷаҳон -Name[tr]=Merhaba Dünya Eklentisi -Name[ug]=سالام دۇنيا قىستۇرمىسى -Name[uk]=Тестовий додаток -Name[x-test]=xxHello World Pluginxx -Name[zh_CN]=Hello World 插件 -Name[zh_TW]=Hello World 外掛程式 -Comment=Your short description about the plugin goes here -Comment[ar]=الوصف القصير لهذه الملحقة يكون هنا -Comment[ast]=Equí va una descripción curtia sobro'l so complementu -Comment[bg]=Кратко описание на приставката -Comment[bs]=Ovdje ide kratak opis priključka -Comment[ca]=Aquí va una breu descripció sobre el connector -Comment[ca@valencia]=Ací va una breu descripció sobre el connector -Comment[cs]=Sem patří krátký popis vašeho modulu -Comment[da]=Din korte beskrivelse af pluginet skal være her -Comment[de]=Ihre Kurzbeschreibung des Moduls gehört hier hinein -Comment[el]=Η σύντομη περιγραφή σας σχετικά με το πρόσθετο -Comment[en_GB]=Your short description about the plugin goes here -Comment[es]=Aquí va una breve descripción sobre su complemento -Comment[et]=Siia võib kirjutada oma plugina kirjelduse -Comment[eu]=Pluginari buruzko zure deskribapena hemen doa -Comment[fi]=Lyhyt kuvaus liitännäisestäsi tähän -Comment[fr]=Une courte description de votre module externe s'insère ici -Comment[ga]=Cuir do chur síos gearr ar an mbreiseán anseo -Comment[gl]=A descrición curta acerca do complemento vai aquí -Comment[he]=כאן אתה צריך להוסיף את התיאור של התוסף -Comment[hu]=A bővítőmodul rövid leírása -Comment[ia]=Tu breve description re le plug-in va hic -Comment[it]=La tua breve descrizione dell'estensione va qui -Comment[ja]=プラグインの簡単な説明をここに書きます -Comment[kk]=Мұнда плагинінің қысқа сипаттамасы болады -Comment[km]=ការ​ពិពណ៌នា​សង្ខេប​របស់​អ្នក​អំពី​កម្មវិធី​ជំនួយ​នៅ​ទីនេះ -Comment[ko]=플러그인에 대한 짧은 설명을 입력하십시오 -Comment[lt]=Čia turėtų būti trumpas priedo aprašymas -Comment[lv]=Šeit jābūt nelielam spraudņa aprakstam -Comment[mr]=प्लगइन करिता थोडक्यात वर्णन -Comment[nb]=Din kortbeskrivelse av programtillegget skal legges inn her -Comment[nds]=Hier kummt Dien korte Beschrieven vun't Moduul hen -Comment[ne]=यहाँ प्लगइन जाने बारे तपाईँको छोटो वर्णन -Comment[nl]=Voer hier een korte beschrijving van uw plug-in in. -Comment[nn]=Skriv inn ei kort skildring av tillegget her -Comment[pa]=ਪਲੱਗਇਨ ਬਾਰੇ ਤੁਹਾਡੀ ਸੰਖੇਪ ਜਾਣਕਾਰੀ ਇੱਥੇ -Comment[pl]=Tutaj powinien znaleźć się krótki opis wtyczki -Comment[pt]=Aqui aparece a sua descrição breve sobre o 'plugin' -Comment[pt_BR]=Sua descrição resumida sobre o plugin aparece aqui -Comment[ro]=Aici merge o scurtă descriere a modulului -Comment[ru]=А здесь должно быть описание модуля -Comment[si]=ප්ලගිනය පිලිබඳ ඔබේ කෙටි විස්තරය මෙහි දැක්වේ -Comment[sk]=Sem ide krátky popis vášho pluginu -Comment[sl]=Sem spada kratek opis vašega vstavka -Comment[sr]=Овде иде кратак опис прикључка -Comment[sr@ijekavian]=Овдје иде кратак опис прикључка -Comment[sr@ijekavianlatin]=Ovdje ide kratak opis priključka -Comment[sr@latin]=Ovde ide kratak opis priključka -Comment[sv]=Kort beskrivning av vad insticksprogrammet gör -Comment[tg]=Шарҳи кӯтоҳи шумо дар бораи ин плагин дар ин ҷо сар мешавад -Comment[tr]=Eklenti hakkındaki kısa yorumunuzu buraya ekleyin -Comment[ug]=بۇ قىستۇرمىنىڭ قىسقىچە چۈشەندۈرۈشى -Comment[uk]=Тут слід вказати ваш короткий опис додатка -Comment[x-test]=xxYour short description about the plugin goes herexx -Comment[zh_CN]=关于此插件的简短描述 -Comment[zh_TW]=在這裡描述您的外掛程式 diff --git a/kate/addons/kate/helloworld/plugin_katehelloworld.cpp b/kate/addons/kate/helloworld/plugin_katehelloworld.cpp deleted file mode 100644 index a7d52e85..00000000 --- a/kate/addons/kate/helloworld/plugin_katehelloworld.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* This file is part of the Kate project. - * - * Copyright (C) 2010 Christoph Cullmann - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "plugin_katehelloworld.h" -#include "moc_plugin_katehelloworld.cpp" - -#include -#include - -#include -#include -#include -#include -#include -#include - -K_PLUGIN_FACTORY(KatePluginHelloWorldFactory, registerPlugin();) -K_EXPORT_PLUGIN(KatePluginHelloWorldFactory(KAboutData("katehelloworld","katehelloworld",ki18n("Hello World"), "0.1", ki18n("Example kate plugin"))) ) - -KatePluginHelloWorld::KatePluginHelloWorld( QObject* parent, const QList& ) - : Kate::Plugin( (Kate::Application*)parent, "kate-hello-world-plugin" ) -{ -} - -KatePluginHelloWorld::~KatePluginHelloWorld() -{ -} - -Kate::PluginView *KatePluginHelloWorld::createView( Kate::MainWindow *mainWindow ) -{ - return new KatePluginHelloWorldView( mainWindow ); -} - - -KatePluginHelloWorldView::KatePluginHelloWorldView( Kate::MainWindow *mainWin ) - : Kate::PluginView( mainWin ), - Kate::XMLGUIClient(KatePluginHelloWorldFactory::componentData()) -{ - KAction *a = actionCollection()->addAction( "edit_insert_helloworld" ); - a->setText( i18n("Insert Hello World") ); - connect( a, SIGNAL(triggered(bool)), this, SLOT(slotInsertHello()) ); - - mainWindow()->guiFactory()->addClient( this ); -} - -KatePluginHelloWorldView::~KatePluginHelloWorldView() -{ - mainWindow()->guiFactory()->removeClient( this ); -} - -void KatePluginHelloWorldView::slotInsertHello() -{ - if (!mainWindow()) { - return; - } - - KTextEditor::View *kv = mainWindow()->activeView(); - - if (kv) { - kv->insertText( "Hello World" ); - } -} - -void KatePluginHelloWorldView::readSessionConfig( KConfigBase* config, const QString& groupPrefix ) -{ - // If you have session-dependant settings, load them here. - // If you have application wide settings, you have to read your own KConfig, - // see the Kate::Plugin docs for more information. - Q_UNUSED( config ); - Q_UNUSED( groupPrefix ); -} - -void KatePluginHelloWorldView::writeSessionConfig( KConfigBase* config, const QString& groupPrefix ) -{ - // If you have session-dependant settings, save them here. - // If you have application wide settings, you have to create your own KConfig, - // see the Kate::Plugin docs for more information. - Q_UNUSED( config ); - Q_UNUSED( groupPrefix ); -} - -// kate: space-indent on; indent-width 2; replace-tabs on; - diff --git a/kate/addons/kate/helloworld/plugin_katehelloworld.h b/kate/addons/kate/helloworld/plugin_katehelloworld.h deleted file mode 100644 index 895fac56..00000000 --- a/kate/addons/kate/helloworld/plugin_katehelloworld.h +++ /dev/null @@ -1,57 +0,0 @@ -/* This file is part of the Kate project. - * - * Copyright (C) 2010 Christoph Cullmann - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _PLUGIN_KATE_HELLOWORLD_H_ -#define _PLUGIN_KATE_HELLOWORLD_H_ - -#include -#include -#include - -class KatePluginHelloWorld : public Kate::Plugin -{ - Q_OBJECT - - public: - explicit KatePluginHelloWorld( QObject* parent = 0, const QList& = QList() ); - virtual ~KatePluginHelloWorld(); - - Kate::PluginView *createView( Kate::MainWindow *mainWindow ); -}; - -class KatePluginHelloWorldView : public Kate::PluginView, public Kate::XMLGUIClient -{ - Q_OBJECT - - public: - KatePluginHelloWorldView( Kate::MainWindow *mainWindow ); - ~KatePluginHelloWorldView(); - - virtual void readSessionConfig( KConfigBase* config, const QString& groupPrefix ); - virtual void writeSessionConfig( KConfigBase* config, const QString& groupPrefix ); - - public slots: - void slotInsertHello(); -}; - -#endif - -// kate: space-indent on; indent-width 2; replace-tabs on; - diff --git a/kate/addons/kate/helloworld/ui.rc b/kate/addons/kate/helloworld/ui.rc deleted file mode 100644 index ccc2dac0..00000000 --- a/kate/addons/kate/helloworld/ui.rc +++ /dev/null @@ -1,8 +0,0 @@ - - - - &Tools - - - - diff --git a/kate/addons/kate/openheader/CMakeLists.txt b/kate/addons/kate/openheader/CMakeLists.txt deleted file mode 100644 index dd6f2b39..00000000 --- a/kate/addons/kate/openheader/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -########### next target ############### - -kde4_add_plugin(kateopenheaderplugin plugin_kateopenheader.cpp) - -target_link_libraries(kateopenheaderplugin - kateinterfaces - KDE4::kio - KDE4::kparts - KDE4::ktexteditor -) - -install( - TARGETS kateopenheaderplugin - DESTINATION ${KDE4_PLUGIN_INSTALL_DIR} -) - -########### install files ############### - -install( - FILES ui.rc - DESTINATION ${KDE4_DATA_INSTALL_DIR}/kate/plugins/kateopenheader -) -install( - FILES kateopenheader.desktop - DESTINATION ${KDE4_SERVICES_INSTALL_DIR} -) diff --git a/kate/addons/kate/openheader/Messages.sh b/kate/addons/kate/openheader/Messages.sh deleted file mode 100644 index 3d2878ac..00000000 --- a/kate/addons/kate/openheader/Messages.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh -$EXTRACTRC *.rc >> rc.cpp -$XGETTEXT *.cpp -o $podir/kateopenheader.pot diff --git a/kate/addons/kate/openheader/kateopenheader.desktop b/kate/addons/kate/openheader/kateopenheader.desktop deleted file mode 100644 index 068b45cf..00000000 --- a/kate/addons/kate/openheader/kateopenheader.desktop +++ /dev/null @@ -1,116 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=Kate/Plugin -X-KDE-Library=kateopenheaderplugin -X-Kate-Version=2.8 -Name=Open Header -Name[ar]=افتح الترويسة -Name[ast]=Abrir cabecera -Name[bg]=Отваряне на header -Name[bs]=Otvaranje zaglavlja -Name[ca]=Obre capçaleres -Name[ca@valencia]=Obri capçaleres -Name[cs]=Otevřít hlavičku -Name[da]=Åbn headerfil -Name[de]=Header öffnen -Name[el]=Άνοιγμα κεφαλίδας -Name[en_GB]=Open Header -Name[es]=Abrir cabecera -Name[et]=Päiseavaja -Name[eu]=Ireki goiburua -Name[fi]=Avaa otsake -Name[fr]=Ouvrir un fichier d'en-tête -Name[ga]=Oscail Comhad Ceanntáisc -Name[gl]=Abrir a cabeceira -Name[he]=פתח קובץ כותרת -Name[hu]=Fejlécböngésző -Name[ia]=Aperi capite (header) -Name[it]=Apri intestazioni -Name[ja]=オープンヘッダ -Name[kk]=Айдарын ашу -Name[km]=បើក​បឋមកថា​ -Name[ko]=헤더 열기 -Name[lt]=Atverti antraštę -Name[lv]=Atvērt galveni -Name[mr]=हेडर उघडा -Name[nb]=Åpne deklarasjonsfil -Name[nds]=Koppdatei opmaken -Name[nl]=OpenHeader -Name[nn]=Opna deklarasjonsfil -Name[pa]=ਹੈੱਡਰ ਖੋਲ੍ਹੋ -Name[pl]=Otwórz plik nagłówkowy -Name[pt]=Abrir um Ficheiro de Inclusão -Name[pt_BR]=Abrir arquivo de inclusão -Name[ro]=Deschide antet -Name[ru]=Открытие заголовочного файла -Name[si]=ශීර්ෂය විවෘතකරන්න -Name[sk]=Otvoriť hlavičku -Name[sl]=Odpiranje glav -Name[sr]=Отварање заглавља -Name[sr@ijekavian]=Отварање заглавља -Name[sr@ijekavianlatin]=Otvaranje zaglavlja -Name[sr@latin]=Otvaranje zaglavlja -Name[sv]=Öppna deklarationsfil -Name[tg]=Кушодани сарлавҳа -Name[tr]=Başlığı Aç -Name[ug]=باشنى ئاچ -Name[uk]=Відкрити заголовок -Name[x-test]=xxOpen Headerxx -Name[zh_CN]=打开头文件 -Name[zh_TW]=開啟標頭 -Comment=Opens the corresponding .h/[.cpp|.c] file -Comment[ar]=يفتح ملف ‎.h/[.cpp|.c] ‎ المناسب -Comment[ast]=Abre'l correspondiente ficheru .h/[.cpp|.c] -Comment[bg]=Отваряне на съответните файлове .h/[.cpp|.c] -Comment[bs]=Otvara pridruženu .h/[.cpp|.c] datoteku -Comment[ca]=Obre el fitxer .h/[.cpp|.c] corresponent -Comment[ca@valencia]=Obri el fitxer .h/[.cpp|.c] corresponent -Comment[cs]=Otevře odpovídající soubor .h/[.cpp|.c] -Comment[da]=Åbner den tilhørende .h/[.cpp|.c]-fil -Comment[de]=Öffnet die zusammengehörigen .h/[.cpp|.c]-Dateien -Comment[el]=Άνοιγμα του αντίστοιχου αρχείου .h/[.cpp|.c] -Comment[en_GB]=Opens the corresponding .h/[.cpp|.c] file -Comment[es]=Abre el correspondiente archivo .h/[.cpp|.c] -Comment[et]=Vastava .h/[.cpp|.c] faili avamine -Comment[eu]=Dagokion .h/[.cpp|.c] fitxategia irekitzen du -Comment[fi]=Avaa vastaavan .h/[.cpp|.c]-tiedoston -Comment[fr]=Ouvre le fichier .h / [.cpp |.c] correspondant -Comment[ga]=Oscail an comhad .h/[.cpp|.c] a fhreagraíonn leis an gceann seo -Comment[gl]=Abre o ficheiro .h/[.cpp|.c] correspondente -Comment[he]=פותח את הקובץ המתאים (file.h, file.cpp) -Comment[hu]=Megnyitja a megfelelő .h/[.cpp|.c] fájlt -Comment[ia]=Aperi le correspondente file .h/[.cpp].c] -Comment[it]=Apre il file .h/[.cpp|.c] corrispondente -Comment[ja]=対応する .h/[.cpp|.c] ファイルを開きます -Comment[kk]=Сәйкесті .h/[.cpp|.c] файлын ашу -Comment[km]=បើក​ឯកសារ​ដែល​ត្រូវ​នឹង .h/[.cpp|.c] -Comment[ko]=해당하는 .h/[.cpp|.c] 파일 열기 -Comment[lt]=Atveria atitinkamą .h/[.cpp|.c] failą -Comment[lv]=Atver atbilstošo .h/[.cpp|.c] datni -Comment[mr]=संबंधित .h/[.cpp|.c] फाईल उघडतो -Comment[nb]=Åpner tilhørende .h/[.cpp|.c] fil -Comment[nds]=Maakt de tohören .h/.cpp/.c-Datei op -Comment[ne]=संगत .h/[.cpp|.c] फाइल खोल्दछ -Comment[nl]=Open het bijhorende .h/[.cpp|.c]-bestand -Comment[nn]=Opna tilhøyrande .h/[.cpp|.c]-fil -Comment[pa]=ਸਬੰਧਿਤ .h/[.cpp|.c] ਫਾਇਲ ਖੋਲ੍ਹੋ -Comment[pl]=Otwiera odpowiedni plik .h/[.cpp|.c] -Comment[pt]=Abre o ficheiro .h/[.cpp|.c] correspondente -Comment[pt_BR]=Abre o arquivo .h/[.cpp|.c] correspondente -Comment[ro]=Deschide fișierul .h/[.cpp|.c] corespunzător -Comment[ru]=Открывает соответствующий файл .h/[.cpp|.c] -Comment[si]=අදාල .h/[.cpp|.c] ගොනුව විවෘත කරයි -Comment[sk]=Otvorí korešpondujúci .h/[.cpp|.c] súbor -Comment[sl]=Odpre ustrezno datoteko .h/[.cpp|.c] -Comment[sr]=Отвара придружени .h/[.cpp|.c] фајл -Comment[sr@ijekavian]=Отвара придружени .h/[.cpp|.c] фајл -Comment[sr@ijekavianlatin]=Otvara pridruženi .h/[.cpp|.c] fajl -Comment[sr@latin]=Otvara pridruženi .h/[.cpp|.c] fajl -Comment[sv]=Öppnar den motsvarande .h/[.cpp|.c]-filen -Comment[tg]=Кушодани фаилҳои мувофиқи .h/[.cpp|.c] -Comment[tr]=Uyumlu .h/[.cpp|.c] dosyalarını açar -Comment[ug]=نۆۋەتتىكى ھۆججەت .h/[.cpp.c] غا ماس كەلگەن ھۆججەتنى ئاچىدۇ -Comment[uk]=Відкриває відповідний файл .h/[.cpp|.c] -Comment[x-test]=xxOpens the corresponding .h/[.cpp|.c] filexx -Comment[zh_CN]=打开对应于当前文件的 .h/[.cpp|.c] 文件 -Comment[zh_TW]=開啟相關的 .h/.cpp/.c 檔 diff --git a/kate/addons/kate/openheader/plugin_kateopenheader.cpp b/kate/addons/kate/openheader/plugin_kateopenheader.cpp deleted file mode 100644 index 1617cb9c..00000000 --- a/kate/addons/kate/openheader/plugin_kateopenheader.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Joseph Wenninger - Copyright (C) 2009 Erlend Hamberg - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "plugin_kateopenheader.h" -#include "moc_plugin_kateopenheader.cpp" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -K_PLUGIN_FACTORY(KateOpenHeaderFactory, registerPlugin();) -K_EXPORT_PLUGIN(KateOpenHeaderFactory(KAboutData("kateopenheader","kateopenheader",ki18n("Open Header"), "0.1", ki18n("Open header for a source file"), KAboutData::License_LGPL_V2)) ) - - -PluginViewKateOpenHeader::PluginViewKateOpenHeader(PluginKateOpenHeader *plugin, Kate::MainWindow *mainwindow) - : Kate::PluginView(mainwindow) - , Kate::XMLGUIClient(KateOpenHeaderFactory::componentData()) - , KTextEditor::Command() - , m_plugin(plugin) -{ - KAction *a = actionCollection()->addAction("file_openheader"); - a->setText(i18n("Open .h/.cpp/.c")); - a->setShortcut( Qt::Key_F12 ); - connect( a, SIGNAL(triggered(bool)), plugin, SLOT(slotOpenHeader()) ); - - mainwindow->guiFactory()->addClient (this); - - KTextEditor::CommandInterface* cmdIface = - qobject_cast( Kate::application()->editor() ); - - if( cmdIface ) { - cmdIface->registerCommand( this ); - } -} - -PluginViewKateOpenHeader::~PluginViewKateOpenHeader() -{ - mainWindow()->guiFactory()->removeClient (this); - - KTextEditor::CommandInterface* cmdIface = - qobject_cast( Kate::application()->editor() ); - - if( cmdIface ) { - cmdIface->unregisterCommand( this ); - } -} - -PluginKateOpenHeader::PluginKateOpenHeader( QObject* parent, const QList& ) - : Kate::Plugin ( (Kate::Application *)parent, "open-header-plugin" ) -{ -} - -PluginKateOpenHeader::~PluginKateOpenHeader() -{ -} - -Kate::PluginView *PluginKateOpenHeader::createView (Kate::MainWindow *mainWindow) -{ - return new PluginViewKateOpenHeader(this,mainWindow); -} - -void PluginKateOpenHeader::slotOpenHeader () -{ - if (!application()->activeMainWindow()) - return; - - KTextEditor::View * kv (application()->activeMainWindow()->activeView()); - if (!kv) return; - - KUrl url=kv->document()->url(); - if ((!url.isValid()) || (url.isEmpty())) return; - - QFileInfo info( url.toLocalFile() ); - QString extension = info.suffix().toLower(); - - QStringList headers( QStringList() << "h" << "H" << "hh" << "hpp" ); - QStringList sources( QStringList() << "c" << "cpp" << "cc" << "cp" << "cxx" ); - - if( sources.contains( extension ) ) { - tryOpen( url, headers ); - } else if ( headers.contains( extension ) ) { - tryOpen( url, sources ); - } -} - -void PluginKateOpenHeader::tryOpen( const KUrl& url, const QStringList& extensions ) -{ - if (!application()->activeMainWindow()) - return; - - kDebug() << "Trying to open " << url.pathOrUrl() << " with extensions " << extensions.join(" "); - QString basename = QFileInfo( url.path() ).baseName(); - KUrl newURL( url ); - for( QStringList::ConstIterator it = extensions.begin(); it != extensions.end(); ++it ) { - newURL.setFileName( basename + '.' + *it ); - if( KIO::NetAccess::exists( newURL , KIO::NetAccess::SourceSide, application()->activeMainWindow()->window()) ) - application()->activeMainWindow()->openUrl( newURL ); - newURL.setFileName( basename + '.' + (*it).toUpper() ); - if( KIO::NetAccess::exists( newURL , KIO::NetAccess::SourceSide, application()->activeMainWindow()->window()) ) - application()->activeMainWindow()->openUrl( newURL ); - } -} - -const QStringList& PluginViewKateOpenHeader::cmds() -{ - static QStringList l; - - if (l.empty()) { - l << "toggle-header"; - } - - return l; -} - -bool PluginViewKateOpenHeader::exec(KTextEditor::View *view, const QString &cmd, QString &msg) -{ - Q_UNUSED(view) - Q_UNUSED(cmd) - Q_UNUSED(msg) - - m_plugin->slotOpenHeader(); - return true; -} - -bool PluginViewKateOpenHeader::help(KTextEditor::View *view, const QString &cmd, QString &msg) -{ - Q_UNUSED(view) - Q_UNUSED(cmd) - - msg = "

toggle-header — switch between header and corresponding c/cpp file

" - "

usage: toggle-header

" - "

When editing C or C++ code, this command will switch between a header file and " - "its corresponding C/C++ file or vice verca.

" - "

For example, if you are editing myclass.cpp, toggle-header will change " - "to myclass.h if this file is available.

" - "

Pairs of the following filename suffixes will work:
" - " Header files: h, H, hh, hpp
" - " Source files: c, cpp, cc, cp, cxx

"; - - return true; -} diff --git a/kate/addons/kate/openheader/plugin_kateopenheader.h b/kate/addons/kate/openheader/plugin_kateopenheader.h deleted file mode 100644 index 43957a26..00000000 --- a/kate/addons/kate/openheader/plugin_kateopenheader.h +++ /dev/null @@ -1,61 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Joseph Wenninger - Copyright (C) 2009 Erlend Hamberg - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - - -#ifndef PLUGIN_KATEOPENHEADER_H -#define PLUGIN_KATEOPENHEADER_H - -#include -#include -#include - -class PluginKateOpenHeader : public Kate::Plugin -{ - Q_OBJECT - - public: - explicit PluginKateOpenHeader( QObject* parent = 0, const QList& = QList() ); - virtual ~PluginKateOpenHeader(); - - Kate::PluginView *createView (Kate::MainWindow *mainWindow); - - public slots: - void slotOpenHeader (); - void tryOpen( const KUrl& url, const QStringList& extensions ); -}; - -class PluginViewKateOpenHeader - : public Kate::PluginView - , public Kate::XMLGUIClient - , public KTextEditor::Command -{ - Q_OBJECT - public: - PluginViewKateOpenHeader(PluginKateOpenHeader* plugin, Kate::MainWindow *mainwindow); - virtual ~PluginViewKateOpenHeader(); - - virtual const QStringList &cmds (); - virtual bool exec (KTextEditor::View *view, const QString &cmd, QString &msg); - virtual bool help (KTextEditor::View *view, const QString &cmd, QString &msg); - - private: - PluginKateOpenHeader* m_plugin; -}; - -#endif // PLUGIN_KATEOPENHEADER_H diff --git a/kate/addons/kate/openheader/ui.rc b/kate/addons/kate/openheader/ui.rc deleted file mode 100644 index fe1fdf08..00000000 --- a/kate/addons/kate/openheader/ui.rc +++ /dev/null @@ -1,8 +0,0 @@ - - - - &File - - - - diff --git a/kate/addons/kate/tabbarextension/CMakeLists.txt b/kate/addons/kate/tabbarextension/CMakeLists.txt deleted file mode 100644 index f551b702..00000000 --- a/kate/addons/kate/tabbarextension/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -########### next target ############### - -set(katetabbarextensionplugin_PART_SRCS - plugin_katetabbarextension.cpp - ktinytabbutton.cpp - ktinytabbar.cpp - ktinytabbarconfigdialog.cpp - ktinytabbarconfigpage.cpp -) - -kde4_add_plugin(katetabbarextensionplugin ${katetabbarextensionplugin_PART_SRCS}) - -target_link_libraries(katetabbarextensionplugin - KDE4::kdeui - KDE4::kparts - kateinterfaces -) - -install( - TARGETS katetabbarextensionplugin - DESTINATION ${KDE4_PLUGIN_INSTALL_DIR} -) - -########### install files ############### - -install( - FILES ui.rc - DESTINATION ${KDE4_DATA_INSTALL_DIR}/kate/plugins/katetabbarextension -) -install( - FILES katetabbarextension.desktop - DESTINATION ${KDE4_SERVICES_INSTALL_DIR} -) diff --git a/kate/addons/kate/tabbarextension/Messages.sh b/kate/addons/kate/tabbarextension/Messages.sh deleted file mode 100644 index 2dde84fd..00000000 --- a/kate/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/kate/addons/kate/tabbarextension/katetabbarextension.desktop b/kate/addons/kate/tabbarextension/katetabbarextension.desktop deleted file mode 100644 index 893a9633..00000000 --- a/kate/addons/kate/tabbarextension/katetabbarextension.desktop +++ /dev/null @@ -1,111 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=Kate/Plugin -X-KDE-Library=katetabbarextensionplugin -X-Kate-Version=2.8 -Name=Multiline Tab Bar -Name[ar]=شريط ألسنة متعدّد الأسطر -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[en_GB]=Multiline Tab Bar -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[he]=כרטיסיות בעלות כמה שורות -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]=Çok Satı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[ar]=يضيف شريط ألسنة بصفوف متعدّدة إلى نافذة كيت الرئيسية -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[en_GB]=Adds a tab bar with multiple rows to Kate's main window -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[he]=מוסיף שורת לשוניות עם כמה שורות של לשוניות אל החלון הראשי של 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/kate/addons/kate/tabbarextension/ktinytabbar.cpp b/kate/addons/kate/tabbarextension/ktinytabbar.cpp deleted file mode 100644 index 3f40249f..00000000 --- a/kate/addons/kate/tabbarextension/ktinytabbar.cpp +++ /dev/null @@ -1,1233 +0,0 @@ -/*************************************************************************** - ktinytabbar.cpp - ------------------- - begin : 2005-06-15 - copyright : (C) 2005 by Dominik Haumann - email : dhdev@gmx.de - - Copyright (C) 2007 Flavio Castelli - ***************************************************************************/ - -/*************************************************************************** - 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 "moc_ktinytabbar.cpp" -#include "ktinytabbutton.h" -#include "ktinytabbarconfigpage.h" -#include "ktinytabbarconfigdialog.h" - -#include -#include -#include -#include -#include - -#include // QApplication::sendEvent -#include // 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; - - foreach (KTinyTabButton* 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; - - foreach (KTinyTabButton* 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; - - foreach( KTinyTabButton* 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; - - foreach( KTinyTabButton* 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; - foreach( KTinyTabButton* 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; - foreach( KTinyTabButton* 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; - foreach( KTinyTabButton* tabButton, m_tabButtons ) - tabButton->setHighlightModifiedTabs( modified ); -} - -bool KTinyTabBar::highlightModifiedTabs() const -{ - return m_highlightModifiedTabs; -} - -void KTinyTabBar::setModifiedTabsColor( const QColor& color ) -{ - m_colorModifiedTab = color; - foreach( KTinyTabButton* tabButton, m_tabButtons ) - tabButton->setModifiedTabsColor( color ); -} - -QColor KTinyTabBar::modifiedTabsColor() const -{ - return m_colorModifiedTab; -} - -void KTinyTabBar::removeHighlightMarks() -{ - foreach( KTinyTabButton* tabButton, m_tabButtons ) - { - if( tabButton->highlightColor().isValid() ) - tabButton->setHighlightColor( QColor() ); - } - - m_highlightedTabs.clear(); - emit highlightMarksChanged( this ); -} - -void KTinyTabBar::setHighlightMarks( const QMap& marks ) -{ - m_highlightedTabs = marks; - - foreach( KTinyTabButton* 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 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 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 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 ) -{ -// kDebug() << "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 ); - - foreach( KTinyTabButton* 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 - KTinyTabButton *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/kate/addons/kate/tabbarextension/ktinytabbar.h b/kate/addons/kate/tabbarextension/ktinytabbar.h deleted file mode 100644 index 8a570c65..00000000 --- a/kate/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 - ***************************************************************************/ - -/*************************************************************************** - 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 - -#include -#include -#include -#include - -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& marks ); - QMap highlightMarks() const; - -public slots: - void setCurrentTab( int button_id ); // does not emit signal - void removeHighlightMarks(); - -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 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/kate/addons/kate/tabbarextension/ktinytabbarconfigdialog.cpp b/kate/addons/kate/tabbarextension/ktinytabbarconfigdialog.cpp deleted file mode 100644 index d0b8ff5c..00000000 --- a/kate/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 - - -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 "moc_ktinytabbarconfigdialog.cpp" - -// kate: space-indent on; tab-width 4; replace-tabs off; eol unix; - diff --git a/kate/addons/kate/tabbarextension/ktinytabbarconfigdialog.h b/kate/addons/kate/tabbarextension/ktinytabbarconfigdialog.h deleted file mode 100644 index c4473a69..00000000 --- a/kate/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 - - -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 slots: - void configChanged(); - -private: - KTinyTabBarConfigPage* m_configPage; -}; - -#endif - -// kate: space-indent on; tab-width 4; replace-tabs off; eol unix; diff --git a/kate/addons/kate/tabbarextension/ktinytabbarconfigpage.cpp b/kate/addons/kate/tabbarextension/ktinytabbarconfigpage.cpp deleted file mode 100644 index 8f811c07..00000000 --- a/kate/addons/kate/tabbarextension/ktinytabbarconfigpage.cpp +++ /dev/null @@ -1,426 +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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -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(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(type); - cmbSorting->setCurrentIndex(index); -} - -KTinyTabBar::SortType KTinyTabBarConfigPage::tabSortType() const -{ - return static_cast(cmbSorting->currentIndex()); -} - - -void KTinyTabBarConfigPage::setTabButtonStyle( KTinyTabBar::ButtonStyle style ) -{ - int index = static_cast(style); - cmbStyle->setCurrentIndex(index); -} - -KTinyTabBar::ButtonStyle KTinyTabBarConfigPage::tabButtonStyle() const -{ - return static_cast(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 "moc_ktinytabbarconfigpage.cpp" - -// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs off; eol unix; diff --git a/kate/addons/kate/tabbarextension/ktinytabbarconfigpage.h b/kate/addons/kate/tabbarextension/ktinytabbarconfigpage.h deleted file mode 100644 index 0e2efd72..00000000 --- a/kate/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 -#include - -#include "ktinytabbar.h" -#include "ui_tabbarconfigwidget.h" - -class KColorButton; -class KTinyTabButton; -#include -#include -#include -#include -#include - -/** - * 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; - - -signals: - void changed(); - void removeHighlightMarks(); - -protected 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/kate/addons/kate/tabbarextension/ktinytabbutton.cpp b/kate/addons/kate/tabbarextension/ktinytabbutton.cpp deleted file mode 100644 index 32d083ad..00000000 --- a/kate/addons/kate/tabbarextension/ktinytabbutton.cpp +++ /dev/null @@ -1,398 +0,0 @@ -/*************************************************************************** - ktinytabbutton.cpp - ------------------- - begin : 2005-06-15 - copyright : (C) 2005 by Dominik Haumann - email : dhdev@gmx.de - - Copyright (C) 2007 Flavio Castelli - ***************************************************************************/ - -/*************************************************************************** - 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 "moc_ktinytabbutton.cpp" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -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::MiddleButton) { - 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/kate/addons/kate/tabbarextension/ktinytabbutton.h b/kate/addons/kate/tabbarextension/ktinytabbutton.h deleted file mode 100644 index 64730f13..00000000 --- a/kate/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 - ***************************************************************************/ - -/*************************************************************************** - 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 -#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; - -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 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/kate/addons/kate/tabbarextension/plugin_katetabbarextension.cpp b/kate/addons/kate/tabbarextension/plugin_katetabbarextension.cpp deleted file mode 100644 index f116b66c..00000000 --- a/kate/addons/kate/tabbarextension/plugin_katetabbarextension.cpp +++ /dev/null @@ -1,293 +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 -#include - -#include -#include -#include -#include - -#include - -#include -//END - - -K_PLUGIN_FACTORY(KateTabBarExtensionFactory, registerPlugin();) -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(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()), - 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(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 ) -{ - // kDebug() << "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 ) -{ - kDebug() << "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& ) - : 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 "moc_plugin_katetabbarextension.cpp" - -// kate: space-indent on; indent-width 2; tab-width 4; replace-tabs off; eol unix; diff --git a/kate/addons/kate/tabbarextension/plugin_katetabbarextension.h b/kate/addons/kate/tabbarextension/plugin_katetabbarextension.h deleted file mode 100644 index 7c0fc700..00000000 --- a/kate/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 -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include -#include -#include - -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 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 id2doc; - QMap doc2id; -}; - -class KatePluginTabBarExtension : public Kate::Plugin -{ - Q_OBJECT - - public: - explicit KatePluginTabBarExtension( QObject* parent = 0, const QList& = QList() ); - virtual ~KatePluginTabBarExtension(); - - Kate::PluginView *createView (Kate::MainWindow *mainWindow); - - void readSessionConfig (KConfigBase* config, const QString& groupPrefix); - void writeSessionConfig (KConfigBase* config, const QString& groupPrefix); - - protected slots: - void tabbarSettingsChanged( KTinyTabBar* tabbar ); - void tabbarHighlightMarksChanged( KTinyTabBar* tabbar ); - - private: - QList m_views; -}; - -#endif // PLUGIN_KATETABBAREXTENSION_H diff --git a/kate/addons/kate/tabbarextension/tabbarconfigwidget.ui b/kate/addons/kate/tabbarextension/tabbarconfigwidget.ui deleted file mode 100644 index c0372b66..00000000 --- a/kate/addons/kate/tabbarextension/tabbarconfigwidget.ui +++ /dev/null @@ -1,495 +0,0 @@ - - TabBarConfigWidget - - - - - - Behavior - - - - - - Location: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - Top - - - - - Bottom - - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 98 - 53 - - - - - - - - Rows: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - rows - - - 1 - - - 10 - - - - - - - Sorting: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - Keep activated tab visible - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 0 - 28 - - - - - - - - - - - - - Opening Order - - - - - Document Name - - - - - Document URL - - - - - File Extension - - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 0 - 17 - - - - - - - - - - - - - Tabs - - - - - - Minimum width: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - pixels - - - 20 - - - 500 - - - - - - - Qt::Horizontal - - - - 11 - 96 - - - - - - - - Maximum width: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 20 pixels - - - pixels - - - 20 - - - 500 - - - - - - - Height: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 16 pixels - - - pixels - - - 16 - - - 60 - - - - - - - Style: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - Buttons - - - - - Flat - - - - - - - - - - - Highlighting - - - - - - - - - - false - - - - - - - Highlight modified tabs - - - - - - - false - - - - - - - Highlight active tab - - - - - - - false - - - - - - - Highlight previous tab - - - - - - - Opacity: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - 100 - - - Qt::Horizontal - - - - - - - - - Qt::Horizontal - - - - 241 - 108 - - - - - - - - - - - - Note: Use the context menu to highlight a tab - - - - - - - Qt::Horizontal - - - - 0 - 13 - - - - - - - - Remove all highlight marks in the current session. - - - Clear Highlight Cache - - - - - - - - - - - - Preview - - - - - - - - KColorButton - QPushButton -
kcolorbutton.h
-
-
- - cmbLocation - sbRows - chkFollowActive - cmbSorting - cmbStyle - sbMinWidth - sbMaxWidth - sbHeight - chkModified - colModified - chkActive - colActive - chkPrevious - colPrevious - slOpacity - btnClearCache - - - - chkModified - toggled(bool) - colModified - setEnabled(bool) - - - 111 - 237 - - - 50 - 238 - - - - - chkActive - toggled(bool) - colActive - setEnabled(bool) - - - 96 - 273 - - - 55 - 268 - - - - - chkPrevious - toggled(bool) - colPrevious - setEnabled(bool) - - - 84 - 297 - - - 60 - 303 - - - - -
diff --git a/kate/addons/kate/tabbarextension/ui.rc b/kate/addons/kate/tabbarextension/ui.rc deleted file mode 100644 index 953a8121..00000000 --- a/kate/addons/kate/tabbarextension/ui.rc +++ /dev/null @@ -1,7 +0,0 @@ - - - - Tab Bar Extension - - -