#include <QSpacerItem>
#include <QHBoxLayout>
#include <QApplication>
-#include <QSettings>
#include <QMainWindow>
#include <QPushButton>
#include <QKeyEvent>
#include <QDesktopWidget>
+#include <QSettings>
#include "qt4.hpp"
-#include <vlc/vlc.h>
+#include <vlc_common.h>
#include <vlc_charset.h>
class QVLCTools
window is docked into an other - don't all this function
or it may write garbage to position info!
*/
- static void saveWidgetPosition(QSettings *settings, QWidget *widget)
+ static void saveWidgetPosition( QSettings *settings, QWidget *widget)
{
settings->setValue("geometry", widget->saveGeometry());
}
- static void saveWidgetPosition(QString configName, QWidget *widget)
+ static void saveWidgetPosition( intf_thread_t *p_intf,
+ QString configName,
+ QWidget *widget)
{
- QSettings *settings = new QSettings("vlc", "vlc-qt-interface");
- settings->beginGroup( configName );
- QVLCTools::saveWidgetPosition(settings, widget);
- settings->endGroup();
- delete settings;
+ getSettings()->beginGroup( configName );
+ QVLCTools::saveWidgetPosition(getSettings(), widget);
+ getSettings()->endGroup();
}
use this method only for restoring window state of non docked
windows!
*/
- static vlc_bool_t restoreWidgetPosition(QSettings *settings,
+ static bool restoreWidgetPosition(QSettings *settings,
QWidget *widget,
QSize defSize = QSize( 0, 0 ),
QPoint defPos = QPoint( 0, 0 ))
if(defPos.x() == 0 && defPos.y()==0)
centerWidgetOnScreen(widget);
- return VLC_TRUE;
+ return true;
}
- return VLC_FALSE;
+ return false;
}
- static vlc_bool_t restoreWidgetPosition(QString configName,
+ static bool restoreWidgetPosition( intf_thread_t *p_intf,
+ QString configName,
QWidget *widget,
QSize defSize = QSize( 0, 0 ),
QPoint defPos = QPoint( 0, 0 ) )
{
- QSettings *settings = new QSettings( "vlc", "vlc-qt-interface" );
- settings->beginGroup( configName );
- vlc_bool_t defaultUsed = QVLCTools::restoreWidgetPosition(settings,
+ getSettings()->beginGroup( configName );
+ bool defaultUsed = QVLCTools::restoreWidgetPosition( getSettings(),
widget,
defSize,
defPos);
- settings->endGroup();
- delete settings;
+ getSettings()->endGroup();
return defaultUsed;
}
class QVLCFrame : public QWidget
{
public:
+#ifdef __APPLE__
+ QVLCFrame( intf_thread_t *_p_intf ) : QWidget( NULL, Qt::Window ), p_intf( _p_intf )
+#else
QVLCFrame( intf_thread_t *_p_intf ) : QWidget( NULL ), p_intf( _p_intf )
- { };
+#endif
+ {};
virtual ~QVLCFrame() {};
void toggleVisible()
QSize defSize = QSize( 0, 0 ),
QPoint defPos = QPoint( 0, 0 ) )
{
- QVLCTools::restoreWidgetPosition(name, this, defSize, defPos);
+ QVLCTools::restoreWidgetPosition(p_intf, name, this, defSize, defPos);
}
void writeSettings( QString name )
{
- QVLCTools::saveWidgetPosition(name, this);
+ QVLCTools::saveWidgetPosition( p_intf, name, this);
}
virtual void cancel()
void readSettings( QString name, QSize defSize )
{
- QVLCTools::restoreWidgetPosition(name, this, defSize);
+ QVLCTools::restoreWidgetPosition( p_intf, name, this, defSize);
}
void readSettings( QString name )
{
- QVLCTools::restoreWidgetPosition(name, this);
+ QVLCTools::restoreWidgetPosition( p_intf, name, this);
}
-
void readSettings( QSettings *settings )
{
QVLCTools::restoreWidgetPosition(settings, this);
void writeSettings(QString name )
{
- QVLCTools::saveWidgetPosition(name, this);
+ QVLCTools::saveWidgetPosition( p_intf, name, this);
}
-
void writeSettings(QSettings *settings )
{
QVLCTools::saveWidgetPosition(settings, this);
}
-
};
#endif