Compare commits
48
Commits
v1.1.1
...
Export_Import
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eddf2b0339 | ||
|
|
702459918b | ||
|
|
9c419b1f2e | ||
|
|
0786489924 | ||
|
|
9cc34df185 | ||
|
|
d5adcdf988 | ||
|
|
837c0e1a17 | ||
|
|
d458f43b63 | ||
|
|
be655902b4 | ||
|
|
f9332befb3 | ||
|
|
66728df978 | ||
|
|
60dc85c2fc | ||
|
|
4b4eb623b9 | ||
|
|
d2c98bf559 | ||
|
|
9a31503996 | ||
|
|
cb4622f61f | ||
|
|
1ce1091eca | ||
|
|
4546eef1e3 | ||
|
|
1d8f24ced2 | ||
|
|
19a61ba517 | ||
|
|
2b377e35f1 | ||
|
|
f5011630a3 | ||
|
|
8967a84f12 | ||
|
|
38bed5e4eb | ||
|
|
5370ecedd8 | ||
|
|
0e8cd5cefc | ||
|
|
e3c3649b0f | ||
|
|
19f953fa54 | ||
|
|
ad1b5e35c7 | ||
|
|
ff2eb0fef6 | ||
|
|
d356c14f87 | ||
|
|
829cbf890b | ||
|
|
5ae52d4b4f | ||
|
|
4608c6b7ee | ||
|
|
7c7a818ca0 | ||
|
|
08c6d44185 | ||
|
|
dc8495b147 | ||
|
|
e2f5765a87 | ||
|
|
0086df54f0 | ||
|
|
ddc0c910c8 | ||
|
|
31f74baef7 | ||
|
|
8cd4f50304 | ||
|
|
48f6abb361 | ||
|
|
47039d8685 | ||
|
|
bc9aded3b7 | ||
|
|
f919544d1e | ||
|
|
ea49d0508a | ||
|
|
578447ecc3 |
@@ -30,14 +30,11 @@
|
||||
|
||||
#include "robomongo/gui/widgets/LogWidget.h"
|
||||
#include "robomongo/gui/widgets/explorer/ExplorerWidget.h"
|
||||
#include "robomongo/gui/widgets/explorer/ExplorerCollectionTreeItem.h"
|
||||
#include "robomongo/gui/widgets/explorer/ExplorerTreeWidget.h"
|
||||
#include "robomongo/gui/widgets/workarea/WorkAreaTabWidget.h"
|
||||
#include "robomongo/gui/widgets/workarea/QueryWidget.h"
|
||||
#include "robomongo/gui/dialogs/ConnectionsDialog.h"
|
||||
#include "robomongo/gui/dialogs/AboutDialog.h"
|
||||
#include "robomongo/gui/dialogs/PreferencesDialog.h"
|
||||
#include "robomongo/gui/dialogs/ExportDialog.h"
|
||||
#include "robomongo/gui/GuiRegistry.h"
|
||||
#include "robomongo/gui/AppStyle.h"
|
||||
|
||||
@@ -98,12 +95,10 @@ namespace Robomongo
|
||||
|
||||
MainWindow::MainWindow()
|
||||
: BaseClass(),
|
||||
_logDock(nullptr), _workArea(nullptr), _explorer(nullptr), _app(AppRegistry::instance().app()),
|
||||
_connectionsMenu(nullptr), _connectButton(nullptr), _viewMenu(nullptr), _toolbarsMenu(nullptr),
|
||||
_connectAction(nullptr), _openAction(nullptr), _saveAction(nullptr), _saveAsAction(nullptr),
|
||||
_executeAction(nullptr), _stopAction(nullptr), _orientationAction(nullptr), _execToolBar(nullptr),
|
||||
_exportAction(nullptr), _importAction(nullptr)
|
||||
{
|
||||
_app(AppRegistry::instance().app()),
|
||||
_workArea(NULL),
|
||||
_connectionsMenu(NULL)
|
||||
{
|
||||
QColor background = palette().window().color();
|
||||
QString controlKey = "Ctrl";
|
||||
|
||||
@@ -498,26 +493,6 @@ namespace Robomongo
|
||||
_toolbarsMenu->addAction(_execToolBar->toggleViewAction());
|
||||
VERIFY(connect(_execToolBar->toggleViewAction(), SIGNAL(triggered(bool)), this, SLOT(onExecToolbarVisibilityChanged(bool))));
|
||||
|
||||
// Export/Import Toolbar
|
||||
auto expImpToolBar = new QToolBar(tr("Export/Import Toolbar"), this);
|
||||
expImpToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
|
||||
expImpToolBar->setMovable(false);
|
||||
// Add export action
|
||||
_exportAction = new QAction(this);
|
||||
_exportAction->setData("Export");
|
||||
_exportAction->setIcon(GuiRegistry::instance().exportIcon());
|
||||
_exportAction->setDisabled(true);
|
||||
VERIFY(connect(_exportAction, SIGNAL(triggered()), this, SLOT(openExportDialog())));
|
||||
addToolBar(expImpToolBar);
|
||||
expImpToolBar->addAction(_exportAction);
|
||||
// Add import action
|
||||
_importAction = new QAction(this);
|
||||
_importAction->setData("Import");
|
||||
_importAction->setIcon(GuiRegistry::instance().importIcon());
|
||||
_importAction->setDisabled(true);
|
||||
addToolBar(expImpToolBar);
|
||||
expImpToolBar->addAction(_importAction);
|
||||
|
||||
createTabs();
|
||||
createStatusBar();
|
||||
setWindowTitle(PROJECT_NAME_TITLE " " PROJECT_VERSION);
|
||||
@@ -601,6 +576,8 @@ namespace Robomongo
|
||||
if (settings.contains("MainWindow/geometry"))
|
||||
{
|
||||
restoreGeometry(settings.value("MainWindow/geometry").toByteArray());
|
||||
restoreState(settings.value("MainWindow/windowState").toByteArray());
|
||||
settings.setValue("windowState", saveState());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -623,6 +600,7 @@ namespace Robomongo
|
||||
{
|
||||
QSettings settings("Paralect", "Robomongo");
|
||||
settings.setValue("MainWindow/geometry", saveGeometry());
|
||||
settings.setValue("MainWindow/windowState", saveState());
|
||||
}
|
||||
|
||||
void MainWindow::open()
|
||||
@@ -866,16 +844,6 @@ namespace Robomongo
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
void MainWindow::openExportDialog()
|
||||
{
|
||||
auto selectedItem = dynamic_cast<ExplorerCollectionTreeItem*>(_explorer->getSelectedTreeItem());
|
||||
auto dbName = QString::fromStdString(selectedItem->collection()->database()->name());
|
||||
auto collName = QString::fromStdString(selectedItem->collection()->name());
|
||||
|
||||
auto dialog = new ExportDialog(dbName, collName, this);
|
||||
dialog->show(); // show it mode-less so that user can perform multiple simultaneous exports
|
||||
}
|
||||
|
||||
void MainWindow::setDefaultUuidEncoding()
|
||||
{
|
||||
AppRegistry::instance().settingsManager()->setUuidEncoding(DefaultEncoding);
|
||||
@@ -1015,14 +983,14 @@ namespace Robomongo
|
||||
|
||||
void MainWindow::createDatabaseExplorer()
|
||||
{
|
||||
_explorer = new ExplorerWidget(this);
|
||||
AppRegistry::instance().bus()->subscribe(_explorer, ConnectingEvent::Type);
|
||||
AppRegistry::instance().bus()->subscribe(_explorer, ConnectionFailedEvent::Type);
|
||||
AppRegistry::instance().bus()->subscribe(_explorer, ConnectionEstablishedEvent::Type);
|
||||
ExplorerWidget *explorer = new ExplorerWidget(this);
|
||||
AppRegistry::instance().bus()->subscribe(explorer, ConnectingEvent::Type);
|
||||
AppRegistry::instance().bus()->subscribe(explorer, ConnectionFailedEvent::Type);
|
||||
AppRegistry::instance().bus()->subscribe(explorer, ConnectionEstablishedEvent::Type);
|
||||
|
||||
QDockWidget *explorerDock = new QDockWidget(tr("Database Explorer"));
|
||||
explorerDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
||||
explorerDock->setWidget(_explorer);
|
||||
explorerDock->setWidget(explorer);
|
||||
explorerDock->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable);
|
||||
|
||||
QWidget *titleWidget = new QWidget(this); // this lines simply remove
|
||||
@@ -1112,15 +1080,4 @@ namespace Robomongo
|
||||
AppRegistry::instance().settingsManager()->setToolbarSettings("explorer", isVisible);
|
||||
AppRegistry::instance().settingsManager()->save();
|
||||
}
|
||||
|
||||
void MainWindow::onExplorerItemSelected(QTreeWidgetItem *selectedItem)
|
||||
{
|
||||
auto collectionItem = dynamic_cast<ExplorerCollectionTreeItem*>(selectedItem);
|
||||
if (collectionItem) {
|
||||
_exportAction->setEnabled(true);
|
||||
}
|
||||
else {
|
||||
_exportAction->setDisabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ class QLabel;
|
||||
class QToolBar;
|
||||
class QDockWidget;
|
||||
class QToolButton;
|
||||
class QTreeWidgetItem;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Robomongo
|
||||
@@ -20,7 +19,6 @@ namespace Robomongo
|
||||
class WorkAreaTabWidget;
|
||||
class ConnectionMenu;
|
||||
class App;
|
||||
class ExplorerWidget;
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
@@ -80,13 +78,11 @@ namespace Robomongo
|
||||
void setUtcTimeZone();
|
||||
void setLocalTimeZone();
|
||||
void openPreferences();
|
||||
void openExportDialog();
|
||||
|
||||
|
||||
void onConnectToolbarVisibilityChanged(bool isVisisble);
|
||||
void onOpenSaveToolbarVisibilityChanged(bool isVisisble);
|
||||
void onExecToolbarVisibilityChanged(bool isVisisble);
|
||||
void onExplorerVisibilityChanged(bool isVisisble);
|
||||
void onExplorerItemSelected(QTreeWidgetItem *selectedItem);
|
||||
|
||||
private:
|
||||
void updateConnectionsMenu();
|
||||
@@ -101,8 +97,6 @@ namespace Robomongo
|
||||
|
||||
WorkAreaTabWidget *_workArea;
|
||||
|
||||
ExplorerWidget* _explorer;
|
||||
|
||||
App *_app;
|
||||
|
||||
ConnectionMenu *_connectionsMenu;
|
||||
@@ -110,18 +104,14 @@ namespace Robomongo
|
||||
QMenu *_viewMenu;
|
||||
QMenu *_toolbarsMenu;
|
||||
QAction *_connectAction;
|
||||
// Open/Save tool bar
|
||||
QAction *_openAction;
|
||||
QAction *_saveAction;
|
||||
QAction *_saveAsAction;
|
||||
// Execution tool bar
|
||||
QAction *_executeAction;
|
||||
QAction *_stopAction;
|
||||
QAction *_orientationAction;
|
||||
QToolBar *_execToolBar;
|
||||
// Export/import tool bar
|
||||
QAction *_exportAction;
|
||||
QAction *_importAction;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user