diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-05-09 14:19:17 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-05-09 14:19:17 -0500 |
commit | d48a6acee440373307f66fe441407f76d42abded (patch) | |
tree | b47639a230eb6e1a47e0b3a60a39076f78d927f9 | |
parent | 77cbd6e9576edc206b1610ea9495e502a3639068 (diff) | |
parent | 0782d2bbb105a1bd0af4a3aa99ca913e1c8a79cc (diff) | |
download | tdebase-d48a6acee440373307f66fe441407f76d42abded.tar.gz tdebase-d48a6acee440373307f66fe441407f76d42abded.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tdebase
-rw-r--r-- | CMakeLists.txt | 21 | ||||
-rw-r--r-- | config.h.cmake | 4 | ||||
-rw-r--r-- | kicker/kicker/buttons/CMakeLists.txt | 1 | ||||
-rw-r--r-- | kicker/kicker/core/CMakeLists.txt | 1 | ||||
-rw-r--r-- | kicker/kicker/core/kmenubase.ui | 6 | ||||
-rw-r--r-- | kicker/kicker/ui/CMakeLists.txt | 4 | ||||
-rw-r--r-- | kicker/kicker/ui/itemview.cpp | 5 | ||||
-rw-r--r-- | kicker/kicker/ui/k_new_mnu.cpp | 303 | ||||
-rw-r--r-- | kicker/kicker/ui/k_new_mnu.h | 18 | ||||
-rw-r--r-- | kicker/kicker/ui/kickoff_bar.cpp | 64 | ||||
-rw-r--r-- | kicker/kicker/ui/kickoff_bar.h | 1 | ||||
-rw-r--r-- | tdeioslave/filter/lzma.protocol | 10 | ||||
-rw-r--r-- | tdeioslave/filter/xz.protocol | 10 |
13 files changed, 309 insertions, 139 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ff608393..df16178e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -278,6 +278,27 @@ else() message( STATUS "Selected man-db for tdeio-man on your system" ) endif() +##### Checks for a distribution-specific 1st menu item, generally a control center +if(EXISTS "/usr/share/applications/YaST.desktop") + set( KICKOFF_DIST_CONFIG_SHORTCUT1 "/usr/share/applications/YaST.desktop" ) +endif() +if(EXISTS "/usr/share/applications/mageia-drakconf.desktop") + set( KICKOFF_DIST_CONFIG_SHORTCUT1 "/usr/share/applications/mageia-drakconf.desktop" ) +endif() +if(EXISTS "/usr/share/applications/pclinuxos-drakconf.desktop") + set( KICKOFF_DIST_CONFIG_SHORTCUT1 "/usr/share/applications/pclinuxos-drakconf.desktop" ) +endif() +if(EXISTS "/usr/share/applications/mandriva-drakconf.desktop") + set( KICKOFF_DIST_CONFIG_SHORTCUT1 "/usr/share/applications/mandriva-drakconf.desktop" ) +endif() + +##### Checks for a distribution-specific 2nd menu item, generally a shortcut to graphical package manager +if(EXISTS "/usr/share/applications/package-manager.desktop") + set( KICKOFF_DIST_CONFIG_SHORTCUT2 "/usr/share/applications/package-manager.desktop" ) +endif() +if(EXISTS "/usr/share/applications/rpmdrake.desktop") + set( KICKOFF_DIST_CONFIG_SHORTCUT2 "/usr/share/applications/rpmdrake.desktop" ) +endif() ##### write configure files ##################### diff --git a/config.h.cmake b/config.h.cmake index 282e3a80d..4fbb33915 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -195,3 +195,7 @@ // Use makewhatis manpage support #cmakedefine WITH_MAKEWHATIS "@WITH_MAKEWHATIS@" + +// Kickoff menu +#cmakedefine KICKOFF_DIST_CONFIG_SHORTCUT1 "@KICKOFF_DIST_CONFIG_SHORTCUT1@" +#cmakedefine KICKOFF_DIST_CONFIG_SHORTCUT2 "@KICKOFF_DIST_CONFIG_SHORTCUT2@" diff --git a/kicker/kicker/buttons/CMakeLists.txt b/kicker/kicker/buttons/CMakeLists.txt index 06c4c254a..1e7ede5b1 100644 --- a/kicker/kicker/buttons/CMakeLists.txt +++ b/kicker/kicker/buttons/CMakeLists.txt @@ -17,6 +17,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/kicker/kicker/core ${CMAKE_SOURCE_DIR}/kicker/kicker/ui ${CMAKE_SOURCE_DIR}/libkonq + ${DBUS_TQT_INCLUDE_DIRS} ${TDE_INCLUDE_DIR} ${TQT_INCLUDE_DIRS} ) diff --git a/kicker/kicker/core/CMakeLists.txt b/kicker/kicker/core/CMakeLists.txt index 4db8c69d9..fdef6dc5f 100644 --- a/kicker/kicker/core/CMakeLists.txt +++ b/kicker/kicker/core/CMakeLists.txt @@ -17,6 +17,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/kicker/libkicker ${CMAKE_SOURCE_DIR}/kicker/kicker/ui ${CMAKE_SOURCE_DIR}/kicker/kicker/buttons + ${DBUS_TQT_INCLUDE_DIRS} ${TDE_INCLUDE_DIR} ${TQT_INCLUDE_DIRS} ) diff --git a/kicker/kicker/core/kmenubase.ui b/kicker/kicker/core/kmenubase.ui index f76942c94..68c82dc7e 100644 --- a/kicker/kicker/core/kmenubase.ui +++ b/kicker/kicker/core/kmenubase.ui @@ -15,12 +15,6 @@ <property name="caption"> <string>KMenu</string> </property> - <property name="frameShadow" stdset="0"> - <string>MShadow</string> - </property> - <property name="frameShape" stdset="0"> - <string>MShape</string> - </property> <widget class="TQLayoutWidget"> <property name="name"> <cstring>m_search</cstring> diff --git a/kicker/kicker/ui/CMakeLists.txt b/kicker/kicker/ui/CMakeLists.txt index 2631f3bc3..f65c51802 100644 --- a/kicker/kicker/ui/CMakeLists.txt +++ b/kicker/kicker/ui/CMakeLists.txt @@ -12,6 +12,7 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/kicker/kicker/core ${CMAKE_BINARY_DIR}/kicker/libkicker ${CMAKE_SOURCE_DIR}/kicker/libkicker @@ -19,6 +20,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/kicker/kicker/buttons ${CMAKE_SOURCE_DIR}/tdmlib ${CMAKE_SOURCE_DIR}/libkonq + ${DBUS_TQT_INCLUDE_DIRS} ${TDE_INCLUDE_DIR} ${TQT_INCLUDE_DIRS} ) @@ -54,5 +56,5 @@ set( ${target}_SRCS tde_add_library( ${target} STATIC_PIC AUTOMOC SOURCES ${${target}_SRCS} DEPENDENCIES kicker_core-static kickermain-static - LINK dmctl-static kickoffsearch_interfaces-shared + LINK dmctl-static kickoffsearch_interfaces-shared ${DBUS_TQT_LIBRARIES} ${HAL_LIBRARIES} ) diff --git a/kicker/kicker/ui/itemview.cpp b/kicker/kicker/ui/itemview.cpp index 729a7b865..ea7894343 100644 --- a/kicker/kicker/ui/itemview.cpp +++ b/kicker/kicker/ui/itemview.cpp @@ -139,7 +139,10 @@ void KMenuItem::setDescription(const TQString& txt) void KMenuItem::setIcon(const TQString& icon, int size) { m_icon = icon; - TQListViewItem::setPixmap(0, TDEGlobal::iconLoader()->loadIcon(icon, TDEIcon::Panel, size )); + TQPixmap pixmap = TDEGlobal::iconLoader()->loadIcon(icon, TDEIcon::Panel, size, TDEIcon::DefaultState, 0L, true); + if (!pixmap.isNull()) { + TQListViewItem::setPixmap(0, pixmap); + } } void KMenuItem::setHasChildren( bool flag ) diff --git a/kicker/kicker/ui/k_new_mnu.cpp b/kicker/kicker/ui/k_new_mnu.cpp index 4e61f8eca..3711a914f 100644 --- a/kicker/kicker/ui/k_new_mnu.cpp +++ b/kicker/kicker/ui/k_new_mnu.cpp @@ -52,6 +52,7 @@ #include <kdebug.h> #include <tdeglobal.h> #include <tdeglobalsettings.h> +#include <tdehardwaredevices.h> #include <kiconloader.h> #include <klineedit.h> #include <tdelocale.h> @@ -101,6 +102,18 @@ #include "k_new_mnu.moc" #include "kickoff_bar.h" +#include "config.h" + +#ifndef NO_QT3_DBUS_SUPPORT +/* We acknowledge the the dbus API is unstable */ +#define DBUS_API_SUBJECT_TO_CHANGE +#include <dbus/connection.h> +#endif // NO_QT3_DBUS_SUPPORT + +#ifdef COMPILE_HALBACKEND +#include <hal/libhal.h> +#endif + #define WAIT_BEFORE_QUERYING 700 #define IDS_PER_CATEGORY 20 @@ -294,7 +307,7 @@ KMenu::KMenu() m_searchResultsWidget = new ItemView (m_searchWidget, "m_searchResultsWidget"); m_searchResultsWidget->setItemMargin(4); - m_searchResultsWidget->setIconSize(16); +// m_searchResultsWidget->setIconSize(16); m_searchActions = new ItemView (m_searchWidget, "m_searchActions"); m_searchActions->setFocusPolicy(TQ_NoFocus); m_searchActions->setItemMargin(4); @@ -415,6 +428,38 @@ KMenu::KMenu() search_tab_top_left.load( locate("data", "kicker/pics/search-tab-top-left.png" ) ); search_tab_top_right.load( locate("data", "kicker/pics/search-tab-top-right.png" ) ); search_tab_top_center.load( locate("data", "kicker/pics/search-tab-top-center.png" ) ); + +#ifdef COMPILE_HALBACKEND + m_halCtx = NULL; + m_halCtx = libhal_ctx_new(); + + DBusError error; + dbus_error_init(&error); + m_dbusConn = dbus_connection_open_private(DBUS_SYSTEM_BUS, &error); + if (!m_dbusConn) { + dbus_error_free(&error); + libhal_ctx_free(m_halCtx); + m_halCtx = NULL; + } else { + dbus_bus_register(m_dbusConn, &error); + if (dbus_error_is_set(&error)) { + dbus_error_free(&error); + libhal_ctx_free(m_halCtx); + m_dbusConn = NULL; + m_halCtx = NULL; + } else { + libhal_ctx_set_dbus_connection(m_halCtx, m_dbusConn); + if (!libhal_ctx_init(m_halCtx, &error)) { + if (dbus_error_is_set(&error)) { + dbus_error_free(&error); + } + libhal_ctx_free(m_halCtx); + m_dbusConn = NULL; + m_halCtx = NULL; + } + } + } +#endif } void KMenu::setupUi() @@ -437,6 +482,15 @@ KMenu::~KMenu() clearSubmenus(); delete m_filterData; + +#ifdef COMPILE_HALBACKEND + if (m_halCtx) { + DBusError error; + dbus_error_init(&error); + libhal_ctx_shutdown(m_halCtx, &error); + libhal_ctx_free(m_halCtx); + } +#endif } bool KMenu::eventFilter ( TQObject * receiver, TQEvent* e) @@ -1342,11 +1396,24 @@ void KMenu::insertStaticItems() m_systemView->insertSeparator( nId++, i18n("Applications"), index++); - KService::Ptr p = KService::serviceByStorageId("/usr/share/applications/YaST.desktop"); +#ifdef KICKOFF_DIST_CONFIG_SHORTCUT1 + KService::Ptr kdcs1 = KService::serviceByStorageId(KICKOFF_DIST_CONFIG_SHORTCUT1); + m_systemView->insertMenuItem(kdcs1, nId++, index++); +#endif +#ifdef KICKOFF_DIST_CONFIG_SHORTCUT2 + KService::Ptr kdcs2 = KService::serviceByStorageId(KICKOFF_DIST_CONFIG_SHORTCUT2); + m_systemView->insertMenuItem(kdcs2, nId++, index++); +#endif + + KService::Ptr p = KService::serviceByStorageId("KControl.desktop"); m_systemView->insertMenuItem(p, nId++, index++); - m_systemView->insertItem( "info", i18n( "System Information" ), - "sysinfo:/", "sysinfo:/", nId++, index++ ); + // run command + if (kapp->authorize("run_command")) + { + m_systemView->insertItem( "run", i18n("Run Command..."), + "", "kicker:/runusercommand", nId++, index++ ); + } m_systemView->insertSeparator( nId++, i18n("System Folders"), index++ ); @@ -2579,58 +2646,35 @@ void KMenu::slotStartURL(const TQString& u) slotLock(); } else if ( u == "kicker:/logout" ) { -#ifdef KDELIBS_SUSE TQByteArray params; TQDataStream stream(params, IO_WriteOnly); stream << 0 << -1 << ""; kapp->dcopClient()->send("ksmserver", "default", "logoutTimed(int,int,TQString)", params); -#else - DCOPRef mediamanager("ksmserver", "ksmserver"); - DCOPReply reply = mediamanager.call( "logoutTimed", (int)TDEApplication::ShutdownTypeNone, (int)TDEApplication::ShutdownModeDefault ); - if (!reply.isValid() && KMessageBox::Continue==KMessageBox::warningContinueCancel(this, i18n("Do you really want to end the session?"), - i18n("Logout Confirmation"), KGuiItem(i18n("Logout"),"undo"))) - kapp->requestShutDown( TDEApplication::ShutdownConfirmNo, - TDEApplication::ShutdownTypeNone, - TDEApplication::ShutdownModeDefault ); - -#endif } else if ( u == "kicker:/runcommand" ) { runCommand(); } + else if ( u == "kicker:/runusercommand" ) + { + runUserCommand(); + } else if ( u == "kicker:/shutdown" ) { -#ifdef KDELIBS_SUSE TQByteArray params; TQDataStream stream(params, IO_WriteOnly); stream << 2 << -1 << ""; kapp->dcopClient()->send("ksmserver", "default", "logoutTimed(int,int,TQString)", params); -#else - if (KMessageBox::Continue==KMessageBox::warningContinueCancel(this, i18n("Do you really want to turn off the computer?"), - i18n("Shutdown Confirmation"), KGuiItem(i18n("Shutdown"),"exit"))) - kapp->requestShutDown( TDEApplication::ShutdownConfirmNo, - TDEApplication::ShutdownTypeHalt, - TDEApplication::ShutdownModeDefault ); -#endif } else if ( u == "kicker:/restart" ) { -#ifdef KDELIBS_SUSE TQByteArray params; TQDataStream stream(params, IO_WriteOnly); stream << 1 << -1 << TQString(); kapp->dcopClient()->send("ksmserver", "default", "logoutTimed(int,int,TQString)", params); -#else - if (KMessageBox::Continue==KMessageBox::warningContinueCancel(this, i18n("Do you really want to reset the computer and boot (another operating system)?"), - i18n("Restart Confirmation"), KGuiItem(i18n("Restart"),"reload"))) - kapp->requestShutDown( TDEApplication::ShutdownConfirmNo, - TDEApplication::ShutdownTypeReboot, - TDEApplication::ShutdownModeDefault ); -#endif } -#ifdef KDELIBS_SUSE +#ifdef COMPILE_HALBACKEND else if ( u == "kicker:/suspend_disk" ) { slotSuspend( 1 ); } @@ -2656,7 +2700,6 @@ void KMenu::slotStartURL(const TQString& u) else if ( u.startsWith("kicker:/switchuser_") ) DM().lockSwitchVT( u.mid(19).toInt() ); else if ( u.startsWith("kicker:/restart_") ) { -#ifdef KDELIBS_SUSE TQStringList rebootOptions; int def, cur; DM().bootOptions( rebootOptions, def, cur ); @@ -2666,9 +2709,6 @@ void KMenu::slotStartURL(const TQString& u) stream << 1 << -1 << rebootOptions[u.mid(16).toInt()]; kapp->dcopClient()->send("ksmserver", "default", "logoutTimed(int,int,TQString)", params); -#else - KMessageBox::error( this, TQString( "Sorry, not implemented." )); -#endif } #warning restart entry not supported #if 0 @@ -3350,7 +3390,7 @@ TQSize KMenu::sizeHint() const TQSize KMenu::minimumSizeHint() const { TQSize minsize; - minsize.setWidth( minsize.width() + m_tabBar->sizeHint().width() ); + minsize.setWidth( minsize.width() + m_tabBar->minimumSizeHint().width() ); minsize.setWidth( QMAX( minsize.width(), m_search->minimumSize().width() ) ); minsize.setWidth( QMAX( minsize.width(), @@ -3702,98 +3742,125 @@ int KMenu::max_items(int category) const return 5; } -#define DBUS_HAL_INTERFACE "org.freedesktop.Hal" -#define DBUS_HAL_SYSTEM_POWER_INTERFACE "org.freedesktop.Hal.Device.SystemPowerManagement" -#define HAL_UDI_COMPUTER "/org/freedesktop/Hal/devices/computer" - -#ifdef KDELIBS_SUSE -#include <liblazy.h> -#endif - void KMenu::insertSuspendOption( int &nId, int &index ) { -#ifdef KDELIBS_SUSE - int supported = -1; - bool suspend_ram, suspend_disk, standby; - - liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_suspend", &supported); - if (supported == 1) - suspend_ram = true; - else - suspend_ram = false; - liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_standby", &supported); - if (supported == 1) - standby = true; - else - standby = false; - liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_hibernate", &supported); - if (supported == 1) - suspend_disk = true; - else - suspend_disk = false; - - if (liblazy_hal_is_caller_privileged("org.freedesktop.hal.power-management.hibernate") != 1) - suspend_disk = false; - if (liblazy_hal_is_caller_privileged("org.freedesktop.hal.power-management.suspend") != 1) - suspend_ram = false; - if (liblazy_hal_is_caller_privileged("org.freedesktop.hal.power-management.standby") != 1) - standby = false; - - if ( ! ( standby + suspend_ram + suspend_disk ) ) - return; - - i18n("Suspend Computer"); - - if ( suspend_disk ) - m_exitView->leftView()->insertItem( "suspend2disk", i18n( "Suspend to Disk" ), - i18n( "Pause without logging out" ), "kicker:/suspend_disk", nId++, index++ ); + bool suspend_ram = false; + bool standby = false; + bool suspend_disk = false; +#ifdef COMPILE_HALBACKEND + suspend_ram = libhal_device_get_property_bool(m_halCtx, + "/org/freedesktop/Hal/devices/computer", + "power_management.can_suspend", + NULL); + + standby = libhal_device_get_property_bool(m_halCtx, + "/org/freedesktop/Hal/devices/computer", + "power_management.can_standby", + NULL); + + suspend_disk = libhal_device_get_property_bool(m_halCtx, + "/org/freedesktop/Hal/devices/computer", + "power_management.can_hibernate", + NULL); +#else // COMPILE_HALBACKEND + TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); + if (rootDevice) { + suspend_ram = rootDevice->canSuspend(); + standby = rootDevice->canStandby(); + suspend_disk = rootDevice->canHibernate(); + } +#endif - if ( suspend_ram ) - m_exitView->leftView()->insertItem( "suspend2ram", i18n( "Suspend to RAM" ), - i18n( "Pause without logging out" ), "kicker:/suspend_ram", nId++, index++ ); + if ( suspend_disk ) { + m_exitView->leftView()->insertItem( + "suspend2disk", + i18n( "Suspend to Disk" ), + i18n( "Pause without logging out" ), + "kicker:/suspend_disk", nId++, index++ ); + } + + if ( suspend_ram ) { + m_exitView->leftView()->insertItem( + "suspend2ram", + i18n( "Suspend to RAM" ), + i18n( "Pause without logging out" ), + "kicker:/suspend_ram", nId++, index++ ); + } - if ( standby ) - m_exitView->leftView()->insertItem( "player_pause", i18n( "Standby" ), - i18n( "Pause without logging out" ), "kicker:/standby", nId++, index++ ); -#endif + if ( standby ) { + m_exitView->leftView()->insertItem( + "player_pause", + i18n( "Standby" ), + i18n( "Pause without logging out" ), + "kicker:/standby", nId++, index++ ); + } } void KMenu::slotSuspend(int id) { -#ifdef KDELIBS_SUSE - int error = 0; - int wake = 0; - DBusMessage *reply = 0; - - if (id == 1) { - error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, - HAL_UDI_COMPUTER, - DBUS_HAL_SYSTEM_POWER_INTERFACE, - "Hibernate", - &reply, - DBUS_TYPE_INVALID); - } else if (id == 2) - error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, - HAL_UDI_COMPUTER, - DBUS_HAL_SYSTEM_POWER_INTERFACE, - "Suspend", - &reply, - DBUS_TYPE_INT32, - &wake, - DBUS_TYPE_INVALID); - else if (id == 3) - error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, - HAL_UDI_COMPUTER, - DBUS_HAL_SYSTEM_POWER_INTERFACE, - "Standby", - &reply, - DBUS_TYPE_INVALID); - else - return; - if (error) + bool error = true; +#ifdef COMPILE_HALBACKEND + DBusMessage* msg = NULL; + + if (m_dbusConn) { + if (id == 1) { + msg = dbus_message_new_method_call( + "org.freedesktop.Hal", + "/org/freedesktop/Hal/devices/computer", + "org.freedesktop.Hal.Device.SystemPowerManagement", + "Hibernate"); + } else if (id == 2) { + msg = dbus_message_new_method_call( + "org.freedesktop.Hal", + "/org/freedesktop/Hal/devices/computer", + "org.freedesktop.Hal.Device.SystemPowerManagement", + "Suspend"); + int wakeup=0; + dbus_message_append_args(msg, DBUS_TYPE_INT32, &wakeup, DBUS_TYPE_INVALID); + } else if (id == 3) { + msg = dbus_message_new_method_call( + "org.freedesktop.Hal", + "/org/freedesktop/Hal/devices/computer", + "org.freedesktop.Hal.Device.SystemPowerManagement", + "Standby"); + } else { + return; + } + + if(dbus_connection_send(m_dbusConn, msg, NULL)) { + error = false; + } + dbus_message_unref(msg); + } +#else // COMPILE_HALBACKEND + TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); + if (rootDevice) { + if (id == 1) { + error = !rootDevice->setPowerState(TDESystemPowerState::Hibernate); + } else if (id == 2) { + error = !rootDevice->setPowerState(TDESystemPowerState::Suspend); + } else if (id == 3) { + error = !rootDevice->setPowerState(TDESystemPowerState::Standby); + } else { + return; + } + } #endif + if (error) KMessageBox::error(this, i18n("Suspend failed")); } +void KMenu::runUserCommand() +{ + TQByteArray data; + TQCString appname( "kdesktop" ); + if ( kicker_screen_number ) + appname.sprintf("kdesktop-screen-%d", kicker_screen_number); + + kapp->updateRemoteUserTimestamp( appname ); + kapp->dcopClient()->send( appname, "KDesktopIface", + "popupExecuteCommand()", data ); +} + // vim:cindent:sw=4: diff --git a/kicker/kicker/ui/k_new_mnu.h b/kicker/kicker/ui/k_new_mnu.h index 6dff75feb..7276e874a 100644 --- a/kicker/kicker/ui/k_new_mnu.h +++ b/kicker/kicker/ui/k_new_mnu.h @@ -43,6 +43,18 @@ #include "service_mnu.h" #include "query.h" +#include <config.h> + +#ifndef NO_QT3_DBUS_SUPPORT +/* We acknowledge the the dbus API is unstable */ +#define DBUS_API_SUBJECT_TO_CHANGE +#include <dbus/connection.h> +#endif // NO_QT3_DBUS_SUPPORT + +#ifdef COMPILE_HALBACKEND +#include <hal/libhal.h> +#endif + class KickerClientMenu; class KickoffTabBar; class KBookmarkMenu; @@ -181,6 +193,7 @@ protected: // void raiseStackWidget(TQWidget *view); bool runCommand(); + void runUserCommand(); void setupUi(); @@ -338,6 +351,11 @@ private: void fillOverflowCategory(); TQString insertBreaks(const TQString& text, TQFontMetrics fm, int width, TQString leadInsert = TQString::null); + +#ifdef COMPILE_HALBACKEND + LibHalContext* m_halCtx; + DBusConnection *m_dbusConn; +#endif }; #endif diff --git a/kicker/kicker/ui/kickoff_bar.cpp b/kicker/kicker/ui/kickoff_bar.cpp index 0383c0144..994300c0d 100644 --- a/kicker/kicker/ui/kickoff_bar.cpp +++ b/kicker/kicker/ui/kickoff_bar.cpp @@ -128,39 +128,77 @@ TQSize KickoffTabBar::sizeHint() const return s; } -void KickoffTabBar::layoutTabs() +TQSize KickoffTabBar::minimumSizeHint() const { - TQTabBar::layoutTabs(); + TQSize s; TQFontMetrics fm = fontMetrics(); int fh = ((KickerSettings::kickoffTabBarFormat() != KickerSettings::IconOnly) ? fm.height() : 0) + 4; int hframe = style().pixelMetric( TQStyle::PM_TabBarTabHSpace, this ); int vframe = style().pixelMetric( TQStyle::PM_TabBarTabVSpace, this ); - int overlap = style().pixelMetric( TQStyle::PM_TabBarTabOverlap, this ); - TQSize s; - for (int t = 0; t < count(); ++t) - { + for (int t = 0; t < count(); ++t) { TQTab* tab = tabAt(t); - if (tab->iconSet()) + if (tab->iconSet()) { s = s.expandedTo(tab->iconSet()->pixmap(TQIconSet::Large, TQIconSet::Normal).size()); + } } - int x = 0; + // Every tab must have identical height and width. + // We check every tab minimum height and width and we keep the + // biggest one as reference. Smaller tabs will be expanded to match + // the same size. + int mw = 0; + int mh = 0; for (int t = 0; t < count(); ++t) { TQTab* tab = tabAt(TQApplication::reverseLayout() ? count() - t - 1 : t); + + // Checks tab minimum height int h = fh; - if (tab->iconSet()) + if (tab->iconSet()) { h += 4 + s.height() + 4; - TQRect r = tab->rect(); + } + h += ((KickerSettings::kickoffTabBarFormat() != KickerSettings::IconOnly) ? fm.height() : 0) + vframe; + // Checks tab minimum width (font) int fw = fm.size( TQt::SingleLine|TQt::ShowPrefix, tab->text() ).width(); + + // Checks tab minimum width (icon) int iw = 0; - if ( tab->iconSet() != 0 ) + if ( tab->iconSet()) { iw = tab->iconSet()->pixmap( TQIconSet::Large, TQIconSet::Normal ).width(); - int w = QMAX(iw, fw + 6 + 6 ) + hframe; - h += ((KickerSettings::kickoffTabBarFormat() != KickerSettings::IconOnly) ? fm.height() : 0) + vframe; + } + + // Final width for this tab + int w = QMAX(iw, fw) + hframe; + + mw = QMAX(mw, w); + mh = QMAX(mh, h); + } + + s.setWidth(mw * count()); + s.setHeight(mh); + return (s); +} + +void KickoffTabBar::layoutTabs() +{ + TQSize s; + TQSize st = minimumSizeHint(); + + TQTabBar::layoutTabs(); + int overlap = style().pixelMetric( TQStyle::PM_TabBarTabOverlap, this ); + + int x = 0; + int h = st.height(); + + for (int t = 0; t < count(); ++t) { + TQTab* tab = tabAt(TQApplication::reverseLayout() ? count() - t - 1 : t); + + int w = QMAX(st.width() / count(), parentWidget()->width() / count()); + + TQRect r = tab->rect(); tab->setRect(TQRect(TQPoint(x, 0), style().tqsizeFromContents(TQStyle::CT_TabBarTab, this, TQSize(w, h), TQStyleOption(tab)))); x += tab->rect().width() - overlap; diff --git a/kicker/kicker/ui/kickoff_bar.h b/kicker/kicker/ui/kickoff_bar.h index 2330ffe39..941f1144f 100644 --- a/kicker/kicker/ui/kickoff_bar.h +++ b/kicker/kicker/ui/kickoff_bar.h @@ -33,6 +33,7 @@ public: void deactivateTabs(bool b); virtual TQSize sizeHint() const; + virtual TQSize minimumSizeHint() const; protected: virtual void paint(TQPainter*, TQTab*, bool) const; diff --git a/tdeioslave/filter/lzma.protocol b/tdeioslave/filter/lzma.protocol new file mode 100644 index 000000000..15c255286 --- /dev/null +++ b/tdeioslave/filter/lzma.protocol @@ -0,0 +1,10 @@ +[Protocol] +exec=tdeio_filter +protocol=lzma +mimetype=application/x-lzma +input=stream +output=stream +reading=true +source=false +DocPath=tdeioslave/lzma.html +Icon=ark diff --git a/tdeioslave/filter/xz.protocol b/tdeioslave/filter/xz.protocol new file mode 100644 index 000000000..e8a83b56f --- /dev/null +++ b/tdeioslave/filter/xz.protocol @@ -0,0 +1,10 @@ +[Protocol] +exec=tdeio_filter +protocol=xz +mimetype=application/x-xz +input=stream +output=stream +reading=true +source=false +DocPath=tdeioslave/xz.html +Icon=ark |