cleanups in SettingsWindow, and rename to SettingsDialog
This commit is contained in:
parent
ad7cf39499
commit
5e65a6d329
6 changed files with 53 additions and 35 deletions
|
@ -60,7 +60,8 @@ BrowseModel::list_root ()
|
||||||
}
|
}
|
||||||
|
|
||||||
m_list.append (new BrowseModelItem ("file:///", "Files", true));
|
m_list.append (new BrowseModelItem ("file:///", "Files", true));
|
||||||
m_list.append (new BrowseModelItem ("daap://", "DAAP", true));
|
// FIXME: removed for now, crashes application
|
||||||
|
// m_list.append (new BrowseModelItem ("daap://", "DAAP", true));
|
||||||
emit dirChanged ("");
|
emit dirChanged ("");
|
||||||
|
|
||||||
reset ();
|
reset ();
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
#include "SkinChooser.h"
|
#include "SkinChooser.h"
|
||||||
// #include "MedialibWindow.h"
|
// #include "MedialibWindow.h"
|
||||||
#include "SettingsWindow.h"
|
#include "settingsdialog.h"
|
||||||
#include "Button.h"
|
#include "Button.h"
|
||||||
#include "BrowseDialog.h"
|
#include "BrowseDialog.h"
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ TitleBar::showMenu (void)
|
||||||
a = new QAction (tr ("Medialib browser"), this);
|
a = new QAction (tr ("Medialib browser"), this);
|
||||||
a->setShortcut (tr ("Alt+M"));
|
a->setShortcut (tr ("Alt+M"));
|
||||||
connect (a, SIGNAL (triggered ()), this, SLOT (showMlib ()));
|
connect (a, SIGNAL (triggered ()), this, SLOT (showMlib ()));
|
||||||
|
a->setEnabled(false); // FIXME: disabled for now, as Mlib-browser doesn't work
|
||||||
qm.addAction (a);
|
qm.addAction (a);
|
||||||
a = new QAction (tr ("Server-side browser"), this);
|
a = new QAction (tr ("Server-side browser"), this);
|
||||||
a->setShortcut (tr ("Alt+S"));
|
a->setShortcut (tr ("Alt+S"));
|
||||||
|
@ -61,6 +62,7 @@ TitleBar::showMenu (void)
|
||||||
qm.addAction (a);
|
qm.addAction (a);
|
||||||
a = new QAction (tr ("Server settings"), this);
|
a = new QAction (tr ("Server settings"), this);
|
||||||
a->setShortcut (tr ("Alt+S"));
|
a->setShortcut (tr ("Alt+S"));
|
||||||
|
a->setEnabled(false); // FIXME: disabled for now, not yet implemented
|
||||||
qm.addAction (a);
|
qm.addAction (a);
|
||||||
qm.addSeparator ();
|
qm.addSeparator ();
|
||||||
a = new QAction (tr ("Quit"), this);
|
a = new QAction (tr ("Quit"), this);
|
||||||
|
@ -91,7 +93,7 @@ TitleBar::showServerB ()
|
||||||
void
|
void
|
||||||
TitleBar::showSettings ()
|
TitleBar::showSettings ()
|
||||||
{
|
{
|
||||||
SettingsWindow *sw = new SettingsWindow (window ());
|
SettingsDialog *sw = new SettingsDialog (window ());
|
||||||
sw->show ();
|
sw->show ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
/**
|
/**
|
||||||
|
* This file is a part of Prome, an XMMS2 Client.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005-2007 XMMS2 Team
|
||||||
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; version 2 of the License.
|
||||||
|
|
|
@ -1,29 +1,36 @@
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
#include "SettingsWindow.h"
|
#include "settingsdialog.h"
|
||||||
|
|
||||||
#include <QCheckBox>
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
SettingsWindow::SettingsWindow (QWidget *parent) : QMainWindow (parent)
|
#include <QLabel>
|
||||||
|
#include <QCheckBox>
|
||||||
|
#include <QSpinBox>
|
||||||
|
#include <QComboBox>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
|
#include <QTabWidget>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
|
||||||
|
SettingsDialog::SettingsDialog (QWidget *parent) : QDialog (parent)
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
setWindowIcon (QIcon (":icon.png"));
|
setWindowIcon (QIcon (":icon.png"));
|
||||||
#endif
|
#endif
|
||||||
setWindowTitle ("Promoe - Settings window");
|
setWindowTitle ("Promoe - Settings window");
|
||||||
setWindowFlags (Qt::Dialog);
|
// setWindowFlags (Qt::Dialog);
|
||||||
setWindowModality (Qt::ApplicationModal);
|
setWindowModality (Qt::ApplicationModal);
|
||||||
setAttribute (Qt::WA_DeleteOnClose);
|
setAttribute (Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
resize (400, 500);
|
resize (400, 500);
|
||||||
|
|
||||||
QWidget *dummy = new QWidget (this);
|
QVBoxLayout *vbox = new QVBoxLayout (this);//dummy);
|
||||||
setCentralWidget (dummy);
|
setLayout(vbox);
|
||||||
|
|
||||||
QVBoxLayout *vbox = new QVBoxLayout (dummy);
|
QTabWidget *tab = new QTabWidget (this);//dummy);
|
||||||
|
|
||||||
QTabWidget *tab = new QTabWidget (dummy);
|
|
||||||
vbox->addWidget (tab);
|
vbox->addWidget (tab);
|
||||||
|
|
||||||
|
/* Use a QDialogButtonBox for this
|
||||||
QWidget *dummy2 = new QWidget (dummy);
|
QWidget *dummy2 = new QWidget (dummy);
|
||||||
QHBoxLayout *hbox = new QHBoxLayout (dummy2);
|
QHBoxLayout *hbox = new QHBoxLayout (dummy2);
|
||||||
vbox->addWidget (dummy2);
|
vbox->addWidget (dummy2);
|
||||||
|
@ -38,6 +45,12 @@ SettingsWindow::SettingsWindow (QWidget *parent) : QMainWindow (parent)
|
||||||
hbox->addWidget (new QWidget (dummy2), 1);
|
hbox->addWidget (new QWidget (dummy2), 1);
|
||||||
hbox->addWidget (cancel);
|
hbox->addWidget (cancel);
|
||||||
hbox->addWidget (ok);
|
hbox->addWidget (ok);
|
||||||
|
*/
|
||||||
|
QDialogButtonBox *buttonbox = new QDialogButtonBox(QDialogButtonBox::Ok
|
||||||
|
| QDialogButtonBox::Cancel);
|
||||||
|
connect (buttonbox, SIGNAL (accepted()), this, SLOT (okButton ()));
|
||||||
|
connect (buttonbox, SIGNAL (rejected()), this, SLOT (close ()));
|
||||||
|
vbox->addWidget (buttonbox);
|
||||||
|
|
||||||
m_mainwindow = new SettingsTabMain (NULL);
|
m_mainwindow = new SettingsTabMain (NULL);
|
||||||
m_playlistwin = new SettingsTabPlaylist (NULL);
|
m_playlistwin = new SettingsTabPlaylist (NULL);
|
||||||
|
@ -53,7 +66,7 @@ SettingsWindow::SettingsWindow (QWidget *parent) : QMainWindow (parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SettingsWindow::okButton (void)
|
SettingsDialog::okButton (void)
|
||||||
{
|
{
|
||||||
m_mainwindow->saveSettings ();
|
m_mainwindow->saveSettings ();
|
||||||
m_playlistwin->saveSettings ();
|
m_playlistwin->saveSettings ();
|
||||||
|
@ -320,6 +333,7 @@ SettingsTabMain::SettingsTabMain (QWidget *parent) : QWidget (parent)
|
||||||
if (s.contains ("promoe/quitonclose"))
|
if (s.contains ("promoe/quitonclose"))
|
||||||
s.setValue ("promoe/quitonclose", false);
|
s.setValue ("promoe/quitonclose", false);
|
||||||
m_quitonclose->setCheckState (s.value ("promoe/quitonclose").toBool () ? Qt::Checked : Qt::Unchecked);
|
m_quitonclose->setCheckState (s.value ("promoe/quitonclose").toBool () ? Qt::Checked : Qt::Unchecked);
|
||||||
|
m_quitonclose->setEnabled (false); // FIXME: disabled for now, not working
|
||||||
h->addWidget (m_quitonclose);
|
h->addWidget (m_quitonclose);
|
||||||
|
|
||||||
c = new QWidget (dummy);
|
c = new QWidget (dummy);
|
|
@ -1,15 +1,13 @@
|
||||||
#ifndef __SETTINGSWINDOW_H__
|
#ifndef __SETTINGSWINDOW_H__
|
||||||
#define __SETTINGSWINDOW_H__
|
#define __SETTINGSWINDOW_H__
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QWidget>
|
||||||
#include <QTabWidget>
|
#include <QDialog>
|
||||||
#include <QPushButton>
|
|
||||||
#include <QVBoxLayout>
|
class QCheckBox;
|
||||||
#include <QCheckBox>
|
class QSpinBox;
|
||||||
#include <QHBoxLayout>
|
class QComboBox;
|
||||||
#include <QSpinBox>
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QComboBox>
|
|
||||||
|
|
||||||
class SettingsTabMedialib : public QWidget {
|
class SettingsTabMedialib : public QWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -57,11 +55,11 @@ class SettingsTabMain : public QWidget {
|
||||||
QCheckBox *m_shadescroll;
|
QCheckBox *m_shadescroll;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SettingsWindow : public QMainWindow {
|
class SettingsDialog : public QDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
SettingsWindow (QWidget *parent);
|
SettingsDialog (QWidget *parent);
|
||||||
~SettingsWindow () {}
|
~SettingsDialog () {}
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void okButton (void);
|
void okButton (void);
|
|
@ -18,7 +18,7 @@ HEADERS += PixWidget.h \
|
||||||
PlayStatus.h \
|
PlayStatus.h \
|
||||||
ShadedDisplay.h \
|
ShadedDisplay.h \
|
||||||
SkinChooser.h \
|
SkinChooser.h \
|
||||||
SettingsWindow.h \
|
settingsdialog.h \
|
||||||
VolumeSlider.h \
|
VolumeSlider.h \
|
||||||
ClutterBar.h \
|
ClutterBar.h \
|
||||||
FileDialog.h \
|
FileDialog.h \
|
||||||
|
@ -43,7 +43,7 @@ SOURCES += main.cpp \
|
||||||
PlayStatus.cpp \
|
PlayStatus.cpp \
|
||||||
ShadedDisplay.cpp \
|
ShadedDisplay.cpp \
|
||||||
SkinChooser.cpp \
|
SkinChooser.cpp \
|
||||||
SettingsWindow.cpp \
|
settingsdialog.cpp \
|
||||||
VolumeSlider.cpp \
|
VolumeSlider.cpp \
|
||||||
ClutterBar.cpp \
|
ClutterBar.cpp \
|
||||||
FileDialog.cpp \
|
FileDialog.cpp \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue