Пример #1
0
static void
ice_msgs_process(void)
{
   IceProcessMessagesStatus status;

   status = IceProcessMessages(ice_conn, NULL, NULL);
   if (status == IceProcessMessagesIOError)
     {
	/* Less of the hope.... E survives */
	Alert(_("ERROR!\n" "\n"
		"Lost the Session Manager that was there?\n"
		"Here here session manager... come here... want a bone?\n"
		"Oh come now! Stop sulking! Bugger. Oh well. "
		"Will continue without\n" "a session manager.\n" "\n"
		"I'll survive somehow.\n" "\n" "\n" "... I hope.\n"));
	ice_exit();
     }
}
Пример #2
0
void miniwindow::ice_init_menu_actions()
{
    mode0 = new QAction(QString::fromLocal8Bit("单曲播放"), this);
    mode1 = new QAction(QString::fromLocal8Bit("列表循环"), this);
    mode2 = new QAction(QString::fromLocal8Bit("单曲循环"), this);
    mode3 = new QAction(QString::fromLocal8Bit("随机播放"), this);

    connect(mode0, SIGNAL(triggered()), this, SLOT(ice_set_mode()));
    connect(mode1, SIGNAL(triggered()), this, SLOT(ice_set_mode()));
    connect(mode2, SIGNAL(triggered()), this, SLOT(ice_set_mode()));
    connect(mode3, SIGNAL(triggered()), this, SLOT(ice_set_mode()));

    modeGroup = new QActionGroup(this);
    modeGroup->addAction(mode0);
    modeGroup->addAction(mode1);
    modeGroup->addAction(mode2);
    modeGroup->addAction(mode3);

    mode0->setCheckable(true);
    mode1->setCheckable(true);
    mode2->setCheckable(true);
    mode3->setCheckable(true);
    mode0->setChecked(true);


    mainForm = new QAction(QString::fromLocal8Bit("返回主界面"),this);
    exit = new QAction(QString::fromLocal8Bit("退出"),this);
    next = new QAction(QString::fromLocal8Bit("下一曲"),this);
    last = new QAction(QString::fromLocal8Bit("上一曲"),this);
    lyric = new QAction(QString::fromLocal8Bit("桌面歌词"), this);


    volSlider = new QSlider(Qt::Horizontal, this);
    volSlider->setRange(0, 100);
    volSlider->setGeometry(QRect(26,0,75,25));
    //connect(volSlider, SIGNAL(valueChanged(int)), this, SIGNAL(volumeChanged(int)));
    /* correct lately */
    volSlider->setStyleSheet("QSlider::groove:horizontal{border:0px;height:4px;}"
        "QSlider::sub-page:horizontal{background:#0096ff;}"
        "QSlider::add-page:horizontal{background:lightgray;} "
        "QSlider::handle:horizontal{background:white;width:10px;border:#51b5fb 10px;border-radius:5px;margin:-3px 0px -3px 0px;}");

    setVolumn = new QWidgetAction(this);
    setVolumn->setDefaultWidget(volSlider);

    contextMenu = new QMenu(this);
    contextMenu->addAction(mainForm);
    contextMenu->addSeparator();
    contextMenu->addAction(setVolumn);
    contextMenu->addSeparator();
    contextMenu->addAction(next);
    contextMenu->addAction(last);
    contextMenu->addSeparator();
    contextMenu->addActions(modeGroup->actions());
    contextMenu->addSeparator();
    contextMenu->addAction(lyric);
    contextMenu->addSeparator();
    contextMenu->addAction(exit);


    contextMenu->setStyleSheet(
        "QMenu{padding:5px;background:white;border:1px solid gray;}"
        "QMenu::item{padding:0px 40px 0px 30px;height:25px;}"
        "QMenu::item:selected:enabled{background:#0096ff;color:white;}"
        "QMenu::item:selected:!enabled{background:transparent;}"
        "QMenu::separator{height:1px;background:lightgray;margin:5px 0px 5px 0px;}");

    connect(exit, SIGNAL(triggered()), this, SLOT(ice_exit()));
    connect(mainForm, SIGNAL(triggered()), this, SLOT(ice_back_to_main()));
    connect(next, SIGNAL(triggered()), this, SLOT(ice_next_music()));
    connect(last, SIGNAL(triggered()), this, SLOT(ice_last_music()));
    connect(playButton, SIGNAL(clicked()), this, SLOT(ice_play()));
    connect(pauseButton, SIGNAL(clicked()), this, SLOT(ice_pause()));
    connect(volSlider, SIGNAL(valueChanged(int)), this, SLOT(ice_update_vol(int)));
    connect(lyric, SIGNAL(triggered()), this, SLOT(ice_lyric_action()));

}