Commit 96a9eea8 authored by Clément Stenac's avatar Clément Stenac

Icons support

Misc fprintf cleanup
parent 5b6e15db
......@@ -65,7 +65,7 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
if( !p_item->i_list )
p_control = new StringConfigControl( p_this, p_item, parent,false );
else
fprintf(stderr, "GRAA\n" );
fprintf(stderr, "TODO\n" );
break;
default:
break;
......
......@@ -106,28 +106,10 @@ void *VideoWidget::Request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
}
p_vout = p_nvout;
fprintf( stderr, "[Before update] MI constraints %ix%i -> %ix%i\n",
p_intf->p_sys->p_mi->minimumSize().width(),
p_intf->p_sys->p_mi->minimumSize().height(),
p_intf->p_sys->p_mi->maximumSize().width(),
p_intf->p_sys->p_mi->maximumSize().height() );
setMinimumSize( 1,1 );
p_intf->p_sys->p_mi->videoSize = QSize( *pi_width, *pi_height );
updateGeometry();
need_update = true;
fprintf( stderr, "[After update] MI constraints %ix%i -> %ix%i - Fr %ix%i -> %ix%i (hint %ix%i)\n",
p_intf->p_sys->p_mi->minimumSize().width(),
p_intf->p_sys->p_mi->minimumSize().height(),
p_intf->p_sys->p_mi->maximumSize().width(),
p_intf->p_sys->p_mi->maximumSize().height(),
minimumSize().width(),
minimumSize().height(),
maximumSize().width(),
maximumSize().height(),
sizeHint().width(),sizeHint().height()
);
return (void*)winId();
}
......@@ -142,23 +124,11 @@ void VideoWidget::Release( void *p_win )
{
p_intf->p_sys->p_mi->videoSize = QSize ( 1,1 );
}
fprintf( stderr, "[Before R update] MI constraints %ix%i -> %ix%i\n",
p_intf->p_sys->p_mi->minimumSize().width(),
p_intf->p_sys->p_mi->minimumSize().height(),
p_intf->p_sys->p_mi->maximumSize().width(),
p_intf->p_sys->p_mi->maximumSize().height() );
updateGeometry();
if( !config_GetInt( p_intf, "qt-always-video" ) )
need_update = true;
fprintf( stderr, "[After R update] MI constraints %ix%i -> %ix%i\n",
p_intf->p_sys->p_mi->minimumSize().width(),
p_intf->p_sys->p_mi->minimumSize().height(),
p_intf->p_sys->p_mi->maximumSize().width(),
p_intf->p_sys->p_mi->maximumSize().height() );
p_vout = NULL;
}
......
......@@ -84,22 +84,16 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
videoWidget->resize( videoSize );
ui.vboxLayout->insertWidget( 0, videoWidget );
}
fprintf( stderr, "Margin : %i\n",ui.vboxLayout->margin() );
readSettings( "MainWindow" );
addSize = QSize( ui.vboxLayout->margin() * 2, PREF_H );
if( config_GetInt( p_intf, "qt-always-video" ) )
mainSize = videoSize + addSize;
else
mainSize = QSize( PREF_W, PREF_H );
resize( mainSize );
mainSize = size();
fprintf( stderr, "Size is %ix%i - Video %ix%i\n", mainSize.width(), mainSize.height(), videoSize.width(), videoSize.height() );
fprintf( stderr, "Additional size around video %ix%i", addSize.width(), addSize.height() );
setMinimumSize( PREF_W, addSize.height() );
/* Init input manager */
......@@ -197,7 +191,6 @@ void MainInterface::setName( QString name )
void MainInterface::setStatus( int status )
{
fprintf( stderr, "Status is now %i\n", status );
if( status == 2 ) // Playing
ui.playButton->setIcon( QIcon( ":/pixmaps/pause.png" ) );
else
......
......@@ -699,20 +699,16 @@ void QVLCMenu::CreateAndConnect( QMenu *menu, const char *psz_var,
val, psz_var );
connect( action, SIGNAL(triggered()), THEDP->menusMapper, SLOT(map()) );
THEDP->menusMapper->setMapping( action, itemData );
menu->addAction( action );
}
void QVLCMenu::DoAction( intf_thread_t *p_intf, QObject *data )
{
MenuItemData *itemData = qobject_cast<MenuItemData *>(data);
vlc_object_t *p_object = (vlc_object_t *)vlc_object_get( p_intf,
itemData->i_object_id );
if( p_object == NULL ) return;
fprintf( stderr, "Setting %s on %i\n", itemData->psz_var,
p_object->i_object_id );
var_Set( p_object, itemData->psz_var, itemData->val );
vlc_object_release( p_object );
}
/* XPM */
static char * type_afile_xpm[] = {
"16 16 107 2",
" c None",
". c #8F8F8F",
"+ c #FFFFFF",
"@ c #B7CFF9",
"# c #B8CFF8",
"$ c #BCD2F7",
"% c #AFCAF4",
"& c #93B7EE",
"* c #5B91E2",
"= c #4E88DE",
"- c #4481D9",
"; c #3A7AD6",
"> c #2F73D2",
", c #246CCD",
"' c #1663CA",
") c #F3F7FE",
"! c #F1F6FD",
"~ c #EFF5FD",
"{ c #F2F7FF",
"] c #F2F8FF",
"^ c #E8EFFB",
"/ c #E6EDF9",
"( c #E7EFFB",
"_ c #E2EAF7",
": c #DCE5F1",
"< c #D9E2EF",
"[ c #D6E1EE",
"} c #FFFFFE",
"| c #EFEEED",
"1 c #D5D5D3",
"2 c #CDCBC9",
"3 c #CCCBC9",
"4 c #D4D2D0",
"5 c #EAE8E5",
"6 c #FCFBF8",
"7 c #FBFAF7",
"8 c #F9F7F4",
"9 c #FAFAFA",
"0 c #CFCFCF",
"a c #A7A7A7",
"b c #818181",
"c c #696969",
"d c #686868",
"e c #808080",
"f c #A5A5A5",
"g c #C6C6C6",
"h c #EFEFEF",
"i c #F3F3F3",
"j c #D2D2D2",
"k c #B0B0B0",
"l c #858585",
"m c #828282",
"n c #989898",
"o c #999999",
"p c #838383",
"q c #848484",
"r c #AEAEAE",
"s c #CACACA",
"t c #F0F0F0",
"u c #F6F6F6",
"v c #BDBDBD",
"w c #9F9F9F",
"x c #E8E8E8",
"y c #C3C3C3",
"z c #A1A1A1",
"A c #ACACAC",
"B c #BBBBBB",
"C c #E4E4E4",
"D c #F4F4F4",
"E c #C9C9C9",
"F c #C2C2C2",
"G c #B8B8B8",
"H c #B9B9B9",
"I c #B5B5B5",
"J c #C1C1C1",
"K c #B1B1B1",
"L c #E5E5E5",
"M c #FEFEFE",
"N c #ABABAB",
"O c #EBEBEB",
"P c #C0C0C0",
"Q c #8B8B8B",
"R c #BABABA",
"S c #A6A6A6",
"T c #F1F1F1",
"U c #F9F9F9",
"V c #DEDEDE",
"W c #F2F2F2",
"X c #909090",
"Y c #D8D8D8",
"Z c #F5F5F5",
"` c #FCFCFC",
" . c #DCDCDC",
".. c #777777",
"+. c #6D6D6D",
"@. c #979797",
"#. c #8C8C8C",
"$. c #F7F7F7",
"%. c #F8F8F8",
"&. c #CECECE",
"*. c #868686",
"=. c #B2B2B2",
"-. c #A8A8A8",
";. c #EAEAEA",
">. c #FBFBFB",
",. c #FDFDFD",
"'. c #EEEEEE",
". . . . . . . . . . . . . . . . ",
". + @ # $ % & * = - ; > , ' + . ",
". + ) ! ~ { ] ^ / ( _ : < [ + . ",
". + + + } | 1 2 3 4 5 6 7 8 + . ",
". + + 9 0 a b c d e f g h i + . ",
". + + j k l m n o p q r s t + . ",
". + u v r w s t x y z A B C + . ",
". + D k E F G H I r J s K L + . ",
". + M N J O P . Q R O E S T + . ",
". + U V . v W W t h J X Y 9 + . ",
". + Z ` ...+.. @.#.q s D h + . ",
". + $.%.$.&.*.l =.v g -.-.-.-.. ",
". + U U U U h C C ;.;.-.+ + . ",
". + >.>.>.>.M M ,.+ '.-.+ . ",
". + + + + + + + + + U -.. ",
". . . . . . . . . . . . "};
/* XPM */
static char * type_card_xpm[] = {
"16 16 174 2",
" c #FFFFFF",
". c #E7E7E7",
"+ c #888888",
"@ c #696969",
"# c #B1B1B1",
"$ c #D4D4D4",
"% c #5D5D5D",
"& c #AFAFAF",
"* c #DCDCDC",
"= c #5E5E5E",
"- c #ECECEC",
"; c #FCFCFC",
"> c #D9D9D9",
", c #D3D3D3",
"' c #D2D2D2",
") c #CFCFCF",
"! c #7D7D7D",
"~ c #B2B6B1",
"{ c #72896A",
"] c #6D7E60",
"^ c #6E7E5F",
"/ c #6C7B5C",
"( c #6B7A5B",
"_ c #606C50",
": c #616C4F",
"< c #646F53",
"[ c #5D684C",
"} c #606A4F",
"| c #536148",
"1 c #717370",
"2 c #989B95",
"3 c #667B5C",
"4 c #7F8C7B",
"5 c #8D978A",
"6 c #889185",
"7 c #868F83",
"8 c #858E81",
"9 c #677163",
"0 c #48563D",
"a c #727C67",
"b c #495642",
"c c #697164",
"d c #48573E",
"e c #686B67",
"f c #BFBFBF",
"g c #FEFEFE",
"h c #969993",
"i c #7B8875",
"j c #A9AAA8",
"k c #B7B7B7",
"l c #ADADAD",
"m c #A8A8A8",
"n c #A2A2A2",
"o c #666766",
"p c #545D4D",
"q c #8A8D72",
"r c #52573D",
"s c #969276",
"t c #3E4933",
"u c #6D706C",
"v c #9F9F9F",
"w c #7E8C78",
"x c #929492",
"y c #959595",
"z c #818181",
"A c #7C7C7C",
"B c #7F7F7F",
"C c #4E4F4E",
"D c #495143",
"E c #857664",
"F c #4D3C2B",
"G c #936C5E",
"H c #393F2C",
"I c #676A66",
"J c #9A9A9A",
"K c #979B94",
"L c #586B50",
"M c #4F574C",
"N c #535851",
"O c #4F544D",
"P c #4D514B",
"Q c #4B4E49",
"R c #393E37",
"S c #3B432F",
"T c #58634F",
"U c #3D4737",
"V c #545C4F",
"W c #37432F",
"X c #61635F",
"Y c #A9A9A9",
"Z c #FDFDFD",
"` c #979C96",
" . c #6D8462",
".. c #536045",
"+. c #484F39",
"@. c #414833",
"#. c #3E4531",
"$. c #424733",
"%. c #3E4430",
"&. c #535B3F",
"*. c #566445",
"=. c #566243",
"-. c #59634A",
";. c #4E5843",
">. c #696B67",
",. c #F6F6F6",
"'. c #979C95",
"). c #81916F",
"!. c #6C7257",
"~. c #75795F",
"{. c #676D55",
"]. c #5E634A",
"^. c #6B6E53",
"/. c #566143",
"(. c #576746",
"_. c #65734F",
":. c #69785B",
"<. c #71736F",
"[. c #676766",
"}. c #989796",
"|. c #7E7E7E",
"1. c #959A93",
"2. c #778663",
"3. c #484834",
"4. c #53523B",
"5. c #54553D",
"6. c #444431",
"7. c #494733",
"8. c #576143",
"9. c #65724E",
"0. c #62714D",
"a. c #687859",
"b. c #5E605C",
"c. c #4A4A4A",
"d. c #656565",
"e. c #8C8C8C",
"f. c #666666",
"g. c #AEB1AC",
"h. c #637A5A",
"i. c #677352",
"j. c #5E694A",
"k. c #5E684A",
"l. c #5D6748",
"m. c #5B6647",
"n. c #626E4C",
"o. c #677450",
"p. c #64714D",
"q. c #445135",
"r. c #293121",
"s. c #161B12",
"t. c #5C5C5C",
"u. c #DEDEDE",
"v. c #F8F8F8",
"w. c #757B73",
"x. c #A2A175",
"y. c #9C9A70",
"z. c #9C9A6F",
"A. c #9B996E",
"B. c #9A986D",
"C. c #98956B",
"D. c #323A2D",
"E. c #AAAAAA",
"F. c #979797",
"G. c #AFB1AE",
"H. c #6F6E59",
"I. c #6C6B56",
"J. c #6C6A55",
"K. c #6B6A55",
"L. c #6A6954",
"M. c #5B5F58",
"N. c #EEEEEE",
"O. c #D7D7D7",
"P. c #5F5F5F",
"Q. c #EDEDED",
" . + @ # ",
" $ % & * ",
" $ = - ",
"; > $ $ $ $ $ , ' $ $ $ ) ! - ",
"~ { ] ^ / / ( _ : < [ } | 1 - ",
"2 3 4 5 6 7 8 9 0 a b c d e f g ",
"h i j k l m n o p q r s t u v ; ",
"h w x y z A B C D E F G H I J ; ",
"K L M N O P Q R S T U V W X Y Z ",
"` ...+.@.#.$.%.&.*.=.-.;.>.f ,.",
"'.).!.~.{.].^./.(._.:.<.% [.}.|.",
"1.2.3.4.5.6.7.8.9.0.a.b.c.d.e.f.",
"g.h.i.j.k.l.m.n.o.p.q.r.s.t.& u.",
"v.w.x.y.z.A.B.B.B.C.D.E.F.= - ",
" G.H.I.I.I.J.K.K.L.M.N.O.P.Q. ",
" "};
/* XPM */
static char * type_cdda_xpm[] = {
"16 16 119 2",
" c None",
". c #7E7E7E",
"+ c #A3A3A3",
"@ c #000000",
"# c #030303",
"$ c #BDCCFF",
"% c #C1CDF5",
"& c #D8DDF1",
"* c #C4CBE9",
"= c #C0C8F0",
"- c #646464",
"; c #A8A8A8",
"> c #DFF2FF",
", c #F9FDFF",
"' c #E0E7FB",
") c #B1C3F7",
"! c #F7FAFF",
"~ c #FFFFFF",
"{ c #DBDEEE",
"] c #727EB7",
"^ c #2A2928",
"/ c #BBBBBB",
"( c #E1E9FF",
"_ c #FEFFFD",
": c #BECDF6",
"< c #E5ECFC",
"[ c #E8EDFA",
"} c #747CAA",
"| c #85847F",
"1 c #B8B8B8",
"2 c #D4E6FF",
"3 c #EBEEFB",
"4 c #DDE5FB",
"5 c #FEFFFF",
"6 c #EFF3FE",
"7 c #91ABF5",
"8 c #B7BFE3",
"9 c #7C7A7B",
"0 c #878787",
"a c #1A1A1A",
"b c #D1E4FF",
"c c #D8E1F8",
"d c #FAFAFE",
"e c #FFFFFE",
"f c #D5E0FB",
"g c #EFF0F9",
"h c #FBFDFF",
"i c #AAC0FA",
"j c #B0C7FF",
"k c #DEF0FF",
"l c #8A8B8F",
"m c #A4A49F",
"n c #585857",
"o c #D1E5FF",
"p c #B9CAF5",
"q c #C7D4F8",
"r c #E4EBFC",
"s c #F1F5FF",
"t c #D4DDFD",
"u c #C1C9E9",
"v c #B2BEE9",
"w c #D7E6FF",
"x c #383428",
"y c #8B8C90",
"z c #D3E4FF",
"A c #ABBEF3",
"B c #BBCAF6",
"C c #CAD8F8",
"D c #CED9FC",
"E c #B5C5FC",
"F c #AFB4D7",
"G c #DDE6FF",
"H c #1D1B14",
"I c #34322B",
"J c #CFDCFF",
"K c #C2D8FF",
"L c #B8C8F4",
"M c #ABBDF4",
"N c #B8C9F6",
"O c #D1DCFB",
"P c #DAE2FE",
"Q c #AFBAE2",
"R c #CACDE3",
"S c #F8FBFF",
"T c #DAE7FF",
"U c #C5D8FF",
"V c #D5E6FF",
"W c #5E6592",
"X c #C4D3FF",
"Y c #9BB1F2",
"Z c #B0C4F5",
"` c #D6DDF5",
" . c #F5F6FA",
".. c #E2EAFC",
"+. c #DCE7FF",
"@. c #515886",
"#. c #C0D9FF",
"$. c #B3C5FA",
"%. c #FDFDFF",
"&. c #FAFCFF",
"*. c #E6EBFD",
"=. c #DBDDEE",
"-. c #CADBFF",
";. c #FFFEFE",
">. c #FEFDFF",
",. c #F9FAFE",
"'. c #C7D4F7",
"). c #FDFDFE",
"!. c #959AC1",
"~. c #C7D7FF",
"{. c #D2DEFC",
"]. c #DCE5FF",
"^. c #AFB3D2",
"/. c #ADC1FF",
"(. c #C7D2FF",
"_. c #DBE0FA",
":. c #D7DFF6",
"<. c #A1AEDC",
"[. c #98A1CC",
" . ",
" + @ # ",
" $ % & * = @ @ - ; ",
" > , ' ) ! ~ ~ { ] ^ / ",
" ( ~ _ : < ~ ~ ~ [ } | 1 ",
" 2 ~ ~ ~ 3 4 ~ 5 6 7 8 9 0 @ a ",
" b c d e e f g h i j k l m n ",
" o p q r s t u v w x @ y ",
" z A B C D E F G H I J ",
" K L M N O P Q R S T U V W ",
" X Y Z 5 e ` .~ e ..+.@. ",
" #.$.S %.~ &.*.~ ~ ~ =. ",
" -.~ ;.>.,.'.).~ ~ !. ",
" ~.~ ~ 5 {.].~ ^. ",
" /.(._.:.<.[. ",
" "};
/* XPM */
static char * type_directory_xpm[] = {
"16 16 83 1",
" c None",
". c #3274DB",
"+ c #3273DB",
"@ c #3373DB",
"# c #3274DC",
"$ c #3170D6",
"% c #F5FBFD",
"& c #F5F9FD",
"* c #306DD2",
"= c #E8F5FD",
"- c #E8F6FD",
"; c #E9F5FD",
"> c #5F7DB1",
", c #316DD1",
"' c #306ED1",
") c #316ED2",
"! c #306DD1",
"~ c #306ACC",
"{ c #DBF0FD",
"] c #DAEEFD",
"^ c #DBEEFD",
"/ c #DAF0FD",
"( c #2F66C6",
"_ c #CBE8FD",
": c #CBE9FD",
"< c #255FD1",
"[ c #2E63C0",
"} c #B9E2FD",
"| c #BCE2FD",
"1 c #B9E1FD",
"2 c #BCE1FD",
"3 c #9EC6EE",
"4 c #FCFCFD",
"5 c #ACD1FD",
"6 c #2D61BD",
"7 c #A9DAFD",
"8 c #A9DBFD",
"9 c #86B9EC",
"0 c #8CBDFD",
"a c #89BEFD",
"b c #89BDFD",
"c c #2C5EB8",
"d c #99D3FD",
"e c #2259CB",
"f c #6BAAFD",
"g c #6BA9FD",
"h c #2259CC",
"i c #2B5AB1",
"j c #88CBFD",
"k c #1F52C5",
"l c #5098FD",
"m c #4F98FD",
"n c #4F97FD",
"o c #1E52C5",
"p c #2A58AE",
"q c #7AC4FD",
"r c #1C49BD",
"s c #3987FD",
"t c #3988FD",
"u c #1B49BD",
"v c #2955A8",
"w c #6DBEFD",
"x c #1840B5",
"y c #287CFD",
"z c #287BFD",
"A c #277BFD",
"B c #183FB5",
"C c #2852A3",
"D c #62B7FD",
"E c #1337AA",
"F c #FDFDFD",
"G c #AEAEC6",
"H c #1337AC",
"I c #28509F",
"J c #102DA2",
"K c #274D9B",
"L c #4FAEFD",
"M c #0B2599",
"N c #0C2599",
"O c #274B97",
"P c #091D91",
"Q c #091E91",
"R c #091E90",
" .+@#.. ",
" $%&%&&&$ ",
"*===-=;=>,')'!, ",
"~{{{{{]{^^]{^{/~",
"(_______:<<<<<<<",
"[}}|}|12<344445<",
"678<<<<<940aabb<",
"cdef44444gfggggh",
"ijklmmnlmmmmlmno",
"pqrsttstsstttstu",
"vwxyyzyzzzAzAzzB",
"CDEFFFFFFFFFFFGH",
"IDJFFFFFFFFFFFGJ",
"KLMGGGGGGGGGGGGN",
" OPPPQRQRPRRQQP ",
" "};
/* XPM */
static char * type_disc_xpm[] = {
"16 16 91 1",
" c None",
". c #676767",
"+ c #989898",
"@ c #B7B7B7",
"# c #BEBEBE",
"$ c #919191",
"% c #5B5B5B",
"& c #CDCDCD",
"* c #FEFEFE",
"= c #FFFFFF",
"- c #FDFDFD",
"; c #BDBDBD",
"> c #717171",
", c #F3F3F3",
"' c #FBFBFB",
") c #F9F9F9",
"! c #F7F7F7",
"~ c #FAFAFA",
"{ c #EDEDED",
"] c #4A4A4A",
"^ c #DFDFDF",
"/ c #E4E4E4",
"( c #F1F1F1",
"_ c #F8F8F8",
": c #F4F4F4",
"< c #E5E5E5",
"[ c #AEAEAE",
"} c #D8D8D8",
"| c #D6D6D6",
"1 c #E2E2E2",
"2 c #F5F5F5",
"3 c #FCFCFC",
"4 c #979797",
"5 c #CFCFCF",
"6 c #CCCCCC",
"7 c #D7D7D7",
"8 c #EBEBEB",
"9 c #EEEEEE",
"0 c #EAEAEA",
"a c #E7E7E7",
"b c #D5D5D5",
"c c #6B6B6B",
"d c #C8C8C8",
"e c #E3E3E3",
"f c #DBDBDB",
"g c #C3C3C3",
"h c #EFEFEF",
"i c #DDDDDD",
"j c #D2D2D2",
"k c #D1D1D1",
"l c #484848",
"m c #787878",
"n c #CBCBCB",
"o c #CECECE",
"p c #E6E6E6",
"q c #C9C9C9",
"r c #C4C4C4",
"s c #5A5A5A",
"t c #757575",
"u c #E1E1E1",
"v c #E9E9E9",
"w c #E0E0E0",
"x c #7D7D7D",
"y c #BCBCBC",
"z c #B9B9B9",
"A c #515151",
"B c #545454",
"C c #DEDEDE",
"D c #E8E8E8",
"E c #DCDCDC",
"F c #C7C7C7",
"G c #BABABA",
"H c #BBBBBB",
"I c #C1C1C1",
"J c #333333",
"K c #ECECEC",
"L c #C0C0C0",
"M c #A6A6A6",
"N c #777777",
"O c #C2C2C2",
"P c #C6C6C6",
"Q c #555555",
"R c #828282",
"S c #9E9E9E",
"T c #848484",
"U c #9B9B9B",
"V c #B4B4B4",
"W c #DADADA",
"X c #454545",
"Y c #313131",
"Z c #2F2F2F",
" .+@#$ ",
" %&*====-; ",
" >,='')!~-={] ",
" ^/(_)!:!)-=< ",
" [}|1:~_2!3-!*4 ",
" 567^8,90!-:8ab ",
"cd6}1efg&<haijkl",
"mnofpin |}7q;rs",
"t}7uvw7.xd&dyzrA",
"BC1D{!wEf6F;GHIJ",
" o{{_~KpK0d@GLM ",
" N_~~{^p{DuOzPQ ",
" [=hwjCD<ae&R ",
" S/fqE88h/T ",
" QUV5WnUX ",
" YZ "};
/* XPM */
static char * type_node_xpm[] = {
"16 16 55 1",
" c None",
". c #949494",
"+ c #919191",
"@ c #FAFAFA",
"# c #8F8F8F",
"$ c #F5F5F5",
"% c #F6F6F6",
"& c #999999",
"* c #909090",
"= c #8D8D8D",
"- c #F0F0F0",
"; c #EFEFEF",
"> c #898989",
", c #E9E9E9",
"' c #888888",
") c #868686",
"! c #E2E2E2",
"~ c #E3E3E3",
"{ c #D0D0D0",
"] c #FDFDFD",
"^ c #DCDCDC",
"/ c #848484",
"( c #DBDBDB",
"_ c #C4C4C4",
": c #CECECE",
"< c #CDCDCD",
"[ c #828282",
"} c #D4D4D4",
"| c #BFBFBF",
"1 c #858585",
"2 c #7E7E7E",
"3 c #CCCCCC",
"4 c #808080",
"5 c #B1B1B1",
"6 c #7F7F7F",
"7 c #7C7C7C",
"8 c #C6C6C6",
"9 c #7A7A7A",
"0 c #A5A5A5",
"a c #797979",
"b c #C0C0C0",
"c c #747474",
"d c #9C9C9C",
"e c #9B9B9B",
"f c #777777",
"g c #BABABA",
"h c #6D6D6D",
"i c #FEFEFE",
"j c #6E6E6E",
"k c #676767",
"l c #727272",
"m c #606060",
"n c #707070",
"o c #5B5B5B",
"p c #5A5A5A",
" ...... ",
" +@@@@@@+ ",
"#$$$$$%$&##*### ",
"=-----;---;---;=",
">,,,,,,,,'''''''",
")!!~!~!~'{]]]]^'",
"/(('''''_]:<<<<'",
"[}/|]]]]]||||||1",
"2345555555555556",
"7890000000000009",
"abcdddddddededdc",
"fghiiiiiiiiiii8j",
"cgkiiiiiiiiiii8k",
"l5m888888888888m",
" noopopopoppooo ",
" "};
/* XPM */
static char * type_unknown_xpm[] = {
"16 16 4 1",
" c None",
". c #FFFFFF",
"+ c #000000",
"@ c #BFBFBF",
"................",
"..++++++++......",
"..+......++.....",
"..+.+.+..+.+....",
"..+......++++...",
"..+.+.+.....+...",
".@+.........+...",
"..+.+.+.+.+.+...",
"..+.........+...",
"..+.+.+.+.+.+...",
"..+.........+...",
"..+.+.+.+.+.+...",
"..+.........+...",
"..+++++++++++...",
"................",
"................"};
/* XPM */
static char * type_vfile_xpm[] = {
"16 16 108 2",
" c None",
". c #8F8F8F",
"+ c #FFFFFF",
"@ c #B0B0B0",
"# c #A7A7A7",
"$ c #939393",
"% c #8B8B8B",
"& c #2B2B2B",
"* c #0C0C0C",
"= c #010101",
"- c #000000",
"; c #EFEFEF",
"> c #ECECEC",
", c #E8E8E8",
"' c #E9E9E9",
") c #DFDFDF",
"! c #DCDCDC",
"~ c #E3E3E3",
"{ c #DADADA",
"] c #D5D5D5",
"^ c #D4D4D4",
"/ c #D2D2D2",
"( c #A6A6A6",
"_ c #828181",
": c #F2F2F2",
"< c #FBFBFB",
"[ c #FAFAFA",
"} c #929292",
"| c #3B3A3A",
"1 c #656769",
"2 c #626261",
"3 c #E6E6E5",
"4 c #FDFDFD",
"5 c #868685",
"6 c #292827",
"7 c #9CA4AF",
"8 c #E1F2FF",
"9 c #A6AEB4",
"0 c #5B5C5B",
"a c #D7D7D7",
"b c #F8F8F8",
"c c #787777",
"d c #1D1D1D",
"e c #787C80",
"f c #B6C2D2",
"g c #E0F0FF",
"h c #F3FEFF",
"i c #C3C6C8",
"j c #666666",
"k c #CCCCCB",
"l c #F4F4F4",
"m c #707070",
"n c #767E86",
"o c #EAF8FF",
"p c #BFC6D0",
"q c #C4CCD6",
"r c #EBF4FF",
"s c #767575",
"t c #9C9C9C",
"u c #EDEDED",
"v c #636363",
"w c #0E0F0F",
"x c #595C60",
"y c #88909B",
"z c #E6F1FD",
"A c #F1FDFF",
"B c #D4DBE1",
"C c #CDCED0",
"D c #7B7B7A",
"E c #949494",
"F c #F7F7F7",
"G c #878787",
"H c #0E0E0E",
"I c #999A9B",
"J c #ABB3BB",
"K c #858D97",
"L c #CCD7E5",
"M c #B0B3B6",
"N c #676665",
"O c #A0A0A0",
"P c #E4E4E4",
"Q c #616161",
"R c #7E7E80",
"S c #F1F8FC",
"T c #F7FFFF",
"U c #A0ABB5",
"V c #363738",
"W c #363535",
"X c #AEAEAE",
"Y c #FCFCFC",
"Z c #F1F1F1",
"` c #FEFEFE",
" . c #EEEEEE",
".. c #686766",
"+. c #76797D",
"@. c #C5CFDC",
"#. c #6A6D70",
"$. c #3C3B3A",
"%. c #BEBEBE",
"&. c #A8A8A8",
"*. c #F9F9F9",
"=. c #F6F6F5",
"-. c #767675",
";. c #444444",
">. c #525151",
",. c #CFCFCF",
"'. c #F0F0F0",
"). c #ADADAD",
". . . . . . . . . . . . . . . . ",
". + @ # $ % & * = - - - - - + . ",
". + ; > , ' ) ! ~ ~ { ] ^ / + . ",
". + + + + + + + ( _ : + < [ + . ",
". + + + + + + } | 1 2 3 4 : + . ",
". + + + + + 5 6 7 8 9 0 a b + . ",
". + + + [ c d e f g h i j k + . ",
". + + l m - n o p q r + s t + . ",
". + u v w x y z A B C D E F + . ",
". + G H I + J K L M N O 4 F + . ",
". + P Q R S T U V W X Y Z ; + . ",
". + ` ...+.@.#.$.%.< &.&.&.&.. ",
". + *.` =.-.;.>.,.+ '.&.+ + . ",
". + < < ` b ).a + 4 : &.+ . ",
". + + + + + + + + + Y &.. ",
". . . . . . . . . . . . "};
......@@ -21,11 +21,26 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "pixmaps/codec.xpm"
#include <QIcon>
#include "qt4.hpp"
#include <QApplication>
#include "playlist_model.hpp"
#include <assert.h>
#include "pixmaps/type_unknown.xpm"
#include "pixmaps/type_afile.xpm"
#include "pixmaps/type_vfile.xpm"
#include "pixmaps/type_net.xpm"
#include "pixmaps/type_card.xpm"
#include "pixmaps/type_disc.xpm"
#include "pixmaps/type_cdda.xpm"
#include "pixmaps/type_directory.xpm"
#include "pixmaps/type_playlist.xpm"
#include "pixmaps/type_node.xpm"
QIcon PLModel::icons[ITEM_TYPE_NUMBER];
static int PlaylistChanged( vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void * );
static int PlaylistNext( vlc_object_t *, const char *,
......@@ -98,6 +113,7 @@ void PLItem::update( playlist_item_t *p_item )
{
strings[1] = QString::fromUtf8( p_item->p_input->p_meta->psz_artist );
}
type = p_item->p_input->i_type;
}
/*************************************************************************
......@@ -116,9 +132,22 @@ PLModel::PLModel( playlist_t *_p_playlist,
i_cached_id = -1;
i_cached_input_id = -1;
#define ADD_ICON(type, x) icons[ITEM_TYPE_##type] = QIcon( QPixmap( type_##x##_xpm ) );
ADD_ICON( UNKNOWN , unknown );
ADD_ICON( AFILE,afile );
ADD_ICON( VFILE, vfile );
ADD_ICON( DIRECTORY, directory );
ADD_ICON( DISC, disc );
ADD_ICON( CDDA, cdda );
ADD_ICON( CARD, card );
ADD_ICON( NET, net );
ADD_ICON( PLAYLIST, playlist );
ADD_ICON( NODE, node );
rootItem = NULL;
rebuildRoot( p_root );
addCallbacks();
}
void PLModel::rebuildRoot( playlist_item_t *p_root )
......@@ -179,9 +208,18 @@ void PLModel::activateItem( const QModelIndex &index )
/****************** Base model mandatory implementations *****************/
QVariant PLModel::data(const QModelIndex &index, int role) const
{
if ( !index.isValid() || role != Qt::DisplayRole ) return QVariant();
assert( index.isValid() );
PLItem *item = static_cast<PLItem*>(index.internalPointer());
if( role == Qt::DisplayRole )
{
return QVariant( item->columnString( index.column() ) );
}
else if( role == Qt::DecorationRole && index.column() == 0 )
{
if( item->type >= 0 )
return QVariant( PLModel::icons[item->type] );
}
return QVariant();
}
int PLModel::itemId( const QModelIndex &index ) const
......@@ -384,19 +422,12 @@ void PLModel::ProcessItemAppend( playlist_add_t *p_add )
p_item = playlist_ItemGetById( p_playlist, p_add->i_item );
if( !p_item || p_item->i_flags & PLAYLIST_DBL_FLAG ) goto end;
fprintf( stderr, "Appending item %s - parent %i (root %i)\n",
p_item->p_input->psz_name, p_item->p_parent->i_id,
rootItem->i_id );
if( i_depth == 1 && p_item->p_parent &&
p_item->p_parent->i_id != rootItem->i_id )
goto end;
fprintf( stderr, "Still continuing\n" );
newItem = new PLItem( p_item, nodeItem, this );
nodeItem->appendChild( newItem );
fprintf( stderr, "duh\n" );
UpdateTreeItem( p_item, newItem, true );
end:
return;
......@@ -452,11 +483,11 @@ void PLModel::UpdateTreeItem( playlist_item_t *p_item, PLItem *item,
bool signal, bool force )
{
if( !force && i_depth == 1 && p_item->p_parent &&
p_item->p_parent->i_id == rootItem->i_id )
p_item->p_parent->i_id != rootItem->i_id )
return;
item->update( p_item );
if( signal )
{ // emit
{ /// \todo emit
}
}
......@@ -514,6 +545,5 @@ static int ItemAppended( vlc_object_t *p_this, const char *psz_variable,
}
PLEvent *event = new PLEvent( p_add );
QApplication::postEvent( p_model, static_cast<QEvent*>(event) );
fprintf( stderr, "Posted event to model\n" );
return VLC_SUCCESS;
}
......@@ -55,6 +55,7 @@ public:
protected:
QList<PLItem*> children;
QList<QString> strings;
int type;
int i_id;
int i_input_id;
friend class PLModel;
......@@ -122,6 +123,8 @@ private:
playlist_t *p_playlist;
int i_depth;
static QIcon icons[ITEM_TYPE_NUMBER];
/* Update processing */
void ProcessInputItemUpdate( int i_input_id );
void ProcessItemRemoval( int i_id );
......
......@@ -77,7 +77,6 @@ protected:
}
void writeSettings( QString name )
{
fprintf( stderr, "save\n" );
QSettings settings( "VideoLAN", "VLC" );
settings.beginGroup( name );
settings.setValue ("size", size() );
......
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