* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
/**
* Configuration and settings
+ * Pre-building of interface
**/
settings = new QSettings( "vlc", "vlc-qt-interface" );
settings->beginGroup( "MainWindow" );
setWindowOpacity( config_GetFloat( p_intf, "qt-opacity" ) );
/* Set The Video In emebedded Mode or not */
- videoEmbeddedFlag = false;
- if( config_GetInt( p_intf, "embedded-video" ) ) videoEmbeddedFlag = true;
+ videoEmbeddedFlag = config_GetInt( p_intf, "embedded-video" );
/* Are we in the enhanced always-video mode or not ? */
- alwaysVideoFlag = false;
- if( videoEmbeddedFlag && config_GetInt( p_intf, "qt-always-video" ) )
- alwaysVideoFlag = true;
+ i_visualmode = config_GetInt( p_intf, "qt-display-mode" );
/* Set the other interface settings */
//TODO: I don't like that code
if( b_systrayAvailable && b_createSystray )
createSystray();
- if( config_GetInt( p_intf, "qt-minimal-view" ) )
- toggleMinimalView();
-
/********************
* Input Manager *
********************/
MainInputManager::getInstance( p_intf );
- /********************
- * Various CONNECTs *
- ********************/
+ /**************************
+ * Various CONNECTs on IM *
+ **************************/
/* Connect the input manager to the GUI elements it manages */
/* It is also connected to the control->slider, see the ControlsWidget */
CONNECT( controls, advancedControlsToggled( bool ),
this, doComponentsUpdate() );
+
+ /* Size and placement of interface */
move( settings->value( "pos", QPoint( 0, 0 ) ).toPoint() );
QSize newSize = settings->value( "size", QSize( 350, 60 ) ).toSize();
msg_Warn( p_intf, "Invalid size in constructor" );
}
+ /* Playlist */
int tgPlay = settings->value( "playlist-visible", 0 ).toInt();
settings->endGroup();
togglePlaylist();
}
- updateGeometry();
+ if( i_visualmode == QT_MINIMAL_MODE )
+ toggleMinimalView();
+
+ /* Update the geometry TODO: is it useful */
+ updateGeometry();
}
MainInterface::~MainInterface()
#endif
/* And video Outputs */
- if( alwaysVideoFlag )
+ if( i_visualmode == QT_ALWAYS_VIDEO_MODE ||
+ i_visualmode == QT_MINIMAL_MODE )
{
bgWidget = new BackgroundWidget( p_intf );
bgWidget->resize(
/*****************************************************************************
* Module descriptor
*****************************************************************************/
-#define ALWAYS_VIDEO_TEXT N_( "Always show an area for information when " \
- "no video is played" )
-#define ALWAYS_VIDEO_LONGTEXT N_( "Start VLC with a cone image, and " \
- "use this zone to show information as " \
- "lyrics, album arts or visualisation " \
- " when there is no video track." )
-
#define ADVANCED_PREFS_TEXT N_( "Show advanced prefs over simple ones" )
-#define ADVANCED_PREFS_LONGTEXT N_( "Show advanced preferences and not simple " \
- "preferences when opening the preferences " \
+#define ADVANCED_PREFS_LONGTEXT N_( "Show advanced preferences and not simple "\
+ "preferences when opening the preferences "\
"dialog." )
#define SYSTRAY_TEXT N_( "Systray icon" )
#define SHOWFLAGS_TEXT N_( "Define what columns to show in playlist window" )
#define SHOWFLAGS_LONGTEXT N_( "Enter the sum of the options that you want: \n" \
"Title: 1; Duration: 2; Artist: 4; Genre: 8; " \
- "Copyright: 16; Collection/album: 32; Rating: 256." )
+ "Copyright: 16; Collection/album: 32; Rating: 256." )
#define ERROR_TEXT N_( "Show unimportant error and warnings dialogs" )
-#define MINIMAL_TEXT N_( "Start in minimal view (menus hidden)." )
-
#define UPDATER_TEXT N_( "Activate the updates availability notification" )
#define UPDATER_LONGTEXT N_( "Activate the automatic notification of new " \
"versions of the software. It runs once a week." )
#define PRIVACY_TEXT N_( "Ask for network policy at start" )
+
#define VIEWDETAIL_TEXT N_( "Show the opening dialog view in detail mode" )
+#define QT_MODE_TEXT N_( "Selection of the starting mode and look " )
+#define QT_MODE_LONGTEXT N_( "Start VLC with:\n" \
+ " - normal mode\n" \
+ " - a zone always present to show information" \
+ "as lyrics, album arts...\n" \
+ " - minimal mode with limited controls" )
+
+#define QT_NORMAL_MODE_TEXT N_( "Classic look" )
+#define QT_ALWAYS_VIDEO_MODE_TEXT N_( "Complete look with information area" )
+#define QT_MINIMAL_MODE_TEXT N_( "Minimal look with no menus" )
+
+static int i_mode_list[] =
+ { QT_NORMAL_MODE, QT_ALWAYS_VIDEO_MODE, QT_MINIMAL_MODE };
+static const char *psz_mode_list_text[] =
+ { QT_NORMAL_MODE_TEXT, QT_ALWAYS_VIDEO_MODE_TEXT, QT_MINIMAL_MODE_TEXT };
+
vlc_module_begin();
set_shortname( (char *)"Qt" );
set_description( (char*)_("Qt interface") );
set_description( "Dialogs provider" );
set_capability( "dialogs provider", 51 );
- add_bool( "qt-always-video", VLC_FALSE, NULL, ALWAYS_VIDEO_TEXT,
- ALWAYS_VIDEO_LONGTEXT, VLC_TRUE );
- add_bool( "qt-minimal-view", VLC_FALSE, NULL, MINIMAL_TEXT,
- MINIMAL_TEXT, VLC_TRUE );
+ add_integer( "qt-display-mode", QT_NORMAL_MODE, NULL,
+ QT_MODE_TEXT, QT_MODE_LONGTEXT, VLC_FALSE );
+ change_integer_list( i_mode_list, psz_mode_list_text, 0 );
add_bool( "qt-notification", VLC_TRUE, NULL, NOTIFICATION_TEXT,
NOTIFICATION_LONGTEXT, VLC_FALSE );
add_bool( "qt-privacy-ask", VLC_TRUE, NULL, PRIVACY_TEXT, PRIVACY_TEXT,
VLC_FALSE );
-
set_callbacks( OpenDialogs, Close );
vlc_module_end();