Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.2
kdemultimedia4
kmix-autostart.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File kmix-autostart.diff of Package kdemultimedia4
Index: kmix/KMixApp.h =================================================================== --- kmix/KMixApp.h (revision 946324) +++ kmix/KMixApp.h (working copy) @@ -36,6 +36,7 @@ public slots: //void quitExtended(); // For a hack on visibility() static void keepVisibility(bool); + static void autoStart(bool); /* signals: void stopUpdatesOnVisibility(); @@ -43,6 +44,7 @@ private: KMixWindow *m_kmix; static bool _keepVisibility; + static bool _autoStart; }; #endif Index: kmix/kmixprefdlg.h =================================================================== --- kmix/kmixprefdlg.h (revision 946324) +++ kmix/kmixprefdlg.h (working copy) @@ -57,6 +57,7 @@ QCheckBox *m_showTicks; QCheckBox *m_showLabels; QCheckBox *m_onLogin; + QCheckBox *m_disableAutoStart; QRadioButton *_rbVertical; QRadioButton *_rbHorizontal; }; Index: kmix/kmix.cpp =================================================================== --- kmix/kmix.cpp (revision 946324) +++ kmix/kmix.cpp (working copy) @@ -29,8 +29,10 @@ #include <qradiobutton.h> #include <QCursor> #include <KTabWidget> +#include <QTimer> // include files for KDE +#include <kcmdlineargs.h> #include <kcombobox.h> #include <kiconloader.h> #include <kmessagebox.h> @@ -89,6 +91,10 @@ theKMixDeviceManager->initHotplug(); connect(theKMixDeviceManager, SIGNAL( plugged( const char*, const QString&, QString&)), SLOT (plugged( const char*, const QString&, QString&) ) ); connect(theKMixDeviceManager, SIGNAL( unplugged( const QString&)), SLOT (unplugged( const QString&) ) ); + + if (KCmdLineArgs::parsedArgs()->isSet("autostart") && ! Mixer::mixers().first()) + QTimer::singleShot(0, kapp, SLOT(quit())); + if ( m_startVisible && ! invisible) show(); // Started visible: We don't do "m_isVisible = true;", as the showEvent() already does it @@ -255,6 +261,7 @@ config.writeEntry( "Tickmarks", m_showTicks ); config.writeEntry( "Labels", m_showLabels ); config.writeEntry( "startkdeRestore", m_onLogin ); + config.writeEntry( "AutoStart", m_autoStart ); config.writeEntry( "DefaultCardOnStart", m_defaultCardOnStart ); config.writeEntry( "ConfigVersion", KMIX_CONFIG_VERSION ); Mixer* mixerMasterCard = Mixer::getGlobalMasterMixer(); @@ -327,6 +334,7 @@ m_showLabels = config.readEntry("Labels", true); m_onLogin = config.readEntry("startkdeRestore", true ); m_startVisible = config.readEntry("Visible", false); + m_autoStart = config.readEntry("AutoStart", true); m_multiDriverMode = config.readEntry("MultiDriver", false); const QString& orientationString = config.readEntry("Orientation", "Vertical"); m_defaultCardOnStart = config.readEntry( "DefaultCardOnStart", "" ); @@ -682,6 +690,7 @@ m_prefDlg->m_volumeChk->setChecked(m_volumeWidget); m_prefDlg->m_volumeChk->setEnabled( m_showDockWidget ); m_prefDlg->m_onLogin->setChecked( m_onLogin ); + m_prefDlg->m_disableAutoStart->setChecked( !m_autoStart ); m_prefDlg->m_showTicks->setChecked( m_showTicks ); m_prefDlg->m_showLabels->setChecked( m_showLabels ); @@ -723,6 +732,7 @@ m_showDockWidget = prefDlg->m_dockingChk->isChecked(); m_volumeWidget = prefDlg->m_volumeChk->isChecked(); m_onLogin = prefDlg->m_onLogin->isChecked(); + m_autoStart = !prefDlg->m_disableAutoStart->isChecked(); if ( prefDlg->_rbVertical->isChecked() ) { m_toplevelOrientation = Qt::Vertical; } Index: kmix/KMixApp.cpp =================================================================== --- kmix/KMixApp.cpp (revision 946324) +++ kmix/KMixApp.cpp (working copy) @@ -22,9 +22,11 @@ #include "KMixApp.h" #include "kmix.h" #include <kdebug.h> +#include <kcmdlineargs.h> bool KMixApp::_keepVisibility = false; +bool KMixApp::_autoStart = false; KMixApp::KMixApp() : KUniqueApplication(), m_kmix( 0 ) @@ -51,6 +53,16 @@ // There are 3 cases for a new instance //kDebug(67100) << "KMixApp::newInstance() isRestored()=" << isRestored() << "_keepVisibility=" << _keepVisibility; + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + + if (args->isSet("autostart")) + { + kapp->disableSessionManagement(); + + if ( m_kmix ) + return 0; + } + if ( m_kmix ) { // There already exists an instance/window @@ -107,6 +119,11 @@ _keepVisibility = val_keepVisibility; } +void KMixApp::autoStart(bool val_autoStart) { + //kDebug(67100) << "KMixApp::autoStart()"; + _autoStart = val_autoStart; +} + /* void KMixApp::quitExtended() Index: kmix/kmix.h =================================================================== --- kmix/kmix.h (revision 946324) +++ kmix/kmix.h (working copy) @@ -97,6 +97,7 @@ bool m_showDockWidget; bool m_volumeWidget; + bool m_autoStart; bool m_showTicks; bool m_showLabels; bool m_onLogin; Index: kmix/main.cpp =================================================================== --- kmix/main.cpp (revision 946324) +++ kmix/main.cpp (working copy) @@ -56,6 +56,7 @@ KCmdLineOptions options; options.add("keepvisibility", ki18n("Inhibits the unhiding of the KMix main window, if KMix is already running.")); + options.add("autostart", ki18n("Used by kmix_autostart.desktop")); KCmdLineArgs::addCmdLineOptions( options ); // Add our own options. KUniqueApplication::addCmdLineOptions(); @@ -63,6 +64,8 @@ bool hasArgKeepvisibility = args->isSet("keepvisibility"); //kDebug(67100) << "hasArgKeepvisibility=" << hasArgKeepvisibility; KMixApp::keepVisibility(hasArgKeepvisibility); + bool hasAutoStart = args->isSet("autostart"); + KMixApp::autoStart(hasAutoStart); if (!KMixApp::start()) return 0; Index: kmix/kmixprefdlg.cpp =================================================================== --- kmix/kmixprefdlg.cpp (revision 946324) +++ kmix/kmixprefdlg.cpp (working copy) @@ -78,6 +78,12 @@ m_onLogin = new QCheckBox( i18n("Restore volumes on login"), m_generalTab ); l->addWidget( m_onLogin ); + l = new QHBoxLayout(); + layout->addItem( l ); + l->addSpacing(10); + m_disableAutoStart = new QCheckBox( i18n("Disable automatic startup on login"), m_generalTab ); + l->addWidget( m_disableAutoStart ); + // ----------------------------------------------------------- label = new QLabel( i18n("Visual"), m_generalTab );
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor