Start adding actions to the mainwindow
This commit is contained in:
		
					parent
					
						
							
								1d09d12345
							
						
					
				
			
			
				commit
				
					
						aa5588d286
					
				
			
		
					 2 changed files with 27 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -54,6 +54,7 @@ namespace Danbooru {
 | 
			
		|||
        // toolbar position, icon size, etc.
 | 
			
		||||
        setupGUI();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    DanbooruMainWindow::~DanbooruMainWindow()
 | 
			
		||||
| 
						 | 
				
			
			@ -62,8 +63,31 @@ namespace Danbooru {
 | 
			
		|||
 | 
			
		||||
    void DanbooruMainWindow::setupActions()
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    KAction* connectAction = new KAction(
 | 
			
		||||
        KIcon(QLatin1String("document-open-remote")),
 | 
			
		||||
        i18n("Connect..."),
 | 
			
		||||
        this);
 | 
			
		||||
 | 
			
		||||
    KAction* fetch = new KAction(KIcon(QLatin1String("download")),
 | 
			
		||||
                                 i18n("Download"), this);
 | 
			
		||||
 | 
			
		||||
    connectAction->setShortcut(KStandardShortcut::open());
 | 
			
		||||
    fetch->setShortcut(KStandardShortcut::find());
 | 
			
		||||
    fetch->setEnabled(false);
 | 
			
		||||
 | 
			
		||||
    actionCollection()->addAction(QLatin1String("connect"), connectAction);
 | 
			
		||||
    actionCollection()->addAction(QLatin1String("fetch"), fetch);
 | 
			
		||||
    // actionCollection()->removeAction(actionCollection()->action("help_contents"));
 | 
			
		||||
 | 
			
		||||
    //     KStandardAction::openNew(this, SLOT(fileNew()), actionCollection());
 | 
			
		||||
    //     KStandardAction::quit(qApp, SLOT(closeAllWindows()), actionCollection());
 | 
			
		||||
 | 
			
		||||
    KStandardAction::quit(qApp, SLOT(close()), actionCollection());
 | 
			
		||||
    connect(connectAction, SIGNAL(triggered(bool)), this, SLOT(connectToBoard()));
 | 
			
		||||
    connect(fetch, SIGNAL(triggered(bool)), this, SLOT(downloadPosts()));
 | 
			
		||||
 | 
			
		||||
    //
 | 
			
		||||
    //     KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection());
 | 
			
		||||
    //
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -58,6 +58,7 @@ namespace Danbooru {
 | 
			
		|||
 | 
			
		||||
    private:
 | 
			
		||||
        void setupActions();
 | 
			
		||||
        void setupConnections();
 | 
			
		||||
 | 
			
		||||
    private:
 | 
			
		||||
        DanbooruClientView *m_view;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue