Commit 06825f81 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

[Qt] Menu integration.

parent 1dbee658
/*****************************************************************************
* ToolbarEdit.hpp : ToolbarEdit dialogs
****************************************************************************
* Copyright (C) 2007 the VideoLAN team
* $Id$
*
* Authors: Jean-Baptiste Kempf <jb (at) videolan.org>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef _TOOLBAREDIT_DIALOG_H_
#define _TOOLBAREDIT_DIALOG_H_
#include "util/qvlcframe.hpp"
#include "components/controller.hpp"
#include <QRubberBand>
#include <QListWidget>
class ToolbarEditDialog;
class WidgetListing : public QListWidget
{
Q_OBJECT;
public:
WidgetListing( intf_thread_t *, QWidget *_parent = 0 );
protected:
virtual void startDrag( Qt::DropActions /*supportedActions*/ );
private:
ToolbarEditDialog *parent;
};
class ToolbarEditDialog : public QVLCFrame
{
Q_OBJECT;
public:
static ToolbarEditDialog * getInstance( intf_thread_t *p_intf )
{
if( !instance)
instance = new ToolbarEditDialog( p_intf );
return instance;
}
virtual ~ToolbarEditDialog();
int getOptions() { return flatBox->isChecked() * WIDGET_FLAT +
bigBox->isChecked() * WIDGET_BIG; }
private:
ToolbarEditDialog( intf_thread_t * );
static ToolbarEditDialog *instance;
QCheckBox *flatBox, *bigBox, *shinyBox;
WidgetListing *widgetListing;
};
class DroppingController: public AbstractController
{
Q_OBJECT;
public:
DroppingController( intf_thread_t * );
protected:
virtual void createAndAddWidget( QBoxLayout *controlLayout, int i_index,
buttonType_e i_type, int i_option );
virtual void dragEnterEvent ( QDragEnterEvent * event );
virtual void dragMoveEvent(QDragMoveEvent *event);
virtual void dropEvent ( QDropEvent * event );
virtual void dragLeaveEvent ( QDragLeaveEvent * event );
virtual void doAction( int );
private:
QRubberBand *rubberband;
int getParentPosInLayout( QPoint point);
};
#endif
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include "dialogs/help.hpp" #include "dialogs/help.hpp"
#include "dialogs/gototime.hpp" #include "dialogs/gototime.hpp"
#include "dialogs/podcast_configuration.hpp" #include "dialogs/podcast_configuration.hpp"
#include "dialogs/toolbar.hpp"
#include <QEvent> #include <QEvent>
#include <QApplication> #include <QApplication>
...@@ -238,6 +239,11 @@ void DialogsProvider::podcastConfigureDialog() ...@@ -238,6 +239,11 @@ void DialogsProvider::podcastConfigureDialog()
PodcastConfigDialog::getInstance( p_intf )->toggleVisible(); PodcastConfigDialog::getInstance( p_intf )->toggleVisible();
} }
void DialogsProvider::toolbarDialog()
{
ToolbarEditDialog::getInstance( p_intf )->toggleVisible();
}
/* Generic open file */ /* Generic open file */
void DialogsProvider::openFileGenericDialog( intf_dialog_args_t *p_arg ) void DialogsProvider::openFileGenericDialog( intf_dialog_args_t *p_arg )
{ {
......
...@@ -148,6 +148,7 @@ public slots: ...@@ -148,6 +148,7 @@ public slots:
void aboutDialog(); void aboutDialog();
void gotoTimeDialog(); void gotoTimeDialog();
void podcastConfigureDialog(); void podcastConfigureDialog();
void toolbarDialog();
void openFileGenericDialog( intf_dialog_args_t * ); void openFileGenericDialog( intf_dialog_args_t * );
......
...@@ -362,6 +362,8 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf ) ...@@ -362,6 +362,8 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf )
#endif #endif
menu->addSeparator(); menu->addSeparator();
addDPStaticEntry( menu, qtr( "&Customize Interface..." ), "",
":/preferences", SLOT( toolbarDialog() ), "" );
addDPStaticEntry( menu, qtr( "&Preferences..." ), "", addDPStaticEntry( menu, qtr( "&Preferences..." ), "",
":/preferences", SLOT( prefsDialog() ), "Ctrl+P" ); ":/preferences", SLOT( prefsDialog() ), "Ctrl+P" );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment