summaryrefslogtreecommitdiffstats
path: root/noatun-plugins/dub/dub/dubapp.cpp
blob: 3520fa936ea7b7ae8fb0f1aa9e9bf7265dd8f2f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//
//
// C++ Implementation for module: DubApp
//
// Description:
//
//
// Author: Eray (exa) Ozkural, (C) 2003
//
// Copyright: See COPYING file that comes with this distribution
//
//

// include files for QT
#include <tqdir.h>
#include <tqprinter.h>
#include <tqpainter.h>

// include files for KDE
#include <kiconloader.h>
#include <kdebug.h>
#include <tdefiledialog.h>
#include <tdemenubar.h>
#include <kstatusbar.h>
#include <tdelocale.h>
#include <tdeconfig.h>
#include <kstdaction.h>
#include <noatun/playlist.h>

// application specific includes
#include "dubapp.h"
#include "dubapp.moc"
#include "dubview.h"

#define ID_STATUS_MSG 1

DubApp::DubApp(TQWidget* parent, const char* name)
  : TDEMainWindow(parent, name)
{
  kdDebug(90010) << "cons dubapp" << endl;
  config=kapp->config();

  // call inits to invoke all other construction parts
  initStatusBar();
  initActions();
  initView();
  setAutoSaveSettings();
}

DubApp::~DubApp()
{
  kdDebug(90010) << "destruct dubapp" << endl;
}

void DubApp::initActions()
{
  fileClose = KStdAction::close(this, TQ_SLOT(close()), actionCollection());
  setStandardToolBarMenuEnabled(true);
  createStandardStatusBarAction();

  fileClose->setStatusText(i18n("Close playlist window"));

  // use the absolute path to your dubui.rc file for testing purpose in createGUI();
  createGUI();
}


void DubApp::initStatusBar()
{
  // status bar
  statusBar()->insertItem(i18n("Ready."), ID_STATUS_MSG);
}

void DubApp::initView()
{
  // create the main widget here that is managed by KTMainWindow's view-region and
  // connect the widget to your document to display document contents.

  view = new DubView(this);
  setCentralWidget(view);
  setCaption("Dub Playlist",false);
}

// slots

void DubApp::slotStatusMsg(const TQString &text)
{
  // change status message permanently
  statusBar()->clear();
  statusBar()->changeItem(text, ID_STATUS_MSG);
}

// events

void DubApp::closeEvent(TQCloseEvent*)
{
  hide();
}