void ClipboardDialog::init() { Q_ASSERT(!ui); ui = new Ui::ClipboardDialog; ui->setupUi(this); connect(ui->listWidgetFormats, &QListWidget::currentItemChanged, this, &ClipboardDialog::onListWidgetFormatsCurrentItemChanged); connect(ui->actionRemove_Format, &QAction::triggered, this, &ClipboardDialog::onActionRemoveFormatTriggered); setWindowIcon(appIcon()); ui->horizontalLayout->setStretchFactor(1, 1); ui->listWidgetFormats->setCurrentRow(0); WindowGeometryGuard::create(this); ui->actionRemove_Format->setIcon( getIcon("list-remove", IconTrash) ); ui->actionRemove_Format->setShortcut(shortcutToRemove()); ui->listWidgetFormats->addAction(ui->actionRemove_Format); onListWidgetFormatsCurrentItemChanged(nullptr, nullptr); }
void ClipboardDialog::init() { Q_ASSERT(!ui); ui = new Ui::ClipboardDialog; ui->setupUi(this); setWindowIcon( ConfigurationManager::instance()->iconFactory()->appIcon() ); ui->horizontalLayout->setStretchFactor(1, 1); ui->listWidgetFormats->setCurrentRow(0); ConfigurationManager::instance()->registerWindowGeometry(this); ui->actionRemove_Format->setIcon( getIcon("list-remove", IconRemove) ); ui->actionRemove_Format->setShortcut(shortcutToRemove()); ui->listWidgetFormats->addAction(ui->actionRemove_Format); }
void ClipboardDialog::init() { Q_ASSERT(!ui); ui = new Ui::ClipboardDialog; ui->setupUi(this); setWindowIcon(appIcon()); ui->horizontalLayout->setStretchFactor(1, 1); ui->listWidgetFormats->setCurrentRow(0); WindowGeometryGuard::create(this); ui->actionRemove_Format->setIcon( getIcon("list-remove", IconRemove) ); ui->actionRemove_Format->setShortcut(shortcutToRemove()); ui->listWidgetFormats->addAction(ui->actionRemove_Format); on_listWidgetFormats_currentItemChanged(NULL, NULL); }
void ConfigTabShortcuts::initShortcuts() { ShortcutsWidget *w = ui->shortcutsWidgetGeneral; w->addAction( Actions::File_New, tr("&New Item"), "new", QKeySequence::New ); w->addAction( Actions::File_ImportTab, tr("&Import Tab..."), "import_tab", tr("Ctrl+I") ); w->addAction( Actions::File_ExportTab, tr("&Export Tab..."), "export_tab", QKeySequence::Save ); w->addAction( Actions::File_Preferences, tr("&Preferences..."), "preferences", tr("Ctrl+P") ); w->addAction( Actions::File_ShowClipboardContent, tr("Show &Clipboard Content"), "show_clipboard_content", tr("Ctrl+Shift+C") ); w->addAction( Actions::File_ToggleClipboardStoring, tr("&Toggle Clipboard Storing"), "toggle_clipboard_storing", tr("Ctrl+Shift+X") ); w->addAction( Actions::File_ProcessManager, tr("P&rocess Manager"), "process_manager", tr("Ctrl+Shift+Z") ); w->addAction( Actions::File_Exit, tr("E&xit"), "exit", tr("Ctrl+Q") ); w->addAction( Actions::Edit_SortSelectedItems, tr("&Sort Selected Items"), "sort_selected_items", tr("Ctrl+Shift+S") ); w->addAction( Actions::Edit_ReverseSelectedItems, tr("&Reverse Selected Items"), "reverse_selected_items", tr("Ctrl+Shift+R") ); w->addAction( Actions::Edit_PasteItems, tr("&Paste Items"), "paste_selected_items", QKeySequence::Paste ); w->addAction( Actions::Edit_CopySelectedItems, tr("&Copy Selected Items"), "copy_selected_items", QKeySequence::Copy ); w->addAction( Actions::Item_MoveToClipboard, tr("Move to &Clipboard"), "move_to_clipboard" ); w->addAction( Actions::Item_ShowContent, tr("&Show Content..."), "show_item_content", tr("F4") ); w->addAction( Actions::Item_Edit, tr("&Edit"), "edit", tr("F2") ); w->addAction( Actions::Item_EditNotes, tr("&Edit Notes"), "edit_notes", tr("Shift+F2") ); w->addAction( Actions::Item_EditWithEditor, tr("E&dit with editor"), "editor", tr("Ctrl+E") ); w->addAction( Actions::Item_Action, tr("&Action..."), "action", tr("F5") ); w->addAction( Actions::Item_NextToClipboard, tr("&Next to Clipboard"), "next_to_clipboard", tr("Ctrl+Shift+N") ); w->addAction( Actions::Item_PreviousToClipboard, tr("&Previous to Clipboard"), "previous_to_clipboard", tr("Ctrl+Shift+P") ); w->addAction( Actions::Item_Remove, tr("&Remove"), "delete_item", shortcutToRemove() ); w->addAction( Actions::Tabs_NewTab, tr("&New Tab"), "new_tab", tr("Ctrl+T") ); w->addAction( Actions::Tabs_RenameTab, tr("Re&name Tab"), "rename_tab", tr("Ctrl+F2") ); w->addAction( Actions::Tabs_RemoveTab, tr("Re&move Tab"), "remove_tab", tr("Ctrl+W") ); w->addAction( Actions::Tabs_ChangeTabIcon, tr("&Change Tab Icon"), "change_tab_icon", tr("Ctrl+Shift+T") ); w->addAction( Actions::Help_Help, tr("&Help"), "help", QKeySequence::HelpContents ); }
ClipboardDialog::ClipboardDialog(const ClipboardItemPtr &item, QWidget *parent) : QDialog(parent) , ui(new Ui::ClipboardDialog) , m_item(item) { ui->setupUi(this); setWindowIcon( ConfigurationManager::instance()->iconFactory()->appIcon() ); QVariantMap data; if ( m_item.isNull() ) { const QMimeData *clipData = clipboardData(); if (clipData) data = cloneData(*clipData); } else { setWindowTitle( tr("CopyQ Item Content") ); data = item->data(); } // Show only data that can be displayed. foreach ( const QString &mime, data.keys() ) { if ( data[mime].canConvert<QByteArray>() && mime != mimeOwner ) { m_data.insert(mime, data[mime]); ui->listWidgetFormats->addItem(mime); } } ui->horizontalLayout->setStretchFactor(1, 1); ui->listWidgetFormats->setCurrentRow(0); ConfigurationManager::instance()->registerWindowGeometry(this); ui->actionRemove_Format->setIcon( getIcon("list-remove", IconRemove) ); ui->actionRemove_Format->setShortcut(shortcutToRemove()); ui->listWidgetFormats->addAction(ui->actionRemove_Format); }
QString AboutDialog::aboutPage() { return "<html>" // CSS "<head><style type=\"text/css\">" "body{font-size:10pt;background:white;color:#333;margin:1.5em}" "p, li{white-space:pre-wrap;margin-left:1ex}" "a{text-decoration:none}" ".h1{font-size:26pt;color:#666;white-space:pre}" ".h1x{font-size:16pt;color:#888;white-space:pre}" ".h2{width:100%;font-size:16pt;margin-left:1ex;margin-top:0.2em}" ".h2x{font-size:12pt}" ".h3{font-size:9pt;color:#666}" ".links td{padding:0}" ".link{font-size:9pt}" ".pp{margin-left:4ex}" ".ppp{margin-left:4ex;font-size:9pt}" "table{border:0}" ".odd {background:#def}" "td{padding:0.1em}" "#keys{margin-left:4ex}" ".key{font-family:monospace;font-size:9pt;padding-left:0.5em}" ".logo{float:left}" ".info{font-size:9pt}" "</style></head>" "<body>" // logo "<img class='logo' src=':/images/logo.png' />" // title "<div class='h1'>CopyQ</div>" // subtitle "<div class=\"h1x\">" + escapeHtml(tr("Clipboard Manager")) + " " COPYQ_VERSION "</div>" "<p>" "<table class='links'>" + helpLink( tr("Author"), QString::fromUtf8("Lukáš Holeček") ) + helpLink( tr("E-mail"), helpMail("*****@*****.**") ) + helpLink( tr("Web"), helpUrl("https://hluk.github.io/CopyQ/") ) + helpLink( tr("Wiki"), helpUrl("https://github.com/hluk/CopyQ/wiki") ) + helpLink( tr("Donate"), helpUrl("https://www.bountysource.com/teams/copyq") ) + "</table>" "</p>" // copyright "<p class='info'>Copyright (c) 2009 - 2016</p>" "<p></p>" + helpTitle(tr("Development")) + "<p class=\"pp\">" // developers + helpDeveloper("Adam Batkin", "*****@*****.**") + helpDeveloper("Giacomo Margarito", "*****@*****.**") + helpDeveloper("Greg Carp", "*****@*****.**") + helpDeveloper("Ilya Plenne", "*****@*****.**") + helpDeveloper("Jörg Thalheim", "*****@*****.**") + helpDeveloper("Kim Jzhone", "*****@*****.**") + helpDeveloper("Kos Ivantsov", "*****@*****.**") + helpDeveloper("lightonflux", "*****@*****.**") + helpDeveloper("Lukas Holecek", "*****@*****.**") + helpDeveloper("Marjolein Hoekstra", "http://twitter.com/cleverclogs") + helpDeveloper("Martin Lepadusch", "*****@*****.**") + helpDeveloper("Matt d'Entremont", "*****@*****.**") + helpDeveloper("Michal Čihař", "*****@*****.**") + helpDeveloper("Patricio M. Ros", "*****@*****.**") + helpDeveloper("Ryan Wooden", "*****@*****.**") + helpDeveloper("Scott Kostyshak", "*****@*****.**") + helpDeveloper("Sebastian Schuberth", "*****@*****.**") + helpDeveloper("Tomas Nilzon", "*****@*****.**") + helpDeveloper("Wilfried Caruel", "*****@*****.**") + helpDeveloper("x2357", "*****@*****.**") + "</p>" // libraries + helpLib("Qt", tr("Library used in the application", "Qt library description"), "Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies)", "https://www.qt.io/") + helpLib("Weblate", tr("Free web-based translation management system", "Weblate description"), "Copyright (c) 2012 - 2013 Michal Čihař", "https://weblate.org") + helpLib("Font Awesome", tr("Iconic font used in the application", "Font Awesome description"), "Created & Maintained by Dave Gandy", "https://fortawesome.github.io/Font-Awesome/") + helpLib("LibQxt", tr("Library used in the application", "LibQxt library description"), "Copyright (c) 2006 - 2011, the LibQxt project", "http://libqxt.org") + helpLib("Solarized", tr("Color palette used for themes", "Solarized palette/themes description"), "Copyright (c) 2011 Ethan Schoonover", "http://ethanschoonover.com/solarized") // keyboard title + helpTitle(tr("Keyboard")) + helpParagraph(tr("Application shortcuts can be changed in Preferences dialog.")) #ifndef NO_GLOBAL_SHORTCUTS + helpParagraph(tr("Global shortcuts (system-wide shortcuts) can be set in Command dialog (default shortcut is F6).")) #endif + helpParagraph(tr("Type any text to search the clipboard history.")) // keyboard table + "<p><table id=\"keys\">" + helpKeys( tr("Item list navigation"), tr("Up/Down, Page Up/Down, Home/End") ) + helpKeys( tr("Tab navigation"), tr("Left, Right, %1, %2", "Keys for tab navigation (%1, %2 are the standard keys).") .arg(QKeySequence(QKeySequence::NextChild).toString(QKeySequence::NativeText)) .arg(QKeySequence(QKeySequence::PreviousChild).toString(QKeySequence::NativeText)) ) + helpKeys( tr("Move selected items"), tr("Ctrl+Up/Down, Ctrl+Home/End") ) + helpKeys( tr("Reset search or hide window"), tr("Escape") ) + helpKeys( tr("Delete item"), shortcutToRemove() ) + helpKeys( tr("Put selected items into clipboard"), tr("Enter") ) + helpKeys( tr("Change item display format"), tr("Ctrl+Left/Right") ) + helpKeys( tr("Edit Item"), tr("F2") ) + "</table></p>" + "<p></p>" "</body></html>"; }
MenuItems menuItems() { MenuItems items; addMenuItem( items, Actions::File_New, QObject::tr("&New Item"), "new", QKeySequence::New, "document-new", IconFileAlt ); addMenuItem( items, Actions::File_Import, QObject::tr("&Import..."), "import", QObject::tr("Ctrl+I"), "document-open", IconFolderOpen ); addMenuItem( items, Actions::File_Export, QObject::tr("&Export..."), "export", QKeySequence::Save, "document-save", IconSave ); addMenuItem( items, Actions::File_Preferences, QObject::tr("&Preferences..."), "preferences", QObject::tr("Ctrl+P"), "preferences-other", IconWrench ); addMenuItem( items, Actions::File_Commands, #ifndef NO_GLOBAL_SHORTCUTS QObject::tr("C&ommands/Global Shortcuts..."), #else QObject::tr("C&ommands..."), #endif "commands", QObject::tr("F6"), "system-run", IconCog ); addMenuItem( items, Actions::File_ShowClipboardContent, QObject::tr("Show &Clipboard Content"), "show_clipboard_content", QObject::tr("Ctrl+Shift+C"), "dialog-information", IconPaste ); addMenuItem( items, Actions::File_ToggleClipboardStoring, QObject::tr("&Toggle Clipboard Storing"), "toggle_clipboard_storing", QObject::tr("Ctrl+Shift+X"), "" ); addMenuItem( items, Actions::File_ProcessManager, QObject::tr("P&rocess Manager"), "process_manager", QObject::tr("Ctrl+Shift+Z"), "system-search", IconCogs ); addMenuItem( items, Actions::File_Exit, QObject::tr("E&xit"), "exit", QObject::tr("Ctrl+Q"), "application-exit", IconPowerOff ); addMenuItem( items, Actions::Edit_SortSelectedItems, QObject::tr("&Sort Selected Items"), "sort_selected_items", QObject::tr("Ctrl+Shift+S"), "view-sort-ascending", IconSortAlphaDown ); addMenuItem( items, Actions::Edit_ReverseSelectedItems, QObject::tr("&Reverse Selected Items"), "reverse_selected_items", QObject::tr("Ctrl+Shift+R"), "view-sort-descending", IconSortAlphaUp ); addMenuItem( items, Actions::Edit_PasteItems, QObject::tr("&Paste Items"), "paste_selected_items", QKeySequence::Paste, "edit-paste", IconPaste ); addMenuItem( items, Actions::Edit_CopySelectedItems, QObject::tr("&Copy Selected Items"), "copy_selected_items", QKeySequence::Copy, "edit-copy", IconCopy ); addMenuItem( items, Actions::Edit_FindItems, QObject::tr("&Find"), "find_items", QKeySequence::FindNext, "edit-find", IconSearch ); addMenuItem( items, Actions::Item_MoveToClipboard, QObject::tr("Move to &Clipboard"), "move_to_clipboard", QKeySequence(), "clipboard", IconPaste ); addMenuItem( items, Actions::Item_ShowContent, QObject::tr("&Show Content..."), "show_item_content", QObject::tr("F4"), "dialog-information", IconInfoCircle ); addMenuItem( items, Actions::Item_ShowPreview, QObject::tr("&Show Preview"), "show_item_preview", QObject::tr("F7"), "document-print-preview", IconEye ); addMenuItem( items, Actions::Item_Remove, QObject::tr("&Remove"), "delete_item", shortcutToRemove(), "list-remove", IconTrash ); addMenuItem( items, Actions::Item_Edit, QObject::tr("&Edit"), "edit", QObject::tr("F2"), "accessories-text-editor", IconEdit ); addMenuItem( items, Actions::Item_EditNotes, QObject::tr("Edit &Notes"), "edit_notes", QObject::tr("Shift+F2"), "accessories-text-editor", IconPenSquare ); addMenuItem( items, Actions::Item_EditWithEditor, QObject::tr("E&dit with editor"), "editor", QObject::tr("Ctrl+E"), "accessories-text-editor", IconPencilAlt ); addMenuItem( items, Actions::Item_Action, QObject::tr("&Action..."), "system-run", QObject::tr("F5"), "action", IconBolt ); addMenuItem( items, Actions::Item_NextFormat, QObject::tr("Next Format"), "format-next", QObject::tr("Ctrl+Right"), "go-next", IconArrowRight ); addMenuItem( items, Actions::Item_PreviousFormat, QObject::tr("Previous Format"), "format-previous", QObject::tr("Ctrl+Left"), "go-previous", IconArrowLeft ); addMenuItem( items, Actions::Item_MoveUp, QObject::tr("Move Up"), "move_up", QObject::tr("Ctrl+Up"), "go-up", IconAngleUp ); addMenuItem( items, Actions::Item_MoveDown, QObject::tr("Move Down"), "move_down", QObject::tr("Ctrl+Down"), "go-down", IconAngleDown ); addMenuItem( items, Actions::Item_MoveToTop, QObject::tr("Move to Top"), "move_to_top", QObject::tr("Ctrl+Home"), "go-top", IconAngleDoubleUp ); addMenuItem( items, Actions::Item_MoveToBottom, QObject::tr("Move to Bottom"), "move_to_bottom", QObject::tr("Ctrl+End"), "go-bottom", IconAngleDoubleDown ); addMenuItem( items, Actions::Tabs_NewTab, QObject::tr("&New Tab"), "new_tab", QObject::tr("Ctrl+T"), ":/images/tab_new" ); addMenuItem( items, Actions::Tabs_RenameTab, QObject::tr("R&ename Tab"), "rename_tab", QObject::tr("Ctrl+F2"), ":/images/tab_rename" ); addMenuItem( items, Actions::Tabs_RemoveTab, QObject::tr("Re&move Tab"), "remove_tab", QObject::tr("Ctrl+W"), ":/images/tab_remove" ); addMenuItem( items, Actions::Tabs_ChangeTabIcon, QObject::tr("&Change Tab Icon"), "change_tab_icon", QObject::tr("Ctrl+Shift+T"), ":/images/tab_icon" ); addMenuItem( items, Actions::Tabs_NextTab, QObject::tr("Ne&xt Tab"), "next_tab", QObject::tr("Right", "Default shortcut to focus next tab"), "go-next", IconArrowRight ); addMenuItem( items, Actions::Tabs_PreviousTab, QObject::tr("&Previous Tab"), "previous_tab", QObject::tr("Left", "Default shortcut to focus previous tab"), "go-previous", IconArrowLeft ); addMenuItem( items, Actions::Help_Help, QObject::tr("&Help"), "help", QKeySequence::HelpContents, "help-contents", IconQuestionCircle ); addMenuItem( items, Actions::Help_ShowLog, QObject::tr("&Show Log"), "show-log", QObject::tr("F12"), "help-about", IconExclamationCircle ); addMenuItem( items, Actions::Help_About, QObject::tr("&About"), "about", QKeySequence::WhatsThis, "help-about", IconInfoCircle ); addMenuItem( items, Actions::ItemMenu, QObject::tr("Open Item Context Menu"), "item-menu", QObject::tr("Shift+F10", "Default shortcut to open item context menu"), "", IconListAlt ); return items; }
void ConfigTabShortcuts::initShortcuts() { ShortcutsWidget *w = ui->shortcutsWidgetGeneral; w->addAction( Actions::File_New, tr("&New Item"), "new", QKeySequence::New, "document-new", IconFileAlt ); w->addAction( Actions::File_ImportTab, tr("&Import Tab..."), "import_tab", tr("Ctrl+I"), "document-open", IconFolderOpen ); w->addAction( Actions::File_ExportTab, tr("&Export Tab..."), "export_tab", QKeySequence::Save, "document-save", IconSave ); w->addAction( Actions::File_Preferences, tr("&Preferences..."), "preferences", tr("Ctrl+P"), "preferences-other", IconWrench ); w->addAction( Actions::File_Commands, #ifndef NO_GLOBAL_SHORTCUTS tr("C&ommands/Global Shortcuts..."), #else tr("C&ommands..."), #endif "commands", tr("F6"), "system-run", IconCog ); w->addAction( Actions::File_ShowClipboardContent, tr("Show &Clipboard Content"), "show_clipboard_content", tr("Ctrl+Shift+C"), "dialog-information", IconPaste ); w->addAction( Actions::File_ToggleClipboardStoring, tr("&Toggle Clipboard Storing"), "toggle_clipboard_storing", tr("Ctrl+Shift+X"), "" ); w->addAction( Actions::File_ProcessManager, tr("P&rocess Manager"), "process_manager", tr("Ctrl+Shift+Z"), "system-search", IconCogs ); w->addAction( Actions::File_Exit, tr("E&xit"), "exit", tr("Ctrl+Q"), "application-exit", IconOff ); w->addAction( Actions::Edit_SortSelectedItems, tr("&Sort Selected Items"), "sort_selected_items", tr("Ctrl+Shift+S"), "view-sort-ascending", IconSortByAlphabet ); w->addAction( Actions::Edit_ReverseSelectedItems, tr("&Reverse Selected Items"), "reverse_selected_items", tr("Ctrl+Shift+R"), "view-sort-descending", IconSortByAlphabetAlt ); w->addAction( Actions::Edit_PasteItems, tr("&Paste Items"), "paste_selected_items", QKeySequence::Paste, "edit-paste", IconPaste ); w->addAction( Actions::Edit_CopySelectedItems, tr("&Copy Selected Items"), "copy_selected_items", QKeySequence::Copy, "edit-copy", IconCopy ); w->addAction( Actions::Edit_FindItems, tr("&Find"), "find_items", QKeySequence::FindNext, "edit-find", IconSearch ); w->addAction( Actions::Item_MoveToClipboard, tr("Move to &Clipboard"), "move_to_clipboard", QKeySequence(), "clipboard", IconPaste ); w->addAction( Actions::Item_ShowContent, tr("&Show Content..."), "show_item_content", tr("F4"), "dialog-information", IconInfoSign ); w->addAction( Actions::Item_Edit, tr("&Edit"), "edit", tr("F2"), "accessories-text-editor", IconEdit ); w->addAction( Actions::Item_EditNotes, tr("Edit &Notes"), "edit_notes", tr("Shift+F2"), "accessories-text-editor", IconEditSign ); w->addAction( Actions::Item_EditWithEditor, tr("E&dit with editor"), "editor", tr("Ctrl+E"), "accessories-text-editor", IconPencil ); w->addAction( Actions::Item_Action, tr("&Action..."), "system-run", tr("F5"), "action", IconCog ); w->addAction( Actions::Item_Remove, tr("&Remove"), "delete_item", shortcutToRemove(), "list-remove", IconRemove ); w->addAction( Actions::Tabs_NewTab, tr("&New Tab"), "new_tab", tr("Ctrl+T"), ":/images/tab_new" ); w->addAction( Actions::Tabs_RenameTab, tr("R&ename Tab"), "rename_tab", tr("Ctrl+F2"), ":/images/tab_rename" ); w->addAction( Actions::Tabs_RemoveTab, tr("Re&move Tab"), "remove_tab", tr("Ctrl+W"), ":/images/tab_remove" ); w->addAction( Actions::Tabs_ChangeTabIcon, tr("&Change Tab Icon"), "change_tab_icon", tr("Ctrl+Shift+T"), ":/images/tab_icon" ); w->addAction( Actions::Help_Help, tr("&Help"), "help", QKeySequence::HelpContents, "help-about", IconQuestionSign ); }