From 4aed2c8219774f5d797760606b8489a92ddc5163 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kicker/menuext/kdeprint/Makefile.am | 15 ++++ kicker/menuext/kdeprint/print_mnu.cpp | 139 ++++++++++++++++++++++++++++ kicker/menuext/kdeprint/print_mnu.h | 46 ++++++++++ kicker/menuext/kdeprint/printmenu.desktop | 144 ++++++++++++++++++++++++++++++ 4 files changed, 344 insertions(+) create mode 100644 kicker/menuext/kdeprint/Makefile.am create mode 100644 kicker/menuext/kdeprint/print_mnu.cpp create mode 100644 kicker/menuext/kdeprint/print_mnu.h create mode 100644 kicker/menuext/kdeprint/printmenu.desktop (limited to 'kicker/menuext/kdeprint') diff --git a/kicker/menuext/kdeprint/Makefile.am b/kicker/menuext/kdeprint/Makefile.am new file mode 100644 index 000000000..051c087fb --- /dev/null +++ b/kicker/menuext/kdeprint/Makefile.am @@ -0,0 +1,15 @@ +INCLUDES = $(all_includes) + +kde_module_LTLIBRARIES = kickermenu_kdeprint.la + +kickermenu_kdeprint_la_SOURCES = print_mnu.cpp +kickermenu_kdeprint_la_LDFLAGS = $(all_libraries) -module -avoid-version +kickermenu_kdeprint_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO) -lkdeprint + +kickermenu_kdeprint_la_METASOURCES = AUTO + +desktopmenu_DATA = printmenu.desktop +desktopmenudir = $(kde_datadir)/kicker/menuext + +messages: + $(XGETTEXT) *.cpp -o $(podir)/libkickermenu_kdeprint.pot diff --git a/kicker/menuext/kdeprint/print_mnu.cpp b/kicker/menuext/kdeprint/print_mnu.cpp new file mode 100644 index 000000000..8b2679432 --- /dev/null +++ b/kicker/menuext/kdeprint/print_mnu.cpp @@ -0,0 +1,139 @@ +/***************************************************************** + +Copyright (c) 1996-2001 the kicker authors. See file AUTHORS. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +******************************************************************/ + +#include "print_mnu.h" +#include +#include +#include +#include +#include +#include +#include + +K_EXPORT_KICKER_MENUEXT(kdeprint, PrintMenu) + +#define ADD_PRINTER_ID 0 +#define KDEPRINT_SETTINGS_ID 1 +#define CONFIG_SERVER_ID 2 +#define PRINT_MANAGER_ID 3 +#define PRINT_BROWSER_ID 4 +#define KPRINTER_ID 5 +#define PRINTER_LIST_ID 10 + +PrintMenu::PrintMenu(QWidget *parent, const char *name, const QStringList & /*args*/) +: KPanelMenu("", parent, name) +{ + static bool kdeprintIconsInitialized = false; + if ( !kdeprintIconsInitialized ) { + KGlobal::iconLoader()->addAppDir("kdeprint"); + kdeprintIconsInitialized = true; + } +} + +PrintMenu::~PrintMenu() +{ +} + +void PrintMenu::initialize() +{ + if (initialized()) clear(); + setInitialized(true); + + int ID = PRINTER_LIST_ID; + // just to be sure the plugin is loaded -> icons are available + KMManager::self(); + + if ((KMManager::self()->printerOperationMask() & KMManager::PrinterCreation) && KMManager::self()->hasManagement()) + insertItem(SmallIconSet("wizard"), i18n("Add Printer..."), ADD_PRINTER_ID); + insertItem(SmallIconSet("kdeprint_configmgr"), i18n("KDE Print Settings"), KDEPRINT_SETTINGS_ID); + if (KMManager::self()->serverOperationMask() & KMManager::ServerConfigure) + insertItem(SmallIconSet("kdeprint_configsrv"), i18n("Configure Server"), CONFIG_SERVER_ID); + insertSeparator(); + insertItem(SmallIconSet("kcontrol"), i18n("Print Manager"), PRINT_MANAGER_ID); + insertItem(SmallIconSet("konqueror"), i18n("Print Browser (Konqueror)"), PRINT_BROWSER_ID); + insertSeparator(); + insertItem(SmallIconSet("fileprint"), i18n("Print File..."), KPRINTER_ID); + + // printer list + QPtrList *l = KMManager::self()->printerList(); + if (l && !l->isEmpty()) + { + bool separatorInserted = false; + QPtrListIterator it(*l); + for (; it.current(); ++it) + { + // no special, implicit or pure instances + if (it.current()->isSpecial() || it.current()->isVirtual()) + continue; + if (!separatorInserted) + { + // we insert a separator only when we find the first + // printer + insertSeparator(); + separatorInserted = true; + } + insertItem(SmallIconSet(it.current()->pixmap()), + it.current()->printerName(), ID++); + } + } +} + +void PrintMenu::slotExec(int ID) +{ + switch (ID) + { + case ADD_PRINTER_ID: + kapp->kdeinitExec("kaddprinterwizard"); + break; + case KDEPRINT_SETTINGS_ID: + kapp->kdeinitExec("kaddprinterwizard", QStringList("--kdeconfig")); + break; + case CONFIG_SERVER_ID: + kapp->kdeinitExec("kaddprinterwizard", QStringList("--serverconfig")); + break; + case PRINT_MANAGER_ID: + KRun::runCommand("kcmshell kde-printers.desktop"); + break; + case PRINT_BROWSER_ID: + KRun::runCommand("kfmclient openProfile filemanagement print:/", "kfmclient", "konqueror"); + break; + case KPRINTER_ID: + kapp->kdeinitExec("kprinter"); + break; + default: + { + // start kjobviewer + QStringList args; + args << "--show" << "-d" << text(ID).remove('&'); + kapp->kdeinitExec("kjobviewer", args); + } + break; + } +} + +void PrintMenu::reload() +{ + initialize(); +} + +#include "print_mnu.moc" diff --git a/kicker/menuext/kdeprint/print_mnu.h b/kicker/menuext/kdeprint/print_mnu.h new file mode 100644 index 000000000..a80da4be2 --- /dev/null +++ b/kicker/menuext/kdeprint/print_mnu.h @@ -0,0 +1,46 @@ +/***************************************************************** + +Copyright (c) 1996-2001 the kicker authors. See file AUTHORS. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +******************************************************************/ + +#ifndef _print_mnu_h_ +#define _print_mnu_h_ + +#include +#include + +class PrintMenu : public KPanelMenu, public KPReloadObject +{ + Q_OBJECT + +public: + PrintMenu(QWidget *parent, const char *name, const QStringList & /*args*/); + ~PrintMenu(); + +protected slots: + void slotExec(int id); + void initialize(); + +protected: + void reload(); +}; + +#endif diff --git a/kicker/menuext/kdeprint/printmenu.desktop b/kicker/menuext/kdeprint/printmenu.desktop new file mode 100644 index 000000000..2bc90f1b8 --- /dev/null +++ b/kicker/menuext/kdeprint/printmenu.desktop @@ -0,0 +1,144 @@ +[Desktop Entry] +Name=Print System +Name[af]=Drukker Stelsel +Name[ar]=نظام الطباعة +Name[az]=Çap Sistemi +Name[be]=Сістэма друку +Name[bg]=Система за печат +Name[bn]=মুদ্রণ ব্যবস্থা +Name[br]=Reizhiad moulañ +Name[bs]=Sistem štampe +Name[ca]=Sistema d'impressió +Name[cs]=Tiskový systém +Name[csb]=Systema drëkù +Name[cy]=Cysawd Argraffu +Name[da]=Udskriftssystem +Name[de]=Drucksystem +Name[el]=Σύστημα εκτύπωσης +Name[eo]=Printosistemo +Name[es]=Sistema de impresión +Name[et]=Trükkimissüsteem +Name[eu]=Inprimaketa sistema +Name[fa]=سیستم چاپ +Name[fi]=Tulostusjärjestelmä +Name[fr]=Système d'impression +Name[fy]=Printsysteem +Name[ga]=Córas Priontála +Name[gl]=Sistema de Impresión +Name[he]=מערכת הדפסה +Name[hi]=छापा तंत्र +Name[hr]=Sustav za ispisivanje +Name[hu]=Nyomtatási rendszer +Name[is]=Prentkerfi +Name[it]=Sistema di stampa +Name[ja]=印刷システム +Name[ka]=ბეჭდვის სისტემა +Name[kk]=Басып шығару +Name[km]=ប្រព័ន្ធ​បោះពុម្ព +Name[ko]=모던 시스템 +Name[ku]=Pergala Çapkirinê +Name[lo]=ລະບົບການພິມ +Name[lt]=Spausdinimo sistema +Name[lv]=Drukas Sistēma +Name[mk]=Печатарски систем +Name[mn]=Хэвлэх систем +Name[ms]=Cetak Sistem +Name[mt]=Sistema tal-ipprintjar +Name[nb]=Utskriftsystem +Name[nds]=Drucksysteem +Name[ne]=मुद्रण प्रणाली +Name[nl]=Afdruksysteem +Name[nn]=Utskriftssystem +Name[nso]=System ya Kgatiso +Name[pa]=ਪਰਿੰਟ ਸਿਸਟਮ +Name[pl]=System drukowania +Name[pt]=Sistema de Impressão +Name[pt_BR]=Sistema de Impressão +Name[ro]=Sistem de tipărire +Name[ru]=Система печати +Name[rw]=Sisitemu Gucapa +Name[se]=Čálihanvuogádat +Name[sk]=Tlačový systém +Name[sl]=Tiskalniški sistem +Name[sr]=Систем за штампу +Name[sr@Latn]=Sistem za štampu +Name[sv]=Skrivarsystem +Name[ta]=அச்சு அமைப்பு +Name[te]=ప్రచురణ వ్యవస్థ +Name[tg]=Системаи Чоп +Name[th]=ระบบการพิมพ์ +Name[tr]=Yazıcı Sistemi +Name[tt]=Bastıru Sisteme +Name[uk]=Система друку +Name[uz]=Bosib chiqarish tizimi +Name[uz@cyrillic]=Босиб чиқариш тизими +Name[ven]=Maitele au phirintha +Name[vi]=Hệ thống In ấn +Name[wa]=Sistinme d' imprimaedje +Name[xh]=Indlela Yoshicilelo +Name[zh_CN]=打印系统 +Name[zh_TW]=列印系統 +Name[zu]=Isistimu yokushicilela +Comment=Menu for the print system +Comment[af]=Kieslys vir die drukker stelsel +Comment[ar]=قائمة لنظام الطباعة +Comment[be]=Меню для сістэмы друку +Comment[bg]=Меню на системата за печат +Comment[bn]=মুদ্রণ ব্যবস্থার জন্য মেনু +Comment[bs]=Meni za sistem štampe +Comment[ca]=Menú per al sistema d'impressió +Comment[cs]=Nabídka tiskového systému +Comment[csb]=Menu systemë drëkù +Comment[da]=Menu for udskriftssystemet +Comment[de]=Einfacher Zugriff auf das Drucksystem +Comment[el]=Μενού για το σύστημα εκτύπωσης +Comment[eo]=Menuo por printosistemo +Comment[es]=Menú para el sistema de impresión +Comment[et]=Trükkimissüsteemi menüü +Comment[eu]=Inprimaketa sistemarako menua +Comment[fa]=گزینگان برای سیستم چاپ +Comment[fi]=Tulostusjärjestelmävalikko +Comment[fr]=Menu du système d'impression +Comment[fy]=Menu foar it printsysteem +Comment[gl]=Menu para o sistema de impresión +Comment[he]=תפריט למערכת ההדפסה +Comment[hr]=Izbornik sustava ispisivanja +Comment[hu]=Menü a nyomtatási rendszer eléréséhez +Comment[is]=Fljótleg leið að prentkerfinu +Comment[it]=Menu del sistema di stampa +Comment[ja]=印刷システム用メニュー +Comment[ka]=ბეჭდვის სისტემის მენიუ +Comment[kk]=Басып шығару жүйесінің мәзірі +Comment[km]=ម៉ឺនុយ​សម្រាប់​ប្រព័ន្ធ​បោះពុម្ព +Comment[lt]=Spausdinimo sistemos meniu +Comment[mk]=Мени за системот за печатење +Comment[nb]=Meny for utskriftssystemet +Comment[nds]=Menü för dat Drucksysteem +Comment[ne]=मुद्रण प्रणालीका लागि मेनु +Comment[nl]=Menu voor het afdruksysteem +Comment[nn]=Meny for utskriftssystemet +Comment[pa]=ਪਰਿੰਟ ਸਿਸਟਮ ਲਈ ਮੇਨੂ +Comment[pl]=Menu systemu drukowania +Comment[pt]=Um menu para o sistema de impressão +Comment[pt_BR]=Menu para o sistema de impressão +Comment[ro]=Meniu pentru sistemul de tipărire +Comment[ru]=Быстрый доступ к системе печати +Comment[se]=Čálihanvuogádaga fállu +Comment[sk]=Menu pre tlačový systém +Comment[sl]=Meni za tiskalniški sistem +Comment[sr]=Мени за систем штампања +Comment[sr@Latn]=Meni za sistem štampanja +Comment[sv]=Meny för skrivarsystemet +Comment[te]=ప్రచురణ వ్యవస్థ కొరకు పట్టి +Comment[th]=เมนูสำหรับระบบการพิมพ์ +Comment[tr]=Yazıcı sistemi menüsü +Comment[uk]=Меню для системи друку +Comment[uz]=Bosib chiqarish tizimining menyusi +Comment[uz@cyrillic]=Босиб чиқариш тизимининг менюси +Comment[vi]=Thực đơn cho hệ thống in ấn +Comment[wa]=Dresseŷe pol sistinme d' imprimaedje +Comment[zh_CN]=打印系统菜单 +Comment[zh_TW]=用於列印系統的選單 +Icon=fileprint + +X-KDE-Library=kickermenu_kdeprint -- cgit v1.2.1