diff options
Diffstat (limited to 'kicker/menuext/system')
-rw-r--r-- | kicker/menuext/system/Makefile.am | 15 | ||||
-rw-r--r-- | kicker/menuext/system/systemmenu.cpp | 91 | ||||
-rw-r--r-- | kicker/menuext/system/systemmenu.desktop | 127 | ||||
-rw-r--r-- | kicker/menuext/system/systemmenu.h | 50 |
4 files changed, 283 insertions, 0 deletions
diff --git a/kicker/menuext/system/Makefile.am b/kicker/menuext/system/Makefile.am new file mode 100644 index 000000000..aa5d3d33f --- /dev/null +++ b/kicker/menuext/system/Makefile.am @@ -0,0 +1,15 @@ +INCLUDES = -I$(top_srcdir)/kicker/libkicker $(all_includes) + +kde_module_LTLIBRARIES = kickermenu_systemmenu.la + +kickermenu_systemmenu_la_SOURCES = systemmenu.cpp +kickermenu_systemmenu_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined +kickermenu_systemmenu_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO) $(top_builddir)/kicker/libkicker/libkickermain.la + +kickermenu_systemmenu_la_METASOURCES = AUTO + +desktopmenu_DATA = systemmenu.desktop +desktopmenudir = $(kde_datadir)/kicker/menuext + +messages: + $(XGETTEXT) *.cpp -o $(podir)/libkickermenu_systemmenu.pot diff --git a/kicker/menuext/system/systemmenu.cpp b/kicker/menuext/system/systemmenu.cpp new file mode 100644 index 000000000..68c3f5c66 --- /dev/null +++ b/kicker/menuext/system/systemmenu.cpp @@ -0,0 +1,91 @@ +/* This file is part of the KDE project + Copyright (c) 2004 Kevin Ottens <ervin ipsquad net> + + 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 "systemmenu.h" + +#include <krun.h> +#include <kiconloader.h> +#include <qpixmap.h> + +#include "global.h" + +K_EXPORT_KICKER_MENUEXT(systemmenu, SystemMenu) + + +SystemMenu::SystemMenu(QWidget *parent, const char *name, + const QStringList &/*args*/) + : KPanelMenu( parent, name) +{ + connect( &m_dirLister, SIGNAL( completed() ), + this, SLOT( slotCompleted() ) ); + + m_dirLister.openURL(KURL("system:/")); +} + +SystemMenu::~SystemMenu() +{ +} + +void SystemMenu::append(const QString &icon, const KURL &url, + const QString &label) +{ + int id = insertItem(KickerLib::menuIconSet(icon), label); + m_urlMap.insert(id, url); +} + +void SystemMenu::initialize() +{ + if (isVisible()) return; + + clear(); + + if (m_entries.isEmpty()) + { + insertItem(i18n("Empty...")); + return; + } + + m_urlMap.clear(); + + KFileItemList::ConstIterator it = m_entries.begin(); + KFileItemList::ConstIterator end = m_entries.end(); + + for (; it!=end; ++it) + { + QString icon = (*it)->iconName(); + KURL url = (*it)->url(); + QString name = (*it)->name(); + append(icon, url, name); + } +} + +void SystemMenu::slotExec(int id) +{ + if(!m_urlMap.contains(id)) return; + + new KRun(m_urlMap[id]); // will delete itself +} + +void SystemMenu::slotCompleted() +{ + m_entries = m_dirLister.items(KDirLister::AllItems); + setInitialized(false); +} + +#include "systemmenu.moc" diff --git a/kicker/menuext/system/systemmenu.desktop b/kicker/menuext/system/systemmenu.desktop new file mode 100644 index 000000000..29156838c --- /dev/null +++ b/kicker/menuext/system/systemmenu.desktop @@ -0,0 +1,127 @@ +[Desktop Entry] +Name=System Menu +Name[af]=Stelsel Kieslys +Name[ar]=قائمة النظام +Name[be]=Сістэмнае меню +Name[bg]=Системно меню +Name[bn]=সিস্টেম মেনু +Name[br]=Meuziad ar reizhiad +Name[bs]=Sistemski meni +Name[ca]=Menú de sistema +Name[cs]=Systémová nabídka +Name[csb]=Systema +Name[cy]=Dewislen y Cysawd +Name[da]=Systemmenu +Name[de]=System-Menü +Name[el]=Μενού συστήματος +Name[eo]=SistemMenuo +Name[es]=Menú del sistema +Name[et]=Süsteemi menüü +Name[eu]=Sistemaren menua +Name[fa]=گزینگان سیستم +Name[fi]=Järjestelmävalikko +Name[fr]=Menu du système +Name[fy]=Systeemmenu +Name[ga]=Roghchlár an Chórais +Name[gl]=Sistema +Name[he]=תפריט מערכת +Name[hr]=Sistemski izbornik +Name[hu]=Rendszermenü +Name[is]=Kerfisvalmynd +Name[it]=Menu di Sistema +Name[ja]=システムメニュー +Name[ka]=სისტემის მენიუ +Name[kk]=Жүйе мәзірі +Name[km]=ប្រព័ន្ធម៉ឺនុយ +Name[lt]=Sistemos meniu +Name[mk]=Системско мени +Name[nb]=Systemmeny +Name[nds]=Systeem-Menü +Name[ne]=प्रणाली मेनु +Name[nl]=Systeemmenu +Name[nn]=Systemmeny +Name[pa]=ਸਿਸਟਮ ਮੇਨੂ +Name[pl]=System +Name[pt]=Menu do Sistema +Name[pt_BR]=Menu Sistema +Name[ro]=Meniu sistem +Name[ru]=Система +Name[se]=Vuogádatfállu +Name[sk]=Systémové menu +Name[sl]=Sistem +Name[sr]=Системски мени +Name[sr@Latn]=Sistemski meni +Name[sv]=Systemmeny +Name[te]=వ్యవస్థ పట్టి +Name[tg]=Менюи система +Name[th]=เมนูระบบ +Name[tr]=Sistem Menüsü +Name[uk]=Системне меню +Name[uz]=Tizim menyusi +Name[uz@cyrillic]=Тизим менюси +Name[vi]=Thực đơn Hệ thống +Name[wa]=Dressêye sistinme +Name[zh_CN]=系统菜单 +Name[zh_TW]=系統選單 +Comment=Menu of important system places +Comment[af]=Kieslys vir belangrike stelsel plekke +Comment[ar]=قائمة أمكنة النظام الهامة +Comment[be]=Меню важных сістэмных месцаў +Comment[bg]=Меню за достъп до системните директории +Comment[bn]=সিস্টেমের গুরুত্বপূর্ণ অবস্থানগুলির তালিকা +Comment[bs]=Meni sa sistemskim lokacijama +Comment[ca]=Menú de llocs importants del sistema +Comment[cs]=Nabídka důležitých systémových míst +Comment[csb]=Menu z wôżnëma placama systemë +Comment[da]=Menu med vigtige steder på systemet +Comment[de]=Einfacher Zugriff auf Systemordner +Comment[el]=Μενού σημαντικών τοποθεσιών του συστήματος +Comment[eo]=Menuo de gravaj sistemlokoj +Comment[es]=Menú de lugares importantes del sistema +Comment[et]=Olulisemate süsteemi osade menüü +Comment[eu]=Sistemaren leku garrantzitsuen menua +Comment[fa]=گزینگان جاهای مهم سیستم +Comment[fi]=Järjestelmän tärkeiden asetuksien valikko +Comment[fr]=Menu dirigeant vers les endroits importants du système +Comment[fy]=Menu mei wichtige systeemgebieden +Comment[gl]=Aceso doado a lugares de importáncia para o sistema +Comment[he]=תפריט של מקומות מערכת חשובים +Comment[hr]=Izbornik važnih lokacija sustava +Comment[hu]=A rendszerkönyvtárak menüje +Comment[is]=Fljótleg leið að mikilvægum kerfishlutum +Comment[it]=Menu con gli oggetti importanti del sistema +Comment[ja]=システムの重要な場所にアクセスするためのメニュー +Comment[ka]=სისტემის მნიშვნელოვან ადგილთა მენიუ +Comment[kk]=Маңызды жүйелік орындарының мәзірі +Comment[km]=ម៉ឺនុយកន្លែងប្រព័ន្ធសំខាន់ +Comment[lt]=Svarbių sistemos vietų meniu +Comment[mk]=Мени со важни системски ресурси +Comment[nb]=Meny over viktige systemsteder +Comment[nds]=Menü vun wichtig Systeemornern +Comment[ne]=महत्वपूर्ण प्रणाली स्थानको मेनु +Comment[nl]=Menu met belangrijke systeemgebieden +Comment[nn]=Meny over viktige systemstader +Comment[pa]=ਸਿਸਟਮ ਥਾਵਾਂ ਲ਼ਈ ਮੇਨੂ +Comment[pl]=Menu z ważnymi miejscami systemu +Comment[pt]=Um menu com os locais importantes do sistema +Comment[pt_BR]=Acesso fácil a locais importantes do sistema +Comment[ro]=Meniu cu locații importante din sistem +Comment[ru]=Быстрый доступ к системным ресурсам +Comment[se]=Fállu mii čájeha dehálaš báikkiid vuogádagas +Comment[sk]=Menu dôležitých systémových miest +Comment[sl]=Meni s pomembnimi sistemskimi lokacijami +Comment[sr]=Мени важних места на систему +Comment[sr@Latn]=Meni važnih mesta na sistemu +Comment[sv]=Meny med viktiga systemplatser +Comment[th]=เมนูสำหรับที่สำคัญๆ ของระบบ +Comment[tr]=Önemli sistem yerlerinin menüsü +Comment[uk]=Меню важливих місць в системі +Comment[uz]=Tizimda muhim boʻlgan joylarning menyusi +Comment[uz@cyrillic]=Тизимда муҳим бўлган жойларнинг менюси +Comment[vi]=Thực đơn chứa các liên kết hệ thống quan trọng +Comment[wa]=Dressêye des impôrtantès plaeces do sistinmes +Comment[zh_CN]=重要系统位置的菜单 +Comment[zh_TW]=重要系統位置選單 +Icon=system + +X-KDE-Library=kickermenu_systemmenu diff --git a/kicker/menuext/system/systemmenu.h b/kicker/menuext/system/systemmenu.h new file mode 100644 index 000000000..6f118d21c --- /dev/null +++ b/kicker/menuext/system/systemmenu.h @@ -0,0 +1,50 @@ +/* This file is part of the KDE project + Copyright (c) 2004 Kevin Ottens <ervin ipsquad net> + + 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 SYSTEMMENU_H +#define SYSTEMMENU_H + +#include <kpanelmenu.h> +#include <kurl.h> +#include <kdirlister.h> +#include <kfileitem.h> + +class SystemMenu : public KPanelMenu +{ + Q_OBJECT + + public: + SystemMenu(QWidget *parent, const char *name, + const QStringList & /*args*/); + ~SystemMenu(); + + protected slots: + void initialize(); + void slotExec(int id); + + void slotCompleted(); + + private: + void append(const QString &icon, const KURL &url, const QString &label); + KDirLister m_dirLister; + KFileItemList m_entries; + QMap<int, KURL> m_urlMap; +}; + +#endif |