2012-02-20 21:47:14 +00:00
|
|
|
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
|
2009-01-28 20:55:45 +00:00
|
|
|
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
|
|
|
|
|
|
|
#ifndef __MAINWINDOW_HH_INCLUDED__
|
|
|
|
#define __MAINWINDOW_HH_INCLUDED__
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QThread>
|
|
|
|
#include <QToolButton>
|
2009-02-05 20:55:00 +00:00
|
|
|
#include <QSystemTrayIcon>
|
2009-03-26 19:00:08 +00:00
|
|
|
#include <QNetworkAccessManager>
|
2009-01-28 20:55:45 +00:00
|
|
|
#include "ui_mainwindow.h"
|
|
|
|
#include "folding.hh"
|
|
|
|
#include "config.hh"
|
|
|
|
#include "dictionary.hh"
|
|
|
|
#include "article_netmgr.hh"
|
|
|
|
#include "instances.hh"
|
|
|
|
#include "article_maker.hh"
|
|
|
|
#include "scanpopup.hh"
|
|
|
|
#include "articleview.hh"
|
2009-01-29 19:16:25 +00:00
|
|
|
#include "wordfinder.hh"
|
2009-09-21 17:50:03 +00:00
|
|
|
#include "dictionarybar.hh"
|
2009-10-21 19:37:07 +00:00
|
|
|
#include "history.hh"
|
2010-06-28 15:14:07 +00:00
|
|
|
#include "hotkeywrapper.hh"
|
2011-06-27 18:54:15 +00:00
|
|
|
#include "mainstatusbar.hh"
|
2011-11-02 23:37:50 +00:00
|
|
|
#include "mruqmenu.hh"
|
2012-12-24 11:30:03 +00:00
|
|
|
#include "translatebox.hh"
|
2009-01-28 20:55:45 +00:00
|
|
|
|
2011-06-09 07:29:21 +00:00
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#include <fixx11h.h>
|
|
|
|
#endif
|
|
|
|
|
2009-01-28 20:55:45 +00:00
|
|
|
using std::string;
|
|
|
|
using std::vector;
|
|
|
|
|
2012-12-24 11:30:03 +00:00
|
|
|
class ExpandableToolBar : public QToolBar
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit ExpandableToolBar(QString const & title, QWidget * parent = 0)
|
|
|
|
: QToolBar(title, parent) {}
|
|
|
|
virtual QSize sizeHint() const
|
|
|
|
{
|
|
|
|
if ( !isFloating() && parentWidget() )
|
|
|
|
{
|
|
|
|
return QSize( parentWidget()->width(), QToolBar::sizeHint().height() );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return QToolBar::sizeHint();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-06-28 15:14:07 +00:00
|
|
|
class MainWindow: public QMainWindow, public DataCommitter
|
2009-01-28 20:55:45 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2009-04-12 20:46:25 +00:00
|
|
|
MainWindow( Config::Class & cfg );
|
2009-02-06 17:04:11 +00:00
|
|
|
~MainWindow();
|
2009-01-28 20:55:45 +00:00
|
|
|
|
2010-06-28 15:14:07 +00:00
|
|
|
virtual void commitData( QSessionManager & );
|
|
|
|
|
2010-11-20 13:43:55 +00:00
|
|
|
public slots:
|
|
|
|
|
|
|
|
void messageFromAnotherInstanceReceived( QString const & );
|
2011-07-14 20:11:57 +00:00
|
|
|
void showStatusBarMessage ( QString const &, int, QPixmap const & );
|
2011-11-16 12:52:25 +00:00
|
|
|
void wordReceived( QString const & );
|
2012-09-16 10:19:47 +00:00
|
|
|
void setExpandMode( bool expand );
|
2010-11-20 13:43:55 +00:00
|
|
|
|
2009-01-28 20:55:45 +00:00
|
|
|
private:
|
|
|
|
|
2010-06-28 15:14:07 +00:00
|
|
|
void commitData();
|
|
|
|
bool commitDataCompleted;
|
|
|
|
|
2009-02-05 20:55:00 +00:00
|
|
|
QSystemTrayIcon * trayIcon;
|
|
|
|
|
2009-01-28 20:55:45 +00:00
|
|
|
Ui::MainWindow ui;
|
2009-04-20 14:13:39 +00:00
|
|
|
|
|
|
|
/// This widget is used as a title bar for the searchPane dock, and
|
|
|
|
/// incorporates the next three objects inside
|
|
|
|
QWidget searchPaneTitleBar;
|
|
|
|
QHBoxLayout searchPaneTitleBarLayout;
|
|
|
|
QLabel groupLabel;
|
2012-12-24 11:30:03 +00:00
|
|
|
GroupComboBox * groupList, * groupListInToolbar, * groupListInDock;
|
|
|
|
|
|
|
|
// Needed to be able to show/hide the group list in the toolbar, since hiding
|
|
|
|
// the list expilictily doesn't work, see docs for QToolBar::addWidget().
|
|
|
|
QAction * groupListToolBarAction;
|
2009-04-20 14:13:39 +00:00
|
|
|
|
2011-06-05 11:49:50 +00:00
|
|
|
QWidget dictsPaneTitleBar;
|
|
|
|
QHBoxLayout dictsPaneTitleBarLayout;
|
|
|
|
QLabel foundInDictsLabel;
|
|
|
|
|
2012-12-24 11:30:03 +00:00
|
|
|
TranslateBox * translateBox;
|
|
|
|
|
2010-07-02 11:19:02 +00:00
|
|
|
/// Fonts saved before words zooming is in effect, so it could be reset back.
|
|
|
|
QFont wordListDefaultFont, translateLineDefaultFont;
|
|
|
|
|
2011-06-29 19:12:46 +00:00
|
|
|
QAction escAction, f3Action, shiftF3Action, focusTranslateLineAction, addTabAction, closeCurrentTabAction,
|
2010-09-16 18:52:40 +00:00
|
|
|
closeAllTabAction, closeRestTabAction,
|
2011-06-26 11:53:28 +00:00
|
|
|
switchToNextTabAction, switchToPrevTabAction,
|
2012-09-16 10:19:47 +00:00
|
|
|
showDictBarNamesAction, useSmallIconsInToolbarsAction, toggleMenuBarAction, switchExpandModeAction;
|
2009-01-28 20:55:45 +00:00
|
|
|
QToolBar * navToolbar;
|
2011-06-27 18:54:15 +00:00
|
|
|
MainStatusBar * mainStatusBar;
|
2012-12-26 13:46:04 +00:00
|
|
|
QAction * navBack, * navForward, * navPronounce, * enableScanPopup;
|
2012-12-29 18:46:43 +00:00
|
|
|
QAction * beforeScanPopupSeparator, * afterScanPopupSeparator, * beforeOptionsSeparator;
|
2009-04-30 19:57:25 +00:00
|
|
|
QAction * zoomIn, * zoomOut, * zoomBase;
|
2010-07-02 11:19:02 +00:00
|
|
|
QAction * wordsZoomIn, * wordsZoomOut, * wordsZoomBase;
|
2009-02-08 20:20:02 +00:00
|
|
|
QMenu trayIconMenu;
|
2012-12-29 18:46:43 +00:00
|
|
|
QMenu * tabMenu;
|
|
|
|
QAction * menuButtonAction;
|
2011-11-02 23:37:50 +00:00
|
|
|
MRUQMenu *tabListMenu;
|
|
|
|
//List that contains indexes of tabs arranged in a most-recently-used order
|
|
|
|
QList<QWidget*> mruList;
|
2010-09-16 18:52:40 +00:00
|
|
|
QToolButton addTab, *tabListButton;
|
2009-04-12 20:46:25 +00:00
|
|
|
Config::Class & cfg;
|
2009-09-21 17:50:03 +00:00
|
|
|
Config::Events configEvents;
|
2009-10-21 19:37:07 +00:00
|
|
|
History history;
|
2009-09-21 17:50:03 +00:00
|
|
|
DictionaryBar dictionaryBar;
|
2009-01-28 20:55:45 +00:00
|
|
|
vector< sptr< Dictionary::Class > > dictionaries;
|
2009-09-23 18:44:38 +00:00
|
|
|
/// Here we store unmuted dictionaries when the dictionary bar is active
|
|
|
|
vector< sptr< Dictionary::Class > > dictionariesUnmuted;
|
2009-05-14 19:27:19 +00:00
|
|
|
Instances::Groups groupInstances;
|
2009-01-28 20:55:45 +00:00
|
|
|
ArticleMaker articleMaker;
|
|
|
|
ArticleNetworkAccessManager articleNetMgr;
|
2009-03-26 19:00:08 +00:00
|
|
|
QNetworkAccessManager dictNetMgr; // We give dictionaries a separate manager,
|
|
|
|
// since their requests can be destroyed
|
|
|
|
// in a separate thread
|
2009-01-28 20:55:45 +00:00
|
|
|
|
2012-12-24 11:30:03 +00:00
|
|
|
QListWidget * wordList;
|
|
|
|
QLineEdit * translateLine;
|
|
|
|
|
2009-01-29 19:16:25 +00:00
|
|
|
WordFinder wordFinder;
|
2009-01-28 20:55:45 +00:00
|
|
|
|
2009-02-01 00:08:08 +00:00
|
|
|
sptr< ScanPopup > scanPopup;
|
2009-01-28 20:55:45 +00:00
|
|
|
|
2009-04-21 18:27:26 +00:00
|
|
|
sptr< HotkeyWrapper > hotkeyWrapper;
|
2009-04-19 21:32:18 +00:00
|
|
|
|
2009-04-20 19:54:34 +00:00
|
|
|
QTimer newReleaseCheckTimer; // Countdown to a check for the new program
|
|
|
|
// release, if enabled
|
|
|
|
sptr< QNetworkReply > latestReleaseReply;
|
|
|
|
|
2009-11-11 09:40:32 +00:00
|
|
|
sptr< QPrinter > printer; // The printer we use for all printing operations
|
2010-09-16 18:52:40 +00:00
|
|
|
|
2012-11-25 11:37:57 +00:00
|
|
|
bool wordListSelChanged;
|
|
|
|
|
2009-11-11 09:40:32 +00:00
|
|
|
QPrinter & getPrinter(); // Creates a printer if it's not there and returns it
|
|
|
|
|
2009-05-16 18:04:21 +00:00
|
|
|
/// Applies the qt's stylesheet, given the style's name.
|
2012-12-10 14:14:13 +00:00
|
|
|
void applyQtStyleSheet( QString const & displayStyle, QString const & addonStyle );
|
2009-05-16 18:04:21 +00:00
|
|
|
|
2009-02-05 20:55:00 +00:00
|
|
|
/// Creates, destroys or otherwise updates tray icon, according to the
|
|
|
|
/// current configuration and situation.
|
|
|
|
void updateTrayIcon();
|
|
|
|
|
2013-01-01 23:05:29 +00:00
|
|
|
void wheelEvent( QWheelEvent * );
|
2009-02-05 20:55:00 +00:00
|
|
|
void closeEvent( QCloseEvent * );
|
|
|
|
|
2009-04-03 17:10:27 +00:00
|
|
|
void applyProxySettings();
|
2011-05-08 21:19:08 +00:00
|
|
|
void applyWebSettings();
|
2009-01-28 20:55:45 +00:00
|
|
|
void makeDictionaries();
|
|
|
|
void updateStatusLine();
|
|
|
|
void updateGroupList();
|
2009-09-21 17:50:03 +00:00
|
|
|
void updateDictionaryBar();
|
2009-02-01 00:08:08 +00:00
|
|
|
void makeScanPopup();
|
2009-01-28 20:55:45 +00:00
|
|
|
|
2009-03-26 19:00:08 +00:00
|
|
|
void updateMatchResults( bool finished );
|
|
|
|
|
2009-04-10 21:07:03 +00:00
|
|
|
void updatePronounceAvailability();
|
|
|
|
|
2011-06-05 11:49:50 +00:00
|
|
|
void updateFoundInDictsList();
|
|
|
|
|
2011-06-07 11:27:19 +00:00
|
|
|
void updateBackForwardButtons();
|
|
|
|
|
2011-06-25 07:53:45 +00:00
|
|
|
void updateWindowTitle();
|
|
|
|
|
2009-09-23 18:44:38 +00:00
|
|
|
/// Updates word search request and active article view in response to
|
|
|
|
/// muting or unmuting dictionaries, or showing/hiding dictionary bar.
|
|
|
|
void applyMutedDictionariesState();
|
|
|
|
|
2009-03-29 17:38:54 +00:00
|
|
|
virtual bool eventFilter( QObject *, QEvent * );
|
|
|
|
|
2009-01-28 20:55:45 +00:00
|
|
|
/// Returns the reference to dictionaries stored in the currently active
|
|
|
|
/// group, or to all dictionaries if there are no groups.
|
|
|
|
vector< sptr< Dictionary::Class > > const & getActiveDicts();
|
|
|
|
|
2009-04-20 12:25:26 +00:00
|
|
|
/// Brings the main window to front if it's not currently, or hides it
|
|
|
|
/// otherwise. The hiding part is omitted if onlyShow is true.
|
|
|
|
void toggleMainWindow( bool onlyShow = false );
|
|
|
|
|
2009-04-21 18:27:26 +00:00
|
|
|
/// Creates hotkeyWrapper and hooks the currently set keys for it
|
|
|
|
void installHotKeys();
|
|
|
|
|
2009-04-30 19:57:25 +00:00
|
|
|
void applyZoomFactor();
|
|
|
|
|
2009-07-31 11:40:54 +00:00
|
|
|
void mousePressEvent ( QMouseEvent * event );
|
|
|
|
|
2010-11-15 15:22:35 +00:00
|
|
|
void updateCurrentGroupProperty();
|
|
|
|
|
2011-06-07 08:26:49 +00:00
|
|
|
/// Handles backward and forward mouse buttons and
|
|
|
|
/// returns true if the event is handled.
|
|
|
|
bool handleBackForwardMouseButtons(QMouseEvent *ev);
|
2010-11-15 15:22:35 +00:00
|
|
|
|
2011-07-01 19:22:40 +00:00
|
|
|
ArticleView * getCurrentArticleView();
|
2011-11-02 23:37:50 +00:00
|
|
|
void ctrlTabPressed();
|
2011-07-01 19:22:40 +00:00
|
|
|
|
2012-09-10 16:23:58 +00:00
|
|
|
void fillWordListFromHistory();
|
|
|
|
|
2009-04-21 18:27:26 +00:00
|
|
|
private slots:
|
|
|
|
|
|
|
|
void hotKeyActivated( int );
|
|
|
|
|
2009-04-20 19:54:34 +00:00
|
|
|
/// If new release checks are on, santizies the next check time and starts
|
|
|
|
/// the timer. Does nothing otherwise.
|
|
|
|
void prepareNewReleaseChecks();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
/// Does the new release check.
|
|
|
|
void checkForNewRelease();
|
|
|
|
|
|
|
|
/// Signalled when the lastestReleaseReply is finished()
|
|
|
|
void latestReleaseReplyReady();
|
|
|
|
|
2012-09-19 12:44:36 +00:00
|
|
|
/// Receive click on "Found in:" pane
|
2012-09-24 12:51:51 +00:00
|
|
|
void foundDictsPaneClicked( QListWidgetItem * item );
|
|
|
|
|
|
|
|
/// Receive right click on "Found in:" pane
|
|
|
|
void foundDictsContextMenuRequested( const QPoint & pos );
|
2012-09-19 12:44:36 +00:00
|
|
|
|
2012-09-25 13:13:35 +00:00
|
|
|
void showDictionaryInfo( QString const & id );
|
|
|
|
|
2009-01-28 20:55:45 +00:00
|
|
|
private slots:
|
|
|
|
|
|
|
|
// Executed in response to a user click on an 'add tab' tool button
|
|
|
|
void addNewTab();
|
|
|
|
// Executed in response to a user click on an 'close' button on a tab
|
|
|
|
void tabCloseRequested( int );
|
2009-04-09 22:11:38 +00:00
|
|
|
// Closes current tab.
|
|
|
|
void closeCurrentTab();
|
2010-09-16 18:52:40 +00:00
|
|
|
void closeAllTabs();
|
|
|
|
void closeRestTabs();
|
2009-04-09 22:11:38 +00:00
|
|
|
void switchToNextTab();
|
|
|
|
void switchToPrevTab();
|
2011-11-02 23:37:50 +00:00
|
|
|
void ctrlReleased();
|
2009-01-28 20:55:45 +00:00
|
|
|
|
2012-09-16 10:19:47 +00:00
|
|
|
// Switch optional parts expand mode for current tab
|
|
|
|
void switchExpandOptionalPartsMode();
|
|
|
|
|
2010-09-16 18:52:40 +00:00
|
|
|
// Handling of active tab list
|
|
|
|
void createTabList();
|
|
|
|
void fillWindowsMenu();
|
|
|
|
void switchToWindow(QAction *act);
|
|
|
|
|
2009-01-28 20:55:45 +00:00
|
|
|
/// Triggered by the actions in the nav toolbar
|
|
|
|
void backClicked();
|
|
|
|
void forwardClicked();
|
|
|
|
|
|
|
|
/// ArticleView's title has changed
|
|
|
|
void titleChanged( ArticleView *, QString const & );
|
|
|
|
/// ArticleView's icon has changed
|
|
|
|
void iconChanged( ArticleView *, QIcon const & );
|
|
|
|
|
2009-05-14 19:27:19 +00:00
|
|
|
void pageLoaded( ArticleView * );
|
2009-04-10 21:07:03 +00:00
|
|
|
void tabSwitched( int );
|
2010-09-16 18:52:40 +00:00
|
|
|
void tabMenuRequested(QPoint pos);
|
2009-04-10 21:07:03 +00:00
|
|
|
|
2009-09-23 18:44:38 +00:00
|
|
|
void dictionaryBarToggled( bool checked );
|
|
|
|
|
2009-04-10 21:07:03 +00:00
|
|
|
/// Pronounces the currently displayed word by playing its first audio
|
|
|
|
/// reference, if it has any.
|
2009-05-14 19:27:19 +00:00
|
|
|
/// If view is 0, the operation is done for the currently open tab.
|
|
|
|
void pronounce( ArticleView * view = 0 );
|
2009-04-10 21:07:03 +00:00
|
|
|
|
2009-04-30 19:57:25 +00:00
|
|
|
void zoomin();
|
|
|
|
void zoomout();
|
|
|
|
void unzoom();
|
|
|
|
|
2010-07-02 11:19:02 +00:00
|
|
|
void doWordsZoomIn();
|
|
|
|
void doWordsZoomOut();
|
|
|
|
void doWordsZoomBase();
|
|
|
|
|
|
|
|
void applyWordsZoomLevel();
|
|
|
|
|
2010-05-08 14:01:59 +00:00
|
|
|
/// If editDictionaryGroup is specified, the dialog positions on that group
|
|
|
|
/// initially.
|
|
|
|
void editDictionaries( unsigned editDictionaryGroup = Instances::Group::NoGroupId );
|
|
|
|
/// Edits current group when triggered from the dictionary bar.
|
|
|
|
void editCurrentGroup();
|
2009-02-05 20:55:00 +00:00
|
|
|
void editPreferences();
|
2009-01-28 20:55:45 +00:00
|
|
|
|
2009-02-06 17:04:11 +00:00
|
|
|
void currentGroupChanged( QString const & );
|
2009-01-28 20:55:45 +00:00
|
|
|
void translateInputChanged( QString const & );
|
2012-09-03 12:42:43 +00:00
|
|
|
void translateInputFinished( bool checkModifiers = true );
|
2009-03-26 19:00:08 +00:00
|
|
|
|
2011-05-07 13:42:49 +00:00
|
|
|
/// Closes any opened search in the article view, and focuses the translateLine/close main window to tray.
|
2010-04-27 07:49:37 +00:00
|
|
|
void handleEsc();
|
|
|
|
|
2011-06-29 19:12:46 +00:00
|
|
|
/// Either triggers Edit Dictionaries menu option or perform a Find Next action.
|
|
|
|
void handleF3();
|
|
|
|
void handleShiftF3();
|
|
|
|
|
2009-04-12 22:36:47 +00:00
|
|
|
/// Gives the keyboard focus to the translateLine and selects all the text
|
|
|
|
/// it has.
|
|
|
|
void focusTranslateLine();
|
2009-04-08 22:25:46 +00:00
|
|
|
|
2009-03-26 19:00:08 +00:00
|
|
|
void prefixMatchUpdated();
|
|
|
|
void prefixMatchFinished();
|
2009-04-18 18:47:01 +00:00
|
|
|
|
2009-01-28 20:55:45 +00:00
|
|
|
void wordListItemActivated( QListWidgetItem * );
|
2009-02-08 14:02:27 +00:00
|
|
|
void wordListSelectionChanged();
|
2009-01-28 20:55:45 +00:00
|
|
|
|
2011-06-05 11:49:50 +00:00
|
|
|
void dictsListItemActivated( QListWidgetItem * );
|
|
|
|
void dictsListSelectionChanged();
|
|
|
|
|
2011-07-31 00:11:07 +00:00
|
|
|
void showDictsPane( );
|
2011-06-05 11:49:50 +00:00
|
|
|
void dictsPaneVisibilityChanged ( bool );
|
|
|
|
|
2009-04-13 12:51:25 +00:00
|
|
|
/// Creates a new tab, which is to be populated then with some content.
|
|
|
|
ArticleView * createNewTab( bool switchToIt,
|
|
|
|
QString const & name );
|
|
|
|
|
2009-05-29 19:48:50 +00:00
|
|
|
void openLinkInNewTab( QUrl const &, QUrl const &, QString const &,
|
|
|
|
ArticleView::Contexts const & contexts );
|
2009-05-11 19:14:28 +00:00
|
|
|
void showDefinitionInNewTab( QString const & word, unsigned group,
|
2009-05-29 19:48:50 +00:00
|
|
|
QString const & fromArticle,
|
|
|
|
ArticleView::Contexts const & contexts );
|
2009-05-12 13:25:18 +00:00
|
|
|
void typingEvent( QString const & );
|
2009-04-18 18:47:01 +00:00
|
|
|
|
2011-07-03 12:27:08 +00:00
|
|
|
void activeArticleChanged( QString const & id );
|
|
|
|
|
2009-09-23 18:44:38 +00:00
|
|
|
void mutedDictionariesChanged();
|
|
|
|
|
2009-10-21 20:06:17 +00:00
|
|
|
void showTranslationFor( QString const &, unsigned inGroup = 0 );
|
2009-02-05 20:55:00 +00:00
|
|
|
|
2013-01-17 09:08:53 +00:00
|
|
|
void showHistoryItem( QString const & );
|
|
|
|
|
2009-02-05 20:55:00 +00:00
|
|
|
void trayIconActivated( QSystemTrayIcon::ActivationReason );
|
2009-02-08 14:02:27 +00:00
|
|
|
|
2009-02-08 20:20:02 +00:00
|
|
|
void scanEnableToggled( bool );
|
|
|
|
|
2009-04-18 18:47:01 +00:00
|
|
|
void setAutostart( bool );
|
|
|
|
|
2009-02-08 20:20:02 +00:00
|
|
|
void showMainWindow();
|
2009-04-18 18:47:01 +00:00
|
|
|
|
2009-02-08 14:02:27 +00:00
|
|
|
void visitHomepage();
|
|
|
|
void visitForum();
|
2011-07-10 07:36:43 +00:00
|
|
|
void openConfigFolder();
|
2009-02-08 14:02:27 +00:00
|
|
|
void showAbout();
|
2009-04-18 18:47:01 +00:00
|
|
|
|
2009-10-12 12:41:20 +00:00
|
|
|
void showDictBarNamesTriggered();
|
2011-05-22 02:42:05 +00:00
|
|
|
void useSmallIconsInToolbarsTriggered();
|
2011-06-26 11:53:28 +00:00
|
|
|
void toggleMenuBarTriggered( bool announce = true );
|
2009-10-12 12:41:20 +00:00
|
|
|
|
2012-12-03 21:57:00 +00:00
|
|
|
void on_clearHistory_triggered();
|
2009-10-21 19:37:07 +00:00
|
|
|
|
2012-12-03 21:57:00 +00:00
|
|
|
void on_newTab_triggered();
|
2011-06-25 07:34:28 +00:00
|
|
|
|
2012-12-03 21:57:00 +00:00
|
|
|
void on_actionCloseToTray_triggered();
|
2010-09-16 18:52:40 +00:00
|
|
|
|
2012-12-03 21:57:00 +00:00
|
|
|
void on_pageSetup_triggered();
|
|
|
|
void on_printPreview_triggered();
|
|
|
|
void on_print_triggered();
|
2009-05-01 12:20:33 +00:00
|
|
|
void printPreviewPaintRequested( QPrinter * );
|
2010-09-16 18:52:40 +00:00
|
|
|
|
2012-12-03 21:57:00 +00:00
|
|
|
void on_saveArticle_triggered();
|
2009-05-08 10:47:34 +00:00
|
|
|
|
2012-12-03 21:57:00 +00:00
|
|
|
void on_rescanFiles_triggered();
|
2012-02-16 14:56:25 +00:00
|
|
|
|
2012-12-03 21:57:00 +00:00
|
|
|
void on_showHideHistory_triggered();
|
|
|
|
void on_exportHistory_triggered();
|
|
|
|
void on_importHistory_triggered();
|
2012-12-29 11:19:49 +00:00
|
|
|
void on_alwaysOnTop_triggered( bool checked );
|
2012-09-12 12:32:29 +00:00
|
|
|
void focusWordList();
|
2012-09-12 14:11:30 +00:00
|
|
|
|
2013-01-05 11:26:55 +00:00
|
|
|
void updateSearchPaneAndBar( bool searchInDock );
|
2012-12-24 11:30:03 +00:00
|
|
|
|
2013-01-17 09:08:53 +00:00
|
|
|
void updateHistoryMenu();
|
|
|
|
|
2012-11-12 13:52:54 +00:00
|
|
|
/// Add word to history
|
|
|
|
void addWordToHistory( const QString & word );
|
2012-09-12 14:11:30 +00:00
|
|
|
/// Add word to history even if history is disabled in options
|
|
|
|
void forceAddWordToHistory( const QString & word);
|
2012-09-16 10:19:47 +00:00
|
|
|
|
2012-11-26 13:13:13 +00:00
|
|
|
void sendWordToInputLine( QString const & word );
|
|
|
|
|
2012-09-16 10:19:47 +00:00
|
|
|
signals:
|
|
|
|
/// Set optional parts expand mode for all tabs
|
|
|
|
void setExpandOptionalParts( bool expand );
|
2012-09-18 23:01:31 +00:00
|
|
|
|
2012-09-19 12:44:36 +00:00
|
|
|
/// Retranslate Ctrl(Shift) + Click on dictionary pane to dictionary toolbar
|
|
|
|
void clickOnDictPane( QString const & id );
|
|
|
|
|
2012-09-18 23:01:31 +00:00
|
|
|
#ifdef Q_OS_WIN32
|
|
|
|
/// For receiving message from scan libraries
|
|
|
|
protected:
|
|
|
|
unsigned gdAskMessage;
|
|
|
|
bool winEvent( MSG * message, long * result );
|
2012-09-24 13:20:58 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
/// Return true while scanning GoldenDict window
|
|
|
|
bool isGoldenDictWindow( HWND hwnd );
|
2012-09-18 23:01:31 +00:00
|
|
|
#endif
|
2009-01-28 20:55:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|