Exemple #1
0
CloudView::CloudView(QWidget *parent)
    : QWidget(parent),
      in_refresh_(false),
      list_repo_req_(NULL),
      clone_task_dialog_(NULL)

{
    setupUi(this);

    // seahub_messages_monitor_ = new SeahubMessagesMonitor(this);
    mSeahubMessagesBtn->setVisible(false);

    setupHeader();
    createRepoModelView();
    createLoadingView();
    mStack->insertWidget(INDEX_LOADING_VIEW, loading_view_);
    mStack->insertWidget(INDEX_REPOS_VIEW, repos_tree_);

    createToolBar();
    updateAccountInfoDisplay();
    prepareAccountButtonMenu();

    setupDropArea();
    setupFooter();

    resizer_ = new QSizeGrip(this);
    resizer_->resize(resizer_->sizeHint());

    refresh_status_bar_timer_ = new QTimer(this);
    connect(refresh_status_bar_timer_, SIGNAL(timeout()), this, SLOT(refreshStatusBar()));

    refresh_timer_ = new QTimer(this);
    connect(refresh_timer_, SIGNAL(timeout()), this, SLOT(refreshRepos()));

    connect(seafApplet->accountManager(), SIGNAL(accountAdded(const Account&)),
            this, SLOT(setCurrentAccount(const Account&)));

    connect(seafApplet->accountManager(), SIGNAL(accountAdded(const Account&)),
            this, SLOT(updateAccountMenu()));

    connect(seafApplet->accountManager(), SIGNAL(accountRemoved(const Account&)),
            this, SLOT(updateAccountMenu()));
#ifdef Q_WS_MAC
    mHeader->setVisible(false);
#endif
}
CloudView::CloudView(QWidget *parent)
    : QWidget(parent),
      clone_task_dialog_(NULL)

{
    setupUi(this);

    // seahub_messages_monitor_ = new SeahubMessagesMonitor(this);
    // mSeahubMessagesBtn->setVisible(false);

    layout()->setContentsMargins(1, 0, 1, 0);

    // Setup widgets from top down
    setupHeader();

    createAccountView();

    createTabs();

    // tool bar have to be created after tabs, since some of the toolbar
    // actions are provided by the tabs
    createToolBar();

    setupDropArea();

    setupFooter();

    QVBoxLayout *vlayout = (QVBoxLayout *)layout();
    vlayout->insertWidget(kIndexOfAccountView, account_view_);
    vlayout->insertWidget(kIndexOfToolBar, tool_bar_);
    vlayout->insertWidget(kIndexOfTabWidget, tabs_);

    resizer_ = new QSizeGrip(this);
    resizer_->resize(resizer_->sizeHint());

    refresh_status_bar_timer_ = new QTimer(this);
    connect(refresh_status_bar_timer_, SIGNAL(timeout()), this, SLOT(refreshStatusBar()));

    AccountManager *account_mgr = seafApplet->accountManager();
    connect(account_mgr, SIGNAL(accountsChanged()),
            this, SLOT(onAccountChanged()));

#ifdef Q_WS_MAC
    mHeader->setVisible(false);
#endif
}
Exemple #3
0
KInfoCenter::KInfoCenter() : KXmlGuiWindow( 0, Qt::WindowContextHelpButtonHint )
{
    setWindowIcon(KIcon("hwinfo"));
    setWindowTitle(i18nc("Main window title", "KInfocenter"));
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

    m_cWidget = new QWidget(this);
    setCentralWidget(m_cWidget);

    QVBoxLayout *cLayout = new QVBoxLayout(m_cWidget);
    Q_UNUSED(cLayout);

    cLayout->setSpacing(0);
    cLayout->setContentsMargins(0, 0, 0, 0);
    createMainFrame();
    createToolBar();

    //TreeWidget
    connect(m_sideMenu,SIGNAL(clicked(const KcmTreeItem*)),this,SLOT(itemClickedSlot(const KcmTreeItem*)));

    //SearchBox
    connect(m_searchText, SIGNAL(textChanged(QString)), m_sideMenu, SLOT(filterSideMenuSlot(QString)));
    connect(m_searchAction, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)),m_searchText,SLOT(setFocus()));

    //Buttons
    connect(m_moduleHelpAction, SIGNAL(triggered(bool)),this,SLOT(helpClickedSlot()));
    connect(m_exportAction, SIGNAL(triggered(bool)),this,SLOT(exportClickedSlot()));

    //Menu
    connect(m_aboutKcm, SIGNAL(triggered(bool)), this, SLOT(aboutKcmSlot()));

    //Startup
    m_searchText->completionObject()->setItems(m_sideMenu->allChildKeywords());
    m_sideMenu->setFocus(Qt::OtherFocusReason);
    m_sideMenu->changeToFirstValidItem();

    m_toolTips = new ToolTipManager(m_sideMenu);
    setupGUI(QSize(640,480), ToolBar | Keys | Save | Create, "kinfocenterui.rc");

    m_helpAction->setMenu( dynamic_cast<KMenu*>( factory()->container("help", this) ) );
    menuBar()->hide();

    QAction *aboutApp = actionCollection()->action("help_about_app");
    aboutApp->setIcon(KIcon("hwinfo"));
}
Exemple #4
0
BrowserWindow::BrowserWindow(const QString &url, QWebPage *webPage,
                             QWidget *parent, Qt::WindowFlags flags)
    : QFrame(parent, flags)
{
    setFrameStyle(QFrame::Box|QFrame::Raised);

    webView = new QWebView;
    if (webPage)
        webView->setPage(webPage);
    load(url);

    createActions();
    createToolBar();
    createLayout();
    createConnections();
    webView->page()->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);
    connect(webView, SIGNAL(linkClicked(const QUrl&)), this, SLOT (onUrlClicked(const QUrl&)));
}
FileBrowserDialog::FileBrowserDialog(const ServerRepo& repo, QWidget *parent)
    : QDialog(parent),
      repo_(repo)
{
    current_path_ = "/";
    // since root is special, the next step is unnecessary
    // current_lpath_.push_back("");

    const Account& account = seafApplet->accountManager()->currentAccount();
    data_mgr_ = new DataManager(account);

    setWindowTitle(tr("File Browser"));
    setWindowIcon(QIcon(":/images/seafile.png"));
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

    createToolBar();
    createStatusBar();
    createLoadingFailedView();
    createFileTable();

    QVBoxLayout *vlayout = new QVBoxLayout;
    vlayout->setContentsMargins(0, 6, 0, 0);
    vlayout->setSpacing(0);
    setLayout(vlayout);

    stack_ = new QStackedWidget;
    stack_->insertWidget(INDEX_LOADING_VIEW, loading_view_);
    stack_->insertWidget(INDEX_TABLE_VIEW, table_view_);
    stack_->insertWidget(INDEX_LOADING_FAILED_VIEW, loading_failed_view_);

    vlayout->addWidget(toolbar_);
    vlayout->addWidget(stack_);
    vlayout->addWidget(status_bar_);

    connect(table_view_, SIGNAL(direntClicked(const SeafDirent&)),
            this, SLOT(onDirentClicked(const SeafDirent&)));

    connect(data_mgr_, SIGNAL(getDirentsSuccess(const QList<SeafDirent>&)),
            this, SLOT(onGetDirentsSuccess(const QList<SeafDirent>&)));
    connect(data_mgr_, SIGNAL(getDirentsFailed(const ApiError&)),
            this, SLOT(onGetDirentsFailed(const ApiError&)));

    QTimer::singleShot(0, this, SLOT(fetchDirents()));
}
Exemple #6
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    m_tree = new TreeWidgetMine(ui->treeWidget);
    initButtonName();
    createToolBar();
    crtUIActConnect();
    scene = Scene::Instance();
    ui->view->setScene(scene);

    //显示关系控制栏
    //结点属性显示控制栏
    connect(ui->attrButtonGroup, SIGNAL(buttonToggled(QAbstractButton*, bool)), this, SLOT(changShowFlag(QAbstractButton*, bool)));
    connect(this,SIGNAL(nodefilterSIG(QString,bool)),scene,SLOT(nodeFilter(QString,bool)));
    //connect(ui->attrButtonGroup,SIGNAL(buttonToggled(int,bool)),this,SLOT(changeRelationFlag(int,bool)));
    ui->moneyRelationBox->setChecked(true);
    ui->idRelationBox->setChecked(true);
    ui->addrBox->setChecked(true);
    ui->societyRealtionBox->setChecked(true);
    ui->IPBox->setChecked(true);
    ui->phoneBox->setChecked(true);
    ui->MacBox->setChecked(true);
    ui->ATMBox->setChecked(true);
    //分析控制栏
    connect(ui->someNetBox, SIGNAL(clicked(bool)), ui->view, SLOT(drawNetBySomeone(bool)));
    connect(ui->linkerNumSpinBox, SIGNAL(valueChanged(int)), this, SLOT(showItemByLinkerNum(int)));
    connect(ui->topLevelColorBox, SIGNAL(clicked(bool)), this, SLOT(setTopLevelColor(bool)));
    connect(ui->fontSizeBox, SIGNAL(valueChanged(int)), this, SLOT(setFontSize(int)));
    connect(ui->findNodeBtn,SIGNAL(clicked()),this,SLOT(fixedPoint()));//定点寻址
    connect(this,SIGNAL(routePointSIG(QString )),ui->view, SLOT(routePoint(QString)));
    //jaky,
    connect(ui->view,SIGNAL(showTreeWgt(ItemBase*)),this,SLOT(showInfo(ItemBase*)));
    connect(ui->nodeDisBOx, SIGNAL(valueChanged(int)), this,SLOT(setNodeInterval(int)));

    //状态栏信息更新
    connect(scene, SIGNAL(sendMsg(QString)), this, SLOT(showBarMsg(QString)));
    connect(ui->view, SIGNAL(sendMsg(QString)), this, SLOT(showBarMsg(QString)));
    setWindowTitle("RiskKiller");
    //ui->page_1->setStyleSheet("font:75 9pt Aharoni;");
    ui->toolBox->setStyleSheet("QToolBox::tab:selected{font:12pt; color: rgb(2, 2, 124);}");

}
Exemple #7
0
MilkMainWindow::MilkMainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    setObjectName("MilkMainWindow");
    setWindowTitle("Milk");
    setWindowIcon(QIcon(":/ui/app.ico"));

    setDockOptions(QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks);

    setMinimumSize(320, 240);

    createCentralView();

    createAction();
    createMenu();
    createToolBar();
    createStatusBar();
    createDockPanel();
}
Exemple #8
0
Painter::Painter(QWidget *parent)
    :QMainWindow(parent)
{
    QFont font("Sans Serif", 12);
    setFont(font);

    setWindowTitle(tr("xy手写"));

    widget = new DrawWidget;
    setCentralWidget(widget);

    createToolBar();

    //setMinimumSize(600, 400);

    slotStyle();
    widget->setWidth(widthSpinBox->value());
    widget->setColor(Qt::black);
}
Exemple #9
0
MainWindow::MainWindow(QWidget *parent) :
	QMainWindow(parent)
{
	setWindowTitle("Vision3D");

	createToolBar();

	QSplitter *splitter = new QSplitter(Qt::Horizontal, this);
	leftMenu = new LeftMenu();
	splitter->addWidget(leftMenu);
	PlotArea * area = new PlotArea();
	splitter->addWidget(area);
	setCentralWidget(splitter);

	connect(this, SIGNAL(refreshSignal()), area, SLOT(repaint()));

	resize(800, 600);

}
Exemple #10
0
FormMain::FormMain( QWidget * parent )
	: QMainWindow( parent )
{
#ifdef DEBUG
	connect( this, SIGNAL( yell( const QString & ) ), SLOT( yellDebug( const QString & ) ) );
	emit yell( tr("is debugging!!!, drivers: %1").arg( QSqlDatabase::drivers().join(", ") ) );
#endif

	setWindowTitle( tr("Folder chart") );

	createWidgets();

	createActions();

	createToolBar();

	QSqlDatabase sqlite3 = QSqlDatabase::addDatabase("QSQLITE");	// Sqlite3 database

	sqlite3.setDatabaseName( DB_PATH );

	if ( sqlite3.open() ) {
		QSqlQuery q( sqlite3 );

		// speed up sqlite3 queries

		if ( ! q.exec( "PRAGMA synchronous=OFF" ) )
			emit yell( q.lastError().text() );

		if ( ! q.exec( "PRAGMA journal_mode=OFF" ) )
			emit yell( q.lastError().text() );

		if ( ! q.exec( "PRAGMA cache_size=2000000" ) )		// 2 MB
			emit yell( q.lastError().text() );

		dbRestoreFromDb();

	} else {
		emit yell( tr("Can't open %1 with error %2")
				.arg( DB_PATH )
				.arg( sqlite3.lastError().text() ) );

	}
}
Exemple #11
0
MainWindow::MainWindow(QWidget *parent) :
  QMainWindow(parent), logoWidget(0), classificaWidget(0), toolBar(0), newWizard(0),
  tabs(0), editor(0), squadre(new SquadreModel(this)), arbitri(new ArbitriModel(this)),
  fileOpen(""), confFile("preference.conf"), xml(squadre, arbitri), modificato(false)
{
    createLogoWidget();
    createActions();
    createMenus();
    createToolBar();

    setCentralWidget(logoWidget);

    setWindowTitle("HandBall Stats by Beatrice Guerra");
    setMinimumSize(sizeHint());

    if(loadPreference() && !fileOpen.isEmpty()){
        open(false);
    }
}
Exemple #12
0
StitcherWorkspace::StitcherWorkspace(QWidget * parent)
    :QWidget(parent)
{
    QHBoxLayout * hbox = new QHBoxLayout(this);
    QSplitter * centerSplitter = new QSplitter(Qt::Horizontal,this);
    this->setLayout(hbox);
    hbox->addWidget(centerSplitter);
    _stitcherView = new StitcherView(this);
    _stitcherView->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
    QSplitter * leftSplitter = new QSplitter(Qt::Vertical,this);
    centerSplitter->addWidget(leftSplitter);
    leftSplitter->addWidget(createToolBar());
    leftSplitter->addWidget(createGeometryTree());
    leftSplitter->addWidget(createConstraintsTree());
    connect(_stitcherView,SIGNAL(imageItemGeometryChanged(ImageItem *)),this,SLOT(loadGeometry()));
    centerSplitter->addWidget(_stitcherView);
    centerSplitter->setStretchFactor(0,0);
    centerSplitter->setStretchFactor(1,2);
    //  centerSplitter->setSizes(QList<int>() << 1 << 1000);
}
Exemple #13
0
/*!
  \brief Constructor.
  Creates a new MainWindow instance.
  \param parent parent widget of this window, default value is \a 0
 */
Ui::MainWindow::MainWindow(QWidget *parent /* = 0 */)
    : QMainWindow(parent)
{
    setWindowIcon(QIcon(":/app"));
    setWindowTitle(tr("PicWorks v%1", "Main window title with version number.").arg(appCtx->version()));

    mapper = new QSignalMapper(this);

    mdiArea = new QMdiArea;
    setCentralWidget(mdiArea);

    createActions();
    createMenus();
    createStatusBar();
    createDockPanels();
    createToolBar();
    createToolBox();
    createCommonBar();
    establishConnections();
}
Exemple #14
0
int main(int argc,char *argv[])
{

	GtkWidget *mainWindow;
	GtkWidget *mainVBox;
	GtkWidget *menuBar;
	GtkWidget *scrolledWindow;
	GtkWidget *textView;
	GtkWidget *toolBar;
	GtkWidget *statusBar;
	GtkTextBuffer *buf;


	gtk_init (&argc,&argv);

	mainWindow		= createWindow ("SimpleEditor",800,500,GTK_WIN_POS_CENTER);
	mainVBox		= gtk_vbox_new (FALSE,0);
	statusBar		= createStatusBar ();
	textView		= createTextView (statusBar);
	scrolledWindow  = gtk_scrolled_window_new (NULL,NULL);
	menuBar			= createMenuBar (textView,mainWindow);
	buf				= gtk_text_view_get_buffer(GTK_TEXT_VIEW(textView));
	toolBar			= createToolBar (textView);

	g_signal_connect(buf,"changed",G_CALLBACK(buffer_text_changed),NULL);
	g_signal_connect(G_OBJECT(mainWindow),"delete-event",G_CALLBACK(mainWindowDeleteEvent),(gpointer)textView);

	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(scrolledWindow),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);

	gtk_container_add (GTK_CONTAINER(mainWindow),mainVBox);
	gtk_box_pack_start (GTK_BOX(mainVBox),menuBar,FALSE,FALSE,0);
	gtk_box_pack_start (GTK_BOX(mainVBox),toolBar,FALSE,FALSE,0);
	gtk_box_pack_start (GTK_BOX(mainVBox),scrolledWindow,TRUE,TRUE,0);
	gtk_box_pack_start (GTK_BOX(mainVBox),statusBar,FALSE,FALSE,0);
	gtk_container_add (GTK_CONTAINER(scrolledWindow),textView);
	
	gtk_widget_show_all(mainWindow);
		
	gtk_main ();
	return 0;
}
Exemple #15
0
//-----------------------------------------------------------------------------
PlotWindow::PlotWindow(COutputHandlerPlot * pHandler, const CPlotSpecification* ptrSpec, CopasiUI3Window * pMainWindow):
  CWindowInterface(),
  mpPlot(NULL),
  mpHandler(pHandler),
  mpMainWindow(pMainWindow),
  mpWindowMenu(NULL),
  mpaCloseWindow(NULL),
  mpaShowAll(NULL),
  mpaHideAll(NULL),
  mpaPrint(NULL),
  mpaSaveImage(NULL),
  mpaSaveData(NULL),
  mpaZoomOut(NULL),
  mpaToggleLogX(NULL),
  mpaToggleLogY(NULL),
  initializing(false)
{
  this->resize(640, 480);
  this->setWindowTitle(("COPASI Plot: " + ptrSpec->getTitle()).c_str());

#ifndef Darwin
  setWindowIcon(CQIconResource::icon(CQIconResource::copasi));
#endif // not Darwin

  // set up the GUI - the toolbar
  createActions();
  createMenus();
  createToolBar();

  mpPlot = new CopasiPlot(ptrSpec, this);
  setCentralWidget(mpPlot);

  initializing  = true;
  mpaToggleLogX->setChecked(ptrSpec->isLogX());
  mpaToggleLogY->setChecked(ptrSpec->isLogY());
  initializing = false;

  addToMainWindow(mpMainWindow);
}
Exemple #16
0
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    playIcon = QIcon(":/play.png");
    pauseIcon = QIcon(":/pause.png");

    mediaObject = new Phonon::MediaObject(this);
    mediaObject->setTickInterval(OneSecond);
    videoWidget = new Phonon::VideoWidget(this);
    Phonon::createPath(mediaObject, videoWidget);
    audioOutput = new Phonon::AudioOutput(Phonon::VideoCategory,
                                          this);
    Phonon::createPath(mediaObject, audioOutput);

    createActions();
    createToolBar();
    createWidgets();
    createLayout();
    createConnections();

    setWindowTitle(QApplication::applicationName());
}
Exemple #17
0
MainWindow::MainWindow(QWidget * parent)
    : QMainWindow(parent)
{
    setWindowFlags(Qt::FramelessWindowHint);

    settingsdialog = new SettingsDialog(this);
    sudokuTable = new SudokuTable(this);
    setCentralWidget(sudokuTable);
    setWindowTitle(QStringLiteral("数独计算器"));
    setWindowIcon(QIcon(":/images/sudoku.png"));
    createActions();
    createToolBar();
    setFixedHeight(351);
    setFixedWidth(317);

    connect(sudokuTable, SIGNAL(setNextEnabled(bool)),
            this, SLOT(setNextActionEnabled(bool)));
    connect(sudokuTable, SIGNAL(setPreviousEnabled(bool)),
            this, SLOT(setPreviousActionEnabled(bool)));

    previousAction->setEnabled(false);
}
ContractManagerView::ContractManagerView(QWidget *parent) : QWidget(parent)
{
    iniFileString = QDir::currentPath() + "/workspace.ini";
    wsSettings = new QSettings(iniFileString, QSettings::IniFormat);

    setWindowFlags(Qt::Window);
    setWindowTitle("ContractManager");

    createToolBar();


    pTableView = new QTableView();
    pModel = new ContractManagerModel(0);

    QVBoxLayout *vLayout = new QVBoxLayout;
    vLayout->setSpacing(0);
    vLayout->setMargin(0);
    vLayout->setContentsMargins(0,0,0,0);

    vLayout->addWidget(pToolBar);
    vLayout->addWidget(pTableView);

    setLayout(vLayout);

    pTableView->setModel(pModel);

    (pTableView->horizontalHeader())->setSectionResizeMode(QHeaderView::ResizeToContents);
    pTableView->setSelectionMode(QAbstractItemView::SingleSelection);
    pTableView->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(pTableView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(onCustomMenuRequested(QPoint)));
    connect(pTableView, SIGNAL(clicked(QModelIndex)), this, SLOT(onClicked(QModelIndex)));

    pTableView->show();

    createContextMenu();

    setMinimumSize(200, 200);
    loadWorkSpace();
}
DiagramWindow::DiagramWindow(QWidget *parent) : QMainWindow(parent)
{
    scene = new QGraphicsScene(0, 0, 600, 500);

    view = new QGraphicsView();
    view->setScene(scene);
    view->setDragMode(QGraphicsView::RubberBandDrag);
    view->setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing);
    view->setContextMenuPolicy(Qt::ActionsContextMenu);
    setCentralWidget(view);

    minZ = 0;
    maxZ = 0;
    seqNumber = 0;

    createActions();
    createMenus();
    createToolBar();
    connect(scene, SIGNAL(selectionChanged()), this, SLOT(updateActions()));

    setWindowTitle(tr("Diagram"));
    updateActions();
}
Exemple #20
0
MainWindow::MainWindow()
{

	m_drawing = new DrawingArea(this);
	setCentralWidget(m_drawing);

	createStatusBar();
	this->resize(1000, 800);

	parseAction = new QAction(tr("&Parse File"), this);
	parseAction->setStatusTip(tr("Open a trace file for parsing"));

	exportAction = new QAction(tr("&Export Scene"), this);
	exportAction->setStatusTip(tr("Export the current scene"));

	createToolBar();

	connect(parseAction, SIGNAL(triggered()), this, SLOT(parseFile()));
	connect(exportAction, SIGNAL(triggered()), this, SLOT(exportScene()));

	connect(m_spinBox, SIGNAL(valueChanged(int)), this, SLOT(timeChanged(int)));
	connect(m_slider, SIGNAL(valueChanged(int)), this, SLOT(timeChanged(int)));
}
Exemple #21
0
VideoPlayer::VideoPlayer(QWidget *parent)
: QDialog(parent, Qt::Dialog | Qt::WindowSystemMenuHint)
{
   setWindowTitle(tr("Video Tutorial")); 
   playIcon = QIcon(":/images/play.png");
   pauseIcon = QIcon(":/images/pause.png");

   mediaObject = new Phonon::MediaObject(this);
   mediaObject->setTickInterval(OneSecond);
   videoWidget = new Phonon::VideoWidget(this);
   Phonon::createPath(mediaObject, videoWidget);
   //audioOutput = new Phonon::AudioOutput(Phonon::VideoCategory,
   //                                          this);
   //Phonon::createPath(mediaObject, audioOutput);

    createActions();
    createToolBar();
    createWidgets();
    createLayout();
    createConnections();

    //setWindowTitle(QApplication::applicationName());
}
Exemple #22
0
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
//PRE: parent points to an initialized QWidget
//POST: The application's GUI elements are created (menus, dock, toolbar), and we are set up to
//		start playing songs
{
    setWindowIcon(QIcon(":/Icon/GLUI.png"));		//Set Icon to image as located by .qrc file

    glWindow = new GLWidget(0);						//Initialize member pointer variables
    myPlayer = new Player(0);
    playlistWidget = new QListWidget();
    myWave = NULL;

    playlistWidget->clear();                        //Clear playlist initially

    curTrack = -1;									//-1 indicates no track playing
    numTracks = 0;									//we have no track list

    setCentralWidget(glWindow);						//every QMainWindow needs a central widget
    //(the one that is the primary focus)

    connect(this, SIGNAL(newSong(Wave*)), 			//When we start playing a new song,
            myPlayer, SLOT(playNewSong(Wave*)));	//let the SDL music player
    connect(this, SIGNAL(newSong(Wave*)),
            glWindow, SLOT(playNewSong(Wave*)));	//and GLWidget play the new song

    connect(glWindow, SIGNAL(songEnded()), 			//When the current song has ended,
            this, SLOT(gotoNextSong()));			// go to the next song

    connect(playlistWidget, SIGNAL(currentRowChanged(int)), //Handle the playlist being clicked
            this, SLOT(listClicked(int)));

    createDock();									//Create the GUI components
    createActions();
    createMenus();
    createToolBar();
    //playlistDock->toggleViewAction()->trigger(); (This doesn't work for hiding playlist upon start)
}
/*!
    Constructs the GeneratorApp with the given \a parent and \a uiContext. The
    uiContext is used when showing dialog windows.
*/
GeneratorApp::GeneratorApp(QWidget* uiContext, QObject *parent) :
    QObject(parent)
{
    mUiContext = uiContext;
    mState = GenerateStateStopped;

    // Deallocation: uiContext is set as parent
    mArea = new UiGeneratorArea(uiContext);
    connect(mArea, SIGNAL(generatorClosed(UiGeneratorArea::GeneratorType)),
            this, SLOT(handleGeneratorClosed(UiGeneratorArea::GeneratorType)));

    createToolBar();

    QList<Device*> devices = DeviceManager::instance().devices();
    for (int i = 0; i < devices.size(); i++) {
        Device* device = devices.at(i);

        if (device->generatorDevice() != NULL) {
            connect(device->generatorDevice(),
                    SIGNAL(generateFinished(bool,QString)),
                    this, SLOT(handleGenerateFinished(bool,QString)));
        }

    }
Exemple #24
0
MWToolBarManagerImpl::MWToolBarManagerImpl(QMainWindow* _mw) : QObject(_mw), mw(_mw) {
	QToolBar* tb = createToolBar(MWTOOLBAR_MAIN);
    tb->setToolButtonStyle(Qt::ToolButtonIconOnly);
	createToolBar(MWTOOLBAR_ACTIVEMDI);
}
FileBrowserDialog::FileBrowserDialog(const ServerRepo& repo, QWidget *parent)
    : QDialog(parent),
      repo_(repo)
{
    current_path_ = "/";
    // since root is special, the next step is unnecessary
    // current_lpath_.push_back("");

    const Account& account = seafApplet->accountManager()->currentAccount();
    data_mgr_ = new DataManager(account);

    setWindowTitle(tr("Cloud File Browser"));
    setWindowIcon(QIcon(":/images/seafile.png"));
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint & ~Qt::Dialog
                   | Qt::WindowMinimizeButtonHint | Qt::Window);

    createToolBar();
    createStatusBar();
    createLoadingFailedView();
    createFileTable();

    QVBoxLayout *vlayout = new QVBoxLayout;
    vlayout->setContentsMargins(0, 6, 0, 0);
    vlayout->setSpacing(0);
    setLayout(vlayout);

    stack_ = new QStackedWidget;
    stack_->insertWidget(INDEX_LOADING_VIEW, loading_view_);
    stack_->insertWidget(INDEX_TABLE_VIEW, table_view_);
    stack_->insertWidget(INDEX_LOADING_FAILED_VIEW, loading_failed_view_);

    vlayout->addWidget(toolbar_);
    vlayout->addWidget(stack_);
    vlayout->addWidget(status_bar_);

    // this <--> table_view_
    connect(table_view_, SIGNAL(direntClicked(const SeafDirent&)),
            this, SLOT(onDirentClicked(const SeafDirent&)));
    connect(table_view_, SIGNAL(direntRename(const SeafDirent&)),
            this, SLOT(onGetDirentRename(const SeafDirent&)));
    connect(table_view_, SIGNAL(direntRemove(const SeafDirent&)),
            this, SLOT(onGetDirentRemove(const SeafDirent&)));
    connect(table_view_, SIGNAL(direntShare(const SeafDirent&)),
            this, SLOT(onGetDirentShare(const SeafDirent&)));
    connect(table_view_, SIGNAL(direntUpdate(const SeafDirent&)),
            this, SLOT(onGetDirentUpdate(const SeafDirent&)));
    connect(table_view_, SIGNAL(cancelDownload(const SeafDirent&)),
            this, SLOT(onCancelDownload(const SeafDirent&)));

    //dirents <--> data_mgr_
    connect(data_mgr_, SIGNAL(getDirentsSuccess(const QList<SeafDirent>&)),
            this, SLOT(onGetDirentsSuccess(const QList<SeafDirent>&)));
    connect(data_mgr_, SIGNAL(getDirentsFailed(const ApiError&)),
            this, SLOT(onGetDirentsFailed(const ApiError&)));

    //create <--> data_mgr_
    connect(data_mgr_, SIGNAL(createDirectorySuccess(const QString&)),
            this, SLOT(onDirectoryCreateSuccess(const QString&)));
    connect(data_mgr_, SIGNAL(createDirectoryFailed(const ApiError&)),
            this, SLOT(onDirectoryCreateFailed(const ApiError&)));

    //rename <--> data_mgr_
    connect(data_mgr_, SIGNAL(renameDirentSuccess(const QString&, const QString&)),
            this, SLOT(onDirentRenameSuccess(const QString&, const QString&)));
    connect(data_mgr_, SIGNAL(renameDirentFailed(const ApiError&)),
            this, SLOT(onDirentRenameFailed(const ApiError&)));

    //remove <--> data_mgr_
    connect(data_mgr_, SIGNAL(removeDirentSuccess(const QString&)),
            this, SLOT(onDirentRemoveSuccess(const QString&)));
    connect(data_mgr_, SIGNAL(removeDirentFailed(const ApiError&)),
            this, SLOT(onDirentRemoveFailed(const ApiError&)));

    //share <--> data_mgr_
    connect(data_mgr_, SIGNAL(shareDirentSuccess(const QString&)),
            this, SLOT(onDirentShareSuccess(const QString&)));
    connect(data_mgr_, SIGNAL(shareDirentFailed(const ApiError&)),
            this, SLOT(onDirentShareFailed(const ApiError&)));

    connect(AutoUpdateManager::instance(), SIGNAL(fileUpdated(const QString&, const QString&)),
            this, SLOT(onFileAutoUpdated(const QString&, const QString&)));

    QTimer::singleShot(0, this, SLOT(fetchDirents()));
}
Exemple #26
0
PlotCanvas::PlotCanvas( QTshotWidget * my_parent, int the_mode, 
                        const char * pname,
                        const char * sname,
                        DBlock * block, bool reversed )
  : QMainWindow( my_parent )
  , parent( my_parent )
  , lexicon( Language::Get() )
  , icon( IconSet::Get() )
  , plot_name( pname ) 
  , mode( the_mode )
  , units( my_parent->getUnits() )
{
  DBG_CHECK("PlotCanvas::cstr() mode %d name %s %s\n", mode, pname, sname );

  setCaption();

  if ( mode == MODE_3D ) {
    parent->set3DCanvas( this );
    status = new PlotStatus( PLOT_FRAME_3D, pname, sname );
  } else { // MODE_PLAN MODE_EXT MODE_CROSS MODE_HCROSS
    status = new PlotStatus( PLOT_FRAME_GRID, pname, sname );
  }

  #ifdef HAS_LRUD
    plot = new Plot( parent->DoLRUD() );
  #else
    plot = new Plot( );
  #endif

  if ( block == NULL ) {
    // parent->GetList()->evalSplayExtended();
    if ( ! plot->computePlot( parent->getList(), mode ) ) {
      // delete this;
      return;
    }
  } else {
#if 1 // def USER_HORIZONTAL_SECTION
    // force vertical / horizontal to the user choice
    double vertical = ( mode == MODE_CROSS )? 100.0 : -1.0 ;
#else
    Config & config = Config::Get();
    double vertical = atof( config("V_THRESHOLD") );
#endif
    if ( ! plot->computeXSection( parent->getList(), block, reversed, vertical ) ) {
      delete this;
      return;
    }
  }
  createActions();
  createToolBar();

  scene = new PlotCanvasScene( 0, 0, CANVAS_WIDTH, CANVAS_HEIGHT, this );
  view  = new PlotCanvasView( scene, this );
  // frame  = new PlotFrame( scene );
  status->setScene( scene );

  // view->setFixedSize( CANVAS_WIDTH, CANVAS_HEIGHT );
  // view->resize( CANVAS_WIDTH, CANVAS_HEIGHT );
  // view->show();
  this->setCentralWidget( view );
  //  this->show();
  scene->setOffset( );
  double ls = units.length_factor;
  status->computeGrid( status->getScale() / ls,
                 (int)(status->getWidth() * ls),
                 (int)(status->getHeight() * ls),
                 units.length_unit );
  scene->showPlot( );
  showGridSpacing();
}
FileBrowserDialog::FileBrowserDialog(const Account &account, const ServerRepo& repo, const QString &path, QWidget *parent)
    : QDialog(parent),
      account_(account),
      repo_(repo),
      current_path_(path)
{
    current_lpath_ = current_path_.split('/');

    data_mgr_ = new DataManager(account_);

    setWindowTitle(tr("Cloud File Browser"));
    setWindowIcon(QIcon(":/images/seafile.png"));
    setWindowFlags((windowFlags() & ~Qt::WindowContextHelpButtonHint & ~Qt::Dialog)
#if !defined(Q_OS_MAC)
                   | Qt::FramelessWindowHint
#endif
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
                   | Qt::WindowMinimizeButtonHint
#endif
                   | Qt::Window);

    resizer_ = new QSizeGrip(this);
    resizer_->resize(resizer_->sizeHint());
    setAttribute(Qt::WA_TranslucentBackground, true);

    createTitleBar();
    createToolBar();
    createStatusBar();
    createLoadingFailedView();
    createFileTable();

    QWidget* widget = new QWidget;
    widget->setObjectName("mainWidget");
    QVBoxLayout* layout = new QVBoxLayout;
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(0);
    setLayout(layout);
    layout->addWidget(widget);

    QVBoxLayout *vlayout = new QVBoxLayout;
    vlayout->setContentsMargins(1, 0, 1, 0);
    vlayout->setSpacing(0);
    widget->setLayout(vlayout);

    stack_ = new QStackedWidget;
    stack_->insertWidget(INDEX_LOADING_VIEW, loading_view_);
    stack_->insertWidget(INDEX_TABLE_VIEW, table_view_);
    stack_->insertWidget(INDEX_LOADING_FAILED_VIEW, loading_failed_view_);
    stack_->setContentsMargins(0, 0, 0, 0);

    vlayout->addWidget(header_);
    vlayout->addWidget(toolbar_);
    vlayout->addWidget(stack_);
    vlayout->addWidget(status_bar_);

#ifdef Q_OS_MAC
    header_->setVisible(false);
#endif

    // this <--> table_view_
    connect(table_view_, SIGNAL(direntClicked(const SeafDirent&)),
            this, SLOT(onDirentClicked(const SeafDirent&)));
    connect(table_view_, SIGNAL(direntSaveAs(const SeafDirent&)),
            this, SLOT(onDirentSaveAs(const SeafDirent&)));
    connect(table_view_, SIGNAL(direntRename(const SeafDirent&)),
            this, SLOT(onGetDirentRename(const SeafDirent&)));
    connect(table_view_, SIGNAL(direntRemove(const SeafDirent&)),
            this, SLOT(onGetDirentRemove(const SeafDirent&)));
    connect(table_view_, SIGNAL(direntRemove(const QList<const SeafDirent*> &)),
            this, SLOT(onGetDirentRemove(const QList<const SeafDirent*> &)));
    connect(table_view_, SIGNAL(direntShare(const SeafDirent&)),
            this, SLOT(onGetDirentShare(const SeafDirent&)));
    connect(table_view_, SIGNAL(direntUpdate(const SeafDirent&)),
            this, SLOT(onGetDirentUpdate(const SeafDirent&)));
    connect(table_view_, SIGNAL(direntPaste()),
            this, SLOT(onGetDirentsPaste()));
    connect(table_view_, SIGNAL(cancelDownload(const SeafDirent&)),
            this, SLOT(onCancelDownload(const SeafDirent&)));
    connect(table_view_, SIGNAL(syncSubdirectory(const QString&)),
            this, SLOT(onGetSyncSubdirectory(const QString &)));

    //dirents <--> data_mgr_
    connect(data_mgr_, SIGNAL(getDirentsSuccess(const QList<SeafDirent>&)),
            this, SLOT(onGetDirentsSuccess(const QList<SeafDirent>&)));
    connect(data_mgr_, SIGNAL(getDirentsFailed(const ApiError&)),
            this, SLOT(onGetDirentsFailed(const ApiError&)));

    //create <--> data_mgr_
    connect(data_mgr_, SIGNAL(createDirectorySuccess(const QString&)),
            this, SLOT(onDirectoryCreateSuccess(const QString&)));
    connect(data_mgr_, SIGNAL(createDirectoryFailed(const ApiError&)),
            this, SLOT(onDirectoryCreateFailed(const ApiError&)));

    //rename <--> data_mgr_
    connect(data_mgr_, SIGNAL(renameDirentSuccess(const QString&, const QString&)),
            this, SLOT(onDirentRenameSuccess(const QString&, const QString&)));
    connect(data_mgr_, SIGNAL(renameDirentFailed(const ApiError&)),
            this, SLOT(onDirentRenameFailed(const ApiError&)));

    //remove <--> data_mgr_
    connect(data_mgr_, SIGNAL(removeDirentSuccess(const QString&)),
            this, SLOT(onDirentRemoveSuccess(const QString&)));
    connect(data_mgr_, SIGNAL(removeDirentFailed(const ApiError&)),
            this, SLOT(onDirentRemoveFailed(const ApiError&)));

    //share <--> data_mgr_
    connect(data_mgr_, SIGNAL(shareDirentSuccess(const QString&)),
            this, SLOT(onDirentShareSuccess(const QString&)));
    connect(data_mgr_, SIGNAL(shareDirentFailed(const ApiError&)),
            this, SLOT(onDirentShareFailed(const ApiError&)));

    //copy <--> data_mgr_
    connect(data_mgr_, SIGNAL(copyDirentsSuccess()),
            this, SLOT(onDirentsCopySuccess()));
    connect(data_mgr_, SIGNAL(copyDirentsFailed(const ApiError&)),
            this, SLOT(onDirentsCopyFailed(const ApiError&)));

    //move <--> data_mgr_
    connect(data_mgr_, SIGNAL(moveDirentsSuccess()),
            this, SLOT(onDirentsMoveSuccess()));
    connect(data_mgr_, SIGNAL(moveDirentsFailed(const ApiError&)),
            this, SLOT(onDirentsMoveFailed(const ApiError&)));

    //subrepo <-->data_mgr_
    connect(data_mgr_, SIGNAL(createSubrepoSuccess(const ServerRepo &)),
            this, SLOT(onCreateSubrepoSuccess(const ServerRepo &)));
    connect(data_mgr_, SIGNAL(createSubrepoFailed(const ApiError&)),
            this, SLOT(onCreateSubrepoFailed(const ApiError&)));

    connect(AutoUpdateManager::instance(), SIGNAL(fileUpdated(const QString&, const QString&)),
            this, SLOT(onFileAutoUpdated(const QString&, const QString&)));

    QTimer::singleShot(0, this, SLOT(fetchDirents()));
}
Exemple #28
0
MainWindow::MainWindow()
{
    settings = new Settings;
    settings->loadSettings();

    //actions manager
    actionsManager = new ActionsManager(this);

    //configure the scrollarea
    scrollArea = new QScrollArea;
    scrollArea->setBackgroundRole(QPalette::Mid);
    /*scrollArea->setBackgroundRole(QPalette(QColor(settings->getBackgroundColor().at(0).toInt(),
                                                  settings->getBackgroundColor().at(1).toInt(),
                                                  settings->getBackgroundColor().at(2).toInt())));*/
    scrollArea->setAlignment(Qt::AlignCenter);
    scrollArea->setFrameShape(QFrame::NoFrame);
    setCentralWidget(scrollArea);

    //create the image widget and make the conections
    imageWidget = new ImageWidget;
    scrollArea->setWidget(imageWidget);
    connect(imageWidget, SIGNAL(couldOpen(bool)), this, SLOT(couldOpen(bool)));
    connect(imageWidget, SIGNAL(pixmapChanged()), this, SLOT(pixmapChangedSlot()));
    connect(imageWidget, SIGNAL(moveWidget(QPoint, QPoint)), this, SLOT(moveWidget(QPoint, QPoint)));

    //the zoom widget
    zoomWidget = new ZoomWidget;
    connect(imageWidget, SIGNAL(wheelZoom(int)), this, SLOT(wheelZoom(int)));
    connect(imageWidget, SIGNAL(picSizeChanged()), this, SLOT(imageTranformated()));
    connect(zoomWidget, SIGNAL(zoom(double)), imageWidget, SLOT(makeZoom(double)));
    connect(zoomWidget, SIGNAL(zoom(double)), this, SLOT(updateWindowTitle()));

    setNameFilters();
    createActions();
    createMenus();
    createToolBar();

    imageSetted = false;
    pixmapChanged = false;

    //file utils
    fileUtils = new FileUtils;
    fileUtils->setNameFilters(nameFilters);
    connect(fileUtils, SIGNAL(filePathChanged(QString)), this, SLOT(setLastPathUsed(QString)));

    //add actions to imageWidget, zoomin, zoomout, separator, etc
    imageWidget->addAction(zoomInAct);
    imageWidget->addAction(zoomOutAct);
    //a separator
    QAction *action1 = new QAction(this);
    action1->setSeparator(true);
    imageWidget->addAction(action1);
    imageWidget->addAction(normalSizeAct);
    imageWidget->addAction(adjustSizeAct);
    //another separator
    QAction *action2 = new QAction(this);
    action2->setSeparator(true);
    imageWidget->addAction(action2);
    imageWidget->addAction(filePropertiesAct);
    imageWidget->setContextMenuPolicy(Qt::ActionsContextMenu);

    this->loadSettings();
    this->setWindowTitle(tr("EyeSight"));
    this->setWindowIcon(QIcon::fromTheme("eyesight"));
    this->showMenuBar();
    this->addAction(this->showMenuBarAct);
    this->addAction(this->configureToolBarAct);
    this->setContextMenuPolicy(Qt::ActionsContextMenu);
}
Exemple #29
0
void lmcChatRoomWindow::init(User* pLocalUser, bool connected, QString thread)
{
	localId = pLocalUser->id;
	localName = pLocalUser->name;

	this->pLocalUser = pLocalUser;

	pMessageLog->localId = localId;

	//	get the avatar image for the users from the cache folder
	QDir cacheDir(StdLocation::cacheDir());
	QString fileName = "avt_" + localId + ".png";
	QString filePath = cacheDir.absoluteFilePath(fileName);
	pMessageLog->participantAvatars.insert(localId, filePath);

	threadId = thread;
	groupMode = !threadId.isNull();

	createUserMenu();
	createSmileyMenu();
	createToolBar();

	bConnected = connected;
    if ( !bConnected )
        showStatus( IT_Disconnected, true );

	pSoundPlayer = new lmcSoundPlayer();

	ui.tvUserList->setIconSize(QSize(16, 16));
    ui.tvUserList->header()->setSectionsMovable(false);
	ui.tvUserList->header()->setStretchLastSection(false);
    ui.tvUserList->header()->setSectionResizeMode(0, QHeaderView::Stretch);

	lmcUserTreeWidgetGroupItem *pItem = new lmcUserTreeWidgetGroupItem();
	pItem->setData(0, IdRole, GroupId);
	pItem->setData(0, TypeRole, "Group");
	pItem->setText(0, "Participants");
	pItem->setSizeHint(0, QSize(0, 22));
	ui.tvUserList->addTopLevelItem(pItem);
	ui.tvUserList->expandAll();

	pSettings = new lmcSettings();
	showSmiley = pSettings->value(IDS_EMOTICON, IDS_EMOTICON_VAL).toBool();
	pMessageLog->showSmiley = showSmiley;
	pMessageLog->autoFile = pSettings->value(IDS_AUTOFILE, IDS_AUTOFILE_VAL).toBool();
	pMessageLog->fontSizeVal = pSettings->value(IDS_FONTSIZE, IDS_FONTSIZE_VAL).toInt();
	pMessageLog->messageTime = pSettings->value(IDS_MESSAGETIME, IDS_MESSAGETIME_VAL).toBool();
	pMessageLog->messageDate = pSettings->value(IDS_MESSAGEDATE, IDS_MESSAGEDATE_VAL).toBool();
	pMessageLog->allowLinks = pSettings->value(IDS_ALLOWLINKS, IDS_ALLOWLINKS_VAL).toBool();
	pMessageLog->pathToLink = pSettings->value(IDS_PATHTOLINK, IDS_PATHTOLINK_VAL).toBool();
	pMessageLog->trimMessage = pSettings->value(IDS_TRIMMESSAGE, IDS_TRIMMESSAGE_VAL).toBool();
	QFont font = QApplication::font();
	font.fromString(pSettings->value(IDS_FONT, IDS_FONT_VAL).toString());
	messageColor = QApplication::palette().text().color();
	messageColor.setNamedColor(pSettings->value(IDS_COLOR, IDS_COLOR_VAL).toString());
	sendKeyMod = pSettings->value(IDS_SENDKEYMOD, IDS_SENDKEYMOD_VAL).toBool();

    if ( !groupMode )
    {
		restoreGeometry(pSettings->value(IDS_WINDOWPUBLICCHAT).toByteArray());
		ui.vSplitter->restoreState(pSettings->value(IDS_SPLITTERPUBLICCHATV).toByteArray());
		ui.hSplitter->restoreState(pSettings->value(IDS_SPLITTERPUBLICCHATH).toByteArray());
	}

	setUIText();

    setMessageFont( font );
    ui.txtMessage->setStyleSheet( "QTextEdit {color: " + messageColor.name() + ";}" );
	ui.txtMessage->setFocus();

	QString themePath = pSettings->value(IDS_THEME, IDS_THEME_VAL).toString();
	pMessageLog->initMessageLog(themePath);

	int viewType = pSettings->value(IDS_USERLISTVIEW, IDS_USERLISTVIEW_VAL).toInt();
	ui.tvUserList->setView((UserListView)viewType);

	//	Destroy the window when it closes if in group mode
	setAttribute(Qt::WA_DeleteOnClose, groupMode);

	//	Add the local user as a participant
	addUser(pLocalUser);
}