diff options
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp index 6a8c6a8..e8e7d36 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,10 +1,13 @@ -#include <tdeapplication.h> +#include <kuniqueapplication.h> #include <tdecmdlineargs.h> #include <tdeaboutdata.h> #include <tdelocale.h> +#include <tdeconfig.h> +#include <tdeglobal.h> #include "model/pulsemodel.h" #include "ui/mixerwindow.h" +#include "ui/tmixapp.h" static TDECmdLineOptions options[] = { TDECmdLineLastOption }; @@ -20,16 +23,27 @@ int main( int argc, char **argv ) TDECmdLineArgs::init( argc, argv, &about ); TDECmdLineArgs::addCmdLineOptions( options ); - TDEApplication app; + KUniqueApplication::addCmdLineOptions(); - PulseModel model; - if ( !model.open() ) { - // TODO: show error dialog + if ( !KUniqueApplication::start() ) + return 0; + + TmixApp app; + app.disableSessionManagement(); + + PulseModel *model = new PulseModel; + if ( !model->open() ) { + delete model; return 1; } - MixerWindow win( &model ); - win.show(); + MixerWindow *win = new MixerWindow( model ); + app.setMainWindow( win ); + + TDEConfig *cfg = TDEGlobal::config(); + cfg->setGroup("General"); + if ( !cfg->readBoolEntry("DockInTray", true) ) + win->show(); return app.exec(); } |
