File: QueueShell.h

package info (click to toggle)
gmod 3.1-8.3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,340 kB
  • ctags: 808
  • sloc: cpp: 7,764; makefile: 76
file content (84 lines) | stat: -rw-r--r-- 1,486 bytes parent folder | download | duplicates (2)
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
// -*-C++-*-
// This file is part of the gmod package
// Copyright (C) 1997 by Andrew J. Robinson

#ifndef __QueueShellH
#define __QueueShellH

#include <qapp.h>
#undef Unsorted
#include <qfiledlg.h>
#include <qlistbox.h>
#include <qpushbt.h>
#include <qwidget.h>

class TopShell;

struct qInfoArray
{
  char *name, *label;
  int x, y, width, height;
};

// XQFileDialog is a special QFileDialog which doesn't close when a file
// is selected
class XQFileDialog : public QFileDialog
{
  Q_OBJECT
 protected slots:
  void done(int);
};

inline void XQFileDialog::done(int r)
{
  if (r == Rejected)
    QFileDialog::done(Rejected);
};

class QueueShell : public QWidget
{
  Q_OBJECT

  signals:
  void currentDeleted();

public:
  QueueShell(QWidget *w = 0);
  void addFile(const char *);
  void removeModule(int);

 public slots:
 void currentClicked();

protected:
  void resizeEvent(QResizeEvent *);

private:
  void addModule(int, const char *);
  QListBox *queueList;
  QPushButton *buttons[8];
  QFileDialog *saveDialog;
  XQFileDialog *loadDialog;

  static struct qInfoArray buttonInfo[8];

 private slots:
 void showQueueShell();
  void closeClicked();
  void addClicked();
  void saveClicked();
  void playClicked();
  void removeClicked();
  void clearClicked();
  void shuffleClicked();
  void loadFileSelected(const QString &);
  void saveFileSelected(const QString &);
};

inline void
QueueShell::addFile(const char *filename)
{
  queueList->insertItem(filename);
}

#endif