some stub work on settings dialog

git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@763 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
w1z7ard
2008-01-23 05:31:02 +00:00
parent 80064d6361
commit a9fcbb4893
2 changed files with 36 additions and 32 deletions

View File

@ -102,32 +102,8 @@ QProjectM_MainWindow::QProjectM_MainWindow ( const std::string & config_file )
m_timer->start ( 0 );
ConfigFile config ( config_file );
if ( config.read ( "Fullscreen", false ) )
this->setWindowState ( this->windowState() | Qt::WindowFullScreen );
else
this->setWindowState ( this->windowState() & ~Qt::WindowFullScreen );
readConfig(config_file);
setCentralWidget ( m_QProjectMWidget );
// ((QVBoxLayout*)ui->verticalLayout)->setAlignment(Qt::AlignCenter);
//ui->verticalLayout->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
//ui->verticalLayout->sizePolicy().setVerticalStretch(2);
//ui->presetPlayListDockWidget->widget()->layout()->setAlignment(Qt::AlignCenter);
// ((QLayout*)((QLayout*)ui->verticalLayout)->itemAt(1))->setSizeConstraint(QLayout::SetNoConstraint);
// ((QLayout*)((QLayout*)ui->verticalLayout)->itemAt(2))->setSizeConstraint(QLayout::SetNoConstraint);
int wvw = config.read<int> ( "Window Width", 512 );
int wvh = config.read<int> ( "Window Height", 512 );
// Suggest to the widget the projectM window size configuration settings
m_QProjectMWidget->setBaseSize ( wvw, wvh );
createActions();
createMenus();
createToolBars();
@ -138,6 +114,31 @@ QProjectM_MainWindow::QProjectM_MainWindow ( const std::string & config_file )
}
/// @bug diffferent params necessary
void QProjectM_MainWindow::writeConfig() {
}
void QProjectM_MainWindow::readConfig(const std::string & configFile ) {
ConfigFile config ( configFile );
if ( config.read ( "Fullscreen", false ) )
this->setWindowState ( this->windowState() | Qt::WindowFullScreen );
else
this->setWindowState ( this->windowState() & ~Qt::WindowFullScreen );
int wvw = config.read<int> ( "Window Width", 512 );
int wvh = config.read<int> ( "Window Height", 512 );
// Suggest to the widget the projectM window size configuration settings
m_QProjectMWidget->setBaseSize ( wvw, wvh );
}
QProjectM_MainWindow::~QProjectM_MainWindow()
{
@ -551,9 +552,6 @@ void QProjectM_MainWindow::readSettings()
m_QPlaylistFileDialog->setDirectory
( settings.value ( "playlistPath", m_QPlaylistFileDialog->directory().absolutePath() ).toString() );
m_QPresetFileDialog->setDirectory
( settings.value ( "presetPath", m_QPresetFileDialog->directory().absolutePath() ).toString() );
resize ( size );
move ( pos );
}
@ -564,7 +562,6 @@ void QProjectM_MainWindow::writeSettings()
settings.setValue ( "pos", pos() );
settings.setValue ( "size", size() );
settings.setValue ( "playlistPath", m_QPlaylistFileDialog->directory().absolutePath() );
settings.setValue ( "presetPath", m_QPresetFileDialog->directory().absolutePath() );
}

View File

@ -74,6 +74,10 @@ class QProjectMWidget : public QGLWidget
: QGLWidget(parent), config_file(_config_file), m_projectM(0) {}
~QProjectMWidget() { if (m_projectM) delete(m_projectM); }
inline const std::string & configFile() {
return config_file;
}
QProjectM * getQProjectM() { return m_projectM; }
public slots:
@ -230,7 +234,8 @@ public:
void keyReleaseEvent ( QKeyEvent * e );
QProjectM * getQProjectM();
void refreshPlaylist();
QProjectMWidget * getQProjectMWidget() { return m_QProjectMWidget; }
@ -255,8 +260,10 @@ private slots:
void changeRating(const QModelIndex & index);
void openSettingsDialog();
void updateFilteredPlaylist(const QString & text);
private:
private:
void readConfig(const std::string & configFile);
void writeConfig();
void copyPlaylist();
QHeaderView * hHeader;