Beispiel #1
0
KateViewManager::KateViewManager (QWidget *parentW, KateMainWindow *parent)
    : QSplitter  (parentW)
    , m_mainWindow(parent)
    , m_blockViewCreationAndActivation (false)
    , m_activeViewRunning (false)
{
  // while init
  m_init = true;

  // important, set them up, as we use them in other methodes
  setupActions ();

  guiMergedView = 0;

  // resize mode
  setOpaqueResize( KGlobalSettings::opaqueResize() );

  KateViewSpace* vs = new KateViewSpace( this, 0 );
  addWidget (vs);

  vs->setActive( true );
  m_viewSpaceList.append(vs);

  connect( this, SIGNAL(viewChanged()), this, SLOT(slotViewChanged()) );
  connect(KateDocManager::self(), SIGNAL(initialDocumentReplaced()), this, SIGNAL(viewChanged()));

  connect(KateDocManager::self(), SIGNAL(documentCreated(KTextEditor::Document *)), this, SLOT(documentCreated(KTextEditor::Document *)));
  connect(KateDocManager::self(), SIGNAL(documentDeleted(KTextEditor::Document *)), this, SLOT(documentDeleted(KTextEditor::Document *)));

  // init done
  m_init = false;
}
Beispiel #2
0
TimerWindow::TimerWindow(QWidget *parent) : QMainWindow(parent) {
    qDebug("TimerWindow::TimerWindow");

    setAllowClose( false );

    setupUi(this);

    libkiIcon = QIcon(":images/libki_clock.png");

    this->setWindowIcon(libkiIcon);

    setFixedSize(width(), height()); // Prevent the window from being resized
    setWindowFlags( (windowFlags() | Qt::CustomizeWindowHint) & ~Qt::WindowMaximizeButtonHint); // Remove the maximize window button
    setWindowFlags( (windowFlags() | Qt::CustomizeWindowHint) & ~Qt::WindowSystemMenuHint); // Remove the close window button

    setupActions();
    setupTrayIcon();

    trayIconPopupTimer = new QTimer(this);
    connect(trayIconPopupTimer, SIGNAL(timeout()), this, SLOT(showSystemTrayIconTimeLeftMessage()) );


    // Disable unused features
    pauseButton->hide();

    this->move(QApplication::desktop()->screen()->rect().center()-this->rect().center());

    this->hide();
}
Beispiel #3
0
akuTreeWidget::akuTreeWidget(QWidget *parent) : QTreeWidget(parent)
{
  setDragEnabled(false);
  setDragDropOverwriteMode(false);
  setDragDropMode(QAbstractItemView::NoDragDrop);
  setAlternatingRowColors(true);
  setSelectionMode(QAbstractItemView::ExtendedSelection);
  setAutoExpandDelay(-1);
  setRootIsDecorated(true);
  setUniformRowHeights(false);
  setSortingEnabled(true);
  setAnimated(true);
  setAllColumnsShowFocus(true);
  headerItem()->setText(0, i18n("File Name", 0));
  headerItem()->setText(1, i18n("Size", 0));
  headerItem()->setText(2, i18n("Packed Size", 0));
  headerItem()->setText(3, i18n("Ratio", 0));
  headerItem()->setText(4, i18n("Modified", 0));
  headerItem()->setText(5, i18n("Attributes", 0));
  headerItem()->setText(6, i18n("CRC", 0));
  headerItem()->setText(7, i18n("Method", 0));
  headerItem()->setText(8, i18n("Version", 0));
  headerItem()->setText(9, i18n("MIME Type", 0));
  headerItem()->setText(10,"");
  headerItem()->setIcon(10,KIcon("document-properties"));
  headerItem()->setToolTip(10, i18n("Status: a key is shown if the file is crypted"));
  header() -> moveSection(10,0);
  header() -> setResizeMode(10,QHeaderView::ResizeToContents);
  header() -> setResizeMode(4,QHeaderView::ResizeToContents);
  setupActions();
}
 SyndicationPlugin::SyndicationPlugin(QObject* parent, const QStringList& args): Plugin(parent), add_feed(0)
 {
     Q_UNUSED(args);
     setupActions();
     //  setXMLFile("ktsyndicationpluginui.rc");
     LogSystemManager::instance().registerSystem(i18n("Syndication"), SYS_SYN);
 }
Beispiel #5
0
Player::Player(  QWidget * parent, Qt::WindowFlags f)
    : QWidget(parent, f)
{
    m_current =NULL;
    last=NULL;

#ifdef REPEAT
    m_repeatCheck = false;
#endif
    m_mediaPlayer = new QMediaPlayer();
    connect(m_mediaPlayer,SIGNAL(stateChanged(QMediaPlayer::State)),this,SLOT(playerStatusChanged(QMediaPlayer::State)));
    connect(m_mediaPlayer,SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),this,SLOT(statusChanged(QMediaPlayer::MediaStatus)));

    connect(m_mediaPlayer,SIGNAL(currentMediaChanged(QMediaContent)),this,SLOT(sourceChanged(QMediaContent)));
    mypreference = Preference_data::getInstance();
    myPlaylist = Playlist::getInstance();
    m_listposition = -1;
    position = 0;
    selectedReadMode = mypreference->getSelectedReadMode();

    setupActions();

    //readSettings();
    setupUi();
    m_seekSlider->setMaximum(0);

}
Beispiel #6
0
    TorrentActivity::TorrentActivity(Core* core, GUI* gui, QWidget* parent)
        : TorrentActivityInterface(i18n("Torrents"), QStringLiteral("ktorrent"), parent),
          core(core),
          gui(gui)
    {
        setXMLGUIFile(QStringLiteral("kttorrentactivityui.rc"));
        QWidget* view_part = new QWidget(this);
        view = new View(core, gui, view_part);
        connect(view, &View::currentTorrentChanged, this, &TorrentActivity::currentTorrentChanged);
        search_bar = new TorrentSearchBar(view, view_part);
        search_bar->setHidden(true);

        QVBoxLayout* layout = new QVBoxLayout(this);
        layout->setSpacing(0);
        layout->setMargin(0);
        vsplit = new QSplitter(Qt::Vertical, this);
        layout->addWidget(vsplit);
        hsplit = new QSplitter(Qt::Horizontal, vsplit);

        group_switcher = new GroupSwitcher(view, core->getGroupManager(), this);
        connect(core->getQueueManager(), SIGNAL(queueOrdered()), this, SLOT(queueOrdered()));

        QVBoxLayout* vlayout = new QVBoxLayout(view_part);
        vlayout->setSpacing(0);
        vlayout->setMargin(0);
        vlayout->addWidget(group_switcher);
        vlayout->addWidget(search_bar);
        vlayout->addWidget(view);

        group_view = new GroupView(core->getGroupManager(), view, core, gui, hsplit);
        group_view->setupActions(part()->actionCollection());
        connect(group_view, &GroupView::currentGroupChanged, group_switcher, &GroupSwitcher::currentGroupChanged);
        connect(group_view, &GroupView::openTab, group_switcher, &GroupSwitcher::addTab);

        setupActions();

        hsplit->addWidget(group_view);
        hsplit->addWidget(view_part);
        hsplit->setStretchFactor(0, 1);
        hsplit->setStretchFactor(1, 3);
        vsplit->addWidget(hsplit);
        tool_views = new TabBarWidget(vsplit, this);
        vsplit->setStretchFactor(0, 3);
        vsplit->setStretchFactor(1, 1);
        layout->addWidget(tool_views);

        qm = new QueueManagerWidget(core->getQueueManager(), this);
        connect(core, &Core::torrentAdded, qm, &QueueManagerWidget::onTorrentAdded);
        connect(core, &Core::torrentRemoved, qm, &QueueManagerWidget::onTorrentRemoved);
        tool_views->addTab(qm, i18n("Queue Manager"), QStringLiteral("kt-queue-manager"), i18n("Widget to manage the torrent queue"));

        magnet_view = new MagnetView(core->getMagnetManager(), this);
        tool_views->addTab(magnet_view, i18n("Magnet Downloader"), QStringLiteral("kt-magnet"),
                           i18n("Displays the currently downloading magnet links"));

        QueueManager* qman = core->getQueueManager();
        connect(qman, &QueueManager::suspendStateChanged, this, &TorrentActivity::onSuspendedStateChanged);

        queue_suspend_action->setChecked(core->getSuspendedState());
    }
Beispiel #7
0
DiscoverMainWindow::DiscoverMainWindow(CompactMode mode)
    : QObject()
    , m_collection(this)
    , m_engine(new QQmlApplicationEngine)
    , m_mode(mode)
{
    ResourcesModel *m = ResourcesModel::global();
    m->integrateActions(actionCollection());

    setObjectName(QStringLiteral("DiscoverMain"));
    KDeclarative::KDeclarative kdeclarative;
    kdeclarative.setDeclarativeEngine(m_engine);
    kdeclarative.setupBindings();
    
    qmlRegisterType<UnityLauncher>("org.kde.discover.app", 1, 0, "UnityLauncher");
    qmlRegisterType<PaginateModel>("org.kde.discover.app", 1, 0, "PaginateModel");
    qmlRegisterType<IconColors>("org.kde.discover.app", 1, 0, "IconColors");
    qmlRegisterType<KConcatenateRowsProxyModel>("org.kde.discover.app", 1, 0, "KConcatenateRowsProxyModel");

    qmlRegisterSingletonType<SystemFonts>("org.kde.discover.app", 1, 0, "SystemFonts", ([](QQmlEngine*, QJSEngine*) -> QObject* { return new SystemFonts; }));
    qmlRegisterSingletonType(QUrl(QStringLiteral("qrc:/qml/DiscoverSystemPalette.qml")), "org.kde.discover.app", 1, 0, "DiscoverSystemPalette");
    qmlRegisterSingletonType(QUrl(QStringLiteral("qrc:/qml/Helpers.qml")), "org.kde.discover.app", 1, 0, "Helpers");
    qmlRegisterType<QQuickView>();
    qmlRegisterType<QActionGroup>();
    qmlRegisterType<QAction>();
    qmlRegisterUncreatableType<DiscoverMainWindow>("org.kde.discover.app", 1, 0, "DiscoverMainWindow", QStringLiteral("don't do that"));
    setupActions();
    
    //Here we set up a cache for the screenshots
    m_engine->rootContext()->setContextProperty(QStringLiteral("app"), this);

    connect(m_engine, &QQmlApplicationEngine::objectCreated, this, &DiscoverMainWindow::integrateObject);
    m_engine->load(QUrl(QStringLiteral("qrc:/qml/DiscoverWindow.qml")));
}
Beispiel #8
0
ClintWindow::ClintWindow(QWidget *parent) :
  QMainWindow(parent) {

  QString filename;
  QStringList args = qApp->arguments();
  for (int i = 0; i < args.size(); i++) {
    if (!args[i].startsWith("--") && !args[i].endsWith("clint")) {
      if (filename.length() != 0) {
        QMessageBox::warning(this, "Multiple files to open", "Extra file to open is ignored", QMessageBox::Ok, QMessageBox::Ok);
        continue;
      }
      filename = args[i];
    }
  }

  QFont monospacefont("PT Mono");
  m_scriptEditor = new QTextEdit;
  m_codeEditor = new QTextEdit;
  m_codeEditor->setFont(monospacefont);
  m_scriptEditor->setFont(monospacefont);

  m_reparseCodeButton = new QPushButton("<");
  m_reparseScriptButton = new QPushButton("<");
  connect(m_reparseCodeButton, &QPushButton::clicked, this, &ClintWindow::reparseCode);
  connect(m_reparseScriptButton, &QPushButton::clicked, this, &ClintWindow::reparseScript);

  setWindowTitle("Clint: Chunky Loop INTerface");
  setupActions();
  setupMenus();
  if (filename.length() != 0) {
    openFileByName(filename);
  }
}
Beispiel #9
0
KTutorialEditor::KTutorialEditor(): KXmlGuiWindow(0),
    mTutorial(0) {

    mTreeView = new AutoExpandableTreeView();
    mTreeView->setObjectName("centralTreeView");
    mTreeView->setWordWrap(true);
    setCentralWidget(mTreeView);

    setupDocks();

    setupActions();

    connect(mEditActions, SIGNAL(cleanChanged(bool)),
            this, SIGNAL(cleanChanged(bool)));
    connect(this, SIGNAL(cleanChanged(bool)),
            this, SLOT(handleUndoStackCleanChanged(bool)));

    //The actions can not be added in setupDocks because setupActions() needs
    //the docks to be created (to get their toggleAction), so it can be called
    //before setupDocks().
    setupActionListWidgets();

    mFileActions->newTutorial();

    ktutorial::KTutorial::self()->setup(this);

    setupGUI();
}
Beispiel #10
0
UProcessView::UProcessView(QWidget *parent /*= 0*/)
:QTableView(parent)
,killProcessAction_(0)
,selectColumnAction_(0)
{
    //设置Model。
    QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
    UProcessModel *processModel = new UProcessModel(this);
    connect(this,SIGNAL(processTerminated(unsigned int)),processModel,SLOT(refresh()));

    proxyModel->setSourceModel(processModel);
    proxyModel->setDynamicSortFilter(true);
    proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
    setModel(proxyModel);
    setSortingEnabled(true);
    
    setSelectionBehavior(QAbstractItemView::SelectRows);
    horizontalHeader()->setStretchLastSection(true);
    verticalHeader()->hide();
    setSelectionMode(QAbstractItemView::SingleSelection);

    setContextMenuPolicy(Qt::ActionsContextMenu);
    setupActions();

    setupConnections();
}
StorageServiceManagerMainWindow::StorageServiceManagerMainWindow()
    : KXmlGuiWindow()
{
    StorageServiceManagerSettingsJob *settingsJob = new StorageServiceManagerSettingsJob;
    PimCommon::StorageServiceJobConfig *configJob = PimCommon::StorageServiceJobConfig::self();
    configJob->registerConfigIf(settingsJob);

    mStorageManager = new PimCommon::StorageServiceManager(this);
    connect(mStorageManager, &PimCommon::StorageServiceManager::servicesChanged, this, &StorageServiceManagerMainWindow::slotServicesChanged);
    mStorageServiceMainWidget = new StorageServiceManagerMainWidget;
    connect(mStorageServiceMainWidget, &StorageServiceManagerMainWidget::configureClicked, this, &StorageServiceManagerMainWindow::slotConfigure);
    connect(mStorageServiceMainWidget->storageServiceTabWidget(), &QTabWidget::currentChanged, this, &StorageServiceManagerMainWindow::slotUpdateActions);
    connect(mStorageServiceMainWidget->storageServiceTabWidget(), &StorageServiceTabWidget::updateStatusBarMessage, this, &StorageServiceManagerMainWindow::slotSetStatusBarMessage);
    connect(mStorageServiceMainWidget->storageServiceTabWidget(), &StorageServiceTabWidget::listFileWasInitialized, this, &StorageServiceManagerMainWindow::slotUpdateActions);
    connect(mStorageServiceMainWidget->storageServiceTabWidget(), &StorageServiceTabWidget::selectionChanged, this, &StorageServiceManagerMainWindow::slotUpdateActions);
    setCentralWidget(mStorageServiceMainWidget);

    mNetworkConfigurationManager = new QNetworkConfigurationManager();
    connect(mNetworkConfigurationManager, &QNetworkConfigurationManager::onlineStateChanged, this, &StorageServiceManagerMainWindow::slotSystemNetworkOnlineStateChanged);

    setupActions();
    setupGUI(Keys | StatusBar | Save | Create);
    readConfig();
    mStorageServiceMainWidget->storageServiceTabWidget()->setListStorageService(mStorageManager->listService());
    slotUpdateActions();
    initStatusBar();
    slotSystemNetworkOnlineStateChanged(mNetworkConfigurationManager->isOnline());
}
Beispiel #12
0
PencilTool::PencilTool() : k(new Private)
{
    k->configurator = 0;
    k->item = 0;

    setupActions();
}
Beispiel #13
0
PencilTool::PencilTool() : TupToolPlugin(), k(new Private)
{
    k->configurator = 0;
    k->item = 0;

    setupActions();
}
Beispiel #14
0
Kaqtoos::Kaqtoos()
	: QMainWindow(),
	  downloadManager(this),
	  isOAuthUserConnected(false)
{
	oauthRequest = new KQOAuthRequest();
	oauthManager = new KQOAuthManager(this);

	setupUi();
	setupActions();
	setupConnections();
	
	publicXmlUrls <<
		QString("http://api.kactoos.com/br/api/products/get-product-list/format/xml/oauth_consumer_key/%1/limit/30/orderby/new-products").arg(consumerKey) <<
		QString("http://api.kactoos.com/br/api/products/get-product-list/format/xml/oauth_consumer_key/%1/limit/30/orderby/popular").arg(consumerKey) <<
		QString("http://api.kactoos.com/br/api/products/get-product-list/format/xml/oauth_consumer_key/%1/limit/30/orderby/economic").arg(consumerKey);

	// start downloading
	downloadManager.append(publicXmlUrls);

	// NOTE: just for test
	QGraphicsScene *scene = new QGraphicsScene();

	ProductItem *item = new ProductItem();
	item->setImage("http://www.kactoos.com/libraries/thumb/?src=/images/products/5791_3556942391.jpg");
	
	scene->addItem(item);
	allProductsView->setScene(scene);

	setWindowTitle(tr("KaQToos"));
	resize(QSize(600, 480));
}
Beispiel #15
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent)

{
    /* Window Title */
    setWindowTitle(tr(APPLICATION_NAME));

    /* Set sticky places for dockwidgets */
    setCorner(Qt::TopLeftCorner, Qt::TopDockWidgetArea);
    setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
    setCorner(Qt::BottomLeftCorner, Qt::BottomDockWidgetArea);
    setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea);

    /*
     * Create Mastercontroller (zone -1)
     * Controls all zones on all bridges.
     */
    master = new SingleController("Master", -1, this);
    masterDockWidget = new QDockWidget(tr("Master Controller"), this);
    masterDockWidget->setWidget(master);
    masterDockWidget->setMaximumWidth(200);
    addDockWidget(Qt::TopDockWidgetArea, masterDockWidget);

    /* Audio Controller */
    audio = new audioController(this);
    addDockWidget(Qt::TopDockWidgetArea, audio);

    /* Connect Audio to Master .*/
    connect(audio, SIGNAL(setRandomSame()), master, SLOT(setRandomExt()));
    connect(audio, SIGNAL(flash()), master, SLOT(flash()));
    connect(audio, SIGNAL(flashRandom()), master, SLOT(flashRandom()));
    connect(audio, SIGNAL(fade10()), master, SLOT(fade10Ext()));
    connect(audio, SIGNAL(fade20()), master, SLOT(fade20Ext()));

    presetController = new PresetController(this);
    presetController->setMinimumWidth(230);
    addDockWidget(Qt::TopDockWidgetArea, presetController);
    connect(presetController, SIGNAL(createPreset()), this, SLOT(getPreset()));
    connect(this, SIGNAL(presetAvailable(Preset*)), presetController, SLOT(addPreset(Preset*)));
    connect(presetController, SIGNAL(setPreset(Preset*)), this, SLOT(setPreset(Preset*)));

    /* Center the window. */
    QWidget *w = window();
    w->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, w->size(), qApp->desktop()->availableGeometry()));

    /* Create Bridge Discovery Dialog. */
    MiLightDiscover *d = new MiLightDiscover(this);
    connect(d, SIGNAL(selectedDevices(QStringList, bool)), this, SLOT(setupControllers(QStringList, bool)));
    d->exec();

    setupActions();
    setupToolBar();
    setupMenuBar();
    setupStatusBar();

    loadSettings();

    delete d;

}
Beispiel #16
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
	_doExit = false;

	ui->setupUi(this);

	connect(qApp, SIGNAL(commitDataRequest(QSessionManager&)),
	        this, SLOT(commitAppData(QSessionManager&)));

	createTrayIcon();

	_tabsWidgetModifyMapper = new QSignalMapper(this);
	connect(_tabsWidgetModifyMapper, SIGNAL(mapped(QWidget*)),
	        this, SLOT(taskListModified(QWidget*)));

	_tabsWidgetFileNameChangeMapper = new QSignalMapper(this);
	connect(_tabsWidgetFileNameChangeMapper, SIGNAL(mapped(QWidget*)),
	        this, SLOT(taskListFileNameChanged(QWidget*)));

	connect(ui->tabWidget, SIGNAL(tabCloseRequested(int)),
	        this, SLOT(closeTab(int)));

	setupActions();

	loadSettings();

	//setCentralWidget( new TaskTreeWidget(_rootTask, this) );
}
SettingsWidget::SettingsWidget(QWidget *parent):
    QWidget( parent )
{
    setupComponents();
    setupActions();
    setupLayout();
}
Beispiel #18
0
////////////////////////////////////////////////////////////////////////////////
/// CTreeNodeEditor::CTreeNodeEditor
///
/// @description    This is the default constructor for the CTreeNodeEditor
///                 class.  It initializes member variables.
/// @pre            None
/// @post           Member variables are initialized.
///
/// @param canvas:  This is a pointer to the canvas.
///
/// @limitations    None
///
////////////////////////////////////////////////////////////////////////////////
CTreeNodeEditor::CTreeNodeEditor( QWidget *canvas )
: QObject(canvas)
{
    m_canvas = canvas;
    m_isAddingChildNode = false;
    m_selNode = NULL;
    m_oldParent = NULL;

    //Setup the line edit used for editing node history values.
    m_historyEdit = new QLineEdit( m_canvas );
    m_historyEdit->setAlignment( Qt::AlignCenter );
    m_historyEdit->hide();
    connect( m_historyEdit, SIGNAL( editingFinished() ), this,
             SLOT( historyDone() ) );

    //Setup the line edit used for editing node names.
    m_nameEdit = new QLineEdit( m_canvas );
    m_nameEdit->setAlignment( Qt::AlignCenter );
    m_nameEdit->hide();
    connect( m_nameEdit, SIGNAL( editingFinished() ), this,
             SLOT( nameDone() ) );

    //Setup the line edit used for editing node values.
    m_valueEdit = new QLineEdit( m_canvas );
    m_valueEdit->setAlignment( Qt::AlignCenter );
    m_valueEdit->hide();
    connect( m_valueEdit, SIGNAL( editingFinished() ), this,
             SLOT( valueDone() ) );

    //Setup actions and menus.
    setupActions();
    setupMenus();
}
Beispiel #19
0
KFDMainWindow::KFDMainWindow()
 : KParts::MainWindow()
{
	setXMLFile("kfd_mainwindow.rc");

	setupActions();
	//statusBar()->show();

	KLibFactory *factory = KLibLoader::self()->factory("libkformdesigner_part");
	if (factory)
	{
		QStringList list;
		list << "shell" << "multipleMode";
		m_part = static_cast<KParts::ReadWritePart *>( factory->create(this, "kformdesigner_part", "KParts::ReadWritePart", list) );

		if(m_part)
		{
			setCentralWidget(m_part->widget());
			createGUI(m_part);
		}
	}
	else
	{
		KMessageBox::error(this, i18n("Could not find the KFormDesigner part. Please check your installation."));
		kapp->quit();
		return;
	}

	setAutoSaveSettings();
}
KTNEFMain::KTNEFMain( QWidget *parent )
  : KXmlGuiWindow( parent )
{
  setupActions();
  setupStatusbar();

  setupTNEF();

  KConfigGroup config( KGlobal::config(), "Settings" );
  mDefaultDir = config.readPathEntry( "defaultdir", "/tmp/" );
  mLastDir = mDefaultDir;

  // create personale temo extract dir
  KStandardDirs::makeDir( KGlobal::dirs()->localkdedir() + "/share/apps/ktnef/tmp" );

  resize( 430, 350 );

  setStandardToolBarMenuEnabled( true );

  createStandardStatusBarAction();

  setupGUI( Keys | Save | Create, "ktnefui.rc" );

  setAutoSaveSettings();
}
Beispiel #21
0
// - Application constructor
ItemWidget::ItemWidget(QWidget *parent, XDGDesktop item) : QFrame(parent){
  createWidget();
  isDirectory = false;
  if(LUtils::isFavorite(item.filePath)){
    linkPath = item.filePath;
    isShortcut=true;
  }else if( item.filePath.section("/",0,-2)==QDir::homePath()+"/Desktop" ){
    isShortcut = true;
  }else{
    isShortcut = false;
  }
  if(isShortcut){
    name->setToolTip(icon->whatsThis()); //also allow the user to see the full shortcut path
  }
  //Now fill it appropriately
  icon->setPixmap( LXDG::findIcon(item.icon,"preferences-system-windows-actions").pixmap(64,64) );
      text = item.name;
      if(!item.genericName.isEmpty() && item.name!=item.genericName){ text.append("<br><i> -- "+item.genericName+"</i>"); }
      name->setText(text);
      name->setToolTip(item.comment);
  this->setWhatsThis(item.name);
  icon->setWhatsThis(item.filePath);
  iconPath = item.icon;
  //Now setup the buttons appropriately
  setupContextMenu();
  setupActions(item);
}
Beispiel #22
0
KISDNnet::KISDNnet()
    : KMainWindow( 0, "KISDNnet" ),
      m_view(new KISDNnetView(this))
{
    // accept dnd
    setAcceptDrops(true);

    // tell the KMainWindow that this is indeed the main widget
    setCentralWidget(m_view);

    // then, setup our actions
    setupActions();

    // and a status bar
    statusBar()->show();

    // apply the saved mainwindow settings, if any, and ask the mainwindow
    // to automatically save settings if changed: window size, toolbar
    // position, icon size, etc.
    setAutoSaveSettings();

    // allow the view to change the statusbar and caption
    connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)),
            this,   SLOT(changeStatusbar(const QString&)));
    connect(m_view, SIGNAL(signalChangeCaption(const QString&)),
            this,   SLOT(changeCaption(const QString&)));
	readProfiles();

}
MainWindow::MainWindow( const QString &icsfile )
  :  KParts::MainWindow( )
{
    kDebug(5970) << "Entering function, icsfile is " << icsfile;
    // Setup our actions
    setupActions();

    // this routine will find and load our Part.
    KLibFactory *factory = KLibLoader::self()->factory("ktimetrackerpart");
    if (factory)
    {
        // now that the Part is loaded, we cast it to a Part to get
        // our hands on it
        m_part = static_cast<ktimetrackerpart *>(factory->create(this, "ktimetrackerpart" ));

        if (m_part)
        {
            // tell the KParts::MainWindow that this is indeed
            // the main widget
            setCentralWidget(m_part->widget());
            m_part->openFile(icsfile);
            slotSetCaption( icsfile );  // set the window title to our iCal file
            connect(configureAction, SIGNAL(triggered(bool)),
                m_part->widget(), SLOT(showSettingsDialog()));
            ((TimetrackerWidget *) (m_part->widget()))->setupActions( actionCollection() );
            setupGUI();
        }
    }
    else
    {
Beispiel #24
0
kerp::kerp()
    : KMainWindow( 0, "kerp" ),
      m_view(new kerpView(this)),
      m_printer(0)
{
    // accept dnd
    setAcceptDrops(true);

    // tell the KMainWindow that this is indeed the main widget
    setCentralWidget(m_view);

    // then, setup our actions
    setupActions();

    // and a status bar
    statusBar()->show();

    // apply the saved mainwindow settings, if any, and ask the mainwindow
    // to automatically save settings if changed: window size, toolbar
    // position, icon size, etc.
    setAutoSaveSettings();

    // allow the view to change the statusbar and caption
    connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)),
            this,   SLOT(changeStatusbar(const QString&)));
    connect(m_view, SIGNAL(signalChangeCaption(const QString&)),
            this,   SLOT(changeCaption(const QString&)));
    createConnection();
	kdDebug()<<"going to create il"<<endl;
	kdDebug()<<"testing global to string 7"<<Global::toString(7)<<endl;
	InvoiceLine *il=new InvoiceLine(1);
	kdDebug()<<"out the if "<<endl;
	kdDebug()<<"il created :"<< il->getProduct();
}
void MusicPlayer::setup(QWidget *widget)
{
    this->widget = widget;
    setupActions();
    setupUi();
    timeLcd->display("00:00");
}
Beispiel #26
0
MainWindow::MainWindow(QWidget* parent, const char* name, WFlags fl)
//     : KMainWindow(parent, name, fl),  m_debuggerSettings(0), m_browserSettings(0)
    : KParts::MainWindow(parent, name, fl),  m_debuggerSettings(0), m_browserSettings(0)
{
  if(!name) { setName("MainWindow"); }

  setupStatusBar();

  m_debugger_manager = new DebuggerManager(this);

  createWidgets();

  setupActions();

  createGUI(0);

  resize( QSize(633, 533).expandedTo(minimumSizeHint()) );
  clearWState(WState_Polished);

  m_debugger_manager->init();

  connect(kapp, SIGNAL(aboutToQuit()), this, SLOT(slotClose()));

  connect(ProtoeditorSettings::self(), SIGNAL(sigSettingsChanged()),
          this, SLOT(slotSettingsChanged()));

  loadSites();

  stateChanged("init");
}
Beispiel #27
0
//![0]
MainWindow::MainWindow ( QWidget * parent ) {

	audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
	mediaObject = new Phonon::MediaObject(this);
	metaInformationResolver = new Phonon::MediaObject(this);

	mediaObject->setTickInterval(1000);
//![0]
//![2]
	connect(mediaObject, SIGNAL(tick(qint64)), this, SLOT(tick(qint64)));
	connect(mediaObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)),
			this, SLOT(stateChanged(Phonon::State, Phonon::State)));
	connect(metaInformationResolver, SIGNAL(stateChanged(Phonon::State,Phonon::State)),
			this, SLOT(metaStateChanged(Phonon::State, Phonon::State)));
	connect(mediaObject, SIGNAL(currentSourceChanged(const Phonon::MediaSource &)),
			this, SLOT(sourceChanged(const Phonon::MediaSource &)));
	connect(mediaObject, SIGNAL(aboutToFinish()), this, SLOT(aboutToFinish()));
//![2]

//![1]
	Phonon::createPath(mediaObject, audioOutput);
//![1]

	setupActions();
	setupMenus();
	setupUi();
	timeLcd->display("00:00");
}
KisInputManager::Private::Private(KisInputManager *qq)
    : q(qq)
    , canvas(0)
    , toolProxy(0)
    , forwardAllEventsToTool(false)
    , disableTouchOnCanvas(false)
    , touchHasBlockedPressEvents(false)
    , lastTouchEvent(0)
    , defaultInputAction(0)
    , eventsReceiver(0)
    , moveEventCompressor(10 /* ms */, KisSignalCompressor::FIRST_ACTIVE)
    , testingAcceptCompressedTabletEvents(false)
    , testingCompressBrushEvents(false)
    , focusOnEnter(true)
    , containsPointer(true)
{
    KisConfig cfg;
    disableTouchOnCanvas = cfg.disableTouchOnCanvas();

    moveEventCompressor.setDelay(cfg.tabletEventsDelay());
    testingAcceptCompressedTabletEvents = cfg.testingAcceptCompressedTabletEvents();
    testingCompressBrushEvents = cfg.testingCompressBrushEvents();
    setupActions();
    canvasSwitcher = new CanvasSwitcher(this, q);
    qApp->installEventFilter(globalEventEater);
}
	SearchActivity::SearchActivity(SearchPlugin* sp,QWidget* parent)
		: Activity(i18nc("plugin name","Search"),"edit-find",10,parent),sp(sp)
	{
		setXMLGUIFile("ktsearchpluginui.rc");
		setupActions();
		toolbar = new SearchToolBar(part()->actionCollection(),sp->getSearchEngineList(),this);
		connect(toolbar,SIGNAL(search( const QString&, int, bool )),
				sp,SLOT(search( const QString&, int, bool )));
		
		QVBoxLayout* layout = new QVBoxLayout(this);
		layout->setSpacing(0);
		layout->setMargin(0);
		tabs = new KTabWidget(this);
		tabs->setMovable(true);
		layout->addWidget(tabs);
		connect(tabs,SIGNAL(currentChanged(int)),this,SLOT(currentTabChanged(int)));
		
		QToolButton* lc = new QToolButton(tabs);
		tabs->setCornerWidget(lc,Qt::TopLeftCorner);
		QToolButton* rc = new QToolButton(tabs);
		tabs->setCornerWidget(rc,Qt::TopRightCorner);
		lc->setIcon(KIcon("tab-new"));
		connect(lc,SIGNAL(clicked()),this,SLOT(openTab()));
		rc->setIcon(KIcon("tab-close"));
		connect(rc,SIGNAL(clicked()),this,SLOT(closeTab()));
	}
Beispiel #30
0
LoginWindow::LoginWindow(QWidget *parent) : QMainWindow(parent) {
    qDebug("LoginWindow::LoginWindow");

    setAllowClose( false );

    setupUi(this);

    libkiIcon = QIcon(":images/libki_clock.png");
    this->setWindowIcon(libkiIcon);

    setWindowFlags( (windowFlags() | Qt::CustomizeWindowHint) & ~Qt::WindowMaximizeButtonHint); // Remove the maximize window button
    setWindowFlags( (windowFlags() | Qt::CustomizeWindowHint) & ~Qt::WindowSystemMenuHint); // Remove the close window button
    setWindowFlags( (windowFlags() | Qt::CustomizeWindowHint) & Qt::WindowStaysOnTopHint);
    setWindowFlags( (windowFlags() | Qt::CustomizeWindowHint) & Qt::X11BypassWindowManagerHint);
    setWindowFlags( (windowFlags() | Qt::CustomizeWindowHint) & Qt::FramelessWindowHint);

    setupActions();

    getSettings();

    reservedLabel->hide();

    handleBanners();

    showMe();
}